/* Vidyalaya — one stylesheet, no build step (docs/02 §2.10).
   Light and dark from the same custom properties; colour never carries meaning
   on its own (NFR-A11Y-2). */

:root {
  --bg:           #f6f7fb;
  --surface:      #ffffff;
  --surface-2:    #f1f3f8;
  --border:       #dfe3ec;
  --text:         #16181f;
  --text-muted:   #5c6478;
  --primary:      #3730a3;
  --primary-ink:  #ffffff;
  --primary-soft: #eceafb;
  --success:      #15803d;
  --success-soft: #e6f4ea;
  --warn:         #b45309;
  --warn-soft:    #fdf1e0;
  --danger:       #b91c1c;
  --danger-soft:  #fceceb;
  --neutral:      #64748b;
  --neutral-soft: #eef1f6;

  --radius:   12px;
  --radius-sm: 8px;
  --gutter:   16px;
  --shadow:   0 1px 2px rgba(16, 20, 40, .06), 0 4px 14px rgba(16, 20, 40, .05);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:           #0b1020;
    --surface:      #141a2e;
    --surface-2:    #1b2238;
    --border:       #28304a;
    --text:         #e8ebf5;
    --text-muted:   #9aa3bd;
    --primary:      #8b85f0;
    --primary-ink:  #0b1020;
    --primary-soft: #232045;
    --success:      #4ade80;
    --success-soft: #16281f;
    --warn:         #fbbf24;
    --warn-soft:    #2c2413;
    --danger:       #f87171;
    --danger-soft:  #2e1a1a;
    --neutral:      #94a3b8;
    --neutral-soft: #1d2438;
    --shadow:       0 1px 2px rgba(0, 0, 0, .4), 0 6px 20px rgba(0, 0, 0, .3);
  }
}

:root[data-theme="dark"] {
  --bg: #0b1020; --surface: #141a2e; --surface-2: #1b2238; --border: #28304a;
  --text: #e8ebf5; --text-muted: #9aa3bd; --primary: #8b85f0; --primary-ink: #0b1020;
  --primary-soft: #232045; --success: #4ade80; --success-soft: #16281f;
  --warn: #fbbf24; --warn-soft: #2c2413; --danger: #f87171; --danger-soft: #2e1a1a;
  --neutral: #94a3b8; --neutral-soft: #1d2438;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--font);
  font-variant-numeric: tabular-nums;
  overflow-x: hidden;
  padding-bottom: env(safe-area-inset-bottom);
}

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

h1, h2, h3 { line-height: 1.25; margin: 0 0 .4em; }
p { margin: 0 0 .9em; }
a { color: var(--primary); text-decoration-thickness: 1px; text-underline-offset: 2px; }
code { font-family: var(--mono); font-size: .9em; }

:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 4px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--primary); color: var(--primary-ink); padding: 12px 18px;
}
.skip-link:focus { left: 0; }

/* ------------------------------------------------------------------ chrome */

.topbar {
  position: sticky; top: 0; z-index: 30;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding-top: env(safe-area-inset-top);
}
.topbar__inner {
  display: flex; align-items: center; gap: 10px;
  max-width: 1200px; margin: 0 auto; padding: 10px var(--gutter);
}
.topbar__brand { font-weight: 700; color: var(--text); text-decoration: none; margin-right: auto; }
.topbar__tag {
  font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  background: var(--primary-soft); color: var(--primary);
  padding: 2px 6px; border-radius: 6px; vertical-align: middle;
}
.topbar__menu {
  display: none; background: none; border: 0; color: var(--text);
  font-size: 20px; min-width: 44px; min-height: 44px; cursor: pointer;
}
.topbar__actions { display: flex; align-items: center; gap: 6px; }
.topbar__icon {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; min-height: 44px; text-decoration: none; font-size: 18px;
}

.badge {
  position: absolute; top: 4px; right: 2px;
  background: var(--danger); color: #fff;
  font-size: 11px; font-weight: 700; line-height: 1;
  padding: 3px 5px; border-radius: 999px;
}
.badge--dot { width: 8px; height: 8px; padding: 0; }

.avatar { border-radius: 999px; object-fit: cover; display: inline-block; }
.avatar--sm { width: 30px; height: 30px; }
.avatar--lg { width: 64px; height: 64px; font-size: 22px; }
.avatar--initials {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; background: var(--primary-soft); color: var(--primary);
  font-size: 12px; font-weight: 700;
}

