:root {
  --plum-950: #22153f;
  --plum-900: #2d1c52;
  --plum-800: #3a2763;
  --plum-700: #503477;
  --plum-100: #eee8f5;
  --plum-50: #f7f4fa;
  --gold-600: #b9861b;
  --gold-500: #d2a238;
  --gold-300: #e3bf67;
  --gold-200: #edd59a;
  --gold-100: #f8edcf;
  --cream: #fffaf0;
  --cream-strong: #fbf1dd;
  --ink: #25212a;
  --muted: #6c6671;
  --line: #ded9e1;
  --line-dark: #c7c1cb;
  --green: #266c51;
  --green-bg: #e6f3ed;
  --amber: #8b5c0b;
  --amber-bg: #fbefd7;
  --red: #923a35;
  --red-bg: #fae9e7;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Bulk Target Entry */
.context-bar.target-context-bar {
  grid-template-columns: repeat(2, minmax(220px, 1fr)) auto;
}

.target-subject-selector {
  margin: 22px 0;
  padding: 18px;
  border: 1px solid var(--gold-200);
  border-radius: 6px;
  background: var(--cream);
}

.target-subject-selector legend {
  padding: 0 7px;
  color: var(--plum-900);
  font: 700 20px var(--serif);
}

.target-subject-selector > p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
}

.target-subject-options {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.target-subject-options label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid var(--line-dark);
  border-radius: 4px;
  background: #fff;
  font-weight: 700;
  cursor: pointer;
}

.target-subject-options label:has(input:checked) {
  border-color: var(--green);
  background: var(--green-bg);
}

.target-subject-options input {
  width: 17px;
  height: 17px;
  accent-color: var(--green);
}

.target-subject-selector .field-error {
  margin-top: 10px;
  color: var(--red);
  font-size: 13px;
  font-weight: 700;
}

.target-ledger-table thead th {
  top: 0;
}

.target-level-cell {
  min-width: 152px;
}

.target-level-input {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 7px 9px;
  border: 1px solid var(--line-dark);
  border-radius: 4px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}

.target-level-input:focus {
  border-color: var(--plum-700);
  outline: 3px solid rgb(45 28 82 / 14%);
  outline-offset: 1px;
}

.target-level-input.is-changed {
  border-color: var(--gold-500);
  background: #fffbef;
}

.record-summary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.report-batch-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 20px 0;
  padding: 18px 20px;
  border-left: 4px solid var(--green);
  background: var(--green-bg);
}

.report-batch-action h2,
.report-batch-action p {
  margin: 0;
}

.report-batch-action h2 {
  color: var(--plum-900);
  font-size: 20px;
}

.report-batch-action p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 620px) {
  .report-batch-action {
    align-items: stretch;
    flex-direction: column;
  }

  .report-batch-action .button {
    width: 100%;
  }
}

@media (max-width: 980px) {
  .context-bar.target-context-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .context-bar.target-context-bar {
    grid-template-columns: 1fr;
  }
}

/* Bulk Exam Mark Entry */
.exam-marks-rule {
  max-width: 320px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.context-bar.exam-context-bar {
  grid-template-columns: repeat(3, minmax(180px, 1fr)) auto;
}

.exam-ledger {
  border-top: 1px solid var(--line-dark);
  border-bottom: 1px solid var(--line-dark);
}

.exam-ledger-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 0 18px;
}

.exam-ledger-heading h2 {
  margin-bottom: 5px;
  font-size: 30px;
}

.exam-ledger-heading p,
.exam-save-bar p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.exam-ledger-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
}

.exam-sort-control {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 7px;
}

.exam-sort-control > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.exam-sort-control select {
  min-height: 34px;
  padding: 5px 28px 5px 9px;
  border: 1px solid var(--line-dark);
  border-radius: 4px;
  color: var(--ink);
  background: #fff;
  font: 700 12px var(--sans);
}

.exam-subject-count {
  padding: 8px 10px;
  border-left: 3px solid var(--green);
  color: var(--ink);
  background: var(--green-bg);
  font-size: 12px;
  font-weight: 750;
}

.exam-subject-count-off {
  border-color: var(--line-dark);
  color: var(--muted);
  background: var(--plum-50);
}

.exam-ledger-table-wrap {
  max-width: 100%;
}

