/* CVCA Thrive: shared tokens and components. CVCA navy, royal blue and
   gold, following the Campus.Watch / CVCA attendance look. Every color a rule
   paints comes from a token here, so dark mode is the two blocks below. */
:root {
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto, sans-serif;

  --canvas: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --surface-3: #edf1f6;
  --ink: #18283d;
  --slate: #596a7e;
  --muted: #6f7f93;
  --line: #e2e7ee;
  --line-strong: #cdd6e1;

  --chrome: #10243a;
  --chrome-2: #19395b;
  --chrome-3: #265588;
  --chrome-ink: #e6eef8;
  --chrome-muted: #94a6bd;

  --accent: #285da1;
  --accent-ink: #214f89;
  --accent-soft: #edf3fb;
  --accent-line: #c7d8ee;
  --accent-rgb: 40, 93, 161;
  --button: #19395b;
  --button-hover: #10243a;

  --gold: #c6a45c;
  --gold-bright: #e8c77d;
  --gold-rgb: 232, 199, 125;
  --gold-ink: #86661c;
  --gold-soft: #fbf4e5;
  --gold-line: #ecdcb4;

  --chart: #285da1;
  --chart-track: #dfe8f5;

  --red: #bf4540;
  --red-soft: #fcebea;
  --red-line: #f1c4c1;
  --green: #2c7a5e;
  --green-soft: #e9f4ef;
  --green-line: #bfe0cf;
  --blue: #2d72c7;
  --blue-soft: #e8f2ff;
  --amber: #a15f0f;
  --amber-soft: #fdf1e0;
  --amber-line: #f2d4a8;
  --purple: #725da7;
  --purple-soft: #f0ecf8;

  --shadow-1: 0 1px 2px rgba(16, 36, 58, .05), 0 1px 3px rgba(16, 36, 58, .04);
  --shadow-2: 0 2px 4px rgba(16, 36, 58, .04), 0 6px 16px rgba(16, 36, 58, .06);
  --shadow-3: 0 10px 20px rgba(16, 36, 58, .08), 0 24px 56px rgba(16, 36, 58, .16);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --ease: cubic-bezier(.32, .72, 0, 1);
  --focus: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --canvas: #0d1521;
  --surface: #152130;
  --surface-2: #1b2b3e;
  --surface-3: #22344a;
  --ink: #edf2fa;
  --slate: #b5c2d2;
  --muted: #8fa2ba;
  --line: #2a3a4d;
  --line-strong: #40536a;
  --chrome: #061321;
  --chrome-2: #0b213a;
  --chrome-3: #16304a;
  --accent: #4b9cff;
  --accent-ink: #91c2ff;
  --accent-soft: #102f57;
  --accent-line: #24497a;
  --accent-rgb: 75, 156, 255;
  --button: #1768c5;
  --button-hover: #0f58ad;
  --gold-ink: #e8c77d;
  --gold-soft: #3b2e17;
  --gold-line: #5e4a22;
  --chart: #4b8fe0;
  --chart-track: #1d3450;
  --red: #ef817c;
  --red-soft: #3d2024;
  --red-line: #6b2f2b;
  --green: #6ac9a6;
  --green-soft: #17382f;
  --green-line: #2a5a43;
  --blue: #77b5ff;
  --blue-soft: #142f50;
  --amber: #f0b060;
  --amber-soft: #33240f;
  --amber-line: #5c4219;
  --purple: #ad98e2;
  --purple-soft: #2d2743;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-2: 0 2px 6px rgba(0, 0, 0, .35);
  --shadow-3: 0 16px 48px rgba(0, 0, 0, .55);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --canvas: #0d1521;
    --surface: #152130;
    --surface-2: #1b2b3e;
    --surface-3: #22344a;
    --ink: #edf2fa;
    --slate: #b5c2d2;
    --muted: #8fa2ba;
    --line: #2a3a4d;
    --line-strong: #40536a;
    --chrome: #061321;
    --chrome-2: #0b213a;
    --chrome-3: #16304a;
    --accent: #4b9cff;
    --accent-ink: #91c2ff;
    --accent-soft: #102f57;
    --accent-line: #24497a;
    --accent-rgb: 75, 156, 255;
    --button: #1768c5;
    --button-hover: #0f58ad;
    --gold-ink: #e8c77d;
    --gold-soft: #3b2e17;
    --gold-line: #5e4a22;
    --chart: #4b8fe0;
    --chart-track: #1d3450;
    --red: #ef817c;
    --red-soft: #3d2024;
    --red-line: #6b2f2b;
    --green: #6ac9a6;
    --green-soft: #17382f;
    --green-line: #2a5a43;
    --blue: #77b5ff;
    --blue-soft: #142f50;
    --amber: #f0b060;
    --amber-soft: #33240f;
    --amber-line: #5c4219;
    --purple: #ad98e2;
    --purple-soft: #2d2743;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-2: 0 2px 6px rgba(0, 0, 0, .35);
    --shadow-3: 0 16px 48px rgba(0, 0, 0, .55);
    color-scheme: dark;
  }
}

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

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-width: 320px; color: var(--ink); background: var(--canvas); font-family: var(--font); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--accent-ink); }
[hidden] { display: none !important; }
:where(a, button, input, select, textarea, [tabindex]):focus-visible { outline: 0; box-shadow: var(--focus); }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; font-family: var(--font-display); color: var(--ink); }
h1 { font-size: 30px; font-weight: 700; letter-spacing: -.03em; }
h2 { font-size: 19px; font-weight: 680; letter-spacing: -.02em; }
h3 { font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
p { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
.slate { color: var(--slate); }
.num { font-variant-numeric: tabular-nums; }
.eyebrow { margin: 0 0 6px; color: var(--accent); font-size: 11px; font-weight: 750; letter-spacing: .16em; text-transform: uppercase; }
.ui-icon { flex: 0 0 auto; display: block; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px;
  border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--ink);
  font-weight: 620; font-size: 14px; white-space: nowrap; text-decoration: none;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .15s var(--ease);
}
.btn:hover { border-color: var(--accent); background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; transform: none; }
.btn.primary { border-color: var(--button); background: var(--button); color: #fff; }
.btn.primary:hover { border-color: var(--button-hover); background: var(--button-hover); }
.btn.gold { border-color: var(--gold-bright); background: var(--gold-bright); color: #2a1f05; }
.btn.gold:hover { background: #dcb862; }
.btn.danger { border-color: var(--red-line); color: var(--red); background: var(--surface); }
.btn.danger:hover { background: var(--red-soft); border-color: var(--red); }
.btn.danger.solid { background: var(--red); border-color: var(--red); color: var(--surface); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-3); border-color: transparent; }
.btn.sm { min-height: 32px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.btn.lg { min-height: 48px; padding: 0 22px; font-size: 15.5px; border-radius: 12px; }
.btn.icon-only { width: 40px; padding: 0; }
.btn.sm.icon-only { width: 32px; }
.btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.btn.block { width: 100%; }

/* Two or three options side by side (Month | Week). */
.segmented { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); }
.segmented button { min-height: 32px; padding: 0 14px; border: 0; border-radius: 8px; background: none; color: var(--slate); font-weight: 650; font-size: 13px; }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }

/* ---------- Forms ---------- */
.field { display: grid; gap: 6px; margin-bottom: 16px; align-content: start; }
.field > span, .label { color: var(--slate); font-size: 12.5px; font-weight: 650; }
.field small, .hint { color: var(--muted); font-size: 12.5px; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="search"], input[type="date"], input[type="time"], input[type="tel"], select, textarea {
  width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--surface); color: var(--ink); outline: 0; transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .2); }
