:root {
    --bg: #ececec;
    --surface: #fafafa;
    --text: #262626;
    --muted: #707070;
    --primary: #7a7a7a;
    --primary-dark: #636363;
    --border: #dcdcdc;
    --danger: #b3261e;
    --radius: 28px;
    --sidebar: 308px;
    font-family: "Outfit", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-size: 16px;
    line-height: 1.5;
}

a { color: var(--primary); }
h1, h2 { margin: 0 0 .25rem; line-height: 1.2; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.2rem; }
.muted { color: var(--muted); }
.lead { font-size: 1.15rem; }

.sidebar {
    position: fixed;
    top: 0; bottom: 0; left: 0;
    width: var(--sidebar);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 12px;
    overflow-y: auto;
    z-index: 20;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 8px 20px;
    color: inherit;
    text-decoration: none;
}
.brand strong { display: block; font-size: 1.05rem; }
.brand small { display: block; color: var(--muted); font-size: .85rem; }
.brand img { border-radius: 50%; flex: none; }

.menu { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.menu a, .menu .is-disabled {
    display: block;
    padding: 14px 18px;
    border-radius: 20px;
    color: var(--text);
    font-weight: 500;
    text-decoration: none;
}
.menu a:hover { background: var(--bg); }
.menu a.is-active { background: var(--primary); color: #fff; font-weight: 600; }
.menu .is-disabled { color: #a3abb5; cursor: default; }

.logout { padding-top: 12px; margin: 0; }

.main { margin-left: var(--sidebar); padding: 40px 24px 64px; }
.container { max-width: 850px; margin: 0 auto; }
.container-wide { max-width: 1400px; }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 28px rgba(27, 36, 48, .07);
    padding: 28px 32px;
    margin-bottom: 24px;
}
.card-center { text-align: center; }
.card h2 { margin-bottom: 1rem; }

.barcode-label { margin: 2rem 0 1rem; }
.barcode svg { max-width: 100%; height: auto; }
.barcode-text { font-family: ui-monospace, Consolas, monospace; font-size: 1.25rem; letter-spacing: .12em; margin-top: 4px; }

.actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 1.5rem; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 22px;
    border-radius: 999px;
    border: 1px solid transparent;
    font: inherit;
    font-weight: 600;
    font-size: .95rem;
    text-decoration: none;
    cursor: pointer;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-light { background: var(--bg); color: var(--text); border-color: var(--border); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.btn-light:hover { background: #e2e2e2; }
.btn-block { display: flex; width: 100%; }

.details { margin: 0; }
.details > div {
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}
.details > div:last-child { border-bottom: 0; }
.details dt { color: var(--muted); font-size: .92rem; padding-top: 3px; }
.details dd { margin: 0; font-size: 1.1rem; font-weight: 500; word-break: break-word; }

.form { display: flex; flex-direction: column; gap: 18px; text-align: left; margin-top: 1.5rem; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field span { color: var(--muted); font-size: .92rem; }
.field input {
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    font: inherit;
    background: var(--surface);
}
.field input:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.error { color: var(--danger); }

.alert { padding: 12px 18px; border-radius: 16px; margin-bottom: 20px; }
.alert-success { background: #ededed; color: #404040; border: 1px solid #d0d0d0; }
.alert-error { background: #fbeceb; color: var(--danger); border: 1px solid #f0c8c5; margin: 0; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; color: var(--muted); font-weight: 500; font-size: .9rem; }
.table th, .table td { padding: 12px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }

.link-list { list-style: none; margin: 0; padding: 0; }
.link-list li { padding: 12px 0; border-bottom: 1px solid var(--border); font-weight: 500; }
.link-list li:last-child { border-bottom: 0; }

.guest-main { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { width: 100%; max-width: 440px; text-align: center; padding: 36px; margin: 0; }
.login-logo { border-radius: 50%; margin-bottom: 12px; }

.menu-button { display: none; }

@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0, 0, 0, .15); }
    .menu-toggle:checked ~ .sidebar { transform: none; }
    .main { margin-left: 0; padding-top: 72px; }
    .menu-button {
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        top: 12px;
        left: 12px;
        width: 44px;
        height: 44px;
        border-radius: 50%;
        background: var(--surface);
        border: 1px solid var(--border);
        z-index: 30;
        cursor: pointer;
    }
    .menu-button span, .menu-button span::before, .menu-button span::after {
        content: "";
        display: block;
        width: 18px;
        height: 2px;
        background: var(--text);
        position: relative;
    }
    .menu-button span::before { position: absolute; top: -6px; }
    .menu-button span::after { position: absolute; top: 6px; }
    .details > div { grid-template-columns: 1fr; gap: 4px; }
    .card { padding: 22px 20px; }

    .table thead { display: none; }
    .table td { display: block; border: 0; padding: 4px 0; }
    .table td::before { content: attr(data-label) ": "; color: var(--muted); }
    .table tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--border); }
}

@media print {
    body { background: #fff; }
    .sidebar, .menu-button, .no-print, .alert { display: none !important; }
    .main { margin: 0; padding: 0; }
    .card { box-shadow: none; border: 0; }
}