.exam-ledger-table {
  min-width: 1120px;
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.exam-ledger-table th,
.exam-ledger-table td {
  padding: 11px 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
  text-align: left;
}

.exam-ledger-table thead th {
  position: sticky;
  z-index: 4;
  top: 0;
  color: #5e5662;
  background: #f8f6f9;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.exam-ledger-table thead .exam-maximum-row th {
  top: 55px;
  background: var(--cream);
  letter-spacing: 0;
  text-transform: none;
}

.exam-ledger-table .exam-identity,
.exam-ledger-table .exam-student {
  position: sticky;
  z-index: 3;
}

.exam-ledger-table .exam-identity {
  left: 0;
  width: 145px;
  min-width: 145px;
}

.exam-ledger-table .exam-student {
  left: 145px;
  width: 215px;
  min-width: 215px;
  box-shadow: 7px 0 10px -10px var(--plum-900);
}

.exam-ledger-table thead .exam-identity,
.exam-ledger-table thead .exam-student {
  z-index: 6;
}

.exam-ledger-table tbody tr:hover td {
  background: #fffdf7;
}

.exam-ledger-table tbody tr:hover .exam-identity,
.exam-ledger-table tbody tr:hover .exam-student {
  background: #fff9eb;
}

.exam-student strong,
.exam-student small,
.exam-subject-header strong,
.exam-subject-header small {
  display: block;
}

.exam-student small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.exam-subject-header,
.exam-mark-cell {
  min-width: 152px;
}

.exam-subject-header strong {
  color: var(--plum-900);
  font-family: var(--serif);
  font-size: 16px;
  letter-spacing: 0;
  text-transform: none;
}

.exam-subject-header small {
  margin-top: 3px;
  color: var(--green);
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
}

.exam-subject-header.is-unavailable strong,
.exam-subject-header.is-unavailable small {
  color: #817a85;
}

.exam-maximum-control,
.exam-mark-control {
  display: grid;
  grid-template-columns: minmax(68px, 1fr) auto;
  align-items: center;
  gap: 7px;
}

.exam-maximum-control input,
.exam-mark-control input {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 7px 9px;
  border: 1px solid var(--line-dark);
  border-radius: 4px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}

.exam-maximum-control input:focus,
.exam-mark-control input:focus {
  border-color: var(--plum-700);
  outline: 3px solid rgb(45 28 82 / 14%);
  outline-offset: 1px;
}

.exam-maximum-control input.is-changed,
.exam-mark-control input.is-changed {
  border-color: var(--gold-500);
  background: #fffbef;
}

.exam-maximum-control input[aria-invalid="true"],
.exam-mark-control input[aria-invalid="true"] {
  border-color: var(--red);
  background: var(--red-bg);
}

.exam-maximum-control small,
.exam-mark-control small {
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.exam-mark-cell.is-unavailable {
  color: #918b94;
  background: #f5f3f6;
}

.exam-mark-cell.is-unavailable input {
  color: #918b94;
  background: #f5f3f6;
}

.exam-ledger.is-hiding-unavailable .is-unavailable {
  display: none;
}

.exam-save-bar {
  position: sticky;
  z-index: 8;
  bottom: 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 22px;
  padding: 14px 0;
  background: rgb(255 255 255 / 96%);
  border-top: 1px solid var(--gold-200);
  box-shadow: 0 -8px 28px rgb(34 21 63 / 7%);
  backdrop-filter: blur(8px);
}

.exam-change-count {
  min-width: 160px;
}

.exam-change-count strong,
.exam-change-count span {
  display: block;
}

.exam-change-count strong {
  color: var(--plum-900);
  font-size: 18px;
}

.exam-change-count span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 980px) {
  .context-bar.exam-context-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .exam-ledger-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .exam-ledger-tools {
    justify-content: flex-start;
  }

  .exam-save-bar {
    grid-template-columns: 1fr auto;
  }

  .exam-save-bar p {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

@media (max-width: 620px) {
  .exam-marks-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .exam-marks-rule {
    max-width: none;
    text-align: left;
  }

  .context-bar.exam-context-bar {
    grid-template-columns: 1fr;
  }

  .exam-ledger-tools {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .exam-sort-control,
  .exam-ledger-tools .button {
    grid-column: 1 / -1;
  }

  .exam-sort-control {
    grid-template-columns: auto 1fr;
  }

  .exam-save-bar {
    position: static;
    grid-template-columns: 1fr;
    text-align: center;
    box-shadow: none;
  }

  .exam-save-bar p {
    grid-column: auto;
    grid-row: auto;
  }

  .exam-ledger-table .exam-identity {
    width: 120px;
    min-width: 120px;
  }

  .exam-ledger-table .exam-student {
    left: 120px;
    width: 185px;
    min-width: 185px;
  }
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  color: var(--ink);
  background: #fff;
  font-family: var(--sans);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

/* Public error page */
.error-body {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  background: #fff;
}

.error-header {
  min-height: 176px;
  display: flex;
  align-items: center;
  padding: 22px 36px;
  background: var(--plum-950);
  border-bottom: 4px solid var(--gold-300);
}

.error-brand {
  display: inline-flex;
  align-items: center;
  gap: 24px;
  color: #fff;
  font: 650 34px/1.05 var(--serif);
  text-decoration: none;
}

.error-brand img {
  width: 120px;
  height: 120px;
}

.error-page {
  width: min(1280px, calc(100% - 72px));
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(400px, 0.9fr);
  grid-template-areas:
    "message code"
    "help help";
  align-items: center;
  gap: 28px 70px;
  margin: 0 auto;
  padding: 70px 0 42px;
}

.error-message {
  grid-area: message;
}

.error-message h1 {
  max-width: 620px;
  margin-bottom: 32px;
  font-size: clamp(62px, 6vw, 92px);
  font-weight: 600;
  line-height: 1.02;
}

.error-message > p {
  margin-bottom: 48px;
  color: var(--muted);
  font-size: 21px;
  line-height: 1.5;
}

.error-actions {
  display: flex;
  align-items: center;
  gap: 46px;
}

.error-actions .button {
  min-width: 352px;
  min-height: 74px;
  justify-content: center;
  font-size: 18px;
}

.error-back {
  font-size: 18px;
  font-weight: 750;
}

.error-code {
  grid-area: code;
  margin: 0;
  color: transparent;
  font: 400 clamp(180px, 28vw, 410px)/0.8 var(--serif);
  letter-spacing: -0.08em;
  text-align: right;
  -webkit-text-stroke: 2px #b5a6bd;
}

.error-help {
  grid-area: help;
  align-self: end;
  margin: 0;
  padding-top: 34px;
  color: var(--muted);
  border-top: 1px solid var(--gold-200);
  font-size: 16px;
}

.error-footer {
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  padding: 24px max(36px, calc((100% - 1280px) / 2));
  color: var(--muted);
  background: var(--cream);
  border-top: 1px solid var(--gold-200);
}

.error-footer strong {
  color: var(--plum-900);
  font: 650 23px var(--serif);
}

@media (max-width: 760px) {
  .error-header {
    min-height: 110px;
    padding: 16px 20px;
    border-bottom-width: 3px;
  }

  .error-brand {
    gap: 14px;
    font-size: 22px;
  }

  .error-brand img {
    width: 70px;
    height: 70px;
  }

  .error-page {
    width: min(100% - 40px, 520px);
    grid-template-columns: 1fr;
    grid-template-areas:
      "code"
      "message"
      "help";
    align-content: center;
    gap: 34px;
    padding: 50px 0 38px;
  }

  .error-code {
    font-size: clamp(118px, 42vw, 170px);
    line-height: 0.72;
    text-align: left;
    -webkit-text-stroke-width: 1px;
  }

  .error-message h1 {
    margin-bottom: 20px;
    font-size: clamp(46px, 14vw, 64px);
  }

  .error-message > p {
    margin-bottom: 30px;
    font-size: 18px;
  }

  .error-actions {
    align-items: stretch;
    flex-direction: column;
    gap: 22px;
  }

  .error-actions .button {
    width: 100%;
    min-width: 0;
    min-height: 56px;
  }

  .error-back {
    align-self: flex-start;
  }

  .error-help {
    padding-top: 26px;
    line-height: 1.55;
  }

  .error-footer {
    min-height: 108px;
    padding: 22px 20px;
  }
}

button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: var(--plum-800);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid rgb(210 162 56 / 55%);
  outline-offset: 3px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  color: var(--plum-900);
  font-family: var(--serif);
  letter-spacing: -0.03em;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  color: #fff;
  background: var(--plum-950);
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: translateY(0);
}

.app-header {
  min-height: 82px;
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 22px;
  padding: 0 26px;
  color: #fff;
  background: var(--plum-950);
  border-bottom: 1px solid rgb(237 213 154 / 45%);
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  color: #fff;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 650;
  line-height: 1.08;
  text-decoration: none;
}

.app-brand img {
  width: 62px;
  height: 62px;
  object-fit: contain;
}

.main-navigation {
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.main-navigation a {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 12px;
  color: rgb(255 255 255 / 80%);
  font-size: 14px;
  text-decoration: none;
}

.main-navigation a:hover {
  color: #fff;
  background: rgb(255 255 255 / 4%);
}

.main-navigation a.active {
  color: #f1ca63;
  font-weight: 750;
}

.main-navigation a.active::after {
  position: absolute;
  right: 12px;
  bottom: 0;
  left: 12px;
  height: 3px;
  background: #f1ca63;
  content: "";
}

.nav-dropdown {
  position: relative;
  display: flex;
  align-items: stretch;
  color: rgb(255 255 255 / 80%);
}

.nav-dropdown summary {
  position: relative;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 12px;
  color: inherit;
  font-size: 14px;
  cursor: pointer;
  list-style: none;
}

.nav-dropdown summary::-webkit-details-marker {
  display: none;
}

.nav-dropdown summary::before {
  order: 2;
  width: 6px;
  height: 6px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  content: "";
  transform: translateY(-2px) rotate(45deg);
}

.nav-dropdown summary:hover,
.nav-dropdown summary:focus-visible {
  color: #fff;
  background: rgb(255 255 255 / 4%);
}

.nav-dropdown summary.active {
  color: #f1ca63;
  font-weight: 750;
}

.nav-dropdown summary.active::after {
  position: absolute;
  right: 12px;
  bottom: 0;
  left: 12px;
  height: 3px;
  background: #f1ca63;
  content: "";
}

.nav-dropdown-menu {
  position: absolute;
  z-index: 45;
  top: 100%;
  left: 0;
  min-width: 190px;
  display: none;
  padding: 7px;
  background: var(--plum-950);
  border: 1px solid rgb(237 213 154 / 35%);
  box-shadow: 0 14px 30px rgb(18 10 34 / 30%);
}

.nav-dropdown[open] .nav-dropdown-menu,
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  display: grid;
}

.main-navigation .nav-dropdown-menu a {
  min-height: 42px;
  padding: 9px 12px;
  white-space: nowrap;
}

.main-navigation .nav-dropdown-menu a.active::after {
  display: none;
}

.staff-menu {
  min-width: 240px;
  display: grid;
  grid-template-columns: 38px minmax(90px, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding-left: 20px;
  border-left: 1px solid rgb(255 255 255 / 24%);
}

.staff-avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--gold-300);
  border-radius: 50%;
  color: var(--gold-300);
  font-size: 12px;
  font-weight: 800;
}

.staff-menu > span:nth-child(2) {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.staff-menu strong {
  font-size: 13px;
}

.staff-menu small {
  color: rgb(255 255 255 / 62%);
  font-size: 11px;
}

.staff-menu > a,
.staff-actions a {
  color: rgb(255 255 255 / 78%);
  font-size: 12px;
}

.staff-actions {
  display: grid;
  gap: 4px;
  text-align: right;
}

.mobile-menu {
  display: none;
}

.app-main {
  min-height: calc(100vh - 82px);
}

.page {
  width: min(100% - 64px, 1380px);
  margin: 0 auto;
  padding: 42px 0 72px;
}

.narrow-page {
  max-width: 720px;
}

@media print {
  .app-header,
  .site-footer,
  .page-actions,
  .flash {
    display: none !important;
  }

  .page {
    width: 100%;
    padding: 0;
  }
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 28px;
  padding-bottom: 25px;
  border-bottom: 1px solid var(--gold-200);
}

.page-heading h1 {
  margin-bottom: 8px;
  font-size: clamp(38px, 4vw, 54px);
  font-weight: 600;
  line-height: 1;
}

.page-heading p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.page-actions,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid var(--plum-800);
  border-radius: 5px;
  color: var(--plum-900);
  background: #fff;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}

.button-primary {
  color: #fff;
  background: var(--plum-900);
}

.button-primary:hover {
  background: var(--plum-800);
}

.button-danger {
  border-color: var(--red);
  color: var(--red);
}

.button-wide {
  width: 100%;
}

.button-small {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.link-button {
  padding: 0;
  border: 0;
  color: var(--plum-800);
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.flash {
  width: min(100% - 64px, 1380px);
  margin: 22px auto -8px;
  padding: 13px 15px;
  border-left: 3px solid var(--plum-700);
  color: var(--plum-900);
  background: var(--plum-50);
}

.flash-success {
  border-color: var(--green);
  color: var(--green);
  background: var(--green-bg);
}

.flash-error {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-bg);
}

.filters {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) repeat(3, minmax(170px, 0.5fr)) auto;
  gap: 14px;
  align-items: end;
  margin-bottom: 28px;
  padding: 18px 0 22px;
  border-bottom: 1px solid var(--line);
}

.field {
  display: grid;
  gap: 7px;
}

.field > span,
.field > label,
.field-label {
  color: #58515d;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 13px;
  border: 1px solid var(--line-dark);
  border-radius: 5px;
  color: var(--ink);
  background: #fff;
}

.field textarea {
  min-height: 130px;
  resize: vertical;
}

.field-help {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 24px;
}

.form-grid .full {
  grid-column: 1 / -1;
}

.form-section {
  margin-bottom: 30px;
  padding: 26px 0 30px;
  border-top: 1px solid var(--line);
}

.form-section h2 {
  margin-bottom: 19px;
  font-size: 29px;
}

.form-actions {
  position: sticky;
  z-index: 5;
  bottom: 0;
  justify-content: flex-end;
  padding: 17px 0;
  background: rgb(255 255 255 / 96%);
  border-top: 1px solid var(--gold-200);
}

.table-wrap {
  overflow-x: auto;
  border-top: 1px solid var(--line-dark);
  border-bottom: 1px solid var(--line-dark);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  padding: 12px 14px;
  color: #6b6470;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.075em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.data-table td {
  padding: 15px 14px;
  border-top: 1px solid var(--line);
  vertical-align: middle;
}

.data-table tbody tr:hover {
  background: var(--cream);
}

.data-table .selected-row {
  background: var(--cream);
  box-shadow: inset 3px 0 var(--plum-700);
}

.data-table input,
.data-table select {
  width: 100%;
  min-width: 105px;
  min-height: 38px;
  padding: 7px 9px;
  border: 1px solid var(--line-dark);
  border-radius: 4px;
  background: #fff;
}

.record-link {
  color: var(--ink);
  font-weight: 750;
  text-decoration: none;
}

.record-link:hover {
  color: var(--plum-700);
  text-decoration: underline;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--green);
  background: var(--green-bg);
  font-size: 12px;
  font-weight: 750;
}

.status-archived,
.status-absent {
  color: var(--red);
  background: var(--red-bg);
}

.status-pending,
.status-late {
  color: var(--amber);
  background: var(--amber-bg);
}

.empty-state {
  padding: 54px 26px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.empty-state h2 {
  margin-bottom: 9px;
  font-size: 30px;
}

.empty-state p {
  color: var(--muted);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line-dark);
  border-left: 1px solid var(--line);
}

.dashboard-item {
  min-height: 180px;
  padding: 28px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}

.dashboard-item:hover {
  background: var(--cream);
}

.dashboard-item span {
  display: block;
  margin-bottom: 35px;
  color: var(--gold-600);
  font-family: var(--serif);
  font-size: 20px;
}

.dashboard-item h2 {
  margin-bottom: 8px;
  font-size: 26px;
}

.dashboard-item p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

/* Role-aware home */
.home-page {
  padding-top: 46px;
}

.home-date,
.home-kicker {
  color: var(--gold-600);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.home-date {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.home-intro {
  padding-bottom: 34px;
  border-bottom: 1px solid var(--gold-200);
}

.home-intro h1 {
  max-width: 1200px;
  margin-bottom: 9px;
  font-size: clamp(44px, 4.7vw, 64px);
  font-weight: 550;
  line-height: 0.98;
}

.home-intro > p:last-child,
.admin-brief > p,
.admin-queue-heading p,
.home-queue-empty p {
  color: var(--muted);
  line-height: 1.55;
}

.teacher-home-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(420px, 1.08fr);
  gap: 54px;
  padding: 42px 0 48px;
}

.teacher-focus {
  padding-right: 54px;
  border-right: 1px solid var(--line);
}

.teacher-class-heading,
.admin-queue-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.teacher-class-heading h2 {
  margin: 0 0 4px;
  font-size: clamp(48px, 5vw, 66px);
  font-weight: 550;
  line-height: 1;
}

.teacher-class-heading p {
  color: var(--muted);
}

.home-text-link {
  color: var(--plum-800);
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
}

.teacher-class-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 30px 0 22px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.teacher-class-facts div {
  min-width: 0;
  padding: 16px 14px 16px 0;
}

.teacher-class-facts div + div {
  padding-left: 14px;
  border-left: 1px solid var(--line);
}

.teacher-class-facts dt,
.teacher-class-facts dd,
.admin-glance dt,
.admin-glance dd {
  margin: 0;
}

.teacher-class-facts dt,
.admin-glance dt {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.teacher-class-facts dd {
  overflow-wrap: anywhere;
  font-weight: 750;
}

.home-state {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  margin: 0 0 15px;
  padding: 8px 12px;
  border-left: 3px solid var(--gold-500);
  color: var(--amber);
  background: var(--amber-bg);
  font-size: 13px;
  font-weight: 750;
}

.home-state-complete {
  border-left-color: var(--green);
  color: var(--green);
  background: var(--green-bg);
}

.home-state-quiet {
  border-left-color: var(--line-dark);
  color: var(--muted);
  background: var(--plum-50);
}

.teacher-focus-help {
  margin-bottom: 22px;
  color: var(--muted);
  font-size: 14px;
}

.home-primary-action {
  min-height: 50px;
  padding-right: 22px;
  padding-left: 22px;
}

.teacher-workflow .home-kicker {
  margin-bottom: 15px;
}

.home-sequence {
  margin: 0;
  padding: 0;
  list-style: none;
}

.home-sequence li {
  min-height: 82px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--line);
}

.home-sequence li:first-child {
  border-top: 1px solid var(--line);
}

.home-sequence li > span {
  color: var(--gold-600);
  font-family: var(--serif);
  font-size: 17px;
}

.home-sequence li strong,
.home-sequence li small,
.home-attention-row strong,
.home-attention-row small,
.home-queue-row strong,
.home-queue-row small {
  display: block;
}

.home-sequence li strong {
  margin-bottom: 4px;
  color: var(--plum-900);
  font-family: var(--serif);
  font-size: 21px;
}

.home-sequence li small,
.home-attention-row small,
.home-queue-row small {
  color: var(--muted);
  line-height: 1.4;
}

.home-sequence li > a {
  font-size: 13px;
  font-weight: 750;
}

.home-sequence .is-current {
  margin: 0 -14px;
  padding: 0 14px;
  border-left: 3px solid var(--plum-800);
  background: var(--cream);
}

.home-attention {
  padding-top: 28px;
  border-top: 1px solid var(--gold-200);
}

.home-attention-row {
  min-height: 76px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}

.home-attention-row:hover {
  background: var(--cream);
}

.home-attention-row > span:last-child {
  color: var(--plum-800);
  font-size: 13px;
  font-weight: 750;
}

.home-row-index {
  color: var(--gold-600);
  font-family: var(--serif);
  font-size: 18px;
}

.admin-home-layout {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(620px, 1.65fr);
  gap: 54px;
}

.admin-brief {
  padding-right: 44px;
  border-right: 1px solid var(--line);
}

.admin-brief h1 {
  margin-bottom: 22px;
  font-size: clamp(54px, 4.6vw, 64px);
  font-weight: 550;
  line-height: 1.02;
}

.admin-brief > p:not(.home-date):not(.admin-primary-note) {
  max-width: 400px;
  margin-bottom: 25px;
}

.admin-primary-note {
  margin: 13px 0 32px;
  color: var(--muted);
  font-size: 13px;
}

.admin-glance {
  padding-top: 28px;
  border-top: 1px solid var(--gold-200);
}

.admin-glance h2,
.admin-queue-heading h2 {
  margin-bottom: 5px;
  font-size: 27px;
}

.admin-glance dl {
  margin: 18px 0 0;
}

.admin-glance dl div {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.admin-glance dd {
  line-height: 1.45;
}

.admin-queue-heading {
  align-items: flex-end;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--gold-200);
}

.admin-queue-heading p {
  margin-bottom: 0;
  font-size: 13px;
}

.home-queue-row {
  min-height: 104px;
  display: grid;
  grid-template-columns: 52px minmax(190px, 1.3fr) minmax(130px, 0.65fr) minmax(112px, auto);
  align-items: center;
  gap: 18px;
  padding: 15px 8px 15px 0;
  border-bottom: 1px solid var(--line);
  border-left: 3px solid var(--gold-500);
}

.home-queue-urgent {
  border-left-color: var(--red);
}

.home-queue-ready {
  border-left-color: var(--green);
}

.home-queue-priority {
  color: var(--gold-600);
  font-family: var(--serif);
  font-size: 28px;
  text-align: center;
}

.home-queue-urgent .home-queue-priority {
  color: var(--red);
}

.home-queue-issue strong,
.home-queue-context strong {
  margin-bottom: 5px;
}

.home-queue-row > a {
  justify-self: end;
  font-size: 13px;
  font-weight: 750;
  text-align: right;
}

.home-queue-empty {
  margin-top: 30px;
  padding: 42px 28px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.home-queue-empty h3 {
  margin-bottom: 7px;
  font-size: 27px;
}

@media (max-width: 1100px) {
  .teacher-home-layout,
  .admin-home-layout {
    grid-template-columns: 1fr;
  }

  .teacher-focus,
  .admin-brief {
    padding-right: 0;
    padding-bottom: 38px;
    border-right: 0;
    border-bottom: 1px solid var(--gold-200);
  }

  .admin-brief > p:not(.home-date):not(.admin-primary-note) {
    max-width: 650px;
  }
}

@media (max-width: 700px) {
  .home-page {
    padding-top: 34px;
  }

  .home-intro {
    padding-bottom: 28px;
  }

  .home-intro h1,
  .admin-brief h1 {
    font-size: 42px;
  }

  .teacher-home-layout {
    gap: 32px;
    padding: 30px 0 38px;
  }

  .teacher-class-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .teacher-class-heading h2 {
    font-size: 48px;
  }

  .teacher-class-facts {
    grid-template-columns: 1fr;
  }

  .teacher-class-facts div,
  .teacher-class-facts div + div {
    padding: 12px 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .teacher-class-facts div:first-child {
    border-top: 0;
  }

  .home-primary-action {
    width: 100%;
  }

  .home-attention-row {
    grid-template-columns: 36px minmax(0, 1fr);
    padding: 13px 0;
  }

  .home-attention-row > span:last-child {
    grid-column: 2;
  }

  .admin-queue-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .home-queue-row {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 8px 13px;
    padding: 16px 7px 16px 0;
  }

  .home-queue-priority {
    grid-row: 1 / 3;
  }

  .home-queue-context {
    grid-column: 2;
  }

  .home-queue-row > a {
    grid-column: 2;
    justify-self: start;
    text-align: left;
  }
}

.records-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 36px;
}

.record-summary {
  padding-left: 28px;
  border-left: 1px solid var(--gold-200);
}

.record-summary h2 {
  margin-bottom: 4px;
  font-size: 30px;
}

.record-summary dl {
  margin: 24px 0;
}

.record-summary dl div,
.detail-list div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}

.record-summary dt,
.detail-list dt {
  color: var(--muted);
}

.record-summary dd,
.detail-list dd {
  margin: 0;
  font-weight: 700;
  text-align: right;
}

.context-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr)) auto;
  gap: 14px;
  align-items: end;
  margin: -6px 0 28px;
  padding: 18px 20px;
  background: var(--cream);
  border-top: 1px solid var(--gold-200);
  border-bottom: 1px solid var(--gold-200);
}

.split-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.65fr);
  gap: 44px;
}