.shell { max-width: 780px; margin: 0 auto; padding: var(--gutter) var(--gutter) 88px; }

/* ------------------------------------------------------------------ banners */

.banner, .flash {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px var(--gutter); font-size: 14px;
}
.banner--offline { background: var(--neutral-soft); color: var(--text); }
.banner--queued  { background: var(--warn-soft); color: var(--warn); }
.banner--warn    { background: var(--warn-soft); color: var(--warn); }

.flash--success { background: var(--success-soft); color: var(--success); }
.flash--error   { background: var(--danger-soft);  color: var(--danger); }
.flash--warn    { background: var(--warn-soft);    color: var(--warn); }
.flash--info    { background: var(--primary-soft); color: var(--primary); }

/* -------------------------------------------------------------------- cards */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--gutter);
  margin-bottom: var(--gutter);
}
.card--nested { box-shadow: none; background: var(--surface-2); }
.card--centred { text-align: center; }
.card--hero { text-align: center; background: linear-gradient(180deg, var(--primary-soft), var(--surface)); }
.card--action { border-color: var(--warn); }

.card__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.card__title { font-size: 18px; margin: 0; }
.card__subtitle { font-size: 15px; margin: 18px 0 8px; color: var(--text-muted); }
.card__label { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); margin: 0 0 4px; }

.page__title { font-size: 24px; margin-bottom: 4px; }
.page__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: var(--gutter); }

.muted { color: var(--text-muted); font-size: 14px; }
.remark { color: var(--text-muted); font-size: 14px; font-style: italic; }
.empty { color: var(--text-muted); text-align: center; padding: 12px 0; }
.empty__glyph { font-size: 32px; text-align: center; margin: 8px 0 0; }
.prose { line-height: 1.65; }
.prose :last-child { margin-bottom: 0; }

.metric { font-size: 40px; font-weight: 700; line-height: 1; margin: 6px 0; }
.metric span { font-size: 22px; color: var(--text-muted); }
.metric--money { font-size: 32px; }

.meter { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin: 8px 0; }
.meter__fill { height: 100%; background: var(--primary); }

.callout {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px; border-radius: var(--radius-sm); margin-bottom: var(--gutter);
  background: var(--neutral-soft);
}
.callout--warn   { background: var(--warn-soft);    color: var(--warn); }
.callout--danger { background: var(--danger-soft);  color: var(--danger); }
.callout--info   { background: var(--primary-soft); color: var(--primary); }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: var(--gutter); }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.tile--warn { border-color: var(--warn); }
.tile__label { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin: 0 0 6px; }
.tile__value { font-size: 26px; font-weight: 700; margin: 0; }
.tile__note  { font-size: 13px; color: var(--text-muted); margin: 4px 0 0; }

/* ------------------------------------------------------------------- lists */

.list { list-style: none; margin: 0; padding: 0; }
.list__item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.list__item:last-child { border-bottom: 0; }
.list--compact .list__item { padding: 8px 0; }
.list__item small { display: block; color: var(--text-muted); font-size: 13px; }
.list__value { text-align: right; white-space: nowrap; }
.list__link { display: inline-block; font-size: 13px; margin-left: 8px; }
.list__full { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; color: inherit; text-decoration: none; }
.list__item.is-unread { border-left: 3px solid var(--primary); padding-left: 10px; }
.list__item.is-break { opacity: .55; }
.list--selectable .list__item { align-items: flex-start; }

.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0 0 12px; }
.chip { background: var(--surface-2); border-radius: 999px; padding: 6px 12px; font-size: 14px; }
.chip small { color: var(--text-muted); }

.pill {
  display: inline-block; font-size: 12px; font-weight: 600; line-height: 1.4;
  padding: 3px 9px; border-radius: 999px;
  background: var(--neutral-soft); color: var(--neutral);
}
.pill--success { background: var(--success-soft); color: var(--success); }
.pill--warn    { background: var(--warn-soft);    color: var(--warn); }
.pill--danger  { background: var(--danger-soft);  color: var(--danger); }
.pill--neutral { background: var(--neutral-soft); color: var(--neutral); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin: 0 0 12px; }
.stats div { background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px; }
.stats dt { font-size: 12px; color: var(--text-muted); }
.stats dd { margin: 2px 0 0; font-size: 18px; font-weight: 600; }

