/* ─────────────────────────────────────────────────────────────
   DojoMaster — administrative side of Shun Poo Kan Aikido.

   The palette is lifted unchanged from the public site so the two read as one
   organisation: crimson #9E1212, charcoal, antique gold, warm neutrals biased
   toward the crimson. Where the public site is editorial and roomy, this is a
   working tool — denser, tabular, with state carried in form as well as words.
   ───────────────────────────────────────────────────────────── */

:root {
  --ink:        #1b1717;
  --ink-soft:   #4e4646;
  --ink-faint:  #7d7373;
  --crimson:    #9E1212;
  --crimson-dp: #6b0d0d;
  --crimson-sf: #f2e3e3;
  --gold:       #6f5f38;
  --gold-lift:  #c4a86e;
  --paper:      #f0edeb;
  --surface:    #f7f5f4;
  --surface-2:  #ffffff;
  --line:       #ded7d4;
  --line-soft:  #ebe5e2;
  --shadow:     0 1px 2px rgba(27,23,23,.05), 0 8px 24px -12px rgba(107,13,13,.25);

  /* Semantic states, deliberately distinct from the crimson accent so that
     "needs attention" never reads as "this is the brand colour". */
  --ok:      #2f6b46;
  --ok-sf:   #e4efe8;
  --warn:    #8a5a12;
  --warn-sf: #f7ecd9;
  --bad:     #9c2020;
  --bad-sf:  #f7e2e2;

  --f-display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --f-body:    system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --f-data:    ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --wrap: 1240px;
  --pad: clamp(1rem, 3vw, 2rem);
  --radius: 3px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink:        #f2eeec;
    --ink-soft:   #b6a9a6;
    --ink-faint:  #8a7d7a;
    --crimson:    #ef6a6a;
    --crimson-dp: #7d1010;
    --crimson-sf: #2e1a1a;
    --gold:       #c4a86e;
    --gold-lift:  #c4a86e;
    --paper:      #151111;
    --surface:    #1d1818;
    --surface-2:  #241e1e;
    --line:       #362d2d;
    --line-soft:  #2b2323;
    --shadow:     0 1px 2px rgba(0,0,0,.45), 0 8px 24px -12px rgba(0,0,0,.75);
    --ok:      #7bc79b;  --ok-sf:   #17281e;
    --warn:    #e0b269;  --warn-sf: #2b2114;
    --bad:     #f08a8a;  --bad-sf:  #2e1717;
  }
}

:root[data-theme="dark"] {
  --ink:        #f2eeec;
  --ink-soft:   #b6a9a6;
  --ink-faint:  #8a7d7a;
  --crimson:    #ef6a6a;
  --crimson-dp: #7d1010;
  --crimson-sf: #2e1a1a;
  --gold:       #c4a86e;
  --gold-lift:  #c4a86e;
  --paper:      #151111;
  --surface:    #1d1818;
  --surface-2:  #241e1e;
  --line:       #362d2d;
  --line-soft:  #2b2323;
  --shadow:     0 1px 2px rgba(0,0,0,.45), 0 8px 24px -12px rgba(0,0,0,.75);
  --ok:      #7bc79b;  --ok-sf:   #17281e;
  --warn:    #e0b269;  --warn-sf: #2b2114;
  --bad:     #f08a8a;  --bad-sf:  #2e1717;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--f-display);
  font-weight: 600;
  text-wrap: balance;
  margin: 0;
  line-height: 1.15;
  letter-spacing: -.01em;
}
h1 { font-size: 1.7rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }

a { color: var(--crimson); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--crimson-dp); }

:where(a, button, input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--crimson);
  outline-offset: 2px;
}

.eyebrow {
  font-family: var(--f-data);
  font-size: .68rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 .35rem;
}

/* ── Frame ─────────────────────────────────────────────────── */

/* The banner is the public site's, unchanged: the club's own logo and kanji on
   the tiling charcoal grain, so DojoMaster and www.shunpookan-aikido.org.uk read
   as one organisation rather than two. It stays dark in both themes because the
   artwork is drawn for a dark ground. */
