/* Live Lion Station Manager — brand tokens + components */

/* Sites page: Active / Archived tabs */
.view-tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--border); margin-bottom: 14px; }
.view-tabs button { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px; border: 0; border-radius: 8px; background: transparent; color: var(--text-dim); font-weight: 700; font-size: 13px; cursor: pointer; }
.view-tabs button span { font-size: 11.5px; padding: 1px 7px; border-radius: 999px; background: var(--surface-3); color: var(--text-dim); }
.view-tabs button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.2), inset 0 -2px 0 var(--gold); }

:root {
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  /* brand accent: Live Lion red (sampled from the logo). Token names kept as --gold* so every
     component that used the old accent picks up the brand colour automatically. */
  --brand-red: #DC2216;
  --gold: #DC2216;
  --gold-strong: #F0392D;
  --gold-ink: #FFFFFF;
  --gold-soft: rgba(220, 34, 22, .14);

  --bg: #07090D;
  --bg-grad: #07090D;
  --surface: #10131A;
  --surface-2: #151922;
  --surface-3: #1C212C;
  --border: #252B37;
  --border-strong: #343B4A;
  --text: #F2F4F8;
  --text-dim: #A6ADBB;
  --text-faint: #6F7685;

  --danger: #FF5C63;
  --danger-soft: rgba(255, 92, 99, .13);
  --warn: #FFB224;
  --warn-soft: rgba(255, 178, 36, .13);
  --ok: #2FD683;
  --ok-soft: rgba(47, 214, 131, .13);
  --info: #5AB1FF;
  --info-soft: rgba(90, 177, 255, .13);
  --violet: #B49BFF;
  --violet-soft: rgba(180, 155, 255, .14);

  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --focus: 0 0 0 3px rgba(220, 34, 22, .45);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --gold: #C81E13;
  --gold-strong: #DC2216;
  --gold-ink: #FFFFFF;
  --gold-soft: rgba(200, 30, 19, .1);
  --bg: #F1F2F5;
  --bg-grad: #F1F2F5;
  --surface: #FFFFFF;
  --surface-2: #F6F8FB;
  --surface-3: #EBEFF5;
  --border: #DBE1EA;
  --border-strong: #C3CCD9;
  --text: #11141A;
  --text-dim: #4A505C;
  --text-faint: #7A808C;
  --focus: 0 0 0 3px rgba(200, 30, 19, .3);
  --danger: #D72631;
  --danger-soft: rgba(215, 38, 49, .09);
  --warn: #B86E00;
  --warn-soft: rgba(230, 150, 0, .12);
  --ok: #0E9F5A;
  --ok-soft: rgba(14, 159, 90, .1);
  --info: #1468C9;
  --info-soft: rgba(20, 104, 201, .09);
  --violet: #6B4BD8;
  --violet-soft: rgba(107, 75, 216, .1);
  --shadow: 0 10px 30px rgba(15, 25, 45, .12);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font: 14px/1.45 var(--font);
  color: var(--text);
  background: var(--bg-grad);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}
a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
svg[aria-hidden="true"] { width: 16px; height: 16px; flex: none; vertical-align: -3px; }
.pill svg, .section-label svg { width: 12px; height: 12px; vertical-align: -1px; }
.dropzone svg { width: 26px; height: 26px; }
.mono { font-family: var(--mono); font-size: .92em; }
.num { font-variant-numeric: tabular-nums; }
.dim { color: var(--text-dim); }
.faint { color: var(--text-faint); }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.boot { min-height: 100vh; display: grid; place-items: center; }
.boot img { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; transform: scale(.94); } }

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface-2);
  font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap;
  transition: background .12s, border-color .12s, transform .05s;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.btn.primary:hover { background: var(--gold-strong); }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); background: transparent; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-3); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn.icon { width: 32px; padding: 0; }
.btn.icon.sm { width: 28px; }
.btn svg { width: 16px; height: 16px; flex: none; }

.input, select.input, textarea.input {
  width: 100%; height: 38px; padding: 0 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface);
  transition: border-color .12s, box-shadow .12s;
}
textarea.input { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.input:focus { outline: none; border-color: var(--gold); box-shadow: var(--focus); }
.input:disabled { opacity: .6; cursor: not-allowed; }
.input.sm { height: 30px; font-size: 12.5px; padding: 0 8px; }
label.field { display: grid; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text-dim); }
label.field .hint { font-weight: 400; color: var(--text-faint); }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 500; color: var(--text); font-size: 13px; }
.check input { width: 16px; height: 16px; accent-color: var(--gold); }

.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 720px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

