/* ==========================================================================
   School Check-In — design system
   Category colours: class = blue, bus = amber, exam = violet.
   ========================================================================== */
:root {
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e5e8f0;
  --border-strong: #d4d9e4;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;

  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-soft: #eef2ff;
  --primary-text: #ffffff;

  --class: #2563eb;  --class-soft: #eff6ff;
  --bus: #d97706;    --bus-soft: #fff7e6;
  --exam: #7c3aed;   --exam-soft: #f5f3ff;

  --ok: #059669;     --ok-soft: #ecfdf5;
  --warn: #c2410c;   --warn-soft: #fff4ec;
  --bad: #dc2626;    --bad-soft: #fef2f2;
  --neutral: #475569; --neutral-soft: #f1f5f9;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgb(15 23 42 / .05);
  --shadow: 0 1px 3px rgb(15 23 42 / .06), 0 8px 24px rgb(15 23 42 / .05);
  --shadow-lg: 0 20px 60px rgb(15 23 42 / .18);
  --ring: 0 0 0 3px rgb(79 70 229 / .18);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0f17; --surface: #121826; --surface-2: #0f1520; --border: #1f2737; --border-strong: #2b3547;
    --text: #e6eaf2; --text-2: #c3cad8; --muted: #8a94a8;
    --primary: #7c83ff; --primary-hover: #949aff; --primary-soft: #1d2140; --primary-text: #0b0f17;
    --class: #60a5fa; --class-soft: #13213b;
    --bus: #fbbf24;   --bus-soft: #2e2410;
    --exam: #a78bfa;  --exam-soft: #221a3b;
    --ok: #34d399; --ok-soft: #0f2a21; --warn: #fb923c; --warn-soft: #2e1c10;
    --bad: #f87171; --bad-soft: #301417; --neutral: #a3adbf; --neutral-soft: #1a2130;
    --shadow-sm: none; --shadow: 0 1px 0 rgb(255 255 255 / .03); --shadow-lg: 0 20px 60px rgb(0 0 0 / .5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 24px; line-height: 1.25; margin: 0; font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: 16px; margin: 0; font-weight: 650; letter-spacing: -.01em; }
h3 { font-size: 14px; margin: 0; font-weight: 600; }
code { font: 12.5px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--neutral-soft); padding: 1px 6px; border-radius: 6px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.ico { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ico.sm { width: 15px; height: 15px; }
.ico.lg { width: 22px; height: 22px; }

/* ---------- App shell ---------- */
body.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; padding: 20px 14px;
  background: var(--surface); border-right: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; }
.brand .logo { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, #6366f1, #8b5cf6 55%, #ec4899); box-shadow: 0 6px 16px rgb(99 102 241 / .35); }
.brand b { display: block; font-size: 15px; letter-spacing: -.01em; }
.brand span { display: block; font-size: 12px; color: var(--muted); }
.nav-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 10px 12px 4px; }
.sidebar a.nav { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; color: var(--text-2); font-weight: 500; }
.sidebar a.nav:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.sidebar a.nav.active { background: var(--primary-soft); color: var(--primary); }
.sidebar .grow { flex: 1; }
.user-card { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.user-card .who { flex: 1; min-width: 0; }
.user-card .who b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-card .who span { font-size: 12px; color: var(--muted); text-transform: capitalize; }

.content { min-width: 0; padding: 28px 32px 64px; max-width: 1320px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head .sub { color: var(--muted); margin: 4px 0 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

@media (max-width: 900px) {
  body.app { grid-template-columns: 1fr; }
  .sidebar { position: sticky; z-index: 20; height: auto; flex-direction: row; align-items: center; padding: 10px 12px; gap: 2px;
    border-right: 0; border-bottom: 1px solid var(--border); overflow-x: auto; }
  .brand { padding: 0 8px 0 0; } .brand div, .nav-label, .sidebar .grow, .user-card .who { display: none; }
  .sidebar a.nav { padding: 8px 10px; white-space: nowrap; }
  .sidebar a.nav span { display: none; }
  .user-card { padding: 4px; border: 0; background: none; margin-left: auto; }
  .content { padding: 20px 16px 48px; }
}

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.card + .card { margin-top: 18px; }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-head .title { display: flex; align-items: center; gap: 10px; }
.card-head p { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }
.card-foot { padding: 12px 20px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12.5px; }
.section-title { display: flex; align-items: center; gap: 10px; margin: 28px 0 12px; }
.section-title .count { color: var(--muted); font-weight: 500; }

.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.spacer { flex: 1; }

/* Icon tile, tinted by category */
.tile { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--primary-soft); color: var(--primary); }
.tile.sm { width: 30px; height: 30px; border-radius: 8px; }
.t-class { --c: var(--class); --c-soft: var(--class-soft); }
.t-bus { --c: var(--bus); --c-soft: var(--bus-soft); }
.t-exam { --c: var(--exam); --c-soft: var(--exam-soft); }
.t-ok { --c: var(--ok); --c-soft: var(--ok-soft); }
.t-warn { --c: var(--warn); --c-soft: var(--warn-soft); }
.t-primary { --c: var(--primary); --c-soft: var(--primary-soft); }
.tile[class*="t-"] { background: var(--c-soft); color: var(--c); }

/* ---------- Stat tiles ---------- */
.stats { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-bottom: 8px; }
.stats .card + .card { margin-top: 0; }
.stat { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.stat .top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-weight: 500; font-size: 13px; }
.stat .value { font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.stat .value small { font-size: 15px; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.stat .foot { font-size: 12.5px; color: var(--muted); }

/* ---------- Progress ---------- */
.progress { height: 8px; background: var(--neutral-soft); border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 99px; background: var(--c, var(--primary)); transition: width .4s ease; }

/* ---------- Location cards (dashboard) ---------- */
.grid .card + .card { margin-top: 0; }
.loc-card { padding: 18px; display: flex; flex-direction: column; gap: 14px; border-top: 3px solid var(--c); }
.loc-card .head { display: flex; align-items: center; gap: 12px; }
.loc-card .head .name { flex: 1; min-width: 0; }
.loc-card .head .name b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.loc-card .head .name span { font-size: 12px; color: var(--muted); }
.loc-card .nums { display: flex; align-items: baseline; justify-content: space-between; }
.loc-card .nums .big { font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.loc-card .nums .big small { font-size: 14px; color: var(--muted); font-weight: 500; }
.loc-card .nums .pct { font-weight: 600; color: var(--c); }
.loc-card .meta { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); }

/* ---------- Buttons ---------- */
button, .btn { font: inherit; font-weight: 550; display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 14px;
  border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); cursor: pointer;
  white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s, color .15s; text-decoration: none; }
button:hover, .btn:hover { background: var(--surface-2); text-decoration: none; }
button:focus-visible, .btn:focus-visible { outline: none; box-shadow: var(--ring); }
button.primary, .btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-text); box-shadow: 0 1px 2px rgb(79 70 229 / .3); }
button.primary:hover, .btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
button.soft, .btn.soft { background: var(--primary-soft); border-color: transparent; color: var(--primary); }
button.soft:hover, .btn.soft:hover { filter: brightness(.97); background: var(--primary-soft); }
button.ghost { background: transparent; border-color: transparent; color: var(--muted); }
button.ghost:hover { background: var(--neutral-soft); color: var(--text); }
button.danger { color: var(--bad); }
button.danger:hover { background: var(--bad-soft); border-color: transparent; }
button.danger.solid { background: var(--bad); border-color: var(--bad); color: #fff; }
button.sm, .btn.sm { height: 32px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
button.lg { height: 46px; padding: 0 20px; font-size: 15px; border-radius: 12px; }
button.icon { width: 34px; height: 34px; padding: 0; border-color: transparent; background: transparent; color: var(--muted); }
button.icon:hover { background: var(--neutral-soft); color: var(--text); }
button.icon.sm { width: 30px; height: 30px; }
button:disabled { opacity: .5; cursor: default; pointer-events: none; }

/* ---------- Form controls ---------- */
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 10px; height: 38px; padding: 0 12px; min-width: 0; transition: border-color .15s, box-shadow .15s; }
textarea { height: auto; padding: 10px 12px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
input[type="checkbox"] { width: 16px; height: 16px; padding: 0; accent-color: var(--primary); cursor: pointer; }
input[type="range"] { padding: 0; height: auto; border: 0; accent-color: var(--primary); box-shadow: none; }
input[type="file"] { height: auto; padding: 8px; }
select { padding-right: 32px; appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 550; color: var(--text-2); }
.field .hint { font-weight: 400; color: var(--muted); font-size: 12px; }
.search { position: relative; display: flex; align-items: center; }
.search .ico { position: absolute; left: 11px; color: var(--muted); pointer-events: none; }
.search input { padding-left: 36px; width: 260px; }
.form-grid { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } .search input { width: 100%; } }

/* Toggle switch */
.switch { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; background: var(--surface-2); }
.switch input { appearance: none; width: 38px; height: 22px; border-radius: 99px; background: var(--border-strong); position: relative; flex: none; border: 0; margin-top: 1px; transition: background .2s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / .2); transition: transform .2s; }
.switch input:checked { background: var(--ok); }
.switch input:checked::after { transform: translateX(16px); }
.switch b { display: block; font-size: 13.5px; }
.switch span { font-size: 12.5px; color: var(--muted); }

/* Segmented control / tabs */
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--neutral-soft); border-radius: 10px; }
.seg button { height: 32px; border: 0; background: transparent; color: var(--muted); border-radius: 8px; padding: 0 12px; font-size: 13px; }
.seg button:hover { color: var(--text); background: transparent; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgb(15 23 42 / .1); }
.seg button .n { font-size: 11.5px; background: var(--border); color: var(--text-2); padding: 0 6px; border-radius: 99px; }
.seg.lg button { height: 38px; padding: 0 16px; font-size: 14px; }

