:root {
  color-scheme: light;
  --bg: #eef2f6;
  --panel: #fff;
  --ink: #172033;
  --muted: #667085;
  --line: #d9e2ee;
  --teal: #2fa79d;
  --teal-dark: #157f78;
  --teal-soft: #d8f1ee;
  --green: #16825d;
  --green-soft: #e8f7f0;
  --blue: #315c96;
  --blue-soft: #e7eef9;
  --red: #b42318;
  --red-soft: #fff0ee;
  --amber: #9a6700;
  --amber-soft: #fff5de;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.modal-open { overflow: hidden; }

a { color: inherit; }

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid var(--teal-dark);
  border-radius: 6px;
  background: var(--teal-dark);
  color: #fff;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

button:hover,
.button:hover { background: #0f6d67; }

.secondary {
  border-color: #ded2d2;
  background: #f1e4e4;
  color: #4f4444;
}

.topbar {
  min-height: 66px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(260px, 1fr);
  align-items: center;
  gap: 18px;
  padding: 8px max(18px, calc((100vw - 1220px) / 2));
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  text-decoration: none;
}

.brand small { display: block; color: var(--muted); font-weight: 500; }

.brand-logo {
  width: 94px;
  height: 53px;
  flex: 0 0 auto;
  object-fit: contain;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--teal-dark);
  border-radius: 7px;
  background: var(--teal-soft);
  color: var(--teal-dark);
  font-size: 22px;
  font-weight: 900;
}

.brand-mark.small { width: 34px; height: 34px; border-radius: 6px; font-size: 17px; }

nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }

nav a {
  padding: 8px 12px;
  border: 1px solid #ded2d2;
  border-radius: 6px;
  background: #f1e4e4;
  text-decoration: none;
}