.split-panel > * {
  min-width: 0;
}

.split-panel > aside {
  padding-left: 34px;
  border-left: 1px solid var(--gold-200);
}

.student-record-page .table-wrap {
  width: 100%;
  max-width: 100%;
}

.student-record-page .detail-list dd,
.student-record-page .detail-list a {
  min-width: 0;
  overflow-wrap: anywhere;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin: 34px 0 15px;
}

.section-heading h2 {
  margin: 0;
  font-size: 30px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.attendance-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 28px;
  margin-top: 34px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line-dark);
}

.attendance-summary h2 {
  margin-bottom: 7px;
  font-size: 31px;
}

.attendance-summary p,
.attendance-toolbar p,
.attendance-save-bar p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.attendance-counts {
  display: grid;
  grid-template-columns: repeat(4, minmax(82px, 1fr));
  gap: 8px;
  margin: 0;
}

.attendance-count {
  min-width: 82px;
  padding: 9px 12px;
  border-left: 4px solid var(--line-dark);
  background: var(--plum-50);
}

.attendance-count dt {
  color: var(--ink);
  font-size: 19px;
  font-weight: 800;
  line-height: 1;
}

.attendance-count dd {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.attendance-count-present {
  border-color: var(--green);
  background: var(--green-bg);
}

.attendance-count-late {
  border-color: var(--amber);
  background: var(--amber-bg);
}

.attendance-count-absent {
  border-color: var(--red);
  background: var(--red-bg);
}

.attendance-toolbar {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}

.attendance-student-list {
  border-bottom: 1px solid var(--line-dark);
}

.attendance-student-row {
  min-height: 82px;
  display: grid;
  grid-template-columns: minmax(230px, 0.9fr) minmax(360px, 1.25fr) minmax(220px, 0.65fr);
  align-items: center;
  gap: 18px;
  padding: 12px 10px;
  border-top: 1px solid var(--line);
}

.attendance-student-row:first-child {
  border-top: 0;
}

.attendance-student-row:hover {
  background: var(--cream);
}

.attendance-student-identity {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 13px;
}

.attendance-student-identity > span:last-child {
  display: grid;
  gap: 4px;
}

.attendance-student-identity strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attendance-student-identity small {
  color: var(--muted);
  font-size: 11px;
}

.attendance-row-number {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--gold-200);
  border-radius: 50%;
  color: var(--gold-600);
  font-family: var(--serif);
  font-size: 13px;
}