.checklist { padding-left: 20px; }
.checklist li { margin-bottom: 10px; }

/* ------------------------------------------------------------------ tables */

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table thead th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table small { display: block; color: var(--text-muted); font-size: 12px; font-weight: 400; }
.table tfoot td, .table tfoot th { border-bottom: 0; }
.table .is-total th, .table .is-total td { font-weight: 700; border-top: 2px solid var(--border); }
.table .is-discount td, .table .is-discount th { color: var(--success); }
.table .is-late-fee td, .table .is-late-fee th { color: var(--warn); }
.table--grid td { min-width: 120px; }
.table--grid .is-break { background: var(--surface-2); }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.code {
  font-family: var(--mono); font-size: 13px; background: var(--surface-2);
  padding: 12px; border-radius: var(--radius-sm); overflow-x: auto; white-space: pre-wrap;
}

/* ------------------------------------------------------------------- forms */

.form { margin: 0; }
.form__row { display: flex; flex-wrap: wrap; gap: 12px; }
.form__row > .field { flex: 1 1 180px; }
.field { margin-bottom: 14px; }
.field--grow { flex: 2 1 260px; }
.field label, .field legend { display: block; font-size: 14px; font-weight: 600; margin-bottom: 5px; }
.field__hint { font-size: 12.5px; color: var(--text-muted); margin: 5px 0 0; }
.field__group { display: flex; gap: 6px; align-items: stretch; }
/* A fixed part of a value the field cannot change, e.g. the domain a school's
   address hangs off. Reads as part of the control, not as a separate input. */
.field__suffix {
  display: inline-flex; align-items: center; white-space: nowrap;
  padding: 0 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text-muted); font-size: 14px;
}
.field__toggle { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0 12px; cursor: pointer; color: var(--text); }
fieldset.field { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; }

input[type="text"], input[type="email"], input[type="password"], input[type="search"],
input[type="tel"], input[type="date"], input[type="datetime-local"], input[type="number"],
input[type="time"], input[type="file"], select, textarea {
  width: 100%; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px; min-height: 44px;
}
textarea { min-height: 80px; resize: vertical; }
.input--tiny { min-height: 34px; padding: 4px 6px; font-size: 12px; margin-top: 4px; }

.check { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 8px; font-size: 14.5px; cursor: pointer; }
.check input { width: 20px; height: 20px; min-height: 0; flex: 0 0 auto; margin-top: 2px; }
.check--inline { display: inline-flex; margin-right: 14px; }
.check--block { flex: 1; }

.form--inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.form--inline input, .form--inline select { width: auto; flex: 1 1 140px; }
.inline { display: inline; }
/* Label on the left, action on the right — the shape most "needs attention"
   entries take. Wraps rather than squashing the button on a narrow screen. */
.row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; padding: 8px 0;
}
.row + .row { border-top: 1px solid var(--border); }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: var(--gutter); }
.filters input, .filters select { width: auto; flex: 1 1 160px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 600; line-height: 1;
  min-height: 44px; padding: 0 18px; border-radius: var(--radius-sm);
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  background: var(--surface-2); color: var(--text);
}
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn--primary { background: var(--primary); color: var(--primary-ink); }
.btn--ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn--block { display: flex; width: 100%; }
.btn--sm { min-height: 36px; padding: 0 12px; font-size: 14px; }
/* Destructive actions must not look like ordinary ones. Outlined rather than
   filled, so the eye does not land on it first the way it does on --primary. */
