[hidden] { display: none !important; }
:root {
  --bg: #0b0b0b;
  --panel: #131313;
  --panel-2: #1a1a1a;
  --line: #262626;
  --line-2: #333333;
  --text: #f2f2f0;
  --muted: #a3a3a3;
  --dim: #6f6f6f;
  --ok: #4ade80;
  --alert: #e5484d;
  --amber: #f2a33a;
  --head: "Barlow Condensed", system-ui, sans-serif;
  --body: "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--body); font-size: 15px; line-height: 1.5; }
a { color: inherit; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.mono { font-family: var(--mono); }
.label { font-family: var(--head); font-weight: 600; letter-spacing: .18em; text-transform: uppercase; font-size: 13px; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ───────── Login ───────── */
.login-wrap { min-height: 100vh; display: grid; grid-template-rows: auto 1fr auto; }
.classbar { background: var(--alert); color: #fff; text-align: center; font-family: var(--head); font-weight: 700; letter-spacing: .3em; font-size: 13px; padding: 6px 12px; text-transform: uppercase; }
.login-main { display: grid; place-items: center; padding: 48px 20px; background:
  radial-gradient(circle at 50% 30%, rgba(255,255,255,.04), transparent 55%),
  repeating-linear-gradient(0deg, rgba(255,255,255,.015) 0 1px, transparent 1px 4px); }
.login-card { width: min(460px, 100%); background: var(--panel); border: 1px solid var(--line-2); border-top: 4px solid var(--text); padding: 40px 36px 32px; text-align: center; }
.login-card img { width: 128px; height: 128px; object-fit: contain; }
.login-card .agency { margin: 18px 0 2px; }
.login-card h1 { font-family: var(--head); font-size: 38px; line-height: 1; margin: 0 0 6px; text-transform: uppercase; letter-spacing: .02em; }
.login-card .sub { color: var(--muted); margin: 0 0 26px; font-size: 14px; }
.restricted { display: flex; gap: 10px; align-items: flex-start; text-align: left; background: rgba(229,72,77,.08); border: 1px solid rgba(229,72,77,.35); padding: 12px 14px; margin-bottom: 24px; font-size: 13px; color: #f3c9ca; }
.restricted b { color: #fff; }
.btn-discord { display: flex; width: 100%; align-items: center; justify-content: center; gap: 10px; background: #5865f2; color: #fff; text-decoration: none; font-weight: 600; padding: 14px 18px; border: 0; cursor: pointer; font-size: 15px; }
.btn-discord:hover { background: #4752c4; }
.msg { margin: 18px 0 0; font-size: 13px; padding: 10px 12px; border: 1px solid var(--line-2); text-align: left; }
.msg.error { border-color: rgba(229,72,77,.5); color: #f3c9ca; }
.msg.ok { border-color: rgba(74,222,128,.4); color: #c9f3d8; }
.login-meta { margin-top: 22px; display: flex; justify-content: space-between; color: var(--dim); font-size: 12px; font-family: var(--mono); }
.disclaimer { text-align: center; color: var(--dim); font-size: 12px; padding: 16px 20px 22px; border-top: 1px solid var(--line); }

/* ───────── App shell ───────── */
.app { display: grid; grid-template-columns: 260px 1fr; grid-template-rows: auto auto 1fr auto; min-height: 100vh; }
.app > .classbar { grid-column: 1 / -1; }
.topbar { grid-column: 1 / -1; display: flex; align-items: center; gap: 16px; padding: 12px 24px; border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 5; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { width: 40px; height: 40px; }
.brand .t1 { font-family: var(--head); font-weight: 700; font-size: 20px; letter-spacing: .04em; text-transform: uppercase; line-height: 1; }
.brand .t2 { font-size: 11px; letter-spacing: .2em; color: var(--muted); text-transform: uppercase; }
.status { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12px; color: var(--muted); border: 1px solid var(--line-2); padding: 4px 10px; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.spacer { flex: 1; }
.user { display: flex; align-items: center; gap: 12px; }
.user img, .user .ph { width: 36px; height: 36px; border-radius: 50%; background: var(--line-2); object-fit: cover; }
.user .name { font-weight: 600; line-height: 1.1; }
.badge { display: inline-block; font-family: var(--mono); font-size: 11px; padding: 2px 8px; border: 1px solid var(--line-2); color: var(--muted); margin-top: 2px; }
.badge.command { border-color: var(--amber); color: var(--amber); }
.btn { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; border: 1px solid var(--line-2); background: transparent; color: var(--text); padding: 8px 14px; text-decoration: none; cursor: pointer; font-size: 14px; }
.btn:hover { border-color: var(--text); }
.btn.primary { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 600; }
.btn.primary:hover { background: #fff; }

.sidebar { border-right: 1px solid var(--line); padding: 20px 14px; background: var(--panel); }
.sidebar .label { padding: 0 10px 8px; display: block; }
.nav { list-style: none; margin: 0 0 22px; padding: 0; }
.nav a { display: flex; justify-content: space-between; align-items: center; padding: 9px 10px; text-decoration: none; color: var(--muted); border-left: 3px solid transparent; }
.nav a:hover { color: var(--text); background: var(--panel-2); }
.nav a.active { color: var(--text); background: var(--panel-2); border-left-color: var(--text); }
.nav .count { font-family: var(--mono); font-size: 12px; color: var(--dim); }

main { padding: 28px 32px 48px; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-family: var(--head); font-size: 40px; line-height: 1; margin: 4px 0 0; text-transform: uppercase; letter-spacing: .02em; }
.view[hidden] { display: none; }

.grid { display: grid; gap: 16px; }
.grid.k4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.k3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.k2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.panel { background: var(--panel); border: 1px solid var(--line); padding: 20px; }
.panel h2 { font-family: var(--head); font-size: 22px; text-transform: uppercase; margin: 0 0 12px; letter-spacing: .03em; }
.tile { display: flex; flex-direction: column; gap: 6px; background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--text); padding: 18px; text-decoration: none; transition: border-color .15s, background .15s; }
.tile:hover { background: var(--panel-2); border-color: var(--line-2); }
.tile .k { font-family: var(--mono); font-size: 11px; color: var(--dim); }
.tile .t { font-family: var(--head); font-size: 22px; font-weight: 700; text-transform: uppercase; line-height: 1.05; }
.tile .d { color: var(--muted); font-size: 13px; }
.tile.cmd { border-top-color: var(--amber); }
.stat .v { font-family: var(--head); font-weight: 700; font-size: 44px; line-height: 1; }
.stat .v small { font-size: 22px; color: var(--muted); }
.stat .l { color: var(--muted); font-size: 13px; margin-top: 6px; }

.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.search { flex: 1; min-width: 240px; display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--line-2); padding: 0 14px; }
.search input { flex: 1; background: transparent; border: 0; color: var(--text); padding: 12px 0; font: inherit; outline: none; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line-2); background: transparent; color: var(--muted); padding: 7px 12px; cursor: pointer; font-size: 13px; }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }

table.records { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); }
.records th { text-align: left; font-family: var(--head); text-transform: uppercase; letter-spacing: .12em; font-size: 13px; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--line-2); background: var(--panel-2); }
.records td { padding: 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.records tr:last-child td { border-bottom: 0; }
.records tr:hover td { background: #161616; }
.records .rid { font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; }
.records .ttl { font-weight: 600; }
.records .desc { color: var(--muted); font-size: 13px; margin-top: 2px; }
.type { font-family: var(--mono); font-size: 11px; border: 1px solid var(--line-2); padding: 2px 7px; color: var(--muted); white-space: nowrap; }
.restricted-tag { font-family: var(--mono); font-size: 11px; border: 1px solid var(--amber); color: var(--amber); padding: 2px 7px; margin-left: 8px; white-space: nowrap; }
.empty { padding: 28px; text-align: center; color: var(--muted); }

table.plain { width: 100%; border-collapse: collapse; }
.plain th, .plain td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.plain th { font-family: var(--head); text-transform: uppercase; letter-spacing: .12em; font-size: 13px; color: var(--muted); }
.plain td.mono { color: var(--muted); }

.cert { border-top: 3px solid var(--text); }
.cert .num { font-family: var(--head); font-size: 15px; color: var(--muted); letter-spacing: .14em; text-transform: uppercase; }
.cert h3 { font-family: var(--head); font-size: 26px; text-transform: uppercase; margin: 4px 0 8px; }
.cert dl { margin: 12px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13px; }
.cert dt { color: var(--muted); }
.cert dd { margin: 0; }

footer.foot { grid-column: 1 / -1; border-top: 1px solid var(--line); padding: 14px 24px; color: var(--dim); font-size: 12px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

.loading { display: grid; place-items: center; min-height: 100vh; color: var(--muted); font-family: var(--mono); }

@media (max-width: 1100px) { .grid.k4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid.k3 { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .topbar { padding: 10px 14px; gap: 10px; }
  .user .name, .user #avatar { display: none; }
  .user .badge { font-size: 10px; }
  .brand .t1 { font-size: 17px; }
  .brand img { width: 32px; height: 32px; }
  .classbar { letter-spacing: .14em; font-size: 11px; }
  .page-head h1 { font-size: 30px; }
  .records th:nth-child(1), .records td:nth-child(1), .records th:nth-child(4), .records td:nth-child(4), .records th:nth-child(3), .records td:nth-child(3) { display: none; }
  .sidebar { display: none; border-right: 0; border-bottom: 1px solid var(--line); max-height: 70vh; overflow-y: auto; }
  .sidebar.open { display: block; }
  .status, .brand .t2 { display: none; }
  main { padding: 20px 16px 40px; }
  .grid.k2 { grid-template-columns: 1fr; }
}

.table-wrap { overflow-x: auto; }

.add-form { display: grid; grid-template-columns: 1.3fr 1.3fr .8fr auto; gap: 12px; align-items: end; }
.add-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.add-form input, .add-form select { background: var(--bg); color: var(--text); border: 1px solid var(--line-2); padding: 10px 12px; font: inherit; }
.add-form input:focus, .add-form select:focus { border-color: var(--text); outline: none; }
.plain .actions { display: flex; gap: 8px; justify-content: flex-end; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.danger:hover { border-color: var(--alert); color: #f3c9ca; }
.locked { font-family: var(--mono); font-size: 11px; color: var(--dim); }
@media (max-width: 860px) { .add-form { grid-template-columns: 1fr; } }

/* ───────── Shared bits ───────── */
.menu-btn { display: none !important; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.lede { color: var(--muted); margin: -8px 0 16px; max-width: 75ch; }
.tiny { font-size: 12px; color: var(--muted); }
.dim { color: var(--dim); }
.nowrap { white-space: nowrap; }
.grow { flex: 1; }
.red { color: var(--alert); }
.pill { display: inline-block; font-family: var(--mono); font-size: 11px; padding: 2px 8px; border: 1px solid var(--line-2); color: var(--muted); white-space: nowrap; text-transform: none; vertical-align: middle; }
.pill.green { border-color: rgba(74,222,128,.5); color: #86efac; }
.pill.amber { border-color: rgba(242,163,58,.6); color: var(--amber); }
.pill.red { border-color: rgba(229,72,77,.6); color: #f59ea1; }
.pill.blue { border-color: rgba(96,165,250,.6); color: #93c5fd; }
.yes { color: #86efac; } .no { color: var(--dim); }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.panel-head h2 { margin: 0; }
.more { font-size: 13px; color: var(--muted); }
.nav .count.pending:not(:empty) { background: var(--amber); color: #111; padding: 0 6px; font-weight: 600; }
.toast { position: fixed; bottom: 20px; right: 20px; z-index: 50; background: var(--text); color: var(--bg); padding: 12px 16px; font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.5); max-width: 360px; }
.toast.error { background: var(--alert); color: #fff; }
.msg ul { margin: 6px 0 0; padding-left: 18px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.search.small { min-width: 200px; flex: 0 1 260px; }
.search.small input { padding: 7px 0; }
.panel + .panel, section.panel { margin-top: 16px; }
.grid > .panel { margin-top: 0; }
.flush { padding: 0; }
.clickable tbody tr { cursor: pointer; }
.clickable tbody tr:hover td, .clickable tbody tr.sel td { background: var(--panel-2); }
.clickable tbody tr.sel td:first-child { box-shadow: inset 3px 0 0 var(--text); }

/* Dashboard */
.pending-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.pending-bar a { border: 1px solid var(--amber); color: var(--amber); padding: 8px 12px; text-decoration: none; font-size: 14px; }
.pending-bar a:hover { background: rgba(242,163,58,.08); }
.grid.dash { grid-template-columns: 1.4fr 1fr; }
.evt-row { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); text-decoration: none; }
.evt-row:first-child { border-top: 0; }
.evt-row .t { font-weight: 600; }
.date { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 48px; border: 1px solid var(--line-2); padding: 4px 6px; line-height: 1.1; }
.date span { font-size: 11px; text-transform: uppercase; color: var(--muted); letter-spacing: .08em; }
.date b { font-family: var(--head); font-size: 24px; }
.date.big { min-width: 64px; padding: 8px; } .date.big b { font-size: 32px; }

/* Announcements */
.ann { border-left: 3px solid var(--line-2); padding: 12px 0 12px 14px; margin-bottom: 4px; }
#ann-list .ann { background: var(--panel); border: 1px solid var(--line); border-left-width: 3px; padding: 18px 20px; margin-bottom: 12px; }
.ann.important { border-left-color: var(--amber) !important; }
.ann.urgent { border-left-color: var(--alert) !important; }
.ann.pinned { border-left-color: var(--text); }
.ann h3 { font-family: var(--head); font-size: 22px; text-transform: uppercase; margin: 4px 0 6px; letter-spacing: .02em; }
.ann-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.ann-body { color: #d8d8d6; }
.ann-body a { color: #93c5fd; }
.ann-actions { display: flex; gap: 8px; margin-top: 12px; }
#dash-ann .ann { padding: 10px 0 10px 12px; border-top: 0; }
#dash-ann .ann-body { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: 14px; }

/* Editors and forms */
.editor { margin-bottom: 16px; }
.row { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 6px; margin: 0 0 18px; border: 0; padding: 0; min-width: 0; }
.field.short { max-width: 280px; }
.row .field { flex: 1 1 200px; }
.row .field.short { flex: 0 1 220px; }
.flabel { font-weight: 600; }
.req { color: var(--alert); }
.help { color: var(--muted); font-size: 13px; }
.field legend { padding: 0; margin-bottom: 8px; display: flex; flex-direction: column; gap: 4px; }
.field input[type=text], .field input[type=number], .field input[type=date], .field input[type=datetime-local], .field textarea, .field select, .review select, .review textarea, #csv {
  background: var(--bg); color: var(--text); border: 1px solid var(--line-2); padding: 10px 12px; font: inherit; width: 100%; color-scheme: dark; }
.field textarea, #csv { resize: vertical; line-height: 1.5; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--text); outline: none; }
.field.invalid input, .field.invalid textarea, .field.invalid .choices { border-color: var(--alert) !important; box-shadow: 0 0 0 1px var(--alert); }
.counter { font-family: var(--mono); font-size: 11px; color: var(--dim); align-self: flex-end; }
.counter.ok { color: #86efac; }
.choices { display: flex; flex-direction: column; gap: 2px; border: 1px solid transparent; }
.opt { display: flex; gap: 10px; align-items: center; padding: 8px 10px; cursor: pointer; border: 1px solid var(--line); background: var(--bg); }
.opt:hover { border-color: var(--line-2); }
.opt:has(input:checked) { border-color: var(--text); background: var(--panel-2); }
.opt input { accent-color: #f2f2f0; width: 16px; height: 16px; flex: none; }
.opt.other .other-text { flex: 1; background: transparent; border: 0; border-bottom: 1px solid var(--line-2); color: var(--text); padding: 4px; font: inherit; }
.scale { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.scale label { cursor: pointer; }
.scale input { position: absolute; opacity: 0; }
.scale label span { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line-2); font-family: var(--mono); }
.scale input:checked + span { background: var(--text); color: var(--bg); }
.scale input:focus-visible + span { outline: 2px solid var(--text); outline-offset: 2px; }
.scale .end { font-size: 12px; color: var(--muted); padding: 0 6px; }
.form-wrap { max-width: 860px; }
.form-intro h2 { font-size: 30px; }
.form-intro p { color: #d0d0ce; }
.form-section h3 { font-family: var(--head); font-size: 20px; text-transform: uppercase; letter-spacing: .04em; margin: 0 0 4px; }
.form-section > .help { margin: 0 0 16px; }
.form-section .field:last-child { margin-bottom: 0; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; align-items: center; }
.done h2 { font-size: 30px; }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; margin-bottom: 18px; }
.check input { accent-color: #f2f2f0; width: 16px; height: 16px; }

/* Inbox */
.inbox { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.inbox:has(.detail:not([hidden])) { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); }
.inbox > .panel { margin-top: 0; }
.detail { align-self: start; position: sticky; top: 84px; max-height: calc(100vh - 110px); overflow-y: auto; }
.detail-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.detail-head h2 { margin: 4px 0; }
.score { padding: 10px 12px; border: 1px solid var(--line-2); margin-bottom: 12px; }
.score.ok { border-color: rgba(74,222,128,.5); } .score.bad { border-color: rgba(229,72,77,.5); }
.review { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; padding: 14px; background: var(--bg); border: 1px solid var(--line); margin-bottom: 16px; }
.review label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.review label.grow { flex: 1 1 240px; }
.review .check { flex-direction: row; color: var(--text); margin: 0; flex-basis: 100%; }
.review .form-actions { margin: 0; flex-basis: 100%; }
.ans-section h4 { font-family: var(--head); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-size: 15px; margin: 18px 0 8px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.ans-section dl { margin: 0; }
.ans-section dt { font-size: 13px; color: var(--muted); margin-top: 10px; }
.ans-section dd { margin: 2px 0 0; }

/* Roster */
.notes { color: var(--muted); font-size: 13px; margin: -6px 0 16px; padding-left: 18px; }
.roster th, .roster td { padding: 8px 10px; font-size: 14px; }
.roster tr.group th { background: var(--panel-2); color: var(--text); font-size: 14px; letter-spacing: .14em; padding: 10px; border-top: 1px solid var(--line-2); }
.roster tr.group .count { font-family: var(--mono); color: var(--dim); letter-spacing: 0; margin-left: 6px; }
.roster .w-xs { width: 1%; white-space: nowrap; }
.roster.editing td { padding: 4px; }
.roster.editing input, .roster.editing select { background: var(--bg); color: var(--text); border: 1px solid var(--line); padding: 6px 8px; font: inherit; font-size: 13px; color-scheme: dark; }
.roster.editing input:focus, .roster.editing select:focus { border-color: var(--text); outline: none; }
.roster.editing input.w-xs { width: 70px; } .roster.editing input.w-s { width: 120px; } .roster.editing input.w-m { width: 170px; } .roster.editing input.w-l { width: 240px; }
.roster.editing input[type=checkbox] { width: 18px; height: 18px; accent-color: #f2f2f0; }
.row-actions { white-space: nowrap; }
.row-actions .btn { padding: 4px 8px; }
#import-box { margin-bottom: 16px; }

/* Calendar */
.evt { margin-top: 0; margin-bottom: 12px; }
.evt.past { opacity: .6; }
.evt-top { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.evt h3 { font-family: var(--head); font-size: 24px; text-transform: uppercase; margin: 6px 0 2px; }
.evt p { margin: 8px 0 0; color: #d0d0ce; }
.signups { margin-top: 10px; font-size: 13px; color: var(--muted); }
.signups b { color: var(--text); }
.evt-actions { display: flex; flex-direction: column; gap: 8px; align-items: stretch; min-width: 150px; }
.past-list { margin-top: 24px; }
.past-list summary { cursor: pointer; margin-bottom: 12px; }

/* Service record */
.record-top .v { display: flex; align-items: baseline; gap: 6px; font-size: 36px; }
.record-top .v .pill { font-size: 16px; padding: 4px 10px; }
.sep { width: 1px; height: 28px; background: var(--line-2); display: inline-block; margin: 0 6px; }
.cert-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 0; }
.cert-badge { border: 1px solid var(--line-2); padding: 6px 12px; color: var(--dim); font-size: 13px; }
.cert-badge.on { border-color: var(--text); color: var(--text); }
.record-grid { margin-top: 16px; }
.record-grid section.panel { margin-top: 0; }

/* Stats */
.stats-grid { margin-top: 16px; }
.stats-grid section.panel { margin-top: 0; }
.bars { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1.2fr) 2fr 32px; gap: 8px; align-items: center; font-size: 13px; }
.bl { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bt { height: 10px; background: var(--panel-2); }
.bt span { display: block; height: 100%; background: var(--text); min-width: 2px; }
.bv { text-align: right; }
.cols { display: flex; gap: 6px; align-items: flex-end; height: 160px; padding-top: 18px; }
.col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; }
.cb { width: 100%; background: var(--text); min-height: 2px; }
.cv { font-size: 11px; color: var(--muted); }
.cl { font-size: 10px; color: var(--dim); font-family: var(--mono); }

/* Document viewer */
.doc-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; align-items: start; }
.doc-toc { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 2px; max-height: calc(100vh - 110px); overflow-y: auto; }
.doc-toc .label { margin-bottom: 8px; }
.doc-toc a { color: var(--muted); text-decoration: none; font-size: 13px; padding: 5px 8px; border-left: 2px solid var(--line); }
.doc-toc a:hover { color: var(--text); border-left-color: var(--text); }
.doc { background: #f4f4f2; color: #161616; padding: 48px 56px; max-width: 900px; line-height: 1.6; font-size: 15px; }
.doc-head { display: flex; gap: 18px; align-items: center; border-bottom: 2px solid #161616; padding-bottom: 18px; margin-bottom: 24px; }
.doc-head img { width: 80px; height: 80px; filter: invert(1); }
.doc-head .label { color: #555; font-size: 12px; }
.doc-title { font-family: var(--head); font-weight: 700; font-size: 38px; text-transform: uppercase; line-height: 1; margin: 4px 0; }
.doc-meta { font-size: 12px; color: #555; }
.doc h2 { font-family: var(--head); font-size: 26px; text-transform: uppercase; letter-spacing: .02em; border-bottom: 1px solid #161616; padding-bottom: 4px; margin: 32px 0 12px; scroll-margin-top: 90px; }
.doc h3 { font-family: var(--head); font-size: 19px; text-transform: uppercase; margin: 22px 0 8px; }
.doc p { margin: 0 0 12px; }
.doc .lead { font-size: 16px; }
.doc .note { color: #555; font-style: italic; font-size: 14px; }
.doc blockquote { margin: 0 0 16px; border-left: 3px solid #161616; padding-left: 14px; font-style: italic; }
.doc ul, .doc ol { padding-left: 22px; margin: 0 0 14px; }
.doc li { margin-bottom: 4px; }
.doc ul.checks { list-style: none; padding-left: 4px; }
.doc ul.checks li::before { content: "☐  "; }
.doc .table-wrap { margin: 0 0 16px; }
.doc table { width: 100%; border-collapse: collapse; font-size: 14px; }
.doc th { background: #161616; color: #fff; text-align: left; padding: 8px 10px; font-weight: 600; }
.doc td { border: 1px solid #c8c8c4; padding: 7px 10px; vertical-align: top; }
.doc tbody tr:nth-child(even) td { background: #eaeae6; }
.doc .doc-img { max-width: 100%; display: block; margin: 8px auto 16px; border: 1px solid #c8c8c4; background: #fff; }
.doc a { color: #1d4ed8; }

/* Slide viewer */
.slides { max-width: 1100px; }
.stage { position: relative; background: #000; border: 1px solid var(--line); aspect-ratio: 16 / 9; display: grid; place-items: center; }
.stage img { width: 100%; height: 100%; object-fit: contain; cursor: pointer; display: block; }
.stage:fullscreen { border: 0; }
.nav-btn { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 72px; background: rgba(0,0,0,.55); color: #fff; border: 0; font-size: 34px; cursor: pointer; opacity: 0; transition: opacity .15s; }
.stage:hover .nav-btn, .nav-btn:focus-visible { opacity: 1; }
.nav-btn.prev { left: 0; } .nav-btn.next { right: 0; }
.slide-bar { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; padding: 8px 2px; }
.thumbs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; }
.thumbs button { flex: none; width: 128px; padding: 0; border: 2px solid transparent; background: none; cursor: pointer; position: relative; }
.thumbs button.on { border-color: var(--text); }
.thumbs img { width: 100%; display: block; aspect-ratio: 16 / 9; object-fit: cover; background: #111; }
.thumbs span { position: absolute; bottom: 2px; right: 4px; font-family: var(--mono); font-size: 11px; background: rgba(0,0,0,.7); padding: 0 4px; }

/* Applicant mode */
body.applicant .sidebar, body.applicant .menu-btn { display: none !important; }
body.applicant .app { grid-template-columns: minmax(0, 1fr); }
body.applicant main { max-width: 900px; margin: 0 auto; width: 100%; }

@media (max-width: 1100px) {
  .grid.dash { grid-template-columns: 1fr; }
  .inbox:has(.detail:not([hidden])) { grid-template-columns: minmax(0, 1fr); }
  .detail { position: static; max-height: none; }
  .doc-layout { grid-template-columns: minmax(0, 1fr); }
  .doc-toc { display: none; }
}
@media (max-width: 860px) {
  .doc { padding: 24px 18px; }
  .doc-title { font-size: 28px; }
  .doc-head img { width: 56px; height: 56px; }
  .evt-actions { flex-direction: row; flex-wrap: wrap; min-width: 0; width: 100%; }
  .record-top .v { font-size: 28px; }
  .nav-btn { opacity: .8; }
}

@media print {
  body { background: #fff; }
  .classbar, .topbar, .sidebar, footer.foot, .page-head, .doc-toc, .toast { display: none !important; }
  .app { display: block; }
  main { padding: 0; }
  .doc-layout { display: block; }
  .doc { max-width: none; padding: 0; background: #fff; }
  .doc h2 { break-after: avoid; }
  .doc tr { break-inside: avoid; }
}

@media (max-width: 860px) { .menu-btn { display: inline-flex !important; } body.applicant .menu-btn { display: none !important; } }

.roster td { white-space: nowrap; }
.roster td.w-l { white-space: normal; min-width: 200px; }

/* Simplified navigation */
.main-nav a { font-size: 15px; padding: 11px 12px; }
.sidebar > .main-nav { margin-top: 4px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line-2); margin: -6px 0 20px; overflow-x: auto; scrollbar-width: thin; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; font-size: 14px; }
.tabs a:hover { color: var(--text); }
.tabs a.on { color: var(--text); border-bottom-color: var(--text); font-weight: 600; }
.tabs .count.pending:not(:empty) { background: var(--amber); color: #111; padding: 0 6px; font-family: var(--mono); font-size: 11px; font-weight: 600; margin-left: 4px; }
#status-chips { margin-bottom: 14px; }
.back { color: var(--muted); text-decoration: none; font-size: 14px; }
.back:hover { color: var(--text); }

/* ───────── Chat ───────── */
body.on-chat main { padding-bottom: 16px; }
.chat { display: grid; grid-template-columns: 240px minmax(0, 1fr); height: calc(100vh - 150px); min-height: 480px; border: 1px solid var(--line); background: var(--panel); }
.chat-side { border-right: 1px solid var(--line); padding: 14px 10px; overflow-y: auto; background: #101010; }
.chat-side .label { display: block; padding: 10px 8px 6px; font-size: 12px; }
.chat-side .label:first-child { padding-top: 0; }
.ch { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 7px 8px; color: var(--muted); text-decoration: none; background: none; border: 0; cursor: pointer; font: inherit; font-size: 14px; }
.ch:hover { background: var(--panel-2); color: var(--text); }
.ch.on, .vc.on > .ch { background: var(--panel-2); color: var(--text); }
.ch.unread { color: var(--text); font-weight: 600; }
.ch.unread::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--text); margin-left: auto; }
.ch .hash { color: var(--dim); width: 18px; text-align: center; flex: none; }
.ch .lock { font-family: var(--mono); font-size: 9px; border: 1px solid var(--amber); color: var(--amber); padding: 0 4px; }
.ch .n { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--dim); }
.vp { display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 34px; font-size: 13px; color: #d0d0ce; }
.vp .st { font-size: 11px; color: var(--alert); margin-left: auto; }
.av { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; display: inline-grid; place-items: center; background: var(--line-2); color: var(--text); font-weight: 600; }
.av.sm { width: 22px; height: 22px; font-size: 11px; }
.speaking .av { box-shadow: 0 0 0 2px var(--ok); }
.vc-note { padding: 12px 8px 0; }
.chat-main { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-width: 0; }
.chat-head { padding: 12px 18px; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: baseline; }
.chat-head b { font-size: 16px; }
.chat-log { overflow-y: auto; padding: 8px 0 12px; }
.chan-start { padding: 24px 18px 8px; }
.chan-start h3 { font-family: var(--head); font-size: 28px; text-transform: uppercase; margin: 0; }
.older { text-align: center; padding: 10px; }
.cm { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; padding: 6px 18px 2px 12px; position: relative; }
.cm > .av { margin: 2px 0 0 4px; }
.cm.grouped { padding-top: 0; }
.cm:hover { background: #171717; }
.cm.mentioned { background: rgba(242,163,58,.07); box-shadow: inset 3px 0 0 var(--amber); }
.cm-head { display: flex; gap: 8px; align-items: baseline; }
.cm-head b { font-weight: 600; }
.cs { font-family: var(--mono); font-size: 11px; color: var(--muted); border: 1px solid var(--line-2); padding: 0 5px; }
.cm-time { font-size: 11px; color: var(--dim); }
.cm-time-side { font-size: 10px; color: transparent; text-align: center; padding-top: 4px; font-family: var(--mono); }
.cm:hover .cm-time-side { color: var(--dim); }
.cm-text { color: #e4e4e2; overflow-wrap: anywhere; line-height: 1.45; }
.cm-text a { color: #93c5fd; }
.mention { background: rgba(88,101,242,.3); color: #c9cdfb; padding: 0 2px; }
.msg-del { opacity: 0; background: none; border: 1px solid var(--line-2); color: var(--muted); font-size: 11px; cursor: pointer; align-self: start; padding: 2px 6px; }
.cm:hover .msg-del, .msg-del:focus-visible { opacity: 1; }
.msg-del:hover { border-color: var(--alert); color: #f3c9ca; }
.day-break { display: flex; align-items: center; gap: 10px; margin: 14px 18px 6px; color: var(--dim); font-size: 12px; }
.day-break::before, .day-break::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.chat-compose { display: flex; gap: 8px; padding: 12px 16px 16px; border-top: 1px solid var(--line); }
.chat-compose textarea { flex: 1; resize: none; background: var(--bg); color: var(--text); border: 1px solid var(--line-2); padding: 10px 12px; font: inherit; line-height: 1.4; max-height: 160px; }
.chat-compose textarea:focus { border-color: var(--text); outline: none; }

/* Voice bar (bottom of sidebar, follows you across pages) */
.voice-bar { position: sticky; bottom: 0; margin: 12px -14px -20px; padding: 12px 14px; background: #0f1a12; border-top: 1px solid rgba(74,222,128,.35); }
.vb-top { display: flex; flex-direction: column; margin-bottom: 8px; }
.vb-status { font-weight: 600; font-size: 13px; }
.vb-status.ok { color: #86efac; } .vb-status.wait { color: var(--amber); } .vb-status.bad { color: #f59ea1; }
#vb-room { font-size: 12px; color: var(--muted); text-decoration: none; }
.vb-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.vb-actions .btn[aria-pressed="true"] { border-color: var(--alert); color: #f3c9ca; }

/* ───────── Calendar month grid ───────── */
.cal-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.cal-wrap > .panel, .cal-side > .panel, .cal-side .panel { margin-top: 0; }
.cal-side { display: flex; flex-direction: column; gap: 16px; }
.cal-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.cal-bar h2 { margin: 0 8px; min-width: 200px; text-align: center; }
.legend { display: flex; gap: 10px; flex-wrap: wrap; font-size: 11px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; margin-right: 4px; vertical-align: -1px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-left: 1px solid var(--line); border-top: 1px solid var(--line); margin-bottom: 10px; }
.cal-h { padding: 6px 8px; font-family: var(--head); text-transform: uppercase; letter-spacing: .12em; font-size: 12px; color: var(--muted); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--panel-2); }
.cal-day { min-height: 104px; padding: 4px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-day.out { background: #0e0e0e; }
.cal-day.out .dn { color: var(--dim); }
.cal-day .dn { font-family: var(--mono); font-size: 12px; color: var(--muted); padding: 2px 4px; align-self: flex-end; }
.cal-day.today .dn { background: var(--text); color: var(--bg); font-weight: 600; }
body:not(.applicant) .cal-day:hover { background: #161616; }
.chip-evt { display: block; width: 100%; text-align: left; border: 0; border-left: 3px solid; padding: 3px 5px; font-size: 11px; color: var(--text); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--body); }
.chip-evt b { font-weight: 600; }
.chip-evt.done { opacity: .5; }
.chip-evt.sel { outline: 1px solid var(--text); }
.chip-evt.mine::after { content: " ✔"; color: #86efac; }
.more-evt { background: none; border: 0; color: var(--muted); font-size: 11px; text-align: left; cursor: pointer; padding: 0 5px; }
.t1, .legend i.t1 { --c: #e5484d; } .t2 { --c: #f2a33a; } .t3 { --c: #60a5fa; } .t4 { --c: #a78bfa; } .t5 { --c: #a3a3a3; }
.chip-evt { border-left-color: var(--c); background: color-mix(in srgb, var(--c) 16%, transparent); }
.legend i { background: var(--c); }
.evt-detail { border-top: 3px solid var(--c); }
.evt-detail h3 { font-family: var(--head); font-size: 26px; text-transform: uppercase; margin: 8px 0 6px; line-height: 1.05; }
.evt-detail p { margin: 0 0 10px; }
.evt-detail .detail-head { margin-bottom: 0; }
#evt-up .evt-row { cursor: pointer; }

@media (max-width: 1100px) {
  .cal-wrap { grid-template-columns: minmax(0, 1fr); }
  .chat { grid-template-columns: 200px minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .chat { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); height: calc(100vh - 120px); }
  .chat-side { border-right: 0; border-bottom: 1px solid var(--line); max-height: 180px; }
  .cal-day { min-height: 64px; padding: 2px; }
  .chip-evt { font-size: 0; padding: 0; height: 6px; border-left-width: 0; background: var(--c); }
  .chip-evt b { display: none; }
  .legend { display: none; }
  .cal-bar h2 { min-width: 0; font-size: 18px; }
  .voice-bar { margin: 12px -14px -10px; }
}

.badge.admin { border-color: #c084fc; color: #d8b4fe; }
.add-form { grid-template-columns: 1.3fr 1.3fr 1fr auto; }
.add-actions { display: flex; gap: 8px; }
.add-form input[readonly] { color: var(--dim); }