.attendance-status-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
  padding: 0;
  border: 0;
}

.attendance-status-choice {
  min-width: 0;
  cursor: pointer;
}

.attendance-status-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.attendance-status-choice span {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7px 10px;
  border: 1px solid var(--line-dark);
  border-radius: 5px;
  color: var(--ink);
  background: #fff;
  font-size: 13px;
  font-weight: 750;
}

.attendance-status-choice input:focus-visible + span {
  outline: 3px solid rgb(210 162 56 / 55%);
  outline-offset: 3px;
}

.attendance-status-present input:checked + span {
  border-color: var(--green);
  color: var(--green);
  background: var(--green-bg);
}

.attendance-status-late input:checked + span {
  border-color: var(--amber);
  color: var(--amber);
  background: var(--amber-bg);
}

.attendance-status-absent input:checked + span {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-bg);
}

.attendance-remark {
  display: grid;
  gap: 5px;
}

.attendance-remark span {
  color: #58515d;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.attendance-remark input {
  width: 100%;
  min-height: 42px;
  padding: 8px 11px;
  border: 1px solid var(--line-dark);
  border-radius: 5px;
  background: #fff;
}

.attendance-remark input:disabled {
  color: var(--muted);
  background: #f4f2f5;
}

.attendance-save-bar {
  position: sticky;
  z-index: 6;
  bottom: 0;
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 0;
  background: rgb(255 255 255 / 97%);
  border-top: 1px solid var(--gold-200);
  box-shadow: 0 -10px 24px rgb(34 21 63 / 5%);
}

