/* Shared academy colors are loaded from core/theme.css. */
* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; line-height: 1.65; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }
button, input, select, textarea { font: inherit; }
input { accent-color: var(--brand); }
a:focus-visible, button:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
.app-sidebar a:focus-visible, .app-sidebar button:focus-visible { outline-color: var(--sidebar-accent); }
.shell { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.site-header { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--line); background: rgba(255, 253, 250, 0.94); backdrop-filter: blur(14px); }
.header-inner { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 760; letter-spacing: 0.02em; }
.brand-mark { display: block; width: 34px; height: 34px; flex: 0 0 34px; border-radius: 9px; object-fit: contain; background: var(--brand-mark); }
nav { display: flex; align-items: center; gap: 20px; font-size: 14px; }
.inline-form { display: inline; margin: 0; }
.link-button { padding: 0; border: 0; color: var(--brand); background: transparent; cursor: pointer; }
.page { min-height: calc(100vh - 136px); padding-block: 48px 72px; }
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; padding: 24px 0; }
.hero { padding: 64px 0 46px; max-width: 760px; }
.hero h1, .page-heading h1, .report-cover h1 { margin: 8px 0 16px; font-family: Georgia, "Songti SC", serif; font-size: clamp(36px, 6vw, 64px); line-height: 1.12; letter-spacing: -0.035em; }
.page-heading h1 { margin: 0 0 10px; font-size: clamp(26px, 3vw, 36px); }
.eyebrow { margin: 0; color: var(--brand); font-size: 13px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; }
.lead { max-width: 660px; margin-bottom: 28px; color: var(--muted); font-size: 19px; }
.muted { color: var(--muted); }
.card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.role-card, .list-card, .record-card, .review-card, .form-card, .subject-report { border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.role-card { min-height: 220px; padding: 28px; color: var(--ink); transition: transform 160ms ease, border-color 160ms ease; }
.role-card:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.role-card h2, .list-card h2 { margin: 10px 0 8px; font-family: Georgia, "Songti SC", serif; }
.role-card p, .list-card p { margin: 0; color: var(--muted); }
.card-kicker { color: var(--brand); font-size: 13px; font-weight: 800; }
.card-link { display: inline-block; margin-top: 24px; font-weight: 750; }
.button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 10px; padding: 9px 18px; font-weight: 750; cursor: pointer; }
.button.primary { color: white; background: var(--brand); }
.button.primary:hover { color: white; background: var(--brand-dark); }
.button.secondary { border-color: var(--brand); color: var(--brand); background: var(--surface); }
.button.danger-outline { border-color: #d9aaa4; color: var(--danger); background: var(--surface); }
.page-heading { margin-bottom: 18px; }
.page-heading.split { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.page-heading p { color: var(--muted); }
.back-link { display: inline-block; margin-bottom: 20px; font-size: 14px; font-weight: 700; }
.student-directory { overflow: hidden; margin-bottom: 16px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); }
.life-week-selector { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px; }
.life-week-selector select { width: auto; max-width: 100%; flex: 1 1 240px; }
.student-directory-row { display: grid; grid-template-columns: 90px minmax(0, 1fr); min-height: 42px; border-top: 1px solid var(--line); }
.student-directory-row:first-child { border-top: 0; }
.student-directory-row.primary { background: var(--surface-soft); }
.student-directory-label { display: flex; align-items: center; border-right: 1px solid var(--line); padding: 6px 12px; color: var(--brand-dark); font-family: Georgia, "Songti SC", serif; font-size: 15px; white-space: nowrap; }
.student-directory-items { display: flex; flex-wrap: nowrap; overflow-x: auto; align-items: center; gap: 6px; padding: 5px 10px; }
.directory-chip { display: inline-flex; flex: 0 0 auto; min-height: 30px; align-items: center; border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; color: var(--ink); background: var(--surface); font-weight: 700; white-space: nowrap; }
.directory-chip:hover { border-color: var(--line-strong); color: var(--brand-dark); background: var(--brand-soft); }
.directory-chip.primary { min-width: 64px; justify-content: center; }
.directory-chip.active { border-color: var(--brand); color: white; background: var(--brand); }
.directory-content-stack { margin-top: 24px; }
.record-card, .review-card, .student-report-group { scroll-margin-top: 18px; }
.list-stack, .student-records, .review-list { display: grid; gap: 16px; }
.list-card { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 24px 26px; color: var(--ink); }
.list-card.static:hover { color: var(--ink); }
.grow { flex: 1; }
.status-pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 10px; color: var(--muted); background: var(--surface-soft); font-size: 12px; font-weight: 760; }
.status-pill.submitted, .status-pill.approved { color: var(--success); background: var(--success-soft); }
.status-pill.returned, .status-pill.changes_requested { color: var(--danger); background: var(--danger-soft); }
.status-pill.published { color: #765616; background: #faf0d9; }
.record-card, .review-card, .form-card { padding: 16px; }
.record-card.has-errors { border-color: #d9aaa4; box-shadow: 0 0 0 3px rgba(154, 61, 51, 0.08); }
.field-alert { margin: 0; padding: 10px 12px; border-radius: 8px; color: var(--danger); background: var(--danger-soft); font-weight: 700; }
.draft-save-status { grid-column: 1 / -1; min-height: 20px; margin: 8px 0 0; color: var(--brand-dark); font-size: 13px; }
.record-card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.record-card-header > div { display: flex; align-items: center; gap: 12px; }
.record-card-header h2 { margin: 0; font-size: 20px; }
.student-index, .subject-title > span { color: var(--gold); font-family: Georgia, serif; font-weight: 800; }
.record-form, .stack-form { display: grid; gap: 16px; }
.record-entry-layout { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.record-save { justify-self: end; min-width: 64px; white-space: nowrap; }
.record-selector { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.record-selector label { margin: 0; }
.record-mode-tabs { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.record-mode-tabs .button { flex: 0 1 auto; }
.record-mode-tabs [aria-current="page"] { cursor: default; }
.record-mode-tabs .record-mode-unavailable { color: #777; background: #eee; border-color: #ccc; cursor: pointer; }
.record-mode-toast { position: fixed; z-index: 1000; left: 50%; bottom: 96px; transform: translateX(-50%); width: max-content; max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: 10px; background: #342a24; color: white; text-align: center; box-shadow: var(--shadow); }
.record-selector select { width: auto; max-width: 100%; }
.record-selector #record-week, .record-selector #life-week { flex: 1 1 280px; }
.form-grid { display: grid; gap: 14px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.score-grid { grid-template-columns: repeat(2, minmax(0, 180px)); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }
.weekly-table-entry, .weekly-report-table { overflow: hidden; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); }
.weekly-report-table { box-shadow: var(--shadow); }
.weekly-table-header, .weekly-table-row, .homeroom-comment-row { display: grid; grid-template-columns: 84px minmax(0, 1.2fr) minmax(0, 1.2fr) minmax(0, 0.8fr); }
.weekly-table-header { color: var(--muted); background: var(--surface-soft); font-size: 13px; font-weight: 800; }
.weekly-table-header > div, .weekly-subject-cell, .weekly-table-cell { min-width: 0; padding: 12px 14px; border-left: 1px solid var(--line); }
.weekly-table-header > div:first-child, .weekly-subject-cell { border-left: 0; }
.weekly-table-row { border-top: 1px solid var(--line); }
.homeroom-comment-row { margin: 0; border-top: 1px solid var(--line); }
.homeroom-comment-cell { grid-column: 2 / -1; min-width: 0; min-height: 110px; border-left: 1px solid var(--line); padding: 12px 14px; overflow-wrap: anywhere; }
.homeroom-comment-cell textarea { min-height: 92px; }
.homeroom-comment-cell .button { margin-top: 10px; }
.weekly-subject-cell { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 4px; text-align: center; font-size: 17px; }
.weekly-table-cell { min-height: 150px; overflow-wrap: anywhere; }
.weekly-table-cell textarea { min-height: 120px; height: 150px; border: 0; border-radius: 0; padding: 2px; }
.weekly-table-cell textarea:focus { outline: 0; box-shadow: inset 0 0 0 2px var(--brand-ring); }
.weekly-table-cell textarea[aria-invalid="true"], .life-routine-form input[aria-invalid="true"] { background: #fff7f5; box-shadow: inset 0 0 0 2px var(--danger); }
.weekly-table-cell .text-action { margin-top: 4px; }
.mobile-column-label { display: none; }
.life-routine-table, .life-routine-form { display: grid; grid-template-columns: 72px minmax(0, 1fr); margin: -12px -14px; }
.life-routine-table > div, .life-routine-form > div { min-height: 42px; border-top: 1px solid var(--line); padding: 8px 10px; }
.life-routine-table > div:nth-child(-n+2), .life-routine-form > div:first-child { border-top: 0; }
.life-routine-label { display: flex; align-items: center; font-weight: 750; }
.life-routine-table > div:nth-child(even) { border-left: 1px solid var(--line); }
.life-routine-form > div { display: grid; grid-column: 1 / -1; grid-template-columns: 72px minmax(0, 1fr); padding: 0; }
.life-routine-form label { display: flex; align-items: center; margin: 0; padding: 8px 10px; }
.life-routine-form input { border: 0; border-left: 1px solid var(--line); border-radius: 0; }
.life-routine-form .errorlist { grid-column: 1 / -1; padding: 4px 10px; }
label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 750; }
input, select, textarea { width: 100%; border: 1px solid var(--line-strong); border-radius: 9px; padding: 10px 12px; color: var(--ink); background: var(--surface); }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--brand-ring); border-color: var(--brand); }
input:disabled, select:disabled, textarea:disabled { color: var(--muted); background: var(--surface-soft); }
.button:disabled { cursor: not-allowed; opacity: 0.55; }
.student-management-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.student-dialog { width: min(640px, calc(100vw - 32px)); max-height: 88vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 18px; padding: 24px; color: var(--ink); background: var(--surface); }
.student-dialog::backdrop { background: rgba(47, 29, 25, 0.5); }
.student-roster th select { min-width: 90px; padding: 6px 8px; font-size: 13px; }
textarea { resize: vertical; }
.errorlist, .form-errors { margin: 6px 0 0; color: var(--danger); font-size: 13px; }
.submit-bar { position: static; display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 16px; border: 1px solid var(--line-strong); border-radius: 12px; padding: 14px 18px; background: var(--surface); }
.submit-bar p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.life-submit-bar { position: static; }
.review-note, .version-note, .warning-box { margin-top: 16px; border-left: 3px solid var(--gold); border-radius: 6px; padding: 12px 14px; background: #fff8e9; }
.return-form { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 12px; margin-top: 18px; }
.return-form label { grid-column: 1 / -1; }
.manager-report-links { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 14px; }
.manager-report-links a { font-weight: 750; }
.manager-published-item { display: grid; gap: 10px; }
.manager-report-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.manager-report-actions > a { font-weight: 750; }
.manager-detail-withdraw { margin-top: 18px; }
.review-weekly-table { overflow: hidden; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); }
.review-weekly-header, .review-weekly-row, .review-homeroom-row { display: grid; grid-template-columns: 84px minmax(180px, 1.25fr) minmax(180px, 1.15fr) minmax(150px, 0.8fr) minmax(160px, 0.72fr); }
.review-weekly-header { color: var(--muted); background: var(--surface-soft); font-size: 13px; font-weight: 800; }
.review-weekly-header > div { min-width: 0; padding: 12px 14px; border-left: 1px solid var(--line); }
.review-weekly-header > div:first-child { border-left: 0; }
.review-weekly-row, .review-homeroom-row { border-top: 1px solid var(--line); }
.review-weekly-row > .weekly-table-cell, .review-return-cell { border-left: 1px solid var(--line); }
.review-return-cell { min-width: 0; min-height: 150px; padding: 12px; overflow-wrap: anywhere; }
.review-return-cell p { margin: 10px 0 0; color: var(--danger); }
.review-return-form { display: grid; gap: 8px; }
.review-return-form textarea { min-height: 78px; padding: 8px; }
.review-return-form .button { min-height: 38px; padding: 6px 10px; }
.review-missing-cell { grid-column: 2 / 5; min-height: 150px; border-left: 1px solid var(--line); padding: 18px 14px; color: var(--muted); }
.review-homeroom-cell { grid-column: 2 / -1; min-width: 0; border-left: 1px solid var(--line); padding: 12px 14px; }
.review-homeroom-cell textarea { min-height: 100px; }
.review-homeroom-cell .button { margin-top: 10px; }
.compact-comment-editor { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.compact-comment-editor textarea { grid-column: 1; }
.compact-comment-editor .record-save { grid-column: 2; grid-row: 1; margin: 0; }
.compact-comment-editor .errorlist { grid-column: 1 / -1; }
.student-share-panel { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 20px; border: 1px solid #d6c59e; border-radius: 12px; padding: 14px 16px; background: #fffaf0; }
.student-share-panel p { margin: 3px 0; color: var(--muted); font-size: 13px; }
.student-share-panel small { display: block; max-width: 820px; color: #765616; }
.student-share-panel form { flex: 0 0 auto; }
.student-share-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.share-copy-toast { position: fixed; z-index: 2000; top: 50%; left: 50%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 18px; width: 250px; max-width: calc(100vw - 40px); box-sizing: border-box; padding: 26px 20px; border-radius: 16px; background: rgba(48, 48, 48, .9); color: white; text-align: center; box-shadow: 0 8px 30px rgba(0, 0, 0, .16); pointer-events: none; }
.share-copy-toast[hidden] { display: none; }
.share-copy-toast-icon { font-size: 52px; line-height: 1; color: #e1e1e1; }
.share-copy-toast-message { font-size: 17px; font-weight: 700; line-height: 1.5; overflow-wrap: anywhere; }
.student-share-url { overflow-wrap: anywhere; font-weight: 750; }
.record-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin: 0; }
.record-summary div { border-top: 1px solid var(--line); padding-top: 12px; }
.record-summary .wide { grid-column: 1 / -1; }
.record-summary dt { color: var(--muted); font-size: 12px; font-weight: 800; }
.record-summary dd { margin: 4px 0 0; }
.subject-statuses { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.metric { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 14px; padding: 18px; background: var(--surface); }
.metric span { color: var(--muted); font-size: 13px; }
.metric strong { margin-top: 6px; font-family: Georgia, serif; font-size: 30px; }
.compact-table { margin-top: 12px; }
.section-title { margin: 0 0 16px; font-family: Georgia, "Songti SC", serif; }
.section-block { margin-top: 46px; }
.section-card { margin-top: 32px; border: 1px solid var(--line); border-radius: 18px; padding: 24px; background: var(--surface); box-shadow: var(--shadow); }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.section-heading h2 { margin: 4px 0 0; font-family: Georgia, "Songti SC", serif; }
.field-group { margin-bottom: 18px; }
.field-help { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.form-actions { display: flex; align-items: center; gap: 18px; }
.section-action-row, .queue-filter, .pagination { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.section-action-row p { margin: 0; }
.queue-filter { justify-content: flex-start; margin: 18px 0; border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; background: var(--surface); }
.queue-filter > div { width: min(320px, 100%); }
.queue-filter label { margin-bottom: 4px; }
.pagination { margin-top: 18px; }
.pagination span, .pagination-summary { color: var(--muted); font-size: 13px; }
.pagination-summary { text-align: right; }
.compact-action { margin-top: 0; }
.notification-resolution-actions { display: flex; gap: 8px; }
.batch-action-bar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 18px 0 12px; border: 1px solid var(--line-strong); border-radius: 14px; padding: 16px 18px; background: var(--surface); }
.batch-action-bar p { margin: 0; color: var(--muted); }
.queue-checkbox { width: auto; min-width: 18px; min-height: 18px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 16px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: var(--muted); font-size: 12px; }
tr:last-child td { border-bottom: 0; }
.auth-card { max-width: 480px; margin: 48px auto; border: 1px solid var(--line); border-radius: 20px; padding: 34px; background: var(--surface); box-shadow: var(--shadow); }
.auth-card h1 { margin: 8px 0; font-family: Georgia, "Songti SC", serif; font-size: 38px; }
.empty-state { border: 1px dashed var(--line-strong); border-radius: 16px; padding: 36px; text-align: center; background: rgba(255, 255, 255, 0.5); }
.empty-state h2 { margin-top: 0; }
.messages { display: grid; gap: 8px; margin-bottom: 20px; }
.form-feedback { position: fixed; z-index: 2000; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; width: max-content; max-width: calc(100vw - 32px); max-height: 35vh; overflow: auto; box-sizing: border-box; padding: 12px 16px; border-radius: 12px; background: var(--ink); color: var(--surface); box-shadow: 0 4px 20px #0003; }
.form-feedback button { flex-shrink: 0; min-width: 44px; min-height: 44px; padding: 0; background: transparent; border: 0; color: inherit; font-size: 24px; }
.message { border-radius: 10px; padding: 12px 14px; background: var(--surface-soft); }
.message.success { color: var(--success); background: var(--success-soft); }
.message.error { color: var(--danger); background: var(--danger-soft); }
.form-feedback .message { margin: 0; padding: 0; border: 0; background: transparent; color: inherit; }
.report-cover { margin-bottom: 30px; border-bottom: 1px solid var(--line); padding-bottom: 28px; }
.report-meta { display: flex; flex-wrap: wrap; gap: 10px 24px; color: var(--muted); font-size: 14px; }
.student-report-groups { display: grid; gap: 56px; }
.student-report-group-heading, .published-report-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.student-report-group-heading { margin-bottom: 18px; }
.student-report-group-heading h2 { margin: 4px 0 0; font-family: Georgia, "Songti SC", serif; font-size: 30px; }
.published-report-stack { display: grid; gap: 28px; }
.published-report-stack-item { border: 1px solid var(--line); border-radius: 18px; padding: 24px; background: var(--surface); box-shadow: var(--shadow); }
.published-report-heading { margin-bottom: 18px; }
.published-report-heading h3 { margin: 8px 0 2px; font-family: Georgia, "Songti SC", serif; font-size: 24px; }
.published-report-heading .shared-report-week { margin: 0 0 2px; font-family: Georgia, "Songti SC", serif; font-size: 24px; }
.report-week-label { white-space: nowrap; }
.report-week-number { color: var(--brand); font-family: Arial, "Helvetica Neue", sans-serif; font-size: calc(1em + 1px); font-weight: inherit; line-height: 1; }
.published-report-heading p { margin: 0; color: var(--muted); font-size: 14px; }
.published-report-stack-item .weekly-report-table { box-shadow: none; }
.subject-report-grid { display: grid; grid-template-columns: 1fr; gap: 18px; }
.subject-report { padding: 26px; }
.subject-title { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.subject-title h2 { margin: 0; font-family: Georgia, "Songti SC", serif; }
.score { margin-left: auto; color: var(--brand); font-size: 20px; }

.page-heading-row, .page-actions, .section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.page-actions { flex-wrap: wrap; }
.filter-bar { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin: 18px 0; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.filter-bar label { display: grid; gap: 5px; font-size: 13px; color: var(--muted); }
.filter-bar select, .filter-bar input { min-width: 128px; }
.table-scroll { overflow-x: auto; margin-top: 16px; }
.data-table { width: 100%; border-collapse: collapse; background: var(--surface); }
.data-table th, .data-table td { padding: 12px; border: 1px solid var(--line); text-align: left; vertical-align: middle; }
.data-table thead th { background: var(--surface-soft); white-space: nowrap; }
.data-table small { display: block; margin-top: 4px; color: var(--muted); font-weight: 400; }
.grade-matrix td { min-width: 112px; text-align: center; }
.grade-matrix thead th:not(:first-child) { min-width: 140px; }
.score-entry-table input { width: 110px; }
.grade-full-marks { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.grade-full-marks > select, .grade-full-marks > div { flex: 1 1 140px; }
.warning-text { color: #9b5a00; font-weight: 700; }
.assessment-list { display: grid; gap: 5px; margin-top: 10px; padding-top: 9px; border-top: 1px dashed var(--line); }
.assessment-list div { color: var(--brand); }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 16px 0; }
.stats-grid > div { display: grid; gap: 4px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.stats-grid strong { font-size: 22px; }
.stats-grid span { color: var(--muted); font-size: 13px; }

@media (max-width: 760px) {
  .page-heading-row, .section-heading { flex-direction: column; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.text-action { display: inline-block; margin-top: 18px; font-size: 13px; font-weight: 750; }
.privacy-note { margin: 30px 0 0; color: var(--muted); text-align: center; font-size: 13px; }
.security-card { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 34px; border: 1px solid var(--line); border-radius: 18px; padding: 22px 24px; background: var(--surface); box-shadow: var(--shadow); }
.security-card h2 { margin: 4px 0; font-family: Georgia, "Songti SC", serif; }
.security-card p { margin: 0; }
.security-setup-card, .recovery-card { max-width: 620px; }
.totp-qr { display: block; width: min(280px, 100%); aspect-ratio: 1; margin: 20px auto; border: 10px solid white; }
.manual-secret { display: grid; gap: 6px; margin: 18px 0 24px; border: 1px solid var(--line); border-radius: 12px; padding: 14px; text-align: center; background: var(--paper); }
.manual-secret span { color: var(--muted); font-size: 12px; font-weight: 750; }
.manual-secret code, .recovery-code-grid code { overflow-wrap: anywhere; color: var(--ink); font-size: 15px; letter-spacing: 0.08em; }
.cancel-form { margin-top: 18px; text-align: center; }
.recovery-code-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 28px; margin: 24px 0; border: 1px solid var(--line); border-radius: 14px; padding: 20px 20px 20px 48px; background: var(--paper); }

/* Authenticated application shell */
.app-body { min-width: 320px; background: var(--paper); }
.app-frame { display: grid; grid-template-columns: 272px minmax(0, 1fr); min-height: 100vh; }
.app-sidebar { position: sticky; top: 0; display: flex; height: 100vh; overflow-y: auto; flex-direction: column; padding: 26px 18px 20px; color: #f9f3e7; background: linear-gradient(180deg, var(--sidebar-top) 0%, var(--sidebar-bottom) 100%); }
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 0 10px 28px; color: #fffaf0; }
.sidebar-brand:hover { color: white; }
.sidebar-brand-mark { display: block; width: 46px; height: 46px; flex: 0 0 46px; border-radius: 13px; object-fit: contain; background: var(--brand-mark); }
.sidebar-brand strong, .sidebar-brand small, .sidebar-user strong, .sidebar-user small { display: block; }
.sidebar-brand strong { font-size: 17px; }
.sidebar-brand small { color: var(--sidebar-muted); font-size: 12px; font-weight: 500; }
.sidebar-nav { display: grid; align-items: stretch; gap: 6px; font-size: 15px; }
.sidebar-nav a { display: grid; grid-template-columns: 28px 1fr; align-items: center; min-height: 50px; border-radius: 12px; padding: 8px 14px; color: var(--sidebar-text); font-weight: 700; }
.sidebar-nav a:hover { color: white; background: rgba(255, 255, 255, 0.08); }
.sidebar-nav a.active { color: white; background: var(--sidebar-active); box-shadow: inset 4px 0 0 var(--sidebar-accent); }
.sidebar-nav a > span { color: var(--sidebar-accent); font-family: Georgia, "Songti SC", serif; font-weight: 800; }
.sidebar-section-label { margin: 18px 14px 4px; color: var(--sidebar-muted); font-size: 11px; font-weight: 800; letter-spacing: 0.16em; }
.sidebar-user { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 10px; margin-top: auto; border-top: 1px solid rgba(255, 255, 255, 0.12); padding: 20px 8px 0; }
.sidebar-user small { overflow: hidden; color: var(--sidebar-muted); text-overflow: ellipsis; font-size: 11px; }
.sidebar-avatar { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 12px; color: var(--brand-dark); background: #f3e6cc; font-weight: 800; }
.sidebar-account { position: relative; margin-top: auto; }
.sidebar-account > summary { margin-top: 0; cursor: pointer; list-style: none; }
.sidebar-account > summary::-webkit-details-marker { display: none; }
.sidebar-account > summary:focus-visible { outline: 2px solid var(--sidebar-accent); outline-offset: 3px; }
.sidebar-account-toggle { color: var(--sidebar-accent); font-size: 12px; }
.sidebar-account-menu { position: absolute; bottom: 100%; left: 0; right: 0; z-index: 20; padding: 8px; border: 1px solid #dcc6b3; border-radius: 12px; background: var(--surface, #fffdf9); box-shadow: 0 8px 24px #0003; }
.sidebar-account-menu a, .sidebar-account-menu button { display: block; width: 100%; padding: 12px; border: 0; border-radius: 8px; color: var(--brand-dark); background: transparent; text-align: left; font: inherit; cursor: pointer; }
.sidebar-account-menu a:hover, .sidebar-account-menu button:hover { background: #f5ebdf; }
.sidebar-account-menu a span { display: block; margin-top: 4px; color: #74675c; font-size: 11px; }
.sidebar-account-menu form { margin: 0; }
.sidebar-logout { border: 0; padding: 6px; color: var(--sidebar-accent); background: transparent; cursor: pointer; }
.app-workspace { min-width: 0; }
.workspace-header { display: flex; min-height: 112px; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); padding: 24px clamp(24px, 4vw, 64px); background: rgba(255, 253, 250, 0.94); }
.workspace-header h1 { margin: 2px 0 0; font-family: Georgia, "Songti SC", serif; font-size: clamp(28px, 3vw, 42px); line-height: 1.15; }
.workspace-account { border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; color: var(--muted); background: var(--surface); font-size: 13px; }
.workspace-page { width: min(1440px, calc(100% - 48px)); min-height: calc(100vh - 64px); margin: 0 auto; padding: 24px 0 40px; }
.workspace-footer { border-top: 1px solid var(--line); padding: 20px 32px; color: var(--muted); text-align: center; font-size: 12px; }
.app-workspace .hero { padding-top: 22px; }

/* Manager setup pages */
.management-grid { display: grid; grid-template-columns: minmax(320px, 0.9fr) minmax(380px, 1.1fr); align-items: start; gap: 20px; }
.management-grid .section-card { margin-top: 0; }
.management-form { display: grid; gap: 16px; }
.management-form p { margin: 0; }
.management-form .helptext { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; }
.student-management-grid { grid-template-columns: minmax(320px, 720px); }
.student-entry-card { width: 100%; }
.compact-management-form { margin-top: 14px; }
.dormitory-management-item .button { justify-self: start; }
.class-management-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.class-management-list { max-height: calc(100vh - 230px); overflow-y: auto; padding-right: 4px; }
.class-management-item { padding: 18px; }
.class-subject-list { display: grid; gap: 12px; }
.class-subject-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; margin: 0; border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.class-subject-row legend { padding: 0 6px; color: var(--brand); font-size: 13px; font-weight: 800; }
.class-subject-row p { margin: 0; }
.class-subject-row select[multiple] { min-height: 112px; padding: 7px 9px; }
.choice-panel { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--surface-soft); }
.choice-panel > label { margin-bottom: 8px; }
.choice-panel > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; }
.choice-panel label { display: flex; align-items: flex-start; gap: 8px; margin: 0; font-weight: 600; }
.choice-panel input[type="checkbox"] { width: auto; margin-top: 4px; }
.choice-panel .boolean-choice { align-items: center; }
.choice-panel .boolean-choice input { margin-top: 0; }
.management-list { display: grid; gap: 10px; }
.management-item { border: 1px solid var(--line); border-radius: 12px; padding: 15px 16px; background: var(--surface); }
.management-item-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.management-item h3 { margin: 0; font-size: 16px; }
.management-item p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.responsibility-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.responsibility-tag { border-radius: 999px; padding: 3px 9px; color: var(--brand-dark); background: var(--brand-soft); font-size: 12px; font-weight: 700; }
.status-warning { color: var(--danger); font-weight: 750; }
.temporary-password-note { overflow-wrap: anywhere; font-weight: 750; }

@media (max-width: 760px) {
  .record-entry-layout { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .shell { width: min(100% - 22px, 1120px); }
  .site-header { position: static; }
  .header-inner { align-items: flex-start; flex-direction: column; padding-block: 14px; }
  nav { width: 100%; justify-content: space-between; gap: 12px; }
  .page { padding-top: 32px; }
  .hero { padding-top: 28px; }
  .card-grid, .subject-report-grid, .form-grid.three, .record-summary, .metric-grid { grid-template-columns: 1fr; }
  .page-heading.split, .list-card, .submit-bar, .security-card, .section-heading, .section-action-row, .queue-filter, .pagination, .batch-action-bar, .student-share-panel, .student-report-group-heading, .published-report-heading { align-items: stretch; flex-direction: column; }
  .student-directory-row { grid-template-columns: 84px minmax(0, 1fr); }
  .student-directory-label { padding-inline: 12px; font-size: 14px; }
  .student-directory-items { flex-wrap: nowrap; overflow-x: auto; padding-inline: 10px; }
  .directory-chip { flex: 0 0 auto; }
  .manager-report-actions { align-items: stretch; flex-direction: column; }
  .manager-report-actions .button { width: 100%; }
  .recovery-code-grid { grid-template-columns: 1fr; }
  .submit-bar { bottom: 8px; }
  .submit-bar .button { width: 100%; }
  .student-share-panel .button { width: 100%; }
  .return-form { grid-template-columns: 1fr; }
  .review-weekly-header { display: none; }
  .review-weekly-row, .review-homeroom-row { grid-template-columns: 1fr; }
  .review-weekly-row > .weekly-table-cell, .review-return-cell, .review-homeroom-cell { border-top: 1px solid var(--line); border-left: 0; }
  .review-missing-cell, .review-homeroom-cell { grid-column: auto; min-height: 0; border-top: 1px solid var(--line); border-left: 0; }
  .review-return-cell { min-height: 0; }
  .record-summary .wide { grid-column: auto; }
  .weekly-table-header { display: none; }
  .weekly-table-row, .homeroom-comment-row { grid-template-columns: 1fr; }
  .weekly-subject-cell, .weekly-table-cell { border-top: 1px solid var(--line); border-left: 0; }
  .weekly-subject-cell { min-height: 54px; border-top: 0; background: var(--surface-soft); }
  .weekly-table-cell { min-height: 0; }
  .homeroom-comment-cell { grid-column: auto; min-height: 0; border-top: 1px solid var(--line); border-left: 0; }
  .mobile-column-label { display: block; margin: -2px 0 10px; color: var(--muted); font-size: 12px; font-weight: 800; }
  .life-routine-table, .life-routine-form { margin-top: 0; }
  .app-frame { display: block; }
  .app-sidebar { position: static; width: 100%; height: auto; padding: 18px 14px; }
  .sidebar-brand { padding-bottom: 16px; }
  .sidebar-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sidebar-nav a { min-height: 44px; }
  .sidebar-section-label { grid-column: 1 / -1; margin-top: 10px; }
  .sidebar-user { margin-top: 18px; }
  .workspace-header { min-height: 88px; padding: 18px 16px; }
  .workspace-account { display: none; }
  .workspace-page { width: min(100% - 22px, 1440px); padding-top: 26px; }
  .management-grid { grid-template-columns: 1fr; }
  .class-management-list { max-height: none; }
  .class-subject-row { grid-template-columns: 1fr; }
  .choice-panel > div { grid-template-columns: 1fr; }
}
