/* Fox & Stork admin design system (matches the approved prototype).
   Colours come from the logo: petrol teal for actions and Paid, fox orange for
   money still owed, pale blue-grey surfaces. Lato from the public site.
   Every rule is scoped (.fs-*) so legacy W3.CSS pages are unaffected. */

@import url('https://fonts.googleapis.com/css2?family=Lato:wght@400;700;900&display=swap');

:root {
  --fs-ink: #1d2a30;
  --fs-ink-strong: #16323d;
  --fs-muted: #56656c;
  --fs-soft: #3f4f56;
  --fs-teal: #134b5f;
  --fs-teal-dark: #0c3342;
  --fs-teal-tint: #e6eff2;
  --fs-teal-wash: #f1f7f9;
  --fs-fox: #b4602c;
  --fs-fox-ink: #6e3a17;
  --fs-fox-wash: #fdf6f0;
  --fs-fox-line: #e7c9b2;
  --fs-good: #2f7a5a;
  --fs-bad: #8a2f1f;
  --fs-bad-wash: #fbeeeb;
  --fs-ground: #f4f6f6;
  --fs-card: #ffffff;
  --fs-line: #dfe6e9;
  --fs-line-soft: #edf1f2;
  --fs-field: #cfd9dd;
  --fs-radius: 12px;
}

body.fs-app { margin: 0; background: var(--fs-ground); font-family: 'Lato', system-ui, sans-serif; color: var(--fs-ink); }
.fs-app a { color: var(--fs-teal); }
.fs-app a:hover { color: var(--fs-teal-dark); }
.fs-app h1, .fs-app h2, .fs-app h3 { font-family: 'Lato', system-ui, sans-serif; color: var(--fs-ink-strong); }

/* ---------- Navigation (also used on legacy pages) ---------- */
.fs-nav { background: #fff; border-bottom: 1px solid var(--fs-line); font-family: 'Lato', system-ui, sans-serif; }
.fs-nav-inner { max-width: 1360px; margin: 0 auto; padding: 8px 32px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.fs-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--fs-teal) !important; }
.fs-brand img { width: 44px; height: 44px; object-fit: contain; }
.fs-brand span { font-size: 19px; font-weight: 900; letter-spacing: .02em; }
.fs-nav-links { display: flex; gap: 4px; flex-wrap: wrap; }
.fs-nav-link { color: var(--fs-soft) !important; text-decoration: none; padding: 10px 14px; border-radius: 8px; font-weight: 700; font-size: 15px; }
.fs-nav-link:hover { background: #eef3f4; color: var(--fs-teal) !important; }
.fs-nav-link[aria-current="page"] { background: var(--fs-teal-tint); color: var(--fs-teal) !important; }
.fs-nav-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.fs-env-badge { font-size: 13px; font-weight: 700; color: #8a4a1f; background: #fbeee4; border-radius: 999px; padding: 6px 12px; }

/* ---------- Layout ---------- */
.fs-main { width: 100%; max-width: 1360px; margin: 0 auto; padding: 24px 32px 48px; box-sizing: border-box; display: flex; flex-direction: column; gap: 20px; }
.fs-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.fs-row-end { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.fs-grow { flex-grow: 1; }
.fs-stack { display: flex; flex-direction: column; gap: 10px; }
.fs-grid-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.fs-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 560px), 1fr)); gap: 20px; align-items: start; }
.fs-title { margin: 0; font-size: 28px; font-weight: 900; }
.fs-subtitle { margin: 4px 0 0; font-size: 15px; color: var(--fs-muted); }
.fs-note { margin: 0; font-size: 14px; color: var(--fs-muted); line-height: 1.5; max-width: 960px; }
.fs-small { font-size: 13px; color: var(--fs-muted); }
.fs-back { font-size: 14px; font-weight: 700; text-decoration: none; }

