* { box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    margin: 0;
    padding: 16px;
    background: #f4f5f7;
    color: #1a1a1a;
    max-width: 900px;
    margin-inline: auto;
}
header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    gap: 8px;
}
header h1 { margin: 0; font-size: 1.4rem; }
nav a {
    margin-left: 12px;
    color: #2563eb;
    text-decoration: none;
    font-size: 0.9rem;
}
nav a:first-child { margin-left: 0; }
nav a:hover { text-decoration: underline; }

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    background: white;
    padding: 12px;
    border-radius: 8px;
}
.filters select, .filters input[type=text] {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.95rem;
}
.filters input[type=text] { flex: 1; min-width: 150px; }
.clear-link { align-self: center; font-size: 0.85rem; color: #666; }

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    font-size: 0.9rem;
}
th, td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}
th { background: #fafafa; font-weight: 600; }
tr:last-child td { border-bottom: none; }
.actions a, .actions .link-button { margin-right: 8px; font-size: 0.85rem; }

.link-button {
    background: none;
    border: none;
    color: #dc2626;
    cursor: pointer;
    padding: 0;
    font-size: 0.85rem;
    text-decoration: underline;
}

.empty { text-align: center; padding: 40px 20px; color: #666; }
.error { background: #fee2e2; color: #991b1b; padding: 10px 14px; border-radius: 6px; margin-bottom: 12px; }

.item-form {
    background: white;
    padding: 16px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 500px;
}
.item-form label { font-weight: 600; margin-top: 8px; font-size: 0.9rem; }
.location-hint { margin-top: 8px; font-size: 0.9rem; color: #444; }
.item-form input, .item-form select, .item-form textarea {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
    width: 100%;
}
.item-form button {
    margin-top: 16px;
    padding: 12px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
}
.item-form button:hover { background: #1d4ed8; }

body.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}
.login-box {
    background: white;
    padding: 32px;
    border-radius: 10px;
    width: 100%;
    max-width: 340px;
    text-align: center;
}
.login-box h1 { margin-bottom: 20px; }
.login-box form { display: flex; flex-direction: column; gap: 8px; text-align: left; }
.login-box label { font-weight: 600; font-size: 0.9rem; margin-top: 8px; }
.login-box input {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
}
.login-box button {
    margin-top: 16px;
    padding: 12px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
}

.export-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.export-bar button {
    padding: 8px 14px;
    border: 1px solid #ccc;
    background: white;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
}
.export-bar button:hover { background: #f4f5f7; }

.print-only { display: none; }

@media print {
    .no-print { display: none !important; }
    .print-only { display: block; }
    body { background: white; padding: 0; max-width: 100%; }
    table { box-shadow: none; }
    .actions { display: none; }
    th:last-child, td:last-child { display: none; }
}

@media (max-width: 600px) {
    table, thead, tbody, th, td, tr { display: block; }
    thead { display: none; }
    tr { margin-bottom: 12px; border: 1px solid #eee; border-radius: 8px; padding: 8px; }
    td { border: none; padding: 4px 8px; }
    td::before {
        content: attr(data-label);
        font-weight: 600;
        display: inline-block;
        width: 110px;
        color: #666;
    }
}
