:root {
  --ink: #18212b;
  --muted: #647180;
  --line: #d9e0e8;
  --paper: #ffffff;
  --soft: #f5f7fa;
  --soft-strong: #e9eef4;
  --brand: #1d6f5f;
  --brand-dark: #145348;
  --brand-soft: #e4f3ef;
  --accent: #bb7d1b;
  --danger: #a33535;
  --danger-soft: #fff1f1;
  --shadow: 0 12px 30px rgba(24, 33, 43, 0.08);
  --font-body: "Inter", Arial, Helvetica, sans-serif;
  --font-heading: "Plus Jakarta Sans", "Inter", Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: linear-gradient(180deg, #edf6f3 0, var(--soft) 300px), var(--soft);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.45;
}

body.menu-open {
  overflow: hidden;
}

body.modal-open {
  overflow: hidden;
}

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

button {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  cursor: pointer;
  font-weight: 700;
  min-height: 40px;
  padding: 0.58rem 0.82rem;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

button:hover {
  border-color: var(--brand);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(24, 33, 43, 0.08);
}

button:active {
  transform: translateY(0);
  box-shadow: none;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

button:focus-visible,
input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(29, 111, 95, 0.16);
  outline: none;
}

.primary-btn {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.primary-btn:hover {
  background: var(--brand-dark);
  color: #fff;
}

.danger-btn {
  color: var(--danger);
}

.danger-btn:hover {
  background: var(--danger-soft);
  border-color: #ddb2b2;
}

.ghost-btn {
  background: transparent;
}

.tab-btn,
.mobile-tab-btn,
.subnav-btn,
.list-item,
.summary-card,
.class-summary-card,
.report-card,
.class-toggle-btn,
.marks-edit-row,
.mobile-menu button {
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

@media (hover: hover) and (pointer: fine) {
  .tab-btn:hover,
  .mobile-tab-btn:hover,
  .subnav-btn:hover,
  .class-toggle-btn:hover,
  .mobile-menu button:hover {
    border-color: var(--brand);
    box-shadow: 0 8px 18px rgba(24, 33, 43, 0.08);
    transform: translateY(-1px);
  }

  .subnav-btn:hover {
    background: #f6fbf9;
  }

  .list-item:hover,
  .summary-card:hover,
  .class-summary-card:hover,
  .report-card:hover,
  .marks-edit-row:hover {
    border-color: #c7d4de;
    box-shadow: 0 10px 24px rgba(24, 33, 43, 0.1);
    transform: translateY(-1px);
  }

  .class-summary-card:hover {
    background: linear-gradient(180deg, #f7fffc 0%, #ffffff 100%);
  }

  .report-card:hover {
    box-shadow: 0 14px 34px rgba(24, 33, 43, 0.12);
  }
}

.tab-btn:focus-visible,
.mobile-tab-btn:focus-visible,
.subnav-btn:focus-visible,
.class-toggle-btn:focus-visible,
.mobile-menu button:focus-visible {
  box-shadow: 0 0 0 3px rgba(29, 111, 95, 0.16), 0 8px 18px rgba(24, 33, 43, 0.08);
}

.list-item {
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.list-item:hover,
.list-item:focus-within {
  background: #f8fcfb;
  border-color: #c7d4de;
  box-shadow: 0 10px 24px rgba(24, 33, 43, 0.1);
  transform: translateY(-1px);
}

.summary-card:hover,
.summary-card:focus-within {
  border-color: #c7d4de;
  box-shadow: 0 10px 24px rgba(24, 33, 43, 0.1);
  transform: translateY(-1px);
}

.class-summary-card:focus-visible,
.report-card:focus-within {
  box-shadow: 0 14px 34px rgba(24, 33, 43, 0.12);
}

.marks-edit-row:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(29, 111, 95, 0.08);
}

.hidden,
.file-input {
  display: none !important;
}

[hidden] {
  display: none !important;
}

.mobile-menu-btn,
.mobile-menu {
  display: none;
}

.modal-overlay {
  align-items: center;
  display: grid;
  inset: 0;
  justify-items: center;
  padding: 1rem;
  position: fixed;
  z-index: 30;
}

.modal-backdrop {
  background: rgba(12, 20, 28, 0.58);
  inset: 0;
  position: absolute;
}

.modal-dialog {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 22px 64px rgba(24, 33, 43, 0.24);
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 2rem);
  overflow: hidden;
  position: relative;
  width: min(92vw, 820px);
}

.modal-header {
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: 1rem 1rem 0.85rem;
}

.modal-header h2 {
  margin-bottom: 0;
}

.modal-body {
  overflow: auto;
  padding: 1rem;
  -webkit-overflow-scrolling: touch;
}

.modal-body .inline-form {
  margin-bottom: 0;
}

.modal-body .compact-form {
  grid-template-columns: minmax(0, 1fr);
}

.modal-body .learner-form-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.modal-body .subject-class-assignment {
  grid-column: 1 / -1;
}

.modal-body .button-row {
  justify-content: flex-start;
}

.icon-btn svg {
  display: block;
  height: 18px;
  width: 18px;
}

.mobile-menu-btn {
  position: relative;
}

.mobile-menu-btn .menu-icon,
.mobile-menu-btn .close-icon {
  left: 50%;
  position: absolute;
  top: 50%;
  transform-origin: center;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.mobile-menu-btn .menu-icon {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1) rotate(0deg);
}

.mobile-menu-btn .close-icon {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.75) rotate(-90deg);
}

.mobile-menu-btn.active .menu-icon {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.75) rotate(90deg);
}

.mobile-menu-btn.active .close-icon {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1) rotate(0deg);
}

.app-header {
  align-items: center;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: 1.15rem clamp(1rem, 3vw, 2rem);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand-block {
  min-width: 0;
}

.eyebrow {
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin: 0 0 0.15rem;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  font-family: var(--font-heading);
}

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

h1 {
  font-size: clamp(1.8rem, 4vw, 2.45rem);
  margin-bottom: 0;
}

h2 {
  font-size: 1.18rem;
  margin-bottom: 0.25rem;
}

.header-copy,
.section-title p,
.preview-heading p {
  color: var(--muted);
  margin-bottom: 0;
}

.header-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: flex-end;
}

.save-status {
  background: var(--brand-soft);
  border: 1px solid #badbd3;
  border-radius: 999px;
  color: var(--brand-dark);
  font-size: 0.82rem;
  font-weight: 800;
  padding: 0.45rem 0.7rem;
  white-space: nowrap;
}

main {
  display: grid;
  gap: 1rem;
  padding: 1rem clamp(1rem, 3vw, 2rem) 2rem;
}

.role-chooser {
  align-items: center;
  display: grid;
  min-height: 100vh;
  padding: 1rem;
}

.landing-shell {
  display: grid;
  gap: 1.25rem;
  margin: 0 auto;
  max-width: 1180px;
  width: 100%;
}

.landing-hero {
  align-items: center;
  background: linear-gradient(135deg, #ffffff 0%, #edf8f4 100%);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 1.5rem;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  padding: clamp(1.3rem, 4vw, 2.8rem);
}

.landing-lead {
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  line-height: 1.6;
  margin: 0.7rem 0 0;
  max-width: 42rem;
}

.landing-benefits {
  display: grid;
  gap: 0.65rem;
}

.landing-benefits span {
  align-items: center;
  display: flex;
  font-weight: 700;
  gap: 0.6rem;
}

.landing-benefits span::before {
  background: var(--brand);
  border-radius: 50%;
  color: white;
  content: "✓";
  display: inline-grid;
  flex: 0 0 1.4rem;
  font-size: 0.78rem;
  height: 1.4rem;
  place-items: center;
}

.landing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
}

.landing-role-heading {
  text-align: center;
}

.role-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.role-option-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
}

