/* ==========================================================================
   Vidya — tuition centre demo
   Palette: warm paper, muted violet, apricot and sky. Green is deliberately
   rare so it never becomes the default "good" colour.
   ========================================================================== */

:root {
  --paper: #faf7f1;
  --paper-2: #f3eee4;
  --paper-3: #ece5d7;
  --surface: #ffffff;
  --surface-warm: #fffdf8;

  --ink: #2a2724;
  --ink-soft: #5f5a52;
  --ink-faint: #756c60;

  --line: #e8e1d4;
  --line-strong: #d6ccb9;

  --brand: #675a9e;
  --brand-deep: #4d4279;
  --brand-tint: #efebf8;
  --brand-tint-2: #ded5f1;

  --apricot: #d98a55;
  --apricot-tint: #fbeadf;
  --apricot-deep: #a65c2e;

  --sky: #5f879e;
  --sky-tint: #e8f1f5;
  --sky-deep: #3d6479;

  --rose: #bd6f6d;
  --rose-tint: #f9eae8;
  --rose-deep: #8f4644;

  --gold: #a97c37;
  --gold-tint: #f8efdb;
  --gold-deep: #7d5a22;

  --sage: #5d7d66;
  --sage-tint: #edf2ec;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(50, 43, 33, .06);
  --shadow: 0 2px 4px rgba(50, 43, 33, .04), 0 12px 28px -18px rgba(50, 43, 33, .28);
  --shadow-lg: 0 24px 60px -24px rgba(50, 43, 33, .35);

  --font-display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --sidebar-w: 252px;
  --topbar-h: 64px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p, ul, ol, dl, figure { margin: 0; }
ul, ol { padding: 0; }
a { color: var(--brand-deep); text-underline-offset: 3px; }
a:hover { color: var(--brand); }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
svg { display: block; width: 16px; height: 16px; flex: none; }

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

::selection { background: var(--brand-tint-2); color: var(--brand-deep); }

.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: 12px; top: -60px; z-index: 200;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--radius-sm);
  text-decoration: none; transition: top .15s ease;
}
.skip-link:focus { top: 12px; color: #fff; }

/* ------------------------------------------------------------- typography */
.display { font-family: var(--font-display); font-weight: 500; letter-spacing: -.01em; }
h1, .h1 { font-family: var(--font-display); font-weight: 500; font-size: 1.9rem; line-height: 1.18; letter-spacing: -.012em; }
h2, .h2 { font-family: var(--font-display); font-weight: 500; font-size: 1.32rem; line-height: 1.25; }
h3, .h3 { font-size: 1rem; font-weight: 650; letter-spacing: -.005em; }
h4, .h4 { font-size: .82rem; font-weight: 650; }
.eyebrow {
  font-family: var(--font-mono); font-size: .68rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-faint);
}
.muted { color: var(--ink-soft); }
.faint { color: var(--ink-faint); }
.small { font-size: .82rem; }
.xsmall { font-size: .74rem; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); }
.strong { font-weight: 650; }
.center { text-align: center; }
.right { text-align: right; }

/* ------------------------------------------------------------------ layout */
.app-shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100vh; z-index: 40;
  display: flex; flex-direction: column;
  background: #fdfbf7;
  border-right: 1px solid var(--line);
}
.sidebar-top {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 20px 16px;
}
.sidebar-top .sidebar-close { display: none; margin-left: auto; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand img { width: 34px; height: 34px; }
.brand-text { display: grid; line-height: 1.1; }
.brand-name { font-family: var(--font-display); font-size: 1.22rem; letter-spacing: -.01em; }
.brand-sub { font-size: .64rem; letter-spacing: .13em; text-transform: uppercase; color: var(--ink-faint); margin-top: 3px; }

.sidebar-context {
  margin: 0 14px 12px; padding: 10px 12px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  display: grid; gap: 2px;
}
.sidebar-context .ctx-label { font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); }
.sidebar-context .ctx-name { font-size: .82rem; font-weight: 600; }

