:root {
  /* Pacifica brand (Logo + Branding Guide, 2023). Same values and names as Hall Pass's stylesheet. */
  --brand: #0d3160;        /* Pacifica Navy, web */
  --brand-2: #1a4a86;      /* lighter navy for hovers */
  --accent: #279b44;       /* Pacifica Green, web */
  --sky: #5fa0bb;
  --mist: #ccdde7;
  --silver: #c8cbc8;
  --bg: #f3f6f8;
  --surface: #ffffff;
  --surface-2: #edf2f5;
  --text: #14233a;
  --muted: #59625a;        /* brand gray (#798079), darkened for readable small text */
  --border: #d9e1e6;
  --ok: #1f7f38;
  --ok-bg: #e4f3e8;
  --warn: #a35f00;
  --warn-bg: #fff3dc;
  --over: #c0262d;
  --over-bg: #fde8e8;
  --link: #1a4a86;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(13, 49, 96, .06), 0 2px 8px rgba(13, 49, 96, .07);
  /* Gotham Narrow is the school's typeface; the guide names Inter as its stand-in, and Cormorant Bold caps for the wordmark. */
  --font: "Gotham Narrow", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --display: "Cormorant", "Trajan Pro", Georgia, serif;
  font-family: var(--font);
  color: var(--text);
  -webkit-text-size-adjust: 100%;
}
@media (prefers-color-scheme: dark) {
  :root:not(.light) {
    --bg: #08162b; --surface: #0f2240; --surface-2: #16305a; --text: #e8eef5; --muted: #a7b4c4;
    --border: #23406b; --ok: #4cc06a; --ok-bg: #12321f; --warn: #f0b04a; --warn-bg: #3a2a0c;
    --over: #ff6b6b; --over-bg: #3d1515; --brand-2: #2a5ea3; --link: #8cc4ff;
    --shadow: 0 1px 2px rgba(0,0,0,.4);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); }
body { min-height: 100vh; font-size: 15px; line-height: 1.5; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
a { color: var(--link); }
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.wordmark { font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; line-height: 1; }

/* top bar: white crest, PACIFICA wordmark, the app's name under it */
.topbar {
  display: flex; align-items: center; gap: 16px; padding: 12px 24px; background: var(--brand); color: #fff;
  position: sticky; top: 0; z-index: 10; flex-wrap: wrap;
}
.topbar .brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.topbar .brand img { height: 36px; filter: brightness(0) invert(1); }
.topbar .brand .wordmark { font-size: 22px; }
.topbar .brand .app-name { font-size: 11px; text-transform: uppercase; letter-spacing: .2em; opacity: .8; font-weight: 600; margin-top: 3px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #4cd471; display: inline-block; }
.live-dot.off { background: #f28b82; }
.topbar nav.main-nav { margin-left: auto; display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.topbar nav.main-nav a {
  color: #fff; opacity: .8; text-decoration: none; font-weight: 600; font-size: 14px; padding: 6px 12px; border-radius: 99px;
}
.topbar nav.main-nav a:hover { opacity: 1; background: rgba(255,255,255,.08); }
.topbar nav.main-nav a.active { opacity: 1; background: rgba(255,255,255,.16); }

/* account: initials in a circle; a click opens the name and Sign out */
details.account { position: relative; }
details.account summary { list-style: none; cursor: pointer; }
details.account summary::-webkit-details-marker { display: none; }
.avatar {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.16);
  color: #fff; font-weight: 700; font-size: 13px; letter-spacing: .03em;
}
details.account[open] .avatar, details.account summary:hover .avatar { background: rgba(255,255,255,.28); }
details.account .menu {
  position: absolute; right: 0; top: 44px; min-width: 220px; background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.18); padding: 12px; z-index: 20;
  display: flex; flex-direction: column; gap: 10px;
}
details.account .menu button { width: 100%; }

/* tabs between the pages of one section (Attendance, Settings) */
nav.tabs.section-tabs { margin-bottom: 18px; }

main { max-width: 1040px; margin: 0 auto; padding: 20px 24px 60px; }
@media (max-width: 700px) {
  .topbar { padding: 10px 16px; position: static; gap: 10px; }
  .topbar nav.main-nav { order: 3; width: 100%; margin-left: 0; }
  details.account { margin-left: auto; }
  main { padding: 16px 16px 60px; }
}

/* cards */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 20px; margin-bottom: 16px;
}
.card h2 { font-size: 16px; margin-bottom: 4px; }
.card h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; margin: 20px 0 4px; }
.card p { margin: 8px 0; }
.card p.help { margin: 0 0 14px; color: var(--muted); max-width: 70ch; }