input::placeholder, textarea::placeholder { color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 16px; align-items: start; }
.form-error { min-height: 20px; margin: 0 0 10px; color: var(--red); font-size: 13px; font-weight: 600; }
.check { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); flex: 0 0 auto; }
.check strong { display: block; font-size: 13.5px; font-weight: 620; }
.check span { color: var(--muted); font-size: 12.5px; }
.money-input { position: relative; }
.money-input::before { content: "$"; position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.money-input input { padding-left: 22px; }

/* Toggle switch built on a checkbox */
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 38px; height: 22px; border-radius: 99px; background: var(--line-strong); position: relative; transition: background .15s; flex: 0 0 auto; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .18s var(--ease); }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { box-shadow: var(--focus); }

/* ---------- Cards, chips, tables ---------- */
.card { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-1); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 12px; flex-wrap: wrap; }
.card-head p { margin-top: 2px; color: var(--muted); font-size: 12.5px; }
.card-body { padding: 4px 20px 20px; }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 99px; font-size: 12px; font-weight: 650; white-space: nowrap; background: var(--surface-3); color: var(--slate); }
.chip.accent { background: var(--accent-soft); color: var(--accent-ink); }
.chip.gold { background: var(--gold-soft); color: var(--gold-ink); }
.chip.red { background: var(--red-soft); color: var(--red); }
.chip.green { background: var(--green-soft); color: var(--green); }
.chip.blue { background: var(--blue-soft); color: var(--blue); }
.chip.amber { background: var(--amber-soft); color: var(--amber); }
.chip.purple { background: var(--purple-soft); color: var(--purple); }
.chip .ui-icon { width: 13px; height: 13px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; flex: none; }

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th { position: sticky; top: 0; z-index: 1; padding: 10px 12px; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-align: left; text-transform: uppercase; white-space: nowrap; }
table.data td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover td { background: var(--surface-2); }
table.data tr.clickable { cursor: pointer; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data td.actions { text-align: right; white-space: nowrap; }
table.data tfoot td { border-top: 2px solid var(--line-strong); border-bottom: 0; font-weight: 700; background: var(--surface-2); }
.cell-name strong { display: block; font-weight: 620; }
.cell-name span { color: var(--muted); font-size: 12.5px; }
.cell-name span .ui-icon { display: inline-block; vertical-align: -2px; }
.tabular { font-variant-numeric: tabular-nums; white-space: nowrap; }
.cell-name a { color: inherit; text-decoration: none; }
.cell-name a:hover { text-decoration: underline; }

.avatar { display: grid; place-items: center; flex: 0 0 auto; width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-ink); font-weight: 750; font-size: 13px; letter-spacing: .02em; }

