/* Number Knights: teachers.html, audit.html (light, for grown-ups) and class.html (the kids' dark look). */
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.hidden { display: none !important; }
a { color: #2557d6; }
.muted { color: #5b6280; }
.small { font-size: 0.875rem; }
.err { color: #b3261e; min-height: 1.2em; margin: 6px 0 0; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.brand { font-size: 2.2rem; font-weight: 900; color: #4fc3ff; text-decoration: none; }
.brand span { color: #ffd23f; margin-left: 0.12em; }
.brand.small { font-size: 1.35rem; }
.brand em { font-style: normal; font-weight: 600; font-size: 0.95rem; color: #5b6280; margin-left: 8px; }
.btn { display: inline-block; border: 0; border-radius: 10px; padding: 10px 18px; background: #2557d6; color: #fff; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; }
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.ghost { background: #fff; color: #2557d6; border: 1.5px solid #2557d6; }
.btn.danger { background: #fff; color: #b3261e; border: 1.5px solid #b3261e; }
.btn.on { box-shadow: 0 0 0 3px #ffd23f; }
.link-btn { background: none; border: 0; padding: 0; color: #2557d6; font: inherit; cursor: pointer; text-decoration: underline; }
.link-btn.danger { color: #b3261e; }
:focus-visible { outline: 3px solid #ffb300; outline-offset: 2px; }

/* ---- Grown-up pages */
.teacher-page { background: #f4f6fb; color: #1b1f3b; }
.teacher-page .brand { color: #1d6fd6; }
.teacher-page .brand span { color: #e0a100; }
.t-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 20px; background: #fff; border-bottom: 1px solid #e1e5f0; flex-wrap: wrap; }
.t-top nav { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
main { max-width: 1180px; margin: 0 auto; padding: 20px; }
.t-card { background: #fff; border: 1px solid #e1e5f0; border-radius: 14px; padding: 18px 20px; margin: 0 0 16px; }
.t-card.narrow { max-width: 460px; margin: 30px auto; }
.t-card h2, .t-card h3 { margin: 0 0 10px; }
.t-card label { display: block; margin: 0 0 12px; font-weight: 600; font-size: 0.95rem; }
.t-card input:not([type=checkbox]), .t-card select, .t-card textarea, .filters select, .filters input:not([type=checkbox]), #aNote {
  display: block; width: 100%; margin-top: 4px; padding: 9px 11px; border: 1.5px solid #c9cfe0; border-radius: 9px; font: inherit; background: #fff; color: inherit; }
.filters label { font-weight: 600; font-size: 0.9rem; }
.filters select, .filters input:not([type=checkbox]) { width: auto; min-width: 150px; }
.filters label.check { align-items: center; align-self: flex-end; padding-bottom: 8px; }
label.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; }
label.check input { margin-top: 4px; }
.t-card.inline { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.t-card.inline h3 { margin: 0; flex-basis: 100%; }
.t-card.inline input, .t-card.inline select { width: auto; flex: 1 1 200px; margin: 0; }
.t-card.inline .err { flex-basis: 100%; }
.or { text-align: center; color: #5b6280; margin: 12px 0; }
fieldset { border: 1px solid #e1e5f0; border-radius: 10px; margin: 0 0 12px; padding: 8px 12px; }
legend { font-weight: 700; padding: 0 6px; }
.note { background: #fff7d6; border: 1px solid #f0d36b; border-radius: 10px; padding: 10px 14px; margin: 0 0 14px; }
.toast { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); background: #1b1f3b; color: #fff; padding: 10px 18px; border-radius: 10px; z-index: 9; max-width: 90vw; }
.badge { background: #e8ecf8; border-radius: 99px; padding: 4px 12px; font-weight: 700; font-size: 0.85rem; }
.badge.plus { background: #ffe9a8; }
.tab-btn { border: 1.5px solid #c9cfe0; background: #fff; border-radius: 99px; padding: 6px 14px; font: inherit; font-weight: 600; cursor: pointer; color: inherit; }
.tab-btn.on { background: #1b1f3b; color: #fff; border-color: #1b1f3b; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 760px) { .two { grid-template-columns: 1fr; } }

.t-hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 28px; align-items: start; padding: 20px 0; }
@media (max-width: 860px) { .t-hero { grid-template-columns: 1fr; } }
.t-hero h1 { font-size: 2.3rem; line-height: 1.15; margin: 0 0 12px; }
.lead { font-size: 1.15rem; color: #3a4060; }
.ticks { padding-left: 1.2em; }
.ticks li { margin: 6px 0; }
.t-how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 10px 0 20px; }
@media (max-width: 760px) { .t-how { grid-template-columns: 1fr; } }
.t-how > div { background: #fff; border: 1px solid #e1e5f0; border-radius: 14px; padding: 16px; }
.t-how h3 { margin: 0 0 6px; }
.foot { text-align: center; color: #5b6280; }

.dash-head, .class-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 6px 0 16px; }
.dash-head h1, .class-head h2 { margin: 0; }
.class-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-bottom: 16px; }
.class-card { text-align: left; background: #fff; border: 1px solid #e1e5f0; border-radius: 14px; padding: 16px; cursor: pointer; font: inherit; color: inherit; display: flex; flex-direction: column; gap: 4px; }
.class-card:hover { border-color: #2557d6; }
.class-card.archived { opacity: 0.6; }
.class-card b { font-size: 1.15rem; }
.code { font-family: ui-monospace, Consolas, monospace; letter-spacing: 0.08em; font-weight: 800; }
.tag { align-self: flex-start; background: #e3f4e6; color: #1f6b2c; border-radius: 99px; padding: 2px 10px; font-size: 0.8rem; font-weight: 700; }

.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 0.9rem; margin: 10px 0; }
.legend i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-right: 4px; }
.c3 { background: #2e9b4e; } .c2 { background: #f2c037; } .c1 { background: #e2685c; } .c0 { background: #e6e9f2; }
.unv { color: #8a5cf6; font-weight: 900; }
.grid-wrap { overflow: auto; max-height: 70vh; background: #fff; border: 1px solid #e1e5f0; border-radius: 14px; margin-bottom: 16px; }
table.grid { border-collapse: separate; border-spacing: 2px; }
table.grid th { font-weight: 600; font-size: 0.8rem; background: #fff; }
table.grid thead th { position: sticky; top: 0; z-index: 1; height: 150px; vertical-align: bottom; padding: 6px 0; }
table.grid .vcode { display: inline-block; writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; }
table.grid th.sticky { position: sticky; left: 0; z-index: 2; text-align: left; padding: 0 10px; white-space: nowrap; }
table.grid td { width: 22px; min-width: 22px; height: 22px; border-radius: 4px; }
table.grid td.na { background: #fafbfe; color: #b8bdd0; text-align: center; font-size: 0.7rem; }
table.roster, table.mini { width: 100%; border-collapse: collapse; background: #fff; }
table.roster th, table.roster td, table.mini th, table.mini td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #eef0f6; }
table.roster .actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
table.roster select { padding: 4px 6px; border-radius: 6px; border: 1px solid #c9cfe0; font: inherit; }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 8px; vertical-align: -1px; }
.assign-list { max-height: 50vh; overflow: auto; background: #fff; border: 1px solid #e1e5f0; border-radius: 14px; padding: 8px 14px; margin: 10px 0 14px; }
.assign-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid #eef0f6; font-weight: 400 !important; }
.assign-row input { margin-top: 5px; }

/* Auditors */
.tally { display: flex; gap: 18px; flex-wrap: wrap; font-weight: 700; }
.c3b { color: #1f6b2c; } .c1b { color: #b3261e; }
.audit-item { border-left: 6px solid #c9cfe0; }
.audit-item.state-verified { border-left-color: #2e9b4e; }
.audit-item.state-disputed { border-left-color: #e2685c; }
.ai-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.ai-head .state { font-weight: 800; }
.ai-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 860px) { .ai-cols { grid-template-columns: 1fr; } }
.ai-cols h3 { font-size: 1.05rem; }
blockquote { margin: 0; padding: 10px 14px; background: #f4f6fb; border-radius: 10px; }
.samples li { margin: 4px 0; }
.votes { list-style: none; padding: 0; margin: 10px 0; }
.votes li.approve { color: #1f6b2c; } .votes li.reject { color: #b3261e; }
.vote-row { margin-top: 10px; }
.vote-row .note-input { flex: 1 1 220px; padding: 9px 11px; border: 1.5px solid #c9cfe0; border-radius: 9px; font: inherit; }

/* ---- Students joining (kids' look) */
.kid-page { background: #0d1030; color: #e8eaff; min-height: 100vh; }
.kid-page a { color: #9fdcff; }
.kid-page .muted { color: #b9bde6; }
.join { max-width: 640px; text-align: center; padding-top: 6vh; }
.join-card { background: #1b1f4b; border-radius: 20px; padding: 26px 22px; margin: 20px 0; }
.join-card h1 { margin: 0 0 14px; font-size: 1.8rem; }
.join-card label { display: block; margin-bottom: 10px; color: #c9ccef; }
.code-input { display: block; width: 100%; max-width: 320px; margin: 0 auto 16px; padding: 14px; font: 800 2rem ui-monospace, Consolas, monospace; letter-spacing: 0.2em; text-align: center;
  text-transform: uppercase; border-radius: 14px; border: 3px solid #4fc3ff; background: #0d1030; color: #fff; }
.btn.big { background: #ffd23f; color: #1b1f4b; font-size: 1.25rem; padding: 14px 34px; border-radius: 14px; font-weight: 900; }
.kid-page .err { color: #ff9b8f; }
.name-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin: 14px 0; }
.name-btn { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 8px; border-radius: 16px; border: 2px solid #343a7a; background: #262b63; color: #fff;
  font: 700 1.05rem system-ui, sans-serif; cursor: pointer; }
.name-btn:hover { border-color: #ffd23f; }
.face { width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #1b1f4b; font-weight: 900; font-size: 1.4rem; }
.kid-page .link-btn { color: #9fdcff; }

/* ---- Printable login cards */
.print-only { display: none; }
@media print {
  body.teacher-page > *:not(#cards) { display: none !important; }
  .print-only { display: grid !important; grid-template-columns: 1fr 1fr; gap: 10px; }
  .login-card { border: 2px dashed #555; border-radius: 12px; padding: 14px 16px; break-inside: avoid; font-size: 14px; color: #000; }
  .lc-brand { font-weight: 900; font-size: 18px; color: #1d6fd6; }
  .lc-brand span { color: #c48a00; margin-left: 2px; }
  .lc-name { font-size: 24px; font-weight: 800; margin: 6px 0; }
  .lc-class { margin-top: 6px; color: #555; font-size: 12px; }
}
