/* Production presentation layer: one information hierarchy for the real workspace. */
:root {
  --workspace-ink: #102f28;
  --workspace-muted: #6b7a74;
  --workspace-line: #d8e4de;
  --workspace-paper: #ffffff;
  --workspace-canvas: #f4f7f4;
  --workspace-brand: #075a48;
  --workspace-brand-dark: #063f34;
  --workspace-brand-soft: #e8f3ed;
  --workspace-warning: #9a5d11;
  --workspace-warning-soft: #fff4df;
  --workspace-danger: #a63f3a;
  --workspace-danger-soft: #fff0ee;
  --workspace-radius: 12px;
}

[hidden] { display: none !important; }
*, *::before, *::after { box-sizing: border-box; }
a { color: var(--workspace-brand); text-decoration: none; }
button:disabled { cursor: not-allowed; opacity: .56; }

.app-shell { grid-template-columns: 236px minmax(0, 1fr); background: var(--workspace-canvas); }
.sidebar-scrim { display: none; }
.sidebar { padding: 24px 16px 18px; background: linear-gradient(165deg, #073d33 0%, #06352c 64%, #062923 100%); }
.brand { padding: 7px 9px 24px; }
.brand-mark { width: 48px; height: 48px; }
.brand-name { font-size: 20px; }
.brand-sub { margin-top: 3px; }
.nav-group { margin-top: 26px; gap: 7px; }
.nav-label { padding: 0 12px 7px; }
.nav-button { min-height: 48px; padding: 12px 14px; border-radius: 13px; font-size: 16px; }
.nav-button.active { box-shadow: 0 9px 22px rgba(0, 0, 0, .14); }
.identity-card { padding: 15px; border-radius: 15px; }

.topbar { min-height: 82px; padding: 14px 38px; background: rgba(255,255,255,.94); }
.crumb { font-weight: 650; }
.top-actions { gap: 9px; }
.page { max-width: 1480px; padding: 38px 42px 56px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-head > div:first-child { min-width: 0; }
.page-head h1, .page-head p { margin-bottom: 0; }
.page-head h1 { color: var(--workspace-ink); font-size: clamp(30px, 3vw, 37px); letter-spacing: -.045em; line-height: 1.12; }
.page-head p { max-width: 700px; margin-top: 9px; font-size: 16px; line-height: 1.65; }
.eyebrow { color: var(--workspace-brand); font-size: 12px; letter-spacing: .11em; }
.muted { color: var(--workspace-muted); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer;
  min-height: 42px; padding: 9px 15px; border: 1px solid #c7d7ce; border-radius: 11px;
  background: #fff; color: var(--workspace-ink); font-weight: 700; box-shadow: none;
  font: inherit; line-height: 1.25; text-align: center; text-decoration: none; appearance: none;
  transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}
.btn:hover { border-color: #93b3a3; background: #f7fbf8; }
.btn.primary, .btn.btn-primary { background: var(--workspace-brand); border-color: var(--workspace-brand); color: #fff; }
.btn.primary:hover, .btn.btn-primary:hover { background: var(--workspace-brand-dark); border-color: var(--workspace-brand-dark); }
.btn.active { background: var(--workspace-brand); border-color: var(--workspace-brand); color: #fff; }
.btn.danger { color: var(--workspace-danger); border-color: #e5bbb8; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }

.card, .panel {
  border: 1px solid var(--workspace-line); border-radius: var(--workspace-radius);
  background: var(--workspace-paper); box-shadow: 0 7px 24px rgba(18, 53, 43, .035);
}
.card { padding: 24px; margin-bottom: 20px; }
.card h2, .panel h2 { margin-top: 0; color: var(--workspace-ink); }
.card h3 { color: var(--workspace-ink); }
.notice { padding: 14px 16px; border: 1px solid #efd9b7; background: var(--workspace-warning-soft); color: #76500e; border-radius: 12px; }
.empty { display: grid; min-height: 104px; place-items: center; padding: 26px 16px; color: var(--workspace-muted); text-align: center; }
.badge { display: inline-flex; align-items: center; width: fit-content; padding: 5px 9px; border-radius: 999px; background: var(--workspace-brand-soft); color: var(--workspace-brand); font-size: 12px; font-weight: 750; line-height: 1.2; }
.badge.medium { background: var(--workspace-warning-soft); color: var(--workspace-warning); }
.badge.high, .badge.error { background: var(--workspace-danger-soft); color: var(--workspace-danger); }

/* Shared working rows: a short, scan-friendly rhythm instead of full cards. */
.list-row { display: flex; align-items: center; justify-content: space-between; padding: 16px 0; gap: 16px; border-bottom: 1px solid #e7eeea; }
.list-row:last-child { border-bottom: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row h3 { font-size: 16px; margin: 0 0 6px; }
.list-row p { margin: 4px 0; }
.record { padding: 16px 0; border-bottom: 1px solid #e7eeea; }
.record:last-child { border-bottom: 0; }
.tabs { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; }
.tabs .btn { min-height: 40px; }
.preview-sticky { position: sticky; top: 102px; }
.two-col { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .8fr); gap: 22px; align-items: start; }
.field { display: grid; gap: 7px; min-width: 0; color: var(--workspace-ink); font-size: 13px; font-weight: 750; }
.field input, .field select, .field textarea, .filter {
  min-width: 0; width: 100%; border: 1px solid #c5d4cc; border-radius: 11px; padding: 11px 12px;
  background: #fff; color: var(--workspace-ink); font: inherit; font-weight: 500;
}
.field textarea { min-height: 96px; resize: vertical; }
.field small { color: var(--workspace-muted); font-weight: 500; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus, .filter:focus {
  border-color: var(--workspace-brand); outline: 3px solid rgba(7,90,72,.12);
}

/* Learner directory: finding a learner and reviewing one learner are a single workspace. */
.students-toolbar {
  display: flex; align-items: end; justify-content: space-between; gap: 20px;
  padding: 14px 16px; margin-bottom: 18px; border: 1px solid var(--workspace-line);
  border-radius: 16px; background: var(--workspace-paper);
}
.student-search { display: flex; align-items: end; gap: 10px; min-width: min(460px, 100%); flex: 1; }
.student-search label { display: grid; gap: 6px; flex: 1; color: var(--workspace-muted); font-size: 12px; font-weight: 750; }
.student-search input { min-height: 42px; width: 100%; border: 1px solid #c5d4cc; border-radius: 11px; padding: 0 12px; color: var(--workspace-ink); background: #fff; }
.filter-tabs { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.filter-tabs .btn { min-height: 38px; padding: 8px 12px; }
.students-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(310px, .8fr); gap: 20px; align-items: start; }
.student-list-panel, .student-preview {
  border: 1px solid var(--workspace-line); border-radius: var(--workspace-radius); background: var(--workspace-paper);
  box-shadow: 0 7px 24px rgba(18,53,43,.035);
}
.student-list-head { display: flex; justify-content: space-between; align-items: end; gap: 18px; padding: 22px 24px 16px; border-bottom: 1px solid var(--workspace-line); }
.student-list-head h2 { margin: 0; font-size: 21px; letter-spacing: -.025em; }
.student-list-head p, .student-list-head > span { margin: 5px 0 0; color: var(--workspace-muted); font-size: 13px; }
.student-list-head > span { margin: 0; white-space: nowrap; }
.student-directory { padding: 0 12px; }
.student-list-row {
  display: grid; grid-template-columns: 44px minmax(190px, 1.18fr) minmax(190px, 1fr) auto; gap: 15px; align-items: center;
  min-height: 86px; padding: 14px 12px; border-bottom: 1px solid #e7eeea;
}
.student-list-row:last-child { border-bottom: 0; }
.student-list-row.selected { background: var(--workspace-brand-soft); box-shadow: inset 4px 0 0 var(--workspace-brand); }
.student-avatar { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 13px; background: #e8f1ec; color: var(--workspace-brand); font-size: 17px; }
.student-row-main { min-width: 0; }
.student-row-main h3 { margin: 0; color: var(--workspace-ink); font-size: 17px; }
.student-row-main p { overflow: hidden; margin: 4px 0 6px; color: var(--workspace-muted); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.row-state { color: var(--workspace-muted); font-size: 12px; }
.student-row-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px; color: var(--workspace-muted); font-size: 12px; }
.student-row-meta b { min-width: 0; color: var(--workspace-ink); font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.student-row-actions { display: flex; align-items: center; gap: 7px; justify-content: end; }
.student-row-actions .btn { min-height: 38px; padding: 7px 11px; white-space: nowrap; }
.student-preview { padding: 24px; }
.student-preview > header { display: flex; justify-content: space-between; gap: 14px; align-items: start; margin: 7px 0 20px; }
.student-preview h2 { margin: 0; font-size: 25px; letter-spacing: -.035em; }
.student-preview header p { margin: 5px 0 0; color: var(--workspace-muted); }
.preview-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin: 0; border-top: 1px solid var(--workspace-line); border-bottom: 1px solid var(--workspace-line); }
.preview-facts > div { min-height: 68px; padding: 12px 8px; }
.preview-facts > div:nth-child(odd) { border-right: 1px solid var(--workspace-line); }
.preview-facts > div:nth-child(-n+2) { border-bottom: 1px solid var(--workspace-line); }
.preview-facts dt { color: var(--workspace-muted); font-size: 12px; }
.preview-facts dd { margin: 5px 0 0; color: var(--workspace-ink); font-size: 14px; font-weight: 750; }
.preview-priority { padding: 20px 0; }
.preview-priority h3 { margin: 0 0 12px; font-size: 16px; }
.preview-priority p { margin: 8px 0; }
.list-pagination { margin: 0 24px; padding: 18px 0; }

/* The learner archive keeps the current urgency first and expands detail only when useful. */
.profile-hero { display: flex; align-items: center; gap: 17px; min-height: 104px; padding: 21px 24px; margin: 0 0 18px; border: 1px solid #d3e4dc; border-radius: var(--workspace-radius); background: linear-gradient(135deg, #e7f2ec, #f6fbf8); }
.profile-hero > div:nth-child(2) { flex: 1; min-width: 0; }
.profile-hero h2 { margin: 0; color: var(--workspace-ink); font-size: 25px; }
.profile-hero p { margin: 6px 0 0; }
.profile-hero > .actions { margin-left: auto; justify-content: flex-end; }
.profile-hero .student-avatar { width: 58px; height: 58px; flex-basis: 58px; border-radius: 17px; font-size: 23px; background: #fff; }
.profile-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: 0 0 18px; border: 1px solid var(--workspace-line); border-radius: var(--workspace-radius); overflow: hidden; background: var(--workspace-paper); }
.profile-summary > div { min-height: 84px; padding: 17px 19px; border: 0; border-radius: 0; background: transparent; }
.profile-summary > div + div { border-left: 1px solid var(--workspace-line); }
.profile-summary small { display: block; margin-bottom: 8px; color: var(--workspace-muted); }
.profile-summary strong { display: block; overflow: hidden; color: var(--workspace-ink); font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.student-overview-grid { display: grid; grid-template-columns: minmax(0, 1.42fr) minmax(280px, .76fr); gap: 18px; align-items: start; }
.priority-card, .exam-card { border: 1px solid var(--workspace-line); border-radius: var(--workspace-radius); background: var(--workspace-paper); box-shadow: 0 7px 24px rgba(18,53,43,.035); }
.priority-card { padding: 24px; }
.priority-card > header { display: flex; justify-content: space-between; gap: 14px; align-items: start; padding-bottom: 15px; border-bottom: 1px solid var(--workspace-line); }
.priority-card h2, .exam-card h2 { margin: 7px 0 0; font-size: 21px; }
.priority-card .list-row { padding: 16px 0; }
.priority-footnote { margin: 16px 0 0; font-size: 13px; }
.exam-card { padding: 24px; }
.exam-card p { line-height: 1.65; }
.exam-card .exam-countdown { margin: 18px 0 8px; color: var(--workspace-brand); font-size: 18px; font-weight: 800; }
.exam-card .btn { margin-top: 4px; }
.profile-details { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--workspace-line); }
.profile-details summary { color: var(--workspace-brand); cursor: pointer; font-weight: 750; }
.profile-details form { margin-top: 16px; }
.profile-details .field { margin-bottom: 14px; }

/* Owner overview, teacher desk, and staff list use the same quiet working rhythm. */
.status-strip {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; padding: 0;
  overflow: hidden; border-radius: var(--workspace-radius);
  background: linear-gradient(110deg, var(--workspace-brand-dark), var(--workspace-brand));
  box-shadow: 0 10px 24px rgba(7, 63, 52, .15);
}
.status-strip > div {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label action" "value action" "note note";
  align-items: center; gap: 5px 12px; min-width: 0; padding: 19px 20px;
}
.status-strip > div + div { border-left: 1px solid rgba(255,255,255,.18); }
.status-strip small { grid-area: label; color: rgba(255,255,255,.68); font-size: 12px; font-weight: 700; }
.status-strip strong { grid-area: value; overflow: hidden; color: #fff; font-size: 18px; text-overflow: ellipsis; white-space: nowrap; }
.status-strip span { grid-area: note; color: rgba(255,255,255,.72); font-size: 12px; line-height: 1.45; }
.status-strip .btn { grid-area: action; min-height: 36px; padding: 7px 10px; border-color: rgba(255,255,255,.7); background: #fff; color: var(--workspace-brand-dark); }
.metric-strip { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 12px; margin: 18px 0; }
.metric-button { display: grid; gap: 8px; min-width: 0; padding: 18px; border: 1px solid var(--workspace-line); border-radius: 15px; background: #fff; color: var(--workspace-muted); text-decoration: none; box-shadow: 0 5px 15px rgba(18,53,43,.025); }
.metric-button:hover { border-color: #9fc1b0; background: #fbfdfc; }
.metric-button strong { color: var(--workspace-ink); font-size: 29px; line-height: 1; }
.metric-button span { font-size: 13px; }
.overview-grid { display: grid; grid-template-columns: minmax(0,1.45fr) minmax(280px,.75fr); gap: 18px; align-items: stretch; }
.panel.card-pad { padding: 24px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.section-head h2 { margin-bottom: 0; }
.attention-link { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; border-bottom: 1px solid #e7eeea; color: var(--workspace-ink); text-decoration: none; }
.attention-link:last-child { border-bottom: 0; }
.attention-link:hover span { color: var(--workspace-brand); }
.chart-bars { display: flex; align-items: end; gap: clamp(8px,2vw,18px); min-height: 190px; padding: 25px 8px 0; border-bottom: 1px solid var(--workspace-line); }
.chart-bar { display: grid; grid-template-rows: 22px minmax(2px,135px) 24px; align-items: end; justify-items: center; flex: 1; min-width: 0; color: var(--workspace-muted); text-decoration: none; }
.chart-bar b { color: var(--workspace-ink); font-size: 13px; }
.chart-bar i { display: block; width: min(36px,72%); min-height: 3px; border-radius: 8px 8px 2px 2px; background: linear-gradient(180deg,#2a8b70,var(--workspace-brand)); transition: transform .15s ease; }
.chart-bar:hover i { transform: scaleX(1.12); }
.chart-bar span { overflow: hidden; width: 100%; padding-top: 6px; font-size: 11px; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.teachers-panel { margin-top: 18px; }
.work-summary { border-radius: var(--workspace-radius); background: linear-gradient(110deg, var(--workspace-brand-dark), var(--workspace-brand)); }
.work-summary > div { padding: 7px 16px; }
.work-layout { gap: 18px; }
.quiet-card { margin-top: 18px; border: 1px solid var(--workspace-line); border-radius: var(--workspace-radius); background: #f8fbf8; }
.teacher-panel table, .teachers-panel table { border: 1px solid var(--workspace-line); border-radius: 14px; overflow: hidden; }
.teacher-panel th, .teachers-panel th { background: #f7faf8; }
.table-wrap { max-width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 14px; border-bottom: 1px solid #e7eeea; text-align: left; vertical-align: middle; }
th { color: var(--workspace-muted); font-size: 12px; white-space: nowrap; }
td { color: var(--workspace-ink); font-size: 13px; }
tr:last-child td { border-bottom: 0; }
.practice-ratio { display: grid; gap: 7px; min-width: 116px; }
.practice-ratio i { display: block; width: 100%; height: 5px; overflow: hidden; border-radius: 999px; background: #e5eee9; }
.practice-ratio i b { display: block; height: 100%; border-radius: inherit; background: var(--workspace-brand); }

/* Material records separate delivery actions from destructive administration. */
.material-record-card { padding: 0; overflow: hidden; }
.material-record-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 22px 24px; border-bottom: 1px solid var(--workspace-line); }
.material-record-head h2 { margin: 0; font-size: 20px; }
.material-record-head p { margin: 6px 0 0; }
.material-record-body { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 20px 24px; }
.material-record-body .actions { flex: 1; }
.danger-zone { border-top: 1px solid #f0dedc; background: #fffafa; }
.danger-zone > summary { padding: 13px 24px; color: var(--workspace-danger); cursor: pointer; font-size: 13px; font-weight: 700; }
.danger-zone > div { padding: 0 24px 20px; }

/* The login page explains one shared entry and then gets out of the way. */
.login-screen { display: grid; grid-template-columns: minmax(0,1.05fr) minmax(360px,.72fr); align-items: center; gap: clamp(48px,8vw,120px); min-height: 100dvh; padding: clamp(28px,6vw,90px); background: radial-gradient(circle at 12% 18%,rgba(45,137,110,.19),transparent 32%),linear-gradient(140deg,#062f28 0%,#074a3c 55%,#f2f7f3 55%,#f7faf8 100%); }
.login-intro { max-width: 650px; color: #fff; }
.login-mark { width: 74px; height: 74px; margin-bottom: 34px; border-radius: 50%; background: #fff; box-shadow: 0 14px 36px rgba(0,0,0,.2); }
.login-intro .eyebrow { color: #a9d8c7; }
.login-intro h1 { margin: 16px 0 20px; font-size: clamp(36px,5vw,62px); letter-spacing: -.055em; line-height: 1.08; }
.login-intro p { max-width: 560px; color: rgba(255,255,255,.78); font-size: 17px; line-height: 1.75; }
.login-intro ul { display: flex; flex-wrap: wrap; gap: 9px; padding: 0; margin: 30px 0 0; list-style: none; }
.login-intro li { padding: 8px 12px; border: 1px solid rgba(255,255,255,.25); border-radius: 999px; color: rgba(255,255,255,.86); font-size: 13px; }
.login-card { display: grid; gap: 20px; width: 100%; max-width: 460px; margin: 0; padding: clamp(28px,4vw,42px); border: 1px solid rgba(255,255,255,.7); border-radius: 24px; background: rgba(255,255,255,.97); box-shadow: 0 24px 70px rgba(6,47,40,.2); }
.login-card > .brand-mark { display: none; }
.login-card h2 { margin: 6px 0 4px; color: var(--workspace-ink); font-size: 28px; }
.login-card p { margin: 0; }
.password-control { position: relative; }
.password-control input { padding-right: 66px; }
.password-toggle { position: absolute; top: 50%; right: 7px; transform: translateY(-50%); border: 0; background: transparent; color: var(--workspace-brand); cursor: pointer; font-weight: 750; }
.caps-hint { color: var(--workspace-warning) !important; }
.login-status { min-height: 20px; padding: 0; color: var(--workspace-danger); font-size: 13px; }
.login-status:not(.visible) { visibility: hidden; }
.login-submit { width: 100%; min-height: 48px; }
.login-screen.login-simple { display: grid; grid-template-columns: minmax(0, 430px); place-content: center; min-height: 100dvh; padding: 24px; background: radial-gradient(circle at 50% 0,rgba(45,137,110,.16),transparent 42%),#edf4ef; }
.login-simple .login-card { margin: 0; }
.login-simple .login-card > .brand-mark { display: block; width: 58px; height: 58px; margin: 0 auto 4px; border-radius: 50%; background: #fff; }
.login-simple .login-card h1 { margin: 0; color: var(--workspace-ink); font-size: 26px; letter-spacing: -.035em; }

/* New-material flow: each step has one job, with background generation visible but not dominant. */
.stepper { margin: 0 0 26px; }
.upload-layout { gap: 18px; }
.panel.card-pad { border-radius: var(--workspace-radius); }
.file-box {
  min-height: 158px; padding: 22px; background: #f8fbf9;
}
/* file-box is also a .field label: give its text, chooser and helper their
   own grid cells so the native chooser never compresses labels vertically. */
.file-box.field {
  display: grid; grid-template-columns: max-content minmax(0, 1fr); align-items: center;
  gap: 12px 16px; margin-bottom: 0;
}
.file-box.field > input[type="file"] { min-width: 0; width: 100%; padding: 10px 12px; }
.file-box.field > small { grid-column: 1 / -1; }
.full-action { border-color: var(--workspace-line); border-radius: 16px; }
.recent-materials { margin-top: 28px; padding: 13px 2px; color: var(--workspace-muted); }
.recent-materials > summary { cursor: pointer; }
.confirm-layout, .completion-grid { gap: 18px; }
.progress-panel { padding: 28px; }
.success-card { border-radius: var(--workspace-radius); }

/* Reports, history and internal records stay document-like rather than turning into a grid of cards. */
.report-content { border: 1px solid var(--workspace-line); border-radius: var(--workspace-radius); background: #fff; overflow-wrap: anywhere; }
.report-content .report-document { padding-bottom: 24px; }
.report-content a, .record blockquote a { text-decoration: underline; text-underline-offset: 3px; }
.attachments img { border-color: var(--workspace-line); }
.file-attachment { display: inline-grid; grid-template-columns: auto minmax(0,1fr); gap: 3px 9px; min-width: min(100%,260px); padding: 11px 13px; border: 1px solid var(--workspace-line); border-radius: 12px; background: #f8fbf9; color: var(--workspace-ink); text-decoration: none !important; }
.file-attachment > span { grid-row: 1 / span 2; align-self: center; padding: 5px 7px; border-radius: 8px; background: var(--workspace-brand-soft); color: var(--workspace-brand); font-size: 11px; font-weight: 800; }
.file-attachment strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.file-attachment small { color: var(--workspace-muted); font-size: 11px; }
.record blockquote { margin: 12px 0 0; border-left-color: #8eb5a2; }
.login-card { border: 1px solid var(--workspace-line); box-shadow: 0 18px 48px rgba(15,50,40,.11); }
dialog { border-radius: 18px; color: var(--workspace-ink); }

#toast { bottom: 22px; padding: 12px 18px; border-radius: 12px; background: var(--workspace-brand-dark); }

@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 210px minmax(0, 1fr); }
  .sidebar { padding-left: 12px; padding-right: 12px; }
  .page { padding: 32px 30px 48px; }
  .students-layout { grid-template-columns: minmax(0, 1.35fr) minmax(284px, .8fr); }
  .student-list-row { grid-template-columns: 42px minmax(155px, 1.1fr) minmax(150px,.9fr) auto; gap: 11px; }
  .student-row-actions .btn { padding: 7px 9px; }
  .student-overview-grid { grid-template-columns: minmax(0, 1.2fr) minmax(260px, .8fr); }
}

@media (max-width: 960px) {
  .page { padding: 28px 24px 44px; }
  .students-toolbar { align-items: stretch; flex-direction: column; gap: 12px; }
  .student-search { min-width: 0; }
  .filter-tabs { width: 100%; }
  .students-layout, .student-overview-grid, .overview-grid { grid-template-columns: 1fr; }
  .student-preview { position: static; }
  .student-list-row { grid-template-columns: 44px minmax(0,1fr) auto; }
  .student-row-meta { display: none; }
  .student-overview-grid .exam-card { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
  .student-overview-grid .exam-card > .eyebrow, .student-overview-grid .exam-card > h2, .student-overview-grid .exam-card > .profile-details { grid-column: 1 / -1; }
  .metric-strip { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .login-screen { grid-template-columns: minmax(0,.9fr) minmax(340px,.8fr); gap: 36px; padding: 36px; }
  .login-intro h1 { font-size: 39px; }
}

@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { top: 0; bottom: 0; width: min(86vw, 290px); height: 100dvh; transform: translateX(-105%); transition: transform .2s ease; box-shadow: 16px 0 36px rgba(0,0,0,.2); }
  .sidebar { z-index: 30; }
  .sidebar-scrim { position: fixed; z-index: 20; inset: 0; display: block; border: 0; background: rgba(4,26,22,.44); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
  .app-shell.menu-open .sidebar { transform: translateX(0); }
  .app-shell.menu-open .sidebar-scrim { opacity: 1; pointer-events: auto; }
  .topbar { min-height: 66px; padding: 10px 14px; }
  .mobile-menu { display: grid; place-items: center; }
  .crumb, .top-actions .muted { display: none; }
  .top-actions .btn { min-height: 38px; padding: 7px 10px; }
  .page { padding: 24px 14px 36px; }
  .page-head { display: block; margin-bottom: 20px; }
  .page-head h1 { font-size: 30px; }
  .page-head p { margin-top: 7px; font-size: 14px; }
  .page-head .actions { margin-top: 16px; }
  .page-head .actions .btn { flex: 1; }
  .students-toolbar { padding: 13px; border-radius: 15px; }
  .student-search { align-items: stretch; flex-direction: column; gap: 8px; }
  .student-search .btn { width: 100%; }
  .filter-tabs { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
  .filter-tabs .btn { flex: 0 0 auto; }
  .student-list-head { padding: 18px 18px 13px; }
  .student-list-head > span { display: none; }
  .student-directory { padding: 0 8px; }
  .student-list-row { grid-template-columns: 38px minmax(0,1fr); min-height: 0; padding: 14px 9px; }
  .student-avatar { width: 38px; height: 38px; flex-basis: 38px; border-radius: 12px; font-size: 16px; }
  .student-row-main h3 { font-size: 16px; }
  .student-row-actions { grid-column: 2; justify-content: flex-start; margin-top: 2px; }
  .student-row-actions .btn { flex: 1; }
  .student-preview { padding: 20px; }
  .students-layout:not(.has-preview) .student-preview { display: none; }
  .students-layout.has-preview .student-preview { display: block; order: -1; }
  .profile-hero { align-items: flex-start; padding: 19px; }
  .profile-hero > .actions { margin-left: 0; flex-wrap: wrap; }
  .profile-summary { grid-template-columns: 1fr 1fr; }
  .profile-summary > div { min-height: 74px; padding: 14px; }
  .profile-summary > div + div { border-left: 0; }
  .profile-summary > div:nth-child(even) { border-left: 1px solid var(--workspace-line); }
  .profile-summary > div:nth-child(-n+2) { border-bottom: 1px solid var(--workspace-line); }
  .student-overview-grid .exam-card { display: block; }
  .priority-card, .exam-card { padding: 20px; }
  .priority-card > header { align-items: start; }
  .list-row { align-items: start; flex-wrap: wrap; }
  .list-row .actions { width: 100%; }
  .list-row .actions .btn { flex: 1; }
  .student-list-row.list-row { display: grid; align-items: center; }
  .student-list-row.list-row .student-row-actions { width: auto; }
  .status-strip { grid-template-columns: 1fr; }
  .status-strip > div { padding: 15px 16px; }
  .status-strip > div + div { border-top: 1px solid rgba(255,255,255,.18); border-left: 0; }
  .metric-strip { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric-button { padding: 15px; }
  .metric-button strong { font-size: 25px; }
  .overview-grid, .work-layout, .two-col, .confirm-layout, .completion-grid { grid-template-columns: 1fr; }
  .panel.card-pad, .card { padding: 19px; }
  .work-summary { grid-template-columns: 1fr 1fr; padding: 12px; }
  .work-summary > div { border-right: 0; padding: 8px 9px; }
  .work-summary span { font-size: 25px; }
  .stepper { grid-template-columns: 1fr 1fr; gap: 4px; }
  .step { padding: 7px 3px; font-size: 13px; }
  .step::after { display: none; }
  .step strong { font-size: 13px; }
  .file-box { min-height: 124px; }
  .full-action { position: static; align-items: stretch; margin-top: 15px; }
  .full-action .btn { width: 100%; }
  .upload-layout, .completion-grid { padding-bottom: 0; }
  .form-grid { grid-template-columns: 1fr; }
  .tabs { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 3px; }
  .tabs .btn { flex: 0 0 auto; }
  .code-box { align-items: stretch; flex-direction: column; }
  .code-box .btn { width: 100%; }
  .material-record-head, .material-record-body { align-items: stretch; flex-direction: column; padding: 18px; }
  .material-record-body .actions .btn { flex: 1 1 170px; }
  .danger-zone > summary { padding: 13px 18px; }
  .danger-zone > div { padding: 0 18px 18px; }
  .login-screen { display: block; min-height: 100dvh; padding: 24px 14px; background: radial-gradient(circle at 15% 0,rgba(45,137,110,.2),transparent 34%),#edf4ef; }
  .login-intro { padding: 22px 10px 28px; color: var(--workspace-ink); }
  .login-mark { width: 56px; height: 56px; margin-bottom: 20px; }
  .login-intro .eyebrow { color: var(--workspace-brand); }
  .login-intro h1 { margin: 10px 0; font-size: 31px; }
  .login-intro p { color: var(--workspace-muted); font-size: 14px; }
  .login-intro ul { display: none; }
  .login-card { max-width: none; padding: 24px 20px; border-radius: 20px; }
  .login-screen.login-simple { display: grid; padding: 18px; }
  table.mobile-cards, table.mobile-cards tbody, table.mobile-cards tr, table.mobile-cards td { display: block; width: 100%; }
  table.mobile-cards thead { display: none; }
  table.mobile-cards tbody { display: grid; gap: 12px; }
  table.mobile-cards tr { padding: 14px; border: 1px solid var(--workspace-line); border-radius: 14px; background: #fff; }
  table.mobile-cards td { display: grid; grid-template-columns: minmax(112px,.7fr) minmax(0,1fr); gap: 12px; padding: 8px 0; border: 0; text-align: right; }
  table.mobile-cards td::before { content: attr(data-label); color: var(--workspace-muted); font-size: 12px; text-align: left; }
  table.mobile-cards td:first-child { padding-top: 0; }
  table.mobile-cards td:last-child { padding-bottom: 0; }
  table.mobile-cards td .btn { justify-self: end; }
  dialog { width: min(94vw, 620px); padding: 20px; }
}

@media (max-width: 420px) {
  .top-actions .btn:first-of-type { display: none; }
  .page { padding-left: 12px; padding-right: 12px; }
  .student-preview > header { align-items: start; flex-direction: column; }
  .preview-facts { grid-template-columns: 1fr; }
  .preview-facts > div, .preview-facts > div:nth-child(odd) { border-right: 0; border-bottom: 1px solid var(--workspace-line); }
  .preview-facts > div:last-child { border-bottom: 0; }
  .metric-strip { grid-template-columns: 1fr 1fr; }
  .profile-hero { flex-wrap: wrap; }
  .profile-hero > div:nth-child(2) { flex: 1 1 calc(100% - 60px); }
  .profile-hero > .actions { width: 100%; }
  .login-intro h1 { font-size: 27px; }
}

/* Shared working hierarchy: compact context, readable tasks, supporting aside. */
.student-avatar { display: inline-grid; place-items: center; flex-shrink: 0; line-height: 1; padding: 0; text-align: center; }
.work-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; align-items: start; gap: 20px; }
.work-layout > *, .overview-grid > *, .student-overview-grid > * { min-width: 0; }
.work-summary { background: #fff; color: var(--workspace-ink); border: 1px solid var(--workspace-line); border-radius: 10px; padding: 12px 4px; gap: 0; }
.work-summary > div { padding: 2px 20px; border-right: 1px solid var(--workspace-line); }
.work-summary span { font-size: 27px; line-height: 1.3; font-variant-numeric: tabular-nums; }
.work-summary small { color: var(--workspace-muted); font-size: 12px; margin-top: 4px; }
.data-freshness { color: var(--workspace-muted); font-size: 11px; margin: 8px 0 18px; }
.work-layout .section-head { padding-bottom: 14px; margin-bottom: 0; border-bottom: 1px solid var(--workspace-line); }
.section-head h2, .work-layout h2 { font-size: 19px; line-height: 1.4; margin: 0; }
.work-layout .eyebrow { margin-bottom: 6px; }
.focus-row { display: grid; grid-template-columns: 38px minmax(0,1fr) auto; gap: 14px; padding: 19px 0; }
.focus-row .student-avatar { width: 38px; height: 38px; border-radius: 10px; font-size: 16px; }
.focus-row h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 6px; }
.focus-row h3 a { color: var(--workspace-ink); }
.focus-row h3 a:hover { color: var(--workspace-brand); }
.focus-row p { white-space: normal; overflow: visible; font-size: 13px; line-height: 1.65; color: #53675e; }
.focus-row small { display: block; font-size: 12px; margin-top: 5px; }
.focus-row > .btn { padding: 8px 11px; font-size: 13px; }
.exam-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 0; border-bottom: 1px solid var(--workspace-line); }
.exam-row > div { min-width: 0; }
.exam-row strong { font-size: 14px; }
.exam-row p { font-size: 12px; line-height: 1.7; margin: 5px 0 0; }
.exam-row .btn { min-height: 36px; padding: 7px 10px; font-size: 12px; }
.work-layout aside > section > p { font-size: 12px; line-height: 1.7; }
.task-detail-row { display: block; padding: 20px 0; }
.task-detail-row h3 { margin: 0 0 10px; font-size: 14px; }
.task-detail-row .badge { white-space: normal; line-height: 1.5; border-radius: 5px; }
.task-detail-row .grow > p { font-size: 14px; line-height: 1.8; margin-top: 10px; overflow-wrap: anywhere; }
.task-detail-row .actions { margin-top: 12px; gap: 8px; }
.task-detail-row .actions .btn { font-size: 13px; }
.profile-summary { margin-bottom: 18px; }
.profile-summary.profile-summary-compact { grid-template-columns: repeat(2,minmax(0,1fr)); }
.profile-summary-compact > div:nth-child(-n+2) { border-bottom: 0; }
.profile-summary > div { min-height: 0; padding: 12px 16px; }
.priority-card, .exam-card, .panel, .card { box-shadow: none; }
.priority-footnote { font-size: 12px; line-height: 1.6; }
.exam-card > p { font-size: 14px; line-height: 1.7; }
.tabs .btn { background: transparent; border-color: transparent; color: #61746b; border-radius: 6px; }
.tabs .btn.active { background: #e3efe8; color: #075a48; border-color: #c5dbce; font-weight: 750; }
.tabs .btn:hover { background: #edf3ef; }
.record { line-height: 1.75; overflow-wrap: anywhere; }
.record > .muted, .record > small { font-size: 12px; }
.field + .field { margin-top: 14px; }
.field input[type=file]::file-selector-button { border: 1px solid #bfd0c6; border-radius: 6px; background: white; color: #075a48; padding: 8px 12px; margin-right: 12px; cursor: pointer; }
dialog { max-height: calc(100dvh - 40px); overflow-y: auto; max-width: calc(100vw - 28px); border: 1px solid var(--workspace-line); box-shadow: 0 24px 80px #102f2833; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; position: sticky; top: -20px; background: white; z-index: 1; padding: 10px 0; gap: 16px; }
.dialog-head h2 { margin: 0; }
.dialog-head .btn { flex-shrink: 0; }
.dialog-head h2 { font-size: 21px; }
:is(a,button,summary):focus-visible { outline: 3px solid #5a9e82; outline-offset: 3px; }
@media (max-width: 1100px) {
 .work-layout { grid-template-columns: minmax(0,1fr) 240px; gap: 16px; }
 .work-layout .panel.card-pad { padding: 18px; }
 .focus-row { grid-template-columns: 34px minmax(0,1fr); }
 .focus-row > .btn { grid-column: 2; justify-self: start; }
}
@media (max-width: 760px) {
 .work-layout { grid-template-columns: minmax(0,1fr); }
 .work-summary { grid-template-columns: repeat(2,minmax(0,1fr)); padding: 4px; }
 .work-summary > div { padding: 12px; border: 0; }
 .work-summary > div:nth-child(odd) { border-right: 1px solid var(--workspace-line); }
 .work-summary span { font-size: 24px; }
 .focus-row { grid-template-columns: 34px minmax(0,1fr); gap: 10px 12px; }
 .focus-row > .btn { min-height: 44px; }
 .task-detail-row .actions .btn { flex: 1 1 140px; min-height: 44px; }
 .work-layout .list-pagination { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; }
 .file-box.field { grid-template-columns: minmax(0,1fr); padding: 16px; }
 .file-box.field > small { grid-column: 1; }
 .section-head { flex-wrap: wrap; gap: 12px; }
 .data-freshness { line-height: 1.6; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }

/* V5.3.1: a direct, compact directory, not a preview inside a directory. */
.topbar { min-height: 64px; }
.page { padding: 24px 28px 48px; }
.page-head { margin-bottom: 20px; }
.page-head h1 { font-size: 28px; }
.student-list-panel.directory-clean { border-radius: 10px; box-shadow: none; }
.directory-clean .student-list-head { padding: 16px 22px; display: flex; align-items: center; justify-content: space-between; }
.directory-clean .student-list-head h2 { margin: 0; font-size: 17px; }
.directory-clean .student-list-head span { color: var(--workspace-muted); font-size: 13px; }
.directory-clean .student-list-row { grid-template-columns: minmax(220px,1.4fr) minmax(220px,1fr) minmax(100px,.5fr); gap: 24px; padding: 18px 22px; cursor: pointer; border-radius: 0; }
.directory-clean .student-list-row:hover { background: #f1f7f4; }
.directory-clean .student-list-row:focus-within { background: #edf6f1; }
.directory-clean .student-row-main h3 { margin: 0 0 5px; font-size: 18px; }
.directory-clean .student-row-main p { margin: 4px 0 0; font-size: 13px; }
.archive-number { color: var(--workspace-brand); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.directory-clean .student-row-meta { display: grid; grid-template-columns: 76px minmax(0,1fr); gap: 6px 12px; font-size: 13px; }
.directory-clean .student-row-meta b { white-space: normal; overflow: visible; }
.student-row-status { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; font-size: 13px; }
.student-row-status small, .row-state { color: var(--workspace-muted); }
.directory-clean > .actions { padding: 16px 22px; }
.archive-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding: 0 0 20px; margin-bottom: 20px; border-bottom: 1px solid var(--workspace-line); font-size: 14px; }
.material-delete-action { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 16px; margin-top: 20px; border-top: 1px solid var(--workspace-line); }
.material-delete-action span { font-size: 13px; color: var(--workspace-muted); }
.btn.danger { color: #ad302b; border: 1px solid #d59892; background: #fff5f4; }
.btn.danger:hover { background: #fce3e0; }
.delete-target { padding: 16px; background: #f7f8f7; border-radius: 8px; overflow-wrap: anywhere; }
.delete-target p { margin: 6px 0; }
.student-search .search-input-wrap { position: relative; display: block; width: 100%; }
.search-input-wrap input { padding-right: 46px; }
#search-clear { position: absolute; right: 3px; top: 3px; bottom: 3px; width: 40px; border: 0; border-radius: 7px; background: transparent; color: #53655c; cursor: pointer; font-size: 22px; }
#search-clear[hidden] { display: none; }
#search-clear:hover { background: #e8f1ec; }
.students-toolbar { flex-wrap: wrap; }
.search-state { flex: 0 0 100%; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; color: var(--workspace-muted); font-size: 13px; }
.search-chip { border: 1px solid #bdd7c9; border-radius: 6px; background: #eff6f2; color: #285643; padding: 6px 10px; cursor: pointer; overflow-wrap: anywhere; max-width: 100%; }
.search-chip span { margin-left: 8px; }
@media (max-width: 1080px) {
 .directory-clean .student-list-row { grid-template-columns: minmax(180px,1fr) minmax(180px,1fr); gap: 12px 20px; }
 .student-row-status { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; }
}
@media (max-width: 640px) {
 .page { padding: 18px 14px 32px; }
 .page-head h1 { font-size: 24px; }
 .directory-clean .student-list-row { grid-template-columns: 1fr; padding: 16px; }
 .directory-clean .student-row-meta { display: grid; grid-template-columns: 76px minmax(0,1fr); }
 .archive-summary { gap: 10px 16px; }
 .archive-summary .archive-number { flex-basis: 100%; }
 .material-delete-action { align-items: flex-start; flex-direction: column; }
 .btn.danger { min-height: 44px; }
}
