:root {
  color-scheme: dark;
  --bg: #0a101b;
  --surface: #101a2a;
  --surface-raised: #152136;
  --surface-hover: #1c2a40;
  --stroke: #24344c;
  --text: #edf2fb;
  --muted: #95a3ba;
  --blue: #5a8ef7;
  --blue-soft: #1d3154;
  --green: #48c99a;
  --red: #ff737d;
  --amber: #e6b35c;
  font-family: Inter, 'Segoe UI', ui-sans-serif, system-ui, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
body { min-width: 340px; min-height: 100vh; margin: 0; color: var(--text); background: radial-gradient(ellipse at 18% -15%, #172a47 0, transparent 38%), var(--bg); }
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.app-shell { width: min(1260px, calc(100% - 64px)); margin: 0 auto; }
.topbar { height: 78px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #ffffff0e; }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid #608dfc44; border-radius: 12px; background: linear-gradient(145deg, #233e6b, #172844); color: #a9c7ff; font-size: 19px; font-weight: 700; }
.brand-copy strong, .brand-copy span { display: block; }
.brand-copy strong { font-size: 14px; letter-spacing: .03em; }
.brand-copy span { margin-top: 2px; color: var(--muted); font-size: 11px; }
.topbar-meta, .profile { display: flex; align-items: center; gap: 18px; }
.group-pill { padding: 7px 12px; border: 1px solid var(--stroke); border-radius: 999px; color: #c8d3e5; font-size: 12px; }
.profile { gap: 9px; color: #c8d3e5; font-size: 12px; }
.profile-avatar { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: #283955; color: #c2d6ff; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; padding: 34px 0 24px; }
.eyebrow { margin: 0 0 7px; color: #7897ca; font-size: 10px; font-weight: 700; letter-spacing: .13em; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 6px; font-size: clamp(27px, 3vw, 34px); font-weight: 600; letter-spacing: -.04em; }
.heading-note { margin: 0; color: var(--muted); font-size: 13px; }
.clock-card { display: flex; align-items: center; gap: 12px; min-width: 196px; padding: 11px 14px; border: 1px solid var(--stroke); border-radius: 13px; background: #111b2bcc; }
.live-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px #48c99a80; }
.clock-card small, .clock-card strong { display: block; }
.clock-card small { margin-bottom: 2px; color: var(--muted); font-size: 9px; letter-spacing: .12em; }
.clock-card strong { font-size: 17px; font-variant-numeric: tabular-nums; }
.clock-date { margin-left: auto; color: var(--muted); font-size: 11px; }
.current-banner { display: flex; align-items: center; gap: 14px; min-height: 88px; padding: 17px 20px; border: 1px solid #496faf66; border-radius: 16px; background: linear-gradient(105deg, #1b3151, #142239 70%); }
.current-icon { width: 40px; height: 40px; display: grid; place-items: center; flex: none; border: 1px solid #7299e866; border-radius: 13px; background: #4779db2b; color: #a9c6ff; font-size: 22px; }
.current-copy { min-width: 0; flex: 1; }
.current-kicker { display: block; margin-bottom: 2px; color: #8eafea; font-size: 9px; font-weight: 700; letter-spacing: .12em; }
.current-copy strong { display: block; overflow: hidden; font-size: 15px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.current-copy > span:last-child { display: block; margin-top: 2px; color: #b0bfd5; font-size: 12px; }
.text-button { padding: 9px 12px; border: 1px solid #ffffff1c; border-radius: 10px; background: #ffffff08; color: #dbe6f8; font-size: 12px; cursor: pointer; }
.text-button:hover { background: #ffffff14; }
.calendar-section { margin: 29px 0 22px; }
.calendar-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 13px; }
.calendar-heading h2, .panel-heading h2 { margin: 0; font-size: 16px; font-weight: 600; }
.calendar-heading p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.week-controls { display: flex; gap: 7px; }
.icon-button { width: 31px; height: 31px; border: 1px solid var(--stroke); border-radius: 9px; background: var(--surface); color: #c9d5e8; font-size: 20px; line-height: 1; cursor: pointer; }
.icon-button:hover { background: var(--surface-hover); }
.day-strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 9px; }
.day-button { position: relative; min-height: 61px; padding: 10px 13px; border: 1px solid var(--stroke); border-radius: 13px; background: #101928cc; text-align: left; cursor: pointer; transition: border-color .15s ease, background .15s ease, transform .15s ease; }
.day-button:hover { transform: translateY(-1px); background: var(--surface-hover); }
.day-button[aria-pressed="true"] { border-color: #5a8ef7; background: linear-gradient(135deg, #203c69, #172b49); box-shadow: inset 0 0 0 1px #5a8ef72b; }
.day-name { display: block; color: #aebbd0; font-size: 11px; }
.day-date { display: block; margin-top: 2px; color: var(--text); font-size: 14px; font-weight: 600; }
.day-mark { position: absolute; top: 13px; right: 13px; width: 6px; height: 6px; border-radius: 50%; background: var(--blue); }
.day-mark.no-classes { background: #536176; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr); align-items: start; gap: 17px; }
.panel { min-width: 0; border: 1px solid var(--stroke); border-radius: 16px; background: linear-gradient(145deg, #111c2b, #0f1826); }
.schedule-panel { padding: 18px; }
.attendance-panel { padding: 18px; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 13px; }
.panel-heading p:not(.eyebrow) { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.count-badge { padding: 5px 9px; border-radius: 999px; background: #202d42; color: #b6c6df; font-size: 11px; white-space: nowrap; }
.lesson-list { display: grid; gap: 8px; }
.lesson-card { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; align-items: start; gap: 12px; width: 100%; padding: 13px 12px; border: 1px solid transparent; border-radius: 12px; background: #172337; text-align: left; cursor: pointer; transition: background .15s ease, border-color .15s ease; }
.lesson-card:hover { background: #1b2a40; }
.lesson-card[aria-pressed="true"] { border-color: #5a8ef77a; background: #1b2c47; }
.lesson-card.is-current:not([aria-pressed="true"]) { border-color: #4bc69b55; }
.lesson-time { color: #e8eef9; font-size: 12px; font-variant-numeric: tabular-nums; font-weight: 600; }
.lesson-time span { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; font-weight: 400; }
.lesson-info { min-width: 0; }
.lesson-kind { display: inline-flex; align-items: center; margin-bottom: 5px; padding: 3px 7px; border-radius: 6px; background: #29416a; color: #b4ceff; font-size: 9px; }
.lesson-kind.lab { background: #483b25; color: #f0c87f; }
.lesson-kind.practice { background: #263d39; color: #8ce0be; }
.lesson-title { display: block; color: #e7edf7; font-size: 12px; font-weight: 500; line-height: 1.4; }
.lesson-state { align-self: center; color: #71819a; font-size: 13px; }
.lesson-card[aria-pressed="true"] .lesson-state { color: #80a9ff; }
.lesson-state.current-label { color: var(--green); font-size: 9px; white-space: nowrap; }
.lesson-card.is-current .lesson-state::after { content: ''; }
.day-button.is-today:not([aria-pressed="true"]) { border-color: #48c99a66; }
.empty-day { display: grid; place-items: center; min-height: 210px; padding: 25px; border: 1px dashed #34445d; border-radius: 12px; color: var(--muted); text-align: center; }
.empty-day strong { display: block; margin-bottom: 5px; color: #dbe4f2; font-size: 14px; font-weight: 500; }
.attendance-heading { align-items: start; margin-bottom: 11px; }
.attendance-heading .eyebrow { margin-bottom: 5px; }
.attendance-heading h2 { max-width: 380px; font-size: 15px; line-height: 1.4; }
.attendance-total { flex: none; padding: 7px 10px; border: 1px solid #2e425f; border-radius: 10px; background: #18273c; color: #dae6f8; font-size: 12px; font-variant-numeric: tabular-nums; }
.attendance-progress { height: 4px; overflow: hidden; margin: 0 0 15px; border-radius: 999px; background: #25334a; }
.attendance-progress span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #3ea983, #72d2aa); transition: width .2s ease; }
.student-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.student-count { color: #aebbd0; font-size: 11px; }
.add-toggle { padding: 6px 9px; border: 1px solid #32425a; border-radius: 8px; background: #172438; color: #c9d9f4; font-size: 11px; cursor: pointer; }
.add-toggle:hover { border-color: #5a8ef7; }
.add-student-form { display: flex; gap: 7px; margin-bottom: 12px; }
.add-student-form[hidden] { display: none; }
.add-student-form input { min-width: 0; flex: 1; padding: 10px 11px; border: 1px solid #33445f; border-radius: 9px; background: #0e1725; color: var(--text); font-size: 12px; }
.add-student-form input::placeholder { color: #71819a; }
.primary-button { padding: 0 13px; border: 0; border-radius: 9px; background: #4b7ee2; color: white; font-size: 11px; font-weight: 600; cursor: pointer; }
.primary-button:hover { background: #6090ed; }
.student-list { max-height: 330px; overflow: auto; }
.student-row { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto 26px; align-items: center; gap: 9px; min-height: 49px; border-top: 1px solid #ffffff0d; }
.student-index { color: #70819a; font-size: 10px; font-variant-numeric: tabular-nums; }
.student-name { overflow: hidden; color: #e0e8f4; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.status-actions { display: flex; gap: 5px; }
.status-button { min-width: 54px; padding: 6px 9px; border: 1px solid #32415a; border-radius: 8px; background: #19263a; color: #bac7d9; font-size: 10px; cursor: pointer; }
.status-button:hover { background: #21324b; }
.status-button.present[aria-pressed="true"] { border-color: #307b64; background: #193d36; color: #78ddb2; }
.status-button.absent[aria-pressed="true"] { border-color: #85464c; background: #40272f; color: #ff9aa0; }
.remove-student { width: 26px; height: 26px; border: 0; border-radius: 7px; background: transparent; color: #76849a; font-size: 16px; cursor: pointer; }
.remove-student:hover { background: #40272f; color: #ff9aa0; }
.empty-students { display: grid; place-items: center; min-height: 200px; padding: 25px; border: 1px dashed #34445d; border-radius: 11px; text-align: center; }
.empty-students .empty-icon { display: grid; place-items: center; width: 38px; height: 38px; margin-bottom: 10px; border-radius: 12px; background: #1e2e47; color: #8db2fc; font-size: 19px; }
.empty-students strong { color: #dfe8f5; font-size: 13px; font-weight: 500; }
.empty-students p { max-width: 250px; margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.storage-note { display: flex; align-items: center; gap: 6px; margin: 13px 0 0; color: #77879f; font-size: 10px; }
.footer-note { display: flex; justify-content: space-between; gap: 15px; padding: 17px 2px 25px; color: #728199; font-size: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }

@media (max-width: 860px) {
  .app-shell { width: min(100% - 36px, 700px); }
  .content-grid { grid-template-columns: 1fr; }
  .attendance-panel { min-height: 320px; }
}
@media (max-width: 560px) {
  .app-shell { width: calc(100% - 24px); }
  .topbar { height: 67px; }
  .group-pill, .profile > span:last-child { display: none; }
  .topbar-meta { gap: 0; }
  .page-heading { align-items: start; padding: 27px 0 18px; }
  .heading-note { max-width: 260px; line-height: 1.5; }
  .clock-card { min-width: auto; padding: 9px; }
  .clock-date { display: none; }
  .current-banner { gap: 10px; padding: 13px; }
  .current-copy strong { font-size: 13px; }
  .text-button { padding: 8px; }
  .day-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .calendar-section { margin-top: 22px; }
  .schedule-panel, .attendance-panel { padding: 14px; }
  .lesson-card { grid-template-columns: 62px minmax(0, 1fr) 12px; gap: 8px; padding: 11px 9px; }
  .footer-note { flex-direction: column; gap: 5px; }
}