.attendance-save-bar p strong {
  color: var(--ink);
}

.attendance-save-bar p span {
  color: var(--muted);
}

.attendance-save-bar > div {
  display: flex;
  gap: 10px;
}

.attendance-save-bar button:disabled {
  border-color: var(--line-dark);
  color: var(--muted);
  background: #ece9ee;
  cursor: not-allowed;
}

.table-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line-dark);
}

.student-check-list {
  border-bottom: 1px solid var(--line-dark);
}

.class-choice-list {
  border-top: 1px solid var(--line-dark);
  border-bottom: 1px solid var(--line-dark);
}

.class-choice {
  min-height: 78px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 12px;
  border-top: 1px solid var(--line);
  cursor: pointer;
}

.class-choice:first-child {
  border-top: 0;
}

.class-choice:hover,
.class-choice:has(input:checked) {
  background: var(--cream);
}

.class-choice input {
  width: 20px;
  height: 20px;
  accent-color: var(--plum-800);
}

.class-choice span {
  display: grid;
  gap: 4px;
}

.class-choice strong {
  color: var(--plum-900);
  font-family: var(--serif);
  font-size: 24px;
}

.class-choice small {
  color: var(--muted);
}

.management-panel {
  margin-bottom: 14px;
  border-top: 1px solid var(--line-dark);
  border-bottom: 1px solid var(--line);
}

.management-panel summary {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 12px;
  cursor: pointer;
}

.management-panel summary > span:first-child {
  display: grid;
  gap: 4px;
}

.management-panel summary small,
.management-meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.management-form {
  padding: 22px 12px;
  border-top: 1px solid var(--line);
}

.inline-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 12px;
  border-top: 1px solid var(--line);
}

.management-list {
  border-top: 1px solid var(--line-dark);
}

.management-row {
  display: grid;
  align-items: end;
  gap: 12px;
  padding: 14px 10px;
  border-bottom: 1px solid var(--line);
}

.management-row-subject {
  grid-template-columns: minmax(220px, 1fr) 110px 150px auto;
}

.management-row-staff {
  grid-template-columns: minmax(180px, 1fr) minmax(150px, 0.8fr) 170px 130px 105px auto;
}

.admin-page {
  max-width: 1260px;
}

.admin-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
  border-top: 1px solid var(--line-dark);
  border-left: 1px solid var(--line);
}

.admin-overview > div {
  min-height: 132px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 20px 24px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.admin-overview span,
.admin-overview small {
  color: var(--muted);
}

.admin-overview span {
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-overview strong {
  color: var(--plum-900);
  font-family: var(--serif);
  font-size: 31px;
  font-weight: 650;
}

.admin-overview small {
  font-size: 12px;
}

.admin-jump-nav {
  position: sticky;
  z-index: 8;
  top: 0;
  display: flex;
  gap: 4px;
  margin-bottom: 42px;
  padding: 9px;
  overflow-x: auto;
  background: rgb(255 250 240 / 97%);
  border-top: 1px solid var(--gold-200);
  border-bottom: 1px solid var(--gold-200);
}

.admin-jump-nav a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  color: var(--plum-900);
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

.admin-jump-nav a:hover {
  background: #fff;
}

.admin-jump-nav a span {
  min-width: 23px;
  min-height: 23px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--plum-700);
  background: var(--plum-100);
  font-size: 10px;
}

.admin-section {
  scroll-margin-top: 72px;
  margin-bottom: 58px;
}

.admin-section-header {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line-dark);
}

.admin-section-header > div:first-child {
  display: flex;
  align-items: center;
  gap: 16px;
}

.admin-section-header h2 {
  margin: 0 0 4px;
  font-size: 31px;
}

.admin-section-header p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.admin-section-number {
  width: 42px;
  height: 42px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--gold-200);
  border-radius: 50%;
  color: var(--gold-600);
  font-family: var(--serif);
  font-size: 14px;
}

.admin-create-panel {
  position: relative;
  flex: 0 0 auto;
}

.admin-create-panel > summary {
  list-style: none;
}

.admin-create-panel > summary::-webkit-details-marker {
  display: none;
}

.admin-create-panel[open] > summary {
  color: var(--plum-900);
  background: #fff;
}

.admin-create-panel > form {
  position: absolute;
  z-index: 20;
  top: calc(100% + 10px);
  right: 0;
  width: min(720px, calc(100vw - 42px));
  padding: 24px;
  background: #fff;
  border: 1px solid var(--line-dark);
  box-shadow: 0 18px 50px rgb(34 21 63 / 16%);
}

.admin-create-panel .note {
  margin-bottom: 20px;
}

.dashboard-access-form {
  max-width: 920px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  padding-top: 18px;
}

.dashboard-access-option {
  min-height: 92px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: start;
  gap: 13px;
  padding: 20px;
  border: 1px solid var(--line);
  cursor: pointer;
}

.dashboard-access-option + .dashboard-access-option {
  border-left: 0;
}

.dashboard-access-option:has(input:checked) {
  border-color: var(--gold-300);
  background: var(--cream);
}

.dashboard-access-option input {
  width: 19px;
  height: 19px;
  margin-top: 2px;
  accent-color: var(--plum-800);
}

.dashboard-access-option strong,
.dashboard-access-option small {
  display: block;
}

.dashboard-access-option strong {
  margin-bottom: 5px;
  color: var(--plum-900);
  font-family: var(--serif);
  font-size: 21px;
}

.dashboard-access-option small {
  color: var(--muted);
  line-height: 1.45;
}

.dashboard-access-form .inline-actions {
  grid-column: 1 / -1;
  margin-top: 16px;
}

/* Leadership dashboard */
.leadership-dashboard {
  padding-top: 28px;
  padding-bottom: 34px;
}

.leadership-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 42px;
  padding-bottom: 20px;
}

.leadership-heading > div > p {
  margin-bottom: 9px;
  color: var(--gold-600);
  font-family: var(--serif);
  font-size: 19px;
}

.leadership-heading h1 {
  margin: 0 0 13px;
  font-size: clamp(50px, 4.6vw, 66px);
  font-weight: 550;
  line-height: 0.98;
}

.leadership-period {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  color: var(--muted);
  font-size: 13px;
}

.leadership-period span {
  padding: 0 15px;
  border-left: 1px solid var(--line-dark);
}

.leadership-period span:first-child {
  padding-left: 0;
  border-left: 0;
}

.leadership-filters {
  min-width: 420px;
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  align-items: end;
  gap: 12px;
}

.leadership-filters .button {
  grid-column: 1 / -1;
  justify-self: end;
  min-height: 38px;
}

.performance-brief {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(330px, 0.85fr);
  border: 1px solid var(--gold-200);
}

.performance-chart-panel,
.leadership-reading {
  min-width: 0;
  padding: 22px 25px;
}

.performance-chart-panel {
  border-right: 1px solid var(--line);
}

.performance-section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.performance-section-heading h2,
.leadership-reading h2 {
  margin: 4px 0 0;
  font-size: 29px;
}

.performance-section-heading > a {
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
}

