/* DrewcotechSIS: its own layout rules, coloured by Drewcotech Yummy Design. No inline styles anywhere: the CSP forbids them.
   Pages load wordmark.css ("DrewcotechSIS" in Jost), yummy.css (a copy of C:\Srvr\Projects\YummyDesign\yummy.css; re-copy
   to update), then this file. The variables are aliases of the Yummy roles, so layouts are unchanged and light/dark follow
   the system. The "Yummy layer" at the end restyles the shared pieces. */

:root {
  --brand: var(--md-primary); --brand-2: color-mix(in srgb, var(--md-primary) 70%, #ffffff); --brand-ink: var(--md-on-primary);
  --accent: var(--md-tertiary); --bg: var(--md-surface); --panel: var(--md-surface-container-low); --panel-2: var(--md-surface-container);
  --ink: var(--md-on-surface); --muted: var(--md-on-surface-variant); --line: var(--md-outline-variant);
  --good: var(--md-on-success-container); --good-bg: var(--md-success-container);
  --warn: var(--md-on-tertiary-container); --warn-bg: var(--md-tertiary-container);
  --bad: var(--md-on-error-container); --bad-bg: var(--md-error-container);
  --info: var(--md-on-primary-container); --info-bg: var(--md-primary-container);
  --plan: var(--md-on-secondary-container); --plan-bg: var(--md-secondary-container);
  --focus: var(--md-primary); --radius: var(--shape-xl); --shadow: none;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 var(--font); color: var(--ink); background: var(--bg); min-height: 100vh; }
a { color: var(--brand); }
a:hover { text-decoration: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
h1 { font-size: 1.55rem; margin: 0 0 1rem; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; margin: 1.5rem 0 .75rem; }
h3 { font-size: 1rem; margin: 1.1rem 0 .5rem; }
code, .mono { font-family: var(--mono); font-size: .92em; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.error { color: var(--bad); font-weight: 600; }
.empty { color: var(--muted); font-style: italic; padding: .75rem 0; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: .5rem; z-index: 10; background: var(--panel); padding: .4rem .8rem; border-radius: 6px; }

/* --- brand / top bar ------------------------------------------------------- */
.brand { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; color: inherit; }
.brand-name { font-weight: 600; font-size: 1.2rem; letter-spacing: -.02em; }
.brand-name strong { font-weight: 800; color: var(--brand); }
.topbar {
  display: flex; align-items: center; gap: 1.25rem; padding: .6rem 1.25rem; background: var(--panel);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5;
}
.who { margin-left: auto; display: flex; flex-direction: column; text-align: right; line-height: 1.2; }
.who-name { font-weight: 600; }
.who-role { color: var(--muted); font-size: .82rem; }
.account { display: flex; gap: .9rem; align-items: center; }
form.inline { display: inline; margin: 0; }
button.link { background: none; border: 0; color: var(--brand); font: inherit; cursor: pointer; padding: 0; text-decoration: underline; }

/* --- shell ------------------------------------------------------------------ */
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - 56px); }
.sidenav { background: var(--panel); border-right: 1px solid var(--line); padding: 1rem .6rem; display: flex; flex-direction: column; gap: 2px; }
.sidenav a { display: flex; align-items: center; justify-content: space-between; padding: .5rem .75rem; border-radius: 8px; color: var(--ink); text-decoration: none; font-weight: 500; }
.sidenav a:hover { background: var(--panel-2); }
.sidenav a.active { background: var(--info-bg); color: var(--info); font-weight: 650; }
.count { background: var(--bad); color: #fff; border-radius: 999px; font-size: .72rem; padding: 0 .45rem; font-weight: 700; }
.content { padding: 1.5rem 2rem 3rem; min-width: 0; max-width: 1400px; }
.content.narrow { max-width: 980px; margin: 0 auto; }
.portalnav { display: flex; gap: .25rem; padding: .5rem 1.25rem; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.portalnav a { padding: .4rem .8rem; border-radius: 8px; text-decoration: none; color: var(--ink); font-weight: 500; }
.portalnav a.active { background: var(--info-bg); color: var(--info); }
.foot { color: var(--muted); font-size: .8rem; text-align: center; padding: 1.5rem; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidenav { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: .5rem; }
  .sidenav a { white-space: nowrap; }
  .content { padding: 1rem 1rem 2.5rem; }
  .who { display: none; }
}

/* --- panels and grids ---------------------------------------------------------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem; box-shadow: var(--shadow); margin-bottom: 1.25rem; min-width: 0; }
.panel > h2:first-child, .panel > h3:first-child { margin-top: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.panel-head h2 { margin: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
@media (max-width: 1000px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: .85rem 1rem; box-shadow: var(--shadow); }
.stat .n { font-size: 1.7rem; font-weight: 750; letter-spacing: -.02em; line-height: 1.1; }
.stat .l { color: var(--muted); font-size: .84rem; }
.stat.bad .n { color: var(--bad); }
.stat.warn .n { color: var(--warn); }
.stat.good .n { color: var(--good); }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.spacer { flex: 1; }

/* --- tables -------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 650; background: var(--panel-2); }
tbody tr:hover { background: var(--panel-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.inactive td { color: var(--muted); }
tr.total td { font-weight: 700; border-top: 2px solid var(--line); }

/* --- forms ----------------------------------------------------------------------- */
label { display: block; font-weight: 600; font-size: .88rem; margin: 0 0 .75rem; }
label > input, label > select, label > textarea { margin-top: .25rem; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=time], input[type=number], input[type=search], input:not([type]), select, textarea {
  display: block; width: 100%; padding: .5rem .65rem; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink);
  font: 400 .95rem var(--font);
}
textarea { min-height: 6rem; resize: vertical; }
textarea.tall { min-height: 12rem; }
input[type=checkbox], input[type=radio] { width: 1.05rem; height: 1.05rem; vertical-align: middle; accent-color: var(--brand); }
label.check { display: flex; align-items: center; gap: .45rem; font-weight: 500; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 1rem; }
.form-grid .wide { grid-column: 1 / -1; }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: .75rem 1rem; margin: 0 0 1rem; }
legend { font-weight: 650; padding: 0 .3rem; }
.inline-form { display: flex; gap: .5rem; align-items: flex-end; flex-wrap: wrap; }
.inline-form label { margin: 0; }
.filters { display: flex; gap: .6rem; align-items: flex-end; flex-wrap: wrap; margin-bottom: 1rem; }
.filters label { margin: 0; min-width: 140px; }
.filters .grow { flex: 1; min-width: 220px; }
input.score { width: 4.5rem; padding: .25rem .4rem; text-align: right; display: inline-block; }
input.tiny { width: 5rem; display: inline-block; }
select.compact { width: auto; display: inline-block; padding: .25rem .4rem; }

.button, button.button {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .5rem 1rem; border-radius: 8px; border: 1px solid transparent;
  background: var(--brand); color: var(--brand-ink); font: 600 .9rem var(--font); cursor: pointer; text-decoration: none; min-height: 36px;
}
.button:hover { filter: brightness(1.08); }
.button.secondary { background: var(--panel); color: var(--ink); border-color: var(--line); }
.button.danger { background: var(--bad); color: #fff; }
.button.small { padding: .25rem .65rem; min-height: 28px; font-size: .82rem; }
.button.wide { width: 100%; }
.button[disabled] { opacity: .5; cursor: not-allowed; }

/* --- badges, flashes, alerts --------------------------------------------------------- */
.badge { display: inline-block; padding: .08rem .5rem; border-radius: 999px; font-size: .76rem; font-weight: 650; background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.badge-good { background: var(--good-bg); color: var(--good); border-color: transparent; }
.badge-warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.badge-bad { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.badge-info { background: var(--info-bg); color: var(--info); border-color: transparent; }
.badge-plan { background: var(--plan-bg); color: var(--plan); border-color: transparent; }
.flash { padding: .7rem 1rem; border-radius: 8px; margin-bottom: 1rem; font-weight: 500; }
.flash-ok { background: var(--good-bg); color: var(--good); }
.flash-error { background: var(--bad-bg); color: var(--bad); }
.flash-info { background: var(--info-bg); color: var(--info); }
.flash-warn { background: var(--warn-bg); color: var(--warn); }
.secret { font: 700 1.25rem var(--mono); letter-spacing: .05em; margin: .5rem 0; color: var(--ink); background: var(--panel); padding: .4rem .7rem; border-radius: 6px; display: inline-block; }
.alert { padding: .55rem .9rem; border-radius: 8px; margin: 0 0 .5rem; border-left: 4px solid; }
.alert-medical { background: var(--bad-bg); border-color: var(--bad); }
.alert-legal { background: var(--warn-bg); border-color: var(--warn); }
.alert-behavior { background: var(--plan-bg); border-color: var(--plan); }
.alert-other { background: var(--info-bg); border-color: var(--info); }

/* --- tabs, student header ----------------------------------------------------------------- */
.tabs { display: flex; gap: .2rem; border-bottom: 1px solid var(--line); margin: 0 0 1.25rem; overflow-x: auto; }
.tabs a { padding: .55rem .9rem; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a.active { color: var(--brand); border-bottom-color: var(--brand); }
.student-head { display: flex; gap: 1rem; align-items: center; margin-bottom: .75rem; }
.student-head p { margin: .1rem 0; }
.student-name { margin: 0; font-size: 1.35rem; }
.avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--info-bg); color: var(--info); display: grid; place-items: center; font-weight: 750; font-size: 1.2rem; flex: none; }
.pills { display: flex; gap: .3rem; flex-wrap: wrap; }

dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0; }
dl.kv dt { color: var(--muted); font-weight: 600; font-size: .86rem; }
dl.kv dd { margin: 0; }

/* --- meters ------------------------------------------------------------------------- */
.meter { display: inline-block; width: 70px; height: 8px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; vertical-align: middle; overflow: hidden; }
.meter-fill { display: block; height: 100%; background: var(--good); }
.meter-warn .meter-fill { background: var(--warn); }
.meter-bad .meter-fill { background: var(--bad); }
.w0 { width: 0; } .w1 { width: 5%; } .w2 { width: 10%; } .w3 { width: 15%; } .w4 { width: 20%; } .w5 { width: 25%; } .w6 { width: 30%; }
.w7 { width: 35%; } .w8 { width: 40%; } .w9 { width: 45%; } .w10 { width: 50%; } .w11 { width: 55%; } .w12 { width: 60%; } .w13 { width: 65%; }
.w14 { width: 70%; } .w15 { width: 75%; } .w16 { width: 80%; } .w17 { width: 85%; } .w18 { width: 90%; } .w19 { width: 95%; } .w20 { width: 100%; }

/* --- attendance roll ---------------------------------------------------------------- */
.roll td { vertical-align: middle; }
.codes { display: flex; gap: .25rem; flex-wrap: wrap; }
.codes label { margin: 0; font-weight: 600; font-size: .82rem; }
.codes input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.codes span { display: inline-block; min-width: 2.1rem; text-align: center; padding: .25rem .45rem; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; background: var(--panel); }
.codes input:checked + span { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.codes input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 1px; }
.codes .c-absent input:checked + span { background: var(--bad); border-color: var(--bad); color: #fff; }
.codes .c-tardy input:checked + span { background: var(--warn); border-color: var(--warn); color: #fff; }
.locked { color: var(--muted); font-style: italic; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.cal div { padding: .3rem; font-size: .78rem; border-radius: 6px; background: var(--panel-2); min-height: 2.4rem; }
.cal .hd { background: none; font-weight: 700; color: var(--muted); text-align: center; min-height: auto; }
.cal .d-instructional { background: var(--good-bg); }
.cal .d-minimum { background: var(--info-bg); }
.cal .d-holiday { background: var(--bad-bg); }
.cal .d-non_student { background: var(--warn-bg); }
.cal .d-absent { background: var(--bad); color: #fff; }
.cal .d-partial { background: var(--warn); color: #fff; }
.cal .d-tardy { background: var(--warn-bg); }
.cal .blank { background: none; }

/* --- gradebook ------------------------------------------------------------------- */
.gradebook { font-size: .85rem; }
.gradebook th, .gradebook td { padding: .3rem .4rem; white-space: nowrap; }
.gradebook th.asg { writing-mode: vertical-rl; transform: rotate(180deg); max-height: 9rem; text-transform: none; letter-spacing: 0; font-weight: 600; }
.gradebook td.sticky, .gradebook th.sticky { position: sticky; left: 0; background: var(--panel); z-index: 1; }
.gradebook .missing { background: var(--bad-bg); }
.gradebook .exempt { color: var(--muted); font-style: italic; }
.gradebook .late { background: var(--warn-bg); }

/* --- plain pages ------------------------------------------------------------------- */
.center-card { min-height: calc(100vh - 80px); display: grid; place-items: center; padding: 1rem; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 2rem; width: 100%; max-width: 420px; box-shadow: var(--shadow); }
.card h1 { margin-top: 1.25rem; font-size: 1.35rem; }
.card .brand { margin-bottom: .25rem; }
details { margin: .5rem 0; }
summary { cursor: pointer; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.list-plain { list-style: none; padding: 0; margin: 0; }
.list-plain li { padding: .45rem 0; border-bottom: 1px solid var(--line); }
.timeline li { padding: .5rem 0 .5rem .9rem; border-left: 3px solid var(--line); margin-left: .3rem; list-style: none; }
.message-body { white-space: pre-wrap; background: var(--panel-2); padding: 1rem; border-radius: 8px; }
.doc h2 { border-bottom: 1px solid var(--line); padding-bottom: .3rem; }
.doc .narrative { white-space: pre-wrap; }
.print-only { display: none; }

@media print {
  .topbar, .sidenav, .portalnav, .foot, .tabs, .no-print, form, .button { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; max-width: none; }
  .panel { box-shadow: none; border: 0; padding: 0; }
  .print-only { display: block; }
  body { background: #fff; color: #000; font-size: 11pt; }
  a { color: #000; text-decoration: none; }
}

/* --- Drewcotech app switcher and the Drewcotech for Education button ------- */
.appswitch { display: flex; gap: .2rem; }
.appswitch a { padding: .3rem .65rem; border-radius: 8px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: .88rem; }
.appswitch a:hover { background: var(--panel-2); color: var(--ink); }
.button.edu { background: #4338ca; color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .button.edu { background: #a5b4fc; color: #11132a; } }
@media (max-width: 860px) { .appswitch { display: none; } }

/* ---------------------------------------------------------------------------------------------------------------
   Yummy layer: shared pieces in Drewcotech Yummy Design (layouts, gradebook, attendance codes and calendar unchanged)
   --------------------------------------------------------------------------------------------------------------- */
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--md-surface) 88%, transparent); backdrop-filter: blur(14px); border: 0; box-shadow: none; view-transition-name: yd-bar; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--md-on-surface); }
.brand img { display: none; }
.brand-name, .brand-name strong { font: 400 1.6rem/1 var(--font-brand); letter-spacing: .005em; color: var(--md-on-surface); }
.appswitch a { padding: 10px 14px; border-radius: var(--shape-full); color: var(--md-on-surface-variant); font-weight: 560; text-decoration: none;
  transition: background .2s var(--ease), color .2s var(--ease), border-radius .35s var(--spring); }
.appswitch a:hover { background: color-mix(in srgb, var(--md-on-surface) 8%, transparent); color: var(--md-on-surface); }
.sidenav { background: var(--md-surface-container-low); border: 0; border-radius: var(--shape-xl); padding: 10px; margin: 12px; align-self: start; }
.sidenav a { border-radius: var(--shape-full); padding: 12px 16px; font-weight: 560; transition: background .2s var(--ease), color .2s var(--ease), border-radius .35s var(--spring); }
.sidenav a:hover { background: color-mix(in srgb, var(--md-on-surface) 8%, transparent); }
.sidenav a:active { border-radius: var(--shape-md); }
.sidenav a.active { background: var(--md-secondary-container); color: var(--md-on-secondary-container); view-transition-name: yd-rail-current; }
.portalnav a { border-radius: var(--shape-full); }
.portalnav a.active { background: var(--md-secondary-container); color: var(--md-on-secondary-container); }
.content { view-transition-name: yd-content; }
.panel, .card { border: 0; border-radius: var(--shape-xl); box-shadow: none; }
.center-card .card { background: var(--md-surface-container-lowest); border-radius: var(--shape-xxl); box-shadow: 0 1px 2px rgb(0 0 0 / .06), 0 12px 40px rgb(0 0 0 / .08); }
.stat { border: 0; border-radius: var(--shape-xl); background: var(--md-surface-container-low); }
.button, button.button { border: 0; border-radius: var(--shape-full); min-height: 42px; padding: 0 20px; font-weight: 620;
  transition: background .2s var(--ease), border-radius .4s var(--spring), transform .4s var(--spring-fast); }
.button:active { border-radius: var(--shape-md); transform: scale(.97); }
.button.secondary { background: var(--md-secondary-container); color: var(--md-on-secondary-container); }
.button.small { min-height: 32px; padding: 0 14px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=time], input[type=number], input[type=search], input:not([type]), select, textarea {
  border-radius: var(--shape-md); border-color: var(--md-outline); }
.badge { border: 0; border-radius: var(--shape-full); }
.flash, .alert { border: 0; border-radius: var(--shape-lg); }
.flash-ok { background: var(--md-inverse-surface); color: var(--md-inverse-on-surface); }
.tabs { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--md-surface-container); border: 0; border-radius: var(--shape-full); }
.tabs a { border: 0; border-radius: var(--shape-full); padding: 9px 18px; margin: 0; }
.tabs a.active { background: var(--md-primary); color: var(--md-on-primary); view-transition-name: yd-tab-current; }
.table-wrap { border: 0; border-radius: var(--shape-xl); }
.avatar { border-radius: 42% 58% 63% 37% / 41% 44% 56% 59%; }
.meter { border-radius: var(--shape-full); background: var(--md-surface-container-highest); }
.meter-fill { border-radius: var(--shape-full); }
@media print { .topbar, .sidenav { display: none !important; } }