.role-option-card p {
  color: var(--muted);
  flex: 1;
  line-height: 1.55;
}

.role-icon {
  color: var(--brand);
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.teacher-profile-chooser {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.25rem;
}

.teacher-profile-actions,
.teacher-assignment-list,
.class-management-grid,
.setup-action-grid {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.teacher-profile-actions button {
  display: grid;
  gap: 0.2rem;
  text-align: left;
}

.teacher-profile-actions span,
.demo-note,
.helper-text {
  color: var(--muted);
  font-size: 0.88rem;
}

.demo-note {
  margin: 0;
  text-align: center;
}

.teacher-assignment-card {
  background: #f8fbfa;
  border: 1px solid var(--line);
  border-radius: 9px;
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
}

.teacher-assignment-list {
  grid-template-columns: 1fr;
}

.teacher-assignment-heading,
.teacher-class-assignments {
  display: grid;
  gap: 0.75rem;
}

.teacher-assignment-heading {
  grid-template-columns: minmax(220px, 0.7fr) minmax(260px, 1.3fr);
}

.teacher-assignment-heading .helper-text {
  align-self: end;
  padding-bottom: 0.75rem;
}

.teacher-class-assignment {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  display: grid;
  gap: 0.75rem;
  padding: 0.9rem;
}

.teacher-class-assignment-header,
.teacher-assignment-actions {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
}

.teacher-class-assignment-header label {
  flex: 1 1 280px;
}

.teacher-subject-picker {
  display: grid;
  gap: 0.7rem;
}

.teacher-subject-picker.disabled {
  background: #f6f8fa;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 0.8rem;
}

.teacher-subject-picker.disabled p {
  margin: 0;
}

.teacher-subject-picker fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0;
  min-width: 0;
  padding: 0.75rem;
}

.teacher-subject-picker legend {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  padding: 0 0.35rem;
}

.teacher-subject-options {
  display: grid;
  gap: 0.45rem;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  max-height: 220px;
  overflow-y: auto;
}

.teacher-subject-option {
  align-items: center;
  background: #f8fbfa;
  border: 1px solid var(--line);
  border-radius: 7px;
  cursor: pointer;
  display: flex;
  gap: 0.55rem;
  padding: 0.6rem;
}

.teacher-subject-option:has(input:checked) {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand-dark);
}

.teacher-subject-option input {
  flex: 0 0 auto;
  width: auto;
}

.teacher-selected-subjects {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.teacher-selected-subjects span {
  background: var(--brand-soft);
  border: 1px solid #b9e2d0;
  border-radius: 999px;
  color: var(--brand-dark);
  font-size: 0.8rem;
  font-weight: 800;
  padding: 0.3rem 0.6rem;
}

.teacher-selected-subjects small,
.teacher-assignment-validation {
  color: var(--muted);
  font-size: 0.84rem;
}

.teacher-assignment-validation:not(:empty) {
  background: var(--danger-soft);
  border: 1px solid #e5b7b7;
  border-radius: 7px;
  color: var(--danger);
  font-weight: 800;
  padding: 0.65rem;
}

.setup-action-card {
  background: #f8fbfa;
  border: 1px solid var(--line);
  color: var(--brand-dark);
  font-weight: 800;
  min-height: 72px;
  text-align: left;
}

.overview-section-heading,
.teacher-quick-actions {
  grid-column: 1 / -1;
}

.overview-section-heading p {
  color: var(--muted);
  margin: 0;
}

.grading-scale-editor input {
  min-width: 90px;
}

.attendance-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.attendance-count {
  align-items: center;
  background: #f6f8fa;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: 0.84rem;
  gap: 0.3rem;
  justify-content: center;
  min-height: 36px;
  padding: 0.38rem 0.7rem;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.attendance-count:hover {
  border-color: currentColor;
  transform: translateY(-1px);
}

.attendance-count:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.28);
  outline-offset: 2px;
}