.performance-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin: 22px 0 8px;
  color: var(--muted);
  font-size: 12px;
}

.performance-legend span::before {
  width: 25px;
  height: 3px;
  display: inline-block;
  margin: 0 8px 3px 0;
  background: currentcolor;
  content: "";
}

.legend-attendance { color: var(--plum-900); }
.legend-targets { color: var(--gold-600); }
.legend-exams { color: var(--green); }

.performance-canvas-wrap {
  height: 195px;
}

.performance-canvas-wrap canvas,
.performance-spark canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.leadership-reading > .home-kicker {
  margin-bottom: 4px;
}

.leadership-insight {
  margin-top: 16px;
  padding: 3px 0 3px 17px;
  border-left: 3px solid var(--plum-700);
}

.leadership-insight.insight-positive { border-left-color: var(--green); }
.leadership-insight.insight-warning { border-left-color: var(--gold-500); }
.leadership-insight.insight-alert { border-left-color: var(--red); }

.leadership-insight strong {
  color: var(--plum-900);
}

.leadership-insight p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.performance-rows {
  margin-top: 28px;
  border-top: 1px solid var(--line-dark);
}

.performance-row {
  min-height: 122px;
  display: grid;
  grid-template-columns: minmax(220px, 1.1fr) minmax(170px, 0.85fr) minmax(180px, 0.85fr) minmax(180px, 0.8fr) 145px;
  align-items: center;
  gap: 22px;
  padding: 8px 14px 8px 18px;
  border-bottom: 1px solid var(--line);
  border-left: 3px solid var(--plum-700);
}