/* ---------- pills / badges ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px;
  border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .02em;
  background: var(--surface-3); color: var(--text-dim); white-space: nowrap;
}
.pill.gold { background: var(--gold-soft); color: var(--gold); }
.pill.red { background: var(--danger-soft); color: var(--danger); }
.pill.amber { background: var(--warn-soft); color: var(--warn); }
.pill.green { background: var(--ok-soft); color: var(--ok); }
.pill.blue { background: var(--info-soft); color: var(--info); }
.pill.violet { background: var(--violet-soft); color: var(--violet); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--text-faint); flex: none; display: inline-block; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.dot.err { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }

/* ---------- brand ---------- */
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand img { height: 36px; width: auto; flex: none; object-fit: contain; }
.brand-text { line-height: 1.1; min-width: 0; }
.brand-name { font-weight: 800; letter-spacing: .08em; font-size: 13px; text-transform: uppercase; }
.brand-name b { color: var(--gold); font-weight: 800; }
.brand-sub { font-size: 11px; color: var(--text-faint); letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- login ---------- */
.login {
  min-height: 100vh; display: grid; grid-template-rows: auto 1fr auto; padding: 24px 16px;
  background:
    radial-gradient(900px 500px at 50% -10%, rgba(245,184,0,.12), transparent 60%),
    var(--bg);
}
.login-top { display: flex; justify-content: space-between; align-items: center; max-width: 1100px; width: 100%; margin: 0 auto; gap: 12px; }
.login-center { display: grid; place-items: center; padding: 24px 0; }
.login-card {
  width: min(420px, 100%); background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 28px; box-shadow: var(--shadow);
}
.login-card h1 { margin: 0 0 4px; font-size: 20px; letter-spacing: -.01em; }
.login-card p.lead { margin: 0 0 20px; color: var(--text-dim); font-size: 13px; }
.pin-display { display: flex; justify-content: center; gap: 10px; margin: 18px 0 20px; min-height: 22px; }
.pin-display span { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border-strong); transition: all .12s; }
.pin-display span.on { background: var(--gold); border-color: var(--gold); transform: scale(1.06); }
.pin-display.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.key {
  height: 58px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2);
  font-size: 22px; font-weight: 600; cursor: pointer; font-variant-numeric: tabular-nums;
  transition: background .1s, transform .05s;
}
.key:hover { background: var(--surface-3); }
.key:active { transform: scale(.97); background: var(--gold-soft); }
.key.fn { font-size: 13px; font-weight: 600; color: var(--text-dim); }
.login-card .btn.primary { width: 100%; height: 46px; font-size: 15px; margin-top: 14px; }
.login-msg { min-height: 20px; margin-top: 12px; text-align: center; color: var(--danger); font-size: 13px; font-weight: 600; }
.login-switch { margin-top: 18px; text-align: center; font-size: 13px; }
.login-switch button { background: none; border: 0; color: var(--text-dim); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.login-foot { text-align: center; color: var(--text-faint); font-size: 12px; }
.login-clock { font-size: 13px; color: var(--text-dim); text-align: right; }
.login-clock b { color: var(--text); font-size: 18px; display: block; font-variant-numeric: tabular-nums; }
.stack { display: grid; gap: 14px; }

/* ---------- console (agent) ---------- */
.console { height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto 1fr; overflow: hidden; }
.topbar {
  display: flex; align-items: center; gap: 16px; padding: 10px 18px; min-height: 60px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.topbar .station-chip {
  display: flex; align-items: center; gap: 10px; padding: 6px 12px 6px 10px; border-radius: 10px;
  background: var(--gold-soft); border: 1px solid color-mix(in srgb, var(--gold) 35%, transparent);
}
.station-chip .label { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); font-weight: 700; }
.station-chip .name { font-weight: 800; font-size: 15px; }
.topbar .spacer { flex: 1; }
.clocks { display: flex; gap: 18px; }
.clock { line-height: 1.1; text-align: right; }
.clock .tz { font-size: 10px; letter-spacing: .1em; color: var(--text-faint); font-weight: 700; }
.clock .t { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stats { display: flex; gap: 14px; }
.stat { line-height: 1.1; }
.stat .v { font-weight: 800; font-size: 17px; font-variant-numeric: tabular-nums; }
.stat .k { font-size: 10px; letter-spacing: .1em; color: var(--text-faint); font-weight: 700; text-transform: uppercase; }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: transparent; padding: 0 10px; height: 30px; font-size: 12px; font-weight: 700; cursor: pointer; color: var(--text-dim); }
.seg button.on { background: var(--gold); color: var(--gold-ink); }
.live { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--text-dim); }
.preview-bar {
  display: flex; align-items: center; gap: 12px; padding: 8px 18px; font-size: 13px; font-weight: 600;
  background: var(--info-soft); color: var(--info); border-bottom: 1px solid var(--border);
}
.console-body { display: grid; grid-template-columns: 270px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); min-height: 0; }
.rail { border-right: 1px solid var(--border); background: var(--surface); display: grid; grid-template-rows: auto 1fr; min-height: 0; }
.rail-search { padding: 12px; border-bottom: 1px solid var(--border); }
.rail-list { overflow: auto; padding: 6px; }
.rail-item {
  width: 100%; display: grid; grid-template-columns: 28px 1fr auto; gap: 8px; align-items: center;
  text-align: left; padding: 8px; border: 0; border-radius: 8px; background: transparent; cursor: pointer;
}
.rail-item:hover { background: var(--surface-3); }
.rail-item.active { background: var(--gold-soft); }
.rail-item .idx { font: 700 12px var(--mono); color: var(--text-faint); text-align: center; }
.rail-item .nm { font-weight: 650; font-size: 13px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-item .sub { font-size: 11.5px; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-item .flags { display: flex; gap: 4px; }
.console-main { overflow: auto; padding: 16px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 470px), 1fr)); gap: 14px; align-items: start; }
.compact .cards { grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 10px; }

