:root {
  --brand-primary: #1d4ed8;
  --brand-secondary: #0f172a;
  --brand-accent: #f59e0b;
  --font-heading: 'Sora', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font-body); color: #1e293b; background: #f8fafc; }
h1, h2, h3 { font-family: var(--font-heading); color: var(--brand-secondary); }
a { color: var(--brand-primary); text-decoration: none; }
.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.topbar { background: var(--brand-secondary); color: #fff; padding: 14px 0; }
.topbar .container { display: flex; justify-content: space-between; align-items: center; }
.topbar a { color: #fff; margin-left: 18px; }
.brand { font-family: var(--font-heading); font-weight: 700; font-size: 18px; }
.card { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 24px; margin: 18px 0; }
.btn { display: inline-block; background: var(--brand-primary); color: #fff; border: 0; border-radius: 8px;
       padding: 10px 18px; font-size: 15px; cursor: pointer; font-family: var(--font-body); }
.btn.accent { background: var(--brand-accent); color: #1e293b; }
.btn.danger { background: #dc2626; }
/*
   For an action that is reversible and ordinary.

   Red is a promise that something cannot be undone. Closing a ticket can be —
   there is a Reopen button beside it — and painting it red makes a bursar
   hesitate over the one action that clears their queue.
*/
.btn.quiet { background: #fff; color: #475569; border: 1px solid #cbd5e1; }
.btn.quiet:hover { background: #f8fafc; color: #0f172a; }
/*
   textarea belongs in this rule, and never was.

   It was left out when this file was first written, so every long-answer box
   in both consoles has been rendering as the browser default: a small,
   monospaced, arbitrarily-sized box sitting beside its label instead of under
   it. Nobody reported it because nobody types a paragraph into this software
   very often — the support desk is the first screen where that is the main
   thing you do there.
*/
input, select, textarea { width: 100%; padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 8px;
       font-size: 15px; margin: 6px 0 14px; font-family: var(--font-body); }
textarea { line-height: 1.6; resize: vertical; min-height: 96px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-primary); outline-offset: 1px;
       border-color: transparent; }
/*
   Left inline on purpose. Fourteen screens wrap their control INSIDE the
   label — "<label>Week<input …></label>" — and several of those sit in flex
   rows that were laid out against an inline label. A block label is tidier on
   the two forms I am looking at today and a redesign of the other fourteen,
   which is not what this release is.
*/
label { font-size: 13px; font-weight: 600; color: #475569; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid #e2e8f0; font-size: 14px; }
th { color: #64748b; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.trial { background: #fef3c7; color: #92400e; }
.badge.active { background: #dcfce7; color: #166534; }
.badge.suspended { background: #fee2e2; color: #991b1b; }
.flash { background: #dcfce7; border: 1px solid #86efac; color: #166534; border-radius: 8px; padding: 12px 16px; margin: 14px 0; }
.errors { background: #fee2e2; border: 1px solid #fca5a5; color: #991b1b; border-radius: 8px; padding: 12px 16px; margin: 14px 0; }
.hero { background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
        color: #fff; padding: 72px 0; text-align: center; }
.hero h1 { color: #fff; font-size: 40px; margin: 0 0 12px; }
.hero p { font-size: 18px; opacity: .9; }
.stats { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; padding: 40px 0; }
.stat { background: #fff; border-radius: 12px; padding: 24px 36px; text-align: center; border: 1px solid #e2e8f0; }
.stat b { display: block; font-size: 30px; color: var(--brand-primary); font-family: var(--font-heading); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 760px) { .grid2 { grid-template-columns: 1fr; } .hero h1 { font-size: 28px; } }
.footer { padding: 26px 0; color: #64748b; font-size: 13px; text-align: center; }

/* ============================ ON A PHONE ============================
 *
 * This stylesheet had one mobile rule — a two-column grid becoming one — and
 * everything else was written for a desktop. Measured at 390px, four of the
 * screens a school uses daily scrolled sideways: staff by 78px, admissions by
 * 125px, announcements by 63px and fees by 325px. A page that slides under the
 * thumb is not a cosmetic problem; it is how a bursar loses the column they
 * were reading and gives up on entering fees from a phone.
 *
 * The fix is not to shrink the tables. A register or a fee ledger has the
 * columns it has, and squeezing eight of them into 390px produces something
 * unreadable rather than something usable. So the TABLE scrolls, inside its own
 * box, and the page stays still.
 */
@media (max-width: 760px) {
  /* Room back from the frame: 20px of gutter and 24px of card padding cost
     nearly a quarter of the usable width on a 390px screen. */
  .container { padding: 0 14px; }
  .card { padding: 16px 14px; margin: 14px 0; border-radius: 10px; }

  /*
   * The table scrolls, not the document.
   *
   * display:block lets the table exceed its parent and carry its own scrollbar;
   * nowrap stops the browser destroying the columns to make it fit, which is
   * what produces a register where every name wraps onto four lines.
   */
  .card table, .table-scroll {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }
  .card table th, .card table td { padding: 9px 10px; }

  /* Forms laid out in a row have to be allowed to become a column. */
  form { max-width: 100%; }
  .grid2, .formrow, .filters { display: block; }
  .grid2 > *, .formrow > *, .filters > * { max-width: 100%; }

  /* Nothing with a fixed width may push the page wider than the screen. */
  input, select, textarea, .card > div, .card > form { max-width: 100%; }
  img, svg, canvas, iframe { max-width: 100%; height: auto; }

  /*
   * Buttons big enough to hit. Anything under about 32px square is a target an
   * adult thumb misses, and a mis-hit on a results screen is not a small thing.
   */
  .btn { padding: 11px 16px; min-height: 40px; }

  .topbar .container { flex-wrap: wrap; gap: 8px; }
  .stats { padding: 20px 0; gap: 12px; }
  .stat { padding: 16px 20px; flex: 1 1 140px; }
  .hero { padding: 44px 0; }
}

/* ---------- admissions: the applicant row ----------
 * A flex pair on a desktop; stacked on a phone, because the action column
 * carries a 230px minimum that a 390px screen cannot give it alongside the
 * applicant's details.
 */
.applicant-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.applicant-actions { min-width: 230px; }
@media (max-width: 760px) {
  .applicant-row { display: block; }
  .applicant-actions { min-width: 0; margin-top: 12px; }
  .applicant-actions form > div { flex-wrap: wrap; }
}