/* ---------- Chips & pills ---------- */
.chip { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 7px; font-size: 12.5px; font-weight: 550;
  background: var(--c-soft, var(--neutral-soft)); color: var(--c, var(--neutral)); white-space: nowrap; max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.chip .ico { width: 13px; height: 13px; }
.chip .seat { opacity: .7; font-weight: 500; }
.chips { display: flex; gap: 5px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px 0 8px; border-radius: 99px; font-size: 12.5px; font-weight: 550; white-space: nowrap;
  background: var(--neutral-soft); color: var(--neutral); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.info { background: var(--primary-soft); color: var(--primary); }
.pill.exam { background: var(--exam-soft); color: var(--exam); }
.none { color: var(--border-strong); }

/* ---------- Avatars & person cell ---------- */
.avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex: none; display: inline-grid; place-items: center;
  font-size: 13px; font-weight: 650; color: #fff; background: var(--av, #94a3b8); }
.avatar.lg { width: 56px; height: 56px; font-size: 18px; }
.person { display: flex; align-items: center; gap: 12px; min-width: 0; }
.person .meta { min-width: 0; }
.person .meta b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person .meta span { font-size: 12.5px; color: var(--muted); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
  padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--surface-2); }
tbody tr.selected { background: var(--primary-soft); }
tbody tr:last-child td { border-bottom: 0; }
td.actions-cell { text-align: right; white-space: nowrap; width: 1%; }
th.check, td.check { width: 44px; padding-right: 0; }
.time { font-variant-numeric: tabular-nums; font-weight: 550; }
.method { font-size: 12px; color: var(--muted); }

/* ---------- Toolbar & bulk bar ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.bulk { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 20px; background: var(--primary-soft); border-bottom: 1px solid var(--border); }
.bulk strong { color: var(--primary); margin-right: 4px; }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty .tile { margin: 0 auto 12px; width: 48px; height: 48px; border-radius: 14px; }
.empty b { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }

/* ---------- Dialogs ---------- */
dialog { border: 0; border-radius: 18px; background: var(--surface); color: var(--text); padding: 0; width: min(560px, calc(100% - 32px));
  max-height: calc(100vh - 48px); box-shadow: var(--shadow-lg); }
dialog[open] { display: flex; flex-direction: column; animation: pop .18s ease-out; }
dialog.wide { width: min(720px, calc(100% - 32px)); }
dialog.narrow { width: min(420px, calc(100% - 32px)); }
dialog::backdrop { background: rgb(15 23 42 / .5); backdrop-filter: blur(3px); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
dialog > form { display: flex; flex-direction: column; min-height: 0; }
.dlg-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px 14px; }
.dlg-head .t { flex: 1; min-width: 0; }
.dlg-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.dlg-body { padding: 4px 20px 20px; overflow: auto; }
.dlg-foot { display: flex; gap: 8px; justify-content: flex-end; align-items: center; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 18px 18px; }
.group-label { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 0 8px; }
.list-box { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.list-box .li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.list-box .li:last-child { border-bottom: 0; }
.list-box .li.empty-li { color: var(--muted); font-size: 13px; justify-content: center; }
.list-box .li.add { background: var(--surface-2); }

/* Steps (import) */
.step { display: flex; gap: 14px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); }
.step + .step { margin-top: 12px; }
.step .num { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: var(--primary-text); font-weight: 700; font-size: 13px; flex: none; }
.step .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.step .body p { margin: 0; color: var(--muted); font-size: 13px; }
.dropzone { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1.5px dashed var(--border-strong); border-radius: 10px; background: var(--surface-2); cursor: pointer; color: var(--muted); font-weight: 500; }
.dropzone:hover { border-color: var(--primary); color: var(--primary); }
.dropzone .fname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log { max-height: 180px; overflow: auto; font: 12px ui-monospace, monospace; background: var(--surface-2); border: 1px solid var(--border); padding: 10px; border-radius: 10px; white-space: pre-wrap; }
progress { width: 100%; height: 8px; accent-color: var(--primary); }

/* Popover menu */
.menu { position: fixed; z-index: 60; min-width: 210px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; animation: pop .12s ease-out; }
.menu button { width: 100%; justify-content: flex-start; border: 0; background: none; height: 36px; font-weight: 500; }
.menu button:hover { background: var(--neutral-soft); }
.menu button.danger:hover { background: var(--bad-soft); }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: 4px 0; }