.empty { display: grid; justify-items: center; gap: 8px; padding: 36px 20px; color: var(--muted); text-align: center; }
.empty .ui-icon { width: 34px; height: 34px; color: var(--line-strong); }
.empty strong { color: var(--slate); font-size: 14.5px; }

.meter { position: relative; height: 6px; border-radius: 99px; background: var(--chart-track); overflow: hidden; }
.meter > i { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: var(--chart); transition: width .4s var(--ease); }

/* ---------- Modal, drawer, toast ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: rgba(6, 19, 33, .5); backdrop-filter: blur(3px); animation: fade .15s ease; }
.modal { width: min(560px, 100%); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; border-radius: var(--radius-xl); background: var(--surface); box-shadow: var(--shadow-3); animation: pop .2s var(--ease); }
.modal.wide { width: min(900px, 100%); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 22px 24px 8px; }
.modal-head p { margin-top: 4px; color: var(--muted); font-size: 13px; }
.modal-body { padding: 10px 24px 8px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; padding: 14px 24px 20px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

.drawer-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(6, 19, 33, .4); animation: fade .15s ease; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 91; width: min(600px, 100vw); display: flex; flex-direction: column; background: var(--surface); box-shadow: var(--shadow-3); animation: slide .22s var(--ease); }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }
.drawer-head { display: flex; align-items: flex-start; gap: 14px; padding: 22px 24px 16px; border-bottom: 1px solid var(--line); }
.drawer-head .avatar { width: 48px; height: 48px; font-size: 16px; border-radius: 14px; }
.drawer-head h2 { font-size: 21px; }
.drawer-head p { color: var(--muted); font-size: 13px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 24px 32px; display: grid; gap: 22px; align-content: start; }
.drawer-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.drawer-stats div { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.drawer-stats strong { display: block; font-size: 22px; letter-spacing: -.02em; }
.drawer-stats span { color: var(--muted); font-size: 12px; }
.section-title { margin-bottom: 10px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.plain-list { display: grid; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.plain-list > div { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line); font-size: 13px; }
.plain-list > div:first-child { border-top: 0; }
.plain-list .grow { flex: 1; min-width: 0; }

.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 200; display: grid; gap: 8px; max-width: calc(100vw - 32px); }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 12px; background: var(--chrome-2); color: #fff; box-shadow: var(--shadow-3); font-weight: 560; animation: pop .2s var(--ease); }
.toast.error { background: #b23b36; }
.toast .ui-icon { color: var(--gold-bright); }
.toast.error .ui-icon { color: #fff; }

.secret-box { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border: 1px dashed var(--gold); border-radius: 12px; background: var(--gold-soft); }
.secret-box code { font-size: 18px; font-weight: 700; letter-spacing: .02em; color: var(--ink); word-break: break-all; }

.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--accent-line); background: var(--accent-soft); color: var(--ink); }
.notice .ui-icon { color: var(--accent-ink); margin-top: 1px; }
.notice.gold { border-color: var(--gold-line); background: var(--gold-soft); }
.notice.gold .ui-icon { color: var(--gold-ink); }
.notice.red { border-color: var(--red-line); background: var(--red-soft); }
.notice.red .ui-icon { color: var(--red); }
.notice.green { border-color: var(--green-line); background: var(--green-soft); }
.notice.green .ui-icon { color: var(--green); }
.notice strong { display: block; }
.notice p { color: var(--slate); font-size: 13px; }
.notice .grow { flex: 1; min-width: 0; }

.cw-badge { display: inline-flex; align-items: center; gap: 7px; color: var(--chrome-muted); font-size: 11px; font-weight: 650; letter-spacing: .02em; text-transform: none; text-decoration: none; }
.cw-badge img { width: 17px; height: auto; opacity: .9; }
/* Fine print: mycampus.watch is not associated with Campus Watch LLC. */
.cw-fine { margin: 0; font-size: 10.5px; line-height: 1.4; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted); }
.login-fine { margin-top: 18px; text-align: center; }
.side-fine { color: var(--chrome-muted); opacity: .8; padding: 2px 2px 0; }