/* ---------- Cards and figures ---------- */
.fs-card { background: var(--fs-card); border: 1px solid var(--fs-line); border-radius: var(--fs-radius); }
.fs-card-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--fs-line-soft); flex-wrap: wrap; }
.fs-card-head h2 { margin: 0; font-size: 18px; font-weight: 900; flex-grow: 1; }
.fs-card-body { padding: 16px 18px; }
.fs-figure { background: var(--fs-card); border: 1px solid var(--fs-line); border-radius: var(--fs-radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.fs-figure-label { font-size: 14px; font-weight: 700; color: var(--fs-soft); display: inline-flex; align-items: center; gap: 8px; }
.fs-figure-value { font-size: 28px; font-weight: 900; color: var(--fs-ink-strong); font-variant-numeric: tabular-nums; }
.fs-figure-note { font-size: 13px; color: var(--fs-muted); }
.fs-figure-separate { background: var(--fs-teal-wash); border: 1px dashed #9bb7c1; }
.fs-figure-unverified { background: var(--fs-fox-wash); border: 1px solid var(--fs-fox-line); }
.fs-figure-unverified .fs-figure-label, .fs-figure-unverified .fs-figure-value { color: var(--fs-fox-ink); }
.fs-credit { color: var(--fs-good) !important; }

/* ---------- Tables ---------- */
.fs-tablewrap { overflow-x: auto; }
.fs-table { border-collapse: collapse; width: 100%; }
.fs-table th { font-size: 13px; font-weight: 700; color: var(--fs-muted); text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--fs-line); background: #f7f9f9; white-space: nowrap; }
.fs-table td { font-size: 15px; padding: 12px 14px; border-bottom: 1px solid var(--fs-line-soft); text-align: left; vertical-align: top; font-variant-numeric: tabular-nums; }
.fs-table .num { text-align: right; white-space: nowrap; }
.fs-table tfoot td { font-weight: 900; border-bottom: 0; }
.fs-table .sub { display: block; font-size: 13px; color: var(--fs-muted); margin-top: 2px; font-weight: 400; }
.fs-table tr.is-void td { color: var(--fs-muted); }
.fs-table tr.is-void td .fs-strike { text-decoration: line-through; }

/* ---------- Status markers (shape + word, never colour alone) ---------- */
.fs-status { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--fs-soft); white-space: nowrap; }
.st { display: inline-block; width: 12px; height: 12px; border-radius: 50%; box-sizing: border-box; flex: none; position: relative; }
.st-open { border: 1.5px dashed var(--fs-muted); }
.st-unpaid { border: 2px solid var(--fs-fox); }
.st-partly { border: 2px solid var(--fs-fox); background: linear-gradient(90deg, var(--fs-fox) 50%, transparent 50%); }
.st-paid { background: var(--fs-teal); border: 2px solid var(--fs-teal); }
.st-paid::after { content: ""; position: absolute; left: 2px; top: 0; width: 3px; height: 6px; border: solid #fff; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.st-void, .st-cancelled { border: 1.5px solid #8a979c; }
.st-void::after, .st-cancelled::after { content: ""; position: absolute; left: 3.5px; top: -1.5px; width: 1.5px; height: 12px; background: #8a979c; transform: rotate(45deg); }
.st-credit { border: 2px solid var(--fs-good); background: #fff; }
.st-credit::after { content: "+"; position: absolute; left: 1px; top: -4px; font-size: 10px; font-weight: 900; color: var(--fs-good); }
.st-flag { border-radius: 2px; background: #fbeee4; border: 1.5px solid var(--fs-fox); transform: rotate(45deg); width: 10px; height: 10px; }
.st-hold { border-radius: 2px; border: 2px solid var(--fs-soft); width: 11px; height: 11px; }
.st-review { border-radius: 2px; border: 1.5px dotted var(--fs-fox-ink); background: var(--fs-fox-wash); }

/* ---------- Forms and buttons ---------- */
.fs-label { font-size: 14px; font-weight: 700; color: var(--fs-soft); }
.fs-input, .fs-select, .fs-textarea { height: 44px; border-radius: 8px; border: 1px solid var(--fs-field); padding: 0 12px; font-family: inherit; font-size: 15px; color: var(--fs-ink); background: #fff; box-sizing: border-box; }
.fs-textarea { height: auto; padding: 10px 12px; min-height: 72px; }
.fs-input:focus, .fs-select:focus, .fs-textarea:focus, .fs-btn:focus-visible, .fs-app a:focus-visible { outline: 3px solid #7fb2c4; outline-offset: 1px; }
.fs-field { display: flex; flex-direction: column; gap: 6px; }
.fs-btn { height: 44px; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 9px; font-family: inherit; font-weight: 700; font-size: 15px; text-decoration: none !important; cursor: pointer; border: 1px solid var(--fs-field); background: #fff; color: var(--fs-teal) !important; box-sizing: border-box; }
.fs-btn:hover { background: #f3f7f8; }
.fs-btn-primary { background: var(--fs-teal); border-color: var(--fs-teal); color: #fff !important; }
.fs-btn-primary:hover { background: var(--fs-teal-dark); }
.fs-btn-danger { color: var(--fs-bad) !important; border-color: #e3b9b0; }
.fs-btn-small { height: 34px; padding: 0 12px; font-size: 14px; }
.fs-btn[disabled], .fs-btn.is-disabled { opacity: .55; cursor: not-allowed; }
.fs-linkbtn { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--fs-teal); cursor: pointer; text-decoration: underline; }

/* ---------- Alerts and notices ---------- */
.fs-alert { border-radius: 10px; padding: 12px 16px; font-size: 15px; line-height: 1.5; margin: 0; }
.fs-alert-error { background: var(--fs-bad-wash); color: var(--fs-bad); border: 1px solid #e3b9b0; }
.fs-alert-warning { background: var(--fs-fox-wash); color: var(--fs-fox-ink); border: 1px solid var(--fs-fox-line); }
.fs-alert-ok { background: #edf6f1; color: #1f5a40; border: 1px solid #b9dcc9; }
.fs-alert-info { background: var(--fs-teal-wash); color: var(--fs-teal-dark); border: 1px solid #c4dbe3; }
.fs-preview { border: 2px solid var(--fs-teal); border-radius: var(--fs-radius); background: var(--fs-teal-wash); padding: 16px 18px; }
.fs-preview h2 { margin: 0 0 8px; font-size: 18px; }
.fs-preview ul { margin: 6px 0 0; padding-left: 20px; line-height: 1.6; }

/* ---------- Login ---------- */
body.fs-login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 16px; box-sizing: border-box; }
.fs-login-card { width: 100%; max-width: 380px; background: #fff; border: 1px solid var(--fs-line); border-radius: 14px; padding: 28px; box-sizing: border-box; display: flex; flex-direction: column; gap: 14px; }
.fs-login-card h1 { margin: 0; font-size: 22px; font-weight: 900; text-align: center; }
.fs-login-logo { width: 88px; height: 88px; object-fit: contain; align-self: center; }

@media (max-width: 760px) {
  .fs-nav-inner, .fs-main { padding-left: 16px; padding-right: 16px; }
  .fs-title { font-size: 24px; }
  /* Wide tables become stacked label/value cards */
  .fs-table.fs-cards thead { display: none; }
  .fs-table.fs-cards, .fs-table.fs-cards tbody, .fs-table.fs-cards tfoot, .fs-table.fs-cards tr { display: block; width: 100%; }
  .fs-table.fs-cards tr { border-bottom: 1px solid var(--fs-line); padding: 12px 16px; box-sizing: border-box; }
  .fs-table.fs-cards td { display: block; border: 0; padding: 4px 0; text-align: right !important; white-space: normal; overflow: hidden; }
  .fs-table.fs-cards td[data-label]::before { content: attr(data-label); float: left; margin-right: 12px; max-width: 45%; text-align: left; font-size: 13px; font-weight: 700; color: var(--fs-muted); }
  .fs-table.fs-cards .fs-status { white-space: normal; }
  .fs-table.fs-cards td:first-child { display: block; text-align: left !important; font-size: 16px; padding-bottom: 6px; }
  .fs-table.fs-cards td:first-child::before { content: none; }
  .fs-table.fs-cards td:empty { display: none; }
  .fs-table.fs-cards td.fs-wide { display: block; text-align: left !important; }
  .fs-table.fs-cards td.fs-wide::before { float: none; display: block; margin-bottom: 6px; }
  .fs-table.fs-cards .sub { text-align: right; }
  .fs-table.fs-cards td:first-child .sub { text-align: left; }
  .fs-chart-amount { display: none; }
}
@media print {
  .fs-nav, .fs-noprint { display: none !important; }
  body.fs-app { background: #fff; }
}

/* ================= Calendar (Release 2; from the approved prototype) ================= */
.fs-app [hidden] { display: none !important; }
.fs-table.fs-lessons { table-layout: fixed; min-width: 640px; }
.fs-lessons col.c-pick { width: 56px; } .fs-lessons col.c-date { width: 15%; } .fs-lessons col.c-time { width: 19%; } .fs-lessons col.c-len { width: 10%; } .fs-lessons col.c-meth { width: 16%; } .fs-lessons col.c-rate { width: 13%; } .fs-lessons col.c-amt { width: 13%; }
.fs-period { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; }
.st-detail { border: 1.5px solid #5f8796; background: #dde9ee; }
.fs-cal-bar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.fs-cal-nav { display: flex; align-items: center; gap: 8px; }
.fs-cal-nav h1 { margin: 0; font-size: 28px; font-weight: 900; color: var(--fs-ink-strong); min-width: 220px; text-align: center; }
.fs-iconbtn { width: 44px; height: 44px; border-radius: 8px; border: 1px solid var(--fs-field); background: #fff; color: var(--fs-teal) !important; font-size: 20px; display: inline-flex; align-items: center; justify-content: center; text-decoration: none !important; box-sizing: border-box; }
.fs-iconbtn:hover { background: var(--fs-teal-wash); }
.fs-seg { display: flex; border: 1px solid var(--fs-field); border-radius: 9px; overflow: hidden; background: #fff; }
.fs-seg a { padding: 0 18px; height: 42px; display: inline-flex; align-items: center; color: var(--fs-soft) !important; font-weight: 700; font-size: 14px; text-decoration: none !important; }
.fs-seg a + a { border-left: 1px solid var(--fs-field); }
.fs-seg a[aria-current="page"] { background: var(--fs-teal); color: #fff !important; }
.fs-cal-filter { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.fs-cal-filter .fs-select { height: 42px; }
.fs-check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--fs-soft); cursor: pointer; }
.fs-check input { width: 18px; height: 18px; accent-color: var(--fs-teal); }
.fs-cal-summary { display: flex; gap: 8px 24px; flex-wrap: wrap; font-size: 14px; color: var(--fs-soft); background: #fff; border: 1px solid var(--fs-line); border-radius: 10px; padding: 12px 16px; align-items: center; }
.fs-cal-summary strong { color: var(--fs-ink-strong); }
.fs-cal-summary .fs-status { font-size: 14px; }
.fs-cal-wrap { overflow-x: auto; }
.fs-cal { min-width: 940px; background: #fff; border: 1px solid var(--fs-line); border-radius: 12px; overflow: hidden; }
.fs-cal-head, .fs-cal-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.fs-cal-head { background: #f7f9f9; border-bottom: 1px solid var(--fs-line); }
.fs-cal-head div { padding: 10px 12px; font-size: 13px; font-weight: 700; color: var(--fs-muted); text-transform: uppercase; letter-spacing: .06em; }
.fs-cal-weekband { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 6px 12px; font-size: 13px; color: var(--fs-fox-ink); background: var(--fs-fox-wash); border-bottom: 1px solid var(--fs-line-soft); }
.fs-cal-weekband a { color: var(--fs-fox-ink); font-weight: 700; }
.fs-cal-weekband { border-left: 4px solid var(--fs-fox); }
.fs-cal-row.has-weekly { box-shadow: inset 4px 0 0 var(--fs-fox); border-top: 2px solid var(--fs-fox-line); }
.fs-cal-row.has-weekly .fs-cal-weekband + .fs-day { box-shadow: inset 4px 0 0 var(--fs-fox); }
.fs-cal-weeksum { max-width: 100%; min-width: 0; }
.fs-cal-weeksum, .fs-cal-weeksum * { white-space: normal; }
.fs-cal-weekband-label { flex-basis: 100%; font-weight: 900; }
.fs-cal-weeksum { display: inline-flex; flex-direction: column; gap: 2px; padding-left: 10px; border-left: 3px solid var(--fs-fox); }
.fs-day { min-height: 132px; padding: 8px; display: flex; flex-direction: column; gap: 6px; border-right: 1px solid var(--fs-line-soft); border-bottom: 1px solid var(--fs-line-soft); box-sizing: border-box; background: #fff; cursor: pointer; position: relative; }
.fs-day:nth-child(7n) { border-right: 0; }
.fs-day.is-out { background: #f5f5f3; }
.fs-day.is-today .fs-day-num { background: var(--fs-teal); color: #fff; border-radius: 999px; padding: 1px 8px; }
.fs-day.is-selected { box-shadow: inset 0 0 0 2px var(--fs-teal); }
.fs-day-top { display: flex; align-items: center; justify-content: space-between; }
.fs-day-num { font-size: 15px; font-weight: 700; color: var(--fs-ink-strong); }
.fs-day.is-out .fs-day-num { color: #7d8a8f; }
.fs-addday { color: var(--fs-muted) !important; text-decoration: none !important; font-size: 20px; line-height: 1; width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; }
.fs-addday:hover, .fs-addday:focus-visible { background: var(--fs-teal-tint); color: var(--fs-teal) !important; }
.fs-day-untimed { font-size: 11.5px; font-weight: 700; color: var(--fs-muted); text-transform: uppercase; letter-spacing: .05em; margin-top: 2px; }
.fs-chip { display: flex; flex-direction: column; gap: 2px; text-decoration: none !important; color: var(--fs-ink) !important; background: #f3f6f7; border: 1px solid var(--fs-line); border-radius: 7px; padding: 6px 8px; cursor: pointer; }
.fs-chip:hover { border-color: var(--fs-teal); }
.fs-chip.is-selected { border: 2px solid var(--fs-teal); background: var(--fs-teal-tint); }
.fs-chip.is-review { background: var(--fs-fox-wash); border-color: var(--fs-fox-line); }
.fs-chip-main { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; }
.fs-chip-sub { font-size: 12.5px; color: var(--fs-muted); padding-left: 18px; }
.fs-chip.is-cancelled .fs-chip-name { text-decoration: line-through; color: var(--fs-muted); }
.fs-cal-legend { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; font-size: 14px; color: var(--fs-soft); }
.fs-cal-legend strong { color: var(--fs-ink-strong); }
.fs-cal-list { display: none; flex-direction: column; gap: 14px; }
.fs-cal-listday { display: flex; flex-direction: column; gap: 8px; }
.fs-cal-listday h3 { margin: 0; font-size: 13px; font-weight: 700; color: var(--fs-muted); text-transform: uppercase; letter-spacing: .06em; }
.fs-cal-listday.is-today h3 { color: var(--fs-teal); }
.fs-lrow { display: flex; gap: 12px; align-items: center; padding: 12px 14px; background: #fff; border: 1px solid var(--fs-line); border-radius: 10px; text-decoration: none !important; color: var(--fs-ink) !important; }
.fs-lrow.is-selected { border: 2px solid var(--fs-teal); background: var(--fs-teal-wash); }
.fs-lrow.is-review { background: var(--fs-fox-wash); border-color: var(--fs-fox-line); }
.fs-lrow-main { display: flex; flex-direction: column; gap: 2px; flex-grow: 1; min-width: 0; }
.fs-lrow-name { font-size: 15px; font-weight: 700; color: var(--fs-ink-strong); }
.fs-lrow-when { font-size: 13px; color: var(--fs-muted); }
.fs-lrow-amt { font-size: 16px; font-weight: 900; color: var(--fs-ink-strong); white-space: nowrap; }
.fs-lrow-add { font-size: 14px; color: var(--fs-muted) !important; text-decoration: none !important; padding: 10px 14px; border: 1px dashed var(--fs-field); border-radius: 10px; }
.fs-cal-weekcols { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; min-width: 940px; }
.fs-cal-weekcols .fs-cal-listday { background: #fff; border: 1px solid var(--fs-line); border-radius: 12px; padding: 10px; min-height: 240px; }
.fs-cal-weekcols .fs-lrow { flex-direction: column; align-items: stretch; gap: 4px; padding: 8px 10px; }
.fs-cal-weekcols .fs-lrow-amt { font-size: 14px; }
.fs-cal-day { display: flex; flex-direction: column; gap: 10px; max-width: 760px; }
.fs-fab { display: none; }

/* Session panel: side panel on desktop, full screen on phones */
.fs-drawer-back { position: fixed; inset: 0; background: rgba(22, 50, 61, .28); z-index: 40; }
.fs-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 560px; max-width: 100%; background: #fff; border-left: 1px solid var(--fs-line); z-index: 41; display: flex; flex-direction: column; box-shadow: -12px 0 32px rgba(22, 50, 61, .14); }
.fs-drawer-head { padding: 22px 28px 14px; border-bottom: 1px solid var(--fs-line-soft); display: flex; align-items: flex-start; gap: 12px; }
.fs-drawer-head .fs-kicker { font-size: 13px; font-weight: 700; color: var(--fs-muted); text-transform: uppercase; letter-spacing: .06em; }
.fs-drawer-head h2 { margin: 4px 0 0; font-size: 24px; font-weight: 900; color: var(--fs-ink-strong); }
.fs-drawer-scroll { flex-grow: 1; overflow-y: auto; }
.fs-drawer-body { padding: 18px 28px 24px; display: flex; flex-direction: column; gap: 18px; }
.fs-drawer-body + .fs-drawer-body { border-top: 1px solid var(--fs-line-soft); }
.fs-drawer-foot { padding: 14px 28px 20px; border-top: 1px solid var(--fs-line-soft); background: #fff; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.fs-drawer-total { flex: 1 1 0; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fs-drawer-actions { display: flex; gap: 12px; flex: none; }
.fs-drawer-total .big { font-size: 22px; font-weight: 900; color: var(--fs-ink-strong); }
.fs-grid-2c { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.fs-lenchips { display: flex; gap: 6px; flex-wrap: wrap; }
.fs-lenchip { height: 36px; min-width: 52px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--fs-field); background: #fff; font-family: inherit; font-size: 14px; font-weight: 700; color: var(--fs-soft); cursor: pointer; }
.fs-lenchip[aria-pressed="true"] { background: var(--fs-teal-tint); border-color: var(--fs-teal); color: var(--fs-teal); }
.fs-fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.fs-fieldset legend { padding: 0; margin-bottom: 8px; }
.fs-radio { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--fs-ink); cursor: pointer; }
.fs-radio input { width: 18px; height: 18px; accent-color: var(--fs-teal); margin: 0; }
.fs-opt { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 10px; cursor: pointer; background: #fff; border: 1px solid var(--fs-field); }
.fs-opt input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--fs-teal); flex: none; }
.fs-opt:has(input:checked) { border: 2px solid var(--fs-teal); background: var(--fs-teal-wash); padding: 13px 15px; }
.fs-opt-text { flex-grow: 1; display: flex; flex-direction: column; gap: 2px; }
.fs-opt-title { font-size: 16px; font-weight: 700; color: var(--fs-ink-strong); }
.fs-opt-sub { font-size: 14px; color: var(--fs-muted); }
.fs-opt-amt { font-size: 20px; font-weight: 900; color: var(--fs-ink-strong); white-space: nowrap; }
.fs-panelbox { display: flex; flex-direction: column; gap: 8px; background: #f7f9f9; border: 1px solid #e3eaec; border-radius: 10px; padding: 14px 16px; }
.fs-panelbox.is-warn { background: var(--fs-fox-wash); border-color: var(--fs-fox-line); }
.fs-dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; font-size: 15px; }
.fs-dl dt { font-weight: 700; color: var(--fs-soft); }
.fs-dl dd { margin: 0; }

@media (max-width: 760px) {
  .fs-cal-nav h1 { font-size: 20px; min-width: 0; flex-grow: 1; }
  .fs-cal-nav { width: 100%; }
  .fs-seg { width: 100%; }
  .fs-seg a { flex: 1; justify-content: center; }
  .fs-cal-wrap.is-month { display: none; }
  .fs-cal-list { display: flex; }
  .fs-cal-weekcols { display: flex; flex-direction: column; min-width: 0; }
  .fs-cal-weekcols .fs-cal-listday { min-height: 0; }
  .fs-cal-weekcols .fs-lrow { flex-direction: row; align-items: center; }
  .fs-cal-add-top { display: none !important; }
  .fs-fab { display: flex; position: fixed; left: 16px; right: 16px; bottom: 16px; height: 52px; align-items: center; justify-content: center; border-radius: 12px; background: var(--fs-teal); color: #fff !important; text-decoration: none !important; font-weight: 700; font-size: 16px; box-shadow: 0 6px 16px rgba(19, 75, 95, .25); z-index: 30; }
  .fs-cal-page { padding-bottom: 72px; }
  .fs-drawer { width: 100%; border-left: 0; }
  .fs-drawer-total { flex-basis: 100%; }
  .fs-drawer-actions { width: 100%; }
  .fs-drawer-actions .fs-btn { flex: 1; }
  .fs-drawer-head, .fs-drawer-body, .fs-drawer-foot { padding-left: 16px; padding-right: 16px; }
  .fs-grid-2c { grid-template-columns: minmax(0, 1fr); }
  .fs-drawer-head, .fs-drawer-scroll .fs-drawer-body { padding-left: 16px; padding-right: 16px; }
}

/* ======================================================================
   Natalie-first screens: student account, students list, simple forms
   ====================================================================== */
.fa-head { display: flex; align-items: flex-end; gap: 12px 16px; flex-wrap: wrap; }
.fa-head .fs-title { line-height: 1.15; }
.fa-head-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.fa-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 14px; }
.fa-tile { background: #fff; border: 1px solid var(--fs-line); border-radius: var(--fs-radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.fa-tile-label { font-size: 14px; font-weight: 700; color: var(--fs-soft); display: flex; align-items: center; gap: 8px; }
.fa-tile-value { font-size: 30px; font-weight: 900; color: var(--fs-ink-strong); font-variant-numeric: tabular-nums; line-height: 1.1; }
.fa-tile-note { font-size: 14px; color: var(--fs-muted); line-height: 1.45; }
.fa-tile .fs-btn { align-self: flex-start; margin-top: 4px; }
.fa-tile.is-credit .fa-tile-value { color: var(--fs-good); }
.fa-tile.is-quiet .fa-tile-value { color: var(--fs-muted); }
.fa-older-line { display: flex; gap: 10px; align-items: flex-start; background: var(--fs-fox-wash); border: 1px solid var(--fs-fox-line); border-radius: 10px; padding: 12px 16px; color: var(--fs-fox-ink); font-size: 15px; line-height: 1.5; }
.fa-older-line .st { margin-top: 5px; }
.fa-older-line.is-done { background: var(--fs-teal-wash); border-color: var(--fs-teal-tint); color: var(--fs-teal-dark); }

.fa-section { background: #fff; border: 1px solid var(--fs-line); border-radius: var(--fs-radius); }
.fa-section-head { display: flex; align-items: center; gap: 10px 14px; padding: 14px 18px; border-bottom: 1px solid var(--fs-line-soft); flex-wrap: wrap; }
.fa-section-head h2 { margin: 0; font-size: 19px; font-weight: 900; flex-grow: 1; }
.fa-tabs { display: inline-flex; border: 1px solid var(--fs-field); border-radius: 9px; overflow: hidden; }
.fa-tabs a { padding: 7px 12px; font-size: 14px; font-weight: 700; text-decoration: none; color: var(--fs-soft) !important; border-left: 1px solid var(--fs-field); }
.fa-tabs a:first-child { border-left: 0; }
.fa-tabs a[aria-current="true"] { background: var(--fs-teal); color: #fff !important; }

.fa-month { display: flex; align-items: center; gap: 10px 14px; padding: 12px 18px 8px; flex-wrap: wrap; border-top: 1px solid var(--fs-line-soft); }
.fa-month:first-child { border-top: 0; }
.fa-month h3 { margin: 0; font-size: 15px; font-weight: 900; color: var(--fs-ink-strong); text-transform: none; }
.fa-month .fs-small { flex-grow: 1; }

.fa-list { list-style: none; margin: 0; padding: 0; }
.fa-item { display: grid; grid-template-columns: minmax(118px, 150px) minmax(0, 1fr) auto minmax(150px, 210px) auto; gap: 4px 16px; align-items: center; padding: 11px 18px; border-top: 1px solid var(--fs-line-soft); }
.fa-item:first-child { border-top: 0; }
.fa-item.is-muted { color: var(--fs-muted); }
.fa-when { font-weight: 700; white-space: nowrap; }
.fa-what { min-width: 0; font-size: 15px; }
.fa-what .sub, .fa-state .sub { display: block; font-size: 13px; color: var(--fs-muted); margin-top: 2px; }
.fa-amt { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.fa-amt .sub { display: block; font-weight: 400; font-size: 13px; color: var(--fs-muted); }
.fa-state { min-width: 0; }
.fa-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.fa-strike { text-decoration: line-through; }

.fa-inv { border-top: 1px solid var(--fs-line-soft); }
.fa-inv:first-child { border-top: 0; }
.fa-inv-num { font-weight: 900; }
/* Invoice row (student page and Invoices list): three groups that never overlap.
   info (title / number + created / status + sent) · amounts (total, paid, left in fixed columns) · actions.
   The layout follows the width of the invoice card itself, not the window:
   narrow: the groups stacked · medium: info on the left, amounts with the actions under them on the right ·
   wide: the three groups side by side. No column can shrink below its content. */
.fa-inv { container-type: inline-size; container-name: fa-inv; }
/* A size container paints as its own layer, so a row whose Actions menu is open is lifted above the rows after it. */
.fa-inv:has(.fa-actions-menu[open]) { position: relative; z-index: 5; }
.fa-inv-main { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "info" "money" "actions"; gap: 12px; padding: 14px 16px; }
.fa-inv-info { grid-area: info; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.fa-inv-who { font-weight: 900; color: var(--fs-ink-strong); text-decoration: none; }
.fa-inv-who:hover { text-decoration: underline; }
.fa-inv-who + .fa-inv-num { font-weight: 700; }
.fa-inv-num, .fa-inv-who { overflow-wrap: anywhere; }
.fa-inv-meta { font-size: 13px; color: var(--fs-muted); }
.fa-inv-status { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 3px; font-size: 14px; }
.fa-inv-sent { color: var(--fs-muted); font-size: 13px; }
.fa-inv-sent::before { content: "·"; margin-right: 10px; color: var(--fs-line); }
.fa-inv-sent.is-failed { color: var(--fs-fox-ink); font-weight: 700; }
.fa-money3 { grid-area: money; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; font-variant-numeric: tabular-nums; }
.fa-amt-cell { display: flex; flex-direction: column; align-items: flex-start; white-space: nowrap; }
.fa-amt-val { font-weight: 700; }
.fa-amt-cell.is-due .fa-amt-val { color: var(--fs-fox-ink); }
.fa-money3 small { font-size: 12px; color: var(--fs-muted); font-weight: 400; }
.fa-inv-main > .fa-actions { grid-area: actions; justify-content: flex-start; align-items: center; }
.fa-inv-main > .fa-actions .fs-btn { white-space: nowrap; }
/* Phone-width card: every action has a fixed slot, whatever the invoice's state.
   Row 1: PDF · Send / Send again… · Actions ▾, in columns of fixed proportions (an empty slot stays empty, so
   nothing shifts or grows).
   Row 2: Record payment across the full width, only when money is due. 44px touch targets, text size unchanged. */
.fa-inv-main > .fa-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) 6.5rem;
  grid-template-areas: "pdf send menu" "pay pay pay"; column-gap: 8px; row-gap: 0; align-items: stretch; }
.fa-inv-main > .fa-actions > .fa-act-pdf { grid-area: pdf; }
.fa-inv-main > .fa-actions > .fa-act-send { grid-area: send; }
.fa-inv-main > .fa-actions > .fa-actions-menu { grid-area: menu; justify-self: end; }
.fa-inv-main > .fa-actions > .fa-act-pay { grid-area: pay; margin-top: 8px; }
.fa-inv-main > .fa-actions > .fs-btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; }
.fa-inv-main > .fa-actions > .fa-actions-menu > .fa-actions-btn { min-height: 44px; display: inline-flex; align-items: center; box-sizing: border-box; padding: 6px 10px; }
.fa-inv-main > .fa-actions > .fa-actions-menu .fa-more-menu { right: 0; left: auto; }
@container fa-inv (min-width: 600px) {
  .fa-inv-main { grid-template-columns: minmax(0, 1fr) max-content; grid-template-areas: "info money" "info actions"; gap: 10px 24px; padding: 14px 18px; }
  .fa-money3 { grid-template-columns: repeat(3, minmax(104px, max-content)); gap: 0 12px; align-self: start; }
  .fa-amt-cell { align-items: flex-end; }
  .fa-inv-main > .fa-actions { display: flex; justify-content: flex-end; align-self: end; margin: 0; }
  .fa-inv-main > .fa-actions > .fa-act-pay { margin-top: 0; }
  .fa-inv-main > .fa-actions > .fs-btn { min-height: 0; }
  .fa-inv-main > .fa-actions > .fa-actions-menu > .fa-actions-btn { min-height: 0; padding: 6px 8px; }
}
@container fa-inv (min-width: 1080px) {
  /* The actions column has one fixed width (room for PDF, Send again…, Record payment and Actions), so the amounts
     line up from row to row whatever buttons a row has. */
  .fa-inv-main { grid-template-columns: minmax(0, 1fr) max-content 24.5rem; grid-template-areas: "info money actions"; align-items: center; }
  .fa-money3 { align-self: center; }
  .fa-inv-main > .fa-actions { align-self: center; }
}
.fa-detail { padding: 0 18px 12px; }
.fa-detail > summary { cursor: pointer; font-size: 14px; font-weight: 700; color: var(--fs-teal); list-style: none; display: inline-flex; gap: 6px; align-items: center; }
.fa-detail > summary::-webkit-details-marker { display: none; }
.fa-detail > summary::before { content: "▸"; font-size: 12px; }
.fa-detail[open] > summary::before { content: "▾"; }
.fa-detail-body { margin-top: 8px; background: #f7f9f9; border-radius: 10px; padding: 10px 14px; font-size: 14px; line-height: 1.6; }
.fa-detail-body table { width: 100%; border-collapse: collapse; }
.fa-detail-body td { padding: 3px 6px; vertical-align: top; }
.fa-detail-body td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

.fa-more { position: relative; }
.fa-more > summary { list-style: none; cursor: pointer; }
.fa-more > summary::-webkit-details-marker { display: none; }
.fa-more-menu { position: absolute; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--fs-line); border-radius: 10px; box-shadow: 0 10px 24px rgba(19,75,95,.14); padding: 6px; min-width: 210px; z-index: 30; display: flex; flex-direction: column; }
.fa-more-menu a { padding: 9px 12px; border-radius: 7px; text-decoration: none; font-size: 14px; font-weight: 700; }
.fa-more-menu a:hover { background: var(--fs-teal-wash); }
.fa-more-menu .danger { color: var(--fs-bad) !important; }

.fa-empty { padding: 16px 18px; color: var(--fs-muted); font-size: 15px; }
.fa-foot { padding: 10px 18px 14px; border-top: 1px solid var(--fs-line-soft); }
.fa-q { border: 2px solid var(--fs-teal); background: var(--fs-teal-wash); border-radius: var(--fs-radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.fa-q h2 { margin: 0; font-size: 18px; }
.fa-q-facts { margin: 0; padding-left: 18px; font-size: 15px; line-height: 1.55; color: var(--fs-ink); }
.fa-q-answers { display: flex; gap: 8px; flex-wrap: wrap; }
.fa-q-kicker { font-size: 13px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; color: var(--fs-teal); }

/* Students list */
.fa-students { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 14px; }
.fa-stu { background: #fff; border: 1px solid var(--fs-line); border-radius: var(--fs-radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; text-decoration: none !important; color: var(--fs-ink) !important; }
.fa-stu:hover { border-color: #9bb7c1; box-shadow: 0 4px 14px rgba(19,75,95,.08); }
.fa-stu-name { font-size: 18px; font-weight: 900; color: var(--fs-ink-strong); }
.fa-stu-lines { display: flex; flex-direction: column; gap: 3px; font-size: 14px; }

/* Secondary menu in the top bar */
.fs-more-nav { position: relative; }
.fs-more-nav > summary { list-style: none; cursor: pointer; }
.fs-more-nav > summary::-webkit-details-marker { display: none; }
.fs-more-nav .fa-more-menu { min-width: 250px; }
.fs-more-nav .fa-more-menu .sep { border-top: 1px solid var(--fs-line-soft); margin: 4px 6px; }
.fs-more-nav .fa-more-menu .hint { display: block; font-size: 12px; font-weight: 400; color: var(--fs-muted); }

@media (max-width: 860px) {
  .fa-item { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "when amt" "what what" "state actions"; padding: 12px 16px; }
  .fa-item .fa-when { grid-area: when; } .fa-item .fa-what { grid-area: what; } .fa-item .fa-amt { grid-area: amt; }
  .fa-item .fa-state { grid-area: state; } .fa-item .fa-actions { grid-area: actions; justify-content: flex-end; align-self: end; }
  .fa-head-actions { margin-left: 0; width: 100%; }
  .fa-head-actions .fs-btn { flex: 1 1 auto; }
  .fa-tile-value { font-size: 26px; }
  .fa-more-menu { left: 0; right: auto; }
}
.fs-maint-bar { background: #3f4f56; color: #fff; font-size: 14px; font-weight: 700; padding: 8px 32px; }
@media (max-width: 760px) { .fs-maint-bar { padding: 8px 16px; } .fs-nav-right { margin-left: 0; } }
.fa-more-menu { max-width: calc(100vw - 32px); box-sizing: border-box; }
@media (max-width: 860px) { .fs-more-nav .fa-more-menu { left: auto; right: 0; } }
@media (max-width: 760px) { .fs-status { white-space: normal; align-items: flex-start; } .fs-status .st { margin-top: 3px; } }
/* Fix a mistake */
.fa-fix { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 12px; max-width: 980px; }
.fa-fix-choice { display: flex; flex-direction: column; gap: 4px; background: #fff; border: 1px solid var(--fs-line); border-radius: var(--fs-radius); padding: 16px 18px; text-decoration: none !important; color: var(--fs-ink) !important; margin: 0; }
a.fa-fix-choice:hover { border-color: var(--fs-teal); box-shadow: 0 4px 14px rgba(19,75,95,.08); }
.fa-fix-choice.is-primary { border: 2px solid var(--fs-teal); }
.fa-fix-title { font-size: 17px; font-weight: 900; color: var(--fs-ink-strong); }
.fa-fix-what { font-size: 14px; color: var(--fs-muted); line-height: 1.5; }
table.fa-fx { border-collapse: collapse; margin-top: 10px; min-width: min(100%, 420px); font-size: 15px; }
table.fa-fx th { font-size: 13px; color: var(--fs-muted); font-weight: 700; padding: 4px 10px; text-align: left; }
table.fa-fx td { padding: 6px 10px; border-top: 1px solid #c4dbe3; font-variant-numeric: tabular-nums; }
table.fa-fx .num { text-align: right; white-space: nowrap; }
table.fa-fx tr.same td { color: var(--fs-muted); }
table.fa-fx tr.same strong { font-weight: 400; }
table.fa-fx .sub { display: block; font-size: 13px; color: var(--fs-muted); font-weight: 400; }
.fa-actions-btn { list-style: none; cursor: pointer; font-size: 14px; font-weight: 700; color: var(--fs-teal); padding: 6px 8px; border-radius: 8px; white-space: nowrap; }
.fa-actions-btn::-webkit-details-marker { display: none; }
.fa-actions-btn:hover, .fa-actions-menu[open] .fa-actions-btn { background: var(--fs-teal-wash); }
/* Create invoices: scope and live selection */
.fa-scope-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 14px; }
.fa-pickbar { position: sticky; bottom: 0; display: flex; gap: 10px 14px; align-items: center; flex-wrap: wrap; background: #fff; border: 1px solid var(--fs-line); border-radius: var(--fs-radius); padding: 12px 16px; box-shadow: 0 -4px 16px rgba(19,75,95,.08); }
.fa-pickbar-sum { flex-grow: 1; font-size: 16px; font-weight: 900; color: var(--fs-ink-strong); }
