:root {
  font-family: Inter, Segoe UI, system-ui, sans-serif;
  color: #183a34;
  background: #f2f7f4;
  font-synthesis: none;
  --ink: #183a34;
  --muted: #647e76;
  --green: #126b5d;
  --line: #dce8e2;
  --surface: #fff;
  --danger: #9e3939;
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 25px; letter-spacing: -.7px; margin-bottom: 0; }
h2 { font-size: 24px; letter-spacing: -.5px; margin-bottom: 0; }
h3 { font-size: 16px; margin-bottom: 0; }
p { line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button { border: 0; border-radius: 8px; background: var(--green); color: #fff; padding: 10px 15px; font-weight: 650; cursor: pointer; white-space: nowrap; }
button:hover { filter: brightness(.96); }
button:disabled { opacity: .48; cursor: default; }
button.quiet { background: #eaf2ee; color: #28584e; }
button.danger { background: var(--danger); color: #fff; }
button.text-button { background: transparent; color: var(--green); padding: 5px 0; font-size: 12px; }
input, select, textarea { width: 100%; min-width: 0; border: 1px solid #bfd2c9; border-radius: 8px; background: #fff; color: var(--ink); padding: 10px 11px; }
textarea { resize: vertical; min-height: 100px; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 3px solid #73cdb6; outline-offset: 2px; }
label { display: flex; flex-direction: column; gap: 7px; font-size: 13px; font-weight: 650; }
.eyebrow { display: block; color: #5a7a70; font-size: 10px; font-weight: 800; letter-spacing: 1.6px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.tag { display: inline-flex; align-items: center; border-radius: 6px; padding: 5px 9px; background: #e7f3ed; color: #246753; font-size: 12px; font-weight: 700; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px; box-shadow: 0 4px 18px #214b3710; }
.site-header { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 19px max(24px, calc((100vw - 1600px) / 2 + 28px)); background: #fff; border-bottom: 1px solid var(--line); }
.brand-role { display: inline-block; vertical-align: middle; border-radius: 5px; padding: 4px 7px; background: #e8f4ed; color: #276852; font-size: 11px; letter-spacing: 0; }
.account { display: flex; align-items: center; gap: 14px; font-size: 12px; color: var(--muted); }
.login { max-width: 440px; margin: 70px auto; }
.login h2 { margin: 10px 0; }
.login p { color: var(--muted); font-size: 14px; }
.login label { margin-bottom: 15px; }
.login button { width: 100%; }
#error { max-width: 1600px; margin: 15px auto 0; padding: 13px 18px; background: #fbe9e6; color: #8b332f; border-radius: 8px; }
main { max-width: 1600px; margin: 0 auto; padding: 24px 28px 48px; }
.session-bar { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.session-context { display: flex; align-items: center; gap: 24px; min-width: 0; }
.class-picker { min-width: 190px; width: 220px; }
.session-context h2 { margin: 3px 0 5px; font-size: 20px; }
.session-context p { margin: 0; }
.session-controls { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; }
.session-badge { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 20px; background: #edf1ef; color: #476358; font-size: 12px; font-weight: 750; }
.session-badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.session-badge.is-live { background: #dff4e8; color: #147450; }
.session-clock { color: var(--muted); font-size: 13px; white-space: nowrap; }
.view-nav { display: flex; gap: 6px; margin: 19px 0 24px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.view-nav::-webkit-scrollbar { display: none; }
.view-nav button { border-radius: 8px 8px 0 0; background: transparent; color: #5a746a; padding: 12px 15px; font-size: 13px; }
.view-nav button[aria-current="page"] { color: var(--green); box-shadow: inset 0 -3px var(--green); background: #eaf4ed; }
.nav-count { display: inline-flex; min-width: 19px; justify-content: center; border-radius: 12px; padding: 2px 5px; margin-left: 3px; background: #e6eeea; color: #426058; font-size: 10px; }
.view-heading { display: flex; justify-content: space-between; align-items: end; gap: 14px; margin-bottom: 17px; }
.view-heading h2 { margin-top: 4px; }
.stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; min-width: 0; text-align: left; background: #fff; color: var(--ink); border: 1px solid var(--line); border-top: 4px solid #96b4a9; border-radius: 10px; padding: 14px 15px; }
.stat strong { font-size: 28px; line-height: 1; letter-spacing: -.8px; }
.stat span { font-size: 10px; letter-spacing: .8px; color: var(--muted); white-space: normal; }
.stat[aria-pressed="true"] { outline: 2px solid var(--green); outline-offset: 1px; background: #f4fbf7; }
.stat.status-ON_TASK { border-top-color: #3d9a79; }
.stat.status-OFF_TASK { border-top-color: #d26962; }
.stat.status-AWAY_FROM_EDGE { border-top-color: #8b74a1; }
.stat.status-IDLE { border-top-color: #d7ac57; }
.stat.status-DISCONNECTED { border-top-color: #a8b8b1; }
.live-layout { display: grid; grid-template-columns: minmax(0, 1fr) 285px; gap: 16px; align-items: start; }
.live-students, .alert-peek { min-width: 0; }
.student-toolbar { display: flex; align-items: end; gap: 12px; }
.search-label { flex: 1; }
.sort-label { width: 185px; flex: none; }
#visibleCount { margin: 12px 0 15px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); gap: 12px; }
.student-card { display: flex; flex-direction: column; align-items: stretch; gap: 9px; min-height: 183px; text-align: left; white-space: normal; background: #fff; color: var(--ink); border: 1px solid var(--line); border-left: 4px solid #45a582; border-radius: 10px; padding: 15px; }
.student-card:hover { box-shadow: 0 5px 15px #214b3718; }
.student-card.OFF_TASK { border-left-color: #c74b4b; background: #fff8f7; }
.student-card.AWAY_FROM_EDGE { border-left-color: #80668a; }
.student-card.IDLE { border-left-color: #caa151; }
.student-card.DISCONNECTED { border-left-color: #abb8b3; background: #fafcfa; }
.card-header { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.card-header strong { font-size: 15px; line-height: 1.25; }
.station-tag { display: inline-block; border-radius: 5px; padding: 3px 6px; background: #e5f0e9; color: #245b4d; font-size: 10px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-weight: 800; }
.student-card .state { font-size: 11px; font-weight: 800; letter-spacing: .4px; text-transform: uppercase; }
.student-card.OFF_TASK .state { color: #ab3e3e; }
.student-card .domain { font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.student-card .duration, .student-card .last-update { color: var(--muted); font-size: 11px; font-weight: 500; }
.student-card .last-update { margin-top: auto; }
.student-card .warning { color: #986a16; font-size: 11px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.alerts, .roster { list-style: none; padding: 0; margin: 0; }
.alerts li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 12px; }
.alerts li:first-child { border-top: 0; }
.alerts li.muted { color: var(--muted); }
.alerts button { font-size: 11px; padding: 7px 9px; }
.alerts .alert-detail { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; white-space: normal; text-align: left; background: none; color: var(--ink); padding: 3px 0; }
.alert-detail strong { font-size: 12px; }
.alert-detail span { color: var(--muted); font-weight: 500; }
.alerts-full li { padding: 14px 0; }
.student-management { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 16px; align-items: start; }
.student-management .panel { min-width: 0; }
.student-management h3 { margin-bottom: 15px; }
.inline, .actions, .roster-tools { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.inline input { flex: 1; width: 90px; }
.station-input { max-width: 78px; }
.roster-tools { margin-top: 13px; }
.roster-tools button { font-size: 12px; }
.roster { margin-top: 15px; }
.roster li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.roster-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.roster-main input[type=checkbox] { flex: none; width: 17px; height: 17px; margin: 0; cursor: pointer; }
.roster-identity { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.roster-name { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; min-width: 0; }
.roster-name strong { font-size: 13px; overflow-wrap: anywhere; }
.roster-identity small { color: var(--muted); font-size: 11px; }
.roster .station-tag { border: 1px solid #c9ddd1; cursor: pointer; }
.roster-actions { display: flex; align-items: center; gap: 4px; }
.roster-actions .roster-icon-button { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0; border-radius: 7px; background: transparent; color: #375f58; }
.roster-actions .roster-icon-button:hover { background: #e9f1ee; color: #124f47; }
.roster-actions .roster-icon-button.danger { background: transparent; color: var(--danger); }
.roster-actions .roster-icon-button.danger:hover { background: #fce9e6; color: #822626; }
.roster-actions .roster-icon-button svg { width: 18px; height: 18px; }
#codeNotice { font-size: 12px; margin: 15px 0 6px; }
#enrollmentCode { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; }
.report-picker { margin-bottom: 16px; max-width: 420px; }
.report-picker label { margin: 0; }
.table-wrap { overflow: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; font-size: 12px; }
th, td { border-bottom: 1px solid var(--line); padding: 12px 9px; white-space: nowrap; }
th { color: var(--muted); text-transform: uppercase; font-size: 10px; }
.rule-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
details { margin: 10px 0 18px; }
summary { color: var(--green); cursor: pointer; font-size: 13px; font-weight: 700; margin: 12px 0 18px; }
.check { flex-direction: row; align-items: center; font-weight: 500; }
.check input { width: auto; }
.actions { margin-top: 18px; }
.empty { grid-column: 1 / -1; padding: 38px 22px; text-align: center; border-radius: 10px; background: #eaf2ed; color: var(--muted); font-size: 14px; }
dialog { width: min(660px, 92vw); max-height: 85vh; border: 1px solid var(--line); border-radius: 14px; padding: 26px; color: var(--ink); }
dialog::backdrop { background: #162f2c99; }
dialog .section-heading { margin-bottom: 12px; }
dialog h2 { font-size: 21px; }
#timeline { padding-left: 18px; font-size: 13px; }
#timeline li { padding: 9px 2px; }
#timeline time { display: inline-block; min-width: 95px; color: var(--muted); }
.bulk-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 12px 0; }
footer { padding: 24px; border-top: 1px solid var(--line); color: var(--muted); text-align: center; font-size: 11px; }
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .live-layout { grid-template-columns: 1fr; }
  .alert-peek { order: -1; }
}
@media (max-width: 740px) {
  .site-header { padding: 16px 18px; align-items: flex-start; }
  .account { flex-direction: column; align-items: flex-end; gap: 5px; }
  .account span { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  main { padding: 18px; }
  .session-bar, .session-context { flex-direction: column; align-items: stretch; gap: 15px; }
  .session-controls { justify-content: flex-start; }
  .class-picker { width: 100%; }
  .student-management, .rule-grid { grid-template-columns: 1fr; }
  .student-toolbar { flex-wrap: wrap; }
  .sort-label { width: 100%; }
  .view-heading { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 480px) {
  .site-header h1 { font-size: 21px; }
  .session-bar { padding: 18px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .roster li { grid-template-columns: 1fr; gap: 5px; }
  .roster-actions { padding-left: 27px; }
  .bulk-meta { align-items: flex-start; flex-direction: column; }
}
