/* ==========================================================================
   NHS Tutoring - two modes, two personalities.

   .dashboard : light, dense, card-based. The coordinator's workbench.
   .kiosk     : dark, enormous targets, nothing on screen but the next tap.
   ========================================================================== */

:root {
  --accent: #fa2d48;
  --accent-soft: #fff0f2;
  --green: #1d9d55;
  --green-soft: #e7f7ee;
  --orange: #c26a00;
  --orange-soft: #fff4e2;
  --red: #d70015;

  --bg: #f5f5f7;
  --panel: #ffffff;
  --sidebar: #ececf0;
  --ink: #1d1d1f;
  --ink-2: #56565c;
  --ink-3: #86868b;
  --line: #dededf;
  --line-soft: #ececee;

  --r-sm: 7px;
  --r-md: 11px;
  --r-lg: 16px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 6px 18px rgba(0, 0, 0, .05);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto,
          Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body.kiosk-active { background: #000; overflow: hidden; }

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; color: var(--ink); }
.hidden { display: none !important; }
.tnum { font-variant-numeric: tabular-nums; }

/* ==========================================================================
   COMMAND CENTER - shell
   ========================================================================== */

.dashboard { display: flex; height: 100vh; overflow: hidden; }

.sidebar {
  width: 232px;
  flex: 0 0 232px;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 14px 10px 10px;
  overflow-y: auto;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(145deg, #fa2d48, #ff6b3d);
  color: #fff; font-weight: 700; font-size: 13px;
  display: grid; place-items: center; letter-spacing: -.3px;
}
.brand-text { line-height: 1.15; }
.brand-text strong { display: block; font-size: 13.5px; letter-spacing: -.2px; }
.brand-text span { font-size: 11px; color: var(--ink-3); }

.nav-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .5px; color: var(--ink-3);
  padding: 14px 8px 6px;
}

.nav-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 7px 8px; margin-bottom: 1px;
  border: 0; background: transparent; border-radius: var(--r-sm);
  font-size: 13.5px; color: var(--ink); text-align: left;
}
.nav-item:hover { background: rgba(0, 0, 0, .045); }
.nav-item.active { background: var(--accent); color: #fff; font-weight: 500; }
.nav-item.active .nav-icon { opacity: 1; }
.nav-icon { width: 17px; text-align: center; opacity: .65; font-size: 14px; }
.nav-count {
  margin-left: auto; font-size: 11px; font-weight: 600;
  background: rgba(0, 0, 0, .08); color: var(--ink-2);
  border-radius: 20px; padding: 1px 7px; min-width: 20px; text-align: center;
}
.nav-item.active .nav-count { background: rgba(255, 255, 255, .25); color: #fff; }
.nav-count.alert { background: var(--orange); color: #fff; }

.sidebar-foot { margin-top: auto; padding-top: 12px; }

.kiosk-launch {
  width: 100%; padding: 11px; border: 0; border-radius: var(--r-md);
  background: var(--ink); color: #fff; font-size: 13.5px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .12s ease, opacity .12s ease;
}
.kiosk-launch:hover { opacity: .88; }
.kiosk-launch:active { transform: scale(.985); }
.sidebar-meta {
  font-size: 11px; color: var(--ink-3); text-align: center;
  padding: 9px 4px 2px; line-height: 1.5;
}

/* Main column ------------------------------------------------------------ */

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: 56px; flex: 0 0 56px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .8);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  display: flex; align-items: center; gap: 14px;
  padding: 0 24px; position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-size: 19px; font-weight: 700; letter-spacing: -.4px; margin: 0; }
.topbar-sub { font-size: 12.5px; color: var(--ink-3); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.live-dot {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; color: var(--ink-3);
}
.live-dot i {
  width: 7px; height: 7px; border-radius: 50%; background: var(--green);
  animation: pulse 2.4s ease-in-out infinite;
}
.live-dot.stale i { background: var(--ink-3); animation: none; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.view { flex: 1; overflow-y: auto; padding: 22px 24px 60px; }
.view-inner { max-width: 1180px; }

/* ==========================================================================
   COMMAND CENTER - components
   ========================================================================== */

.card {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  margin-bottom: 18px;
  overflow: hidden;
}
.card-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; border-bottom: 1px solid var(--line-soft);
}
.card-head h2 { font-size: 15px; font-weight: 650; margin: 0; letter-spacing: -.2px; }
.card-head .sub { font-size: 12px; color: var(--ink-3); }
.card-head .spacer { margin-left: auto; }
.card-body { padding: 16px 18px; }
.card-body.flush { padding: 0; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* Stat tiles */
.stat {
  background: var(--panel); border: 1px solid var(--line-soft);
  border-radius: var(--r-lg); padding: 15px 17px; box-shadow: var(--shadow);
}
.stat-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .45px; color: var(--ink-3);
}
.stat-value {
  font-size: 30px; font-weight: 700; letter-spacing: -1px;
  margin-top: 6px; line-height: 1;
}
.stat-note { font-size: 12px; color: var(--ink-3); margin-top: 6px; }
.stat.is-green .stat-value { color: var(--green); }
.stat.is-orange .stat-value { color: var(--orange); }

/* Alert banner for flagged sessions */
.banner {
  display: flex; align-items: center; gap: 13px;
  background: var(--orange-soft);
  border: 1px solid #f3d2a0;
  border-radius: var(--r-lg);
  padding: 13px 16px; margin-bottom: 18px;
}
.banner-icon {
  width: 30px; height: 30px; flex: none; border-radius: 50%;
  background: var(--orange); color: #fff;
  display: grid; place-items: center; font-size: 16px; font-weight: 700;
}
.banner-text strong { display: block; font-size: 13.5px; color: #7a4400; }
.banner-text span { font-size: 12.5px; color: #8a5a13; }
.banner .btn { margin-left: auto; }

/* Buttons */
.btn {
  border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  border-radius: var(--r-sm); padding: 6px 13px; font-size: 13px; font-weight: 500;
  transition: background .12s ease, border-color .12s ease;
  white-space: nowrap;
}
.btn:hover { background: #f7f7f8; }
.btn:active { background: #efeff1; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #e02440; border-color: #e02440; }
.btn-dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-dark:hover { background: #333; }
.btn-danger { color: var(--red); border-color: #f0c4c4; }
.btn-danger:hover { background: #fff2f2; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: rgba(0, 0, 0, .05); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* Tables */
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .4px; color: var(--ink-3);
  padding: 9px 18px; border-bottom: 1px solid var(--line-soft);
  background: #fbfbfc; position: sticky; top: 0; z-index: 1;
}
table.data td { padding: 11px 18px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: #fafafb; }
table.data td.right, table.data th.right { text-align: right; }
.row-inactive td { opacity: .5; }

/* Avatars */
.avatar {
  width: 30px; height: 30px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 11.5px; font-weight: 650; color: #fff; letter-spacing: .2px;
}
.who { display: flex; align-items: center; gap: 10px; }
.who-name { font-weight: 550; }
.who-sub { font-size: 11.5px; color: var(--ink-3); }

/* Status pills */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 600; border-radius: 20px; padding: 3px 9px;
  background: #f0f0f2; color: var(--ink-2); white-space: nowrap;
}
.pill i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.active { background: var(--green-soft); color: var(--green); }
.pill.active i { animation: pulse 2.4s ease-in-out infinite; }
.pill.flagged { background: var(--orange-soft); color: var(--orange); }
.pill.completed { background: #f0f0f2; color: var(--ink-2); }
.pill.manual { background: #eef2fb; color: #3a5ea8; }
.pill.scheduled { background: #f0f0f2; color: var(--ink-3); }

/* Progress bars */
.progress { height: 6px; border-radius: 4px; background: #ececee; overflow: hidden; min-width: 90px; }
.progress > i { display: block; height: 100%; border-radius: 4px; background: var(--accent); transition: width .4s ease; }
.progress > i.done { background: var(--green); }

/* Forms */
.field { margin-bottom: 14px; }
.field label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--ink-2); margin-bottom: 5px;
}
.help { font-size: 11.5px; color: var(--ink-3); margin-top: 5px; line-height: 1.45; }
input[type="text"], input[type="number"], input[type="date"], input[type="time"],
input[type="password"], select, textarea {
  width: 100%; padding: 8px 11px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: #fff; outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(250, 45, 72, .12);
}
textarea { resize: vertical; min-height: 68px; }
.field-row { display: flex; gap: 12px; }
.field-row > * { flex: 1; }

.filters {
  display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap;
  padding: 14px 18px; border-bottom: 1px solid var(--line-soft); background: #fbfbfc;
}
.filters .field { margin: 0; min-width: 140px; }

/* Schedule grid */
.sched-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.sched-day {
  border: 1px solid var(--line-soft); border-radius: var(--r-md);
  overflow: hidden; background: #fff;
}
.sched-day.today { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.sched-day h3 {
  margin: 0; font-size: 12px; font-weight: 650; padding: 9px 12px;
  background: #fafafb; border-bottom: 1px solid var(--line-soft);
  display: flex; justify-content: space-between; align-items: center;
}
.sched-day h3 em { font-style: normal; font-size: 10.5px; color: var(--accent); font-weight: 700; }
.sched-list { padding: 6px; max-height: 250px; overflow-y: auto; }
.sched-check {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 7px; border-radius: 6px; font-size: 12.5px; cursor: pointer;
}
.sched-check:hover { background: #f5f5f7; }
.sched-check input { width: auto; margin: 0; accent-color: var(--accent); }

/* Empty state */
.empty { padding: 40px 20px; text-align: center; color: var(--ink-3); }
.empty .big { font-size: 30px; margin-bottom: 8px; opacity: .5; }
.empty p { margin: 0; font-size: 13.5px; }

/* Modal.
   Stacking order: topbar 20 < kiosk 200 < modal 500 < toast 600. The modal has
   to clear the kiosk overlay so the admin-exit prompt is visible on the tablet. */
.scrim {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .35);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  display: grid; place-items: center; z-index: 500; padding: 20px;
  animation: fade .16s ease;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  background: var(--panel); border-radius: var(--r-lg);
  width: 100%; max-width: 440px; max-height: 88vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .28);
  animation: rise .2s cubic-bezier(.2, .8, .3, 1);
}
.modal.wide { max-width: 620px; }
@keyframes rise { from { transform: translateY(12px) scale(.985); opacity: 0; } }
.modal-head { padding: 18px 20px 4px; }
.modal-head h2 { margin: 0; font-size: 17px; font-weight: 680; letter-spacing: -.3px; }
.modal-head p { margin: 5px 0 0; font-size: 13px; color: var(--ink-3); line-height: 1.5; }
.modal-body { padding: 16px 20px; }
.modal-foot {
  padding: 14px 20px; border-top: 1px solid var(--line-soft);
  display: flex; gap: 9px; justify-content: flex-end; background: #fbfbfc;
}
.modal-foot .left { margin-right: auto; }
.form-error {
  background: #fff2f2; border: 1px solid #f5cccc; color: var(--red);
  border-radius: var(--r-sm); padding: 8px 11px; font-size: 12.5px; margin-bottom: 12px;
}

/* Toast */
#toast-root {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  z-index: 600; display: flex; flex-direction: column; gap: 8px; align-items: center;
}
.toast {
  background: rgba(28, 28, 30, .95); color: #fff;
  padding: 10px 18px; border-radius: 22px; font-size: 13px; font-weight: 500;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .3);
  animation: toast-in .22s cubic-bezier(.2, .8, .3, 1);
}
.toast.bad { background: rgba(190, 20, 30, .96); }
@keyframes toast-in { from { transform: translateY(14px); opacity: 0; } }

/* ==========================================================================
   KIOSK MODE - dark, oversized, single-purpose
   ========================================================================== */

.kiosk {
  position: fixed; inset: 0; z-index: 200;
  background: radial-gradient(1100px 700px at 50% -10%, #2a2a30 0%, #121215 55%, #0a0a0c 100%);
  color: #fff;
  display: flex; flex-direction: column;
  overflow: hidden;
  user-select: none; -webkit-user-select: none;
}

.k-head {
  padding: 26px 34px 8px;
  display: flex; align-items: baseline; gap: 14px; flex: none;
}
.k-title { font-size: 27px; font-weight: 700; letter-spacing: -.6px; }
.k-sub { font-size: 15px; color: rgba(255, 255, 255, .48); }
.k-clock {
  margin-left: auto; font-size: 22px; font-weight: 600;
  color: rgba(255, 255, 255, .82); font-variant-numeric: tabular-nums;
}

.k-screen { flex: 1; overflow-y: auto; padding: 14px 34px 34px; }
/* `safe` keeps the top of tall content reachable instead of clipping it.
   Centered screens don't need the grid's bottom breathing room. */
.k-screen.center {
  display: grid; justify-items: center; place-content: safe center;
  padding-bottom: 14px;
}

/* Tutor tile grid */
.k-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 18px;
  padding-bottom: 20px;
}

.k-tile {
  position: relative;
  border: 0; border-radius: 22px;
  background: rgba(255, 255, 255, .07);
  padding: 26px 16px 20px;
  display: flex; flex-direction: column; align-items: center; gap: 13px;
  color: #fff;
  transition: transform .14s cubic-bezier(.2, .8, .3, 1), background .14s ease;
  min-height: 172px; justify-content: center;
}
.k-tile:hover { background: rgba(255, 255, 255, .12); }
.k-tile:active { transform: scale(.955); background: rgba(255, 255, 255, .16); }

.k-avatar {
  width: 76px; height: 76px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 27px; font-weight: 650; letter-spacing: .5px; color: #fff;
  box-shadow: inset 0 -2px 8px rgba(0, 0, 0, .18);
}
.k-name { font-size: 18px; font-weight: 600; letter-spacing: -.2px; }

.k-tile.checked-in { background: rgba(48, 209, 88, .14); box-shadow: inset 0 0 0 2px rgba(48, 209, 88, .55); }
.k-tile.checked-in:hover { background: rgba(48, 209, 88, .2); }
.k-badge {
  position: absolute; top: 13px; right: 13px;
  font-size: 11px; font-weight: 700; letter-spacing: .3px;
  background: #30d158; color: #06340f;
  border-radius: 20px; padding: 3px 9px; text-transform: uppercase;
}
.k-tile.flagged-in .k-badge { background: #ff9f0a; color: #3d2500; }
.k-tile.flagged-in { box-shadow: inset 0 0 0 2px rgba(255, 159, 10, .55); background: rgba(255, 159, 10, .12); }

/* PIN pad */
/* Everything on the PIN screen scales with viewport height so the whole pad
   fits without scrolling on a 768px-tall tablet in landscape. */
.k-pin { text-align: center; width: 100%; max-width: 380px; }
.k-pin-who {
  display: flex; flex-direction: column; align-items: center;
  gap: clamp(6px, 1.4vh, 12px); margin-bottom: clamp(10px, 2.4vh, 22px);
}
.k-pin-who .k-avatar {
  width: clamp(54px, 8vh, 76px); height: clamp(54px, 8vh, 76px);
  font-size: clamp(19px, 2.9vh, 27px);
}
.k-pin-title { font-size: clamp(20px, 3.2vh, 25px); font-weight: 650; letter-spacing: -.4px; }
.k-pin-hint { font-size: clamp(13px, 2vh, 15px); color: rgba(255, 255, 255, .5); margin-top: 4px; }

.k-dots {
  display: flex; justify-content: center; gap: 17px;
  margin: clamp(12px, 2.8vh, 26px) 0 clamp(14px, 3.2vh, 30px);
}
.k-dots i {
  width: 17px; height: 17px; border-radius: 50%;
  background: transparent; border: 2px solid rgba(255, 255, 255, .35);
  transition: all .13s ease;
}
.k-dots i.on { background: #fff; border-color: #fff; transform: scale(1.12); }
.k-dots.err i { border-color: #ff453a; background: transparent; }
.k-shake { animation: shake .4s cubic-bezier(.36, .07, .19, .97); }
@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-7px); }
  40%, 60% { transform: translateX(7px); }
}

/* Fixed-width columns keep the keys perfectly round instead of stretching
   into ellipses on wide tablets. */
.k-keys {
  display: grid; justify-content: center;
  grid-template-columns: repeat(3, var(--key, 86px));
  gap: clamp(9px, 1.9vh, 18px);
  --key: clamp(62px, 10vh, 86px);
}
.k-key {
  width: var(--key); height: var(--key); border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .1); color: #fff;
  font-size: clamp(24px, 3.7vh, 31px); font-weight: 400;
  transition: transform .1s ease, background .1s ease;
}
.k-key:hover { background: rgba(255, 255, 255, .16); }
.k-key:active { transform: scale(.9); background: rgba(255, 255, 255, .3); }
.k-key.util { font-size: 15px; font-weight: 600; background: transparent; }
.k-key.util:hover { background: rgba(255, 255, 255, .1); }

.k-error {
  color: #ff6961; font-size: 15px; font-weight: 550;
  min-height: 22px; margin-bottom: 6px;
}

/* Notes step */
.k-notes { width: 100%; max-width: 620px; text-align: center; }
.k-notes h2 { font-size: 27px; font-weight: 680; margin: 0 0 6px; letter-spacing: -.5px; }
.k-notes .k-elapsed { font-size: 16px; color: rgba(255, 255, 255, .55); margin-bottom: 26px; }
.k-notes textarea {
  width: 100%; min-height: 130px; padding: 19px;
  font-size: 20px; line-height: 1.45; color: #fff;
  background: rgba(255, 255, 255, .09);
  border: 2px solid rgba(255, 255, 255, .16); border-radius: 18px;
  outline: none; resize: none;
}
.k-notes textarea::placeholder { color: rgba(255, 255, 255, .32); }
.k-notes textarea:focus { border-color: rgba(255, 255, 255, .45); box-shadow: none; }
.k-chips { display: flex; flex-wrap: wrap; gap: 9px; justify-content: center; margin: 16px 0 6px; }
.k-chip {
  border: 1px solid rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .05);
  color: rgba(255, 255, 255, .85); border-radius: 20px;
  padding: 8px 15px; font-size: 14.5px;
}
.k-chip:active { background: rgba(255, 255, 255, .2); }

.k-actions { display: flex; gap: 14px; justify-content: center; margin-top: 26px; }
.k-btn {
  border: 0; border-radius: 15px; padding: 17px 40px;
  font-size: 18px; font-weight: 620; letter-spacing: -.2px;
  background: rgba(255, 255, 255, .12); color: #fff;
  transition: transform .1s ease, background .12s ease;
}
.k-btn:active { transform: scale(.97); }
.k-btn.go { background: #fff; color: #111; }
.k-btn.go:hover { background: rgba(255, 255, 255, .9); }

/* Confirmation */
.k-confirm { text-align: center; animation: confirm-in .4s cubic-bezier(.2, .9, .3, 1); }
@keyframes confirm-in { from { transform: scale(.9); opacity: 0; } }
.k-check {
  width: 128px; height: 128px; border-radius: 50%; margin: 0 auto 30px;
  display: grid; place-items: center; font-size: 62px; color: #fff;
  background: var(--k-accent, #30d158);
  box-shadow: 0 0 0 14px rgba(48, 209, 88, .13);
}
.k-check.out { background: #0a84ff; box-shadow: 0 0 0 14px rgba(10, 132, 255, .13); }
.k-confirm h2 { font-size: 42px; font-weight: 700; margin: 0 0 12px; letter-spacing: -1.2px; }
.k-confirm .k-time { font-size: 25px; color: rgba(255, 255, 255, .62); font-weight: 500; }
.k-confirm .k-total {
  display: inline-block; margin-top: 24px; padding: 11px 24px;
  background: rgba(255, 255, 255, .1); border-radius: 30px;
  font-size: 19px; font-weight: 600;
}
.k-countdown { margin-top: 32px; font-size: 14px; color: rgba(255, 255, 255, .35); }

/* Exit affordance - deliberately understated */
.k-foot {
  flex: none; padding: 12px 20px 18px;
  display: flex; align-items: center; justify-content: center;
}
.k-exit {
  border: 0; background: transparent; color: rgba(255, 255, 255, .22);
  font-size: 12px; padding: 9px 16px; border-radius: 8px; letter-spacing: .2px;
}
.k-exit:hover { color: rgba(255, 255, 255, .6); background: rgba(255, 255, 255, .06); }

/* Kiosk-flavoured modal (admin PIN to leave) */
.scrim.dark { background: rgba(0, 0, 0, .72); }
.scrim.dark .modal {
  background: #1c1c1f; color: #fff; max-width: 380px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .6);
}
.scrim.dark .modal-head h2 { color: #fff; }
.scrim.dark .modal-head p { color: rgba(255, 255, 255, .5); }
.scrim.dark .modal-foot { background: transparent; border-top-color: rgba(255, 255, 255, .1); }
.scrim.dark input {
  background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .18); color: #fff;
  font-size: 26px; text-align: center; letter-spacing: 10px; padding: 13px;
}
.scrim.dark .btn { background: rgba(255, 255, 255, .12); border-color: transparent; color: #fff; }
.scrim.dark .btn-primary { background: #fff; color: #111; }
.scrim.dark .form-error {
  background: rgba(255, 69, 58, .16); border-color: rgba(255, 69, 58, .38); color: #ff9d95;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1080px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3, .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .sched-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 780px) {
  .sidebar { width: 66px; flex: 0 0 66px; padding: 12px 8px; }
  .brand-text, .nav-item span.label, .nav-label, .sidebar-meta { display: none; }
  .nav-item { justify-content: center; padding: 10px 0; }
  .nav-count { position: absolute; margin: 0; transform: translate(16px, -12px); }
  .nav-item { position: relative; }
  .kiosk-launch { padding: 10px 0; font-size: 0; gap: 0; }
  .kiosk-launch::after { content: "▶"; font-size: 13px; }
  .view { padding: 16px 14px 50px; }
  .topbar { padding: 0 14px; }
  .grid-4 { grid-template-columns: minmax(0, 1fr); }
}

/* Tablets in portrait get slightly chunkier kiosk tiles. */
@media (max-width: 900px) {
  .k-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
  .k-head { padding: 20px 20px 6px; }
  .k-screen { padding: 10px 20px 24px; }
  .k-title { font-size: 23px; }
  .k-confirm h2 { font-size: 34px; }
}

/* ==========================================================================
   DARK MODE - Command Center only.

   The kiosk is dark by definition and already hardcodes its own palette, so
   nothing here touches it. Most of the work is re-pointing the tokens in
   :root; the rules below are the handful of places that hardcoded a light
   value and would otherwise stay stubbornly white.
   ========================================================================== */

:root[data-theme="dark"] {
  --accent-soft: #3d1620;
  --green-soft: #10301f;
  --orange-soft: #35250d;

  --bg: #131316;
  --panel: #1d1d21;
  --sidebar: #0f0f12;
  --ink: #f2f2f5;
  --ink-2: #a4a4ad;
  --ink-3: #78787f;
  --line: #35353c;
  --line-soft: #2a2a30;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 18px rgba(0, 0, 0, .35);
}

:root[data-theme="dark"] .nav-item:hover { background: rgba(255, 255, 255, .06); }
:root[data-theme="dark"] .nav-count { background: rgba(255, 255, 255, .1); }

:root[data-theme="dark"] .btn:hover { background: #26262b; }
:root[data-theme="dark"] .btn:active { background: #2e2e34; }
:root[data-theme="dark"] .btn-ghost:hover { background: rgba(255, 255, 255, .07); }
/* .btn-dark and .kiosk-launch both paint themselves with --ink, which is now
   near-white, so their labels have to flip to dark or they vanish into the
   button. .kiosk-launch is the one that matters — white-on-white made the
   only way into kiosk mode invisible. */
:root[data-theme="dark"] .btn-dark,
:root[data-theme="dark"] .kiosk-launch { color: #131316; }
:root[data-theme="dark"] .btn-dark:hover { background: #d8d8dd; border-color: #d8d8dd; }
:root[data-theme="dark"] .btn-danger { border-color: #5a2b2b; }
:root[data-theme="dark"] .btn-danger:hover { background: #341a1a; }

:root[data-theme="dark"] .pill { background: #2a2a30; }
:root[data-theme="dark"] input[type="text"],
:root[data-theme="dark"] input[type="number"],
:root[data-theme="dark"] input[type="date"],
:root[data-theme="dark"] input[type="time"],
:root[data-theme="dark"] input[type="password"],
:root[data-theme="dark"] select,
:root[data-theme="dark"] textarea { background: #141417; color: var(--ink); }

:root[data-theme="dark"] .sched-day { background: #1d1d21; }
:root[data-theme="dark"] .sched-day h3 { background: #232329; }
:root[data-theme="dark"] .sched-check:hover { background: #2a2a30; }

:root[data-theme="dark"] .modal-foot { background: #1a1a1e; }
:root[data-theme="dark"] .form-error { background: #341a1a; border-color: #5a2b2b; }

/* The amber "forgotten checkout" banner is legible on cream, not on charcoal. */
:root[data-theme="dark"] .banner-text strong { color: #f0b357; }
:root[data-theme="dark"] .banner-text span { color: #c99544; }

/* Fullscreen toggle — sits with the kiosk clock. Quiet by default so it reads
   as chrome, not as something a tutor is meant to press. */
.k-fs {
  flex: none; margin-left: 14px;
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .06);
  color: rgba(255, 255, 255, .55);
  font-size: 17px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  align-self: center;
  transition: background .15s ease, color .15s ease;
}
.k-fs:hover { background: rgba(255, 255, 255, .13); color: rgba(255, 255, 255, .9); }
.k-fs:active { transform: scale(.94); }

/* Light values that specificity or an rgba() form kept out of the token sweep
   above. Found when a fresh origin defaulted to system-dark and the topbar
   stayed white over dark cards. */
:root[data-theme="dark"] .topbar { background: rgba(29, 29, 33, .8); }
:root[data-theme="dark"] table.data th { background: #232329; }
:root[data-theme="dark"] table.data tbody tr:hover { background: #26262b; }
:root[data-theme="dark"] .filters { background: #1a1a1e; }
:root[data-theme="dark"] .progress { background: #33333a; }
/* .pill variants each set their own background, so they out-specify .pill. */
:root[data-theme="dark"] .pill.completed,
:root[data-theme="dark"] .pill.scheduled { background: #2a2a30; }
:root[data-theme="dark"] .pill.manual { background: #1e2a42; color: #8fb0e8; }

/* Shown only where the Fullscreen API is unavailable (iOS Safari) and the app
   isn't already launched from the home screen. */
.k-install {
  font-size: 12.5px; color: rgba(255, 255, 255, .42);
  text-align: center; margin-bottom: 8px; padding: 0 20px; line-height: 1.5;
}