.performance-row-targets { border-left-color: var(--gold-500); }
.performance-row-exams { border-left-color: var(--red); }
.performance-row-assessments {
  border-left-color: var(--green);
  background: linear-gradient(90deg, rgb(230 243 237 / 48%), #fff 42%);
}

.performance-area h2 {
  margin: 4px 0 7px;
  font-size: 22px;
}

.performance-area > p:last-child,
.performance-position span,
.performance-status small,
.performance-spark small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.performance-position {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  gap: 3px 11px;
}

.performance-position strong {
  color: var(--plum-900);
  font-family: var(--serif);
  font-size: 29px;
}

.performance-position .performance-exception,
.performance-position .performance-subject-low {
  margin-top: 8px;
  color: var(--red);
  font-size: 18px;
}

.performance-position .performance-assessment-complete {
  margin-top: 8px;
  color: var(--green);
  font-size: 18px;
}

.performance-spark {
  height: 70px;
  display: grid;
  grid-template-rows: 48px auto;
  gap: 4px;
}

.performance-status {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 7px;
}

.performance-action {
  justify-self: end;
  font-size: 13px;
  font-weight: 750;
  text-align: right;
}

.dashboard-completeness {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 0;
  margin-top: 18px;
  padding: 14px 16px;
  color: var(--muted);
  background: var(--plum-50);
  border: 1px solid var(--line);
  font-size: 11px;
}

.dashboard-completeness strong,
.dashboard-completeness span,
.dashboard-completeness a {
  padding: 0 13px;
  border-left: 1px solid var(--line-dark);
}

.dashboard-completeness strong {
  padding-left: 0;
  color: var(--plum-900);
  border-left: 0;
}

@media (max-width: 1180px) {
  .leadership-heading {
    align-items: stretch;
    flex-direction: column;
    gap: 24px;
  }

  .leadership-filters {
    min-width: 0;
    max-width: 620px;
  }

  .performance-brief {
    grid-template-columns: 1fr;
  }

  .performance-chart-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .performance-row {
    grid-template-columns: minmax(220px, 1.2fr) minmax(180px, 0.8fr) minmax(180px, 0.8fr);
  }

  .performance-status {
    grid-column: 2;
  }

  .performance-action {
    grid-column: 3;
  }
}

@media (max-width: 760px) {
  .dashboard-access-form {
    grid-template-columns: 1fr;
  }

  .dashboard-access-option + .dashboard-access-option {
    border-top: 0;
    border-left: 1px solid var(--line);
  }

  .dashboard-access-form .inline-actions {
    grid-column: auto;
  }

  .leadership-heading h1 {
    font-size: 45px;
  }

  .leadership-period {
    display: grid;
    gap: 4px;
  }

  .leadership-period span,
  .leadership-period span:first-child {
    padding: 0;
    border: 0;
  }

  .performance-section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .performance-chart-panel,
  .leadership-reading {
    padding: 23px 18px;
  }

  .performance-canvas-wrap {
    height: 280px;
    overflow-x: auto;
  }

  .performance-canvas-wrap canvas {
    min-width: 620px;
  }

  .performance-row {
    grid-template-columns: 1fr 1fr;
    gap: 18px;
  }

  .performance-area {
    grid-column: 1 / -1;
  }

  .performance-status,
  .performance-action {
    grid-column: auto;
  }
}

@media (max-width: 520px) {
  .leadership-filters,
  .performance-row {
    grid-template-columns: 1fr;
  }

  .leadership-filters .button,
  .performance-area,
  .performance-status,
  .performance-action {
    grid-column: auto;
  }

  .leadership-filters .button,
  .performance-action {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .performance-position {
    max-width: 300px;
  }
}

.admin-year-panel {
  margin: 16px 0 0;
}

.admin-class-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-left: 1px solid var(--line);
}

.admin-class-list > div {
  min-height: 96px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-content: center;
  align-items: center;
  gap: 3px;
  padding: 15px 18px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.admin-class-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.admin-class-list strong {
  color: var(--plum-900);
  font-family: var(--serif);
  font-size: 22px;
}

.admin-class-list span {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-class-list small {
  color: var(--muted);
  font-size: 10px;
}

.class-student-count {
  min-width: 50px;
  display: block;
  padding-left: 14px;
  overflow: visible;
  border-left: 1px solid var(--gold-200);
  text-align: right;
  white-space: normal;
}

.class-student-count strong {
  display: block;
  font-size: 24px;
  line-height: 1;
}

.class-student-count small {
  display: block;
  margin-top: 4px;
  font-size: 9px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.class-student-count.is-empty strong {
  color: var(--muted);
}

.admin-subject-list,
.admin-record-list {
  margin-top: 16px;
}

.admin-subject-list,
.admin-record-list {
  border-top: 1px solid var(--line-dark);
}

.admin-record {
  border-bottom: 1px solid var(--line);
}

.admin-record > summary {
  position: relative;
  min-height: 72px;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 150px 90px 120px;
  align-items: center;
  gap: 18px;
  padding: 10px 76px 10px 12px;
  cursor: pointer;
  list-style: none;
}

.admin-record > summary::after {
  position: absolute;
  top: 50%;
  right: 14px;
  color: var(--plum-700);
  font-size: 11px;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
  transform: translateY(-50%);
  content: "Edit";
}

.admin-record[open] > summary::after {
  content: "Close";
}

.admin-record > summary::-webkit-details-marker {
  display: none;
}

.admin-record > summary:hover,
.admin-record[open] > summary {
  background: var(--cream);
}

.admin-record-person {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-record-person > span:last-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.admin-record-person strong,
.admin-record-person small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-record-person small,
.admin-record-role {
  color: var(--muted);
  font-size: 12px;
}

.admin-subject-record > summary {
  grid-template-columns: minmax(220px, 1fr) 140px 90px;
}

.admin-subject-name {
  color: var(--plum-900);
}

.admin-subject-order {
  color: var(--muted);
  font-size: 12px;
}

.admin-subject-form {
  padding: 20px 24px;
  background: var(--plum-50);
}

.admin-staff-record > summary {
  grid-template-columns: minmax(235px, 1fr) minmax(130px, 0.65fr) 145px 88px 112px;
}

.staff-assigned-classes {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.staff-class-code {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  color: var(--plum-900);
  background: #fff;
  border: 1px solid var(--gold-200);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.staff-no-class {
  color: var(--muted);
  font-size: 11px;
}

.admin-avatar {
  flex: 0 0 38px;
  color: var(--gold-600);
  background: var(--cream);
}

.admin-staff-form {
  padding: 22px 62px;
  background: var(--plum-50);
}

.admin-assignment-form {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(210px, 0.7fr) auto;
  align-items: end;
  gap: 14px;
  margin: 16px 0 24px;
  padding: 20px;
  background: var(--cream);
  border: 1px solid var(--gold-200);
}

.admin-assignment-table {
  margin-top: 18px;
}

.student-check-row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  cursor: pointer;
}

.student-check-row:hover {
  background: var(--cream);
}

.student-check-row input {
  width: 19px;
  height: 19px;
  accent-color: var(--plum-800);
}

.student-check-row span {
  display: grid;
  gap: 3px;
}

.student-check-row small,
.muted {
  color: var(--muted);
}

.note {
  padding: 16px 18px;
  color: var(--plum-800);
  background: var(--plum-50);
  border-left: 3px solid var(--plum-700);
  line-height: 1.5;
}

.report-document {
  max-width: 920px;
  margin: 0 auto;
}

.report-document-header {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  align-items: center;
  gap: 14px;
  padding-bottom: 18px;
  border-bottom: 2px solid var(--gold-500);
}

.report-document-header img {
  width: 58px;
  height: 58px;
  object-fit: contain;
}

.report-document-header div {
  display: grid;
  gap: 3px;
}

.report-document-header div strong {
  color: var(--plum-900);
  font-family: var(--serif);
  font-size: 22px;
}

.report-document-header span,
.report-document-header p,
.report-student-summary p {
  margin: 0;
  color: var(--muted);
}

.report-student-summary {
  display: grid;
  grid-template-columns: 1fr minmax(260px, 0.6fr);
  gap: 30px;
  padding: 28px 0 18px;
}

.report-student-summary h1 {
  margin-bottom: 5px;
  font-size: 36px;
}

.report-student-summary dl {
  margin: 0;
}

.report-student-summary dl div {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}

.report-student-summary dt {
  color: var(--muted);
}

.report-student-summary dd {
  margin: 0;
  font-weight: 750;
}

.report-section {
  padding: 23px 0 25px;
  border-top: 1px solid var(--line);
}

.report-section h2 {
  margin-bottom: 14px;
  font-size: 28px;
}

.report-section table {
  width: 100%;
  border-collapse: collapse;
}

.report-section th,
.report-section td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.report-section th {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.site-footer {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 max(32px, calc((100% - 1380px) / 2));
  color: var(--muted);
  background: var(--cream);
  border-top: 1px solid var(--gold-200);
  font-size: 12px;
}

/* Sign in */
.login-body {
  background: #fff;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(420px, 0.9fr) minmax(520px, 1.1fr);
}

.login-brand-panel {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 42px clamp(42px, 6vw, 88px);
  color: #fff;
  background: var(--plum-950);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 17px;
  color: #fff;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 650;
  line-height: 1.08;
  text-decoration: none;
}

.login-brand img {
  width: 84px;
  height: 84px;
}

.login-statement {
  max-width: 520px;
  margin: auto 0;
  padding: 60px 0;
}

.login-statement h1 {
  margin-bottom: 24px;
  color: #fff;
  font-size: clamp(45px, 5vw, 68px);
  font-weight: 600;
  line-height: 0.99;
}

.login-statement p {
  max-width: 480px;
  margin-bottom: 0;
  color: rgb(255 255 255 / 70%);
  font-size: 17px;
  line-height: 1.65;
}

.login-year {
  display: flex;
  justify-content: space-between;
  padding-top: 20px;
  border-top: 1px solid rgb(237 213 154 / 40%);
}

.login-year span {
  color: rgb(255 255 255 / 65%);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-year strong {
  color: var(--gold-300);
  font-family: var(--serif);
  font-size: 22px;
}

.login-form-panel {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 50px;
}

.login-box {
  width: min(100%, 430px);
}

.login-box h2 {
  margin-bottom: 10px;
  font-size: 46px;
  font-weight: 600;
}

.login-box > p {
  margin-bottom: 26px;
  padding-bottom: 24px;
  color: var(--muted);
  border-bottom: 1px solid var(--gold-200);
}

.login-form {
  display: grid;
  gap: 21px;
}

.password-wrap {
  position: relative;
}

.password-wrap input {
  padding-right: 72px;
}

.password-wrap button {
  position: absolute;
  top: 50%;
  right: 12px;
  border: 0;
  color: var(--plum-700);
  background: #fff;
  font-size: 13px;
  font-weight: 750;
  text-decoration: underline;
  transform: translateY(-50%);
  cursor: pointer;
}

.login-help {
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

@media (max-width: 1180px) {
  .app-header {
    grid-template-columns: 225px minmax(0, 1fr) auto;
    gap: 10px;
    padding: 0 18px;
  }

  .main-navigation a {
    padding: 0 8px;
    font-size: 13px;
  }

  .nav-dropdown summary {
    padding: 0 8px;
    font-size: 13px;
  }

  .staff-menu {
    min-width: 180px;
  }

  .staff-menu > a,
  .staff-actions .change-class-action {
    display: none;
  }

  .staff-actions {
    display: flex;
    justify-content: flex-end;
  }

  .staff-actions .sign-out-action {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    padding: 0 10px;
    border: 1px solid rgb(255 255 255 / 28%);
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
  }
}

@media (max-width: 940px) {
  .app-header {
    position: relative;
    grid-template-columns: 1fr auto auto;
    min-height: 76px;
  }

  .main-navigation {
    position: absolute;
    z-index: 30;
    top: 76px;
    right: 0;
    left: 0;
    display: none;
    grid-template-columns: repeat(2, 1fr);
    padding: 12px 18px 20px;
    background: var(--plum-950);
  }

  .main-navigation.open {
    display: grid;
  }

  .main-navigation a {
    min-height: 44px;
  }

  .nav-dropdown {
    display: block;
  }

  .nav-dropdown summary {
    min-height: 44px;
  }

  .nav-dropdown-menu {
    position: static;
    min-width: 0;
    padding: 0 0 7px 12px;
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  .main-navigation .nav-dropdown-menu a {
    min-height: 40px;
    padding: 7px 12px;
    border-left: 1px solid rgb(237 213 154 / 35%);
  }

  .mobile-menu {
    min-height: 42px;
    display: block;
    align-self: center;
    padding: 0 13px;
    border: 1px solid rgb(255 255 255 / 35%);
    color: #fff;
    background: transparent;
  }

  .staff-menu {
    min-width: auto;
    grid-template-columns: 38px auto;
    padding-left: 13px;
  }

  .staff-menu > span:nth-child(2) {
    display: none;
  }

  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-brand-panel {
    min-height: auto;
    padding: 28px 34px 30px;
  }

  .login-statement {
    margin: 50px 0 40px;
    padding: 0;
  }

  .login-form-panel {
    min-height: auto;
    padding: 58px 34px 70px;
  }

  .filters,
  .context-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .management-row-subject,
  .management-row-staff {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .records-layout,
  .split-panel {
    grid-template-columns: 1fr;
  }

  .record-summary,
  .split-panel > aside {
    padding: 28px 0 0;
    border-top: 1px solid var(--gold-200);
    border-left: 0;
  }

  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-overview,
  .admin-class-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-record > summary {
    grid-template-columns: minmax(220px, 1fr) 130px 90px;
  }

  .admin-staff-record > summary {
    grid-template-columns: minmax(220px, 1fr) minmax(120px, 0.65fr) 130px 84px;
  }

  .admin-record > summary .management-meta {
    display: none;
  }

  .admin-assignment-form {
    grid-template-columns: 1fr 1fr;
  }

  .admin-assignment-form .button {
    grid-column: 1 / -1;
  }

  .attendance-summary {
    grid-template-columns: 1fr;
  }

  .attendance-counts {
    width: 100%;
  }

  .attendance-student-row {
    grid-template-columns: minmax(210px, 0.7fr) minmax(340px, 1fr);
  }

  .attendance-remark {
    grid-column: 1 / -1;
    grid-template-columns: 210px minmax(0, 1fr);
    align-items: center;
  }
}

/* Compact navigation: keep every destination visible without crowding the brand or Sign out. */
@media (min-width: 700px) and (max-width: 1180px) {
  .app-header {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: 76px 50px;
    gap: 0;
    min-height: 126px;
    padding: 0 18px;
  }

  .app-brand {
    grid-column: 1;
    grid-row: 1;
  }

  .mobile-menu {
    display: none;
  }

  .staff-menu {
    grid-column: 2;
    grid-row: 1;
  }

  .main-navigation,
  .main-navigation.open {
    position: static;
    grid-column: 1 / -1;
    grid-row: 2;
    display: flex;
    align-items: stretch;
    justify-content: center;
    min-width: 0;
    padding: 0;
    background: var(--plum-950);
    border-top: 1px solid rgb(255 255 255 / 12%);
  }

  .main-navigation > a,
  .nav-dropdown summary {
    min-height: 50px;
    padding: 0 9px;
    font-size: 12px;
  }

  .nav-dropdown {
    position: relative;
    display: flex;
    align-items: stretch;
  }

  .nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 180px;
    padding: 7px;
    background: var(--plum-950);
    border: 1px solid rgb(237 213 154 / 35%);
    box-shadow: 0 14px 30px rgb(18 10 34 / 30%);
  }

  .main-navigation .nav-dropdown-menu a {
    min-height: 42px;
    padding: 9px 12px;
    border-left: 0;
    font-size: 13px;
  }
}

@media (max-width: 650px) {
  .app-header {
    padding: 0 13px;
  }

  .app-brand {
    font-size: 15px;
  }

  .app-brand img {
    width: 52px;
    height: 52px;
  }

  .staff-menu {
    grid-template-columns: auto;
    gap: 0;
    padding-left: 8px;
  }

  .staff-avatar {
    display: none;
  }

  .staff-actions .sign-out-action {
    padding: 0 8px;
    font-size: 11px;
  }

  .page {
    width: min(100% - 34px, 1380px);
    padding: 34px 0 58px;
  }

  .page-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .page-heading h1 {
    font-size: 40px;
  }

  .page-actions .button {
    flex: 1;
  }

  .report-document-header,
  .report-student-summary {
    grid-template-columns: 1fr;
  }

  .report-document-header img {
    display: none;
  }

  .filters,
  .context-bar,
  .form-grid,
  .management-row-subject,
  .management-row-staff {
    grid-template-columns: 1fr;
  }

  .form-grid .full {
    grid-column: auto;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .login-brand-panel {
    padding: 22px;
  }

  .login-brand img {
    width: 60px;
    height: 60px;
  }

  .login-statement {
    margin: 38px 0 32px;
  }

  .login-statement h1 {
    font-size: 40px;
  }

  .login-statement p {
    font-size: 15px;
  }

  .login-form-panel {
    padding: 42px 22px 58px;
  }

  .login-box h2 {
    font-size: 40px;
  }

  .site-footer {
    padding: 0 17px;
  }

  .flash {
    width: min(100% - 34px, 1380px);
  }

  .admin-overview,
  .admin-class-list {
    grid-template-columns: 1fr 1fr;
  }

  .admin-class-list {
    grid-template-columns: 1fr;
  }

  .admin-overview > div {
    min-height: 108px;
    padding: 16px;
  }

  .admin-overview strong {
    font-size: 26px;
  }

  .admin-jump-nav {
    margin-right: -17px;
    margin-left: -17px;
  }

  .admin-section-header {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-create-panel {
    width: 100%;
  }

  .admin-create-panel > summary {
    width: 100%;
  }

  .admin-create-panel > form {
    position: static;
    width: 100%;
    margin-top: 10px;
    padding: 18px;
    box-shadow: none;
  }

  .admin-record > summary {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
  }

  .admin-subject-record > summary {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .admin-subject-order {
    display: none;
  }

  .admin-subject-form {
    padding: 18px 12px;
  }

  .admin-staff-record > summary {
    gap: 8px 12px;
  }

  .admin-staff-record .staff-assigned-classes {
    grid-column: 1 / -1;
    padding-left: 50px;
  }

  .admin-staff-record > summary > .status {
    display: none;
  }

  .admin-record-role {
    display: none;
  }

  .admin-staff-form {
    padding: 18px 12px;
  }

  .admin-assignment-form {
    grid-template-columns: 1fr;
  }

  .admin-assignment-form .button {
    grid-column: auto;
  }

  .attendance-counts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .attendance-toolbar,
  .attendance-save-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .attendance-toolbar {
    padding: 16px 0;
  }

  .attendance-student-row {
    grid-template-columns: 1fr;
    gap: 13px;
    padding: 17px 2px;
  }

  .attendance-remark {
    grid-column: auto;
    grid-template-columns: 1fr;
  }

  .attendance-save-bar {
    position: static;
    padding: 13px 0;
    box-shadow: none;
  }

  .attendance-save-bar > div {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

/* Administrator class registers */
.class-register-layout { display:grid; grid-template-columns:260px minmax(0,1fr); gap:32px; align-items:start; }
.class-register-controls { display:grid; gap:16px; min-width:0; }
.class-register-controls h2 { margin:0; }
.class-register-controls fieldset { margin:0; padding:0 0 16px; border:0; border-bottom:1px solid var(--line); }
.class-register-controls legend { font-weight:700; margin-bottom:10px; }
.class-register-controls fieldset label { display:flex; align-items:center; gap:9px; padding:6px 0; }
.class-register-controls input[type=radio], .class-register-controls input[type=checkbox] { width:17px; height:17px; accent-color:var(--plum-900); }
.class-register-controls p { margin:0; color:var(--muted); font-size:13px; line-height:1.5; }
.class-register-controls .button { width:100%; }
.class-register-controls [hidden] { display:none; }
.class-register-checklist { max-height:240px; overflow:auto; }
.class-register-previews { display:grid; gap:28px; min-width:0; }
.class-register-paper { padding:32px; border:1px solid var(--line-dark); background:#fff; min-width:0; max-width:800px; width:100%; box-shadow:0 2px 5px #22153f0d; }
.class-register-brand { display:flex; gap:16px; align-items:center; border-bottom:1px solid var(--line-dark); padding-bottom:20px; }
.class-register-brand img { object-fit:contain; flex-shrink:0; }
.class-register-brand strong { font:700 clamp(16px,1.7vw,24px) var(--serif); color:var(--plum-900); }
.class-register-brand h2 { font:700 clamp(22px,2.3vw,32px) var(--serif); margin:4px 0 0; }
.class-register-meta { display:grid; gap:18px; margin:24px 0 30px; }
.class-register-meta > div { display:grid; grid-template-columns:110px minmax(0,1fr); gap:14px; }
.class-register-meta dt { font-weight:700; }
.class-register-meta dd { margin:0; overflow-wrap:anywhere; }
.class-register-location { border-bottom:1px solid var(--ink); min-height:22px; }
.class-register-table-scroll { overflow-x:auto; }
.class-register-table { width:100%; min-width:480px; table-layout:fixed; border-collapse:collapse; font-size:12px; }
.class-register-table .register-number-col { width:15%; }
.class-register-table .register-student-col { width:25%; }
.class-register-table .register-mobile-col { width:18%; }
.class-register-table .register-blank-col { width:14%; }
.class-register-table th, .class-register-table td { border:1px solid #777; padding:10px 6px; height:42px; text-align:left; overflow-wrap:anywhere; vertical-align:middle; }
.class-register-table th { font-weight:700; }
.class-register-footer { display:flex; justify-content:space-between; gap:12px; margin-top:26px; color:var(--muted); font-size:12px; }
@media (max-width:1000px) {
  .class-register-layout { grid-template-columns:210px minmax(0,1fr); gap:20px; }
  .class-register-paper { padding:20px; }
}
@media (max-width:760px) {
  .class-register-layout { grid-template-columns:1fr; }
  .class-register-controls { border-bottom:1px solid var(--line); padding-bottom:24px; }
  .class-register-brand img { width:44px; height:44px; }
  .class-register-paper { padding:16px; }
}
