/* Attendance Desk — the look of a departmental register: ink-blue writing, ruled lines, a red margin. */
:root {
  --paper: #fbfcfe; --surface: #ffffff; --ink: #1f2a5a; --text: #22283a; --muted: #5b6578; --rule: #d9e2f1; --rule-strong: #b8c6de;
  --margin: #c0392b; --done: #2f6d4f; --pending: #a16207; --info: #2c5aa0; --focus: #1d4ed8;
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --sans: system-ui, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
  font-family: var(--sans); font-size: 16px; color: var(--text); background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; line-height: 1.5; }
a { color: var(--ink); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.practice { background: #fff7e0; border-bottom: 1px solid #ecd28f; color: #5c4300; padding: .45rem 1rem; font-size: .92rem; }
.practice button { margin-left: .6rem; }
body.locked .side { display: none; }
body.locked .shell { grid-template-columns: minmax(0, 1fr); }
body.locked main { margin: 0 auto; }
.lockbox { max-width: 30rem; margin: 3.5rem auto; background: var(--surface); border: 1px solid var(--rule-strong); border-left: 4px solid var(--margin); border-radius: 6px; padding: 1.6rem 1.8rem; }
.lockbox h1 { font-size: 1.7rem; }
.lockbox input { max-width: none; }
.lockbox details { margin-top: 1.2rem; color: var(--muted); }
.lockbtn { margin-top: auto; background: transparent; border: 1.5px solid #b9c4e3; color: #fff; align-self: flex-start; }
.lockbtn:hover { background: rgba(255,255,255,.1); }
.build { color: #8f9bc0; font-size: .75rem; margin-top: .4rem; }
input[type=password] { font: inherit; color: inherit; padding: .45rem .55rem; border: 1px solid #9fb0cc; border-radius: 4px; background: #fff; width: 100%; max-width: 38rem; }
.shell { display: grid; grid-template-columns: 15.5rem minmax(0, 1fr); min-height: calc(100vh - 2.2rem); }
main { min-width: 0; }
.side { background: var(--ink); color: #e6ebf7; padding: 1.2rem 1rem; display: flex; flex-direction: column; gap: .35rem; }
.brand { font-family: var(--serif); font-size: 1.35rem; color: #fff; margin-bottom: 1rem; line-height: 1.2; }
.brand span { display: block; font-family: var(--sans); font-size: .82rem; color: #b9c4e3; margin-top: .25rem; }
.side a { color: #e6ebf7; text-decoration: none; padding: .4rem .55rem; border-radius: 4px; display: block; }
.side a small { color: #aab6d8; font-size: .78rem; margin-left: .25rem; }
.side a:hover { background: rgba(255,255,255,.08); }
.side a[aria-current="page"] { background: #fff; color: var(--ink); font-weight: 600; }
.side a[aria-current="page"] small { color: var(--muted); }
.steps { list-style: none; counter-reset: step; margin: .4rem 0; padding: 0; border-left: 2px solid rgba(255,255,255,.18); }
.steps li { counter-increment: step; }
.steps a::before { content: counter(step); display: inline-grid; place-items: center; width: 1.45rem; height: 1.45rem; border-radius: 50%; border: 1.5px solid currentColor; margin-right: .5rem; font-size: .8rem; font-weight: 700; }
main { padding: 1.6rem 2rem 4rem; max-width: 72rem; width: 100%; }
h1 { font-family: var(--serif); font-weight: 600; font-size: 2rem; color: var(--ink); margin: 0 0 .3rem; line-height: 1.2; }
h2 { font-family: var(--serif); font-weight: 600; font-size: 1.35rem; color: var(--ink); margin: 2rem 0 .6rem; }
h3 { font-size: 1.02rem; margin: 1.2rem 0 .4rem; }
p, li { max-width: 70ch; }
.lead { color: var(--muted); margin: 0 0 1.4rem; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.panel { background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; padding: 1rem 1.2rem; margin: 0 0 1.2rem; }
.panel > h2:first-child, .panel > h3:first-child { margin-top: 0; }
label { display: block; margin: 0 0 .75rem; }
label > span { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .2rem; }
input[type=text], input[type=email], input[type=url], input[type=date], input[type=number], input[type=tel], select, textarea {
  font: inherit; color: inherit; padding: .45rem .55rem; border: 1px solid #9fb0cc; border-radius: 4px; background: #fff; width: 100%; max-width: 38rem; }
textarea { min-height: 14rem; line-height: 1.45; }
.row { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: flex-end; }
.row > label { flex: 1 1 12rem; }
button, .btn { font: inherit; border: 1px solid var(--ink); background: var(--ink); color: #fff; padding: .45rem .9rem; border-radius: 4px; cursor: pointer; text-decoration: none; display: inline-block; }
button.secondary, .btn.secondary { background: #fff; color: var(--ink); }
button.danger { background: #fff; color: var(--margin); border-color: var(--margin); }
button.small { padding: .2rem .55rem; font-size: .88rem; }
button:disabled { opacity: .5; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; margin: .8rem 0; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { text-align: left; padding: .45rem .55rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-weight: 600; color: var(--muted); font-size: .85rem; border-bottom: 1.5px solid var(--rule-strong); }
.scroll { overflow-x: auto; }
.edit td { padding: .25rem .3rem; } .edit input, .edit select { max-width: none; }
/* The register page: ruled rows and a red margin line before the class column */
.register { background: var(--surface); border: 1px solid var(--rule-strong); border-radius: 6px; overflow-x: auto; }
.register table td, .register table th { border-bottom-color: var(--rule); }
.register table td.cls, .register table th.cls { border-left: 2px solid var(--margin); padding-left: .8rem; }
.register tr.open td { background: #f4f7fd; }
.chip { display: inline-block; padding: .08rem .55rem; border-radius: 999px; font-size: .82rem; font-weight: 600; white-space: nowrap; border: 1.5px solid; }
.chip.complete { color: var(--done); border-color: var(--done); background: #eef7f2; }
.chip.incomplete, .chip.returned { color: var(--pending); border-color: var(--pending); background: #fdf6e7; }
.chip.not_started { color: var(--margin); border-color: var(--margin); background: #fdeeee; }
.chip.no_classes_reported, .chip.not_required { color: var(--muted); border-color: #9aa3b5; background: #f3f4f7; border-style: dashed; }
.chip.late { color: var(--margin); border-color: var(--margin); background: #fff; }
.tag { font-size: .82rem; color: var(--muted); }
.low { color: var(--margin); font-weight: 600; }
.summary { display: flex; flex-wrap: wrap; gap: .4rem 1.8rem; margin: .4rem 0 1rem; }
.summary div b { display: block; font-family: var(--serif); font-size: 1.7rem; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.1; }
.summary div { font-size: .9rem; color: var(--muted); }
.issues { margin: .3rem 0 .8rem 1.1rem; padding: 0; }
.issues li { margin: .15rem 0; }
.issues .t { font-weight: 600; }
.msg { font-family: var(--sans); white-space: pre-wrap; }
.notice { border-left: 4px solid var(--info); background: #f2f6fd; padding: .6rem .9rem; margin: .8rem 0; border-radius: 0 4px 4px 0; }
.notice.warn { border-color: var(--pending); background: #fdf8ec; }
.notice.bad { border-color: var(--margin); background: #fdf0ef; }
.drop { border: 2px dashed var(--rule-strong); border-radius: 6px; padding: 1.4rem; text-align: center; background: #f8faff; }
.drop.over { border-color: var(--ink); background: #eef3ff; }
details > summary { cursor: pointer; font-weight: 600; }
#r-month, #p-month, #p-fac, #p-kind, #s-dates { max-width: 22rem; }
.col-wide { flex: 1 1 22rem; } .col-narrow { flex: 1 1 18rem; }
progress { width: 12rem; height: .6rem; accent-color: var(--ink); vertical-align: middle; }
progress.lowbar { accent-color: var(--margin); }
label.check { display: flex; gap: .5rem; align-items: flex-start; font-weight: 400; }
label.check input { margin-top: .3rem; }
.toast { position: fixed; bottom: 1rem; right: 1rem; background: var(--ink); color: #fff; padding: .6rem 1rem; border-radius: 6px; opacity: 0; transform: translateY(.5rem); transition: opacity .2s, transform .2s; max-width: 30rem; }
.toast.show { opacity: 1; transform: none; }
.print-only { display: none; }
.offscreen { position: fixed; left: -9999px; top: 0; opacity: 0; }
@media (min-width: 52.01rem) { .side { position: sticky; top: 0; height: 100vh; overflow-y: auto; } }
@media (max-width: 52rem) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .register td.cls { min-width: 9rem; }
  .side { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .brand { width: 100%; margin-bottom: .3rem; }
  .lockbtn { margin-top: 0; } .build { display: none; }
  .steps { display: flex; flex-wrap: wrap; border: 0; margin: 0; }
  main { padding: 1rem; }
}
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }
@media print {
  body { background: #fff; font-size: 11pt; }
  .practice, .shell, .toast { display: none !important; }
  .print-only { display: block !important; }
  .print-only h1 { font-size: 18pt; } .print-only h2 { font-size: 13pt; margin-top: 14pt; }
  .print-only table { font-size: 9.5pt; page-break-inside: auto; } .print-only tr { page-break-inside: avoid; } .print-only thead { display: table-header-group; }
  .print-only .pagebreak { page-break-before: always; }
  @page { size: A4 portrait; margin: 14mm; }
}
