/* Each workspace has an identity; record status colors keep their own meaning. */
:root{
  --page-bg:#f5f7f3;--ink:#213c36;--accent:#164f45;--accent-hover:#0f4038;
  --sidebar-bg:#164f45;--sidebar-text:#c8dcd2;--soft:#e8f0e3;
  --line:#d8e3d4;--muted:#627a6b;--surface:#fff;--focus:#78a58a;
}
:root[data-theme=attendance]{
  --page-bg:#f3f6fc;--ink:#223a59;--accent:#245ba0;--accent-hover:#19477f;
  --sidebar-bg:#193c68;--sidebar-text:#cbdcf3;--soft:#e7effc;
  --line:#d5e0f0;--muted:#657b98;--surface:#fff;--focus:#85ace0;
}
:root[data-theme=grades]{
  --page-bg:#fcf8f1;--ink:#4c3923;--accent:#926117;--accent-hover:#744b11;
  --sidebar-bg:#594020;--sidebar-text:#e6d7bb;--soft:#f5ead5;
  --line:#e7d9bf;--muted:#827154;--surface:#fffdfa;--focus:#cda45c;
}
body{background:var(--page-bg);color:var(--ink)}
input,select,textarea{color:var(--ink);border-color:var(--line)}
button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline-color:var(--focus)}
.sidebar{background:var(--sidebar-bg)}
.brand .brand-icon{display:grid;place-items:center;width:44px;height:44px;border:1px solid #ffffff40;border-radius:12px;color:#fff;flex-shrink:0}
.brand-icon svg{width:27px;height:27px}
.brand .brand-word{font-size:48px;line-height:1.1;font-weight:650;letter-spacing:0;font-family:system,-apple-system,BlinkMacSystemFont,"Noto Sans SC",sans-serif}
.brand small,.side-note{color:var(--sidebar-text)}
.navigation .nav{color:var(--sidebar-text);gap:11px;padding:11px 13px;border:1px solid transparent}
.nav[data-view=class]{--nav-color:#245e4a;--nav-soft:#e6f2e8}
.nav[data-view=attendance]{--nav-color:#245ba0;--nav-soft:#e8f0ff}
.nav[data-view=grades]{--nav-color:#885b18;--nav-soft:#fff0cf}
.nav-mark{display:grid;place-items:center;flex-shrink:0;width:28px;height:28px;border-radius:8px;background:var(--nav-soft);color:var(--nav-color);font-size:17px;font-weight:700;font-family:system,-apple-system,BlinkMacSystemFont,"Noto Sans SC",sans-serif}
.navigation .nav.active{background:var(--nav-soft,var(--soft));color:var(--nav-color,var(--accent));border-color:#ffffff40;box-shadow:0 3px 12px #0000000c}
.nav.active .nav-mark{background:var(--nav-color);color:#fff}
.nav:not(.active):hover{border-color:#ffffff20}
.side-note{line-height:1.9}.side-note strong{color:#fff}
.page-heading{display:flex;align-items:center;gap:16px}
.page-mark{display:grid;place-items:center;width:64px;height:64px;flex-shrink:0;border:1px solid var(--line);border-radius:18px;background:var(--soft);color:var(--accent);font-size:38px;font-weight:650;line-height:1;font-family:system,-apple-system,BlinkMacSystemFont,"Noto Sans SC",sans-serif}
.topbar h1{color:var(--ink);font-size:25px;line-height:1.4}
.eyebrow,.bottom-note,.data-note{color:var(--muted)}
.button{color:var(--accent);background:var(--soft)}
.button.primary{background:var(--accent);color:#fff}
.button.primary:hover{background:var(--accent-hover)}
.button.outline{border-color:var(--line);background:transparent}
.button.danger{background:#a94b3a;color:#fff}
.language-switcher{border-color:var(--line);background:var(--surface)}
.language-switcher button{color:var(--muted)}
.language-switcher button[aria-pressed=true]{background:var(--accent)}
.language-switcher button:hover:not([aria-pressed=true]){background:var(--soft)}
.pill:not(.warn){background:var(--soft);color:var(--accent)}
.pill:not(.warn) .dot{background:var(--accent)}
.panel,.empty,.metric,.table-wrap{background:var(--surface);border-color:var(--line)}
th{background:var(--soft);color:var(--muted)}
td{border-color:var(--line)}
.section-header h2 span{background:var(--soft);color:var(--muted)}
.filters label{color:var(--muted)}
#toast{background:var(--accent)}
dialog{background:var(--surface);color:var(--ink);border-color:var(--line)}
dialog::backdrop{backdrop-filter:none}
html[dir=rtl] .sidebar{border-inline-end-color:var(--accent)}

/* Attendance: blue interaction surfaces, green/red/amber for attendance statuses. */
.attendance-intro{border-color:var(--line)}
.attendance-intro p:not(.eyebrow),.attendance-controls label,.attendance-voice-fields label,
.attendance-progress,.attendance-focus p,.attendance-voice-settings{color:var(--muted)}
.attendance-day,.attendance-called-name,.attendance-name{color:var(--accent)}
.attendance-count{border-color:var(--line)}
.attendance-count.unmarked{background:var(--soft)}
.attendance-count span{color:var(--muted)}
.attendance-progress progress,.attendance-progress progress::-webkit-progress-bar{background:var(--line)}
.attendance-progress progress::-webkit-progress-value{background:var(--accent)}
.attendance-progress progress::-moz-progress-bar{background:var(--accent)}
.attendance-focus{background:var(--soft);border-color:var(--line)}
.attendance-focus.speaking{border-color:var(--accent);box-shadow:0 0 0 3px var(--soft)}
.attendance-student{border-color:var(--line)}
.attendance-student.selected{border-color:var(--accent);box-shadow:0 0 0 2px var(--soft)}
.attendance-name svg{color:var(--accent)}
.attendance-student-meta,.attendance-focus small{color:var(--muted)}
:root[data-theme=attendance] #name-audio-panel{border-color:var(--line);background:var(--surface)}

/* Grades: warm paper, amber scores and active controls. */
.grades-heading,.grades-tabs{border-color:var(--line)}
.grades-heading p:not(.eyebrow),.grades-controls label,.grades-history-filters label,
.grades-source,.grades-metrics span,.grades-student-top,.grades-student-bottom,
.grades-reason p,.grades-reason summary{color:var(--muted)}
.grades-metrics>div,.grades-student{background:var(--surface);border-color:var(--line)}
.grades-tabs button{color:var(--muted)}
.grades-tabs button[aria-selected=true]{border-bottom-color:var(--accent);color:var(--accent)}
.grades-student{color:var(--ink)}
.grades-student:hover{border-color:var(--accent);box-shadow:0 3px 14px #5940200c}
.grades-current{color:var(--accent)}
.grades-current small{color:var(--muted)}
.grades-student.grades-low{background:#fff2eb;border-color:#e6bca5}
.grades-low .grades-current{color:#a14d2d}
.grades-check input{accent-color:var(--accent)}
.grades-score-preview{background:var(--soft)}
.grades-score-preview strong{color:var(--accent)}
.grades-modal-name{color:var(--ink)!important}

@media(max-width:1100px){.brand .brand-word{font-size:42px}.page-mark{width:58px;height:58px;font-size:34px}.topbar h1{font-size:24px}}
@media(max-width:800px){.brand .brand-word{font-size:32px}.brand .brand-icon{width:38px;height:38px}.brand-icon svg{width:24px;height:24px}.navigation .nav{padding:9px 8px;gap:7px}.nav-mark{width:24px;height:24px;font-size:15px}.page-heading{gap:12px}.page-mark{width:54px;height:54px;border-radius:15px;font-size:32px}.topbar h1{font-size:23px}.side-note{display:none}}
@media(max-width:480px){.navigation .nav{font-size:12px}.nav-mark{width:22px;height:22px;font-size:14px}.page-mark{width:48px;height:48px;font-size:29px}.page-heading .eyebrow{font-size:10px;line-height:1.6;letter-spacing:0}.topbar h1{font-size:22px}}