.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--accent); animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.boot { position: fixed; inset: 0; display: grid; place-content: center; justify-items: center; gap: 18px; background: var(--canvas); }

/* ---------- Sign in (the CVCA attendance split layout) ---------- */
.login { min-height: 100dvh; display: grid; grid-template-columns: minmax(420px, 1.08fr) minmax(420px, .92fr); background: var(--surface); }
.login-art {
  position: relative; display: flex; flex-direction: column; justify-content: space-between; min-height: 100dvh; padding: 40px clamp(32px, 5vw, 80px);
  overflow: hidden; color: #fff; isolation: isolate;
  background:
    radial-gradient(ellipse 70% 60% at 12% 16%, rgba(74, 158, 240, .42), transparent 70%),
    radial-gradient(ellipse 65% 55% at 96% 104%, rgba(0, 30, 76, .55), transparent 70%),
    linear-gradient(155deg, #0966bd 0%, #00549e 48%, #003f7e 100%);
  box-shadow: inset -1px 0 0 rgba(var(--gold-rgb), .3);
}
.login-art::after {
  content: ""; position: absolute; z-index: -1; right: 3%; bottom: 9%; width: min(62%, 72vh); aspect-ratio: 1173 / 1417;
  background: url("/assets/cvca-lion.png") center / contain no-repeat; opacity: .08; mask-image: linear-gradient(to right, transparent, #000 75%);
}
.login-brand { display: flex; align-items: center; gap: 14px; }
.login-brand strong { display: block; font-size: 21px; letter-spacing: .02em; }
.login-brand span { color: #bcdcff; font-size: 12px; }
.login-hero { max-width: 660px; }
.art-eyebrow { margin: 0 0 14px; color: var(--gold-bright); font-size: 12px; font-weight: 750; letter-spacing: .24em; text-transform: uppercase; }
.login-hero h1 { color: #fff; font-size: clamp(46px, 5.2vw, 84px); line-height: 1.02; letter-spacing: -.04em; text-shadow: 0 2px 30px rgba(0, 24, 64, .25); }
.art-rule { display: block; width: 72px; height: 3px; margin: 28px 0 32px; border-radius: 3px; background: linear-gradient(90deg, var(--gold-bright), rgba(var(--gold-rgb), .12)); }
.art-today { display: inline-flex; align-items: center; gap: 18px; padding: 14px 24px 14px 14px; border: 1px solid rgba(255,255,255,.16); border-radius: 18px; background: rgba(255,255,255,.07); backdrop-filter: blur(8px); }
.art-today-icon { display: grid; place-items: center; width: 44px; height: 44px; color: var(--gold-bright); border-radius: 12px; background: rgba(var(--gold-rgb), .14); }
.art-time { font-size: clamp(28px, 2.4vw, 40px); font-weight: 650; letter-spacing: -.02em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.art-divider { align-self: stretch; width: 1px; background: rgba(255,255,255,.18); }
.art-date strong, .art-date span { display: block; white-space: nowrap; }
.art-date strong { font-size: 15px; }
.art-date span { margin-top: 4px; color: #bcdcff; font-size: 11.5px; letter-spacing: .04em; }
.login-foot { display: flex; justify-content: space-between; align-items: center; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.14); color: rgba(255,255,255,.65); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; }
.login-foot .cw-badge { color: rgba(255,255,255,.65); }
.login-main { position: relative; display: grid; place-items: center; padding: 56px 40px; background: radial-gradient(ellipse 80% 60% at 78% 8%, var(--accent-soft), transparent 70%), var(--surface-2); }
.theme-toggle { position: absolute; top: 20px; right: 20px; }
.login-card { width: min(100%, 430px); padding: 36px 36px 28px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: 0 1px 2px rgba(16,36,58,.05), 0 30px 70px -34px rgba(16,36,58,.35); }
.login-card-head { display: flex; align-items: center; gap: 16px; margin-bottom: 26px; }
.login-card h2 { font-size: 28px; letter-spacing: -.04em; }
.login-card-head p { margin-top: 3px; color: var(--slate); font-size: 13.5px; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 64px; }
.show-pass { position: absolute; top: 50%; right: 8px; transform: translateY(-50%); border: 0; background: none; color: var(--accent-ink); font-size: 12.5px; font-weight: 700; padding: 6px; }
/* Demo site: one-click sign-ins, as on the CVCA attendance demo. */
.demo-credentials { display: grid; gap: 12px; margin-top: 22px; padding: 16px; border: 1px dashed var(--line-strong); border-radius: 14px; background: var(--surface-2); }
.demo-head { display: flex; align-items: center; gap: 12px; }
.demo-head strong, .demo-head span { display: block; }
.demo-head strong { font-size: 13px; }
.demo-head span { margin-top: 1px; color: var(--muted); font-size: 12px; }
.icon-chip { display: grid; place-items: center; flex: 0 0 32px; height: 32px; border-radius: 9px; background: var(--gold-soft); color: var(--gold-ink); }
.demo-actions { display: grid; gap: 8px; }
.demo-account { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); text-align: left; transition: border-color .15s, box-shadow .15s, transform .15s var(--ease); }
.demo-account:hover, .demo-account:focus-visible { border-color: var(--accent); box-shadow: 0 6px 18px -10px rgba(var(--accent-rgb), .6); transform: translateY(-1px); }
.demo-account:disabled { opacity: .6; transform: none; }
.demo-account > span:not(.icon-chip) { flex: 1; min-width: 0; }
.demo-account strong { display: block; font-size: 13.5px; }
.demo-account small { display: block; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.demo-account .ui-icon { color: var(--muted); }
.art-stat { display: flex; align-items: center; gap: 9px; width: fit-content; margin-top: 22px; padding: 7px 14px 7px 11px; color: var(--gold-bright); border: 1px solid rgba(var(--gold-rgb), .35); border-radius: 999px; background: rgba(var(--gold-rgb), .12); font-size: 11.5px; font-weight: 650; letter-spacing: .02em; }
.live-pulse { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 18%, transparent); flex: none; }
.demo-pill { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border: 1px solid var(--gold-line); border-radius: 99px; background: var(--gold-soft); color: var(--gold-ink); font-size: 13px; font-weight: 700; white-space: nowrap; }
.demo-pill:not(:disabled):hover { border-color: var(--gold); }
.demo-pill:disabled { cursor: default; opacity: 1; }
.login-note { display: flex; align-items: flex-start; gap: 8px; margin-top: 18px; color: var(--muted); font-size: 12px; }
.login-note .ui-icon { width: 14px; height: 14px; }
.login-note > span:first-child { flex: none; }

.onboard { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(ellipse 80% 60% at 50% 0%, var(--accent-soft), transparent 70%), var(--canvas); }
.onboard-card { width: min(100%, 480px); padding: 32px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: var(--shadow-3); }
.onboard-card > img { display: block; margin-bottom: 18px; }
.onboard-card h1 { font-size: 26px; }
.onboard-card > p { margin: 6px 0 22px; color: var(--slate); }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 256px minmax(0, 1fr); min-height: 100dvh; }
.sidebar { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; color: var(--chrome-ink); background: var(--chrome); border-right: 1px solid rgba(var(--gold-rgb), .1); }
.side-brand { display: flex; align-items: center; gap: 12px; min-height: 84px; padding: 0 20px; border-bottom: 1px solid rgba(255,255,255,.07); }
.side-brand small { display: block; color: var(--gold-bright); font-size: 10px; font-weight: 800; letter-spacing: .2em; }
.side-brand strong { display: block; color: #fff; font-size: 16px; line-height: 1.15; letter-spacing: -.02em; }
.side-brand > div { min-width: 0; }
.side-brand span { display: block; overflow: hidden; color: var(--chrome-muted); font-size: 9.5px; text-overflow: ellipsis; white-space: nowrap; }
nav#nav { flex: 1; overflow-y: auto; padding: 8px 13px 16px; scrollbar-width: thin; scrollbar-color: #3c5068 transparent; }
.nav-group { margin: 18px 12px 7px; color: #83a4c9; font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.nav-group:first-child { margin-top: 6px; }
.nav-link { position: relative; display: flex; align-items: center; gap: 12px; min-height: 41px; margin: 2px 0; padding: 0 12px; border-radius: 8px; color: #b7c5d7; text-decoration: none; font-weight: 520; font-size: 13.5px; transition: background .15s, color .15s; }
.nav-link .ui-icon { color: #8ba0b9; }
.nav-link:hover { background: rgba(255,255,255,.055); color: #fff; }
.nav-link[aria-current="page"] { background: rgba(255,255,255,.085); color: var(--gold-bright); box-shadow: inset 3px 0 0 var(--gold); font-weight: 650; }
.nav-link[aria-current="page"] .ui-icon { color: #dec691; }
.nav-link .badge { margin-left: auto; min-width: 22px; height: 20px; padding: 0 6px; display: grid; place-items: center; border-radius: 99px; background: var(--gold-bright); color: #2a1f05; font-size: 11px; font-weight: 800; }
.side-foot { padding: 12px 13px; border-top: 1px solid rgba(255,255,255,.08); display: grid; gap: 4px; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: inherit; text-decoration: none; }
.side-user:hover { background: rgba(255,255,255,.06); }
.side-user .avatar { background: rgba(var(--gold-rgb), .14); color: var(--gold-bright); }
.side-user strong { display: block; color: #fff; font-size: 13px; }
.side-user small { display: block; color: var(--chrome-muted); font-size: 11.5px; }
.side-link { display: flex; align-items: center; gap: 12px; min-height: 38px; padding: 0 12px; border: 0; border-radius: 10px; background: none; color: #9fb0bf; font-size: 13.5px; text-align: left; }
.side-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.side-cw { justify-content: center; padding: 8px 0 2px; }
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.45); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 16px; min-height: 72px; padding: 12px 32px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(14px); }
.menu-btn { display: none !important; }
.top-clock { display: flex; align-items: center; gap: 14px; min-width: 0; }
.top-clock > strong { font-size: 26px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.top-clock div { display: grid; padding-left: 14px; border-left: 1px solid var(--line); min-width: 0; }
.top-clock span { font-size: 13.5px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-clock small { color: var(--muted); font-size: 12px; white-space: nowrap; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.open-pill { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border-radius: 99px; background: var(--green-soft); color: var(--green); font-size: 13px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.open-pill.has-open { background: var(--gold-soft); color: var(--gold-ink); }
.open-pill .dot { box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent); }

.page { width: 100%; max-width: 1400px; padding: 28px 32px 56px; outline: 0; }
.page:focus-visible { box-shadow: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head p.sub { margin-top: 6px; color: var(--slate); max-width: 760px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.toolbar .grow { flex: 1 1 220px; min-width: 0; }
.toolbar select, .toolbar input { width: auto; min-height: 38px; }
.search-box { position: relative; }
.search-box .ui-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-box input { width: 100%; padding-left: 36px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 20px; align-items: start; }
.stack { display: grid; gap: 20px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }

/* ---------- Stat tiles ---------- */
.tiles { display: grid; grid-template-columns: minmax(250px, 1.3fr) repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 20px; }
.tile { position: relative; display: flex; flex-direction: column; gap: 4px; min-height: 124px; padding: 18px 18px 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-1); text-decoration: none; color: inherit; }
a.tile:hover { border-color: var(--accent-line); }
.tile-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--slate); font-size: 12.5px; font-weight: 650; }
.tile-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--accent-soft); color: var(--accent-ink); }
.tile-icon.red { background: var(--red-soft); color: var(--red); }
.tile-icon.green { background: var(--green-soft); color: var(--green); }
.tile-icon.gold { background: var(--gold-soft); color: var(--gold-ink); }
.tile-icon.purple { background: var(--purple-soft); color: var(--purple); }
.tile-icon .ui-icon { width: 17px; height: 17px; }
.tile-value { margin-top: auto; font-size: 32px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile-sub { color: var(--muted); font-size: 12px; }
.tile.hero { color: #fff; border-color: transparent; background: radial-gradient(ellipse 80% 90% at 100% 100%, rgba(var(--gold-rgb), .18), transparent 60%), linear-gradient(150deg, #19395b, #0b192b); overflow: hidden; }
.tile.hero .tile-label { color: #d9e6f5; }
.tile.hero .tile-icon { background: rgba(var(--gold-rgb), .16); color: var(--gold-bright); }
.tile.hero .tile-value { font-size: 56px; }
.tile.hero .tile-sub { color: #b9cade; }
.tile.hero .meter { margin-top: 10px; background: rgba(255,255,255,.14); }
.tile.hero .meter > i { background: var(--gold-bright); }

/* ---------- Setup checklist ---------- */
.setup { margin-bottom: 20px; }
.setup-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; padding: 0 20px 20px; }
.setup-step { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); color: inherit; text-decoration: none; }
.setup-step:hover { border-color: var(--accent-line); }
.setup-step .mark { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line-strong); flex: 0 0 auto; color: transparent; }
.setup-step.done .mark { border-color: var(--green); background: var(--green); color: #fff; }
.setup-step strong { display: block; font-size: 13.5px; }
.setup-step span { color: var(--muted); font-size: 12.5px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .grid-2 { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
  .tile.hero { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .login { grid-template-columns: 1fr; }
  .login-art { min-height: auto; padding: 28px 24px; gap: 28px; }
  .login-hero h1 { font-size: 46px; }
  .art-today, .login-foot { display: none; }
  .art-rule { margin: 18px 0 0; }
  .login-main { padding: 28px 16px 40px; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 50; width: 272px; transform: translateX(-100%); transition: transform .22s var(--ease); }
  .shell.nav-open .sidebar { transform: none; }
  .menu-btn { display: inline-flex !important; }
  .topbar { padding: 10px 16px; gap: 10px; min-height: 64px; }
  .top-clock > strong { font-size: 20px; }
  .top-clock small { display: none; }
  .page { padding: 20px 16px 48px; }
}
@media (max-width: 560px) {
  h1 { font-size: 24px; }
  .top-clock div { display: none; }
  .open-pill { padding: 0 10px; }
  .drawer-stats { grid-template-columns: 1fr 1fr; }
  .tile.hero .tile-value { font-size: 44px; }
  .login-card { padding: 26px 20px 22px; }
  .modal-head, .modal-body, .modal-foot { padding-left: 18px; padding-right: 18px; }
  .drawer-head, .drawer-body { padding-left: 16px; padding-right: 16px; }
}

@media print {
  .sidebar, .topbar, .no-print, .toasts { display: none !important; }
  .shell { display: block; }
  .page { padding: 0; max-width: none; }
  body { background: #fff; }
  .card { box-shadow: none; break-inside: avoid; }
  table.data th { position: static; }
}
