:root {
  color-scheme: light;
  --ink: #172a33;
  --muted: #60727a;
  --line: #dce5e7;
  --paper: #ffffff;
  --canvas: #f3f7f6;
  --green: #087e70;
  --green-dark: #08675d;
  --mint: #e2f3ef;
  --shadow: 0 18px 50px rgba(23, 57, 62, .08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); }
a { color: inherit; }
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { min-height: 76px; padding: 12px clamp(20px, 5vw, 72px); display: flex; align-items: center; justify-content: space-between; gap: 24px; background: var(--paper); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 14px; color: #fff; background: var(--green); font-size: 19px; font-weight: 800; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; letter-spacing: -.02em; }
.brand small { margin-top: 3px; color: var(--muted); font-size: 12px; }
.account-tools { display: flex; align-items: center; gap: 16px; }
.account-tools form { margin: 0; }
.account-name { color: var(--muted); font-size: 14px; }
.main-content { width: min(1160px, 100% - 40px); margin: 0 auto; padding: clamp(28px, 5vw, 64px) 0; flex: 1; }
.footer { padding: 20px; color: #849398; text-align: center; font-size: 12px; border-top: 1px solid var(--line); }
.login-layout { min-height: min(650px, calc(100vh - 180px)); display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: clamp(36px, 8vw, 110px); }
.login-intro { max-width: 510px; }
.eyebrow { color: var(--green); font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
h1 { margin: 12px 0 14px; font-size: clamp(32px, 5vw, 52px); line-height: 1.06; letter-spacing: -.045em; }
.login-intro p { max-width: 470px; color: var(--muted); font-size: 17px; line-height: 1.65; }
.intro-note { display: inline-flex; align-items: center; gap: 9px; margin-top: 24px; padding: 10px 14px; border: 1px solid #c9e7df; border-radius: 999px; color: var(--green-dark); background: var(--mint); font-size: 13px; font-weight: 650; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.login-card { width: min(100%, 440px); justify-self: end; padding: clamp(24px, 4vw, 40px); border: 1px solid var(--line); border-radius: 24px; background: var(--paper); box-shadow: var(--shadow); }
.login-card h2 { margin: 0 0 7px; font-size: 24px; letter-spacing: -.03em; }
.muted { color: var(--muted); line-height: 1.6; }
.login-card > .muted { margin: 0 0 26px; font-size: 14px; }
.form-field { display: grid; gap: 8px; margin-bottom: 18px; }
.form-field label { font-size: 13px; font-weight: 700; }
.form-field input { width: 100%; min-height: 48px; padding: 12px 14px; border: 1px solid #cbd7d9; border-radius: 10px; outline: none; background: #fff; color: var(--ink); font: inherit; }
.form-field input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(8, 126, 112, .13); }
.button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; padding: 10px 16px; border: 1px solid transparent; border-radius: 10px; font: inherit; font-size: 13px; font-weight: 750; text-decoration: none; cursor: pointer; }
.button-primary { color: white; background: var(--green); }
.button-primary:hover { background: var(--green-dark); }
.button-quiet { color: var(--ink); background: white; border-color: var(--line); }
.button-quiet:hover { background: var(--canvas); }
.button-wide { width: 100%; margin-top: 4px; }
.login-help { margin: 20px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.form-error, .field-error { color: #a43c2a; font-size: 12px; }
.form-error { margin-bottom: 14px; }
.welcome-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.welcome-row h1 { margin: 9px 0 8px; font-size: clamp(32px, 5vw, 44px); }
.welcome-row .muted { margin: 0; }
.role-chip, .phase-pill { padding: 9px 13px; border: 1px solid #c9e7df; border-radius: 999px; color: var(--green-dark); background: var(--mint); font-size: 12px; font-weight: 750; white-space: nowrap; }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.module-card { min-height: 230px; display: flex; flex-direction: column; padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); box-shadow: 0 8px 28px rgba(23, 57, 62, .035); }
.card-topline { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-icon { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 11px; color: var(--green-dark); background: var(--mint); font-size: 11px; font-weight: 850; }
.card-status { color: var(--muted); font-size: 11px; }
.module-card h2 { margin: 22px 0 8px; font-size: 18px; letter-spacing: -.02em; }
.module-card p { margin: 0 0 20px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.text-link { margin-top: auto; color: var(--green-dark); font-size: 12px; font-weight: 800; text-decoration: none; }
.text-link-muted { color: #87969a; }
.phase-banner { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 20px; padding: 20px 22px; border: 1px solid #ead9cc; border-radius: 16px; background: #fffaf6; }
.phase-banner strong { font-size: 14px; }
.phase-banner p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.phase-pill { color: #915336; border-color: #efd2c1; background: #fff0e7; }
.empty-state { max-width: 600px; margin: 8vh auto; padding: 36px; text-align: center; border: 1px solid var(--line); border-radius: 22px; background: white; box-shadow: var(--shadow); }
.empty-icon { display: inline-grid; width: 40px; height: 40px; place-items: center; border-radius: 50%; color: var(--green); background: var(--mint); font-weight: 800; }
.empty-state p { color: var(--muted); line-height: 1.6; }
.empty-state form { margin-top: 22px; }
.notice { margin-bottom: 18px; padding: 12px 16px; border-radius: 10px; background: var(--mint); color: var(--green-dark); }
.activation-card { margin: 4vh auto; justify-self: center; }
.activation-card h1 { font-size: clamp(30px, 4vw, 40px); }
.activation-card .form-field small { font-size: 12px; }
.form-panel, .section-list-panel { padding: clamp(22px, 4vw, 34px); border: 1px solid var(--line); border-radius: 18px; background: var(--paper); box-shadow: 0 8px 28px rgba(23, 57, 62, .035); }
.form-panel { max-width: 760px; }
.form-panel h2 { margin: 0 0 10px; }
.form-panel p { color: var(--muted); line-height: 1.6; }
.form-panel form { margin-top: 18px; }
.form-panel input:not([type="hidden"]), .form-panel select, .form-panel textarea, .form-field select, .form-field textarea { width: 100%; min-height: 46px; padding: 11px 13px; border: 1px solid #cbd7d9; border-radius: 10px; outline: none; background: #fff; color: var(--ink); font: inherit; }
.form-panel textarea { resize: vertical; overflow-wrap: anywhere; }
.form-panel input:focus, .form-panel select:focus, .form-panel textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(8, 126, 112, .13); }
.data-table { width: 100%; border-collapse: collapse; background: var(--paper); font-size: 13px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); }
.data-table th, .data-table td { padding: 13px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.data-table th { color: #52646b; background: #f7faf9; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fbfdfc; }
.data-table tbody tr.is-withdrawn td, .data-table tbody tr.is-withdrawn:hover td { color: #69777b; background: #eef1f2; }
.action-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.action-row form { margin: 0; }
.order-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 14px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #f7faf9; color: var(--muted); font-size: 12px; }
.order-toolbar .button { flex: 0 0 auto; }
.order-status { color: var(--green-dark); font-weight: 700; }
.order-cell { width: 36px; color: #77878b; text-align: center !important; }
.student-order-handle { cursor: grab; font-size: 20px; font-weight: 800; line-height: 1; }
.is-dragging { opacity: .45; }
[data-order-id] { cursor: grab; }
[data-order-id].is-dragging { cursor: grabbing; }
.text-button { padding: 0; border: 0; color: var(--green-dark); background: transparent; font: inherit; font-size: 12px; font-weight: 800; cursor: pointer; }
.state-tag { display: inline-flex; align-items: center; padding: 5px 9px; border: 1px solid var(--line); border-radius: 999px; color: #64767c; background: #f7faf9; font-size: 11px; font-weight: 750; white-space: nowrap; }
.state-active { border-color: #c9e7df; color: var(--green-dark); background: var(--mint); }
.admin-summary .module-card { min-height: 200px; }
.admin-summary .module-card h2 { font-size: 30px; }
.admin-note { margin-top: 18px; }
.filter-row { display: flex; align-items: end; gap: 12px; margin-bottom: 16px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.filter-row label { display: grid; flex: 1; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 700; }
.filter-row input, .filter-row select, .form-card input, .form-card select { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #cbd7d9; border-radius: 9px; background: #fff; color: var(--ink); font: inherit; }
.form-card { max-width: 760px; padding: clamp(22px, 4vw, 34px); border: 1px solid var(--line); border-radius: 18px; background: var(--paper); box-shadow: 0 8px 28px rgba(23, 57, 62, .035); }
.form-card .form-field { margin-bottom: 16px; }
.form-card .form-field input:disabled { background: var(--canvas); color: var(--muted); }
.pagination { display: flex; justify-content: center; align-items: center; gap: 18px; padding: 18px 8px; color: var(--muted); font-size: 13px; }
.pagination a { color: var(--green-dark); font-weight: 750; text-decoration: none; }
.setup-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.setup-grid h2 { margin: 0 0 8px; font-size: 19px; }
.setup-grid .muted { margin: 0 0 18px; font-size: 13px; }
.setup-grid form p { display: grid; gap: 7px; margin: 0 0 14px; }
.setup-grid form label { color: var(--muted); font-size: 12px; font-weight: 700; }
.setup-grid form input, .setup-grid form select { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #cbd7d9; border-radius: 9px; color: var(--ink); background: white; font: inherit; }
.setup-wide { grid-column: 1 / -1; }
.simple-list { display: grid; gap: 8px; padding: 0; list-style: none; color: var(--muted); font-size: 13px; }
.simple-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.simple-list form { margin: 0; }
.gradebook-form { display: grid; gap: 16px; }
.grade-table input { width: 92px; min-height: 40px; padding: 8px; border: 1px solid #cbd7d9; border-radius: 8px; font: inherit; }
.grade-table input[readonly] { color: var(--ink); background: #f2f6f5; border-style: dashed; cursor: default; }
.grade-table input:disabled { color: #69777b; background: #e4e8e9; border-color: #cbd1d3; cursor: not-allowed; }
.grade-table th small { display: block; margin-top: 5px; font-weight: 500; text-transform: none; letter-spacing: 0; }
.grade-table th.competency-col { min-width: 140px; vertical-align: top; }
.grade-table th.competency-col small { max-width: 230px; white-space: normal; font-size: 11px; line-height: 1.45; }
.correction-reason { max-width: 700px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.correction-reason textarea { min-height: 72px; padding: 10px; border: 1px solid #cbd7d9; border-radius: 8px; font: inherit; }
.correction-reason small { color: var(--muted); }
.section-list-panel { margin-top: 22px; }
.report-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.report-heading h2 { margin: 8px 0; }
.report-heading .action-row { justify-content: flex-end; }
.report-table { min-width: 760px; }
.section-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.section-panel-heading h2 { margin: 7px 0 0; font-size: 20px; }
.section-chip-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 18px 0; }
.section-chip { display: grid; justify-items: start; gap: 8px; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: #fbfdfc; }
.section-chip .state-tag { color: var(--green-dark); }
.section-chip strong { font-size: 13px; }
.section-chip span, .section-chip small { color: var(--muted); font-size: 12px; }
.section-list-panel > .muted { margin: 0; font-size: 12px; }
.teaching-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 18px 0; }
.teaching-card { display: flex; flex-direction: column; min-height: 190px; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #fbfdfc; }
.teaching-card-heading, .teaching-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.teaching-card-heading small { color: var(--muted); font-size: 11px; }
.teaching-card h3 { margin: 3px 0 0; font-size: 19px; }
.teaching-card > p { margin: 0; color: var(--muted); font-size: 13px; }
.teaching-card-footer { align-items: flex-end; margin-top: auto; }
.teaching-card-footer .muted { font-size: 11px; }
button:focus-visible, a:focus-visible { outline: 3px solid rgba(8, 126, 112, .35); outline-offset: 3px; }
@media (max-width: 800px) {
  .login-layout { grid-template-columns: 1fr; gap: 28px; }
  .login-card { justify-self: stretch; }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .teaching-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .topbar { min-height: 66px; padding: 10px 16px; }
  .account-name { display: none; }
  .main-content { width: min(100% - 28px, 1160px); padding: 30px 0; }
  .welcome-row { align-items: flex-start; flex-direction: column; }
  .card-grid { grid-template-columns: 1fr; }
  .module-card { min-height: 200px; }
  .phase-banner { align-items: flex-start; }
  .section-chip-list { grid-template-columns: 1fr; }
  .teaching-grid { grid-template-columns: 1fr; }
  .section-panel-heading { align-items: flex-start; flex-direction: column; }
  .report-heading { flex-direction: column; }
  .report-heading .action-row { justify-content: flex-start; }
  .filter-row { align-items: stretch; flex-direction: column; }
  .setup-grid { grid-template-columns: 1fr; }
  .setup-wide { grid-column: auto; }
}

/* Shared application workspace and role-aware navigation. */
:root {
  --ink: #17313a;
  --muted: #5e737b;
  --line: #d8e4e5;
  --paper: #fff;
  --canvas: #f2f7f6;
  --green: #087e70;
  --green-dark: #07685d;
  --mint: #e3f4f0;
  --shadow: 0 14px 38px rgba(20, 57, 61, .055);
}
body { background: #f2f7f6; }
.skip-link { position: fixed; z-index: 20; top: 10px; left: 10px; padding: 10px 14px; transform: translateY(-160%); border-radius: 8px; color: #fff; background: #123c39; font-weight: 700; }
.skip-link:focus { transform: translateY(0); }
.app-frame { min-height: 100vh; display: grid; grid-template-columns: 258px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; display: flex; height: 100vh; flex-direction: column; padding: 26px 16px 18px; border-right: 1px solid var(--line); background: #fff; }
.sidebar .brand { padding: 0 8px 24px; border-bottom: 1px solid #edf1f1; }
.sidebar .brand strong { font-size: 14px; }
.sidebar-nav { display: grid; align-content: start; gap: 25px; padding: 22px 0; overflow-y: auto; }
.nav-group { display: grid; gap: 5px; }
.nav-group-label, .mobile-nav-group > span { padding: 0 12px 5px; color: #84969a; font-size: 10px; font-weight: 850; letter-spacing: .11em; text-transform: uppercase; }
.nav-link { min-height: 42px; display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; color: #53696f; font-size: 13px; font-weight: 650; text-decoration: none; transition: color .15s ease, background .15s ease; }
.nav-link:hover { color: var(--green-dark); background: #f3f9f7; }
.nav-link.is-active { color: #075f54; background: #e7f5f1; font-weight: 800; }
.nav-indicator { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: #b2c2c3; }
.nav-link.is-active .nav-indicator { background: var(--green); box-shadow: 0 0 0 3px rgba(8, 126, 112, .1); }
.sidebar-footnote { display: flex; align-items: center; gap: 9px; margin-top: auto; padding: 14px 8px 0; border-top: 1px solid #edf1f1; color: #74878c; font-size: 11px; }
.sidebar-footnote .status-dot { width: 7px; height: 7px; }
.workspace { min-width: 0; display: flex; min-height: 100vh; flex-direction: column; }
.topbar { min-height: 70px; padding: 10px clamp(22px, 4vw, 52px); }
.topbar-brand { display: none; }
.app-shell:not(.app-frame) .topbar-brand { display: inline-flex; }
.topbar .button { min-height: 38px; padding: 8px 12px; font-size: 12px; }
.main-content { width: min(1320px, 100% - 56px); padding: clamp(28px, 4vw, 50px) 0; }
.footer { padding: 17px 24px; }
.mobile-navigation { display: none; }
.welcome-row { align-items: center; margin-bottom: 24px; }
.welcome-row h1 { letter-spacing: -.04em; }
.welcome-row .eyebrow { letter-spacing: .1em; }
.card-grid { gap: 14px; }
.module-card { min-height: 215px; padding: 20px; border-radius: 16px; box-shadow: var(--shadow); }
.module-card h2 { margin-top: 18px; }
.module-card p { font-size: 13px; }
.section-list-panel, .form-panel, .form-card { border-radius: 16px; box-shadow: var(--shadow); }
.dashboard-overview { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 20px; }
.overview-stat { min-width: 220px; display: flex; align-items: center; gap: 13px; padding: 14px 17px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.overview-icon { width: 38px; height: 38px; display: grid; flex: 0 0 38px; place-items: center; border-radius: 12px; color: var(--green-dark); background: var(--mint); font-size: 17px; font-weight: 850; }
.overview-stat strong, .overview-stat span:not(.overview-icon) { display: block; }
.overview-stat strong { font-size: 20px; letter-spacing: -.03em; }
.overview-stat div > span { margin-top: 2px; color: var(--muted); font-size: 11px; }
.overview-guidance { flex: 1; }
.overview-guidance strong { font-size: 14px; }
.phase-banner { border-color: #e3e8d6; background: #fbfcf5; }
.phase-pill { color: #526a34; border-color: #dce5c5; background: #f2f7e6; }
.filter-row { align-items: end; gap: 11px; padding: 14px; border-radius: 14px; box-shadow: 0 6px 20px rgba(23, 57, 62, .025); }
.filter-row input:focus, .filter-row select:focus, .form-card input:focus, .form-card select:focus { border-color: var(--green); outline: none; box-shadow: 0 0 0 3px rgba(8, 126, 112, .12); }
.result-count { margin: 0 0 10px; color: var(--muted); font-size: 12px; }
.table-wrap { box-shadow: 0 6px 20px rgba(23, 57, 62, .025); }
.data-table th { color: #526b72; background: #f3f8f7; }
.data-table td { line-height: 1.45; }
.data-table .text-link { white-space: nowrap; }
.button, .nav-link, .text-link, .text-button { transition: background-color .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(8, 126, 112, .4); outline-offset: 3px; }
@media (max-width: 980px) {
  .app-frame { grid-template-columns: 222px minmax(0, 1fr); }
  .sidebar { padding-right: 12px; padding-left: 12px; }
  .main-content { width: min(100% - 40px, 1320px); }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 740px) {
  .app-frame { display: flex; flex-direction: column; }
  .sidebar { display: none; }
  .workspace { min-height: 100vh; }
  .topbar { min-height: 64px; padding: 9px 18px; }
  .topbar-brand { display: inline-flex; }
  .topbar-brand .brand-mark { width: 36px; height: 36px; border-radius: 11px; font-size: 16px; }
  .topbar-brand strong { font-size: 13px; }
  .topbar-brand small { font-size: 10px; }
  .mobile-navigation { display: block; margin: 10px 18px 0; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
  .mobile-navigation summary { padding: 12px 14px; color: var(--green-dark); font-size: 13px; font-weight: 800; cursor: pointer; }
  .mobile-navigation nav { display: grid; gap: 14px; padding: 4px 12px 14px; }
  .mobile-nav-group { display: grid; gap: 5px; }
  .mobile-nav-group > span { padding-left: 2px; }
  .mobile-nav-group a { padding: 8px 10px; border-radius: 8px; color: #53696f; font-size: 13px; text-decoration: none; }
  .mobile-nav-group a[aria-current="page"] { color: var(--green-dark); background: var(--mint); font-weight: 800; }
  .main-content { width: min(100% - 32px, 700px); padding: 28px 0; }
  .account-tools { gap: 8px; }
  .account-tools .button { padding: 7px 9px; font-size: 11px; }
  .dashboard-overview { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-stat { min-width: 0; padding: 12px; }
  .overview-icon { width: 34px; height: 34px; flex-basis: 34px; }
}
@media (max-width: 560px) {
  .topbar { align-items: flex-start; gap: 12px; }
  .topbar-brand { gap: 8px; }
  .account-tools { align-items: flex-end; flex-wrap: wrap; justify-content: flex-end; }
  .account-tools .button { min-height: 34px; }
  .account-tools form button { min-height: 34px; }
  .main-content { width: min(100% - 28px, 560px); padding-top: 24px; }
  .welcome-row { align-items: flex-start; }
  .welcome-row > .button, .welcome-row .action-row { width: 100%; }
  .welcome-row .action-row .button { flex: 1; }
  .card-grid { grid-template-columns: 1fr; }
  .module-card { min-height: 0; }
  .overview-stat { align-items: flex-start; gap: 9px; }
  .overview-stat strong { font-size: 17px; }
  .overview-stat div > span { font-size: 10px; }
  .filter-row { padding: 12px; }
  .account-filters { display: grid; grid-template-columns: 1fr 1fr; }
  .account-filters label:first-child { grid-column: 1 / -1; }
  .account-filters button { grid-column: 1 / -1; }
  .mobile-card-wrap { overflow: visible; border: 0; box-shadow: none; background: transparent; }
  .mobile-card-table { display: block; font-size: 12px; }
  .mobile-card-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  .mobile-card-table tbody { display: grid; gap: 10px; }
  .mobile-card-table tbody tr { display: grid; gap: 0; padding: 8px 13px; border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: 0 5px 16px rgba(23, 57, 62, .03); }
  .mobile-card-table tbody td { display: grid; grid-template-columns: minmax(100px, .85fr) minmax(0, 1.5fr); gap: 12px; padding: 9px 0; border-bottom: 1px solid #edf1f1; overflow-wrap: anywhere; }
  .mobile-card-table tbody td:last-child { border-bottom: 0; }
  .mobile-card-table tbody td::before { content: attr(data-label); color: #70848a; font-size: 10px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
  .mobile-card-table tbody td[colspan] { display: block; padding: 12px 0; border: 0; }
  .mobile-card-table tbody td[colspan]::before { content: none; }
  .mobile-card-table .action-row { justify-content: flex-start; }
  .phase-banner { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

/* Large, touch-friendly course and teacher directories. */
.browse-switch { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 28px; }
.browse-switch a { min-height: 52px; display: flex; flex: 1 1 220px; align-items: center; justify-content: space-between; padding: 14px 18px; border: 1px solid #cce4de; border-radius: 14px; color: var(--green-dark); background: #fff; font-weight: 800; text-decoration: none; }
.browse-switch a:hover, .browse-switch a:focus-visible { background: var(--mint); box-shadow: 0 7px 22px rgba(23, 57, 62, .08); }
.directory-section { margin: 24px 0 34px; }
.directory-heading { margin: 0 0 15px; }
.directory-heading h2 { margin: 5px 0; font-size: 22px; letter-spacing: -.025em; }
.directory-heading p { margin: 0; color: var(--muted); font-size: 14px; }
.browse-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(235px, 1fr)); gap: 14px; }
.browse-card { min-height: 204px; display: flex; flex-direction: column; align-items: flex-start; padding: 19px; border: 1px solid var(--line); border-radius: 17px; color: var(--ink); background: #fff; box-shadow: 0 7px 24px rgba(23, 57, 62, .045); text-decoration: none; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.browse-card:hover, .browse-card:focus-visible { transform: translateY(-2px); border-color: #a6d2c8; box-shadow: 0 12px 28px rgba(23, 57, 62, .1); }
.browse-card-icon { width: 38px; height: 38px; display: grid; place-items: center; margin-bottom: 13px; border-radius: 12px; color: var(--green-dark); background: var(--mint); font-size: 15px; font-weight: 900; }
.browse-card-kicker { color: var(--green-dark); font-size: 11px; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
.browse-card h3 { margin: 7px 0; font-size: 18px; line-height: 1.3; letter-spacing: -.02em; }
.browse-card p { margin: 0 0 12px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.browse-card-meta { margin-bottom: 13px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.browse-card-action { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; margin-top: auto; padding-top: 12px; border-top: 1px solid #edf2f1; color: var(--green-dark); font-size: 13px; font-weight: 850; }
.browse-card-action b { font-size: 18px; }
.detail-back { margin: -10px 0 18px; }
.detail-back a { display: inline-flex; min-height: 42px; align-items: center; color: var(--green-dark); font-size: 14px; font-weight: 800; text-decoration: none; }
.detail-summary { margin: 0 0 20px; padding: 20px 22px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow); }
.detail-summary h2 { margin: 7px 0; font-size: 23px; }
.detail-summary p { margin: 0; color: var(--muted); line-height: 1.6; }
.assignment-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.assignment-card { min-height: 225px; display: flex; flex-direction: column; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 7px 24px rgba(23, 57, 62, .04); }
.assignment-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.assignment-card h3 { margin: 14px 0 4px; font-size: 18px; }
.assignment-subject { margin: 0 0 6px; color: var(--green-dark); font-size: 15px; font-weight: 800; }
.assignment-teacher { margin: 0; color: var(--muted); font-size: 13px; }
.period-pills { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 14px; color: var(--muted); font-size: 11px; }
.period-pill { padding: 5px 8px; border: 1px solid #d5e8e2; border-radius: 999px; color: var(--green-dark); background: #f3faf7; font-weight: 800; }
.assignment-actions { display: grid; gap: 5px; margin-top: auto; padding-top: 14px; }
.assignment-actions .browse-card-action { margin: 0; }
.assignment-actions .text-link { padding: 5px 0; }
.course-subject-list { display: grid; gap: 8px; width: 100%; margin: 0 0 13px; padding: 0; list-style: none; }
.course-subject-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid #edf2f1; color: var(--ink); font-size: 13px; font-weight: 700; }
.course-subject-list small { color: var(--muted); font-size: 11px; font-weight: 600; }
@media (max-width: 560px) {
  .browse-switch { display: grid; grid-template-columns: 1fr; }
  .browse-grid, .assignment-grid { grid-template-columns: 1fr; }
  .browse-card { min-height: 185px; }
  .detail-summary { padding: 17px; }
}

/* Colores semánticos: ayudan a reconocer curso, asignatura y estado sin depender solo del texto. */
:root {
  --course-ink: #2453a6;
  --course-bg: #edf3ff;
  --course-line: #cad9fb;
  --subject-ink: #7041a6;
  --subject-bg: #f4efff;
  --subject-line: #ded0fa;
  --teacher-ink: #087568;
  --teacher-bg: #e8f6f2;
  --teacher-line: #bfe5da;
  --open-ink: #855400;
  --open-bg: #fff4d8;
  --open-line: #f0d793;
  --closed-ink: #56636b;
  --closed-bg: #eff2f4;
  --closed-line: #d5dde1;
  --published-ink: #17683d;
  --published-bg: #e6f6e9;
  --published-line: #b9e2c1;
}
.data-chip { display: inline-flex; align-items: center; width: fit-content; max-width: 100%; padding: 5px 9px; border: 1px solid transparent; border-radius: 8px; font-size: 12px; font-weight: 750; line-height: 1.35; vertical-align: middle; }
.data-course { color: var(--course-ink); border-color: var(--course-line); background: var(--course-bg); }
.data-year, .data-code { color: #42545d; border-color: #d7e0e4; background: #f2f5f7; }
.data-subject { color: var(--subject-ink); border-color: var(--subject-line); background: var(--subject-bg); }
.data-role { color: var(--teacher-ink); border-color: var(--teacher-line); background: var(--teacher-bg); }
.data-role-dot { display: inline-block; width: 9px; height: 9px; margin: 0 8px 2px 0; border-radius: 50%; background: var(--teacher-ink); vertical-align: middle; }
.period-open { color: var(--open-ink) !important; border-color: var(--open-line) !important; background: var(--open-bg) !important; }
.period-closed { color: var(--closed-ink) !important; border-color: var(--closed-line) !important; background: var(--closed-bg) !important; }
.period-published { color: var(--published-ink) !important; border-color: var(--published-line) !important; background: var(--published-bg) !important; }
.period-list li { align-items: center; gap: 14px; padding: 12px 0; }
.period-name { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; color: var(--ink); font-size: 13px; font-weight: 650; }
.period-status { font-size: 11px; }
.assignment-card { border-top: 3px solid var(--subject-line); }
.assignment-card h3 { display: flex; align-items: center; line-height: 1.35; }
.assignment-subject { margin: 8px 0 3px; }
.assignment-teacher { margin: 7px 0 0; }
.period-pills { padding-top: 8px; border-top: 1px solid #edf1f2; }
.period-pill { border-color: var(--closed-line); color: var(--closed-ink); background: var(--closed-bg); }
.gradebook-form .data-table th:nth-child(1), .gradebook-form .data-table td:nth-child(1) { min-width: 220px; }
.gradebook-form .data-table th:nth-child(2), .gradebook-form .data-table td:nth-child(2) { min-width: 130px; }
.grade-table .competency-c1 { background-color: #f2f6ff; }
.grade-table .competency-c2 { background-color: #f7f2ff; }
.grade-table .competency-c3 { background-color: #fff7e8; }
.grade-table .competency-c4 { background-color: #eef8f1; }
.grade-table th.competency-c1 { color: #2453a6; }
.grade-table th.competency-c2 { color: #7041a6; }
.grade-table th.competency-c3 { color: #855400; }
.grade-table th.competency-c4 { color: #17683d; }
.grade-table td.competency-col input { border-color: #cbd7d9; background: rgba(255,255,255,.9); }
.grade-table td.competency-col input:focus { outline: 3px solid rgba(8,126,112,.2); outline-offset: 1px; }
@media (max-width: 700px) {
  .period-list li { align-items: flex-start; flex-direction: column; }
  .period-list .action-row { width: 100%; justify-content: flex-start; }
  .gradebook-form .table-wrap { border-radius: 12px; }
}

/* Reporte de curso: una tarjeta por estudiante y período */
.diploma-period-form { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 16px; }
.diploma-period-form label { font-weight: 700; font-size: 13px; }
.diploma-period-form select { width: auto; min-width: 220px; }
.diploma-method { max-width: 980px; line-height: 1.6; }
.diploma-subjects { display: flex; flex-wrap: wrap; gap: 7px; margin: 16px 0 22px; }
.diploma-winners { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.diploma-winner { padding: 24px 20px; border: 1px solid #dfd5bf; border-top: 4px solid #c9ab6f; border-radius: 14px; background: #faf9f5; text-align: center; }
.diploma-place { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin: 0 auto 14px; border: 1px solid #c9ab6f; border-radius: 50%; background: #0c1952; color: #f4ead7; font-family: "Report Caslon", Georgia, serif; font-size: 23px; }
.diploma-winner .eyebrow { color: #897037; }
.diploma-winner h3 { color: #1d2d50; font-family: "Report Caslon", Georgia, serif; font-weight: 400; font-size: 19px; line-height: 1.4; }
.diploma-index { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 12px; border-radius: 8px; background: #edf1f9; color: #243d7a; }
.diploma-index span { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.diploma-index strong { font-size: 26px; font-variant-numeric: tabular-nums; }
.diploma-message { min-height: 100px; color: #526079; font-size: 13px; line-height: 1.65; }
@media (max-width: 1000px) { .diploma-winners { grid-template-columns: 1fr; } .diploma-message { min-height: 0; } }
.period-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 16px; }
.period-filter a { padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--muted); font-size: 12px; font-weight: 750; text-decoration: none; }
.period-filter a:hover { border-color: #b9d8d0; color: var(--green-dark); }
.period-filter a.is-active { border-color: var(--green); background: var(--green); color: #fff; }
.grade-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
.grade-card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); box-shadow: 0 10px 30px rgba(23, 57, 62, .045); overflow: hidden; }
.grade-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 15px 17px 12px; border-bottom: 1px solid var(--line); background: #fbfdfc; }
.grade-card-head h3 { margin: 0 0 4px; font-size: 14.5px; letter-spacing: -.01em; }
.grade-card-head p { margin: 0; font-size: 11.5px; }
.grade-card-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.grade-card-table th { padding: 7px 10px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .07em; text-align: left; text-transform: uppercase; }
.grade-card-table td { padding: 7px 10px; border-bottom: 1px solid #eef3f2; vertical-align: middle; }
.grade-card-table tbody tr:last-child td { border-bottom: 0; }
.grade-card-table .num { text-align: center; font-variant-numeric: tabular-nums; }
.grade-score { font-variant-numeric: tabular-nums; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
.grade-score--low { color: #b4232c; }
.grade-score--high { color: #16803d; }
.grade-score--average { color: #000000; }
.grade-score--missing { color: #8a96a6; }
.competency-label-c1 { color: #2453a6 !important; }
.competency-label-c2 { color: #7041a6 !important; }
.competency-label-c3 { color: #855400 !important; }
.competency-label-c4 { color: #087568 !important; }
.competency-legend { margin: 0 17px 17px; padding-top: 14px; border-top: 1px solid #d6deea; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
.competency-legend h4 { margin: 0 0 12px; color: #1d2d50; font-family: "Report Caslon", Georgia, serif; font-size: 16px; font-weight: 400; }
.competency-legend-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.competency-legend-item { display: flex; align-items: center; gap: 8px; padding: 9px; border-radius: 7px; background: var(--competency-bg); color: var(--competency-color); }
.competency-legend-item strong { flex: 0 0 27px; padding: 4px 0; border-radius: 5px; background: var(--competency-color); color: white; font-size: 10px; text-align: center; }
.competency-legend-item span { min-width: 0; font-size: 10px; line-height: 1.4; }
@media (max-width: 420px) { .competency-legend-grid { grid-template-columns: 1fr; } }
.subject-code { display: inline-block; padding: 2px 7px; border-radius: 6px; background: var(--mint); color: var(--green-dark); font-size: 10.5px; font-weight: 800; letter-spacing: .04em; }
.grade-card-foot { margin-top: auto; padding: 9px 17px 13px; color: var(--muted); font-size: 11px; }
@font-face { font-family: "Report Caslon"; src: url("../fonts/LibreCaslonText.ebc4f134d02f.ttf") format("truetype"); font-style: normal; font-weight: 400 700; font-display: swap; }
.report-center { padding: 22px 18px 16px; border-top: 3px solid #c9ab6f; background: #0c1952; color: #d1d8ee; }
.report-center-heading { display: grid; grid-template-columns: 56px minmax(0, 1fr) 56px; align-items: center; gap: 14px; margin-bottom: 16px; }
.report-center-crest { position: relative; width: 56px; height: 56px; overflow: hidden; border-radius: 50%; }
.report-center-crest img { position: absolute; display: block; max-width: none; padding: 0; border: 0; border-radius: 0; }
.report-center-crest-school img { width: 102.040816%; height: 102.040816%; left: -1.020408%; top: -1.020408%; }
.report-center-crest-district img { width: 125.396825%; height: 125.396825%; left: -14.021164%; top: -11.904762%; }
.report-center-name { min-width: 0; text-align: center; }
.report-center-name span { display: block; margin-bottom: 8px; color: #d7bd86; font-size: 8px; font-weight: 700; text-transform: uppercase; letter-spacing: .16em; }
.report-center-name strong { display: block; color: #f4ead7; font-family: "Report Caslon", Georgia, serif; font-weight: 400; font-size: 18px; line-height: 1.25; }
.report-center p { margin: 5px 0 0; font-size: 10px; line-height: 1.4; text-align: center; }
.report-center p:last-child { color: #b9c4e1; }
@media (max-width: 420px) {
  .report-center { padding-inline: 12px; }
  .report-center-heading { grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 8px; }
  .report-center-crest { width: 44px; height: 44px; }
  .report-center-name strong { font-size: 16px; }
  .report-center-name span { font-size: 7px; letter-spacing: .1em; }
}
.grade-card-signatures { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 4px 17px 17px; }
.grade-card-signature { min-width: 0; padding: 42px 14px 10px; border: 1px solid #d4e3e5; border-radius: 10px; background: #fbfdfd; text-align: center; }
.grade-card-signature span { display: block; padding-top: 9px; border-top: 1px solid #243d7a; color: #1d2d50; font-size: 10px; font-weight: 700; }
@media (max-width: 980px) {
  .grade-card-grid { grid-template-columns: 1fr; }
}
@media print {
  .no-print, .topbar, .footer, .detail-back, .sidebar, .mobile-navigation, .notice, .skip-link { display: none !important; }
  .workspace { display: block !important; }
  .main-content { width: 100%; max-width: none; padding: 0; margin: 0; }
  .grade-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .grade-card { break-inside: avoid; box-shadow: none; }
  .period-filter { display: none; }
}