.btn--danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn--danger:hover { background: var(--danger-soft); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.tabs { display: flex; gap: 4px; overflow-x: auto; margin-bottom: var(--gutter); }
.tabs__item {
  padding: 9px 14px; border-radius: 999px; font-size: 14px; font-weight: 600;
  color: var(--text-muted); text-decoration: none; white-space: nowrap;
}
.tabs__item.is-active { background: var(--primary); color: var(--primary-ink); }

.steps { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0 0 var(--gutter); flex-wrap: wrap; }
.steps__item { font-size: 13px; color: var(--text-muted); padding: 6px 10px; border-radius: 999px; background: var(--surface-2); }
.steps__item.is-current { background: var(--primary); color: var(--primary-ink); }
.steps__item.is-done { background: var(--success-soft); color: var(--success); }

.detail { border-top: 1px solid var(--border); padding: 10px 0; }
.detail summary { cursor: pointer; font-size: 14.5px; }
.detail--inline { border: 0; padding: 0; }

/* --------------------------------------------------------------- switcher */

.switcher {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 12px; margin-bottom: var(--gutter);
}
.switcher__current { display: flex; align-items: center; gap: 10px; }
.switcher__current small { display: block; color: var(--text-muted); font-size: 13px; }
.switcher__label { font-size: 13px; color: var(--text-muted); }
.switcher__select { flex: 1; min-width: 180px; }
.switcher__list { list-style: none; padding: 0; margin: 8px 0 0; }

/* -------------------------------------------------------------- calendar */

.calendar__nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.calendar__head, .calendar__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.calendar__head span { text-align: center; font-size: 12px; color: var(--text-muted); padding-bottom: 4px; }
.calendar__cell {
  aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); background: var(--surface-2); font-size: 13px;
}
.calendar__cell--empty { background: none; }
.calendar__date { font-weight: 600; }
.calendar__glyph { font-size: 11px; line-height: 1; }
.calendar__cell--present  { background: var(--success-soft); color: var(--success); }
.calendar__cell--absent   { background: var(--danger-soft);  color: var(--danger); }
.calendar__cell--late     { background: var(--warn-soft);    color: var(--warn); }
.calendar__cell--excused  { background: var(--primary-soft); color: var(--primary); }
.calendar__cell--holiday  { background: var(--neutral-soft); color: var(--neutral); }
.calendar__cell--not-taken{ background: transparent; border: 1px dashed var(--border); color: var(--text-muted); }

.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 12px; padding: 12px 0 0; margin: 0; font-size: 13px; color: var(--text-muted); }
.legend li { display: flex; align-items: center; gap: 5px; }
.legend__swatch { width: 20px; height: 20px; border-radius: 5px; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; }
.legend__swatch--present  { background: var(--success-soft); color: var(--success); }
.legend__swatch--absent   { background: var(--danger-soft);  color: var(--danger); }
.legend__swatch--late     { background: var(--warn-soft);    color: var(--warn); }
.legend__swatch--excused  { background: var(--primary-soft); color: var(--primary); }
.legend__swatch--holiday  { background: var(--neutral-soft); color: var(--neutral); }
.legend__swatch--not-taken{ border: 1px dashed var(--border); }

/* ---------------------------------------------------------------- roster */

