:root {
  color-scheme: light;
  --ink: #17252f;
  --muted: #66737b;
  --paper: #f5f3ee;
  --card: #fffdf8;
  --line: #ddd9cf;
  --green: #0f766e;
  --green-dark: #0a5b55;
  --green-soft: #dff3ed;
  --amber: #bd7b1c;
  --red: #b4534b;
  --shadow: 0 16px 40px rgba(23, 37, 47, .08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--paper); color: var(--ink); }
button, input, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.eyebrow { margin: 0 0 8px; font-size: .72rem; font-weight: 800; letter-spacing: .16em; color: var(--green); }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(1.7rem, 3vw, 2.5rem); letter-spacing: -.04em; }
h2 { margin-bottom: 0; font-size: 1.15rem; letter-spacing: -.02em; }

.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 32px 18px; background: radial-gradient(circle at 12% 14%, #e3f2ed 0 18%, transparent 38%), var(--paper); }
.auth-card { width: min(100%, 430px); padding: 38px; background: var(--card); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); }
.brand-mark { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 24px; border-radius: 14px; color: #fff; background: var(--green); font-weight: 900; font-size: 1.4rem; }
.lede { color: var(--muted); line-height: 1.6; }
.privacy-note { margin: 20px 0 0; color: var(--muted); font-size: .82rem; text-align: center; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin: 28px 0 20px; background: #eeece5; border-radius: 12px; }
.auth-tab { border: 0; border-radius: 9px; padding: 10px; background: transparent; color: var(--muted); font-weight: 700; }
.auth-tab.active { background: var(--card); color: var(--ink); box-shadow: 0 2px 8px rgba(23, 37, 47, .08); }
.stack-form { display: grid; gap: 15px; }
label { display: grid; gap: 7px; font-size: .82rem; font-weight: 700; color: var(--ink); }
input, select { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; color: var(--ink); background: #fff; outline: none; }
input:focus, select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(15, 118, 110, .12); }
.primary-btn, .ghost-btn, .text-btn, .score { border: 0; border-radius: 10px; padding: 11px 15px; font-weight: 800; transition: transform .15s ease, background .15s ease; }
.primary-btn { color: #fff; background: var(--green); }
.primary-btn:hover { background: var(--green-dark); transform: translateY(-1px); }
.ghost-btn { color: var(--ink); background: #f0eee8; }
.ghost-btn:hover { background: #e4e1d8; }
.text-btn { padding: 10px 0; color: var(--green); background: transparent; }
.form-message, .app-message { min-height: 1.2em; margin: 14px 0 0; color: var(--red); font-size: .86rem; }
.toast { position: fixed; z-index: 20; top: 18px; right: 18px; max-width: min(360px, calc(100% - 36px)); padding: 12px 15px; border: 1px solid #b4ddd1; border-radius: 12px; color: var(--green-dark); background: var(--green-soft); box-shadow: var(--shadow); opacity: 0; pointer-events: none; transform: translateY(-8px); transition: opacity .2s ease, transform .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }

.app-shell { width: min(1480px, 100%); margin: auto; padding: 30px clamp(16px, 3vw, 42px) 60px; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.topbar-actions, .panel-actions, .selection-actions, .session-meta { display: flex; align-items: center; gap: 10px; }
.user-pill { max-width: 240px; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-size: .82rem; }
.control-strip { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 22px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255, 253, 248, .85); }
.group-picker { width: min(560px, 100%); }
.session-meta { flex-wrap: wrap; justify-content: flex-end; color: var(--muted); font-size: .82rem; }
.status-dot::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: var(--green); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat-card { padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); }
.stat-card span, .stat-card small { display: block; color: var(--muted); font-size: .78rem; }
.stat-card strong { display: block; margin: 4px 0 2px; font-size: 1.75rem; letter-spacing: -.04em; }
.stat-card.accent { background: var(--green); color: #fff; border-color: var(--green); }
.stat-card.accent span, .stat-card.accent small { color: #cce8df; }
.workspace-grid { display: grid; grid-template-columns: minmax(300px, .9fr) minmax(430px, 1.4fr); gap: 18px; margin-bottom: 18px; }
.panel { padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); box-shadow: 0 8px 24px rgba(23, 37, 47, .035); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.panel-heading select { width: auto; min-width: 145px; padding: 8px 10px; }
.selected-student { display: grid; place-items: center; min-height: 144px; padding: 18px; border: 1px dashed #a9cfc4; border-radius: 14px; text-align: center; background: #f1faf7; }
.selected-student strong { display: block; font-size: clamp(1.4rem, 3vw, 2rem); letter-spacing: -.04em; }
.selected-student small { display: block; margin-top: 5px; color: var(--muted); }
.empty-state { color: var(--muted); }
.selection-actions { margin-top: 14px; }
.selection-actions .primary-btn { flex: 1; }
.score-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.score { font-size: 1.05rem; }
.score.positive { color: #176b57; background: #dff3ed; }.score.neutral { color: #6b6670; background: #eeecef; }.score.negative { color: #a14640; background: #f8e4df; }
.score:disabled, button:disabled { cursor: not-allowed; opacity: .45; }
.helper-text { margin: 14px 0 0; color: var(--muted); font-size: .78rem; line-height: 1.5; }
.attendance-list { display: grid; gap: 8px; max-height: 330px; overflow: auto; padding-right: 4px; }
.attendance-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; background: #f6f4ef; }
.attendance-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .86rem; }
.attendance-buttons { display: flex; gap: 4px; }.attendance-buttons button { min-width: 32px; padding: 6px 7px; border: 0; border-radius: 7px; color: var(--muted); background: transparent; font-size: .75rem; }.attendance-buttons button.active { color: #fff; background: var(--green); }
.roster-panel { margin-bottom: 18px; }.table-wrap { overflow-x: auto; } table { width: 100%; border-collapse: collapse; min-width: 700px; } th, td { padding: 11px 8px; border-bottom: 1px solid #ebe8df; text-align: left; vertical-align: middle; font-size: .84rem; } th { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; } td input { min-width: 220px; padding: 8px 10px; }
.badge { display: inline-flex; padding: 5px 8px; border-radius: 999px; font-size: .73rem; font-weight: 800; }.badge.present { color: #176b57; background: #dff3ed; }.badge.pending { color: #7a6b49; background: #f7eed3; }.badge.absent { color: #a14640; background: #f8e4df; }.badge.late { color: #835a1a; background: #f9e7bd; }
.lower-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }.report-list, .history-list { display: grid; gap: 8px; }.report-line, .history-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid #ebe8df; font-size: .84rem; }.report-line:last-child, .history-item:last-child { border-bottom: 0; }.report-line span, .history-item small { color: var(--muted); }.history-item { display: grid; grid-template-columns: 1fr auto; }.history-item small { display: block; font-size: .72rem; }.empty-copy { color: var(--muted); font-size: .85rem; }

@media (max-width: 980px) { .workspace-grid, .lower-grid { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .app-shell { padding-top: 20px; }.topbar, .control-strip { align-items: stretch; flex-direction: column; }.session-meta { justify-content: flex-start; }.stats-grid { grid-template-columns: repeat(2, 1fr); }.auth-card { padding: 28px 22px; }.panel { padding: 17px; }.panel-heading { flex-direction: column; }.panel-heading select { width: 100%; }.panel-actions { flex-wrap: wrap; }.topbar-actions { justify-content: space-between; }.user-pill { max-width: 190px; } }
