/* staff.css — the extra styles for the three staff pages: /teacher/, /teacher/report and /academy/.
   It loads AFTER /acct/account.css, which carries the palette, the fonts, the header and footer,
   .panel, .notice, .field, .btn and the focus ring. Everything here is what those three pages need
   on top: wide layout, tables that scroll inside their box, the join-code card, the PIN sheet,
   the dashboard and the print rules.

   No inline <style> and no style= attributes anywhere: style-src is 'self' with no unsafe-inline.
   Written 9 Nov 2026. */

main { flex: 1 1 auto; padding-bottom: 56px; }

.wrap.wide { max-width: 1120px; }

h1 {
  font-family: var(--display);
  font-size: clamp(1.7rem, 5.4vw, 2.3rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 26px 0 6px;
}
h2 {
  font-family: var(--display);
  font-size: clamp(1.18rem, 3.6vw, 1.45rem);
  line-height: 1.25;
  margin: 0 0 12px;
}
h3 { font-size: 1.04rem; margin: 1.8em 0 .5em; }

.lead { margin: 0 0 18px; }
.sub { color: var(--ink-soft); font-size: .95rem; }

/* ---- small building blocks ---- */

.crumbs { margin: 22px 0 0; font-size: .95rem; }
.crumbs a { color: var(--ink-soft); }

.rowbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: baseline;
  justify-content: space-between;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }

.badge {
  display: inline-block;
  font-size: .82rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  white-space: nowrap;
}
.badge.red { background: var(--error-pale, #FBE4E1); border-color: var(--error-line, #E4AFA7); color: #7E1838; }
.badge.green { background: var(--sage-pale); border-color: var(--sage-line, #A9D6BC); color: #0D4F33; }
.badge.blue { background: var(--sky-pale); border-color: var(--sky-line, #AEBEE6); color: #233B7E; }
.badge.amber { background: var(--mustard-pale); border-color: var(--mustard-line, #E3C886); color: #6E4F08; }

.msg { margin: 10px 0 0; font-weight: 700; }
.msg.bad { color: var(--error, #B3291C); }
.msg.good { color: #0D4F33; }
.empty { color: var(--ink-soft); margin: 0; }

/* ---- forms on top of account.css ---- */

select, textarea, input[type=date], input[type=search] {
  font: inherit;
  font-size: 1rem;
  width: 100%;
  max-width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
}
textarea { min-height: 7.5em; line-height: 1.5; resize: vertical; }
select:focus-visible, textarea:focus-visible, input:focus-visible { border-color: var(--sky); }
.field.narrow { max-width: 22rem; }
.btn.small { padding: 7px 14px; font-size: .92rem; }
.btn.danger { background: var(--error, #B3291C); border-color: var(--error, #B3291C); }
.btn.danger:hover { background: #7E1838; border-color: #7E1838; }

/* ---- tables that scroll inside their own box ---- */

.scroller {
  overflow-x: auto;
  max-width: 100%;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--card);
  -webkit-overflow-scrolling: touch;
}
table { border-collapse: collapse; width: 100%; font-size: .96rem; }
table.cols { min-width: 720px; }
table.cols td:first-child, table.cols th:first-child { white-space: nowrap; }
th, td { padding: 9px 12px; text-align: left; border-top: 1px solid var(--line-soft); vertical-align: top; }
thead th { background: var(--paper-2); border-top: 0; white-space: nowrap; font-size: .9rem; }
tbody tr:first-child td { border-top: 1px solid var(--line); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
caption { text-align: left; padding: 10px 12px; color: var(--ink-soft); font-size: .92rem; }

/* ---- the join code card ---- */

.codecard {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 26px;
  align-items: center;
}
.codebox { min-width: 0; }
#code {
  font-family: var(--display);
  font-size: clamp(2.2rem, 11vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: .12em;
  color: var(--clay-dark);
  margin: 0;
  overflow-wrap: anywhere;
}
#qr img { display: block; width: 148px; height: 148px; image-rendering: pixelated; border-radius: 8px; }
.codeway { margin: 6px 0 0; }

/* ---- the PIN sheet ---- */

.pins { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin: 14px 0 0; padding: 0; list-style: none; }
.pincard {
  border: 2px dashed var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: var(--card);
}
.pincard b { display: block; font-family: var(--display); font-size: 1.15rem; font-weight: 600; }
.pincard .p { display: block; font-size: 1.7rem; font-weight: 800; letter-spacing: .16em; font-variant-numeric: tabular-nums; }
.pincard .c { display: block; font-size: .84rem; color: var(--ink-soft); }

/* ---- the roster ---- */

.roster { list-style: none; padding: 0; margin: 0; }
.roster > li { padding: 12px 0; border-top: 1px solid var(--line-soft); display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.roster > li:first-child { border-top: 0; }
.roster .who { font-weight: 700; margin-right: auto; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.roster .seen { color: var(--ink-soft); font-size: .9rem; font-weight: 400; }
.roster .gone { color: var(--ink-soft); font-style: italic; }

/* ---- homework ---- */

.hwlist { list-style: none; padding: 0; margin: 0 0 18px; }
.hwlist > li { padding: 12px 0; border-top: 1px solid var(--line-soft); }
.hwlist > li:first-child { border-top: 0; }
.hwlist h3 { margin: 0 0 2px; }
.picked { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 10px 0 0; }
.picked li { display: flex; gap: 8px; align-items: center; background: var(--sky-pale); border: 1px solid var(--sky-line, #AEBEE6); border-radius: 999px; padding: 4px 6px 4px 12px; font-size: .92rem; }
.results { list-style: none; padding: 0; margin: 10px 0 0; max-height: 17rem; overflow-y: auto; border: 1px solid var(--line-soft); border-radius: 12px; background: var(--card); }
.results li { border-top: 1px solid var(--line-soft); }
.results li:first-child { border-top: 0; }
.results button { display: block; width: 100%; text-align: left; background: none; border: 0; font: inherit; padding: 10px 12px; cursor: pointer; color: inherit; }
.results button:hover { background: var(--clay-pale); }
.results .k { color: var(--ink-soft); font-size: .88rem; }

/* ---- the dashboard ---- */

.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; padding: 0; }
.tabs button {
  font: inherit;
  font-weight: 700;
  padding: 9px 16px;
  border-radius: 999px;
  border: 2px solid var(--line);
  background: var(--card);
  color: var(--ink-soft);
  cursor: pointer;
}
.tabs button:hover { border-color: var(--clay); color: var(--clay-dark); }
.tabs button[aria-pressed=true] { background: var(--clay-dark); border-color: var(--clay-dark); color: #fff; }

button.cell, button.who {
  font: inherit;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  padding: 4px 2px;
  cursor: pointer;
  color: inherit;
  border-radius: 8px;
}
button.cell { text-align: center; font-variant-numeric: tabular-nums; }
button.who { font-weight: 700; }
button.cell:hover, button.who:hover { background: var(--clay-pale); }
td.done { background: var(--sage-pale); }
td.part { background: var(--mustard-pale); }
td.none { color: var(--ink-soft); }

.revisit { color: #7E1838; font-weight: 800; }
tr.flag td { background: var(--error-pale, #FBE4E1); }

.bars { display: flex; gap: 6px; align-items: flex-end; height: 120px; margin: 8px 0 4px; border-bottom: 2px solid var(--line); }
.bars.flat { height: 26px; }
.bars > div { flex: 1 1 0; min-width: 10px; background: var(--sky); border-radius: 6px 6px 0 0; position: relative; }
.barlabels { display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: .78rem; color: var(--ink-soft); }
.barlabels li { flex: 1 1 0; min-width: 10px; text-align: center; overflow-wrap: anywhere; }

.facts { list-style: none; padding: 0; margin: 0; }
.facts li { padding: 8px 0; border-top: 1px solid var(--line-soft); display: flex; gap: 10px; flex-wrap: wrap; }
.facts li:first-child { border-top: 0; }
.facts dfn { font-style: normal; font-weight: 700; min-width: 13rem; }

.twocol { display: grid; gap: 18px; }

@media (min-width: 760px) {
  .twocol { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}

/* ---- print ---- */

@media print {
  .noprint { display: none !important; }
  body.sheet .not-sheet { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .panel, .scroller, .pincard { border-color: #999; background: #fff; box-shadow: none; }
  /* nothing scrolls on paper: let a wide table reflow to the width of the page */
  .scroller { overflow: visible; border: 0; }
  table.cols { min-width: 0; }
  table.cols td:first-child, table.cols th:first-child { white-space: normal; }
  .pins { grid-template-columns: repeat(3, 1fr); }
  table { font-size: 10pt; }
  thead th { background: #eee; }
  a { color: #000; }
}

.intro { color: var(--ink-soft); font-size: .93rem; margin: 0 0 10px; }

/* ---- dark: the same town after sunset. The palette itself comes from /acct/account.css. ---- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .badge.red { color: #FFB8B0; }
  :root:not([data-theme="light"]) .badge.green,
  :root:not([data-theme="light"]) .msg.good { color: #9FE3BE; }
  :root:not([data-theme="light"]) .badge.blue { color: #AFC4FF; }
  :root:not([data-theme="light"]) .badge.amber { color: #F2D79A; }
  :root:not([data-theme="light"]) .revisit { color: #FFB8B0; }
  :root:not([data-theme="light"]) .btn.danger { background: #C0392B; border-color: #C0392B; color: #fff; }
  :root:not([data-theme="light"]) .btn.danger:hover { background: #9E2A1E; border-color: #9E2A1E; color: #fff; }
  :root:not([data-theme="light"]) .tabs button[aria-pressed=true] { color: var(--paper); }
}