nav a.active { border-color: #b8c9e2; background: var(--blue-soft); color: var(--blue); }
.top-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; color: var(--muted); }
.page { width: min(1220px, 100%); margin: 0 auto; padding: 16px 14px 48px; }

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.page-heading h1 { margin: 2px 0; font-size: 25px; }
.page-heading p:last-child { margin-bottom: 0; }
.page-heading-actions { display: flex; align-items: flex-end; flex-direction: column; gap: 8px; }
.eyebrow { margin: 0; color: var(--teal-dark); font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.muted { color: var(--muted); }

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.metrics article {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.metrics span { display: block; color: var(--muted); font-size: 12px; }
.metrics strong { display: block; margin-top: 2px; font-size: 24px; }
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.panel { padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.panel + .panel { margin-top: 14px; }
.dashboard-grid .panel + .panel { margin-top: 0; }
.panel h2 { margin: 0; font-size: 18px; }
.panel-title { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; }

.status {
  display: inline-flex;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f4f6f9;
  color: #526078;
  font-size: 11px;
  font-weight: 800;
}

.status.current { border-color: #bde4d3; background: var(--green-soft); color: var(--green); }
.status.stale { border-color: #ecd49d; background: var(--amber-soft); color: var(--amber); }
.status.offline { border-color: #f0c0bb; background: var(--red-soft); color: var(--red); }
.details { display: grid; gap: 0; margin: 0; }
.details div { display: grid; grid-template-columns: 180px 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.details dt { color: var(--muted); }
.details dd { margin: 0; font-weight: 650; }
.wallet-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.wallet-grid div { padding: 12px; border: 1px solid var(--line); border-radius: 7px; background: #f8fafc; }
.wallet-grid strong { display: block; font-size: 22px; }
.wallet-grid span { color: var(--muted); font-size: 12px; }
.class-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.class-list.vertical { align-content: start; flex-direction: column; margin: 10px 0 0; }

.class-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 120px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  text-decoration: none;
}

.class-link.active { border-color: var(--teal-dark); background: var(--teal-soft); color: var(--teal-dark); }
.class-link strong { padding: 2px 7px; border-radius: 999px; background: #fff; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 9px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { background: #f7f9fb; color: var(--muted); font-size: 11px; text-transform: uppercase; }
.roster-table-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin: 2px 0 12px;
}
.roster-table-toolbar label { display: grid; width: min(560px, 100%); gap: 5px; color: #344057; font-weight: 700; }
.roster-table-toolbar input { min-height: 40px; }
.roster-table-toolbar > span { padding-bottom: 9px; white-space: nowrap; }
.roster-table-scroll {
  --roster-header-height: 39px;
  --roster-row-height: 41px;
  --roster-twenty-rows-height: 820px;
  max-height: min(
    calc(var(--roster-header-height) + var(--roster-twenty-rows-height) + 2px),
    75dvh
  );
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.roster-scroll-hint { display: none; margin: -4px 0 8px; font-size: 12px; }
.roster-table-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 0;
  box-shadow: 0 1px 0 var(--line);
}
.roster-table-scroll tbody td { height: var(--roster-row-height); }
.roster-sort-button {
  width: 100%;
  min-height: 38px;
  justify-content: flex-start;
  gap: 6px;
  padding: 8px 9px;
  border: 0;
  border-radius: 0;
  background: #f7f9fb;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}
.roster-sort-button:hover { background: var(--teal-soft); color: var(--teal-dark); }
.roster-sort-button:disabled { cursor: default; opacity: 1; }
.roster-sort-button:disabled:hover { background: #f7f9fb; color: var(--muted); }
.roster-sort-arrow { color: #98a2b3; font-size: 13px; line-height: 1; }
th[aria-sort="ascending"] .roster-sort-button,
th[aria-sort="descending"] .roster-sort-button { color: var(--teal-dark); }
th[aria-sort="ascending"] .roster-sort-arrow,
th[aria-sort="descending"] .roster-sort-arrow { color: var(--teal-dark); }
.roster-empty { padding: 28px 12px; text-align: center; }
.canteen-layout { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 16px; }
.problem-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.problem-card { display: grid; gap: 4px; padding: 10px; border: 1px solid #f0c0bb; border-radius: 7px; background: var(--red-soft); }
.problem-card strong { color: var(--red); }
.problem-card small { color: var(--muted); }
.empty { padding: 24px; color: var(--muted); text-align: center; }

.drill-link { color: var(--teal-dark); font-weight: 800; text-decoration-thickness: 1px; }
.drill-action { color: var(--teal-dark); font-weight: 700; text-decoration: none; white-space: nowrap; }
.drill-breadcrumb { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; color: var(--muted); }
.drill-breadcrumb a { color: var(--teal-dark); font-weight: 700; }
.drill-breadcrumb span::before { content: "/"; margin-right: 10px; color: #aab4c2; }
.drill-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.drill-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3px 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  text-decoration: none;
}
.drill-card:hover { border-color: var(--teal-dark); background: var(--teal-soft); }
.drill-card span { font-size: 17px; font-weight: 800; }
.drill-card strong { color: var(--teal-dark); font-size: 20px; }
.drill-card small { grid-column: 1 / -1; color: var(--muted); }
.problem-explainer {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  padding: 11px 13px;
  border: 1px solid #ecd49d;
  border-radius: 7px;
  background: var(--amber-soft);
  color: #684700;
}
.problem-explainer strong { white-space: nowrap; }
.problems-panel td .status { white-space: normal; }
.canteen-attention { margin-bottom: 14px; border-color: #ecd49d; background: var(--amber-soft); }
.canteen-attention .panel-title { align-items: flex-start; }
.history-day-row.active td { background: var(--blue-soft); }
.history-day-link { color: var(--teal-dark); font-weight: 800; }
.history-details { margin-top: 14px; }

.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 18px; }
.auth-card { width: min(420px, 100%); padding: 22px; border: 1px solid var(--line); border-top: 4px solid var(--teal); border-radius: 9px; background: #fff; }
.auth-card .brand-mark { margin-bottom: 10px; }
.auth-logo {
  display: block;
  width: min(250px, 76%);
  height: auto;
  margin: 0 0 14px;
}
.auth-card-login {
  width: min(390px, 100%);
  padding: 28px;
  border-top: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 18px 48px rgba(23, 32, 51, .12);
}
.auth-card-login .stack { gap: 16px; }
.auth-card-login input { min-height: 44px; }
.auth-card-login button { min-height: 44px; margin-top: 2px; }
.auth-card-login .form-message:empty { display: none; }
.auth-card h1 { margin: 8px 0 4px; font-size: 24px; }
.stack { display: grid; gap: 13px; }
.stack label { display: grid; gap: 5px; color: #344057; font-weight: 700; }

input,
select {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #c8d3df;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.filter-panel { margin-bottom: 14px; }
.filter-panel p { margin: 10px 0 0; }
.period-form,
.manual-toolbar {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr)) auto;
  align-items: end;
  gap: 10px;
}
.canteen-period-form { grid-template-columns: repeat(2, minmax(180px, 1fr)) auto; }
.manual-filter-form { grid-template-columns: minmax(180px, .7fr) minmax(180px, 1fr) auto; }
.period-form label,
.manual-toolbar label { display: grid; gap: 5px; color: #344057; font-weight: 700; }
.manual-toolbar { grid-template-columns: minmax(180px, .7fr) minmax(240px, 1.3fr); }
.manual-panel { margin-top: 14px; }
.manual-panel .panel-title p { margin: 3px 0 0; }
.candidate-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-height: 360px;
  overflow: auto;
  padding: 2px;
}
.candidate-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  cursor: pointer;
}
.candidate-row:has(input:checked) { border-color: var(--teal-dark); background: var(--teal-soft); }
.candidate-row input { width: 18px; min-height: 18px; margin: 0; }
.candidate-row span { min-width: 0; }
.candidate-row strong,
.candidate-row small { display: block; overflow-wrap: anywhere; }
.candidate-row small { color: var(--muted); }
.form-actions { display: flex; align-items: center; gap: 12px; }
.form-actions .form-message { flex: 1; }
.form-message.success { color: var(--green); }
.nobd-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(23, 32, 51, .58);
  backdrop-filter: blur(2px);
}
.nobd-preview-dialog {
  width: min(820px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(23, 32, 51, .3);
}
.nobd-preview-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 19px 22px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.nobd-preview-header h3 { margin: 4px 0 6px; font-size: 25px; line-height: 1.2; }
.nobd-preview-header p:last-child { margin: 0; color: var(--muted); }
.nobd-modal-x {
  width: 44px;
  min-height: 44px;
  flex: 0 0 44px;
  padding: 0;
  border-color: var(--line);
  border-radius: 50%;
  background: #f7f9fb;
  color: var(--ink);
  font-size: 26px;
  font-weight: 400;
  line-height: 1;
}
.nobd-modal-x:hover { background: var(--red-soft); color: var(--red); }
.nobd-preview-dialog button:disabled { cursor: wait; opacity: .58; }
.nobd-preview-body { display: grid; gap: 14px; padding: 18px 22px 22px; }
.nobd-key-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}
.nobd-key-metrics > div {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
}
.nobd-key-metrics dt { color: var(--muted); font-size: 13px; font-weight: 700; }
.nobd-key-metrics dd { display: grid; margin: 3px 0 0; }
.nobd-key-metrics dd strong { color: var(--teal-dark); font-size: 30px; line-height: 1.15; }
.nobd-key-metrics dd span { color: var(--muted); font-size: 12px; font-weight: 400; }
.nobd-key-metrics .nobd-metric-text { color: var(--muted); font-size: 16px; font-weight: 800; }
.nobd-quality,
.nobd-meal-summary,
.nobd-applied-state {
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.nobd-quality strong,
.nobd-applied-state strong { font-size: 16px; }
.nobd-quality p,
.nobd-applied-state p { margin: 4px 0 0; }
.nobd-quality-success { border-color: #bde4d3; background: var(--green-soft); color: #125f47; }
.nobd-quality-warning { border-color: #ecd49d; background: var(--amber-soft); color: #684700; }
.nobd-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.nobd-section-heading h4 { margin: 0; font-size: 17px; }
.nobd-section-heading p { margin: 4px 0 0; color: var(--muted); }
.nobd-section-heading > strong { color: var(--teal-dark); font-size: 30px; }
.nobd-meal-breakdown { display: grid; gap: 8px; margin: 14px 0 0; }
.nobd-meal-breakdown div,
.nobd-technical-body dl div,
.nobd-detail-list li { display: flex; justify-content: space-between; gap: 16px; }
.nobd-meal-breakdown div { padding-top: 8px; border-top: 1px solid var(--line); }
.nobd-meal-breakdown dd,
.nobd-technical-body dd { margin: 0; font-weight: 800; text-align: right; }
.nobd-technical-details {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
}
.nobd-technical-details summary { padding: 13px 16px; color: var(--teal-dark); font-weight: 800; cursor: pointer; }
.nobd-technical-body { display: grid; gap: 10px; padding: 0 16px 16px; }
.nobd-technical-body dl { display: grid; gap: 8px; margin: 0; }
.nobd-technical-body code { overflow-wrap: anywhere; }
.nobd-technical-body h5 { margin: 4px 0 0; font-size: 14px; }
.nobd-detail-list { display: grid; gap: 7px; margin: 8px 0 0; padding: 0; list-style: none; }
.nobd-confirmation {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 15px 16px;
  border: 1px solid #bde4d3;
  border-radius: 10px;
  background: var(--green-soft);
  cursor: pointer;
}
.nobd-confirmation input { width: 20px; min-height: 20px; flex: 0 0 20px; margin: 2px 0 0; }
.nobd-confirmation span,
.nobd-confirmation strong,
.nobd-confirmation small { display: block; }
.nobd-confirmation small { margin-top: 3px; color: var(--muted); }
.nobd-apply-form { display: grid; gap: 12px; }
.nobd-apply-form .form-message:empty { display: none; }
.nobd-modal-actions { display: flex; justify-content: flex-end; gap: 10px; }
.nobd-applied-state { border-color: #bde4d3; background: var(--green-soft); }
.nobd-applied-state button { margin-top: 12px; }
td small { display: block; color: var(--muted); white-space: normal; }
.notice {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}
.notice.warning { border-color: #ecd49d; background: var(--amber-soft); color: #684700; }
.export-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.export-row p { margin: 10px 0 0; }
.attempt-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.attempt-card { display: grid; gap: 4px; padding: 11px; border: 1px solid var(--line); border-radius: 7px; background: #f8fafc; }
.attempt-card span,
.attempt-card small { color: var(--muted); }
.attempt-card p { margin: 4px 0 0; }
.report-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.report-metrics article {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
}
.report-metrics span { color: var(--muted); font-size: 13px; }
.report-metrics strong { color: var(--teal-dark); font-size: 28px; }
.report-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.wallet-day-row.active td { background: var(--teal-soft); }
.wallet-day-link { color: var(--teal-dark); font-weight: 800; }
#wallet-day-details { scroll-margin-top: 12px; }
#wallet-day-details.loading { opacity: .55; pointer-events: none; }
.wallet-reason-groups { display: grid; gap: 10px; }
.wallet-reason-group {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}
.wallet-reason-group[open] { border-color: #e1bd70; background: #fffdf7; }
.wallet-reason-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 15px;
  cursor: pointer;
  list-style: none;
}
.wallet-reason-group summary::-webkit-details-marker { display: none; }
.wallet-reason-group summary::before {
  content: "+";
  width: 24px;
  height: 24px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--amber-soft);
  color: var(--amber);
  font-weight: 900;
}
.wallet-reason-group[open] summary::before { content: "−"; }
.wallet-reason-group summary span { flex: 1; }
.wallet-reason-group summary strong,
.wallet-reason-group summary small { display: block; }
.wallet-reason-group summary small { margin-top: 2px; color: var(--muted); }
.wallet-reason-group summary b {
  min-width: 34px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--red-soft);
  color: var(--red);
  text-align: center;
}
.wallet-reason-body {
  display: grid;
  grid-template-columns: minmax(260px, .8fr) minmax(320px, 1.2fr);
  gap: 12px;
  padding: 0 15px 15px;
}
.wallet-reason-body h3 { margin: 0 0 8px; font-size: 14px; }
.wallet-error-card,
.wallet-solution {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}
.wallet-solution { border-color: #bde4d3; background: var(--green-soft); }
.wallet-solution p { margin: 0; }
.wallet-error-details { display: grid; gap: 6px; margin: 0; }
.wallet-error-details div { display: grid; grid-template-columns: 110px 1fr; gap: 10px; }
.wallet-error-details dt { color: var(--muted); font-family: ui-monospace, monospace; }
.wallet-error-details dd { margin: 0; overflow-wrap: anywhere; font-weight: 650; }
.wallet-student-list { grid-column: 1 / -1; }
.wallet-student-list h3 { margin-top: 4px; }
.wallet-student-list td:last-child { font-family: ui-monospace, monospace; }
.export-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.compact-notice { justify-content: flex-start; }
.voucher-panel[aria-busy="true"] { opacity: .65; }
.voucher-panel-title { align-items: flex-start; }
.voucher-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 8px; }
.voucher-actions form { margin: 0; }
.voucher-actions button:disabled { cursor: not-allowed; opacity: .55; }
.voucher-sync-explainer,
.compact-note { margin: 6px 0 12px; }
.voucher-refresh-status {
  margin: 12px 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}
.voucher-refresh-status.current { border-color: #bde4d3; background: var(--green-soft); }
.voucher-refresh-status.stale { border-color: #ecd49d; background: var(--amber-soft); }
.voucher-refresh-status.offline { border-color: #f0c0bb; background: var(--red-soft); }
.voucher-refresh-status summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
}
.voucher-refresh-status summary span { color: var(--muted); font-size: 12px; font-weight: 700; }
.voucher-refresh-status summary strong { color: var(--ink); }
.voucher-refresh-status-body { padding: 0 14px 14px; }
.voucher-refresh-status-body p { margin: 8px 0 0; }
.voucher-refresh-progress {
  overflow: hidden;
  height: 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .75);
}
.voucher-refresh-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--teal-dark);
}
.voucher-refresh-status.offline .voucher-refresh-progress span { background: var(--red); }
.voucher-refresh-status.current .voucher-refresh-progress span { background: var(--green); }
.voucher-refresh-facts {
  display: grid;
  gap: 4px;
  margin: 12px 0 0;
}
.voucher-refresh-facts div {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 10px;
}
.voucher-refresh-facts dt { color: var(--muted); }
.voucher-refresh-facts dd { margin: 0; font-weight: 700; }
.voucher-identities {
  margin: 14px 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}
.voucher-identities summary { cursor: pointer; color: var(--teal-dark); font-weight: 800; }
.voucher-identity-list { display: grid; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.voucher-identity-list li {
  display: grid;
  grid-template-columns: minmax(150px, .4fr) minmax(220px, 1fr);
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.voucher-iin { font-family: ui-monospace, monospace; font-weight: 800; }
.voucher-message { margin-top: 12px; }

input:focus,
select:focus-visible,
button:focus-visible,
a:focus-visible { border-color: var(--teal-dark); outline: 3px solid rgba(47, 167, 157, .2); outline-offset: 1px; }
.form-message { min-height: 20px; margin: 0; color: var(--red); overflow-wrap: anywhere; }

@media (max-width: 900px) {
  .topbar { grid-template-columns: 1fr; }
  .brand-logo { width: 72px; height: 41px; }
  nav { order: 3; justify-content: flex-start; }
  .top-actions { justify-content: space-between; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid,
  .canteen-layout { grid-template-columns: 1fr; }
  .period-form,
  .manual-toolbar,
  .candidate-list,
  .attempt-list { grid-template-columns: 1fr; }
  .notice,
  .export-row { align-items: flex-start; flex-direction: column; }
  .problem-list { grid-template-columns: 1fr; }
  .drill-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .problem-explainer { flex-direction: column; }
  .report-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-grid { grid-template-columns: 1fr; }
  .wallet-reason-body { grid-template-columns: 1fr; }
  .voucher-identity-list li { grid-template-columns: 1fr; gap: 3px; }
  .roster-scroll-hint { display: block; }
  .roster-table-scroll tbody td:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    background: #fff;
    box-shadow: 1px 0 0 var(--line);
  }
  .roster-table-scroll thead th:first-child { left: 0; z-index: 3; }
}

@media (max-width: 560px) {
  .page { padding: 10px 8px 36px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .metrics { grid-template-columns: 1fr; }
  .report-metrics { grid-template-columns: 1fr; }
  .details div { grid-template-columns: 1fr; gap: 3px; }
  .drill-grid { grid-template-columns: 1fr; }
  .top-actions span { display: none; }
  .roster-table-toolbar { align-items: stretch; flex-direction: column; gap: 6px; }
  .roster-table-toolbar > span { padding: 0; }
  .nobd-preview-modal { place-items: end center; padding: 0; }
  .nobd-preview-dialog {
    max-height: 94vh;
    max-height: 94dvh;
    padding-bottom: env(safe-area-inset-bottom);
    border-radius: 16px 16px 0 0;
  }
  .nobd-preview-header { padding: 20px 18px 16px; }
  .nobd-preview-header h3 { font-size: 21px; }
  .nobd-preview-body { padding: 18px; }
  .nobd-key-metrics { grid-template-columns: 1fr; }
  .nobd-modal-actions { flex-direction: column; }
  .nobd-modal-actions button { width: 100%; }
}