.banner {
  background-color: #292929;
  background-image: url("../img/Background.gif");
  background-repeat: repeat;
  border-bottom: 1px solid #000;
}
.banner__wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 128px;
}
.brand { display: block; line-height: 0; }
.banner-logo { width: 400px; max-width: min(400px, 64vw); height: auto; }
.banner-marks { display: flex; align-items: center; gap: 1.1rem; flex: none; }
.bab-mark { width: 72px; height: auto; border-radius: 2px; }
.banner-kanji { width: 216px; height: auto; }
@media (max-width: 1040px) { .banner-kanji { width: 165px; } .bab-mark { width: 60px; } }
@media (max-width: 860px)  { .banner-kanji { display: none; } }
@media (max-width: 820px)  { .banner__wrap { min-height: 96px; } }
@media (max-width: 620px)  { .banner-marks { display: none; } }

/* The slim sticky bar beneath it, again matching the public site. */
.site-head {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #1c1a1a;
  border-bottom: 2px solid var(--crimson);
}
.site-head__wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--pad);
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 58px;
}
.site-head__mark {
  font-family: var(--f-data);
  font-size: .7rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gold-lift);
  margin-right: auto;
}
.nav { display: flex; gap: 1.4rem; margin-right: auto; overflow-x: auto; }
.nav a, .nav-link {
  font-size: .92rem;
  text-decoration: none;
  color: #c9bfbc;
  padding-block: .3rem;
  border-bottom: 1px solid transparent;
  white-space: nowrap;
  transition: color .18s, border-color .18s;
}
.nav a:hover, .nav-link:hover { color: #fff; border-bottom-color: var(--crimson); }
.nav a[aria-current="page"] { color: #fff; border-bottom-color: var(--crimson); }
.site-head__who {
  font-family: var(--f-data);
  font-size: .7rem;
  letter-spacing: .08em;
  color: #8f8280;
  white-space: nowrap;
}
.site-head__out { margin: 0; }
.site-head__out button {
  background: none;
  border: none;
  padding: .3rem 0;
  font-size: .92rem;
  color: #c9bfbc;
  text-decoration: underline;
  cursor: pointer;
}
.site-head__out button:hover { color: #fff; background: none; }
@media (max-width: 780px) {
  .site-head__who { display: none; }
  .site-head__wrap { gap: 1rem; }
}

main {
  max-width: var(--wrap);
  margin-inline: auto;
  padding: 1.75rem var(--pad) 4rem;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.page-head p { margin: .3rem 0 0; color: var(--ink-soft); font-size: .92rem; }

footer.foot {
  border-top: 1px solid var(--line);
  margin-top: 3rem;
  padding: 1.25rem var(--pad);
  font-size: .78rem;
  color: var(--ink-faint);
  max-width: var(--wrap);
  margin-inline: auto;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ── Cards & layout helpers ────────────────────────────────── */

.card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card > header {
  padding: .8rem 1.1rem;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
}
.card > .body { padding: 1.1rem; }
.card > .body.tight { padding: 0; }

.stack { display: flex; flex-direction: column; gap: 1.25rem; }
.row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; }
.grid { display: grid; gap: 1.25rem; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }

/* ── Summary tiles ─────────────────────────────────────────── */

.tiles { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); }
.tile {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold-lift);
  border-radius: var(--radius);
  padding: .9rem 1rem;
  text-decoration: none;
  color: inherit;
  display: block;
}
a.tile:hover { border-color: var(--crimson); background: var(--surface); }
.tile dt {
  font-family: var(--f-data);
  font-size: .64rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 .4rem;
}
.tile dd {
  margin: 0;
  font-family: var(--f-display);
  font-size: 1.85rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.tile dd small { font-size: .85rem; color: var(--ink-soft); font-family: var(--f-body); }
.tile--alert { border-left-color: var(--bad); }
.tile--warn { border-left-color: var(--warn); }

/* ── Tables ────────────────────────────────────────────────── */

.table-wrap { overflow-x: auto; }

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}
table.data caption {
  text-align: left;
  padding: .7rem 1.1rem .1rem;
  font-family: var(--f-data);
  font-size: .64rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
table.data th {
  text-align: left;
  font-family: var(--f-data);
  font-size: .64rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 500;
  padding: .55rem .8rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 1;
}
table.data td {
  padding: .55rem .8rem;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}
table.data tbody tr:hover td { background: var(--surface); }
table.data tfoot td, table.data tfoot th {
  border-top: 2px solid var(--line);
  border-bottom: none;
  font-weight: 600;
  background: var(--surface);
  position: static;
}
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mono { font-family: var(--f-data); font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-faint); }
.voided td { opacity: .5; text-decoration: line-through; }
.empty { padding: 2rem 1.1rem; text-align: center; color: var(--ink-faint); font-size: .9rem; }

/* ── Chips ─────────────────────────────────────────────────── */

.chip {
  display: inline-block;
  font-family: var(--f-data);
  font-size: .62rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: .2rem .5rem;
  border-radius: 2px;
  border: 1px solid var(--line);
  color: var(--ink-faint);
  background: var(--surface);
  white-space: nowrap;
}
.chip--ok   { color: var(--ok);   background: var(--ok-sf);   border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.chip--warn { color: var(--warn); background: var(--warn-sf); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.chip--bad  { color: var(--bad);  background: var(--bad-sf);  border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.chip--gold { color: var(--gold); background: transparent; border-color: color-mix(in srgb, var(--gold) 40%, transparent); }

/* ── Forms ─────────────────────────────────────────────────── */

.field { display: flex; flex-direction: column; gap: .25rem; }
.field > label, .lbl {
  font-family: var(--f-data);
  font-size: .64rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
input[type=text], input[type=email], input[type=password], input[type=date],
input[type=number], input[type=search], select, textarea {
  font: inherit;
  font-size: .92rem;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .45rem .6rem;
  width: 100%;
  min-width: 0;
}
input[type=date], input[type=number] { font-variant-numeric: tabular-nums; }
textarea { min-height: 5.5rem; resize: vertical; }
input:disabled, select:disabled, textarea:disabled { background: var(--surface); color: var(--ink-faint); }
input::placeholder { color: var(--ink-faint); }

.field-grid { display: grid; gap: .85rem 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); }
.field-grid .span-2 { grid-column: span 2; }
@media (max-width: 640px) { .field-grid .span-2 { grid-column: span 1; } }

.check { display: flex; align-items: center; gap: .5rem; font-size: .9rem; }
.check input { width: auto; }

button, .btn {
  font: inherit;
  font-size: .88rem;
  font-weight: 500;
  padding: .48rem .95rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  white-space: nowrap;
}
button:hover, .btn:hover { background: var(--surface); border-color: var(--ink-faint); color: var(--ink); }
.btn--primary, button.primary {
  background: var(--crimson);
  border-color: var(--crimson);
  color: #fff;
}
.btn--primary:hover, button.primary:hover { background: var(--crimson-dp); border-color: var(--crimson-dp); color: #fff; }
.btn--quiet { border-color: transparent; background: transparent; color: var(--ink-soft); }
.btn--danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.btn--danger:hover { background: var(--bad-sf); }
.btn--sm { font-size: .78rem; padding: .3rem .6rem; }
button:disabled, .btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Messages ──────────────────────────────────────────────── */

.note {
  padding: .7rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold-lift);
  background: var(--surface-2);
  font-size: .9rem;
}
.note--ok  { border-left-color: var(--ok);  background: var(--ok-sf); }
.note--bad { border-left-color: var(--bad); background: var(--bad-sf); }
.validation, .field-error { color: var(--bad); font-size: .8rem; }
.validation ul { margin: .3rem 0 0; padding-left: 1.1rem; }

/* ── Tabs ──────────────────────────────────────────────────── */

.tabs {
  display: flex;
  gap: .2rem;
  list-style: none;
  margin: 0 0 -1px;
  padding: 0;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
}
.tabs a {
  display: block;
  padding: .55rem .95rem;
  font-size: .88rem;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
}
.tabs a:hover { color: var(--ink); background: var(--surface); }
.tabs a[aria-current="page"] {
  background: var(--surface-2);
  border-color: var(--line);
  color: var(--crimson);
  position: relative;
}
.tabs a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: var(--surface-2);
}

/* ── The register ──────────────────────────────────────────────
   Built for a tablet held at the side of the mat: one big tap target per
   person, state legible at arm's length. The tick is a real checkbox taken
   out of the flow and drawn by its label, so it toggles without JavaScript
   and still answers to the keyboard and a screen reader.
   ───────────────────────────────────────────────────────────── */

/* Each person is their own band with air around it. Butted up against one another
   the tinted states — saved, ticked, owing — ran together into one block of colour. */
.roster {
  list-style: none;
  margin: 0;
  padding: .45rem;
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.roster > li {
  border: 1px solid var(--line-soft);
  border-radius: 2px;
  background: var(--surface-2);
}

.roster__row {
  display: grid;
  grid-template-columns: 3.6rem 3.4rem 1fr 7rem 7.5rem;
  gap: .7rem;
  align-items: center;
  padding: .5rem 1rem;
}

/* The tick */
.tick { justify-self: start; }
.tick input {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap; border: 0;
}
.tick__mark {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: transparent;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  transition: background-color .12s, border-color .12s, color .12s;
}
.tick__mark::before { content: "✓"; }
.tick:hover .tick__mark { border-color: var(--ink-faint); }
.tick input:checked + .tick__mark {
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
}
.tick input:focus-visible + .tick__mark {
  outline: 2px solid var(--crimson);
  outline-offset: 2px;
}
/* A row that is already saved is ticked like any other, but marked along its edge so
   the instructor can tell "I just ticked this" from "this was saved earlier" — and so
   the consequence of unticking it is obvious. */
.roster > li.is-saved:has([data-role="present"]:checked) { border-left: 3px solid var(--ok); }
.roster > li.is-saved .roster__row { padding-left: calc(1rem - 2px); }
.roster > li.is-saved .tick input:not(:checked) + .tick__mark {
  border-color: var(--bad);
  border-style: dashed;
}

.roster__no { font-family: var(--f-data); font-variant-numeric: tabular-nums; color: var(--ink-faint); font-size: .9rem; }
.roster__name { min-width: 0; }
.roster__name strong { font-weight: 600; font-size: 1.02rem; }
.roster__meta { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; margin-top: .15rem; }
.roster__meta .muted { font-size: .78rem; }
.roster__pay { justify-self: end; text-align: right; }
.roster__pay input { width: 6.6rem; text-align: right; font-size: 1rem; padding: .5rem .6rem; }
.roster__paid { justify-self: end; }

/* ── Paid toggle ────────────────────────────────────────────────
   A pill that says which state it is in rather than which state it would move to,
   because at the mat side you read the register, you do not interrogate it. */
.paid { display: block; }
.paid input {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap; border: 0;
}
.paid__pill {
  display: grid;
  place-items: center;
  min-width: 7rem;
  height: 2.6rem;
  padding: 0 .5rem;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  font-family: var(--f-data);
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  cursor: pointer;
  user-select: none;
  transition: background-color .12s, border-color .12s, color .12s;
}
.paid__yes { display: none; }
.paid__no { display: block; }
.paid:hover .paid__pill { border-color: var(--ink-faint); }
.paid input:checked + .paid__pill {
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
}
.paid input:checked + .paid__pill .paid__yes { display: block; }
.paid input:checked + .paid__pill .paid__no { display: none; }
.paid input:focus-visible + .paid__pill { outline: 2px solid var(--crimson); outline-offset: 2px; }
.paid.is-locked .paid__pill { cursor: default; opacity: .55; }

/* A ticked row is unmistakable from a distance; an unticked one reads as absent. */
.roster > li:has([data-role="present"]:checked) { background: var(--ok-sf); }
.roster > li:not(:has([data-role="present"]:checked)) .roster__name strong { color: var(--ink-faint); }

/* Owed money is the one thing on this screen that should nag, so it overrides the
   green — and must stay after it in the file to win on source order. */
.roster > li:has([data-role="present"]:checked):has([data-role="paid"]:not(:checked)) {
  background: var(--warn-sf);
}

.roster__group {
  padding: .5rem .9rem;
  background: var(--surface);
  border-color: var(--line);
  font-family: var(--f-data);
  font-size: .64rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  align-items: center;
  flex-wrap: wrap;
}
.roster > li.roster__group + li { margin-top: 0; }
.roster > li.roster__group:not(:first-child) { margin-top: .5rem; }

@media (max-width: 820px) {
  .roster__row {
    grid-template-columns: 3.6rem 1fr;
    grid-template-areas: "tick name" "tick money";
    row-gap: .55rem;
  }
  .roster__no { display: none; }
  .tick { grid-area: tick; align-self: start; }
  .roster__name { grid-area: name; }
  .roster__pay,
  .roster__paid { grid-area: money; justify-self: start; }
  .roster__pay { margin-right: 8rem; }
  .roster__paid { justify-self: end; }
}

/* The sticky action bar: on a tablet the list is long, and the instructor
   should never have to scroll to the end to save. */
.register-bar {
  position: sticky;
  bottom: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
  padding: .75rem 1rem;
  background: var(--surface-2);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px -18px rgba(0,0,0,.5);
}
.register-bar .count { font-family: var(--f-data); font-size: .8rem; color: var(--ink-soft); }
.register-bar .money {
  font-family: var(--f-data);
  font-size: .8rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
}
.register-bar .money strong { color: var(--ink); }
.register-bar .money .owed { color: var(--bad); }
.save-state {
  font-family: var(--f-data);
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  white-space: nowrap;
}
.save-state[data-state="saving"] { color: var(--warn); }
.save-state[data-state="saved"] { color: var(--ok); }
.save-state[data-state="error"] { color: var(--bad); font-weight: 600; }
.roster > li.is-saving { box-shadow: inset 3px 0 0 var(--warn); }
.roster > li.is-error  { box-shadow: inset 3px 0 0 var(--bad); }
.register-bar .spacer { flex: 1; }
.register-bar button[type=submit] { padding: .6rem 1.4rem; font-size: .95rem; }

.pager { display: flex; gap: .4rem; align-items: center; padding: .7rem 1.1rem; font-size: .82rem; color: var(--ink-faint); flex-wrap: wrap; }
.pager .spacer { flex: 1; }

@media print {
  .banner, .site-head, .foot, .no-print, form.filters { display: none !important; }
  body { background: #fff; }
  .card { border: none; box-shadow: none; }
  main { padding: 0; max-width: none; }
}

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

/* The blank line at the head of the payments ledger. It sits in the table rather than
   on a page of its own, so a night's takings can be typed straight down. */
.entry-row td { background: var(--crimson-sf); vertical-align: middle; padding: .5rem .6rem; }
.entry-row input, .entry-row select { font-size: .88rem; padding: .38rem .5rem; }
.entry-row td:first-child { box-shadow: inset 3px 0 0 var(--crimson); }

/* Money out reads differently from money in without shouting; the ledger is mostly income. */
.num.expense { color: var(--warn); }

/* ── Reconciliation tick ────────────────────────────────────────
   Read-only by default: checking an entry off against the bank is a deliberate act,
   so the control only comes alive in reconcile mode. */
.rec-col { width: 3.2rem; text-align: center; }
.rec { display: inline-block; line-height: 0; }
.rec input {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap; border: 0;
}
.rec__mark {
  display: grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--surface-2);
  color: transparent;
  font-size: 1rem;
  line-height: 1;
}
.rec__mark::before { content: "✓"; }
.rec input:checked + .rec__mark { background: var(--ok); border-color: var(--ok); color: #fff; }
.rec input:disabled + .rec__mark { opacity: .5; }

/* Live only while reconciling. */
.rec.is-live .rec__mark { cursor: pointer; width: 2rem; height: 2rem; border-width: 2px; }
.rec.is-live:hover .rec__mark { border-color: var(--ink-faint); }
.rec.is-live input:focus-visible + .rec__mark { outline: 2px solid var(--crimson); outline-offset: 2px; }

/* Renewal chips carry a date, so they read as words rather than a shouted label. */
.chip--renewal {
  text-transform: none;
  letter-spacing: .01em;
  font-family: var(--f-body);
  font-size: .72rem;
  font-variant-numeric: tabular-nums;
}

/* A tab that is asking for something, rather than merely showing it. */
.tabs a.tab--alert { color: var(--bad); font-weight: 600; }
.tabs a.tab--alert[aria-current="page"] { color: var(--bad); }

/* ── Locked details ─────────────────────────────────────────────────────
   Personal data and money sit behind a second password check, because this app
   is used on a tablet with the club standing round it. */
.tabs a.tab--locked { color: var(--ink-faint); }
.tabs a.tab--locked:hover { color: var(--ink-soft); }

.locked-panel { max-width: 34rem; margin-inline: auto; text-align: center; padding: 2rem 1rem; }
.locked-panel .lock-mark { font-size: 2rem; margin: 0 0 .5rem; opacity: .5; }
.locked-panel h3 { margin: 0 0 .4rem; }
.locked-panel p { margin: 0 0 1rem; }

.unlock-dialog {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--ink);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  width: min(24rem, 92vw);
  text-align: left;
}
.unlock-dialog::backdrop { background: rgba(20, 14, 14, .55); }

/* The grading summary beside the Attendance heading. */
.grading-since {
  font-size: .82rem;
  color: var(--ink-soft);
  padding-left: .9rem;
  border-left: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
.grading-since strong { color: var(--ink); font-weight: 600; }
@media (max-width: 700px) {
  .grading-since { padding-left: 0; border-left: none; }
}
