:root {
    --ink: #0b1320;
    --ink-2: #142131;
    --ink-3: #25364a;
    --paper: #f3f5f2;
    --surface: #ffffff;
    --line: #dfe4df;
    --muted: #6b7783;
    --green: #16c784;
    --green-dark: #087951;
    --green-pale: #e6f7ef;
    --yellow: #f1c24b;
    --red: #e65454;
    --blue: #3d73d6;
    --shadow: 0 18px 55px rgba(11, 19, 32, .08);
    --radius: 20px;
    --sidebar: 264px;
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body { margin: 0; min-height: 100%; background: var(--paper); color: var(--ink); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
code, pre { font-family: "SFMono-Regular", Consolas, monospace; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { letter-spacing: -.035em; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); z-index: 40; display: flex; flex-direction: column; background: var(--ink); color: white; border-right: 1px solid rgba(255,255,255,.07); }
.brand-block { height: 92px; display: flex; align-items: center; padding: 0 24px; border-bottom: 1px solid rgba(255,255,255,.09); }
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 38px; border-radius: 12px 4px 12px 4px; background: var(--green); color: var(--ink); font-weight: 950; font-size: 20px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.28); }
.brand-mark.large { width: 58px; height: 58px; font-size: 28px; border-radius: 17px 5px 17px 5px; margin-bottom: 24px; }
.brand strong { display: block; font-size: 18px; letter-spacing: .12em; line-height: 1; }
.brand small { display: block; margin-top: 5px; color: #91a0ae; font-size: 8px; font-weight: 800; letter-spacing: .16em; }
.brand-light { color: white; }
.community-card { margin: 20px 18px 14px; padding: 16px; border: 1px solid rgba(255,255,255,.1); border-radius: 16px; background: rgba(255,255,255,.035); }
.community-card > strong { display: block; margin: 7px 0 12px; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eyebrow { display: block; color: #71808e; font-size: 9px; line-height: 1.3; font-weight: 900; letter-spacing: .18em; text-transform: uppercase; }
.eyebrow.light { color: rgba(255,255,255,.58); }
.status-dot { display: inline-flex; align-items: center; gap: 7px; color: #8c9ba9; font-size: 10px; font-weight: 750; }
.status-dot i, .green-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(22,199,132,.12); }
.status-dot.amber i { background: var(--yellow); box-shadow: 0 0 0 4px rgba(241,194,75,.15); }
.nav-list { flex: 1; padding: 4px 14px 20px; overflow-y: auto; }
.nav-link { display: flex; align-items: center; gap: 13px; min-height: 44px; padding: 0 12px; margin: 3px 0; color: #91a0ae; border-radius: 11px; font-size: 13px; font-weight: 720; transition: .18s ease; }
.nav-link:hover { color: white; background: rgba(255,255,255,.06); }
.nav-link.active { color: white; background: rgba(22,199,132,.11); box-shadow: inset 3px 0 0 var(--green); }
.nav-number { color: #647383; font-size: 9px; letter-spacing: .08em; }
.nav-link.active .nav-number { color: var(--green); }
.sidebar-footer { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-top: 1px solid rgba(255,255,255,.08); }
.avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--green-pale); color: var(--green-dark); font-size: 13px; font-weight: 900; }
.user-summary { min-width: 0; flex: 1; }
.user-summary strong, .user-summary span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-summary strong { font-size: 11px; }
.user-summary span { color: #748495; margin-top: 3px; font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.icon-button { display: inline-grid; place-items: center; min-width: 34px; height: 34px; padding: 0 9px; border: 0; border-radius: 10px; color: inherit; background: transparent; font-weight: 850; }
.icon-button:hover { background: rgba(255,255,255,.08); }
.icon-button.bordered { border: 1px solid var(--line); background: white; color: var(--ink); font-size: 10px; }
.icon-button.bordered:hover { border-color: #afbab4; }
.icon-button.danger { color: var(--red); }
.sidebar-close, .menu-button { display: none; }
.sidebar-backdrop, .drawer-backdrop { display: none; }

.main-panel { grid-column: 2; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 25; height: 92px; display: flex; align-items: center; justify-content: space-between; padding: 0 34px; background: rgba(243,245,242,.92); border-bottom: 1px solid rgba(11,19,32,.08); backdrop-filter: blur(16px); }
.topbar-left { display: flex; align-items: center; gap: 14px; }
.topbar h1 { margin: 3px 0 0; font-size: 23px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.date-chip { padding: 10px 14px; background: white; border: 1px solid var(--line); border-radius: 10px; color: #64717c; font-size: 10px; font-weight: 850; letter-spacing: .1em; }
.page-content { width: 100%; max-width: 1640px; margin: 0 auto; padding: 30px 34px 70px; }
.flash-stack { position: fixed; z-index: 80; top: 105px; right: 26px; display: grid; gap: 10px; width: min(420px, calc(100vw - 30px)); }
.alert { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border: 1px solid #cfe8db; border-radius: 13px; background: #f2fff8; color: #12633f; box-shadow: var(--shadow); font-size: 13px; font-weight: 700; }
.alert button { border: 0; background: none; color: inherit; font-size: 18px; }
.alert-danger { border-color: #f1caca; background: #fff2f2; color: #9c3030; }
.alert-warning { border-color: #eedda8; background: #fff9e7; color: #7b6016; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 18px; min-height: 44px; padding: 0 18px; border: 1px solid transparent; border-radius: 11px; font-size: 11px; font-weight: 900; letter-spacing: .06em; transition: .18s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { background: var(--green); color: #06140e; box-shadow: 0 10px 26px rgba(22,199,132,.19); }
.button-primary:hover { background: #25d795; }
.button-secondary { background: white; color: var(--ink); border-color: var(--line); }
.button-light { background: white; color: var(--ink); }
.button-whatsapp { background: #25d366; color: #092b18; }
.button-large { width: 100%; min-height: 52px; }
.button.compact { min-height: 38px; padding: 0 14px; font-size: 10px; }
.text-link { color: var(--green-dark); font-size: 11px; font-weight: 850; }
.text-button { padding: 5px; border: 0; color: var(--green-dark); background: none; font-size: 10px; font-weight: 850; text-transform: uppercase; letter-spacing: .06em; }
.muted { color: var(--muted); }
.muted.small, .small { font-size: 10px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 28px rgba(11,19,32,.035); }
.panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 24px 26px; border-bottom: 1px solid var(--line); }
.panel-header h2, .panel-header h3 { margin: 5px 0 0; }
.panel-header h2 { font-size: 21px; }
.panel-header h3 { font-size: 17px; }
.panel-header p { margin: 7px 0 0; font-size: 12px; }

.hero-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, .8fr); gap: 18px; }
.hero-card { min-height: 210px; padding: 32px; border-radius: 24px; display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; color: white; background:
    radial-gradient(circle at 75% 25%, rgba(22,199,132,.18), transparent 25%),
    linear-gradient(135deg, #071017, #142434); overflow: hidden; }
.hero-card h2 { margin: 10px 0 8px; font-size: clamp(32px, 4vw, 54px); font-weight: 530; }
.hero-card h2 em { color: var(--green); font-style: normal; font-weight: 900; }
.hero-card p { margin: 0; color: #94a5b5; font-size: 13px; }
.hero-time { flex: 0 0 auto; text-align: right; }
.hero-time strong { display: block; color: var(--green); font-size: 40px; letter-spacing: -.04em; }
.hero-time span { display: block; margin-top: 6px; color: #8394a4; font-size: 9px; text-transform: uppercase; letter-spacing: .12em; }
.attention-card { padding: 28px; border: 1px solid #d8aa3c; border-radius: 24px; background: var(--yellow); display: grid; grid-template-columns: auto 1fr; gap: 12px 20px; }
.attention-label { grid-column: 1/-1; font-size: 9px; font-weight: 900; letter-spacing: .15em; }
.attention-number { align-self: end; font-size: 80px; line-height: .9; font-weight: 950; letter-spacing: -.08em; }
.attention-links { display: flex; flex-direction: column; align-self: end; gap: 8px; }
.attention-links a { padding-top: 9px; border-top: 1px solid rgba(11,19,32,.2); font-size: 10px; }
.attention-links strong { font-size: 15px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 18px 0; }
.metric-card { min-height: 148px; display: flex; gap: 20px; padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: white; }
.metric-card.accent { background: var(--green-pale); border-color: #bde7d3; }
.metric-card.dark { background: var(--ink-2); border-color: var(--ink-2); color: white; }
.metric-index { color: #adb8b1; font-size: 9px; font-weight: 900; }
.metric-card > div { margin-top: auto; }
.metric-card div > span, .metric-card small { display: block; }
.metric-card div > span { color: #7c8983; font-size: 9px; font-weight: 900; letter-spacing: .12em; }
.metric-card strong { display: block; margin: 5px 0 2px; font-size: 38px; line-height: 1; letter-spacing: -.05em; }
.metric-card small { color: #98a29e; font-size: 9px; }
.content-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.span-2 { grid-column: span 2; }
.activity-list { padding: 5px 22px 16px; }
.activity-row { min-height: 68px; display: flex; align-items: center; gap: 13px; border-bottom: 1px solid #edf0ed; }
.activity-row:last-child { border-bottom: 0; }
.decision-icon { display: grid; place-items: center; width: 30px; height: 30px; flex: 0 0 30px; border-radius: 9px; font-size: 14px; font-weight: 950; }
.decision-icon.granted { background: var(--green-pale); color: var(--green-dark); }
.decision-icon.denied { background: #fdeaea; color: var(--red); }
.activity-main { min-width: 0; flex: 1; }
.activity-main strong, .activity-main span, .activity-unit strong, .activity-unit span { display: block; }
.activity-main strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.activity-main span, .activity-unit span { margin-top: 4px; color: #8a9690; font-size: 9px; }
.activity-unit { text-align: right; }
.activity-unit strong { font-size: 12px; }
.pulse-panel { min-height: 320px; }
.bar-chart { height: 170px; display: flex; align-items: flex-end; gap: 5px; padding: 22px 25px 10px; overflow: hidden; }
.bar-item { height: 100%; min-width: 10px; flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 5px; }
.bar-item i { width: 100%; min-height: 3px; height: var(--bar-height, 8%); max-width: 22px; border-radius: 5px 5px 2px 2px; background: var(--green); opacity: .78; }
.bar-item span { color: #98a39e; font-size: 7px; }
.pulse-summary { display: flex; justify-content: space-between; align-items: center; padding: 16px 24px; border-top: 1px solid var(--line); font-size: 10px; }
.pulse-summary span { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.empty-state { padding: 32px 20px; text-align: center; color: #8b9690; font-size: 12px; }
.empty-state.large { min-height: 180px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
.empty-state strong { color: var(--ink); font-size: 16px; }
.empty-state.compact { min-height: auto; padding: 10px; }

.split-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(330px, .72fr); gap: 18px; align-items: start; }
.form-panel { position: sticky; top: 112px; }
.form-stack { display: grid; gap: 17px; padding: 24px 26px 28px; }
.form-grid { display: grid; gap: 14px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: grid; gap: 7px; min-width: 0; }
.field > span { color: #65726c; font-size: 9px; font-weight: 900; text-transform: uppercase; letter-spacing: .1em; }
.field input, .field select, .field textarea, .deliver-form input, .status-form select { width: 100%; min-width: 0; border: 1px solid #d9dfda; border-radius: 10px; outline: none; background: #f8faf8; color: var(--ink); font-size: 12px; font-weight: 650; transition: .16s ease; }
.field input, .field select { height: 44px; padding: 0 12px; }
.field textarea { padding: 12px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .deliver-form input:focus { border-color: var(--green); background: white; box-shadow: 0 0 0 3px rgba(22,199,132,.1); }
.check-row { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: #fafbfa; }
.check-row input { margin-top: 2px; accent-color: var(--green-dark); }
.check-row span, .check-row strong, .check-row small { display: block; }
.check-row strong { font-size: 10px; }
.check-row small { margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.compact-check { align-items: center; margin-top: 17px; }
.secure-chip { padding: 6px 8px; border-radius: 6px; background: var(--green-pale); color: var(--green-dark); font-size: 8px; font-weight: 950; letter-spacing: .12em; }
.filter-pills { display: flex; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: #f5f7f5; }
.filter-pills button { min-height: 30px; padding: 0 11px; border: 0; border-radius: 7px; color: #7b8881; background: transparent; font-size: 9px; font-weight: 850; }
.filter-pills button.active { background: white; color: var(--ink); box-shadow: 0 2px 9px rgba(11,19,32,.08); }
.pass-list { padding: 0 22px 16px; }
.pass-row { display: grid; grid-template-columns: 42px minmax(160px, 1.5fr) minmax(90px, .7fr) minmax(120px, .85fr) 76px auto; align-items: center; gap: 14px; min-height: 94px; border-bottom: 1px solid #edf0ed; transition: .2s ease; }
.pass-row.highlighted { margin: 5px -10px; padding: 0 10px; border-radius: 12px; background: #effbf5; }
.pass-row.is-filtered { display: none; }
.pass-monogram { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--ink); color: var(--green); font-weight: 900; }
.pass-person, .pass-destination, .pass-validity, .pass-use { min-width: 0; }
.pass-person strong, .pass-person span, .pass-destination span, .pass-destination strong, .pass-destination small, .pass-validity span, .pass-validity strong, .pass-validity small, .pass-use span, .pass-use strong { display: block; }
.pass-person strong { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pass-person span { margin-top: 5px; color: #7b8881; font-size: 9px; }
.pass-destination span, .pass-validity span, .pass-use > span { color: #97a19c; font-size: 7px; font-weight: 900; letter-spacing: .11em; }
.pass-destination strong, .pass-validity strong, .pass-use strong { margin-top: 4px; font-size: 11px; }
.pass-destination small, .pass-validity small { display: block; margin-top: 3px; color: #89948e; font-size: 8px; }
.pass-use .badge { margin-top: 5px; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
.badge { display: inline-flex; align-items: center; width: max-content; padding: 5px 8px; border: 0; border-radius: 999px; background: #eef1ef; color: #637069; font-size: 8px; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; }
.status-active, .status-granted, .status-resolved, .status-delivered { background: var(--green-pale); color: var(--green-dark); }
.status-used, .status-expired, .status-inactive { background: #ecefed; color: #6d7772; }
.status-revoked, .status-denied { background: #fdeaea; color: #b43b3b; }
.status-pending, .status-open { background: #fff3cf; color: #7f6013; }
.status-in_progress { background: #e9f0ff; color: #305da9; }

.modal { width: 100%; max-width: none; height: 100%; max-height: none; padding: 20px; border: 0; background: rgba(5,13,18,.77); backdrop-filter: blur(8px); }
.modal[open] { display: grid; place-items: center; }
.modal::backdrop { background: transparent; }
.modal-card { position: relative; width: min(440px, 100%); padding: 34px; border-radius: 24px; background: white; text-align: center; box-shadow: 0 30px 100px rgba(0,0,0,.35); }
.modal-card h2 { margin: 7px 0; font-size: 28px; }
.modal-close { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: #f0f3f1; color: var(--ink); font-size: 20px; }
.qr-frame { width: 240px; height: 240px; display: grid; place-items: center; margin: 24px auto; padding: 15px; border: 1px solid var(--line); border-radius: 18px; }
.qr-frame canvas, .qr-frame img { max-width: 100%; height: auto !important; }
.copy-box { display: flex; margin-bottom: 12px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: #f7f9f7; }
.copy-box input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; padding: 0 9px; color: #6e7a74; font-size: 9px; }
.copy-box button { border: 0; border-radius: 7px; background: var(--ink); color: white; padding: 9px 12px; font-size: 9px; font-weight: 850; }

.gate-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(290px, .55fr); gap: 18px; align-items: start; }
.gate-console { min-height: calc(100vh - 150px); padding: 28px; border-radius: 24px; color: white; background: var(--ink); }
.gate-topline { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.gate-topline h2 { margin: 12px 0 0; font-size: 29px; }
.live-pill { display: inline-flex; align-items: center; gap: 8px; color: #90a1b1; font-size: 9px; font-weight: 900; letter-spacing: .12em; }
.live-pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgba(22,199,132,.13); }
.compact-field { width: min(220px, 45%); }
.gate-console .field > span { color: #8292a1; }
.gate-console .field input, .gate-console .field select { border-color: #314152; background: #172536; color: white; }
.direction-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 25px auto 18px; padding: 5px; max-width: 560px; border: 1px solid #2c3b4b; border-radius: 13px; background: #101c29; }
.direction-switch button { min-height: 44px; border: 0; border-radius: 9px; background: transparent; color: #7f91a2; font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; }
.direction-switch button span { margin-right: 7px; font-size: 16px; }
.direction-switch button.active { background: var(--green); color: var(--ink); }
.scanner-frame { position: relative; width: min(500px, 100%); aspect-ratio: 16/10; margin: 0 auto 19px; overflow: hidden; border: 1px solid #304253; border-radius: 18px; background: #050a0e; }
.qr-reader { width: 100%; height: 100%; display: grid; place-items: center; overflow: hidden; }
.qr-reader video { width: 100% !important; height: 100% !important; object-fit: cover; }
.scanner-placeholder { display: grid; place-items: center; gap: 9px; color: #8495a6; text-align: center; }
.scanner-placeholder strong { color: white; font-size: 13px; }
.scanner-placeholder span { font-size: 9px; }
.scan-corners { position: relative; width: 110px; height: 110px; margin-bottom: 8px; }
.scan-corners i { position: absolute; width: 27px; height: 27px; border-color: var(--green); border-style: solid; }
.scan-corners i:nth-child(1) { top: 0; left: 0; border-width: 3px 0 0 3px; }
.scan-corners i:nth-child(2) { top: 0; right: 0; border-width: 3px 3px 0 0; }
.scan-corners i:nth-child(3) { bottom: 0; left: 0; border-width: 0 0 3px 3px; }
.scan-corners i:nth-child(4) { right: 0; bottom: 0; border-width: 0 3px 3px 0; }
.scan-line { pointer-events: none; position: absolute; left: 16%; right: 16%; top: 50%; z-index: 4; height: 1px; background: var(--green); box-shadow: 0 0 12px var(--green); animation: scan 2.5s ease-in-out infinite; }
@keyframes scan { 0%,100% { transform: translateY(-75px); opacity: .35; } 50% { transform: translateY(75px); opacity: 1; } }
.manual-code-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; width: min(640px, 100%); margin: auto; }
.manual-code-form .button { height: 44px; }
.gate-history { position: sticky; top: 112px; }
.compact-list { padding-top: 0; }
.compact-list .activity-row time { color: #8d9892; font-size: 9px; }
.gate-result.granted .modal-card { border-top: 8px solid var(--green); }
.gate-result.denied .modal-card { border-top: 8px solid var(--red); }
.result-symbol { display: grid; place-items: center; width: 72px; height: 72px; margin: 0 auto 20px; border-radius: 50%; background: var(--green-pale); color: var(--green-dark); font-size: 34px; font-weight: 950; }
.gate-result.denied .result-symbol { background: #fdeaea; color: var(--red); }
.result-details { display: grid; gap: 8px; margin: 20px 0; padding: 16px; border-radius: 12px; background: #f4f6f4; text-align: left; }
.result-details div { display: flex; justify-content: space-between; gap: 15px; font-size: 11px; }
.result-details span { color: var(--muted); }
.gate-result .button { background: var(--ink); color: white; }

.section-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; margin-bottom: 20px; }
.section-intro h2 { margin: 7px 0 5px; font-size: 27px; }
.section-intro p { margin: 0; font-size: 12px; }
.table-panel { overflow: hidden; }
.table-toolbar { min-height: 67px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.search-field { width: min(420px, 100%); display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: #f7f9f7; color: #87938d; }
.search-field input { width: 100%; border: 0; outline: 0; background: transparent; font-size: 11px; }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { height: 45px; padding: 0 17px; background: #f7f9f7; color: #8a958f; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; font-size: 8px; font-weight: 900; letter-spacing: .11em; text-transform: uppercase; }
.data-table td { min-height: 65px; padding: 13px 17px; border-bottom: 1px solid #edf0ed; white-space: nowrap; font-size: 10px; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fbfcfb; }
.data-table td strong, .data-table td small { display: block; }
.data-table td strong { font-size: 11px; }
.data-table td small { margin-top: 4px; color: #89948e; font-size: 8px; }
.table-identity { display: flex; align-items: center; gap: 11px; }
.unit-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--green-pale); color: var(--green-dark); font-size: 17px; }
.number-chip { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: #f0f3f1; font-weight: 850; }
.align-right { text-align: right !important; }
.small-avatar { width: 34px; height: 34px; }
.role-chip { padding: 5px 8px; border-radius: 6px; background: #eef1ef; color: #5d6963; font-size: 8px; font-weight: 850; text-transform: uppercase; }
.role-administrator, .role-super_admin { background: #e8eeff; color: #315ba1; }
.role-guard { background: #fff2ce; color: #795d16; }
.role-resident { background: var(--green-pale); color: var(--green-dark); }
.row-menu { position: relative; display: inline-block; text-align: left; }
.row-menu summary { list-style: none; width: 34px; height: 30px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; }
.row-menu summary::-webkit-details-marker { display: none; }
.row-menu > div { position: absolute; z-index: 8; right: 0; top: 36px; width: 235px; padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: white; box-shadow: var(--shadow); }
.row-menu form { padding: 5px; }
.reset-password-form { display: grid; grid-template-columns: 1fr auto; gap: 5px; border-top: 1px solid var(--line); }
.reset-password-form input { width: 100%; min-width: 0; height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 7px; font-size: 9px; }
.plate { display: inline-block; padding: 6px 10px; border: 2px solid var(--ink-3); border-radius: 6px; background: #fff; color: var(--ink); font-family: "SFMono-Regular", monospace; font-size: 11px; font-weight: 950; letter-spacing: .08em; box-shadow: inset 0 0 0 2px #eef1ef; }
.small-plate { padding: 4px 6px; font-size: 8px; }
.mini-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.mini-metrics > div { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.mini-metrics span { color: #76827c; font-size: 9px; font-weight: 850; text-transform: uppercase; letter-spacing: .08em; }
.mini-metrics strong { font-size: 24px; }

.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 70; width: min(520px, 100%); overflow-y: auto; background: white; box-shadow: -25px 0 80px rgba(11,19,32,.18); transform: translateX(102%); transition: transform .24s ease; }
.drawer.open { transform: translateX(0); }
.drawer.open + .drawer-backdrop, body.drawer-open .drawer-backdrop { display: block; position: fixed; inset: 0; z-index: 60; background: rgba(4,11,16,.55); backdrop-filter: blur(4px); }
.drawer-header { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: 25px 27px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.95); backdrop-filter: blur(12px); }
.drawer-header h2 { margin: 6px 0 0; }
.info-box { display: grid; gap: 5px; padding: 13px 14px; border: 1px solid #cbe8d9; border-radius: 11px; background: #f1fbf6; }
.info-box strong { color: var(--green-dark); font-size: 10px; }
.info-box span { color: #65766d; font-size: 9px; line-height: 1.5; }
.danger-box { border-color: #f0caca; background: #fff5f5; }
.danger-box strong { color: #a43838; }

.package-board { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.package-column { overflow: hidden; }
.column-title { display: flex; justify-content: space-between; align-items: center; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.column-title strong { font-size: 24px; }
.package-list { padding: 10px 18px 18px; }
.package-card { display: grid; grid-template-columns: 42px 1fr; gap: 13px; padding: 18px 2px; border-bottom: 1px solid var(--line); }
.package-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: #fff3cf; color: #7f6013; font-size: 22px; }
.package-icon.done { background: var(--green-pale); color: var(--green-dark); }
.package-main h3 { margin: 5px 0 4px; font-size: 15px; }
.package-main p { margin: 0; color: #5f6d65; font-size: 10px; }
.package-main small { display: block; margin-top: 6px; color: #919b96; font-size: 8px; }
.deliver-form { grid-column: 2; display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.deliver-form input { height: 38px; padding: 0 10px; }
.compact-card { grid-template-columns: 42px 1fr; }

.incident-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.incident-card { position: relative; min-height: 280px; padding: 23px; border: 1px solid var(--line); border-top: 4px solid #89958f; border-radius: 17px; background: white; box-shadow: 0 8px 28px rgba(11,19,32,.035); }
.incident-card.severity-critical { border-top-color: #bf2828; }
.incident-card.severity-high { border-top-color: var(--red); }
.incident-card.severity-medium { border-top-color: var(--yellow); }
.incident-card.severity-low { border-top-color: var(--blue); }
.incident-meta { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.severity-badge { font-size: 9px; font-weight: 900; text-transform: uppercase; letter-spacing: .09em; }
.incident-card h3 { margin: 7px 0 10px; font-size: 18px; }
.incident-card > p { min-height: 62px; color: #5f6d65; font-size: 11px; line-height: 1.55; }
.incident-footer { display: grid; gap: 5px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); color: #7c8882; font-size: 8px; }
.status-form { display: grid; grid-template-columns: 1fr auto; gap: 7px; margin-top: 14px; }
.status-form select { height: 38px; padding: 0 9px; }

.filter-bar { display: grid; grid-template-columns: 170px 170px 200px auto; gap: 12px; align-items: end; margin-bottom: 16px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: white; }
.report-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.settings-layout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(300px, .7fr); gap: 18px; align-items: start; }
.settings-side { position: sticky; top: 112px; }
.gate-list { padding: 8px 20px; }
.gate-list > div { display: flex; align-items: center; gap: 11px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.gate-list > div > div { flex: 1; }
.gate-list strong, .gate-list small { display: block; }
.gate-list strong { font-size: 11px; }
.gate-list small { margin-top: 4px; color: var(--muted); font-size: 8px; }
.settings-side > .info-box { margin: 16px 20px 20px; }
.gate-create-form { display: grid; gap: 10px; padding: 17px 20px; border-top: 1px solid var(--line); }
.profile-layout { display: grid; grid-template-columns: minmax(260px, .65fr) minmax(340px, 1fr); gap: 18px; align-items: start; max-width: 960px; margin: 20px auto; }
.profile-card { padding: 34px; }
.profile-avatar { display: grid; place-items: center; width: 74px; height: 74px; margin-bottom: 24px; border-radius: 22px; background: var(--ink); color: var(--green); font-size: 30px; font-weight: 950; }
.profile-card h2 { margin: 8px 0 12px; }
.profile-card dl { margin: 28px 0 0; }
.profile-card dl > div { display: flex; justify-content: space-between; gap: 15px; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 10px; }
.profile-card dt { color: var(--muted); }
.profile-card dd { margin: 0; font-weight: 800; text-align: right; }

.auth-body { min-height: 100vh; background: #071017; }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1.2fr) minmax(400px, .8fr); }
.auth-story { position: relative; display: flex; flex-direction: column; justify-content: space-between; min-height: 100vh; padding: 42px 54px; color: white; overflow: hidden; background:
    linear-gradient(120deg, rgba(4,10,14,.98), rgba(10,29,31,.84)),
    radial-gradient(circle at 75% 30%, rgba(22,199,132,.35), transparent 32%); }
.auth-story::before { content: ""; position: absolute; width: 48vw; height: 48vw; right: -22vw; top: 15vh; border: 1px solid rgba(22,199,132,.23); border-radius: 50%; box-shadow: 0 0 0 8vw rgba(22,199,132,.025), 0 0 0 16vw rgba(22,199,132,.018); }
.auth-story > * { position: relative; z-index: 1; }
.auth-copy h1 { max-width: 760px; margin: 13px 0 20px; font-size: clamp(47px, 6vw, 86px); line-height: .94; font-weight: 460; }
.auth-copy h1 em { color: var(--green); font-style: normal; font-weight: 900; }
.auth-copy p { max-width: 530px; color: #9bacb9; font-size: 15px; line-height: 1.6; }
.trust-strip { display: flex; gap: 25px; padding-top: 25px; border-top: 1px solid rgba(255,255,255,.12); color: #8c9daa; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.trust-strip span { display: flex; align-items: center; gap: 8px; }
.trust-strip i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.auth-panel { display: grid; place-items: center; min-height: 100vh; padding: 45px; background: var(--paper); }
.auth-form-wrap { width: min(390px, 100%); }
.auth-form-wrap h2 { margin: 9px 0 7px; font-size: 32px; }
.auth-form-wrap > p { font-size: 12px; }
.auth-form { padding: 20px 0 0; }
.password-field { position: relative; }
.password-field input { padding-right: 58px; }
.password-field button { position: absolute; right: 6px; top: 6px; height: 32px; border: 0; border-radius: 7px; background: #e9edea; color: #59665f; font-size: 9px; font-weight: 850; }
.support-note { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); color: #89948e; text-align: center; font-size: 9px !important; }

.simple-body { min-height: 100vh; display: grid; place-items: center; padding: 25px; background: var(--paper); }
.simple-card { width: min(570px, 100%); padding: 44px; border: 1px solid var(--line); border-radius: 24px; background: white; box-shadow: var(--shadow); }
.simple-card h1 { margin: 10px 0 14px; font-size: 32px; }
.simple-card p { color: var(--muted); line-height: 1.6; }
.simple-card pre { overflow-x: auto; padding: 14px; border-radius: 10px; background: var(--ink); color: var(--green); }
.error-code { display: grid; place-items: center; width: 58px; height: 58px; margin-bottom: 22px; border-radius: 50%; background: #fdeaea; color: var(--red); font-size: 30px; font-weight: 900; }
.error-card .button { margin-top: 10px; }

.pass-body { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #071017; }
.public-pass-shell { width: min(470px, 100%); }
.public-pass-card { overflow: hidden; border-radius: 28px; background: white; box-shadow: 0 30px 100px rgba(0,0,0,.35); }
.public-pass-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px; background: var(--ink); color: white; }
.public-pass-main { padding: 30px 28px 24px; background: var(--ink-2); color: white; text-align: center; }
.public-pass-main h1 { margin: 8px 0 4px; font-size: 30px; }
.public-pass-main > p { color: #91a2b2; font-size: 11px; }
.public-qr { width: 238px; min-height: 238px; display: grid; place-items: center; margin: 25px auto 13px; padding: 15px; border-radius: 18px; background: white; }
.public-qr canvas, .public-qr img { max-width: 100%; height: auto !important; }
.token-prefix { color: #7f92a3; font-family: monospace; font-size: 9px; letter-spacing: .08em; }
.public-pass-data { display: grid; grid-template-columns: repeat(2, 1fr); }
.public-pass-data > div { min-height: 103px; padding: 20px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.public-pass-data > div:nth-child(even) { border-right: 0; }
.public-pass-data span, .public-pass-data strong, .public-pass-data small { display: block; }
.public-pass-data span { color: #929c97; font-size: 8px; font-weight: 900; letter-spacing: .11em; }
.public-pass-data strong { margin-top: 7px; font-size: 14px; }
.public-pass-data small { margin-top: 4px; color: #78847e; font-size: 9px; }
.public-pass-card footer { padding: 17px 22px; color: #84908a; text-align: center; font-size: 8px; line-height: 1.5; }
.pass-warning { margin: 16px 20px 0; padding: 12px; border-radius: 10px; background: #fdeaea; color: #a13434; text-align: center; font-size: 10px; font-weight: 800; }
.inactive-pass .public-qr { opacity: .3; filter: grayscale(1); }
.invalid-pass { padding: 40px; text-align: center; }
.invalid-pass h1 { margin: 10px 0; }
.invalid-pass p { color: var(--muted); }

@media (max-width: 1200px) {
    .metric-grid { grid-template-columns: repeat(2, 1fr); }
    .split-layout { grid-template-columns: 1fr; }
    .form-panel { position: static; }
    .pass-row { grid-template-columns: 42px minmax(150px, 1.5fr) 90px 115px 70px auto; }
    .incident-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
    .app-shell { display: block; }
    .sidebar { transform: translateX(-102%); transition: transform .23s ease; }
    body.menu-open .sidebar { transform: translateX(0); }
    body.menu-open .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(4,11,16,.58); backdrop-filter: blur(3px); }
    .sidebar-close { display: grid; margin-left: auto; }
    .menu-button { display: grid; }
    .main-panel { min-width: 0; }
    .topbar { padding: 0 22px; }
    .page-content { padding: 24px 22px 60px; }
    .hero-grid, .gate-layout, .settings-layout { grid-template-columns: 1fr; }
    .profile-layout { grid-template-columns: 1fr; }
    .gate-history, .settings-side { position: static; }
    .content-grid { grid-template-columns: 1fr; }
    .span-2 { grid-column: auto; }
    .package-board { grid-template-columns: 1fr; }
    .auth-shell { grid-template-columns: 1fr; }
    .auth-story { display: none; }
    .auth-panel { min-height: 100vh; }
}

@media (max-width: 720px) {
    .topbar { height: 78px; padding: 0 15px; }
    .topbar h1 { font-size: 18px; }
    .topbar .eyebrow, .date-chip { display: none; }
    .topbar-actions .button { min-height: 36px; padding: 0 11px; font-size: 8px; }
    .page-content { padding: 17px 13px 50px; }
    .hero-card { min-height: 230px; padding: 24px; align-items: flex-start; flex-direction: column; }
    .hero-card h2 { font-size: 38px; }
    .hero-time { text-align: left; }
    .attention-card { min-height: 180px; }
    .metric-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
    .metric-card { min-height: 124px; padding: 16px; gap: 10px; }
    .metric-card strong { font-size: 31px; }
    .panel-header { padding: 20px; }
    .responsive-header { align-items: stretch; flex-direction: column; }
    .pass-list { padding: 0 14px 12px; }
    .pass-row { grid-template-columns: 38px 1fr auto; gap: 10px; padding: 13px 0; }
    .pass-monogram { width: 38px; height: 38px; }
    .pass-destination, .pass-validity, .pass-use { grid-column: 2; display: flex; align-items: baseline; gap: 6px; }
    .pass-destination span, .pass-validity span, .pass-use > span { min-width: 52px; }
    .pass-destination strong, .pass-validity strong, .pass-use strong { margin: 0; }
    .pass-destination small, .pass-validity small { margin: 0; }
    .row-actions { grid-column: 3; grid-row: 1 / span 4; flex-direction: column; }
    .form-grid.two, .form-grid.three { grid-template-columns: 1fr; }
    .form-stack { padding: 20px; }
    .section-intro { align-items: stretch; flex-direction: column; }
    .section-intro .button { width: 100%; }
    .mini-metrics, .report-metrics { grid-template-columns: 1fr 1fr; }
    .table-toolbar { align-items: stretch; flex-direction: column; }
    .search-field { width: 100%; }
    .incident-grid { grid-template-columns: 1fr; }
    .filter-bar { grid-template-columns: 1fr 1fr; }
    .filter-bar .button { grid-column: span 2; }
    .gate-console { min-height: auto; padding: 20px 14px; }
    .gate-topline { flex-direction: column; }
    .compact-field { width: 100%; }
    .scanner-frame { aspect-ratio: 1/1; }
    .manual-code-form { grid-template-columns: 1fr; }
    .manual-code-form .button { width: 100%; }
    .auth-panel { padding: 30px 22px; }
    .auth-form-wrap h2 { font-size: 27px; }
    .simple-card { padding: 30px 24px; }
    .modal { padding: 10px; }
    .modal-card { padding: 30px 20px 22px; }
    .qr-frame { width: 220px; height: 220px; }
    .pass-body { padding: 10px; }
    .public-pass-card { border-radius: 22px; }
    .public-pass-main { padding-inline: 16px; }
    .public-qr { width: 218px; min-height: 218px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