.roster { padding-bottom: 80px; }
.roster__header { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.roster__tools { display: flex; gap: 8px; margin-bottom: 10px; }
.roster__search { flex: 1; }
.roster__counts { font-size: 14px; color: var(--text-muted); margin-bottom: 8px; }
.roster__list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.roster__row { display: flex; align-items: center; gap: 10px; padding: 6px 12px; border-bottom: 1px solid var(--border); }
.roster__row:last-child { border-bottom: 0; }
.roster__row[hidden] { display: none; }
.roster__roll { width: 28px; color: var(--text-muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.roster__name { flex: 1; font-size: 15px; }

.status-pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  min-width: 68px; min-height: 44px; border-radius: 999px;
  border: 1px solid transparent; font: inherit; font-weight: 700; font-size: 14px; cursor: pointer;
  background: var(--success-soft); color: var(--success);
}
.status-pill--absent  { background: var(--danger-soft);  color: var(--danger); }
.status-pill--late    { background: var(--warn-soft);    color: var(--warn); }
.status-pill--excused { background: var(--primary-soft); color: var(--primary); }
.status-pill--half-day{ background: var(--neutral-soft); color: var(--neutral); }
.status-pill.is-readonly { cursor: default; }

.roster__submit {
  position: sticky; bottom: calc(68px + env(safe-area-inset-bottom)); z-index: 20;
  padding: 10px 0; background: linear-gradient(180deg, transparent, var(--bg) 40%);
}

.score-input { max-width: 90px; display: inline-block; text-align: right; }

/* --------------------------------------------------------------- messaging */

.thread { display: flex; flex-direction: column; min-height: 60vh; }
.thread__header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.thread__messages { flex: 1; display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.bubble { max-width: 82%; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; }
.bubble--mine { align-self: flex-end; background: var(--primary-soft); border-color: transparent; }
.bubble--held { opacity: .7; border-style: dashed; }
.bubble__sender { font-size: 12.5px; font-weight: 700; color: var(--text-muted); margin: 0 0 3px; }
.bubble__body { margin: 0; }
.bubble__meta { font-size: 11.5px; color: var(--text-muted); margin: 5px 0 0; }

.composer { position: sticky; bottom: calc(68px + env(safe-area-inset-bottom)); background: var(--bg); padding-top: 8px; }
.composer__notice { font-size: 13px; color: var(--warn); background: var(--warn-soft); padding: 8px 10px; border-radius: var(--radius-sm); margin: 0 0 8px; }
.composer__row { display: flex; gap: 8px; align-items: flex-end; }
.composer__row textarea { flex: 1; }
.composer__attach { font-size: 13px; color: var(--text-muted); display: block; margin-top: 6px; }
.composer__attach input { width: auto; min-height: 0; }

.paybar { position: sticky; bottom: calc(68px + env(safe-area-inset-bottom)); background: var(--surface); padding-top: 10px; }
.paybar__note { font-size: 12.5px; color: var(--text-muted); text-align: center; margin: 8px 0 0; }

.status__glyph { font-size: 44px; margin: 10px 0; }
.status__glyph--ok { color: var(--success); }
.status__glyph--fail { color: var(--danger); }
.status__glyph--pending { color: var(--warn); }

/* ----------------------------------------------------------------- tabbar */

.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  display: flex; background: var(--surface); border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar__item {
  position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 4px; min-height: 56px; text-decoration: none;
  color: var(--text-muted); font-size: 11px;
}
.tabbar__item.is-active { color: var(--primary); }
.tabbar__glyph { font-size: 18px; line-height: 1; }
.tabbar__item .badge { top: 6px; right: 50%; margin-right: -18px; }

/* ------------------------------------------------------------------ admin */

.admin__layout { display: flex; max-width: 1400px; margin: 0 auto; }
.sidenav {
  width: 230px; flex: 0 0 230px; padding: var(--gutter);
  border-right: 1px solid var(--border); background: var(--surface);
  min-height: calc(100vh - 56px);
}
.sidenav__heading { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); margin: 16px 0 6px; }
.sidenav__list { list-style: none; margin: 0 0 8px; padding: 0; }
.sidenav__link { display: block; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--text); text-decoration: none; font-size: 14.5px; }
.sidenav__link:hover { background: var(--surface-2); }
.sidenav__link.is-active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.admin__main { flex: 1; padding: var(--gutter); min-width: 0; }
.admin .tabbar { display: none; }
.admin body, body.admin { padding-bottom: 0; }

/* ------------------------------------------------------------------- auth */

.bare { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: var(--gutter); }
.bare__panel { width: 100%; max-width: 420px; }
.auth { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px 22px; }
.auth--wide { max-width: none; }
.auth__crest { font-size: 40px; text-align: center; }
.auth__title { text-align: center; font-size: 22px; margin-bottom: 4px; }
.auth__subtitle { text-align: center; color: var(--text-muted); font-size: 14.5px; margin-bottom: 20px; }
.auth__links { text-align: center; font-size: 14px; margin: 14px 0 0; }
.auth__install { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); text-align: center; font-size: 14px; }

.error-page { text-align: center; padding: 40px 0; }
.error-page__code { font-size: 54px; font-weight: 800; color: var(--text-muted); margin: 0; }
.error-page__title { font-size: 20px; }
.error-page__message { color: var(--text-muted); }
.error-page__reference { font-size: 12.5px; color: var(--text-muted); }

/* -------------------------------------------------------------- responsive */

@media (max-width: 900px) {
  .topbar__menu { display: inline-flex; }
  .sidenav {
    position: fixed; inset: 56px auto 0 0; z-index: 25;
    transform: translateX(-100%); transition: transform .2s ease;
    overflow-y: auto;
  }
  .sidenav.is-open { transform: translateX(0); }
  .admin__main { padding: var(--gutter) var(--gutter) 40px; }
}

@media (min-width: 901px) {
  .tabbar { display: none; }
  body { padding-bottom: 0; }
  .shell { padding-bottom: var(--gutter); }
  .roster__submit, .composer, .paybar { bottom: 0; }
}

@media print {
  .topbar, .tabbar, .sidenav, .banner, .flash, .actions, .btn { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: 0; }
}
