/* Attendance record — /admin/attendance (task 3073).
   Loaded AFTER admin.css and borrows its palette wholesale: this page is read
   indoors on an office desktop like the rest of /admin, so it stays dark. (The
   teacher sheet at /attendance is the light one, because that one is read in
   Florida sun.) Nothing here restyles a shared class; every rule is `ah-`
   scoped, so a change on this page cannot move the other nine. */

/* ---------- the answer box ---------- */
/* Deliberately the loudest thing above the fold. One slightly lighter surface
   and a stronger border, no shadow and no gradient — the emphasis comes from
   size and position, which survives a colour-blind reader and a sunlit screen. */
.ah-ask {
  background: #1b273b; border: 1px solid #475569; border-radius: 14px;
  padding: 14px 16px 12px; margin: 14px 0 18px; max-width: 860px;
}
.ah-ask-lab {
  display: block; font-size: 15px; font-weight: 800; color: #e2e8f0;
  text-transform: none; letter-spacing: 0; margin: 0 0 8px;
}
.ah-ask-row { display: flex; gap: 8px; align-items: stretch; }
.ah-ask-row input {
  flex: 1 1 auto; min-width: 0; font-size: 16px; padding: 11px 13px;
  background: #0b1220; border-color: #475569;
}
.ah-ask-row input::placeholder { color: #7c8ba2; }
.ah-ask-row button { flex: 0 0 auto; min-height: 44px; }
.ah-ask-help { margin: 8px 0 0; max-width: 62ch; line-height: 1.5; }
.ah-ask-help b { color: #cbd5e1; }

/* ---------- answers ---------- */
.ah-ans { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.ah-ans:empty { margin-top: 0; }
.ah-a {
  background: #0f172a; border: 1px solid #334155; border-radius: 12px; padding: 11px 13px;
}
.ah-a-top { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.ah-a-say {
  flex: 1 1 320px; min-width: 0; font-size: 15px; line-height: 1.55; color: #e2e8f0;
  max-width: 72ch;
}
.ah-a-say b { color: #ffffff; font-weight: 700; }
.ah-a-say .t { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ah-a-more { margin: 7px 0 0; font-size: 13px; line-height: 1.5; color: #94a3b8; max-width: 72ch; }
.ah-a-more b { color: #cbd5e1; }
.ah-a-more.warn { color: #fcd34d; }
.ah-a-quote { color: #cbd5e1; font-style: italic; }
.ah-a-act { flex: 0 0 auto; }
.ah-a-act button { padding: 6px 11px; font-size: 12px; }
.ah-a-none { font-size: 14px; color: #94a3b8; line-height: 1.55; max-width: 72ch; }
.ah-a-none b { color: #e2e8f0; }

/* Verdict pills. Colour is a shortcut, never the only signal — each one is a
   word, so "Aboard" and "Not aboard" do not rely on green vs red. */
.ah-v {
  flex: 0 0 auto; display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
}
.ah-v.on { background: #14532d; color: #86efac; }
.ah-v.off { background: #7f1d1d; color: #fecaca; }
.ah-v.unknown { background: #78350f; color: #fcd34d; }
.ah-v.nj { background: #334155; color: #cbd5e1; }
.ah-v.extra { background: #0c4a6e; color: #7dd3fc; }

/* ---------- controls bar ---------- */
.ah-bar {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  padding: 10px 0 2px; border-top: 1px solid #1e293b;
}
.ah-tabs { display: flex; gap: 0; border: 1px solid #334155; border-radius: 9px; overflow: hidden; }
.ah-tab {
  background: #1e293b; color: #cbd5e1; border: 0; border-radius: 0;
  padding: 9px 14px; min-height: 40px; font-size: 13px; font-weight: 700; cursor: pointer;
}
.ah-tab + .ah-tab { border-left: 1px solid #334155; }
.ah-tab[aria-selected="true"] { background: #f59e0b; color: #1e293b; }
.ah-tab:focus-visible, .ah-run-h:focus-visible, .ah-dayrow:focus-visible {
  outline: 2px solid #f59e0b; outline-offset: -2px;
}
.ah-nav { display: flex; gap: 6px; align-items: center; }
.ah-nav button { min-width: 40px; min-height: 40px; font-size: 16px; line-height: 1; }
.ah-nav input[type="date"] { color-scheme: dark; min-height: 40px; cursor: pointer; }
.ah-scope { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.ah-inline-lab { margin: 0; }
.ah-scope select { min-height: 40px; }
.ah-status { min-height: 18px; font-size: 13px; color: #94a3b8; padding: 6px 0; }
.ah-status.err { color: #fca5a5; }

/* ---------- day header ---------- */
.ah-dayh { margin: 6px 0 14px; }
.ah-dayh h2 { margin: 0 0 2px; font-size: 19px; color: #e2e8f0; }
.ah-dayh .ah-sum { font-size: 14px; color: #cbd5e1; }
.ah-dayh .ah-sum b { color: #ffffff; font-size: 16px; }
.ah-dayh .ah-meta { font-size: 12.5px; color: #94a3b8; margin-top: 4px; line-height: 1.5; }
.ah-flags { margin: 10px 0 0; display: flex; flex-direction: column; gap: 6px; max-width: 860px; }
.ah-notices { margin: 10px 0 0; display: flex; flex-direction: column; gap: 6px; max-width: 860px; }

/* ---------- run cards ---------- */
.ah-runs { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 760px) { .ah-runs { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .ah-runs { grid-template-columns: repeat(3, 1fr); } }
.ah-group {
  grid-column: 1 / -1; margin: 10px 0 0; font-size: 12px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .05em; color: #94a3b8;
}
.ah-run { background: #1e293b; border: 1px solid #334155; border-radius: 12px; overflow: hidden; }
/* An open card takes the full row rather than stretching its column: the lists
   inside are name + time + who, which needs width more than it needs company. */
.ah-run.open { grid-column: 1 / -1; border-color: #475569; }
.ah-run.flagged { border-color: #78350f; }
.ah-run-h {
  width: 100%; display: flex; gap: 10px; align-items: center; text-align: left;
  background: none; border: 0; border-radius: 0; padding: 12px 13px; cursor: pointer;
  color: inherit; font: inherit; min-height: 44px;
}
.ah-run-h:hover { background: #263447; }
.ah-sw { flex: 0 0 auto; width: 12px; height: 34px; border-radius: 3px; }
.ah-run-t { flex: 1 1 auto; min-width: 0; }
.ah-run-name { display: block; font-size: 15px; font-weight: 700; color: #e2e8f0; }
.ah-run-st { display: block; font-size: 12.5px; color: #94a3b8; margin-top: 2px; line-height: 1.45; }
.ah-run-st.warn { color: #fcd34d; }
.ah-run-n {
  flex: 0 0 auto; text-align: right; font-variant-numeric: tabular-nums;
  font-size: 16px; font-weight: 800; color: #e2e8f0;
}
.ah-run-n small { display: block; font-size: 11px; font-weight: 600; color: #94a3b8; }
.ah-run.allaboard .ah-run-n { color: #86efac; }
.ah-chev { flex: 0 0 auto; color: #94a3b8; font-size: 13px; }
.ah-run-h[aria-expanded="true"] .ah-chev { color: #fbbf24; }
.ah-chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 13px 11px; }
.ah-chip {
  font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  background: #334155; color: #cbd5e1;
}
.ah-chip.warn { background: #78350f; color: #fcd34d; }
.ah-chip.info { background: #0c4a6e; color: #7dd3fc; }
.ah-chip.good { background: #14532d; color: #86efac; }

.ah-body { padding: 0 13px 13px; border-top: 1px solid #334155; }
.ah-sec { margin-top: 13px; }
.ah-sec h4 {
  margin: 0 0 6px; font-size: 12px; font-weight: 800; color: #cbd5e1;
  text-transform: uppercase; letter-spacing: .04em;
}
.ah-sec h4 .n { color: #94a3b8; font-weight: 700; }
.ah-list { display: flex; flex-direction: column; gap: 1px; }
.ah-row {
  display: flex; gap: 10px; align-items: baseline; justify-content: space-between;
  background: #0f172a; padding: 7px 10px; border-radius: 8px;
}
.ah-row.hit { background: #2a2110; outline: 1px solid #78350f; }
.ah-nm { flex: 1 1 auto; min-width: 0; font-size: 13.5px; color: #e2e8f0; }
.ah-nm .cls {
  font-size: 11px; color: #94a3b8; background: #1e293b; border-radius: 5px;
  padding: 0 5px; margin-left: 6px; white-space: nowrap;
}
.ah-when {
  flex: 0 0 auto; font-size: 12px; color: #94a3b8; text-align: right;
  font-variant-numeric: tabular-nums;
}
.ah-when b { color: #cbd5e1; font-weight: 700; }
.ah-why { font-size: 12px; color: #94a3b8; margin-top: 3px; line-height: 1.45; word-break: break-word; }
.ah-why.chg { color: #fcd34d; }
/* "see why" (task 3090). The amber "New that day" line is unchanged; this is
   the control that fetches the one child's Details text, because the day read
   no longer carries it (task 3088 / J2). Sits INSIDE the amber line at the
   same size as the ledger badge, quieter than it, and only picks up the amber
   once it is open - a bus list where most rows are New must not become a row
   of competing buttons. */
.ah-whyb {
  background: transparent; border: 1px solid #5c4a1f; border-radius: 999px;
  color: #cbd5e1; font-family: inherit; font-size: 11.5px; font-weight: 700;
  padding: 1px 8px; min-height: 22px; line-height: 1.5; cursor: pointer;
  white-space: nowrap; margin-left: 6px; vertical-align: 1px;
}
.ah-whyb:hover { background: #3a2f12; border-color: #92400e; color: #ffffff; }
.ah-whyb[aria-expanded="true"] { background: #78350f; border-color: #92400e; color: #fcd34d; }
.ah-whyb:focus-visible { outline: 2px solid #f59e0b; outline-offset: 1px; }
.ah-note {
  background: #0f172a; border: 1px solid #334155; border-radius: 9px; padding: 9px 11px;
  font-size: 13.5px; color: #e2e8f0; white-space: pre-wrap; line-height: 1.5;
}
.ah-note-by { display: block; font-size: 11.5px; color: #94a3b8; margin-top: 5px; white-space: normal; }
.ah-empty { font-size: 13px; color: #7c8ba2; padding: 4px 0; }

/* ---------- the episode ledger (task 3087) ---------- */
/* The "N records" badge. It was already plain text in exactly this place at
   exactly this size; making it a button must not make it shout, or every row
   with a re-tap starts competing with the sentence that answers the question.
   So: the same 11.5px, a pill the page already uses for chips, and the amber
   only once it is open. */
.ah-rec {
  background: #334155; border: 1px solid #475569; border-radius: 999px;
  color: #cbd5e1; font-family: inherit; font-size: 11.5px; font-weight: 700;
  padding: 1px 8px; min-height: 22px; line-height: 1.5; cursor: pointer;
  white-space: nowrap;
}
.ah-rec:hover { background: #475569; border-color: #64748b; color: #ffffff; }
.ah-rec[aria-expanded="true"] { background: #78350f; border-color: #92400e; color: #fcd34d; }
.ah-rec:focus-visible { outline: 2px solid #f59e0b; outline-offset: 1px; }

/* The row and its panel read as one block, so the row loses its bottom
   rounding only while a panel is under it. */
.ah-rowwrap { display: flex; flex-direction: column; }
.ah-rowwrap > .ah-row { border-radius: 8px 8px 0 0; }
.ah-led {
  background: #0b1220; border: 1px solid #334155; border-top: 0;
  border-radius: 0 0 8px 8px; padding: 9px 11px 10px;
}
/* In an answer card the panel is a free-standing block, not a row's tail. */
.ah-a > .ah-led { border-top: 1px solid #334155; border-radius: 9px; margin-top: 8px; }
/* Sentence case, deliberately: the other headings on this page are one or two
   words ("ABOARD", "NOT ABOARD") and uppercase suits them. This one is a
   sentence that names the scope of the panel, and 60 uppercase characters above
   a paragraph of prose reads as shouting. */
.ah-led-h { margin: 0 0 6px; font-size: 11.5px; font-weight: 700; color: #94a3b8; }
.ah-led-say {
  margin: 0; font-size: 13.5px; line-height: 1.6; color: #e2e8f0; max-width: 78ch;
}
.ah-led-say b { color: #ffffff; font-weight: 700; }
.ah-led-say .t { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ah-led-p { margin: 6px 0 0; font-size: 12.5px; line-height: 1.5; color: #94a3b8; max-width: 78ch; }
.ah-led-p b { color: #cbd5e1; }
.ah-led-p.warn { color: #fcd34d; }
.ah-led-p .t { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ah-led > button.secondary { margin-top: 8px; padding: 6px 11px; font-size: 12px; }

/* ---------- all-days table ---------- */
.ah-tablewrap { overflow-x: auto; }
#days-table td { vertical-align: top; }
#days-table td:first-child, #days-table th:first-child { white-space: nowrap; }
.ah-dayrow { cursor: pointer; }
.ah-dayrow:hover td { background: #263447; }
.ah-month td {
  background: #0b1220; color: #94a3b8; font-size: 11px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .05em; cursor: default;
}
.ah-month:hover td { background: #0b1220; }
.ah-d1 { font-weight: 700; color: #e2e8f0; font-size: 13.5px; }
.ah-d2 { display: block; color: #94a3b8; font-size: 11.5px; }
.ah-marks { display: flex; gap: 5px; flex-wrap: wrap; }
.ah-quiet { color: #7c8ba2; font-size: 12px; }
#days-table td.num { font-variant-numeric: tabular-nums; }
@media (max-width: 560px) {
  #days-table th, #days-table td { padding: 8px 6px; }
  .ah-scope { margin-left: 0; }
  .ah-bar { gap: 8px; }
}

/* ================= THE LIVE DISMISSAL BOARD (task 3105) =================
   Shown only when the day on screen is today. Same dark palette as the rest of
   the page — no new surface colours, no gradients, no glass — because the only
   thing here that should pull the eye is a number that is wrong, and it earns
   that with size, weight and one amber or red border. */

/* ---------- the liveness bar ---------- */
/* FIRST thing in the day view and never sticky-overlapped by anything: the
   whole point is that it cannot be mistaken for decoration or scrolled past
   while the figures below it are being read. */
.ah-live {
  display: flex; gap: 10px 14px; align-items: center; flex-wrap: wrap;
  margin: 2px 0 12px; padding: 9px 13px;
  border: 1px solid #334155; border-left-width: 1px; border-radius: 10px;
  background: #16202f;
}
.ah-live.ok { border-color: #14532d; background: #10231a; }
.ah-live.warn { border-color: #78350f; background: #221a0d; }
.ah-live.bad { border-color: #b91c1c; background: #2a1111; }
.ah-live.off { border-color: #334155; background: #16202f; }
/* STICKY ONLY WHEN STALE (task 3105). The day view is twelve bus cards long,
   so a reader scrolled to the tiles cannot see a bar sitting at the top -- and
   "this stopped updating" is worthless if it is only visible where the reader
   is not. The obvious fix, a permanently sticky bar, is the one the teacher
   page just paid for: chrome in a sticky dock is charged on EVERY screen, and
   task 3106 measured 69px of it costing four roster rows per screen. So it is
   in flow while everything is fine -- which is nearly always -- and pins itself
   to the top only in the state where being missed is dangerous. position:
   sticky does not leave the flow, so nothing jumps when it arms. */
.ah-live.stale { position: sticky; top: 0; z-index: 30; box-shadow: 0 6px 18px rgba(0,0,0,.45); }
.ah-live-state { flex: 1 1 320px; min-width: 0; font-size: 13.5px; line-height: 1.5; color: #cbd5e1; }
.ah-live.ok .ah-live-state { color: #86efac; }
.ah-live.warn .ah-live-state { color: #fcd34d; }
/* The red state is the one that must be unmissable from across a desk. */
.ah-live.bad .ah-live-state { color: #fecaca; font-weight: 700; font-size: 14.5px; }
.ah-live-age {
  flex: 0 0 auto; font-size: 12.5px; color: #94a3b8;
  font-variant-numeric: tabular-nums;
}
.ah-live.bad .ah-live-age { color: #fca5a5; }
.ah-live-age .t { white-space: nowrap; }
.ah-live-act { flex: 0 0 auto; }
.ah-live-btn { min-height: 38px; padding: 8px 14px; font-size: 13px; }
.ah-live-btn.urgent { background: #b91c1c; color: #fff; border-color: #b91c1c; font-weight: 700; }
.ah-live-btn.urgent:hover { background: #dc2626; }

/* ---------- the board ---------- */
.ah-board { margin: 0 0 16px; }
.ah-board-head { margin-bottom: 10px; }
.ah-board-big { font-size: 20px; line-height: 1.3; color: #e2e8f0; }
.ah-board-big b { font-size: 30px; font-weight: 800; color: #fbbf24; margin-right: 2px; }
.ah-board-big.good b { color: #86efac; font-size: 20px; }
.ah-board-sub { margin-top: 3px; font-size: 13px; color: #94a3b8; }
/* When the page has stopped updating, the FIGURES say so too — not just the bar
   above them. Somebody scrolled down to the tiles is looking at the numbers. */
.ah-board.stale { opacity: .72; }
.ah-board-stale {
  margin: 2px 0 10px; padding: 9px 12px; border-radius: 8px;
  background: #2a1111; border: 1px solid #b91c1c;
  color: #fecaca; font-size: 13px; font-weight: 700; line-height: 1.45;
}
.ah-board-group {
  grid-column: 1 / -1; margin: 6px 0 0; font-size: 11.5px; font-weight: 800;
  letter-spacing: .06em; text-transform: uppercase; color: #94a3b8;
}
.ah-board-tiles { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 620px) { .ah-board-tiles { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .ah-board-tiles { grid-template-columns: repeat(3, 1fr); } }
.ah-tilewrap { min-width: 0; }
.ah-tilewrap:has(.ah-tile.open) { grid-column: 1 / -1; }

.ah-tile {
  width: 100%; display: flex; gap: 10px; align-items: center; text-align: left;
  min-height: 56px; padding: 9px 12px; cursor: pointer;
  background: #1e293b; border: 1px solid #334155; border-radius: 11px; color: inherit;
}
.ah-tile:hover { background: #263447; }
.ah-tile:focus-visible { outline: 2px solid #fbbf24; outline-offset: 2px; }
.ah-tile.clear { border-color: #14532d; }
.ah-tile.locked { background: #1a2433; }
/* A bus that LEFT with children never tapped is the finding this board exists
   to surface, so it is the only tile that gets a red edge. */
.ah-tile.gone-short { border-color: #b91c1c; }
.ah-tile.open { border-color: #475569; border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
/* A departure or a reopen, highlighted long enough that a glance ten seconds
   later still catches it. A ring, not a flash: an animation that has finished
   tells a reader who looked away nothing. */
.ah-tile.just { box-shadow: 0 0 0 2px #fbbf24; }
.ah-tile-sw { flex: 0 0 auto; width: 10px; height: 36px; border-radius: 3px; }
.ah-tile-t { flex: 1 1 auto; min-width: 0; }
.ah-tile-name { display: block; font-size: 14.5px; font-weight: 700; color: #e2e8f0; }
.ah-tile-st { display: block; margin-top: 2px; font-size: 12px; color: #94a3b8; line-height: 1.4; }
.ah-tile-st.warn { color: #fcd34d; }
.ah-tile-n {
  flex: 0 0 auto; text-align: right; font-variant-numeric: tabular-nums;
  font-size: 22px; font-weight: 800; color: #fbbf24; line-height: 1.05;
}
.ah-tile.clear .ah-tile-n { color: #86efac; }
.ah-tile.gone-short .ah-tile-n { color: #fca5a5; }
.ah-tile-n small { display: block; font-size: 10.5px; font-weight: 700; color: #94a3b8; letter-spacing: .02em; }
.ah-tile-chev { flex: 0 0 auto; color: #94a3b8; font-size: 12px; }
.ah-tile[aria-expanded="true"] .ah-tile-chev { color: #fbbf24; }

.ah-tile-list {
  padding: 10px 12px 12px; background: #16202f;
  border: 1px solid #475569; border-top: 0;
  border-bottom-left-radius: 11px; border-bottom-right-radius: 11px;
}
.ah-tile-names {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 2px 12px;
}
.ah-tile-nm {
  display: flex; gap: 6px; align-items: baseline; padding: 5px 0;
  font-size: 13.5px; color: #e2e8f0; border-bottom: 1px solid #1e293b;
}
.ah-tile-nm .cls {
  flex: 0 0 auto; font-size: 11px; color: #94a3b8; background: #0b1220;
  padding: 1px 5px; border-radius: 4px;
}
.ah-tile-empty { font-size: 13px; color: #86efac; line-height: 1.5; }
.ah-tile-note { margin-bottom: 8px; font-size: 12.5px; color: #fcd34d; line-height: 1.5; }
.ah-tile-bad {
  margin-bottom: 8px; padding: 7px 10px; border-radius: 7px;
  background: #2a1111; border: 1px solid #b91c1c; color: #fecaca;
  font-size: 12.5px; font-weight: 700; line-height: 1.45;
}
.ah-tile-more { margin-top: 10px; min-height: 38px; font-size: 12.5px; }

/* ---------- as it happened ---------- */
/* Close-out and reopen, written down. A tile changing colour is invisible to
   somebody who looked away for ten seconds; a dated line is not. */
.ah-events { margin-top: 12px; }
.ah-events h4 {
  margin: 0 0 6px; font-size: 11.5px; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; color: #94a3b8;
}
.ah-events-list { display: flex; flex-direction: column; gap: 4px; max-width: 900px; }
.ah-event {
  padding: 7px 10px; border-radius: 7px; font-size: 12.5px; line-height: 1.45;
  background: #16202f; border: 1px solid #334155; color: #cbd5e1;
}
.ah-event.warn { border-color: #78350f; background: #221a0d; color: #fcd34d; }
.ah-event.good { border-color: #14532d; background: #10231a; color: #86efac; }
.ah-event .t {
  font-variant-numeric: tabular-nums; color: #94a3b8; margin-right: 6px; white-space: nowrap;
}

@media (max-width: 560px) {
  /* Eli may well watch a dismissal from the curb. Nothing shrinks below a
     thumb and nothing may overflow sideways. */
  .ah-live { padding: 9px 11px; }
  .ah-live-state { flex: 1 1 100%; }
  /* INLINE while things are fine, FULL WIDTH only when it is the thing to
     press. A permanently full-width button costs ~60px above the fold on a
     375px screen every time the page is opened, to serve a state that is rare
     - the same arithmetic task 3106 applied to the teacher count bar. The
     44px floor holds either way. */
  .ah-live-act { flex: 0 0 auto; }
  .ah-live-btn { width: auto; min-width: 132px; min-height: 44px; }
  .ah-live-btn.urgent { width: 100%; }
  .ah-board-big { font-size: 17px; }
  .ah-board-big b { font-size: 26px; }
  .ah-tile { min-height: 60px; }
  .ah-tile-names { grid-template-columns: 1fr; }
  .ah-tile-more { width: 100%; min-height: 44px; }
}