.nav { flex: 1; overflow-y: auto; padding: 4px 12px 16px; }
.nav-group { margin-top: 14px; }
.nav-group:first-child { margin-top: 2px; }
.nav-title {
  padding: 6px 10px; font-family: var(--font-mono); font-size: .62rem;
  letter-spacing: .13em; text-transform: uppercase; color: var(--ink-faint);
}
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; margin: 1px 0;
  border-radius: 9px; color: var(--ink-soft); text-decoration: none;
  font-size: .875rem; font-weight: 500;
  transition: background .14s ease, color .14s ease;
}
.nav a svg { width: 15px; height: 15px; flex: none; opacity: .78; }
.nav a:hover { background: var(--paper-2); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--brand-tint); color: var(--brand-deep); font-weight: 650; }
.nav a[aria-current="page"] svg { opacity: 1; }
.nav-badge {
  margin-left: auto; min-width: 20px; padding: 1px 6px; border-radius: var(--radius-pill);
  background: var(--apricot-tint); color: var(--apricot-deep);
  font-size: .68rem; font-weight: 700; text-align: center;
}
.sidebar-foot { padding: 12px 16px 18px; border-top: 1px solid var(--line); }
.demo-pill {
  display: flex; gap: 8px; align-items: flex-start; padding: 10px 11px;
  background: var(--apricot-tint); border-radius: var(--radius);
  font-size: .73rem; line-height: 1.4; color: var(--apricot-deep);
}
.demo-pill strong { display: block; font-size: .74rem; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: var(--topbar-h); flex: none;
  display: flex; align-items: center; gap: 14px;
  padding: 0 28px;
  background: rgba(250, 247, 241, .88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30;
}
.topbar-title { min-width: 0; }
.topbar-title .eyebrow { font-size: .6rem; }
.topbar-title .crumb { font-size: .9rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-spacer { flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 6px; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid transparent; background: transparent; color: var(--ink-soft);
  cursor: pointer; position: relative;
}
.icon-btn:hover { background: var(--paper-2); color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .dot {
  position: absolute; top: 7px; right: 8px; width: 7px; height: 7px;
  border-radius: 50%; background: var(--rose); border: 1.5px solid var(--paper);
}
.hamburger { display: none; }

.user-menu { position: relative; }
.user-btn {
  display: flex; align-items: center; gap: 9px;
  border: 1px solid var(--line); background: var(--surface);
  padding: 5px 10px 5px 6px; border-radius: var(--radius-pill); cursor: pointer;
}
.user-btn:hover { border-color: var(--line-strong); }
.user-btn .who { display: grid; text-align: left; line-height: 1.15; }
.user-btn .who b { font-size: .78rem; font-weight: 650; }
.user-btn .who span { font-size: .66rem; color: var(--ink-faint); text-transform: capitalize; }
.menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 80;
  min-width: 210px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.menu-head { padding: 9px 10px; border-bottom: 1px solid var(--line); margin-bottom: 5px; }
.menu-head b { display: block; font-size: .84rem; }
.menu-head span { font-size: .74rem; color: var(--ink-faint); }
.menu svg { width: 15px; height: 15px; opacity: .8; }
.menu button, .menu a {
  display: flex; width: 100%; align-items: center; gap: 9px;
  padding: 8px 10px; border: 0; background: transparent; border-radius: 7px;
  font-size: .84rem; text-align: left; text-decoration: none; color: var(--ink); cursor: pointer;
}
.menu button:hover, .menu a:hover { background: var(--paper-2); }
.menu .danger { color: var(--rose-deep); }

.content { padding: 30px 28px 64px; width: 100%; max-width: 1440px; }
.page { max-width: 1240px; animation: fade-up .22s ease both; }

@keyframes fade-up {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .page { animation: none; }
  * { transition-duration: .001ms !important; }
}

.page-head { display: flex; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head .ph-text { flex: 1; min-width: 260px; }
.page-head h1 { margin-top: 4px; }
.page-head .lede { margin-top: 7px; color: var(--ink-soft); font-size: .92rem; max-width: 66ch; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.stack { display: grid; gap: 18px; }
.stack-sm { display: grid; gap: 10px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.grid { display: grid; gap: 18px; }
.grid > *, .grid-2 > *, .grid-3 > *, .grid-4 > *, .grid-sidebar > * { min-width: 0; }
.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)); }
.grid-sidebar { grid-template-columns: minmax(0, 1.65fr) minmax(300px, .9fr); align-items: start; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 6px; }
.mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 18px; }
.mt-4 { margin-top: 28px; }
.mb-2 { margin-bottom: 12px; }

/* ------------------------------------------------------------------ cards */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-head {
  display: flex; align-items: flex-start; gap: 12px; justify-content: space-between;
  padding: 18px 20px 0;
}
.card-head h2, .card-head h3 { margin-top: 2px; }
.card-body { padding: 18px 20px; }
.card-body.tight { padding: 14px 16px; }
.card-foot {
  padding: 13px 20px; border-top: 1px solid var(--line);
  display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  background: linear-gradient(0deg, rgba(250, 247, 241, .4), transparent);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.card-link { font-size: .8rem; font-weight: 600; text-decoration: none; white-space: nowrap; display: inline-flex; align-items: center; gap: 3px; }
.card-link svg { width: 13px; height: 13px; opacity: .65; }

.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.panel:has(input[type="radio"]:checked) { background: var(--brand-tint); border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }

/* ------------------------------------------------------------------- KPIs */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 16px 18px; position: relative; overflow: hidden;
}
.kpi .kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi .kpi-label { font-size: .76rem; color: var(--ink-soft); font-weight: 550; }
.kpi .kpi-value { font-family: var(--font-display); font-size: 1.85rem; line-height: 1.1; margin-top: 6px; letter-spacing: -.015em; }
.kpi .kpi-meta { font-size: .74rem; color: var(--ink-faint); margin-top: 5px; display: flex; align-items: center; gap: 6px; }
.kpi .kpi-icon {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: var(--brand-tint); color: var(--brand-deep); flex: none;
}
.kpi .kpi-icon svg { width: 16px; height: 16px; }
.kpi.kpi--warn .kpi-icon { background: var(--gold-tint); color: var(--gold-deep); }
.kpi.kpi--alert .kpi-icon { background: var(--rose-tint); color: var(--rose-deep); }
.kpi.kpi--calm .kpi-icon { background: var(--sky-tint); color: var(--sky-deep); }
.kpi.kpi--warm .kpi-icon { background: var(--apricot-tint); color: var(--apricot-deep); }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 38px; padding: 8px 15px;
  border-radius: 9px; border: 1px solid transparent;
  background: var(--brand); color: #fff;
  font-size: .85rem; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: background .14s ease, border-color .14s ease, transform .06s ease;
  white-space: nowrap;
}
.btn:hover { background: var(--brand-deep); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 15px; height: 15px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn--ghost { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.btn--ghost:hover { background: var(--paper-2); border-color: var(--ink-faint); color: var(--ink); }
.btn--soft { background: var(--brand-tint); color: var(--brand-deep); }
.btn--soft:hover { background: var(--brand-tint-2); color: var(--brand-deep); }
.btn--warm { background: var(--apricot); color: #fff; }
.btn--warm:hover { background: var(--apricot-deep); }
.btn--danger { background: var(--rose); color: #fff; }
.btn--danger:hover { background: var(--rose-deep); }
.btn--quiet { background: transparent; color: var(--ink-soft); }
.btn--quiet:hover { background: var(--paper-2); color: var(--ink); }
.btn--sm { min-height: 31px; padding: 5px 10px; font-size: .78rem; }
.btn--lg { min-height: 46px; padding: 11px 20px; font-size: .92rem; }
.btn--block { width: 100%; }

/* ------------------------------------------------------------------ forms */
.field { display: grid; gap: 6px; }
.field > label, .field-label { font-size: .78rem; font-weight: 620; color: var(--ink-soft); }
.field .hint { font-size: .72rem; color: var(--ink-faint); }
.field .error-text { font-size: .74rem; color: var(--rose-deep); font-weight: 550; }
.req { color: var(--rose); margin-left: 2px; }

.input, .select, .textarea {
  width: 100%; min-height: 40px; padding: 8px 11px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 9px;
  font-size: .87rem; color: var(--ink);
  transition: border-color .12s ease, box-shadow .12s ease;
}
.input::placeholder, .textarea::placeholder { color: #a9a196; }
.input:hover, .select:hover, .textarea:hover { border-color: #bdb2a0; }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-tint);
}
.textarea { min-height: 92px; resize: vertical; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%235f5a52' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
  padding-right: 32px;
}
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] {
  border-color: var(--rose); background: #fffafa;
}
.input[disabled], .select[disabled], .textarea[disabled] { background: var(--paper); color: var(--ink-faint); cursor: not-allowed; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field-grid .span-2 { grid-column: 1 / -1; }
.form-error {
  background: var(--rose-tint); border: 1px solid #ecc9c6; color: var(--rose-deep);
  padding: 10px 12px; border-radius: 9px; font-size: .82rem;
}
.check { display: flex; gap: 9px; align-items: flex-start; font-size: .84rem; }
.check input { width: 17px; height: 17px; margin: 1px 0 0; accent-color: var(--brand); }
.inline-search { position: relative; }
.inline-search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--ink-faint); }
.inline-search .input { padding-left: 34px; }

/* ------------------------------------------------------------- ind. chunks */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: var(--radius-pill);
  font-size: .71rem; font-weight: 650; letter-spacing: .01em;
  background: var(--paper-2); color: var(--ink-soft); white-space: nowrap;
}
.chip::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .85; }
.chip--plain::before { display: none; }
.chip--brand { background: var(--brand-tint); color: var(--brand-deep); }
.chip--sky { background: var(--sky-tint); color: var(--sky-deep); }
.chip--gold { background: var(--gold-tint); color: var(--gold-deep); }
.chip--rose { background: var(--rose-tint); color: var(--rose-deep); }
.chip--apricot { background: var(--apricot-tint); color: var(--apricot-deep); }
.chip--sage { background: var(--sage-tint); color: var(--sage-deep, #46604c); }

.avatar {
  width: 38px; height: 38px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--brand-tint); color: var(--brand-deep);
  font-size: .78rem; font-weight: 700; letter-spacing: .02em;
}
.avatar--lg { width: 54px; height: 54px; font-size: 1rem; }
.avatar--sm { width: 29px; height: 29px; font-size: .66rem; }
.avatar--warm { background: var(--apricot-tint); color: var(--apricot-deep); }
.avatar--sky { background: var(--sky-tint); color: var(--sky-deep); }
.avatar--rose { background: var(--rose-tint); color: var(--rose-deep); }

.progress { height: 6px; background: var(--paper-2); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--brand); border-radius: inherit; }
.progress--warm > span { background: var(--apricot); }
.progress--full > span { background: var(--rose); }

.banner {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 12px 14px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface);
  font-size: .82rem; color: var(--ink-soft);
}
.banner svg { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.banner strong { color: var(--ink); }
.banner--info { background: var(--sky-tint); border-color: #cfe0e8; color: var(--sky-deep); }
.banner--info strong { color: var(--sky-deep); }
.banner--warn { background: var(--gold-tint); border-color: #ead9b6; color: var(--gold-deep); }
.banner--warn strong { color: var(--gold-deep); }
.banner--danger { background: var(--rose-tint); border-color: #ecc9c6; color: var(--rose-deep); }
.banner--danger strong { color: var(--rose-deep); }
.banner--warm { background: var(--apricot-tint); border-color: #f0d5bd; color: var(--apricot-deep); }
.banner--warm strong { color: var(--apricot-deep); }
.banner .banner-actions { margin-left: auto; display: flex; gap: 6px; flex: none; }

.empty-state {
  text-align: center; padding: 40px 20px; color: var(--ink-soft);
}
.empty-state .empty-icon {
  width: 46px; height: 46px; margin: 0 auto 12px; border-radius: 14px;
  display: grid; place-items: center; background: var(--paper-2); color: var(--ink-faint);
}
.empty-state h3 { color: var(--ink); margin-bottom: 5px; }
.empty-state p { font-size: .84rem; max-width: 42ch; margin: 0 auto; }

/* ----------------------------------------------------------------- tables */
.table-wrap { width: 100%; overflow-x: auto; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
table.table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.table th {
  text-align: left; padding: 10px 14px;
  font-family: var(--font-mono); font-size: .62rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-faint); background: var(--surface-warm); border-bottom: 1px solid var(--line);
  white-space: nowrap; font-weight: 500;
}
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fdfbf8; }
.table .num, .table .right { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table th.num { text-align: right; }
.table .name-cell { display: flex; align-items: center; gap: 10px; min-width: 175px; }
.table .name-cell .nm { font-weight: 620; color: var(--ink); }
.table .name-cell .sub { font-size: .72rem; color: var(--ink-faint); }
.table tr.row-total td { background: var(--paper); font-weight: 700; border-top: 1px solid var(--line-strong); }
.table--compact td { padding: 8px 12px; }
.table--plain th { background: transparent; }
.table a { text-decoration: none; font-weight: 600; }
.link-quiet { color: var(--ink); }
.link-quiet:hover { color: var(--brand-deep); }

.table-toolbar {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.table-toolbar .grow { flex: 1; min-width: 180px; }

/* ------------------------------------------------------------------- tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tab {
  padding: 9px 13px; border: 0; background: transparent; cursor: pointer;
  font-size: .84rem; font-weight: 600; color: var(--ink-soft);
  border-bottom: 2px solid transparent; margin-bottom: -1px; border-radius: 7px 7px 0 0;
}
.tab:hover { color: var(--ink); background: var(--paper-2); }
.tab[aria-selected="true"] { color: var(--brand-deep); border-bottom-color: var(--brand); }
.count-pill {
  display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 999px;
  background: var(--paper-2); color: var(--ink-faint); font-size: .68rem;
}

.segmented { display: inline-flex; background: var(--paper-2); border-radius: 9px; padding: 3px; gap: 2px; }
.segmented label {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  padding: 5px 11px; border-radius: 7px; cursor: pointer;
  font-size: .76rem; font-weight: 600; color: var(--ink-soft); white-space: nowrap;
}
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label + label { box-shadow: inset 1px 0 0 rgba(50, 43, 33, .07); }
.segmented label:hover { color: var(--ink); }
.segmented label:has(input:checked) { background: var(--surface); box-shadow: var(--shadow-sm); color: var(--ink); }
.field .segmented { justify-self: start; }
.segmented input:focus-visible + span { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 5px; }
.segmented--status label:has(input[value="present"]:checked) { background: var(--sky); color: #fff; }
.segmented--status label:has(input[value="absent"]:checked) { background: var(--rose); color: #fff; }
.segmented--status label:has(input[value="leave"]:checked) { background: var(--gold); color: #fff; }

/* -------------------------------------------------------------- notice UI */
.notice-card {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  padding: 15px 16px; display: grid; gap: 6px;
}
.notice-card.unread { border-left: 3px solid var(--brand); }
.notice-card .nc-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.notice-card h3 { font-size: .92rem; }
.notice-card p { font-size: .84rem; color: var(--ink-soft); }
.notice-card .nc-meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: .72rem; color: var(--ink-faint); }

/* ------------------------------------------------------------- list rows */
.list { display: grid; gap: 0; }
.list-row {
  display: flex; gap: 12px; align-items: center;
  padding: 12px 20px; border-bottom: 1px solid var(--line);
}
.list-row:last-child { border-bottom: 0; }
.list-row .lr-main { flex: 1; min-width: 0; }
.list-row .lr-title { font-size: .87rem; font-weight: 600; }
.list-row .lr-sub { font-size: .75rem; color: var(--ink-faint); margin-top: 1px; }
.list-row .lr-side { text-align: right; flex: none; }
.list-row > svg { width: 14px; height: 14px; color: var(--ink-faint); }

/* -------------------------------------------------------------- timeline */
.timeline { display: grid; gap: 0; }
.tl-item { display: grid; grid-template-columns: 18px 1fr; gap: 12px; padding-bottom: 18px; position: relative; }
.tl-item:not(:last-child)::before {
  content: ""; position: absolute; left: 4px; top: 15px; bottom: 0; width: 1px; background: var(--line-strong);
}
.tl-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--brand); margin-top: 5px; box-shadow: 0 0 0 4px var(--brand-tint); }
.tl-dot--warm { background: var(--apricot); box-shadow: 0 0 0 4px var(--apricot-tint); }
.tl-dot--rose { background: var(--rose); box-shadow: 0 0 0 4px var(--rose-tint); }
.tl-title { font-size: .86rem; font-weight: 620; }
.tl-sub { font-size: .76rem; color: var(--ink-faint); margin-top: 2px; }
.tl-body { font-size: .82rem; color: var(--ink-soft); margin-top: 3px; }

/* ---------------------------------------------------------------- dialogs */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 120;
  background: rgba(42, 39, 36, .38);
  backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 20px;
  animation: fade-in .16s ease both;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: min(560px, 100%); max-height: min(88vh, 860px); overflow: auto;
  background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); border: 1px solid var(--line);
  animation: pop .18s ease both;
}
.modal--wide { width: min(860px, 100%); }
.modal--narrow { width: min(420px, 100%); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: none; } }
.modal-head {
  display: flex; align-items: flex-start; gap: 12px; padding: 20px 22px 0;
}
.modal-head .modal-title { flex: 1; }
.modal-head h2 { font-size: 1.2rem; }
.modal-head p { font-size: .8rem; color: var(--ink-faint); margin-top: 3px; }
.modal-body { padding: 18px 22px; }
.modal-foot {
  display: flex; gap: 8px; justify-content: flex-end; align-items: center; flex-wrap: wrap;
  padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface-warm);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.modal-foot .grow { flex: 1; }

.toast-region {
  position: fixed; right: 20px; bottom: 20px; z-index: 200;
  display: grid; gap: 8px; width: min(360px, calc(100vw - 40px));
}
.toast {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--ink); color: #fdfaf3; padding: 12px 14px; border-radius: var(--radius);
  box-shadow: var(--shadow-lg); font-size: .83rem; animation: toast-in .2s ease both;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; } }
