:root {
  color-scheme: light;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  color: #1b2636;
  background: #f2f5fa;
  --muted: #51617a;
  --border: #d9e1ed;
  --accent: #214eaf;
}
* { box-sizing: border-box; }
body { margin: 0; }
h1, h2, p { margin: 0; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #607ef4; outline-offset: 3px; }
[hidden], .print-only { display: none !important; }
.top { background: #13213d; color: white; }
.top-inner { max-width: 1280px; min-height: 70px; padding: 0 28px; margin: auto; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; gap: 11px; align-items: center; }
.brand strong { font-size: 1.125rem; letter-spacing: -.035em; display: block; }
.brand small { display: block; font-weight: 700; font-size: .75rem; letter-spacing: .12em; opacity: .78; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: #2856bb; color: white; font-size: 1.2rem; font-weight: 800; letter-spacing: -.09em; }
.workspace { max-width: 1280px; margin: 36px auto 56px; padding: 0 28px; display: grid; grid-template-columns: 218px minmax(0, 1fr); gap: 32px; }
.side h2 { color: var(--muted); font-size: .875rem; margin: 3px 0 12px 10px; }
.side nav { display: grid; gap: 5px; }
.course { background: transparent; border: 1px solid transparent; border-radius: 9px; text-align: left; padding: 10px; min-height: 49px; display: flex; gap: 9px; align-items: center; color: #40506c; font-size: .875rem; }
.course span:first-child { font-weight: 750; color: #34486b; flex: 0 0 35px; }
.course:hover { background: #e8edf6; }
.course[aria-pressed="true"] { background: #e4edff; border-color: #c7d8ff; color: #183d8f; font-weight: 650; }
.course[aria-pressed="true"] span:first-child { color: #183d8f; }
.intro { display: flex; gap: 16px; align-items: center; justify-content: space-between; margin-bottom: 23px; }
h1 { font-size: clamp(1.65rem, 3vw, 2.25rem); letter-spacing: -.045em; line-height: 1.12; }
.intro p, .login-card p { color: var(--muted); margin-top: 8px; line-height: 1.5; }
.primary, .subtle { display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 1px solid transparent; border-radius: 8px; padding: 10px 16px; min-height: 42px; font-weight: 650; white-space: nowrap; }
.primary { color: #fff; background: var(--accent); }
.primary:hover { background: #183a84; }
.primary:disabled { opacity: .6; cursor: wait; }
.printer { width: 16px; height: 12px; border: 1.5px solid; border-radius: 2px; position: relative; }
.printer::before, .printer::after { content: ""; position: absolute; width: 8px; left: 2.5px; border: 1px solid; background: var(--accent); }
.printer::before { height: 4px; top: -5px; }
.printer::after { height: 5px; bottom: -4px; }
.subtle { color: #284776; border-color: var(--border); background: transparent; }
.subtle:hover { background: #edf2fa; }
.top .subtle { color: white; border-color: #596989; }
.top .subtle:hover { background: #233555; }
.selector { margin-bottom: 16px; }
label { display: block; margin-bottom: 7px; color: #314260; font-weight: 650; font-size: .9rem; }
input, select, textarea { display: block; width: 100%; min-width: 0; padding: 9px 11px; min-height: 42px; color: #1b2636; background: #fff; border: 1px solid #bdcadd; border-radius: 7px; }
select { appearance: none; padding-right: 32px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%23334862' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 12px center; }
textarea { resize: vertical; line-height: 1.55; }
input::placeholder, textarea::placeholder { color: #69768a; opacity: 1; }
.sheet { background: white; border: 1px solid var(--border); border-radius: 14px; padding: 26px; box-shadow: 0 2px 5px #18375b0b; }
.sheet-head { display: flex; justify-content: space-between; align-items: start; gap: 14px; }
.eyebrow { font-size: .875rem; font-weight: 700; color: var(--accent); margin-bottom: 6px; }
.sheet h2 { font-size: clamp(1.2rem, 2.6vw, 1.65rem); letter-spacing: -.026em; line-height: 1.2; }
.max-badge { padding: 7px 10px; background: #eaf0ff; color: #183d8f; border-radius: 6px; font-size: .875rem; font-weight: 700; flex-shrink: 0; }
.description { margin-top: 12px; line-height: 1.6; color: var(--muted); }
.fields { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 12px; margin: 26px 0; }
.rubric { border: 1px solid var(--border); border-radius: 9px; overflow: clip; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 14px; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
th { text-align: left; }
thead, tfoot { background: #edf2fa; color: #2d4163; }
thead th, tfoot td, tfoot th { font-weight: 700; }
thead th { font-size: .875rem; }
tbody th { font-weight: 500; }
:where(th, td):nth-child(n + 2) { text-align: center; width: 96px; font-variant-numeric: tabular-nums; }
tfoot td, tfoot th { border-bottom: 0; padding-block: 12px; }
.points { width: 66px; min-height: 36px; margin: auto; text-align: center; padding: 4px; }
.points[aria-invalid] { border-color: #b52333; background: #fff0f0; }
.comment { margin-top: 23px; }
.sheet-footer { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin-top: 14px; }
.sheet-footer p { color: var(--muted); font-size: .875rem; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(ellipse at 50% 10%, #dae6fb, #f2f5fa 67%); }
.login-card { width: 100%; max-width: 444px; border: 1px solid var(--border); border-radius: 16px; padding: 34px; background: #fff; box-shadow: 0 12px 35px #18375b14; }
.login-card h1 { margin-top: 27px; font-size: 1.85rem; }
.login-card form { margin-top: 22px; display: grid; }
.login-card label:not(:first-child), .login-card button { margin-top: 15px; }
.login-card .error { color: #9a1e30; font-weight: 600; }
@media (max-width: 870px) {
  .workspace { grid-template-columns: 1fr; gap: 20px; margin-top: 22px; }
  .side nav { grid-template-columns: repeat(3, 1fr); }
  .course { min-height: 39px; padding: 7px 8px; }
}
@media (max-width: 590px) {
  .workspace, .top-inner { padding-inline: 14px; }
  .side nav { grid-template-columns: repeat(2, 1fr); }
  .intro { align-items: start; }
  .intro .primary { padding-inline: 10px; }
  .sheet { padding: 15px; }
  .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .fields > :first-child { grid-column: 1 / -1; }
  th, td { padding: 7px 6px; }
  :where(th, td):nth-child(n + 2) { width: 54px; }
  .points { width: 51px; }
  .sheet-footer { flex-wrap: wrap; }
}
.actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: end; }
.subtle:disabled { cursor: wait; opacity: .55; }
.evidence-link { margin-top: 18px; width: 100%; }
.evidence-link[aria-current] { background: #e4edff; border-color: #c7d8ff; }
.status { padding: 10px 13px; margin-bottom: 12px; border-radius: 7px; background: #e9f3ff; color: #253f6c; }
.status-error { background: #ffebee; color: #9a1e30; }
.records-panel > input { margin-bottom: 14px; max-width: 500px; }
.student-list { display: grid; gap: 6px; }
.student-button, .grade-row { display: flex; align-items: center; gap: 12px; justify-content: space-between; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; }
.student-button { background: #f7f9fc; color: #243957; text-align: left; }
.student-button:hover { background: #eaf1fe; }
.student-button > span { color: var(--muted); font-size: .875rem; white-space: nowrap; }
.student-button > strong, .grade-title { overflow-wrap: anywhere; }
.student-detail { margin-top: 25px; }
.student-detail h2 { margin-bottom: 12px; }
.grade-row + .grade-row { margin-top: 6px; }
.grade-title { flex: 1; }
.grade-title small { display: block; margin-top: 3px; color: var(--muted); }
.grade-points { font-weight: 700; color: var(--accent); white-space: nowrap; }
@media (max-width: 590px) {
  .actions { flex-direction: column-reverse; }
  .grade-row { gap: 7px; padding: 9px 7px; }
  .grade-row button { padding-inline: 8px; }
}
@page { size: A4; margin: 0; }
@media print {
  :root, body { background: white; color: #111; margin: 0; }
  body > :not(#print-output) { display: none !important; }
  #print-output { display: block !important; }
  .print-page { width: 210mm; height: 296.95mm; position: relative; }
  .print-page img, .print-page svg { display: block; position: absolute; inset: 0; width: 100%; height: 100%; }
  .print-page svg { fill: #172033; }
  .print-extra { break-before: page; padding: 19mm 21mm; font: 10pt/1.6 Arial, sans-serif; }
  .print-extra h2 { font-size: 14pt; margin-bottom: 3mm; }
  #print-extra-title { font-weight: 700; margin-bottom: 6mm; }
  #print-extra-comment { white-space: pre-wrap; overflow-wrap: anywhere; }
}
