/* NAPAS FaceID — design tokens. Brand colours can be tuned here. */
:root {
  /* NAPAS logo palette */
  --brand: #033c80;
  --brand-600: #022d61;
  --brand-50: #e8eff8;
  --navy: #021d40;
  --accent: #0098d8;
  --accent-50: #e3f4fc;
  --lime: #9fc830;

  --bg: #f4f6fa;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --ink: #0f1b2d;
  --ink-2: #3c4a60;
  --muted: #6b778c;
  --line: #e2e7ef;
  --line-2: #cfd7e3;

  --ok: #12804a;
  --ok-50: #e7f6ee;
  --warn: #b25e00;
  --warn-50: #fff4e2;
  --bad: #c52a2a;
  --bad-50: #fdecec;

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(15, 27, 45, .06);
  --shadow: 0 1px 2px rgba(15, 27, 45, .05), 0 8px 24px rgba(15, 27, 45, .07);
  --font: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); text-decoration: none; }
img { display: block; max-width: 100%; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.num { font-variant-numeric: tabular-nums; }
.ico { width: 1.15em; height: 1.15em; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.18em; }
kbd { display: inline-block; font: 600 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 3px 5px; border-radius: 5px; border: 1px solid currentColor; opacity: .7; margin-left: 6px; vertical-align: 2px; }

/* ---- brand ---- */
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand .logo { height: 30px; width: auto; object-fit: contain; }
.brand .sep { width: 1px; align-self: stretch; background: var(--line-2); margin: 4px 0; }
.wordmark { font-weight: 800; letter-spacing: .04em; font-size: 20px; color: var(--brand); line-height: 1; }
.event-name { font-weight: 700; font-size: 15px; color: var(--navy); line-height: 1.15; white-space: nowrap; }
.event-name small { display: block; font-weight: 500; font-size: 12px; color: var(--muted); }
.brand.on-dark .wordmark, .brand.on-dark .event-name { color: #fff; }
.brand.on-dark .event-name small { color: rgba(255, 255, 255, .75); }
.brand.on-dark .sep { background: rgba(255, 255, 255, .3); }
.brand.on-dark .logo { height: 40px; }

/* ---- buttons & inputs ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 16px; border-radius: var(--r-sm); border: 1px solid var(--line-2);
  background: var(--panel); color: var(--ink); font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.btn:hover { border-color: var(--muted); }
.btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 35%, transparent); outline-offset: 1px; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-600); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.bad { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.bad-outline { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, white); background: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--panel-2); }
.btn.xl { min-height: 64px; font-size: 18px; border-radius: var(--r); padding: 0 22px; }
.btn.lg { min-height: 52px; font-size: 16px; border-radius: var(--r); }
.btn.sm { min-height: 32px; padding: 0 10px; font-size: 13px; }
.btn.block { width: 100%; }
.btn.icon { width: 40px; padding: 0; }
.btn.on-dark { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.25); color: #fff; }
.btn.on-dark:hover { background: rgba(255,255,255,.18); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-weight: 600; font-size: 13px; color: var(--ink-2); }
.field .help { font-size: 12px; color: var(--muted); }
.input {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: var(--r-sm);
  border: 1px solid var(--line-2); background: #fff; font-size: 16px;
}
textarea.input { min-height: 80px; resize: vertical; }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent); }
.input.lg { min-height: 56px; font-size: 20px; font-weight: 600; }
.error-text { color: var(--bad); font-weight: 600; font-size: 14px; min-height: 1.4em; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; font-size: 14px; }
.switch input { width: 20px; height: 20px; accent-color: var(--brand); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line-2); background: #fff; border-radius: 999px; padding: 7px 14px; cursor: pointer; font-weight: 600; font-size: 14px; }
.chip.on { background: var(--brand); color: #fff; border-color: var(--brand); }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge.ok { background: var(--ok-50); color: var(--ok); }
.badge.warn { background: var(--warn-50); color: var(--warn); }
.badge.bad { background: var(--bad-50); color: var(--bad); }
.badge.info { background: var(--brand-50); color: var(--brand); }
.badge.neutral { background: var(--panel-2); color: var(--ink-2); border: 1px solid var(--line); }
.badge.BTC { background: var(--brand-50); color: var(--brand); }
.badge.NAPAS { background: var(--accent-50); color: #006b99; }
.badge.count { background: var(--bad); color: #fff; padding: 1px 7px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.ok { background: #19a463; box-shadow: 0 0 0 3px rgba(25, 164, 99, .18); }
.dot.bad { background: var(--bad); box-shadow: 0 0 0 3px rgba(197, 42, 42, .18); }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.card-head h3 { margin: 0; font-size: 15px; }
h1, h2, h3 { letter-spacing: -.01em; }

/* ---- app header ---- */
.appbar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 16px;
  padding: 10px 20px; background: #fff; border-bottom: 1px solid var(--line); min-height: 62px;
}
.appbar .ctx { display: flex; align-items: center; gap: 10px; min-width: 0; }
.appbar .ctx .title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar .ctx .sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar .vsep { width: 1px; height: 32px; background: var(--line); flex: none; }
.stat-pill { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; padding: 0 6px; }
.stat-pill b { font-size: 18px; font-variant-numeric: tabular-nums; }
.stat-pill span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.net { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.net.down { color: var(--bad); }

/* ---- login ---- */
.login-bg { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(1200px 600px at 10% -10%, #0a56a8 0%, transparent 60%),
              radial-gradient(900px 500px at 110% 110%, rgba(159, 200, 48, .22) 0%, transparent 60%),
              linear-gradient(160deg, var(--navy), #032f66); }
.login { width: min(1020px, 100%); display: grid; grid-template-columns: 1fr 1.05fr; border-radius: 24px; overflow: hidden; box-shadow: 0 30px 80px rgba(0, 0, 0, .35); background: #fff; }
.login-hero { padding: 36px 40px; color: #fff; display: flex; flex-direction: column; gap: 24px;
  background: linear-gradient(160deg, rgba(255,255,255,.08), rgba(255,255,255,0)), var(--brand); position: relative; overflow: hidden; }
.login-hero::after { content: ""; position: absolute; right: -140px; bottom: -140px; width: 360px; height: 360px; border-radius: 50%; border: 56px solid rgba(0, 152, 216, .18); pointer-events: none; }
.login-hero::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: linear-gradient(90deg, var(--lime), var(--accent)); }
.login-hero h1 { margin: 0; font-size: 30px; line-height: 1.2; }
.login-hero p { margin: 0; color: rgba(255, 255, 255, .82); }
.login-hero .steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.login-hero .steps li { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: rgba(255,255,255,.9); }
.login-hero .steps .n { flex: none; width: 26px; height: 26px; border-radius: 50%; background: rgba(255,255,255,.16); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.guide-list-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: rgba(255,255,255,.7); margin-top: auto; }
.login-form { padding: 32px 40px; display: flex; flex-direction: column; gap: 16px; }
.login-form h2 { margin: 0; font-size: 22px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r); padding: 4px; gap: 4px; }
.seg button { border: 0; background: transparent; border-radius: 9px; padding: 10px; font-weight: 700; color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; }
.seg button.on { background: #fff; color: var(--brand); box-shadow: var(--shadow-sm); }
.prog { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.prog button { text-align: left; border: 2px solid var(--line); background: #fff; border-radius: var(--r); padding: 12px 14px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.prog button b { font-size: 16px; }
.prog button span { font-size: 12px; color: var(--muted); }
.prog button.on { border-color: var(--brand); background: var(--brand-50); }
.prog button.on[data-c="NAPAS"] { border-color: var(--accent); background: var(--accent-50); }

/* ---- station ---- */
.station { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(380px, 1fr); gap: 20px; padding: 20px; max-width: 1560px; margin: 0 auto; align-items: start; }
.cam-card { padding: 12px; }
.cam { position: relative; background: #0b1220; border-radius: var(--r); overflow: hidden; aspect-ratio: 4 / 3; }
.cam video { width: 100%; height: 100%; object-fit: cover; }
.cam video.mirror { transform: scaleX(-1); }
.cam .guide { position: absolute; left: 50%; top: 46%; width: 40%; aspect-ratio: 3 / 4; transform: translate(-50%, -50%); border-radius: 50%; border: 3px solid rgba(255,255,255,.85); box-shadow: 0 0 0 9999px rgba(8, 14, 28, .38); pointer-events: none; transition: border-color .2s; }
.cam.busy .guide { border-color: #7cc0ff; animation: pulse 1s ease-in-out infinite; }
.cam.ok .guide { border-color: #3ddc84; }
.cam.bad .guide { border-color: #ff6b6b; }
.cam.warn .guide { border-color: #ffb547; }
@keyframes pulse { 50% { opacity: .55; } }
.cam .flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; transition: opacity .2s; }
.cam .hint { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); background: rgba(8, 14, 28, .72); color: #fff; padding: 7px 14px; border-radius: 999px; font-size: 14px; font-weight: 600; white-space: nowrap; max-width: calc(100% - 24px); overflow: hidden; text-overflow: ellipsis; }
.cam .camerr { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: #fff; padding: 24px; background: #0b1220; }
.cam-tools { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.cam-tools select { max-width: 280px; min-height: 36px; font-size: 14px; padding: 4px 10px; width: auto; }
.perf { font-size: 12px; color: var(--muted); text-align: right; }

.panel { overflow: hidden; }
.status { padding: 20px 22px; display: flex; gap: 14px; align-items: center; border-bottom: 1px solid var(--line); }
.status .big-ico { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; flex: none; background: var(--panel-2); color: var(--ink-2); }
.status .big-ico .ico { width: 28px; height: 28px; stroke-width: 2.4; }
.status h2 { margin: 0; font-size: 24px; line-height: 1.15; }
.status p { margin: 3px 0 0; color: var(--ink-2); font-size: 14px; }
.status.ok { background: var(--ok-50); }
.status.ok .big-ico { background: var(--ok); color: #fff; }
.status.ok h2 { color: var(--ok); }
.status.warn { background: var(--warn-50); }
.status.warn .big-ico { background: #f0a020; color: #fff; }
.status.warn h2 { color: var(--warn); }
.status.bad { background: var(--bad-50); }
.status.bad .big-ico { background: var(--bad); color: #fff; }
.status.bad h2 { color: var(--bad); }
.status.busy .big-ico { background: var(--brand-50); color: var(--brand); }
.status.idle .big-ico { background: var(--brand-50); color: var(--brand); }
.panel-body { padding: 20px 22px; display: flex; flex-direction: column; gap: 16px; }

.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.checklist li { display: flex; gap: 12px; align-items: center; padding: 11px 14px; border-radius: var(--r); background: var(--panel-2); border: 1px solid var(--line); font-weight: 600; font-size: 15px; }
.checklist li .ico { color: var(--brand); width: 20px; height: 20px; }
.consent-note { font-size: 12px; color: var(--muted); line-height: 1.45; }

.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.face { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: #fff; }
.face img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; background: #e9edf3; max-height: 32vh; }
.face .cap { padding: 10px 12px; font-size: 13px; color: var(--ink-2); }
.face .cap b { display: block; font-size: 15px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.face-head { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--panel-2); }
.simbar { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; }
.simbar .track { flex: 1; height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.simbar .fill { height: 100%; border-radius: 99px; }
.new-guest { display: grid; grid-template-columns: 96px 1fr; gap: 16px; align-items: start; }
.new-guest img { width: 96px; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--line); }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.actions .wide { grid-column: 1 / -1; }
.note { padding: 12px 14px; border-radius: var(--r); font-size: 14px; background: var(--panel-2); border: 1px solid var(--line); }
.note.warn { background: var(--warn-50); border-color: #f5d29a; }
.note.ok { background: var(--ok-50); border-color: #b6e2c8; }
.countdown { height: 4px; background: var(--ok); border-radius: 99px; transform-origin: left; }
.countdown.run { animation: shrink var(--dur, 3s) linear forwards; }
@keyframes shrink { to { transform: scaleX(0); } }
.success-name { font-size: 26px; font-weight: 800; line-height: 1.2; }

.recent { list-style: none; margin: 0; padding: 0; }
.recent li { display: flex; align-items: center; gap: 12px; padding: 10px 20px; border-top: 1px solid var(--line); font-size: 14px; }
.recent li:first-child { border-top: 0; }
.recent img { width: 34px; height: 40px; object-fit: cover; border-radius: 6px; background: #e9edf3; }
.recent .t { color: var(--muted); font-size: 12px; margin-left: auto; white-space: nowrap; }

.modal-bg { position: fixed; inset: 0; background: rgba(8, 14, 28, .55); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { width: min(480px, 100%); max-height: calc(100vh - 32px); background: #fff; border-radius: var(--r-lg); box-shadow: 0 30px 80px rgba(0,0,0,.3); display: flex; flex-direction: column; overflow: hidden; }
.modal .panel-body { gap: 14px; overflow-y: auto; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--panel-2); flex-wrap: wrap; }
.choice { display: grid; gap: 10px; }
.choice button { text-align: left; border: 2px solid var(--line); background: #fff; border-radius: var(--r); padding: 14px 16px; cursor: pointer; display: flex; gap: 12px; align-items: flex-start; }
.choice button b { display: block; font-size: 15px; }
.choice button span { font-size: 13px; color: var(--muted); }
.choice button .ico { width: 22px; height: 22px; margin-top: 2px; }
.choice button.on.ok { border-color: var(--ok); background: var(--ok-50); }
.choice button.on.bad { border-color: var(--bad); background: var(--bad-50); }

/* ---- guide ---- */
.guide-modal { width: min(960px, 100%); height: min(700px, calc(100vh - 32px)); }
.guide-modal.single { width: min(720px, 100%); }
.guide-layout { display: grid; grid-template-columns: 260px 1fr; flex: 1; min-height: 0; }
.guide-modal.single .guide-layout { grid-template-columns: 1fr; }
.guide-nav { display: flex; flex-direction: column; gap: 6px; padding: 14px; background: var(--panel-2); border-right: 1px solid var(--line); overflow-y: auto; }
.guide-nav button { display: flex; align-items: center; gap: 12px; text-align: left; padding: 10px 12px; border-radius: 12px; border: 1px solid transparent; background: transparent; cursor: pointer; }
.guide-nav button:hover { background: #fff; }
.guide-nav button b { display: block; font-size: 14px; }
.guide-nav button small { display: block; font-size: 12px; color: var(--muted); line-height: 1.35; }
.guide-nav button.on { background: #fff; border-color: var(--line); box-shadow: var(--shadow-sm); }
.guide-nav button.on .g-ico { background: var(--brand); color: #fff; }
.g-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); flex: none; }
.guide-content { overflow-y: auto; padding: 24px 30px 30px; min-height: 0; }
.g-head { display: flex; align-items: center; gap: 14px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.g-head .g-ico { width: 46px; height: 46px; border-radius: 12px; background: var(--brand); color: #fff; }
.g-head .g-ico .ico { width: 22px; height: 22px; }
.g-head h3 { margin: 0; font-size: 20px; }
.g-head p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.guide-article > .note { margin-top: 16px; }
.g-sec { margin-top: 22px; }
.g-sec h4 { margin: 0 0 10px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.g-sec ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.g-step { display: flex; gap: 12px; align-items: flex-start; font-size: 14.5px; line-height: 1.6; }
.g-n { width: 24px; height: 24px; margin-top: 1px; border-radius: 50%; background: var(--brand-50); color: var(--brand); font-size: 12px; font-weight: 800; display: grid; place-items: center; flex: none; }
.g-outcome { display: flex; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); font-size: 14px; line-height: 1.55; }
.g-outcome .g-title { display: block; font-size: 14.5px; margin-bottom: 1px; }
.g-dot { width: 10px; height: 10px; margin-top: 6px; border-radius: 50%; background: var(--muted); flex: none; }
.g-outcome.ok { background: var(--ok-50); border-color: #c3e6d2; }
.g-outcome.ok .g-dot { background: var(--ok); } .g-outcome.ok .g-title { color: var(--ok); }
.g-outcome.warn { background: var(--warn-50); border-color: #f3d8a6; }
.g-outcome.warn .g-dot { background: #f0a020; } .g-outcome.warn .g-title { color: var(--warn); }
.g-outcome.bad { background: var(--bad-50); border-color: #f2c4c4; }
.g-outcome.bad .g-dot { background: var(--bad); } .g-outcome.bad .g-title { color: var(--bad); }
.guide-article kbd { margin-left: 0; }
.guide-page { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.guide-page .guide-article { padding: 24px 28px 28px; }
.guide-side { display: flex; flex-direction: column; gap: 8px; padding: 16px; }
.guide-side h4 { margin: 0 0 4px; font-size: 13px; }
.guide-side button { display: flex; align-items: center; gap: 12px; text-align: left; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: #fff; cursor: pointer; }
.guide-side button:hover { border-color: var(--line-2); background: var(--panel-2); }
.guide-side button b { display: block; font-size: 14px; }
.guide-side button small { display: block; font-size: 12px; color: var(--muted); }

/* login: guide entry points */
.guide-list { display: grid; gap: 8px; position: relative; z-index: 1; }
.guide-list button { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px 12px; border-radius: 12px; border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.07); color: #fff; cursor: pointer; transition: background .15s; }
.guide-list button:hover { background: rgba(255,255,255,.14); }
.guide-list button b { display: block; font-size: 14px; }
.guide-list button small { display: block; font-size: 12px; color: rgba(255,255,255,.7); }
.guide-list .g-ico { background: rgba(255,255,255,.12); color: #fff; }
.guide-list .chev { margin-left: auto; opacity: .6; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 10px 18px; border-radius: 999px; font-weight: 600; z-index: 60; box-shadow: var(--shadow); }

/* ---- admin ---- */
.admin { max-width: 1440px; margin: 0 auto; padding: 20px; display: flex; flex-direction: column; gap: 20px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); background: #fff; padding: 0 20px; position: sticky; top: 62px; z-index: 4; overflow-x: auto; }
.tabs button { border: 0; background: transparent; padding: 14px 14px 12px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; display: inline-flex; gap: 8px; align-items: center; white-space: nowrap; }
.tabs button.on { color: var(--brand); border-bottom-color: var(--brand); }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.kpi { padding: 14px 16px; border-radius: var(--r); background: var(--panel-2); border: 1px solid var(--line); }
.kpi .v { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi .l { font-size: 12px; color: var(--muted); margin-top: 4px; }
.kpi.hero { background: linear-gradient(140deg, var(--brand), #0a56a8); color: #fff; border: 0; grid-column: span 2; }
.kpi.hero .v { font-size: 38px; }
.kpi.hero .l { color: rgba(255,255,255,.85); }
.kpi.hero.NAPAS { background: linear-gradient(140deg, #0078b0, var(--accent)); }
.kpi.alert { background: var(--warn-50); border-color: #f5d29a; cursor: pointer; }
.kpi.alert .v { color: var(--warn); }
.progress { height: 8px; border-radius: 99px; background: rgba(255,255,255,.25); overflow: hidden; margin-top: 10px; }
.progress div { height: 100%; background: #fff; border-radius: 99px; }
.camp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 620px), 1fr)); gap: 20px; }
.chart { display: grid; grid-template-columns: 34px 1fr; gap: 6px; height: 170px; }
.chart .yax { display: flex; flex-direction: column; justify-content: space-between; font-size: 11px; color: var(--muted); text-align: right; padding-bottom: 18px; }
.chart .plot { position: relative; display: flex; align-items: flex-end; gap: 4px; border-bottom: 1px solid var(--line-2); margin-bottom: 18px; }
.chart .plot .grid { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--line); }
.chart .bar { flex: 1; max-width: 36px; background: var(--brand); border-radius: 4px 4px 0 0; position: relative; min-height: 2px; }
.chart .bar.NAPAS { background: var(--accent); }
.chart .bar span { position: absolute; top: calc(100% + 3px); left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--muted); white-space: nowrap; }
.chart .bar:hover::after { content: attr(data-t); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; font-size: 12px; padding: 3px 8px; border-radius: 6px; white-space: nowrap; z-index: 2; }
.empty { padding: 28px; text-align: center; color: var(--muted); }

.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 10px 14px; background: var(--panel-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--panel-2); }
.tbl .r { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .thumb { width: 40px; height: 48px; object-fit: cover; border-radius: 6px; background: #e9edf3; }
.tbl tr.flag td { background: #fffaf2; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.toolbar .search { position: relative; flex: 1; min-width: 200px; max-width: 360px; }
.toolbar .search .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.toolbar .search input { padding-left: 38px; min-height: 40px; font-size: 14px; }
.toolbar select { width: auto; min-height: 40px; font-size: 14px; }
.pager { display: flex; align-items: center; gap: 8px; padding: 12px 20px; font-size: 13px; color: var(--muted); }

.review-card { display: grid; grid-template-columns: 1fr 1fr 1.2fr; gap: 16px; padding: 16px 20px; border-top: 1px solid var(--line); align-items: start; }
.review-card:first-child { border-top: 0; }
.review-card .face img { max-height: 220px; }

.drawer-bg { position: fixed; inset: 0; background: rgba(8, 14, 28, .45); z-index: 40; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(540px, 100%); background: #fff; z-index: 41; display: flex; flex-direction: column; box-shadow: -20px 0 60px rgba(0,0,0,.2); }
.drawer .content { overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 18px; }
.drawer .foot { display: flex; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--panel-2); flex-wrap: wrap; }
.dl { display: grid; grid-template-columns: 130px 1fr; gap: 8px 12px; font-size: 14px; margin: 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; font-weight: 600; word-break: break-word; }
.scope-switch { display: inline-flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.scope-switch button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; font-weight: 600; font-size: 13px; color: var(--muted); cursor: pointer; }
.scope-switch button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.form-grid .wide { grid-column: 1 / -1; }
.settings-foot { display: flex; gap: 10px; align-items: center; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--panel-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }

@media (max-width: 960px) {
  .login { grid-template-columns: 1fr; }
  .login-hero { padding: 24px; gap: 14px; }
  .login-hero .steps, .login-hero p.lead { display: none; }
  .login-hero h1 { font-size: 22px; }
  .login-form { padding: 24px; }
  .station { grid-template-columns: 1fr; padding: 12px; gap: 12px; }
  .cam { aspect-ratio: 3 / 4; max-height: 46vh; margin: 0 auto; }
  .cam .guide { width: 62%; }
  .cam-card { padding: 8px; }
  .appbar { padding: 8px 12px; gap: 10px; min-height: 56px; }
  .appbar .hide-sm { display: none !important; }
  .brand .logo { height: 28px; }
  .status { padding: 16px; }
  .status h2 { font-size: 20px; }
  .panel-body { padding: 16px; }
  .admin { padding: 12px; gap: 12px; }
  .tabs { top: 56px; padding: 0 8px; }
  .dl { grid-template-columns: 110px 1fr; }
  .review-card { grid-template-columns: 1fr 1fr; }
  .review-card > :last-child { grid-column: 1 / -1; }
  .kpi.hero { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .brand .event-name, .brand .sep { display: none; }
  }
.spinner { width: 24px; height: 24px; border: 3px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; vertical-align: middle; }
.btn .spinner { width: 18px; height: 18px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.panel .compare .face img { max-height: 24vh; }
.station > * { min-width: 0; }
@media (max-width: 960px) {
  .btn.xl { white-space: normal; min-height: 60px; font-size: 17px; }
  .panel .checklist { display: none; }
  .cam { max-height: 42vh; }
  .recent li { padding: 10px 16px; }
}
@media (max-width: 960px) { .panel kbd { display: none; } }

@media (max-width: 720px) {
  .guide-modal { height: calc(100vh - 32px); }
  .guide-layout { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .guide-nav { flex-direction: row; padding: 8px; gap: 6px; border-right: 0; border-bottom: 1px solid var(--line); overflow: visible; }
  .guide-nav button { flex: 1 1 0; flex-direction: column; gap: 4px; text-align: center; padding: 8px 4px; }
  .guide-nav button b { font-size: 12.5px; }
  .guide-nav button small { display: none; }
  .guide-content { padding: 18px; }
  .guide-page { grid-template-columns: 1fr; }
  .guide-page .guide-article { padding: 18px; }
}
.line-editor { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; margin-bottom: 8px; }
.line-row { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 4px 4px 4px 8px; background: #fff; }
.line-row .g-n { width: 26px; height: 26px; }
.line-row .g-n .ico { width: 14px; height: 14px; }
.line-row .input { border: 0; min-height: 34px; padding: 4px 6px; font-size: 14px; font-weight: 600; }
.line-row .input:focus { box-shadow: none; }
.line-row .btn.icon { width: 32px; min-height: 32px; color: var(--muted); }

/* ---- outer gate ---- */
.gate { width: min(420px, 100%); padding: 0; overflow: hidden; box-shadow: 0 30px 80px rgba(0, 0, 0, .35); border: 0; }
.gate-top { padding: 28px 28px 8px; }
.gate-top h1 { margin: 22px 0 4px; font-size: 22px; }
.gate-top p { margin: 0; color: var(--muted); font-size: 14px; }
.gate form { padding: 20px 28px 24px; }
.gate-foot { display: flex; align-items: center; gap: 8px; padding: 12px 28px; border-top: 1px solid var(--line); background: var(--panel-2); font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.pw { position: relative; }
.pw .input { padding-right: 48px; }
.pw .btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
.secret-field { position: relative; }
.secret-field .input { padding-right: 48px; }
.secret-field .btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); min-height: 36px; }
.sec-banner { display: flex; gap: 12px; align-items: flex-start; padding: 14px 18px; border-radius: var(--r-lg); background: var(--warn-50); border: 1px solid #f3d8a6; }
.sec-banner .ico { color: var(--warn); width: 22px; height: 22px; margin-top: 1px; }
.sec-banner b { color: var(--warn); }

/* ---- POC banner & vendor footer ---- */
.poc-tag { display: inline-block; padding: 1px 8px; border-radius: 99px; background: #fff3cd; color: #7a5200; font-weight: 600; }
.site-foot { text-align: center; font-size: 12px; color: var(--muted); padding: 14px 16px 18px; }
.login-bg ~ .site-foot { position: fixed; left: 0; right: 0; bottom: 0; color: rgba(255,255,255,.6); padding: 10px; }
@media print { .site-foot { display: none; } }