.attendance-count.active {
  border-color: currentColor;
  box-shadow: 0 0 0 2px currentColor inset, 0 3px 10px rgba(20, 46, 40, 0.12);
  font-weight: 800;
}

.attendance-count-check {
  display: inline-block;
  font-size: 0.78rem;
  min-width: 0.7rem;
  text-align: center;
}

.attendance-count.all { background: #eef2f7; color: #314155; }
.attendance-count.present { background: #ecf8f3; color: var(--brand-dark); }
.attendance-count.absent { background: #fff0f0; color: var(--danger); }
.attendance-count.late { background: #fff8e6; color: #8a4b00; }
.attendance-count.not-set { background: #f6f8fa; color: #596579; }
.attendance-status-badge.late { background: #fff8e6; border-color: #ead6a2; color: #8a4b00; }

.report-conversion {
  align-items: center;
  background: #f8fbfa;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 0.8rem;
  justify-content: space-between;
  margin-top: 1rem;
  padding: 0.75rem;
}

.report-conversion span { color: var(--muted); font-size: 0.88rem; }

.tour-overlay {
  inset: 0;
  position: fixed;
  z-index: 150;
}

.tour-backdrop {
  background: rgba(13, 35, 31, 0.62);
  inset: 0;
  position: absolute;
}

.tour-card {
  background: var(--paper);
  border-radius: 12px;
  bottom: clamp(1rem, 4vw, 2rem);
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  left: 50%;
  max-width: 520px;
  padding: 1.3rem;
  position: absolute;
  transform: translateX(-50%);
  width: min(calc(100% - 2rem), 520px);
}

.tour-card > p:not(.eyebrow) { color: var(--muted); line-height: 1.55; }
.tour-actions { display: flex; flex-wrap: wrap; gap: 0.55rem; justify-content: flex-end; }

.app-toast {
  background: #173b34;
  border-radius: 9px;
  bottom: 1rem;
  box-shadow: var(--shadow);
  color: #fff;
  left: 50%;
  max-width: min(520px, calc(100% - 2rem));
  padding: 0.8rem 1rem;
  position: fixed;
  transform: translateX(-50%);
  z-index: 200;
}

.role-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin: 0 auto;
  max-width: 760px;
  padding: 1.4rem;
  width: 100%;
}

.role-card h1 {
  margin-bottom: 0.35rem;
}

.role-card p:not(.eyebrow) {
  color: var(--muted);
}

.role-actions {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 1rem;
}

.role-actions button {
  min-height: 52px;
  padding: 0.8rem 0.9rem;
  text-align: left;
}

.switch-role-btn {
  white-space: nowrap;
}

.tabs {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 0.35rem;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  padding: 0.35rem;
  position: sticky;
  top: 90px;
  z-index: 9;
}

.tab-btn {
  border: 0;
  color: #40505e;
  font-family: var(--font-heading);
  min-height: 38px;
  padding: 0.45rem 0.5rem;
}

.tab-btn.active {
  background: var(--brand);
  color: #fff;
}

.mobile-tab-btn.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.route-subnav {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 1rem;
}

.subnav-btn {
  align-items: start;
  background: #fbfcfd;
  display: grid;
  gap: 0.2rem;
  min-height: 86px;
  padding: 0.85rem;
  text-align: left;
}

.subnav-btn strong {
  font-family: var(--font-heading);
}

.subnav-btn span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.35;
}

.subnav-btn.active {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand-dark);
}

.tab-panel {
  display: none;
  gap: 1rem;
}

.tab-panel.active {
  display: grid;
}

.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  min-width: 0;
  padding: 1.05rem;
}

.section-title {
  margin-bottom: 1rem;
}

.form-grid {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-field {
  align-items: start;
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}

.form-field > span,
.marks-edit-subject {
  color: #344252;
  font-size: 0.88rem;
  font-weight: 700;
}

.field-span-2 {
  grid-column: 1 / -1;
}

.subject-class-assignment {
  background: #fbfcfd;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 0.75rem;
  grid-column: 1 / -1;
  padding: 0.85rem;
}

.subject-class-assignment legend {
  color: #344252;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 0 0.25rem;
}

.subject-assignment-heading {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
  margin-top: -0.15rem;
}

.checkbox-grid {
  display: grid;
  gap: 0.45rem;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.checkbox-grid label {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: flex;
  flex-direction: row;
  gap: 0.5rem;
  padding: 0.55rem 0.65rem;
}

.checkbox-grid input[type="checkbox"] {
  accent-color: var(--brand);
  flex: 0 0 auto;
  height: 18px;
  min-height: auto;
  padding: 0;
  width: 18px;
}

.checkbox-grid span {
  overflow-wrap: anywhere;
}

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

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

label {
  color: #344252;
  display: grid;
  font-size: 0.88rem;
  font-weight: 700;
  gap: 0.35rem;
}

input,
select,
textarea {
  background: #fff;
  border: 1px solid #cbd4df;
  border-radius: 6px;
  color: var(--ink);
  min-height: 40px;
  padding: 0.62rem 0.7rem;
  width: 100%;
}

input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

textarea {
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #8794a3;
}

.inline-form {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: 2fr 1fr 1fr 1fr auto auto;
  margin-bottom: 1rem;
}

.compact-form {
  grid-template-columns: minmax(220px, 360px) auto auto;
  justify-content: start;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: flex-end;
}

.button-row.left {
  justify-content: flex-start;
}

.search-bar {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-bottom: 0.8rem;
}

.search-summary {
  margin-bottom: 0.8rem;
}

.search-summary-card {
  background: #f7fbf9;
  border: 1px solid #cfe3dc;
  border-radius: 8px;
  display: grid;
  gap: 0.15rem;
  padding: 0.7rem 0.8rem;
}

.search-summary-card span {
  color: var(--brand);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.search-summary-card strong {
  font-size: 0.96rem;
  overflow-wrap: anywhere;
}

.search-results-meta {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  margin-bottom: 0.55rem;
}

.learner-card-btn {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.learner-search-item {
  min-height: 110px;
}

.learner-search-item span:last-child {
  color: var(--muted);
  font-size: 0.86rem;
}

.learner-detail-card {
  display: grid;
  gap: 1rem;
}

.learner-class-switch {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.learner-class-switch span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.class-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.class-toggle-btn {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  min-height: 36px;
  padding: 0.4rem 0.75rem;
}

.class-toggle-btn.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.marks-class-switch {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.attendance-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-end;
}

.attendance-status-text {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 0.7rem;
}

.attendance-search {
  margin-top: 0.85rem;
}

.attendance-search .search-bar {
  margin-bottom: 0.4rem;
}

.attendance-reason {
  color: var(--muted);
  display: block;
  font-size: 0.78rem;
  margin-top: 0.35rem;
  max-width: 28rem;
  overflow-wrap: anywhere;
}

.attendance-empty-state {
  margin-bottom: 0.85rem;
}

.marks-class-switch span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.detail-panels {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.overview-detail-column {
  display: grid;
  gap: 0.6rem;
  min-width: 0;
}

.overview-scroll-table {
  height: 24rem;
  overflow: auto;
}

.overview-scroll-table table {
  margin-bottom: 0;
}

.assessment-wrap input {
  min-width: 74px;
  text-align: center;
}

.assessment-setup-card {
  background: #f8fbfa;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: grid;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 1rem;
}

.assessment-weight-grid {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.assessment-weight-notice {
  border-radius: 0.9rem;
  font-size: 0.9rem;
  font-weight: 800;
  padding: 0.7rem 0.85rem;
}

.assessment-weight-notice.ok {
  background: #e8f8ef;
  color: #166534;
}

.assessment-weight-notice.warn {
  background: #fff4df;
  color: #8a4b00;
}

.assessment-setup-list {
  display: grid;
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.assessment-entry-toolbar {
  align-items: end;
  display: grid;
  gap: 0.85rem;
  grid-template-columns: minmax(180px, 0.35fr) minmax(220px, 1fr);
  margin-bottom: 0.9rem;
}

.assessment-category-card {
  align-items: start;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: grid;
  gap: 0.8rem;
  grid-template-columns: minmax(160px, 0.5fr) 1fr;
  padding: 1rem;
}

.assessment-category-card span {
  color: var(--muted);
  display: block;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.assessment-category-card strong {
  display: block;
  margin-top: 0.2rem;
}

.assessment-item-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.assessment-item-list span {
  background: #eef6f3;
  border-radius: 999px;
  color: var(--ink);
  display: inline-flex;
  gap: 0.45rem;
  align-items: center;
  padding: 0.45rem 0.65rem;
  text-transform: none;
}

.assessment-item-list span.is-inactive {
  background: #f6f8fa;
  color: var(--muted);
  text-decoration: line-through;
}

.text-danger-btn {
  background: transparent;
  border: 0;
  color: var(--danger);
  font-size: 0.78rem;
  min-height: 0;
  padding: 0.1rem 0.2rem;
}

.assessment-item-list small,
.assessment-item-list em,
.status-muted {
  color: var(--muted);
  font-style: normal;
}

.assessment-learner-list {
  display: grid;
  gap: 0.7rem;
  margin-top: 0.9rem;
}

.assessment-learner-card {
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: grid;
  gap: 0.8rem;
  grid-template-columns: minmax(180px, 1fr) auto auto;
  padding: 0.85rem;
}

.assessment-learner-card.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.assessment-learner-card div {
  display: grid;
  gap: 0.1rem;
}

.assessment-learner-card span {
  color: var(--muted);
  font-size: 0.88rem;
}

.assessment-marks-form {
  display: grid;
  gap: 1rem;
}

.assessment-dialog-list {
  display: grid;
  gap: 0.9rem;
}

.assessment-subject-edit {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: grid;
  gap: 0.75rem;
  padding: 0.85rem;
}

.assessment-subject-heading {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.75rem;
  justify-content: space-between;
}

.assessment-subject-heading span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.assessment-dialog-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.assessment-dialog-grid input {
  text-align: center;
}

.assessment-learner-switcher {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: grid;
  gap: 0.75rem;
  padding: 0.95rem;
}

.assessment-learner-switcher-head {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.8rem;
  justify-content: space-between;
}

.assessment-learner-switcher-head span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.assessment-learner-switcher-head strong {
  font-size: 0.95rem;
}

.assessment-learner-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.assessment-learner-pill {
  background: #f6f8fa;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--ink);
  font-size: 0.86rem;
  padding: 0.45rem 0.75rem;
}

.assessment-learner-pill.active {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand-dark);
}

.computed-mark-pill {
  border-radius: 999px;
  display: inline-block;
  font-size: 0.88rem;
  font-weight: 800;
  min-width: 6.8rem;
  padding: 0.45rem 0.7rem;
  text-align: center;
}

.computed-mark-pill.complete {
  background: #e8f8ef;
  color: #166534;
}

.computed-mark-pill.pending {
  background: #f6f8fa;
  color: var(--muted);
}

.marks-display-input {
  background: #f6f8fa;
  color: var(--ink);
  cursor: default;
  opacity: 1;
  padding-left: 0.45rem;
  padding-right: 0.45rem;
  text-align: center;
  width: 74px;
}

.marks-display-input:disabled {
  color: var(--ink);
  opacity: 1;
}

.marks-edit-form {
  display: grid;
  gap: 1rem;
}

.marks-edit-context {
  display: grid;
  gap: 0.15rem;
}

.marks-edit-context strong {
  font-size: 1.02rem;
}

.marks-edit-context span {
  color: var(--muted);
  font-size: 0.9rem;
}

.marks-edit-list {
  display: grid;
  gap: 0.7rem;
}

.marks-edit-row {
  align-items: center;
  background: #fbfcfd;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: minmax(0, 1fr) auto 110px;
  padding: 0.7rem 0.75rem;
}

.marks-edit-row .marks-edit-subject {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.marks-edit-max {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

.marks-edit-input {
  justify-self: end;
  max-width: 110px;
  text-align: center;
  width: 100%;
}

.marks-edit-actions {
  margin-top: 0.15rem;
}

.empty-state-inline {
  color: var(--muted);
  font-size: 0.88rem;
}

.panel-heading,
.preview-heading {
  align-items: flex-start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.watermark-control {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-top: 1rem;
  padding-top: 1rem;
}

.watermark-control h3 {
  font-size: 1rem;
  margin-bottom: 0.2rem;
}

.watermark-control p,
.watermark-preview {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 0;
}

.watermark-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.watermark-preview {
  align-items: center;
  background: #fbfcfd;
  border: 1px dashed #b6c2cf;
  border-radius: 6px;
  display: flex;
  gap: 0.75rem;
  margin-top: 0.75rem;
  min-height: 52px;
  padding: 0.65rem;
}

.watermark-preview img {
  border: 1px solid var(--line);
  border-radius: 4px;
  height: 38px;
  object-fit: contain;
  width: 38px;
}

.date-control {
  min-width: 220px;
}

.table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

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

th,
td {
  border: 1px solid var(--line);
  padding: 0.55rem;
  text-align: left;
  vertical-align: middle;
}

th {
  background: var(--soft-strong);
  color: #243640;
  font-size: 0.82rem;
  font-weight: 800;
  position: sticky;
  top: 0;
  z-index: 1;
}

.entry-table {
  min-width: max-content;
}

.entry-table th:first-child,
.entry-table td:first-child,
.sticky-name {
  background: #fff;
  left: 0;
  position: sticky;
  z-index: 2;
}

.entry-table th:first-child {
  background: var(--soft-strong);
  z-index: 3;
}

.entry-table tbody tr:nth-child(even) td {
  background: #fbfcfd;
}

.entry-table tbody tr:nth-child(even) td:first-child {
  background: #fbfcfd;
}

.entry-table input {
  min-width: 76px;
  padding: 0.45rem;
}

.sticky-name strong,
.sticky-name span {
  display: block;
}

.sticky-name span {
  color: var(--muted);
  font-size: 0.78rem;
}

.calculated {
  color: #243640;
  font-weight: 700;
  white-space: nowrap;
}

.empty-row td {
  background: #fff;
  color: var(--muted);
  padding: 1rem;
  text-align: center;
}

.action-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.segmented-control {
  display: inline-grid;
  gap: 0.35rem;
  grid-template-columns: repeat(2, minmax(100px, 1fr));
}

.segmented-control label {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: flex;
  gap: 0.4rem;
  justify-content: center;
  min-height: 38px;
  padding: 0.35rem 0.55rem;
}

.segmented-control input {
  min-height: auto;
  width: auto;
}

.attendance-wizard {
  display: grid;
  gap: 1rem;
}

.attendance-session-tools {
  display: grid;
  gap: 0.7rem;
}

.attendance-session-counts {
  align-items: center;
}

.attendance-session-search {
  margin: 0;
}

.attendance-filter-empty {
  align-items: center;
  background: #f8fafc;
  border: 1px dashed var(--line);
  border-radius: 10px;
  color: var(--muted);
  display: grid;
  gap: 0.3rem;
  min-height: 150px;
  padding: 1.25rem;
  text-align: center;
}

.attendance-filter-empty strong {
  color: var(--ink);
}

.attendance-wizard-progress {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: space-between;
}

.attendance-wizard-progress span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

.attendance-wizard-card {
  background: linear-gradient(180deg, #fbfcfd 0%, #f3f8f6 100%);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  gap: 0.65rem;
  padding: 1.1rem;
  text-align: center;
}

.attendance-wizard-label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  margin: 0;
  text-transform: uppercase;
}

.attendance-wizard-card h3 {
  font-size: clamp(1.4rem, 4vw, 2rem);
  margin: 0;
}

.attendance-wizard-card p:last-child {
  color: var(--muted);
  margin: 0;
}

.attendance-choice-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 0.35rem;
}

.attendance-choice-btn {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 800;
  min-height: 72px;
}

.attendance-choice-btn.present {
  border-color: #b9e2d0;
  color: var(--brand-dark);
}

.attendance-choice-btn.absent {
  border-color: #e5b7b7;
  color: var(--danger);
}

.attendance-choice-grid.three-statuses {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.attendance-choice-btn.late {
  border-color: #ead6a2;
  color: #8a4b00;
}

.attendance-choice-btn.active,
.attendance-choice-btn:hover,
.attendance-choice-btn:focus-visible {
  border-color: var(--brand);
}

.attendance-choice-btn.present.active {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.attendance-choice-btn.absent.active {
  background: var(--danger-soft);
  border-color: #d78f8f;
  color: var(--danger);
}

.attendance-choice-btn.late.active {
  background: #fff8e6;
  border-color: #d9b85f;
  color: #8a4b00;
}

.attendance-choice-btn.late:hover,
.attendance-choice-btn.late:focus-visible {
  background: #fffaf0;
}

.attendance-late-reason {
  display: grid;
  font-weight: 800;
  gap: 0.4rem;
  margin-top: 0.75rem;
  text-align: left;
}

.attendance-late-reason span {
  color: var(--ink);
  font-size: 0.9rem;
}

.attendance-confirm-late {
  margin-top: 0.75rem;
  width: 100%;
}

.attendance-choice-btn.present:hover,
.attendance-choice-btn.present:focus-visible {
  background: #f0fbf6;
}

.attendance-choice-btn.absent:hover,
.attendance-choice-btn.absent:focus-visible {
  background: #fff4f4;
}

.attendance-status-badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.82rem;
  font-weight: 800;
  min-width: 84px;
  padding: 0.34rem 0.7rem;
  justify-content: center;
}

.attendance-status-badge.present {
  background: #ecf8f3;
  border-color: #b9e2d0;
  color: var(--brand-dark);
}

.attendance-status-badge.absent {
  background: #fff0f0;
  border-color: #e5b7b7;
  color: var(--danger);
}

.attendance-status-badge.not-set {
  background: #f7f8fb;
  color: var(--muted);
}

.attendance-current-status {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.attendance-wizard-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
}

.list-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.list-item {
  background: #fbfcfd;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 0.35rem;
  padding: 0.75rem;
}

.list-item span {
  color: var(--muted);
  font-size: 0.86rem;
}

.item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.25rem;
}

.summary-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.overview-profile {
  margin-bottom: 1rem;
}

.overview-hero {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfa 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 1fr);
  padding: 1rem;
}

.overview-hero > div:first-child > span {
  color: var(--brand);
  display: block;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
}

.overview-hero h3 {
  font-size: clamp(1.35rem, 3vw, 1.8rem);
  margin-bottom: 0.25rem;
}

.overview-hero p {
  color: var(--muted);
  margin-bottom: 0;
}

.overview-meta {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.overview-meta div {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.65rem;
}

.overview-meta span {
  color: var(--muted);
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.overview-meta strong {
  display: block;
  margin-top: 0.15rem;
  overflow-wrap: anywhere;
}

.summary-card {
  background: linear-gradient(180deg, #fff 0%, #fbfcfd 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.78rem;
}

.summary-card span {
  color: var(--muted);
  display: block;
  font-size: 0.78rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
}

.summary-card strong {
  display: block;
  font-size: 1.05rem;
  overflow-wrap: anywhere;
}

.class-summary-grid {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 1rem 0;
}

.class-summary-card {
  align-content: start;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  gap: 0.28rem;
  min-height: 150px;
  padding: 0.9rem;
  text-align: left;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.class-summary-card:hover,
.class-summary-card:focus-visible,
.class-summary-card.active {
  border-color: var(--brand);
  box-shadow: 0 10px 24px rgba(13, 96, 74, 0.12);
  outline: none;
  transform: translateY(-1px);
}

.class-summary-card.active {
  background: linear-gradient(180deg, #f4fffb 0%, #ffffff 100%);
}

.class-summary-card span {
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.class-summary-card strong {
  font-size: 1.6rem;
  line-height: 1.05;
}

.class-summary-card small {
  color: var(--muted);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.class-detail-summary {
  margin-bottom: 1rem;
}

.class-detail-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 1rem;
  padding: 1rem;
}

.class-detail-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.class-detail-grid h3,
.support-panel h3 {
  font-size: 0.98rem;
  margin-bottom: 0.55rem;
}

.support-panel {
  background: #fff9eb;
  border: 1px solid #f0d79c;
  border-radius: 8px;
  padding: 0.85rem;
}

.support-panel p {
  color: var(--muted);
  margin: 0;
}

.support-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.support-list span {
  background: #fff;
  border: 1px solid #f0d79c;
  border-radius: 999px;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 700;
  padding: 0.35rem 0.6rem;
}

.support-table-wrap {
  background: #fff;
  margin-top: 0.75rem;
}

.support-table th {
  white-space: nowrap;
}

.support-table td:nth-child(3),
.support-table td:nth-child(5),
.support-table td:nth-child(6) {
  font-weight: 800;
}

.grade-pill {
  font-weight: 900;
}

.grade-a,
.grade-b {
  color: #16623f;
}

.grade-c,
.grade-d {
  color: #795609;
}

.grade-e,
.grade-f {
  color: #8f2828;
}

.report-list {
  display: grid;
  gap: 1rem;
}

.empty-state {
  background: var(--paper);
  border: 1px dashed #aab6c4;
  border-radius: 8px;
  color: var(--muted);
  padding: 2rem;
  text-align: center;
}

.report-card {
  background: var(--paper);
  border: 1px solid #aeb9c6;
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin: 0 auto;
  max-width: 850px;
  min-height: 980px;
  overflow: hidden;
  padding: 2rem;
  position: relative;
  width: 100%;
}

.report-card::before {
  color: rgba(24, 33, 43, 0.05);
  content: attr(data-watermark);
  font-size: clamp(3.2rem, 10vw, 6.4rem);
  font-weight: 900;
  left: 50%;
  letter-spacing: 0.08em;
  line-height: 1;
  max-width: 90%;
  pointer-events: none;
  position: absolute;
  text-align: center;
  text-transform: uppercase;
  top: 52%;
  transform: translate(-50%, -50%) rotate(-28deg);
  z-index: 0;
}

.report-card.has-image-watermark::before {
  display: none;
}

.report-card > * {
  position: relative;
  z-index: 1;
}

.report-mark {
  display: block;
  height: 82px;
  margin: 0 auto 0.45rem;
  object-fit: contain;
  width: 82px;
}

.report-background-mark {
  height: 430px;
  left: 50%;
  max-width: 72%;
  object-fit: contain;
  opacity: 0.12;
  pointer-events: none;
  position: absolute;
  top: 52%;
  transform: translate(-50%, -50%);
  width: 430px;
  z-index: 0;
}

.report-top {
  border: 2px solid var(--ink);
  border-left: 0;
  border-right: 0;
  margin-bottom: 1rem;
  padding: 0.85rem 0;
  text-align: center;
}

.report-top h2 {
  font-family: var(--font-heading);
  font-size: 1.7rem;
  margin-bottom: 0.2rem;
  text-transform: uppercase;
}

.report-top p {
  color: #33404c;
  font-weight: 700;
  margin-bottom: 0.15rem;
}

.report-top .motto {
  color: var(--brand-dark);
  font-style: italic;
}

.pupil-strip,
.totals-grid,
.comment-grid,
.date-row,
.signature-row {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 1rem;
}

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

.comment-grid,
.date-row,
.signature-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-box {
  background: #fbfcfd;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.65rem;
}

.detail-box span {
  color: var(--muted);
  display: block;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.detail-box strong {
  display: block;
  margin-top: 0.15rem;
}

.report-table {
  margin-bottom: 1rem;
  table-layout: fixed;
  width: 100%;
}

.report-table th,
.report-table td {
  font-size: 0.82rem;
  overflow-wrap: anywhere;
  padding: 0.5rem 0.48rem;
}

.report-table td:nth-child(2),
.report-table td:nth-child(3),
.report-table td:nth-child(4),
.report-table td:nth-child(5),
.report-table td:nth-child(6),
.report-table td:nth-child(7),
.report-table th:nth-child(2),
.report-table th:nth-child(3),
.report-table th:nth-child(4),
.report-table th:nth-child(5),
.report-table th:nth-child(6),
.report-table th:nth-child(7) {
  text-align: center;
}

.placeholder-cell {
  color: #8b97a5;
}

.stamp-box {
  align-items: center;
  border: 1px dashed #8a98a9;
  border-radius: 8px;
  color: var(--muted);
  display: flex;
  font-weight: 800;
  justify-content: center;
  margin-left: auto;
  min-height: 86px;
  text-transform: uppercase;
  width: min(220px, 100%);
}

.print-comments {
  display: grid;
  gap: 0.7rem;
}

.comment-box {
  background: #fff9eb;
  border-left: 4px solid var(--accent);
  border-radius: 0 6px 6px 0;
  padding: 0.75rem 0.9rem;
}

.signature-line {
  border-bottom: 1px solid var(--ink);
  height: 2.2rem;
  margin-bottom: 0.3rem;
}

@media (max-width: 1100px) {
  .tabs {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    top: 116px;
  }

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

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

  .role-grid,
  .teacher-profile-actions,
  .teacher-assignment-list,
  .class-management-grid,
  .setup-action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .teacher-assignment-heading {
    grid-template-columns: 1fr;
  }

  .teacher-assignment-heading .helper-text {
    padding-bottom: 0;
  }

  .teacher-class-assignment-header,
  .teacher-assignment-actions {
    align-items: stretch;
    display: grid;
  }

  .teacher-subject-options {
    grid-template-columns: 1fr;
  }

  body {
    font-size: 15px;
  }

  .app-header {
    align-items: start;
    display: grid;
    gap: 0.75rem;
    grid-template-columns: minmax(0, 1fr);
    padding: 0.8rem 0.85rem;
    position: sticky;
    top: 0;
    overflow: visible;
    z-index: 20;
  }

  .brand-block {
    display: grid;
    gap: 0.18rem;
  }

  .header-actions {
    align-items: center;
    display: grid;
    gap: 0.45rem;
    grid-template-columns: 1fr auto auto;
    justify-content: stretch;
    padding-top: 0.05rem;
  }

  .desktop-action {
    display: none;
  }

  .switch-role-btn {
    font-size: 0.76rem;
    min-height: 36px;
    padding: 0.35rem 0.5rem;
  }

  .eyebrow {
    display: block;
    font-size: 0.62rem;
    letter-spacing: 0.075em;
    line-height: 1.15;
    margin: 0;
  }

  .header-copy {
    display: block;
    font-size: 0.8rem;
    line-height: 1.3;
    margin-top: 0.08rem;
    max-width: 24rem;
  }

  .save-status {
    font-size: 0.72rem;
    padding: 0.32rem 0.5rem;
    text-align: center;
  }

  h1 {
    font-size: 1.38rem;
    line-height: 1.08;
    margin: 0;
    overflow-wrap: normal;
    word-break: keep-all;
  }

  .mobile-menu-btn {
    align-items: center;
    display: inline-flex;
    font-size: 1.35rem;
    height: 40px;
    justify-content: center;
    line-height: 1;
    min-height: 40px;
    padding: 0;
    width: 40px;
  }

  .mobile-menu-btn.active {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
  }

  .mobile-menu {
    background: var(--paper);
    border: 1px solid var(--line);
    border-top: 1px solid var(--line);
    border-radius: 0 0 8px 8px;
    box-shadow: var(--shadow);
    display: grid;
    gap: 0.85rem;
    grid-template-rows: auto;
    left: -0.85rem;
    max-height: calc(100dvh - 88px);
    overflow: auto;
    padding: 0.7rem 0.95rem 0.85rem 1.05rem;
    position: absolute;
    right: -0.85rem;
    top: calc(100% - 1px);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px) scaleY(0.985);
    transform-origin: top;
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0s linear 0.22s;
    visibility: hidden;
    z-index: 100;
  }

  .mobile-menu.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scaleY(1);
    transition: opacity 0.22s ease, transform 0.22s ease;
    visibility: visible;
  }

  .mobile-menu[hidden] {
    display: none !important;
  }

  .mobile-menu-section {
    display: grid;
    gap: 0.3rem;
    min-width: 0;
  }

  .mobile-menu-section:first-of-type {
    align-content: start;
  }

  .mobile-menu-section span {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
  }

  .mobile-menu button {
    min-height: 38px;
    padding: 0.42rem 0.65rem 0.42rem 0.85rem;
    justify-content: flex-start;
    text-align: left;
    width: 100%;
  }

  main {
    padding: 0.85rem;
  }

  .tabs {
    display: none;
  }

  .panel-heading,
  .preview-heading {
    display: grid;
  }

  .watermark-control {
    align-items: flex-start;
    display: grid;
  }

  .watermark-actions {
    justify-content: flex-start;
  }

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

  .marks-class-switch {
    align-items: flex-start;
    flex-direction: column;
  }

  .attendance-actions,
  .attendance-wizard-progress,
  .attendance-wizard-actions {
    align-items: stretch;
    display: grid;
    justify-content: stretch;
  }

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

  .attendance-choice-grid.three-statuses {
    grid-template-columns: 1fr;
  }

  .form-grid,
  .inline-form,
  .learner-form-grid,
  .compact-form,
  .compact-settings-grid,
  .role-actions,
  .overview-hero,
  .overview-meta,
  .list-grid,
  .summary-grid,
  .class-summary-grid,
  .class-detail-grid,
  .detail-panels,
  .assessment-entry-toolbar,
  .assessment-learner-card,
  .assessment-weight-grid,
  .assessment-category-card,
  .pupil-strip,
  .totals-grid,
  .comment-grid,
  .date-row,
  .signature-row {
    grid-template-columns: 1fr;
  }

  .landing-hero,
  .role-grid,
  .teacher-profile-actions,
  .teacher-assignment-list,
  .class-management-grid,
  .setup-action-grid {
    grid-template-columns: 1fr;
  }

  .role-chooser { align-items: start; padding: 0.7rem; }
  .landing-hero { padding: 1.15rem; }
  .landing-actions,
  .report-conversion,
  .tour-actions { align-items: stretch; display: grid; }

  .table-wrap {
    border-left: 0;
    border-radius: 0;
    border-right: 0;
  }

  .table-wrap::after {
    color: var(--muted);
    content: "Swipe sideways to see more columns";
    display: block;
    font-size: 0.78rem;
    padding: 0.45rem 0.85rem;
  }

  .segmented-control {
    grid-template-columns: 1fr;
    min-width: 150px;
  }

  .overview-scroll-table {
    height: 18rem;
  }

  button {
    width: 100%;
  }

  .mobile-menu-btn,
  .mobile-menu-close {
    width: 40px;
  }

  .modal-dialog {
    max-height: calc(100dvh - 1rem);
    width: min(96vw, 820px);
  }

  .marks-edit-row {
    grid-template-columns: 1fr;
  }

  .marks-edit-input {
    justify-self: stretch;
    max-width: none;
  }

  .form-grid,
  .learner-form-grid,
  .subject-form-grid {
    grid-template-columns: 1fr;
  }

  .field-span-2 {
    grid-column: auto;
  }

  .report-card {
    border-radius: 7px;
    min-height: auto;
    padding: 0.9rem;
  }

  .report-top h2 {
    font-size: 1.16rem;
  }
}

@media (max-width: 360px) {
  .header-copy {
    display: none;
  }

  .eyebrow {
    max-width: 12rem;
  }

  h1 {
    font-size: 1.28rem;
  }

  .switch-role-btn {
    font-size: 0.72rem;
  }
}

@media print {
  @page {
    margin: 8mm;
    size: A4 portrait;
  }

  body {
    background: #fff;
    font-size: 10.5px;
    overflow: visible;
    padding-bottom: 0;
  }

  .no-print {
    display: none !important;
  }

  .mobile-menu,
  .mobile-menu-btn {
    display: none !important;
  }

  main,
  .tab-panel,
  #reports {
    display: block !important;
    padding: 0;
  }

  .tab-panel:not(#reports) {
    display: none !important;
  }

  .report-list {
    display: block;
  }

  .report-card {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    break-after: page;
    break-inside: avoid;
    margin: 0;
    max-width: none;
    min-height: auto;
    page-break-after: always;
    page-break-inside: avoid;
    padding: 0;
  }

  .report-card:last-child {
    break-after: auto;
    page-break-after: auto;
  }

  .report-card::before {
    color: rgba(0, 0, 0, 0.045);
    font-size: 5.1rem;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .report-mark {
    height: 46px;
    margin-bottom: 0.2rem;
    width: 46px;
  }

  .report-background-mark {
    height: 320px;
    opacity: 0.08;
    width: 320px;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .report-top {
    margin-bottom: 0.35rem;
    padding: 0.35rem 0;
  }

  .report-top h2 {
    font-size: 1.05rem;
    margin-bottom: 0.08rem;
  }

  .report-top p {
    font-size: 0.68rem;
    margin-bottom: 0.03rem;
  }

  .pupil-strip,
  .totals-grid,
  .comment-grid,
  .date-row,
  .signature-row {
    gap: 0.35rem;
    margin-bottom: 0.35rem;
  }

  .detail-box {
    padding: 0.32rem 0.4rem;
  }

  .detail-box span {
    font-size: 0.58rem;
  }

  .detail-box strong {
    font-size: 0.7rem;
    margin-top: 0.04rem;
  }

  .report-table {
    margin-bottom: 0.35rem;
  }

  .report-table th,
  .report-table td {
    font-size: 0.58rem;
    line-height: 1.12;
    padding: 0.18rem 0.2rem;
  }

  .grade-pill {
    font-size: 0.58rem;
    min-width: 1.35rem;
    padding: 0.08rem 0.16rem;
  }

  .print-comments {
    gap: 0.3rem;
  }

  .comment-box {
    font-size: 0.66rem;
    line-height: 1.22;
    padding: 0.32rem 0.45rem;
  }

  .signature-line {
    height: 1.2rem;
    margin-bottom: 0.1rem;
  }

  .stamp-box {
    border-radius: 6px;
    font-size: 0.62rem;
    min-height: 44px;
    width: min(160px, 100%);
  }

  th {
    background: #eeeeee !important;
    color: #000;
    position: static;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .report-top,
  .pupil-strip,
  .report-table,
  .totals-grid,
  .print-comments,
  .date-row,
  .signature-row,
  .stamp-box {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .detail-box,
  .comment-box {
    background: #fff !important;
  }

  .report-top .motto,
  .detail-box span,
  .report-top p,
  .comment-box,
  .stamp-box {
    color: #000 !important;
  }
}