.site-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
  scroll-margin: 16px; transition: box-shadow .3s, border-color .3s;
}
.site-card.flash { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.site-card.is-new { border-color: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.sc-head { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; padding: 14px; align-items: start; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.compact .sc-head { grid-template-columns: 44px 1fr auto; padding: 10px 12px; }
.sc-thumb {
  width: 64px; height: 64px; border-radius: 10px; overflow: hidden; background: var(--surface-3);
  display: grid; place-items: center; font-weight: 800; font-size: 18px; color: var(--gold); border: 1px solid var(--border);
}
.compact .sc-thumb { width: 44px; height: 44px; font-size: 14px; }
.sc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.sc-title { min-width: 0; }
.sc-title .idx { font: 700 11px var(--mono); color: var(--gold); letter-spacing: .06em; }
.sc-title h2 { margin: 1px 0 2px; font-size: 17px; line-height: 1.2; letter-spacing: -.01em; }
.compact .sc-title h2 { font-size: 15px; }
.sc-addr { font-size: 12.5px; color: var(--text-dim); display: block; }
.sc-addr:hover { color: var(--info); }
.sc-side { display: grid; gap: 6px; justify-items: end; }
.sc-local { text-align: right; line-height: 1.1; }
.sc-local .t { font: 700 16px var(--font); font-variant-numeric: tabular-nums; }
.sc-local .z { font-size: 10px; color: var(--warn); font-weight: 800; letter-spacing: .06em; }
.sc-body { padding: 12px 14px 14px; display: grid; gap: 12px; }
.compact .sc-body { padding: 10px 12px 12px; gap: 9px; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.summary { font-size: 13px; color: var(--text-dim); margin: 0; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; }
.fact { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; min-width: 0; }
.fact dt { font-size: 10px; letter-spacing: .09em; text-transform: uppercase; color: var(--text-faint); font-weight: 700; }
.fact dd { margin: 2px 0 0; font-weight: 600; font-size: 13px; overflow-wrap: anywhere; }
.fact.code { box-shadow: inset 3px 0 0 var(--brand-red); }
.fact.code dd { font-family: var(--mono); color: var(--text); font-weight: 700; font-size: 14px; letter-spacing: .03em; }
.fact.wide { grid-column: 1 / -1; }
.alerts { display: grid; gap: 6px; }
.alert { display: grid; grid-template-columns: 18px 1fr; gap: 8px; padding: 8px 10px; border-radius: 8px; font-size: 13px; font-weight: 550; line-height: 1.4; }
.alert.alert { background: var(--danger-soft); color: var(--text); border-left: 3px solid var(--danger); }
.alert.package { background: var(--info-soft); border-left: 3px solid var(--info); }
.alert .ic { font-size: 13px; }
.section-label { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint); font-weight: 800; margin: 0 0 6px; display: flex; align-items: center; gap: 8px; }
.objectives { white-space: pre-line; font-size: 13.5px; margin: 0; padding: 10px 12px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); border-left: 3px solid var(--brand-red); }
.contacts { display: grid; gap: 4px; }
.contact { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 6px 10px; border-radius: 8px; background: var(--surface-2); font-size: 13px; }
.contact.police { background: var(--info-soft); }
.contact .who { min-width: 0; }
.contact .who b { font-weight: 650; }
.contact .who small { display: block; color: var(--text-faint); font-size: 11.5px; }
.contact .ph { font: 600 13px var(--mono); white-space: nowrap; display: flex; gap: 6px; align-items: center; }
.access { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.access-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 10px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.access-grid { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; padding: 8px 10px; align-items: center; font-size: 13px; }
.access-grid .k { color: var(--text-faint); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.access-grid .v { font-family: var(--mono); font-weight: 600; overflow-wrap: anywhere; }
.access-grid .acts { display: flex; gap: 4px; }
.cams-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cam-chips { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; }
.cam-chip { font: 600 10.5px var(--mono); padding: 2px 6px; border-radius: 5px; background: var(--surface-3); color: var(--text-faint); }
.cam-chip.live { background: var(--ok-soft); color: var(--ok); }
details.protocol { border: 1px solid var(--border); border-radius: 10px; }
details.protocol summary { cursor: pointer; padding: 8px 12px; font-weight: 700; font-size: 12.5px; list-style: none; display: flex; justify-content: space-between; color: var(--text-dim); }
details.protocol summary::-webkit-details-marker { display: none; }
details.protocol summary::after { content: "▸"; transition: transform .15s; }
details.protocol[open] summary::after { transform: rotate(90deg); }
.notes { white-space: pre-wrap; font-size: 13.5px; line-height: 1.6; padding: 4px 14px 14px; overflow-wrap: anywhere; }
.notes .hl { background: var(--danger-soft); border-radius: 4px; padding: 1px 3px; font-weight: 600; }
.empty-state { text-align: center; padding: 70px 20px; color: var(--text-dim); }
.empty-state h3 { color: var(--text); margin: 12px 0 6px; }

/* ---------- overlays (camera wall, site detail, modals) ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(3, 6, 12, .72); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 16px; animation: fade .12s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(560px, 100%); max-height: calc(100vh - 32px); display: grid; grid-template-rows: auto 1fr auto; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.modal.wide { width: min(980px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-body { padding: 18px; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); background: var(--surface-2); flex-wrap: wrap; }
.modal-foot .left { margin-right: auto; }
.big-pin { font: 700 44px var(--mono); letter-spacing: .25em; text-align: center; padding: 18px; border-radius: 12px; background: var(--gold-soft); color: var(--gold); margin: 6px 0 12px; }

.wall { position: fixed; inset: 0; z-index: 60; background: #000; display: grid; grid-template-rows: auto 1fr; animation: fade .12s; }
.wall-head { display: flex; align-items: center; gap: 14px; padding: 10px 16px; background: #0B0F18; color: #EEF2F8; border-bottom: 1px solid #1E2738; }
.wall-head h3 { margin: 0; font-size: 15px; }
.wall-grid { display: grid; gap: 4px; padding: 4px; min-height: 0; overflow: auto; }
.tile { position: relative; background: #0A0E16; border: 1px solid #1A2232; border-radius: 4px; overflow: hidden; aspect-ratio: 16 / 9; display: grid; place-items: center; }
.tile video, .tile img, .tile iframe { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; border: 0; background: #000; }
.tile .cap { position: absolute; left: 6px; top: 6px; z-index: 2; font: 600 11px var(--mono); padding: 2px 7px; border-radius: 4px; background: rgba(0,0,0,.65); color: #fff; }
.tile .ph { text-align: center; color: #6E7A93; font-size: 12px; padding: 10px; line-height: 1.5; }
.tile .ph b { color: #A3AFC6; display: block; font-size: 13px; }
.tile.expanded { position: fixed; inset: 52px 0 0 0; z-index: 3; aspect-ratio: auto; border-radius: 0; }

.detail { width: min(1280px, 100%); height: calc(100vh - 32px); display: grid; grid-template-rows: auto 1fr; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.detail-body { display: grid; grid-template-columns: 420px 1fr; min-height: 0; }
.detail-info { overflow: auto; border-right: 1px solid var(--border); }
.detail-main { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; min-height: 0; }
.tabs { display: flex; gap: 2px; padding: 8px 12px 0; border-bottom: 1px solid var(--border); }
.tabs button { border: 0; background: transparent; padding: 9px 14px; font-weight: 700; font-size: 13px; color: var(--text-dim); cursor: pointer; border-bottom: 2px solid transparent; }
.tabs button.on { color: var(--text); border-bottom-color: var(--gold); }
.tab-pane { overflow: auto; min-height: 0; }
.map-frame { width: 100%; height: 100%; min-height: 420px; border: 0; display: block; }
.detail-photo { width: 100%; max-height: 260px; object-fit: cover; display: block; }

/* ---------- toasts & menus ---------- */
#toasts { position: fixed; right: 16px; bottom: 16px; z-index: 100; display: grid; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast { padding: 11px 14px; border-radius: 10px; background: var(--surface-3); border: 1px solid var(--border-strong); box-shadow: var(--shadow); font-size: 13px; font-weight: 550; animation: slide .18s; display: flex; gap: 10px; align-items: flex-start; }
.toast.ok { border-left: 4px solid var(--ok); }
.toast.err { border-left: 4px solid var(--danger); }
.toast.info { border-left: 4px solid var(--gold); }
@keyframes slide { from { transform: translateY(8px); opacity: 0; } }
.menu { position: fixed; z-index: 80; min-width: 200px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px; box-shadow: var(--shadow); padding: 5px; animation: fade .1s; }
.menu button { display: flex; width: 100%; align-items: center; gap: 8px; border: 0; background: transparent; padding: 8px 10px; border-radius: 6px; text-align: left; cursor: pointer; font-size: 13px; font-weight: 550; }
.menu button:hover { background: var(--surface-3); }
.menu button.danger { color: var(--danger); }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: 4px 0; }
.menu .menu-label { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint); font-weight: 800; padding: 6px 10px 2px; }

/* ---------- admin shell ---------- */
.admin { display: grid; grid-template-columns: 236px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); height: 100vh; overflow: hidden; }
.nav { background: var(--surface); border-right: 1px solid var(--border); display: grid; grid-template-rows: auto 1fr auto; min-height: 0; }
.nav-top { padding: 16px; border-bottom: 1px solid var(--border); }
.nav-links { padding: 10px; display: grid; gap: 2px; align-content: start; overflow: auto; }
.nav-links a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; color: var(--text-dim); font-weight: 600; font-size: 13.5px; text-decoration: none; }
.nav-links a:hover { background: var(--surface-3); color: var(--text); }
.nav-links a.on { background: var(--gold-soft); color: var(--text); box-shadow: inset 3px 0 0 var(--gold); }
.nav-links a svg { width: 17px; height: 17px; flex: none; }
.nav-links .count { margin-left: auto; font-size: 11px; font-weight: 700; color: var(--text-faint); }
.nav-foot { padding: 12px; border-top: 1px solid var(--border); display: grid; gap: 10px; }
.who-card { display: flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--gold); color: var(--gold-ink); display: grid; place-items: center; font-weight: 800; font-size: 13px; flex: none; }
.who-card .n { font-weight: 700; font-size: 13px; }
.who-card .r { font-size: 11px; color: var(--text-faint); }
.nav-foot .row { display: flex; gap: 6px; }
.admin-main { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; min-width: 0; min-height: 0; }
.page-head { display: flex; align-items: center; gap: 12px; padding: 14px 22px; border-bottom: 1px solid var(--border); background: var(--surface); flex-wrap: wrap; min-height: 64px; }
.page-head h1 { margin: 0; font-size: 19px; letter-spacing: -.01em; }
.page-head .sub { color: var(--text-faint); font-size: 12.5px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.page-body { overflow: auto; padding: 20px 22px; min-height: 0; }
.banner { display: flex; gap: 12px; align-items: center; padding: 10px 14px; border-radius: 10px; font-size: 13px; margin-bottom: 16px; border: 1px solid var(--border); background: var(--surface); }
.banner.green { background: var(--ok-soft); border-color: transparent; }
.banner.amber { background: var(--warn-soft); border-color: transparent; }
.banner.red { background: var(--danger-soft); border-color: transparent; }
.banner .grow { flex: 1; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.kpi .k { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-faint); font-weight: 700; }
.kpi .v { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; margin-top: 2px; }
.kpi .v small { font-size: 13px; color: var(--text-faint); font-weight: 600; }

/* ---------- board ---------- */
.board-tools { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.board-tools .input { max-width: 300px; }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(290px, 320px); gap: 14px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.col { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; display: grid; grid-template-rows: auto 1fr; max-height: calc(100vh - 230px); min-height: 220px; }
.col.unassigned { background: transparent; border-style: dashed; }
.col-head { padding: 12px 12px 10px; border-bottom: 1px solid var(--border); display: grid; gap: 6px; }
.col-title { display: flex; align-items: center; gap: 8px; }
.col-title h3 { margin: 0; font-size: 15px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col-meta { font-size: 12px; color: var(--text-dim); display: flex; gap: 10px; flex-wrap: wrap; }
.col-meta b { color: var(--text); font-variant-numeric: tabular-nums; }
.loadbar { height: 4px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.loadbar span { display: block; height: 100%; background: var(--gold); border-radius: 4px; transition: width .3s; }
.loadbar.heavy span { background: var(--warn); }
.col-list { padding: 8px; display: grid; gap: 6px; align-content: start; overflow-y: auto; min-height: 120px; border-radius: 0 0 14px 14px; transition: background .12s; }
.col-list.over { background: var(--gold-soft); }
.col-empty { text-align: center; color: var(--text-faint); font-size: 12px; padding: 26px 8px; border: 1px dashed var(--border-strong); border-radius: 10px; }
.bcard { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 8px 8px 8px 6px; display: grid; grid-template-columns: 16px 1fr auto; gap: 6px; align-items: center; cursor: grab; transition: border-color .12s, opacity .12s, transform .12s; }
.bcard:hover { border-color: var(--border-strong); }
.bcard.dragging { opacity: .35; }
.bcard.dim { opacity: .3; }
.bcard.hit { border-color: var(--gold); }
.bcard .grip { color: var(--text-faint); font-size: 12px; letter-spacing: -2px; user-select: none; text-align: center; }
.bcard .nm { font-weight: 650; font-size: 13px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bcard .sub { font-size: 11.5px; color: var(--text-faint); display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.bcard .sub .pill { height: 17px; font-size: 10px; padding: 0 6px; }
.bcard .main { min-width: 0; }
.drop-marker { height: 3px; border-radius: 3px; background: var(--gold); margin: -2px 2px; }

/* ---------- tables ---------- */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--text-faint); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); position: sticky; top: 0; white-space: nowrap; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:hover td { background: color-mix(in srgb, var(--surface-3) 45%, transparent); }
.tbl .nm { font-weight: 650; }
.tbl .sub { font-size: 12px; color: var(--text-faint); }
.tbl .acts { display: flex; gap: 6px; justify-content: flex-end; }
.tbl select.input { height: 30px; font-size: 12.5px; padding: 0 6px; min-width: 140px; }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px; margin-bottom: 18px; }
.panel h2 { margin: 0 0 4px; font-size: 16px; display: flex; align-items: center; gap: 10px; }
.panel > p.lead { margin: 0 0 16px; color: var(--text-dim); font-size: 13px; }
.steps { margin: 0 0 16px; padding-left: 20px; color: var(--text-dim); font-size: 13px; line-height: 1.7; }
.steps b { color: var(--text); }
.codebox { position: relative; }
.codebox pre { margin: 0; max-height: 260px; overflow: auto; padding: 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); font: 12px/1.5 var(--mono); }
.codebox .btn { position: absolute; top: 8px; right: 8px; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 14px; font-size: 13px; }
.kv dt { color: var(--text-faint); font-weight: 600; }
.kv dd { margin: 0; }
.warnlist { margin: 8px 0 0; padding-left: 18px; font-size: 12.5px; color: var(--warn); line-height: 1.6; }
.dropzone { border: 2px dashed var(--border-strong); border-radius: 12px; padding: 26px; text-align: center; color: var(--text-dim); cursor: pointer; transition: all .12s; }
.dropzone:hover, .dropzone.over { border-color: var(--gold); background: var(--gold-soft); color: var(--text); }
.cam-table td { padding: 5px 6px; }
.cam-table .input { height: 32px; }
.photo-box { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.photo-box .preview { width: 260px; height: 160px; border-radius: 10px; background: var(--surface-3); display: grid; place-items: center; overflow: hidden; color: var(--text-faint); border: 1px solid var(--border); }
.photo-box .preview img { width: 100%; height: 100%; object-fit: cover; }
.form-section { border-top: 1px solid var(--border); padding-top: 16px; margin-top: 18px; }
.form-section:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.form-section h4 { margin: 0 0 12px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-faint); }
.locked-note { font-size: 12px; color: var(--warn); display: flex; gap: 6px; align-items: center; margin-bottom: 10px; }
.log-row { display: grid; grid-template-columns: 150px 170px 140px 1fr; gap: 12px; padding: 9px 14px; border-bottom: 1px solid var(--border); font-size: 13px; align-items: baseline; }
.log-row:last-child { border-bottom: 0; }
.log-row .t { color: var(--text-faint); font-variant-numeric: tabular-nums; font-size: 12px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .detail-body { grid-template-columns: 1fr; overflow: auto; }
  .detail-info { border-right: 0; border-bottom: 1px solid var(--border); overflow: visible; }
  .detail-main { min-height: 70vh; }
  .stats { display: none; }
}
@media (max-width: 900px) {
  .admin { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; height: auto; min-height: 100vh; overflow: visible; }
  .nav { grid-template-rows: auto; grid-template-columns: minmax(0, 1fr); border-right: 0; border-bottom: 1px solid var(--border); }
  .nav-top { display: flex; justify-content: space-between; align-items: center; }
  .nav-links { display: flex; overflow-x: auto; padding: 6px 10px; }
  .nav-links a { white-space: nowrap; }
  .nav-links .count { display: none; }
  .nav-foot { display: none; }
  .nav-top .mobile-acts { display: flex !important; gap: 6px; }
  #userForm { grid-template-columns: 1fr !important; }
  .admin-main { min-height: 0; }
  .page-body { overflow: visible; padding: 16px; }
  .page-head { padding: 12px 16px; }
  .col { max-height: none; }
  .console { height: auto; min-height: 100vh; overflow: visible; }
  .console-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; }
  .rail { display: none; }
  .console-main { overflow: visible; padding: 12px; }
  .topbar { flex-wrap: wrap; padding: 10px 12px; gap: 10px; }
  .clocks .clock:nth-child(n+2) { display: none; }
  .log-row { grid-template-columns: 1fr; gap: 2px; }
  .facts { grid-template-columns: 1fr; }
  .sc-head { grid-template-columns: 48px 1fr; }
  .sc-thumb { width: 48px; height: 48px; }
  .sc-side { grid-column: 1 / -1; justify-items: start; grid-auto-flow: column; justify-content: start; align-items: center; }
}
.nav-top .mobile-acts { display: none; }

/* ---------- site photos ---------- */
button.sc-thumb { padding: 0; cursor: zoom-in; position: relative; font: inherit; color: var(--gold); }
.thumb-count { position: absolute; right: 3px; bottom: 3px; font: 700 10px var(--font); background: rgba(0,0,0,.7); color: #fff; border-radius: 5px; padding: 1px 5px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; padding: 14px; }
.gallery a { position: relative; display: block; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-3); aspect-ratio: 4 / 3; }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery.small { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); padding: 0; }
.gallery span { position: absolute; left: 6px; bottom: 6px; font: 600 11px var(--mono); background: rgba(0,0,0,.65); color: #fff; padding: 1px 6px; border-radius: 4px; }

/* =====================================================================
   Login — one centred page in the Live Lion brand red
   (always dark, whatever theme the floor manager picked)
   ===================================================================== */
.auth {
  --brand-red: #DC2216;
  /* re-point the accent + surface tokens so every component on this page is on-brand */
  --gold: #DC2216; --gold-strong: #F0392D; --gold-ink: #FFFFFF; --gold-soft: rgba(220, 34, 22, .14);
  --focus: 0 0 0 3px rgba(220, 34, 22, .45);
  --bg: #07090D; --surface: rgba(17, 20, 27, .86); --surface-2: #141821; --surface-3: #1C212C;
  --border: #252B37; --border-strong: #343B4A; --text: #F2F4F8; --text-dim: #A6ADBB; --text-faint: #6F7685;
  --danger: #FF5C63;
  color-scheme: dark;
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 100vh; display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
  grid-template-areas: "top top top" "left center right" "foot foot foot";
  color: var(--text);
  background: #07090D;
}
.auth-top { grid-area: top; }
.auth-left { grid-area: left; }
.auth-center { grid-area: center; }
.auth-right { grid-area: right; }
.auth-foot { grid-area: foot; }

/* background: a dimmed monitoring "video wall", then a darkening/branding overlay */
.auth-wall {
  position: absolute; inset: -12px; z-index: -3; display: grid; gap: 6px; padding: 6px;
  grid-template-columns: repeat(5, 1fr); grid-template-rows: repeat(3, 1fr);
  opacity: .85; filter: blur(.6px) saturate(.6);
}
.vw-tile { position: relative; overflow: hidden; border-radius: 6px; border: 1px solid rgba(255,255,255,.05); }
.vw-tile::after { /* CRT scanlines */
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,.035) 0 1px, transparent 1px 3px);
}
/* five abstract "scenes" so the wall doesn't look tiled */
.vw-tile.t0 { background: linear-gradient(180deg, #3A4252 0%, #282E39 52%, #4A4F58 53%, #1F232A 100%); }
.vw-tile.t1 { background: radial-gradient(60% 50% at 30% 30%, #565C67, transparent 70%), linear-gradient(160deg, #2C323C, #171A20); }
.vw-tile.t2 { background: repeating-linear-gradient(115deg, #313741 0 26px, #232830 26px 52px), #232830; }
.vw-tile.t3 { background: conic-gradient(from 200deg at 50% 45%, #1B1F25, #40464F, #1B1F25 40%, #353B44 70%, #1B1F25); }
.vw-tile.t4 { background: linear-gradient(90deg, #1D2128 0 30%, #3C424C 30% 34%, #262A32 34% 66%, #3C424C 66% 70%, #1D2128 70%), #1D2128; }
.vw-cap, .vw-rec, .vw-time { position: absolute; z-index: 1; font: 600 10px var(--mono); letter-spacing: .04em; color: rgba(255,255,255,.75); }
.vw-cap { left: 8px; top: 6px; }
.vw-rec { right: 8px; top: 6px; color: #FF4B3E; animation: rec 2s steps(2, start) infinite; }
.vw-time { left: 8px; bottom: 6px; }
@keyframes rec { 50% { opacity: .2; } }
.auth::after {
  content: ""; position: absolute; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(560px 440px at 50% 42%, rgba(220, 34, 22, .18), transparent 70%),
    radial-gradient(ellipse 34% 60% at 50% 48%, rgba(7, 9, 13, .82), rgba(7, 9, 13, .5) 100%),
    radial-gradient(ellipse 130% 100% at 50% 45%, rgba(7, 9, 13, .35) 40%, rgba(7, 9, 13, .9) 95%);
}
.auth::before { /* faint surveillance grid over the wall, fading out toward the edges */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 20%, transparent 75%);
}

/* side panels */
.auth-side { align-self: center; display: flex; flex-direction: column; gap: 14px; padding-bottom: 40px; }
.auth-left { justify-self: end; width: min(420px, calc(100% - 96px)); margin: 0 48px 40px 24px; }
.auth-right { justify-self: start; width: min(290px, calc(100% - 96px)); margin: 0 24px 40px 48px; }
.auth-side {
  padding: 26px 28px; border-radius: 18px;
  background: rgba(9, 11, 16, .78); border: 1px solid rgba(255, 255, 255, .06);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
}
.auth-eyebrow { font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--brand-red); }
.auth-headline { margin: 0; font-size: clamp(24px, 2.05vw, 36px); line-height: 1.12; letter-spacing: -.02em; font-weight: 800; text-wrap: balance; }
.auth-headline span { color: var(--brand-red); }
.auth-copy { margin: 0; color: var(--text-dim); font-size: 14.5px; line-height: 1.65; }
.auth-features { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 14px; }
.auth-features li { display: flex; gap: 12px; align-items: flex-start; }
.auth-features li > svg, .ops-help > svg {
  width: 36px; height: 36px; padding: 9px; flex: none; border-radius: 10px;
  color: var(--brand-red); background: rgba(220, 34, 22, .1); border: 1px solid rgba(220, 34, 22, .25);
}
.auth-features b, .ops-help b { display: block; font-size: 14px; }
.auth-features span, .ops-help span { display: block; font-size: 12.5px; color: var(--text-faint); margin-top: 1px; line-height: 1.45; }
.ops-clock { padding: 14px 16px; border-radius: 14px; background: rgba(17, 20, 27, .7); border: 1px solid var(--border); }
.ops-clock span { display: block; font-size: 10.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--text-faint); }
.ops-clock b { display: block; font-size: 34px; font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -.01em; line-height: 1.15; }
.ops-clock.small b { font-size: 24px; }
.ops-date { font-size: 13px; color: var(--text-dim); padding-left: 2px; }
.ops-stat { padding: 12px 16px; border-left: 3px solid var(--brand-red); background: rgba(220, 34, 22, .07); border-radius: 0 10px 10px 0; }
.ops-stat b { display: block; font-size: 18px; letter-spacing: .02em; }
.ops-stat span { font-size: 12.5px; color: var(--text-dim); }
.ops-help { display: flex; gap: 12px; align-items: flex-start; margin-top: 4px; }
.auth-secure { display: none; align-items: center; gap: 7px; font-size: 12px; color: var(--text-faint); }
.auth-secure svg { width: 14px; height: 14px; color: #2FD683; }

/* wide screens: side panels visible, so the top bar and under-card points slim down */
@media (min-width: 1280px) {
  .auth-top .auth-clocks, .auth-points { display: none !important; }
  .auth-secure { display: inline-flex; }
}
@media (max-width: 1279px) {
  .auth { grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "center" "foot"; }
  .auth-side { display: none; }
}

.auth-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 28px; flex-wrap: wrap; }
.auth-status {
  display: inline-flex; align-items: center; gap: 9px; padding: 6px 12px; border-radius: 999px;
  font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  color: #F2F4F8; background: rgba(255,255,255,.04); border: 1px solid var(--border);
}
.auth-status .dot { width: 7px; height: 7px; }
.auth-clocks { display: flex; align-items: center; gap: 26px; }
.auth-clock { text-align: right; line-height: 1.15; }
.auth-clock span { display: block; font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--text-faint); }
.auth-clock b { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.auth-date { color: var(--text-faint); font-size: 12.5px; padding-left: 22px; border-left: 1px solid var(--border); }

.auth-center { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 16px 16px; text-align: center; }
.auth-logo { width: 92px; height: auto; filter: drop-shadow(0 10px 30px rgba(220, 34, 22, .28)); }
.auth-title { margin: 10px 0 2px; font-size: 23px; font-weight: 800; letter-spacing: -.01em; }
.auth-sub { margin: 0 0 16px; color: var(--text-dim); font-size: 14px; }

.auth-card {
  width: min(400px, 100%); text-align: left; padding: 18px 22px 20px; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: 0 30px 80px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.04);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); margin-bottom: 14px; }
.auth-tabs button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; border: 0; border-radius: 9px; background: transparent; color: var(--text-dim); font-weight: 700; font-size: 13px; cursor: pointer; transition: background .15s, color .15s; }
.auth-tabs button:hover { color: var(--text); }
.auth-tabs button.on { background: var(--surface-3); color: var(--text); box-shadow: inset 0 -2px 0 var(--brand-red); }
.auth-form .lead { margin: 0 0 12px; color: var(--text-dim); font-size: 13.5px; line-height: 1.5; }
.input.lg { height: 42px; font-size: 15px; padding: 0 14px; }
.auth .input { background: #0D1016; }
.btn.lg { width: 100%; height: 48px; font-size: 15px; border-radius: 10px; margin-top: 12px; }
.btn.lg svg { width: 18px; height: 18px; }
.auth .btn.primary { box-shadow: 0 10px 24px rgba(220, 34, 22, .3); }
.field-label { font-size: 12px; font-weight: 600; color: var(--text-dim); margin: 12px 0 7px; }
.pin-boxes { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; margin-bottom: 10px; }
.pin-boxes span { position: relative; height: 46px; border-radius: 11px; border: 1.5px solid var(--border-strong); background: #0D1016; transition: border-color .12s, box-shadow .12s; }
.pin-boxes span.on { border-color: var(--brand-red); background: var(--gold-soft); }
.pin-boxes span.on::after { content: ""; position: absolute; left: 50%; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--brand-red); }
.pin-boxes span.next { border-color: var(--brand-red); box-shadow: var(--focus); }
.pin-boxes.shake { animation: shake .35s; }
.auth-form .keypad { gap: 8px; }
.auth-form .key { height: 46px; border-radius: 11px; font-size: 21px; background: var(--surface-2); }
.auth-form .key:hover { background: var(--surface-3); }
.auth-form .login-msg { margin-top: 12px; }

.auth-points { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; margin: 16px 0 0; padding: 0; color: var(--text-faint); font-size: 12.5px; }
.auth-points li { display: inline-flex; align-items: center; gap: 7px; }
.auth-points svg { width: 15px; height: 15px; color: var(--brand-red); }
.auth-foot { text-align: center; color: var(--text-faint); font-size: 11.5px; padding: 0 16px 14px; }

@media (max-height: 980px) and (min-width: 721px) {
  .auth-points { display: none; }            /* keep the sign-in fully on one screen */
}
.auth .login-msg:empty { display: none; }
@media (max-height: 820px) and (min-width: 721px) {
  .auth-top { padding: 8px 24px; }
  .auth-clock b { font-size: 15px; }
  .auth-logo { width: 56px; }
  .auth-title { font-size: 19px; margin: 4px 0 10px; }
  .auth-sub, .auth-form .lead { display: none; }
  .auth-card { padding: 14px 20px 16px; }
  .auth-tabs { margin-bottom: 10px; }
  .auth-tabs button { height: 32px; }
  .auth .input.lg { height: 38px; }
  .field-label { margin: 8px 0 6px; }
  .pin-boxes span { height: 38px; }
  .auth-form .keypad { gap: 6px; }
  .auth-form .key { height: 36px; font-size: 18px; }
  .btn.lg { height: 42px; margin-top: 10px; }
  .auth-foot { padding-bottom: 6px; }
}
@media (max-width: 720px) {
  .auth-top { padding: 12px 16px; justify-content: center; }
  .auth-status, .auth-date, .auth-clock:nth-child(2) { display: none; }
  .auth-clock { text-align: center; }
  .auth-logo { width: 96px; }
  .auth-title { font-size: 21px; margin-top: 12px; }
  .auth-card { padding: 18px 16px 20px; }
}

/* =====================================================================
   Agent console — one site per screen
   ===================================================================== */
.console-main { padding: 0; scroll-snap-type: y proximity; position: relative; }
.pager {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px; min-height: 58px; padding: 9px 22px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.pager:empty { display: none; }
.pager .btn.icon { width: 36px; height: 36px; }
.pager-pos { display: flex; align-items: baseline; gap: 12px; min-width: 0; margin-left: 6px; }
.pager-count { font: 600 13px var(--mono); color: var(--text-faint); white-space: nowrap; }
.pager-count b { color: var(--gold); font-size: 16px; }
.pager-name { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pager-dots { margin-left: auto; display: flex; gap: 5px; align-items: center; }
.pager-dots span { width: 6px; height: 6px; border-radius: 6px; background: var(--border-strong); transition: width .2s, background .2s; }
.pager-dots span.on { width: 20px; background: var(--gold); }
.pager-hint { font-size: 11.5px; color: var(--text-faint); white-space: nowrap; margin-left: 12px; }

.site-page {
  scroll-snap-align: start; scroll-margin-top: 58px; min-height: calc(100vh - 128px);
  padding: 26px 30px 40px; display: flex; flex-direction: column; gap: 22px;
  border-bottom: 1px solid var(--border); transition: background .4s;
}
.site-page.is-new { background: var(--ok-soft); }
.sp-hero { display: grid; grid-template-columns: 320px minmax(0, 1fr) auto; gap: 26px; align-items: start; }
.sp-photo { position: relative; display: block; width: 100%; aspect-ratio: 4 / 3; padding: 0; border-radius: 16px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-3); cursor: zoom-in; box-shadow: var(--shadow); }
.sp-photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s; }
button.sp-photo:hover img { transform: scale(1.03); }
.sp-photo .thumb-count { right: 8px; bottom: 8px; display: inline-flex; gap: 5px; align-items: center; font-size: 11.5px; padding: 3px 8px; border-radius: 7px; }
.sp-photo .thumb-count svg { width: 13px; height: 13px; }
.sp-photo.empty { display: grid; place-content: center; text-align: center; cursor: default; box-shadow: none; border-style: dashed; }
.sp-photo.empty span { font-size: 40px; font-weight: 800; color: var(--gold); letter-spacing: .02em; }
.sp-photo.empty small { color: var(--text-faint); font-size: 12px; }
.sp-kicker { font: 700 11.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }
.sp-title h2 { margin: 6px 0 8px; font-size: 32px; line-height: 1.12; letter-spacing: -.02em; font-weight: 800; }
.sp-addr { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 14px; }
.sp-addr a { display: inline-flex; align-items: center; gap: 6px; color: var(--text-dim); font-size: 14px; }
.sp-addr a:hover { color: var(--info); }
.sp-addr svg { width: 15px; height: 15px; color: var(--gold); }
.sp-title .summary { margin-top: 14px; max-width: 80ch; font-size: 14px; line-height: 1.6; }
.sp-side { display: grid; gap: 12px; justify-items: end; }
.sp-clock { text-align: right; padding: 10px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); min-width: 170px; }
.sp-clock .k { font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--text-faint); }
.sp-clock .v { font-size: 28px; font-weight: 750; font-variant-numeric: tabular-nums; line-height: 1.15; }
.sp-clock.other { border-color: color-mix(in srgb, var(--warn) 45%, transparent); background: var(--warn-soft); }
.sp-clock.other .k { color: var(--warn); }
.sp-actions { display: flex; gap: 8px; }
.sp-actions .btn { height: 40px; }
.sp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.sp-col { display: grid; gap: 16px; align-content: start; }
.site-page .fact { background: var(--surface); padding: 9px 12px; }
.site-page .fact dd { font-size: 14px; }
.site-page .fact.code dd { font-size: 16px; }
.site-page .alert { font-size: 13.5px; padding: 10px 12px; }
.site-page .contact { background: var(--surface); padding: 8px 12px; }
.site-page .contact.police { background: var(--info-soft); }
.site-page .access { background: var(--surface); }
.site-page details.protocol { background: var(--surface); }
.site-page details.protocol summary { padding: 12px 16px; font-size: 13.5px; }
@media (max-width: 1280px) {
  .sp-hero { grid-template-columns: 240px minmax(0, 1fr); }
  .sp-side { grid-column: 1 / -1; grid-auto-flow: column; justify-content: start; align-items: center; justify-items: start; }
  .sp-clock { text-align: left; }
}
@media (max-width: 900px) {
  .console-main { scroll-snap-type: none; }
  .pager { padding: 8px 12px; }
  .pager-hint, .pager-dots { display: none; }
  .site-page { min-height: 0; padding: 18px 14px 28px; }
  .sp-hero { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .sp-side { grid-auto-flow: row; }
  .sp-title h2 { font-size: 24px; }
  .sp-grid { grid-template-columns: minmax(0, 1fr); }
}

/* =====================================================================
   App shell — same look as the login page (backdrop, glass bars, brand red)
   ===================================================================== */
.console, .admin {
  position: relative; isolation: isolate;
  background: radial-gradient(900px 420px at 50% -8%, rgba(220, 34, 22, .13), transparent 70%), var(--bg);
}
.console::before, .admin::before { /* the login's faint surveillance grid */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.028) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.028) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 70%);
  mask-image: linear-gradient(180deg, #000 0%, transparent 70%);
}
:root[data-theme="light"] .console, :root[data-theme="light"] .admin {
  background: radial-gradient(900px 420px at 50% -8%, rgba(200, 30, 19, .07), transparent 70%), var(--bg);
}
:root[data-theme="light"] .console::before, :root[data-theme="light"] .admin::before { opacity: 0; }
.topbar, .nav, .page-head, .rail, .pager {
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.topbar { box-shadow: 0 1px 0 rgba(220, 34, 22, .25); }
.brand img { filter: drop-shadow(0 4px 12px rgba(220, 34, 22, .35)); }
.brand-name b { color: var(--brand-red); }
.station-chip { background: rgba(220, 34, 22, .1); border-color: rgba(220, 34, 22, .35); }
.station-chip .label { color: var(--brand-red); }
.btn.primary { box-shadow: 0 8px 20px rgba(220, 34, 22, .22); }
.nav-links a.on { background: rgba(220, 34, 22, .1); box-shadow: inset 3px 0 0 var(--brand-red); }
.kpi, .panel, .table-wrap, .col:not(.unassigned) { background: color-mix(in srgb, var(--surface) 92%, transparent); }
.kpi { position: relative; overflow: hidden; }
.kpi::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--brand-red); opacity: .85; }

/* =====================================================================
   Site protocol — formatted instead of raw text
   ===================================================================== */
.protocol-body { padding: 4px 16px 16px; font-size: 14px; line-height: 1.6; columns: 2 380px; column-gap: 14px; }
.protocol-body > * { break-inside: avoid; margin: 0 0 10px; }
.tab-pane .protocol-body { padding: 18px 22px; }
.pr-block, .pr-sec { display: grid; gap: 8px; }
.pr-sec { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.pr-sec h4 { margin: 0 0 2px; display: flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--text-dim); }
.pr-sec h4 .e { font-size: 14px; letter-spacing: 0; }
.pr-sec.lvl { border-left-width: 4px; }
.pr-sec.lvl h4 { font-size: 14px; letter-spacing: 0; text-transform: none; color: var(--text); }
.pr-sec.lvl h4 .lvl-n { font: 800 11px var(--mono); letter-spacing: .06em; padding: 2px 8px; border-radius: 999px; color: #fff; }
.pr-sec.lvl1 { border-left-color: #E8A317; } .pr-sec.lvl1 .lvl-n { background: #B97F08; }
.pr-sec.lvl2 { border-left-color: #F06A1E; } .pr-sec.lvl2 .lvl-n { background: #D3560F; }
.pr-sec.lvl3 { border-left-color: var(--danger); } .pr-sec.lvl3 .lvl-n { background: #C81E2B; }
.pr-block p, .pr-sec p { margin: 0; }
.pr-title { display: flex; align-items: center; gap: 8px; padding: 4px 2px 0; font-size: 16px; font-weight: 800; letter-spacing: -.01em; border-bottom: 2px solid var(--brand-red); padding-bottom: 6px; }
.pr-sub { font-size: 10.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--brand-red); margin-top: 2px; }
.pr-kv { display: grid; grid-template-columns: minmax(110px, 38%) minmax(0, 1fr); gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.pr-kv:last-child { border-bottom: 0; }
.pr-kv > span { color: var(--text-faint); font-size: 12.5px; font-weight: 600; }
.pr-kv > b { font-weight: 600; overflow-wrap: anywhere; }
.pr-list { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.pr-list li::marker { color: var(--brand-red); }
.pr-list li b { font-weight: 650; }
.pr-callout { display: grid; grid-template-columns: 20px 1fr; gap: 8px; padding: 10px 12px; border-radius: 10px; font-weight: 550; }
.pr-callout.alert { background: var(--danger-soft); border-left: 3px solid var(--danger); }
.pr-callout.package { background: var(--info-soft); border-left: 3px solid var(--info); }
.pr-callout.police { background: var(--info-soft); border-left: 3px solid var(--info); }
.pr-callout.info { background: var(--surface-3); border-left: 3px solid var(--text-faint); }
.pr-banner { padding: 9px 12px; border-radius: 10px; background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); color: var(--warn); font-weight: 750; font-size: 12.5px; letter-spacing: .02em; display: flex; gap: 8px; align-items: flex-start; }
.protocol-body a.tel { font-family: var(--mono); font-weight: 600; white-space: nowrap; }
.protocol-body strong.em { color: var(--danger); font-weight: 750; }
details.protocol summary { justify-content: flex-start; align-items: center; gap: 8px; color: var(--text); }
details.protocol summary svg { color: var(--brand-red); }
details.protocol summary::after { margin-left: auto; color: var(--text-faint); }
details.protocol summary .pr-count { font-weight: 600; color: var(--text-faint); font-size: 12px; margin-left: auto; margin-right: 10px; }
@media (max-width: 900px) { .protocol-body { columns: 1; padding: 4px 12px 14px; } }