/* buttons and inputs */
button, .button {
  border: 1px solid var(--brand); background: var(--brand); color: #fff; border-radius: 10px;
  padding: 8px 14px; cursor: pointer; font-weight: 600; font-size: 14px; white-space: nowrap;
  text-decoration: none; display: inline-block; transition: transform .05s, background .15s;
}
button:hover, .button:hover { background: var(--brand-2); border-color: var(--brand-2); }
button:active, .button:active { transform: scale(.97); }
button:disabled { opacity: .5; cursor: default; }
button.quiet, .button.quiet { background: var(--surface); border-color: var(--border); color: var(--text); }
button.quiet:hover, .button.quiet:hover { background: var(--surface-2); border-color: var(--border); }
input, select {
  border: 1px solid var(--border); background: var(--surface); border-radius: 10px; padding: 8px 12px;
  font-size: 14px; min-width: 0; color: var(--text);
}
input::placeholder { color: var(--muted); }
input:focus, select:focus { outline: 2px solid var(--brand-2); outline-offset: -1px; }
label { display: inline-flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); font-weight: 600; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-top: 12px; }

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted);
  padding: 10px 12px 10px 0; border-bottom: 1px solid var(--border);
}
td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.num { font-variant-numeric: tabular-nums; }
tr.off td { color: var(--muted); }

/* status */
.pill {
  display: inline-flex; align-items: center; border-radius: 99px; padding: 2px 10px; font-size: 12px;
  font-weight: 700; background: var(--surface-2); color: var(--muted); white-space: nowrap;
}
.pill.good { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--over-bg); color: var(--over); }
.card p.notice { margin: 8px 0; }
.notice { background: var(--warn-bg); color: var(--warn); padding: 10px 12px; border-radius: 10px; font-weight: 600; margin-bottom: 16px; }
.notice.error { background: var(--over-bg); color: var(--over); }
code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; font-size: 13px; word-break: break-all; }

/* sign-in: navy page, white card, the full logo. The full logo has solid white details, so this page stays light. */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--brand); }
.login-card {
  background: var(--surface); border-radius: 22px; padding: 32px; width: min(440px, 100%);
  box-shadow: 0 20px 60px rgba(0,0,0,.25); text-align: center;
}
.login-card .logo { width: 100%; max-width: 300px; display: block; margin: 4px auto 18px; }
.login-card h1 { font-size: 15px; text-transform: uppercase; letter-spacing: .2em; color: var(--muted); margin-bottom: 18px; }
.login-card .button { display: block; padding: 12px; }
.login-card .people { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }

/* caseload screen */
.row.head { align-items: flex-start; margin-top: 0; gap: 20px; }
.row.filters { margin-top: 0; margin-bottom: 12px; }
.grow { flex: 1; min-width: 220px; }
label.check { flex-direction: row; align-items: center; gap: 8px; padding-bottom: 8px; font-weight: 500; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-top: 14px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.stat .label { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.stat .value { font-size: 28px; font-weight: 800; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat.warn .value { color: var(--warn); }
.stat.bad .value { color: var(--over); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-block; border-radius: 8px; padding: 3px 9px; font-size: 13px; background: var(--surface-2);
  color: var(--text); white-space: nowrap;
}
.chip.warn { background: var(--warn-bg); color: var(--warn); font-weight: 600; }
.chip.bad { background: var(--over-bg); color: var(--over); font-weight: 600; }

.card p.notice button { margin-left: 4px; }
.card p.notice { font-weight: 500; }

.notice.good { background: var(--ok-bg); color: var(--ok); }
tr.form-row td { background: var(--surface-2); padding: 4px 14px 14px; border-radius: 10px; }
tr.form-row label.check { padding-bottom: 0; color: var(--text); }

/* tabs on the caseload screen: Attendance | Grades */
nav.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
nav.tabs a { padding: 10px 14px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 14px; border-bottom: 3px solid transparent; }
nav.tabs a.active { color: var(--text); border-bottom-color: var(--accent); }
td.neg { color: var(--over); font-weight: 600; }
td.pos { color: var(--ok); font-weight: 600; }
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable:hover, th.sorted { color: var(--text); }

/* student page */
h2.name { font-size: 22px; }
.stat .value.small { font-size: 20px; }
button.count { padding: 2px 10px; border-radius: 99px; font-size: 13px; background: var(--surface-2); border-color: transparent; color: var(--text); }
button.count.bad { background: var(--over-bg); color: var(--over); }
button.count.warn { background: var(--warn-bg); color: var(--warn); }
button.small { padding: 3px 10px; font-size: 13px; margin-left: 8px; }
.label-row { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; padding: 8px 0 2px; }
table.inner td { border-bottom: 1px solid var(--border); padding: 6px 12px 6px 0; }
table.inner tr:last-child td { border-bottom: 0; }
.nowrap { white-space: nowrap; }
svg.chart { width: 100%; height: auto; display: block; }
svg.chart .grid { stroke: var(--border); stroke-width: 1; }
svg.chart .axis { fill: var(--muted); font-size: 12px; font-family: var(--font); }
.chips.legend { margin-top: 10px; }
button.chip { border: 1px solid var(--border); background: var(--surface); color: var(--text); font-weight: 500; padding: 4px 10px; border-radius: 99px; font-size: 13px; }
button.chip:hover { background: var(--surface-2); border-color: var(--border); }
button.chip.off { opacity: .45; text-decoration: line-through; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.note-form { background: var(--surface-2); border-radius: 12px; padding: 4px 14px 14px; margin-bottom: 16px; }
.note-form textarea { width: 100%; font: inherit; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); resize: vertical; }
.note { border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; margin-bottom: 10px; }
.note-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: 14px; }
.note p { margin: 6px 0 0; white-space: pre-wrap; }
a.student { color: var(--text); text-decoration: none; }
a.student:hover { text-decoration: underline; color: var(--link); }
.results a { display: block; padding: 8px 12px; border-radius: 8px; text-decoration: none; color: var(--text); }
.results a:hover { background: var(--surface-2); }
.stat.good .value { color: var(--ok); }
.dots { display: inline-flex; gap: 5px; align-items: center; font-size: 13px; color: var(--muted); }
.dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--border); display: inline-block; }
.dot.on { background: var(--accent); border-color: var(--accent); }
p.rule { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 6px 0; }
.value .then { font-size: .7em; font-weight: 700; color: var(--muted); }

