/* Portrait-first: the whole site is capped to a phone-width column and
   centred, so it looks deliberate on a laptop instead of like a stretched
   mobile page. Dads open this on a phone between meetings.

   Colours follow Benicia Middle School: royal blue #0049F3 (sampled from
   bms.beniciaunified.org) with the district's warm gold as a secondary.
   The gold is decorative ONLY — at 2.6:1 on white it fails WCAG AA for
   text, so it never carries anything you have to read. The blue does:
   6.5:1 on white. */

:root {
  --bg: #f6f7f9;
  --card: #fff;
  --ink: #16181d;
  --muted: #666b75;
  --line: #dfe3ea;
  --accent: #0049F3;
  --accent-ink: #fff;
  --gold: #C09A6A;
  --ok: #1e6f4a;
  --warn: #8a4b12;
  --full: #a32a2a;
  --col: 30rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101319;
    --card: #191d26;
    --ink: #e8eaef;
    --muted: #949aa6;
    --line: #2b303b;
    /* #0049F3 is unreadable on a dark ground; this lifted tint holds
       7.6:1 while still reading as the same school blue. */
    --accent: #7FA8FF;
    --accent-ink: #0b1020;
    --gold: #D9B380;
    --ok: #6cc79a;
    --warn: #e0a56a;
    --full: #e58c8c;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}

main {
  width: 100%;
  max-width: var(--col);
  margin: 0 auto;
  padding: 1rem 1rem 3rem;
}

h1 { font-size: 1.3rem; margin: 0 0 .75rem; }
h2 { font-size: 1rem; margin: 0 0 .5rem; }

a { color: var(--accent); }

.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82rem; }
.breakall { word-break: break-all; }

/* ---------------------------------------------------------------- chrome */

.head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .6rem;
  padding: 1rem;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  /* The school gold as a hairline under the header — decoration, so its
     low contrast is fine here. */
  box-shadow: inset 0 -3px 0 -1px var(--gold);
}

.brand {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: .01em;
  text-decoration: none;
  color: var(--ink);
}
.mark { display: block; width: 38px; height: 38px; }

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .25rem .9rem;
  align-items: center;
  font-size: .92rem;
}
.nav a { text-decoration: none; color: var(--muted); }
.nav a.on { color: var(--accent); font-weight: 600; }
.nav form { margin: 0; }

.foot {
  text-align: center; color: var(--muted);
  font-size: .78rem; padding: 2rem 1rem;
}

/* ----------------------------------------------------------------- bits */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
  margin: 1rem 0;
}
.narrow { max-width: 100%; }

.notice {
  padding: .6rem .8rem; border-radius: 10px;
  background: var(--card); border: 1px solid var(--line);
  border-left: 3px solid var(--ok);
}
.notice.warn { border-left-color: var(--warn); }

.announce {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: 10px;
  padding: .7rem .9rem;
  margin-bottom: .6rem;
  white-space: pre-wrap;
}

.tag {
  display: inline-block; font-size: .7rem; text-transform: uppercase;
  letter-spacing: .04em; padding: .1rem .4rem; border-radius: 5px;
  background: var(--line); color: var(--muted);
}
.tag.full { color: var(--full); }
.tag.closed { color: var(--warn); }

/* --------------------------------------------------------------- schedule */

/* Equal side columns rather than space-between: in the first and last
   month one arrow is missing, and flex spacing would shove the title
   off-centre. */
.monthnav {
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; gap: .5rem; margin-bottom: .25rem;
}
.monthnav h1 { margin: 0; text-align: center; font-size: 1.2rem; }
.monthnav a { text-decoration: none; font-size: .82rem; }
.monthnav > :first-child { justify-self: start; }
.monthnav > :last-child { justify-self: end; text-align: right; }
.shiftlabel { margin: 0 0 1rem; text-align: center; font-size: .82rem; }

.days { list-style: none; padding: 0; margin: 0; display: grid; gap: .45rem; }

.day {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .65rem .8rem;
}
.day.mine { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.day.past { opacity: .45; }
.day.closed { opacity: .7; }
.day-date { font-weight: 600; font-size: .95rem; }
.day-who { font-size: .85rem; color: var(--muted); }
.day-note { font-size: .8rem; color: var(--warn); margin-top: .15rem; }
.day-side { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; }
.count { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .88rem; }
.count.is-full { color: var(--full); }

/* ---------------------------------------------------------------- forms */

form { margin: 0; }
.stack { display: grid; gap: .7rem; }
.row { display: flex; flex-wrap: wrap; gap: .7rem; }
.inline { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
label { display: grid; gap: .25rem; font-size: .88rem; color: var(--muted); }
.check { display: flex; align-items: center; gap: .4rem; }

input, textarea, select {
  font: inherit; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 9px; padding: .55rem .65rem;
  width: 100%;
}
input:focus-visible, textarea:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px;
}
/* The width:100% above is meant for text fields; without this a checkbox
   stretches across the whole row and drags its label to the far edge. */
input[type="checkbox"], input[type="radio"] { width: auto; }
input.tiny { width: 4.5rem; }
.notefield { min-width: 7rem; flex: 1; }
textarea { resize: vertical; }

button {
  font: inherit; cursor: pointer; border-radius: 9px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  padding: .45rem .8rem;
}
button.primary, .primary.button {
  background: var(--accent); color: var(--accent-ink);
  border-color: var(--accent); font-weight: 600; text-decoration: none;
  display: inline-block;
}
button.ghost { background: transparent; }
button.small { padding: .25rem .5rem; font-size: .8rem; }
button.danger { color: var(--full); }
button.link {
  border: 0; background: none; color: var(--muted);
  padding: 0; text-decoration: underline; font-size: .92rem;
}

/* ---------------------------------------------------------------- admin */

.stats { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.stat {
  flex: 1 1 6rem; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: .6rem; text-align: center;
}
.stat b { display: block; font-size: 1.4rem; }
.stat span { font-size: .74rem; color: var(--muted); }
.stat.warnstat b { color: var(--warn); }

.adminlinks { list-style: none; padding: 0; display: grid; gap: .5rem; }
.adminlinks li {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: .7rem .9rem; font-size: .87rem; color: var(--muted);
}
.adminlinks a { font-weight: 600; }

/* Roster and admin schedule are card lists rather than tables: in a
   phone-width column a five-column table either clips its action buttons
   or drags the whole page sideways. */
.people { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .5rem; }
.person {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: .7rem .8rem;
  display: grid; gap: .55rem;
}
.person.inactive { opacity: .55; }
.person-id { display: grid; gap: .1rem; min-width: 0; }
.person-name { font-weight: 600; font-size: .95rem; }
.person-id .mono { overflow-wrap: anywhere; }
.person-actions { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.tinylabel {
  display: flex; align-items: center; gap: .3rem;
  font-size: .8rem; color: var(--muted);
}

.cols { display: grid; gap: 1rem; }

.months { display: flex; flex-wrap: wrap; gap: .45rem; font-size: .82rem; }
.months a { text-decoration: none; }
.months a.on { font-weight: 700; text-decoration: underline; }

.announce-list { list-style: none; padding: 0; display: grid; gap: .5rem; }
.announce-row {
  display: flex; gap: .75rem; justify-content: space-between; align-items: start;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: .7rem .9rem; font-size: .9rem;
}