.toast--ok { background: #2f4f45; }
.toast--warn { background: #6b4a1f; }
.toast--error { background: #6d3330; }
.toast svg { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.toast strong { display: block; margin-bottom: 1px; }

/* -------------------------------------------------------------- login page */
.login { min-height: 100vh; display: grid; grid-template-columns: 46% 54%; }
.login-visual {
  position: relative; overflow: hidden; padding: 40px 44px;
  background:
    radial-gradient(900px 500px at 85% 8%, rgba(255, 255, 255, .6), transparent 60%),
    linear-gradient(158deg, #ece5f7 0%, #f6e9de 52%, #e7f0f3 100%);
  display: flex; flex-direction: column; justify-content: space-between; gap: 28px;
}
.login-visual::before, .login-visual::after {
  content: ""; position: absolute; border-radius: 50%; pointer-events: none;
}
.login-visual::before {
  width: 420px; height: 420px; right: -140px; top: -120px;
  border: 1px solid rgba(103, 90, 158, .22);
  box-shadow: inset 0 0 0 42px rgba(255, 255, 255, .18), inset 0 0 0 84px rgba(255, 255, 255, .14);
}
.login-visual::after {
  width: 300px; height: 300px; left: -140px; bottom: -120px;
  background: rgba(255, 255, 255, .28);
  border: 1px solid rgba(103, 90, 158, .14);
}
.login-visual > * { position: relative; z-index: 1; }
.login-brand { display: flex; align-items: center; gap: 11px; }
.login-brand img { width: 40px; height: 40px; }
.login-brand .lb-name { font-family: var(--font-display); font-size: 1.35rem; }
.login-brand .lb-sub { font-size: .64rem; letter-spacing: .15em; text-transform: uppercase; color: var(--ink-soft); }
.login-pitch h1 { font-size: clamp(2rem, 3.4vw, 2.8rem); line-height: 1.08; max-width: 15ch; margin-top: 10px; }
.login-pitch h1 em { font-style: italic; color: var(--brand-deep); }
.login-pitch p { margin-top: 14px; max-width: 42ch; color: var(--ink-soft); font-size: .94rem; }
.login-card {
  background: rgba(255, 253, 248, .8); border: 1px solid rgba(255, 255, 255, .8);
  border-radius: var(--radius-lg); padding: 16px; box-shadow: 0 20px 40px -30px rgba(60, 45, 70, .5);
  backdrop-filter: blur(4px); max-width: 420px;
}
.login-card .lc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.login-card .lc-head .eyebrow { color: var(--apricot-deep); }
.lc-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px dashed rgba(103, 90, 158, .22); }
.lc-row:first-of-type { border-top: 0; }
.lc-row .lc-time { font-family: var(--font-mono); font-size: .7rem; color: var(--ink-soft); width: 64px; flex: none; }
.lc-row .lc-what { flex: 1; font-size: .8rem; font-weight: 550; }
.lc-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); flex: none; }
.lc-dot--warm { background: var(--apricot); }
.lc-dot--sky { background: var(--sky); }
.login-foot { font-size: .72rem; color: var(--ink-soft); max-width: 46ch; line-height: 1.5; }

.login-panel {
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  padding: 44px 28px; background: var(--paper);
}
.login-mobile-brand { display: none; }
.login-box { width: min(392px, 100%); }
.login-box h2 { font-size: 1.7rem; margin-top: 2px; }
.login-box .sub { color: var(--ink-soft); font-size: .88rem; margin-top: 6px; }
.login-form { margin-top: 22px; display: grid; gap: 14px; }
.login-form .field > label { color: var(--ink); }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 44px; }
.pw-toggle {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  border: 0; background: transparent; padding: 8px; cursor: pointer; color: var(--ink-faint); border-radius: 7px;
}
.pw-toggle:hover { color: var(--ink); background: var(--paper-2); }
.pw-toggle svg { width: 16px; height: 16px; }

.demo-accounts { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 18px; }
.demo-accounts .da-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.demo-accounts .da-head .eyebrow { letter-spacing: .12em; }
.demo-account-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.demo-account {
  display: flex; align-items: center; gap: 8px; text-align: left;
  padding: 8px 9px; border: 1px solid var(--line); background: var(--surface);
  border-radius: 9px; cursor: pointer; min-width: 0;
}
.demo-account:hover { border-color: var(--brand); background: var(--brand-tint); }
.demo-account .da-role { display: grid; line-height: 1.2; min-width: 0; }
.demo-account .da-role b { font-size: .76rem; font-weight: 650; }
.demo-account .da-role span { font-size: .64rem; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.login-links { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 16px; font-size: .76rem; flex-wrap: wrap; }
.login-note { margin-top: 22px; display: flex; gap: 8px; align-items: flex-start; font-size: .72rem; color: var(--ink-faint); line-height: 1.5; }
.login-note svg { width: 15px; height: 15px; flex: none; margin-top: 1px; }
.cred-note { font-family: var(--font-mono); font-size: .74rem; background: var(--paper-2); padding: 2px 6px; border-radius: 5px; color: var(--ink-soft); }

/* -------------------------------------------------------------- dashboard */
.hero {
  background: linear-gradient(120deg, #f2ecf9 0%, #fbf0e6 58%, #edf4f6 100%);
  border: 1px solid #e6dccd; border-radius: var(--radius-lg);
  padding: 22px 24px; position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; right: -60px; top: -80px; width: 240px; height: 240px;
  border-radius: 50%; border: 1px solid rgba(103, 90, 158, .18);
}
.hero .hero-top { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.hero h2 { font-size: 1.55rem; margin-top: 3px; }
.hero p { color: var(--ink-soft); font-size: .88rem; margin-top: 5px; max-width: 62ch; }
.hero-stats { display: flex; gap: 26px; margin-top: 16px; flex-wrap: wrap; }
.hero-stat .hs-label { font-size: .7rem; color: var(--ink-soft); }
.hero-stat .hs-value { font-family: var(--font-display); font-size: 1.35rem; }

.child-switch { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.child-pill {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--line-strong); background: var(--surface);
  border-radius: var(--radius-pill); padding: 4px 11px 4px 5px;
  font-size: .78rem; font-weight: 600; cursor: pointer; color: var(--ink-soft);
}
.child-pill img, .child-pill .avatar { width: 24px; height: 24px; }
.child-pill[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.child-pill[aria-pressed="true"] .avatar { background: rgba(255, 255, 255, .2); color: #fff; }

/* --------------------------------------------------------------- schedule */
.schedule-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 9px; }
.schedule-item {
  display: flex; gap: 12px; align-items: center; min-width: 0;
  padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface);
}
.schedule-item.is-cancelled { background: var(--rose-tint); border-color: #ecc9c6; }
.schedule-item.is-cancelled .si-title, .schedule-item.is-cancelled .si-time { text-decoration: line-through; color: var(--rose-deep); }
.si-date {
  flex: none; width: 46px; text-align: center; padding: 5px 0;
  background: var(--paper-2); border-radius: 8px;
}
.si-date .d { font-family: var(--font-display); font-size: 1.15rem; line-height: 1; }
.si-date .m { font-size: .6rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-faint); margin-top: 2px; }
.si-main { flex: 1; min-width: 0; }
.si-title { font-size: .86rem; font-weight: 620; }
.si-time { font-size: .75rem; color: var(--ink-faint); margin-top: 1px; }
.si-badge { flex: none; }

/* --------------------------------------------------------------- timetable */
.week-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.week-label { font-family: var(--font-display); font-size: 1.05rem; min-width: 190px; }

.tt-scroll { overflow-x: auto; }
.tt { min-width: 760px; }
.tt-head { display: grid; grid-template-columns: 62px repeat(6, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.tt-day {
  padding: 9px 6px; text-align: center; border-left: 1px solid var(--line);
  font-size: .74rem; font-weight: 650; color: var(--ink-soft);
}
.tt-day .dnum { display: block; font-family: var(--font-display); font-size: 1.05rem; color: var(--ink); }
.tt-day.is-today { background: var(--brand-tint); color: var(--brand-deep); border-radius: 8px 8px 0 0; }
.tt-day.is-holiday { background: var(--rose-tint); }
.tt-body { display: grid; grid-template-columns: 62px repeat(6, minmax(0, 1fr)); position: relative; }
.tt-times { position: relative; border-right: 1px solid var(--line); }
.tt-time { height: 38px; position: relative; }
.tt-time span {
  position: absolute; top: -7px; right: 6px;
  font-family: var(--font-mono); font-size: .62rem; color: var(--ink-faint);
  background: var(--paper); padding: 0 2px;
}
.tt-col { position: relative; border-left: 1px solid var(--line); min-height: 532px; }
.tt-col.is-today { background: rgba(239, 235, 248, .34); }
.tt-col.is-holiday { background: repeating-linear-gradient(135deg, var(--rose-tint), var(--rose-tint) 7px, #fff 7px, #fff 14px); }
.tt-hour { height: 38px; border-bottom: 1px dashed var(--line); }
.tt-hour:last-child { border-bottom: 0; }
.tt-event {
  position: absolute; left: 4px; right: 4px;
  border-radius: 8px; padding: 5px 7px; overflow: hidden;
  background: var(--brand-tint); border: 1px solid #d8cdef; border-left: 3px solid var(--brand);
  font-size: .68rem; line-height: 1.25; color: var(--brand-deep);
  cursor: pointer; text-align: left; width: calc(100% - 8px);
}
.tt-event:hover { filter: brightness(.985); box-shadow: var(--shadow-sm); }
.tt-event b { display: block; font-size: .68rem; font-weight: 700; }
.tt-event span { display: block; color: #6a5f9b; }
.tt-event--warm { background: var(--apricot-tint); border-color: #eccfb4; border-left-color: var(--apricot); color: var(--apricot-deep); }
.tt-event--warm span { color: #9a6238; }
.tt-event--sky { background: var(--sky-tint); border-color: #cadde6; border-left-color: var(--sky); color: var(--sky-deep); }
.tt-event--sky span { color: #476b7f; }
.tt-event--rose { background: var(--rose-tint); border-color: #ecc9c6; border-left-color: var(--rose); color: var(--rose-deep); }
.tt-event--rose span { color: #8f4644; }
.tt-event.is-cancelled { opacity: .62; text-decoration: line-through; }
.tt-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .74rem; color: var(--ink-faint); padding: 12px 4px 0; }
.tt-legend .lg { display: inline-flex; align-items: center; gap: 6px; }
.tt-legend .swatch { width: 11px; height: 11px; border-radius: 3px; border: 1px solid var(--line-strong); }

/* -------------------------------------------------------------- attendance */
.att-roster { display: grid; gap: 8px; }
.att-row {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface);
}
.att-row .att-who { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 190px; }
.att-row .att-who .nm { font-size: .86rem; font-weight: 620; }
.att-row .att-who .sub { font-size: .72rem; color: var(--ink-faint); }
.att-summary { display: flex; gap: 18px; flex-wrap: wrap; }
.att-summary .as-item .n { font-family: var(--font-display); font-size: 1.35rem; }
.att-summary .as-item .l { font-size: .71rem; color: var(--ink-soft); }
.att-summary .as-item.as-present .n { color: var(--sky-deep); }
.att-summary .as-item.as-absent .n { color: var(--rose-deep); }
.att-summary .as-item.as-leave .n { color: var(--gold-deep); }

/* --------------------------------------------------------------- receipts */
.receipt-sheet {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  width: min(760px, 100%); margin: 0 auto; padding: 34px 38px;
  box-shadow: var(--shadow);
}
.receipt-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; border-bottom: 2px solid var(--ink); padding-bottom: 16px; }
.receipt-head .centre-name { font-family: var(--font-display); font-size: 1.4rem; }
.receipt-head .centre-meta { font-size: .76rem; color: var(--ink-soft); margin-top: 3px; line-height: 1.45; }
.receipt-head .rcpt-brand { display: flex; gap: 10px; align-items: center; }
.receipt-head .rcpt-brand img { width: 38px; height: 38px; }
.receipt-title { text-align: right; }
.receipt-title .rt { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-faint); }
.receipt-title .no { font-size: 1.02rem; font-weight: 700; margin-top: 2px; }
.receipt-title .dt { font-size: .76rem; color: var(--ink-soft); margin-top: 3px; }
.receipt-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; padding: 18px 0; }
.receipt-parties .rp-label { font-family: var(--font-mono); font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 4px; }
.receipt-parties .rp-name { font-weight: 650; font-size: .9rem; }
.receipt-parties .rp-line { font-size: .78rem; color: var(--ink-soft); }
.receipt-total {
  display: flex; justify-content: space-between; gap: 16px; align-items: baseline;
  border-top: 2px solid var(--ink); margin-top: 6px; padding-top: 12px;
}
.receipt-total .amt { font-family: var(--font-display); font-size: 1.6rem; }
.receipt-words { font-size: .78rem; color: var(--ink-soft); margin-top: 4px; }
.receipt-notes { margin-top: 20px; padding: 12px 14px; background: var(--paper); border: 1px dashed var(--line-strong); border-radius: 8px; font-size: .76rem; color: var(--ink-soft); }
.receipt-sign { display: flex; justify-content: space-between; gap: 24px; margin-top: 34px; }
.receipt-sign .sig { border-top: 1px solid var(--line-strong); padding-top: 6px; font-size: .72rem; color: var(--ink-faint); min-width: 160px; }
.receipt-foot { text-align: center; font-family: var(--font-mono); font-size: .62rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); margin-top: 26px; }

/* --------------------------------------------------------------- accounts */
.acct-row { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.acct-row:last-child { border-bottom: 0; }

/* -------------------------------------------------------------- help page */
.help-shot {
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  background: var(--paper);
}
.help-shot .shot-bar {
  display: flex; align-items: center; gap: 6px; padding: 8px 10px;
  background: var(--surface-warm); border-bottom: 1px solid var(--line);
}
.help-shot .shot-bar .dots { display: flex; gap: 4px; }
.help-shot .shot-bar .dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); display: block; }
.help-shot .shot-bar .url {
  flex: 1; font-family: var(--font-mono); font-size: .6rem; color: var(--ink-faint);
  background: var(--paper-2); border-radius: 999px; padding: 3px 9px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.shot-stage { position: relative; padding: 12px; background: var(--surface); }
.shot-stage--login { display: grid; grid-template-columns: 40% 60%; gap: 0; padding: 0; }
.shot-mock { display: grid; gap: 7px; }
.shot-mock .sm-line { height: 8px; border-radius: 4px; background: var(--paper-2); }
.shot-mock .sm-line.w40 { width: 40%; } .shot-mock .sm-line.w60 { width: 60%; } .shot-mock .sm-line.w80 { width: 80%; }
.shot-mock .sm-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.shot-mock .sm-card { height: 34px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.shot-mock .sm-table { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.shot-mock .sm-tr { display: flex; gap: 6px; padding: 5px 7px; border-bottom: 1px solid var(--line); align-items: center; }
.shot-mock .sm-tr:last-child { border-bottom: 0; }
.shot-mock .sm-tr i { height: 6px; border-radius: 3px; background: var(--paper-2); display: block; flex: 1; }
.shot-mock .sm-tr i.ws { flex: .5; } .shot-mock .sm-tr i.wl { flex: 1.6; }
.shot-mock .sm-chip { height: 12px; width: 42px; border-radius: 999px; background: var(--brand-tint); flex: none; }
.shot-mock .sm-input { height: 22px; border: 1px solid var(--line-strong); border-radius: 5px; background: #fff; }
.shot-mock .sm-btn { height: 22px; border-radius: 5px; background: var(--brand); width: 34%; }
.shot-mock .sm-visual { background: linear-gradient(150deg, #ece5f7, #f6e9de); border-right: 1px solid var(--line); }
.shot-callout {
  position: absolute; width: 20px; height: 20px; border-radius: 50%;
  background: var(--apricot); color: #fff; display: grid; place-items: center;
  font-size: .65rem; font-weight: 700; font-family: var(--font-mono);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .9);
}
.help-steps { counter-reset: step; display: grid; gap: 10px; padding: 0; list-style: none; }
.help-steps li { counter-increment: step; display: grid; grid-template-columns: 26px 1fr; gap: 10px; font-size: .84rem; }
.help-steps li::before {
  content: counter(step); width: 22px; height: 22px; border-radius: 50%;
  background: var(--brand-tint); color: var(--brand-deep); font-size: .7rem; font-weight: 700;
  display: grid; place-items: center;
}
.help-steps li b { display: block; }
.help-steps li span { color: var(--ink-soft); }
.help-role-nav { display: flex; gap: 6px; flex-wrap: wrap; }
.help-role-nav button {
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-soft);
  padding: 6px 12px; border-radius: 999px; font-size: .78rem; font-weight: 600; cursor: pointer;
}
.help-role-nav button[aria-selected="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ------------------------------------------------------------ design notes */
.design-notes {
  margin-top: 42px; padding-top: 26px;
  border-top: 2px dashed var(--line-strong);
}
.dn-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.dn-tag {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--ink); color: #fbf6ec; padding: 5px 11px; border-radius: 999px;
  font-family: var(--font-mono); font-size: .62rem; letter-spacing: .13em; text-transform: uppercase;
}
.dn-head .dn-title { font-family: var(--font-display); font-size: 1.14rem; }
.dn-head .dn-screen { color: var(--ink-faint); font-size: .78rem; }
.dn-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.dn-card {
  background: var(--surface-warm); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 15px;
}
.dn-card h4 {
  font-family: var(--font-mono); font-size: .61rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--brand-deep); margin-bottom: 7px;
}
.dn-card p, .dn-card li { font-size: .78rem; color: var(--ink-soft); line-height: 1.5; }
.dn-card ul { padding-left: 15px; display: grid; gap: 3px; }
.dn-card li::marker { color: var(--apricot); }
.dn-card code { font-family: var(--font-mono); font-size: .72rem; background: var(--paper-2); padding: 1px 4px; border-radius: 4px; }
.dn-colors { display: flex; gap: 5px; margin-top: 8px; flex-wrap: wrap; }
.dn-swatch { width: 26px; height: 26px; border-radius: 7px; border: 1px solid rgba(0, 0, 0, .08); }
.dn-note-wide { grid-column: 1 / -1; }

/* -------------------------------------------------------------- reporting */
.report-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.report-tab {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft);
  padding: 6px 11px; border-radius: 999px; font-size: .78rem; font-weight: 600; cursor: pointer;
}
.report-tab[aria-selected="true"] { background: var(--brand-deep); border-color: var(--brand-deep); color: #fff; }
.report-tab:hover { border-color: var(--line-strong); }
.filters { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.filters .field { min-width: 130px; }
.report-meta { font-size: .74rem; color: var(--ink-faint); }

/* --------------------------------------------------------------- printing */
@media print {
  body { background: #fff; }
  .sidebar, .topbar, .page-actions, .design-notes, .no-print, .toast-region, .modal-backdrop, .skip-link { display: none !important; }
  .app-shell { display: block; }
  .content { padding: 0; max-width: none; }
  .receipt-sheet { border: 0; box-shadow: none; width: 100%; max-width: none; padding: 8mm 4mm; }
  .page-head { display: none !important; }
  .print-only { display: block !important; }
  .receipt-foot { margin-top: 14mm; }
  @page { size: A4; margin: 12mm; }
}
.print-only { display: none; }

/* -------------------------------------------------------------- responsive */
@media (max-width: 1180px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-sidebar { grid-template-columns: 1fr; }
  .dn-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 90;
    transform: translateX(-102%); transition: transform .2s ease;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.is-open { transform: none; }
  .sidebar-scrim {
    position: fixed; inset: 0; z-index: 80; background: rgba(42, 39, 36, .35);
    backdrop-filter: blur(2px); animation: fade-in .15s ease both;
  }
  .hamburger { display: inline-flex; }
  .sidebar-top .sidebar-close { display: inline-flex; }
  .topbar { padding: 0 18px; }
  .content { padding: 22px 18px 56px; }
  .login { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .login-panel { padding: 34px 20px; min-height: 100vh; }
  .login-mobile-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
  .login-mobile-brand img { width: 38px; height: 38px; }
  .login-mobile-brand .lmb-name { font-family: var(--font-display); font-size: 1.2rem; line-height: 1.1; }
  .login-mobile-brand .lmb-sub { font-family: var(--font-mono); font-size: .6rem; letter-spacing: .13em; text-transform: uppercase; color: var(--ink-faint); }
}
@media (max-width: 820px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field-grid { grid-template-columns: 1fr; }
  .reports-grid { grid-template-columns: 1fr; }
  .receipt-head { flex-direction: column; }
  .receipt-title { text-align: left; }
  .receipt-parties { grid-template-columns: 1fr; gap: 14px; }
  .kpi-grid { gap: 10px; }
  .hero-stats { gap: 18px; }
  .tt { min-width: 700px; }
}
@media (max-width: 640px) {
  h1, .h1 { font-size: 1.62rem; }
  .hero .hero-stats { display: none; }
  .content { padding: 18px 14px 48px; }
  .topbar { padding: 0 12px; gap: 8px; }
  .topbar-title .crumb { max-width: 34vw; }
  .user-btn .who { display: none; }
  .user-btn { padding: 4px; }
  .kpi { padding: 13px 14px; }
  .kpi .kpi-value { font-size: 1.55rem; }
  .card-head { padding: 15px 15px 0; }
  .card-body { padding: 15px; }
  .table th, .table td { padding: 9px 11px; }
  .table-toolbar { padding: 12px 14px; }
  .att-row { align-items: flex-start; }
  .segmented { width: 100%; }
  .segmented label { flex: 1; padding: 7px 8px; }
  .dn-grid { grid-template-columns: 1fr; }
  .page-head { margin-bottom: 16px; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }
  .schedule-item { flex-wrap: wrap; row-gap: 8px; }
  .schedule-item .si-main { flex: 1 1 calc(100% - 58px); }
  .schedule-item > .btn { margin-left: auto; }
  .schedule-item .si-badge { margin-left: 58px; }
  .login-box h2 { font-size: 1.5rem; }
  .demo-account-grid { grid-template-columns: 1fr; }
  .receipt-sheet { padding: 22px 18px; }
  .modal { max-height: 92vh; }
  .modal-head, .modal-body, .modal-foot { padding-left: 16px; padding-right: 16px; }
  .week-label { font-size: .92rem; min-width: 150px; }
}
@media (max-width: 360px) {
  .kpi-grid { grid-template-columns: 1fr; }
}


/* ------------------------------------------------------ v2 additions */
[hidden] { display: none !important; }

.steps {
  display: flex; gap: 8px; flex-wrap: wrap; list-style: none;
  padding: 0; margin: 0 0 16px;
}
.step {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  font-size: .78rem; color: var(--ink-faint);
}
.step .n {
  width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--paper-2); font-size: .66rem; font-weight: 700;
}
.step.is-active { border-color: var(--brand); background: var(--brand-tint); color: var(--brand-deep); font-weight: 600; }
.step.is-done .n { background: var(--brand); color: #fff; }

.login-notes {
  padding: 10px 28px 60px;
  max-width: 1200px;
  margin: 0 auto;
}
.login-notes .design-notes { margin-top: 10px; }

.help-card-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}
@media (max-width: 900px) {
  .help-card-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .login-notes { padding: 8px 14px 40px; }
}

.att-row .segmented { flex: none; }
@media (max-width: 520px) {
  .att-row { display: grid; grid-template-columns: 1fr; }
  .att-row .segmented { width: 100%; }
}

.help-steps li b { font-weight: 650; }
.help-steps li span { display: block; }

.receipt-sheet .table th { background: transparent; }
.receipt-sheet .table { font-size: .84rem; }
.receipt-sheet .table td { padding: 9px 2px; }
.receipt-sheet .table th:last-child, .receipt-sheet .table td:last-child { text-align: right; }

@media print {
  .login-notes { display: none !important; }
}


/* day view of the timetable */
.day-strip {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 7px;
  margin-bottom: 4px; min-width: 0;
}
.day-cell {
  display: block; text-align: center; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 11px; padding: 9px 6px 8px; color: var(--ink);
}
.day-cell:hover { background: var(--paper-2); color: var(--ink); }
.day-cell .dc-day { display: block; font-family: var(--font-mono); font-size: .6rem; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-faint); }
.day-cell .dc-num { display: block; font-family: var(--font-display); font-size: 1.25rem; line-height: 1.15; margin-top: 1px; }
.day-cell .dc-count { display: block; font-size: .62rem; color: var(--ink-faint); margin-top: 1px; white-space: nowrap; }
.day-cell.is-today { border-color: var(--brand-tint-2); }
.day-cell.is-active { background: var(--brand-tint); border-color: var(--brand); }
.day-cell.is-active .dc-day, .day-cell.is-active .dc-count { color: var(--brand-deep); }
.day-cell.is-holiday { background: var(--rose-tint); border-color: #ecc9c6; }
@media (max-width: 700px) {
  .day-strip { grid-auto-flow: column; grid-auto-columns: minmax(76px, 1fr); grid-template-columns: none; overflow-x: auto; padding-bottom: 4px; }
}
.day-row-actions { display: flex; gap: 6px; align-items: center; flex: none; }


.mobile-fee-status { display: none; margin-top: 4px; }
@media (max-width: 640px) {
  .fees-table .col-batch, .fees-table .col-plan, .fees-table .col-paid,
  .fees-table .col-overdue, .fees-table .col-status { display: none; }
  .fees-table .mobile-fee-status { display: block; }
  .fees-table .name-cell { min-width: 0; gap: 8px; }
  .fees-table .name-cell .avatar { display: none; }
  .fees-table th, .fees-table td { padding: 9px 8px; }
  .fees-table .btn--sm { padding: 5px 8px; }
  .fees-table td:last-child { text-align: right; }
}