/* D and F report */
.wide { width: 100%; font: inherit; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); }
textarea.wide { resize: vertical; line-height: 1.5; }
label.block { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.draft { border: 1px solid var(--border); border-radius: 12px; margin-bottom: 10px; }
.draft.open { border-color: var(--brand-2); }
.draft-head { display: flex; gap: 12px; align-items: flex-start; padding: 10px 14px; }
.draft-head input[type=checkbox] { margin-top: 4px; }
.draft-body { padding: 0 14px 14px 40px; }
.draft-body h3:first-child { margin-top: 0; }
.row.months { gap: 6px 12px; align-items: center; }
.row.months label.check { padding-bottom: 0; }
.row.tight { margin-top: 0; gap: 6px; flex-wrap: nowrap; }
div.small, .muted.small { font-size: 13px; }

.chart-wrap { position: relative; }
svg.chart .guide { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.chart-tip { position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--shadow); padding: 8px 12px; font-size: 13px; line-height: 1.6; white-space: nowrap; z-index: 2; }
.chart-tip strong { display: block; margin-bottom: 2px; }
p.class-check button { margin-left: 8px; }
.chip.off-chip { background: var(--surface-2); color: var(--muted); text-decoration: line-through; }
button.link-button { background: none; border: 0; padding: 0; margin-left: 6px; color: var(--link); font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: underline; }
button.link-button:hover { background: none; }

/* the printable attendance contract, laid out like the school's own */
body.paper { background: #fff; }
.print-bar { max-width: 780px; margin: 16px auto 0; padding: 0 24px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.print-bar + .notice, .print-bar ~ .notice { max-width: 732px; margin: 12px auto; }
.contract-editor { max-width: 732px; margin: 12px auto; background: var(--surface-2); border-radius: 12px; padding: 14px 18px; }
main.contract { max-width: 780px; color: #111; font-family: "Times New Roman", Georgia, serif; font-size: 16px; line-height: 1.45; }
main.contract .logo { width: 200px; display: block; margin: 8px auto 14px; }
main.contract h1 { font-size: 18px; text-align: center; letter-spacing: .02em; margin: 6px 0 20px; font-family: inherit; }
main.contract h3 { font-size: 16px; margin: 18px 0 6px; color: #111; text-transform: none; letter-spacing: 0; font-family: inherit; }
main.contract p.field { margin: 0 0 12px; }
main.contract p.terms { margin: 0 0 8px; }
main.contract ol, main.contract ul { margin: 4px 0 8px; padding-left: 40px; }
main.contract li { margin: 2px 0; }
ol.dates { columns: 2; font-size: 14px; }
.signatures { margin-top: 30px; display: flex; flex-direction: column; gap: 26px; }
.sign-row { display: flex; gap: 28px; }
.sign { display: flex; align-items: flex-end; gap: 8px; flex: 1; }
.sign.date { flex: 0 0 200px; }
.sign .rule { flex: 1; border-bottom: 1px solid #111; height: 1.2em; }
@media print {
  .print-bar, .notice, .contract-editor { display: none !important; }
  main.contract { padding: 0; max-width: none; font-size: 12pt; }
  main.contract h3 { break-after: avoid; }
  .signatures { break-inside: avoid; }
}
a.neg { color: var(--over); font-weight: 600; }

/* page titles, folding cards and "How this works" */
.card h1 { font-size: 20px; }
.title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.title-row .push { margin-left: auto; }
.card .row.head h1 + p.help, .card h1 + p.help { margin-top: 2px; }
details.fold { padding: 0; }
details.fold > summary {
  list-style: none; cursor: pointer; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; padding: 16px 20px;
}
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary h2 { margin: 0; }
details.fold > summary::before { content: "▸"; color: var(--muted); font-size: 16px; line-height: 1; transition: transform .15s; display: inline-block; }
details.fold[open] > summary::before { transform: rotate(90deg); }
details.fold > summary:hover h2 { color: var(--link); }
details.fold .fold-body { padding: 0 20px 18px; }
details.about { margin: 4px 0 12px; font-size: 14px; }
details.about summary { cursor: pointer; color: var(--link); font-weight: 600; font-size: 13px; width: fit-content; }
details.about p { margin: 6px 0 0; color: var(--muted); max-width: 75ch; }