/* Toast */
#toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 12px); display: flex; align-items: center; gap: 10px;
  background: #0f172a; color: #f8fafc; padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); opacity: 0;
  transition: opacity .2s, transform .2s; pointer-events: none; z-index: 100; max-width: calc(100% - 32px); font-weight: 500; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast .ico { color: #34d399; }
#toast.error .ico { color: #f87171; }

/* Banner */
.banner { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius); background: var(--primary-soft); color: var(--text-2); font-size: 13px; }
.banner .ico { color: var(--primary); margin-top: 1px; }
.banner.exam { background: var(--exam-soft); } .banner.exam .ico { color: var(--exam); }
.banner.warn { background: var(--warn-soft); } .banner.warn .ico { color: var(--warn); }

/* ---------- Camera stage ---------- */
.stage { position: relative; background: #0b0f17; border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 4 / 3; box-shadow: var(--shadow); }
.stage video, .stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.stage .placeholder { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; color: #64748b; text-align: center; padding: 20px; }
.stage .placeholder .ico { width: 40px; height: 40px; }
.stage .guide { position: absolute; left: 50%; top: 46%; width: 40%; aspect-ratio: 3 / 4; transform: translate(-50%, -50%);
  border: 3px dashed rgb(255 255 255 / .65); border-radius: 50%; pointer-events: none; }
.stage .flash { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 8px;
  max-width: calc(100% - 32px); padding: 10px 18px; border-radius: 99px; font-size: 17px; font-weight: 650; color: #fff;
  background: rgb(15 23 42 / .72); backdrop-filter: blur(8px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage .flash:empty { display: none; }
.stage .flash.ok { background: rgb(5 150 105 / .92); }
.stage .flash.warn { background: rgb(217 119 6 / .92); }
.stage .flash.bad { background: rgb(220 38 38 / .92); }
.stage .verify { position: absolute; top: 16px; right: 16px; display: flex; gap: 14px; align-items: center; padding: 12px 16px 12px 12px;
  background: rgb(255 255 255 / .97); color: #0f172a; border-radius: 16px; box-shadow: var(--shadow-lg); border-left: 5px solid #7c3aed; }
.stage .verify .avatar { width: 84px; height: 84px; border-radius: 12px; font-size: 26px; }
.stage .verify b { display: block; font-size: 17px; }
.stage .verify .id { color: #64748b; font-size: 13px; }
.stage .verify .seat { display: inline-block; margin-top: 6px; font-size: 20px; font-weight: 800; color: #fff; background: #7c3aed; padding: 2px 12px; border-radius: 8px; }
.stage .live { position: absolute; top: 14px; left: 14px; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px;
  font-size: 12px; font-weight: 650; color: #fff; background: rgb(15 23 42 / .6); backdrop-filter: blur(6px); }
.stage .live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #ef4444; box-shadow: 0 0 0 3px rgb(239 68 68 / .3); animation: blink 1.6s infinite; }
.stage .live.paused::before { background: #94a3b8; box-shadow: none; animation: none; }
@keyframes blink { 50% { opacity: .35; } }
.samples { display: flex; gap: 6px; }
.samples img { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; border: 2px solid var(--ok); }

/* ---------- Kiosk ---------- */
.kiosk-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; margin-bottom: 16px; }
.kiosk-bar select { height: 44px; font-size: 15px; font-weight: 600; min-width: 260px; }
.kiosk { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.kiosk .stack { gap: 12px; }
@media (max-width: 980px) { .kiosk { grid-template-columns: 1fr; } }
.roster-card { display: flex; flex-direction: column; max-height: calc(100vh - 150px); position: sticky; top: 20px; }
.roster-card .summary { padding: 16px 18px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.roster-card .summary .big { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.roster-card .summary .big small { font-size: 14px; color: var(--muted); font-weight: 500; }
.roster-card .search input { width: 100%; }
.roster-list { overflow: auto; padding: 6px; }
.roster-list .item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; cursor: pointer; }
.roster-list .item:hover { background: var(--surface-2); }
.roster-list .item .person { flex: 1; }
.roster-list .item.done .meta b { color: var(--muted); }
.status-chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 99px; font-size: 12.5px; font-weight: 600; background: var(--neutral-soft); color: var(--text-2); }
.status-chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.status-chip.off .dot { background: var(--bad); }
.status-chip.pending .dot { background: var(--warn); }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login .hero { position: relative; overflow: hidden; padding: 56px; color: #fff; display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
  background: radial-gradient(1200px 600px at -10% -10%, #8b5cf6 0%, transparent 55%), radial-gradient(900px 500px at 110% 110%, #ec4899 0%, transparent 50%), linear-gradient(135deg, #312e81, #4f46e5); }
.login .hero h1 { font-size: 40px; line-height: 1.1; max-width: 460px; letter-spacing: -.03em; margin-bottom: 14px; }
.login .hero p { color: rgb(255 255 255 / .8); font-size: 16px; max-width: 440px; margin: 0; }
.login .hero .brand b, .login .hero .brand span { color: #fff; }
.login .feat { display: flex; flex-direction: column; gap: 14px; }
.login .feat div { display: flex; gap: 12px; align-items: center; font-weight: 500; }
.login .feat .tile { background: rgb(255 255 255 / .15); color: #fff; }
.login .form-side { display: grid; place-items: center; padding: 32px 20px; }
.login form { width: min(380px, 100%); display: flex; flex-direction: column; gap: 16px; }
.login form input { height: 44px; }
.login .err { color: var(--bad); font-size: 13px; min-height: 18px; }
@media (max-width: 860px) { .login { grid-template-columns: 1fr; } .login .hero { padding: 32px 24px; } .login .hero h1 { font-size: 28px; } .login .feat { display: none; } }

/* ---------- Settings ---------- */
.settings-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.settings-grid .card + .card { margin-top: 18px; }
@media (max-width: 1000px) { .settings-grid { grid-template-columns: 1fr; } }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; padding: 14px 20px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.inline-form input { flex: 1; min-width: 140px; }

/* Bus departure check & excused students */
.ready { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: 13px; }
.ready .ico { margin-top: 1px; }
.ready b { display: block; font-size: 14px; }
.ready span { color: var(--text-2); }
.ready.go { background: var(--ok-soft); color: var(--ok); }
.ready.wait { background: var(--warn-soft); color: var(--warn); }
.roster-sep { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 14px 10px 6px; border-top: 1px solid var(--border); margin-top: 6px; }
.roster-list .item.excluded { opacity: .7; }
.roster-list .item.excluded .meta b { text-decoration: line-through; text-decoration-color: var(--border-strong); }
.roster-list .item .meta .pill { height: 20px; font-size: 11.5px; vertical-align: middle; }
@media (max-width: 980px) { .roster-card { position: static; max-height: none; } }
