/* ============================================================
   Exam system — visual language borrowed from the answer sheet:
   cool paper stock, pine-green marking, graphite rules, and a
   bubble grid that fills in as the paper is worked through.
   ============================================================ */

:root {
  --ink:        #131b26;
  --ink-soft:   #33414f;
  --graphite:   #5d6b7a;
  --paper:      #e9edf1;
  --card:       #ffffff;
  --rule:       #cfd8e0;
  --rule-soft:  #e4eaee;
  --pine:       #1f5f4f;
  --pine-deep:  #164539;
  --pine-wash:  #e3efeb;
  --flag:       #a83a24;
  --flag-wash:  #f8e9e5;
  --amber:      #8a6212;
  --amber-wash: #fbf1dc;

  --display: 'Archivo', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --body:    'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono:    'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --radius:   6px;
  --radius-lg: 10px;
  --shadow:   0 1px 2px rgba(19, 27, 38, .06), 0 6px 20px rgba(19, 27, 38, .06);
  --shadow-lift: 0 2px 4px rgba(19, 27, 38, .08), 0 14px 36px rgba(19, 27, 38, .12);

  /* BBINS blue — same hex as the student verification page (.portal-*),
     so both sides of the app read as one brand. Kept separate from --pine
     (which stays green, reserved for OPEN/Active-style status only). */
  --blue:       #1766c2;
  --blue-deep:  #0e56a8;
  --blue-wash:  #eaf2fc;
  --blue-line:  #bcd8f2;
  --blue-ring:  rgba(23, 102, 194, .16);
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.15;
  margin: 0;
}

h1 { font-size: 1.9rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; letter-spacing: -.01em; }

p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

a { color: var(--pine); }

.eyebrow {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--graphite);
}

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--graphite); }
.hidden { display: none !important; }

:focus-visible {
  outline: 2px solid var(--pine);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ---------------------------------------------------------------- controls */

.btn {
  font-family: var(--body);
  font-size: .93rem;
  font-weight: 600;
  padding: .6rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid var(--pine);
  background: var(--pine);
  color: #fff;
  cursor: pointer;
  transition: background .14s ease, border-color .14s ease, transform .06s ease;
}
.btn:hover { background: var(--pine-deep); border-color: var(--pine-deep); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }

.btn-quiet {
  background: transparent;
  color: var(--ink-soft);
  border-color: var(--rule);
}
.btn-quiet:hover { background: #f2f5f7; color: var(--ink); border-color: var(--graphite); }

.btn-danger { background: var(--flag); border-color: var(--flag); }
.btn-danger:hover { background: #8c2f1d; border-color: #8c2f1d; }

.btn-small { padding: .35rem .7rem; font-size: .82rem; }
.btn-link {
  background: none; border: none; padding: 0;
  color: var(--pine); font: inherit; font-size: .85rem;
  cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
}
.btn-link.danger { color: var(--flag); }

label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .35rem; }

input[type=text], input[type=password], input[type=number], input[type=email], input[type=tel], input[type=date], textarea, select {
  width: 100%;
  font-family: var(--body);
  font-size: .95rem;
  color: var(--ink);
  padding: .58rem .7rem;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  transition: border-color .14s ease, box-shadow .14s ease;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--pine);
  box-shadow: 0 0 0 3px var(--pine-wash);
}
textarea { resize: vertical; min-height: 120px; font-family: var(--mono); font-size: .85rem; line-height: 1.6; }

.field { margin-bottom: 1rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.check {
  display: flex; align-items: flex-start; gap: .6rem;
  font-size: .9rem; font-weight: 500; margin-bottom: .7rem; cursor: pointer;
}
.check input { width: auto; margin: .25rem 0 0; accent-color: var(--pine); flex: none; }
.check span small { display: block; color: var(--graphite); font-weight: 400; font-size: .82rem; }

.card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

.notice {
  padding: .7rem .9rem;
  border-radius: var(--radius);
  font-size: .88rem;
  margin-bottom: 1rem;
  border: 1px solid;
  white-space: pre-line;
}
.notice-error { background: var(--flag-wash); border-color: #e8c4bb; color: #7d2a19; }
.notice-info  { background: var(--pine-wash); border-color: #bcd8ce; color: var(--pine-deep); }
.notice-warn  { background: var(--amber-wash); border-color: #e8d5a8; color: var(--amber); }

.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;
}

.pill {
  display: inline-block;
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: .2rem .5rem;
  border-radius: 3px;
  border: 1px solid;
}
.pill-live  { background: var(--pine-wash); border-color: #bcd8ce; color: var(--pine-deep); }
.pill-draft { background: #eef1f4; border-color: var(--rule); color: var(--graphite); }
.pill-info { background: #eef4ff; border-color: #cbdcf9; color: #075ee8; }
.pill-warn  { background: var(--amber-wash); border-color: #e8d5a8; color: var(--amber); }

/* ================================================== STUDENT PORTAL — mobile auth */

.student-portal-body {
  background: #eef6ff;
}

.student-auth-shell {
  position: relative;
  min-height: 100vh;
  width: min(100%, 470px);
  margin: 0 auto;
  padding: 1.05rem 1.05rem 1.4rem;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 50% 8%, rgba(255, 255, 255, .96), rgba(255, 255, 255, .72) 32%, rgba(235, 245, 255, .94) 74%),
    linear-gradient(180deg, #f9fcff 0%, #eef6ff 100%);
}

.student-auth-watermark {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: url('/logo.png') center 43% / min(88vw, 430px) no-repeat;
  opacity: .045;
}

.student-language-switch {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .45rem;
  min-height: 32px;
  color: var(--blue-deep);
  font-size: .78rem;
  font-weight: 700;
}

.student-language-switch svg,
.student-auth-shell svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.student-language-switch b {
  width: 1px;
  height: 13px;
  background: #c7d8ee;
}

.student-auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: .45rem 0 1.15rem;
}

.student-auth-brand img {
  width: 78px;
  height: 78px;
  object-fit: contain;
  border-radius: 50%;
  filter: drop-shadow(0 8px 20px rgba(12, 86, 168, .12));
}

.student-auth-brand h1,
.student-auth-card h2 {
  letter-spacing: 0;
  color: #0b1d44;
}

.student-auth-brand h1 {
  margin-top: .55rem;
  font-size: 2.35rem;
  line-height: 1;
}

.student-auth-brand p {
  margin: .3rem 0 0;
  color: #435a77;
  font-size: .92rem;
  line-height: 1.35;
}

.student-auth-brand i {
  width: 54px;
  height: 3px;
  margin: .78rem 0 .72rem;
  border-radius: 999px;
  background: #d8aa43;
}

.student-auth-brand span {
  color: var(--blue-deep);
  font-family: var(--mono);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.student-auth-card,
.student-security-card,
.student-feature-card {
  position: relative;
  background: rgba(255, 255, 255, .96);
  border: 1px solid #cfe0f3;
  border-radius: 24px;
  box-shadow: 0 18px 44px rgba(17, 44, 84, .11), 0 2px 8px rgba(17, 44, 84, .06);
}

.student-auth-card {
  padding: 1.35rem;
}

.student-card-icon,
.student-security-card span,
.student-feature-card article > span {
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 50%;
  background: #eaf3ff;
  color: var(--blue);
  border: 1px solid #d7e8fb;
}

.student-card-icon {
  width: 62px;
  height: 62px;
  margin: 0 auto .85rem;
}

.student-card-icon svg {
  width: 28px;
  height: 28px;
}

.student-auth-card h2 {
  text-align: center;
  font-size: 1.72rem;
}

.student-auth-subtitle {
  margin: .35rem 0 1.2rem;
  color: #687b95;
  text-align: center;
  font-size: .94rem;
}

.student-auth-form {
  display: grid;
  gap: .92rem;
}

.student-auth-field {
  display: grid;
  gap: .35rem;
}

.student-auth-field label {
  margin: 0;
  color: #183358;
  font-size: .86rem;
}

.student-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.student-input-wrap > svg {
  position: absolute;
  left: 1rem;
  width: 19px;
  height: 19px;
  color: #6684a8;
  pointer-events: none;
}

.student-input-wrap input,
.student-auth-field > input {
  min-height: 54px;
  padding: .85rem 1rem .85rem 3rem;
  border-radius: 15px;
  border-color: #c8d9ec;
  background: #fbfdff;
  font-size: .96rem;
  box-shadow: 0 1px 0 rgba(17, 44, 84, .02);
}

.student-auth-field > input {
  padding-left: 1rem;
}

.student-input-wrap input:focus,
.student-auth-field > input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px var(--blue-ring);
}

.student-input-wrap input[type=password],
.student-input-wrap input[type=text]#password {
  padding-right: 3rem;
}

.student-eye-toggle {
  position: absolute;
  right: .58rem;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  color: #6684a8;
  background: transparent;
  cursor: pointer;
}

.student-eye-toggle:hover {
  color: var(--blue-deep);
  background: #eaf3ff;
}

.student-forgot {
  justify-self: end;
  margin-top: -.35rem;
  padding: .15rem 0;
  border: 0;
  background: none;
  color: var(--blue-deep);
  font: inherit;
  font-size: .88rem;
  font-weight: 700;
  cursor: pointer;
}

.student-primary-btn,
.student-secondary-btn {
  min-height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  width: 100%;
  border-radius: 16px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform .08s ease, box-shadow .16s ease, background .16s ease;
}

.student-primary-btn {
  border: 1px solid var(--blue-deep);
  color: #fff;
  background: linear-gradient(180deg, #1f73d2 0%, #0955b8 100%);
  box-shadow: 0 12px 22px rgba(14, 86, 168, .24);
}

.student-primary-btn:hover {
  background: linear-gradient(180deg, #166bd0 0%, #064ca6 100%);
}

.student-secondary-btn {
  border: 1px solid #bcd8f2;
  color: var(--blue-deep);
  background: #fff;
}

.student-secondary-btn:hover {
  background: #f3f8ff;
  box-shadow: 0 8px 20px rgba(17, 44, 84, .08);
}

.student-primary-btn:active,
.student-secondary-btn:active {
  transform: translateY(1px);
}

.student-signup-copy {
  margin: .1rem 0 -.25rem;
  color: #687b95;
  text-align: center;
  font-size: .88rem;
}

.student-auth-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: .75rem;
  color: #8a9bb1;
  font-size: .82rem;
}

.student-auth-divider span {
  height: 1px;
  background: #dbe7f4;
}

.student-temp-password {
  margin-top: 1rem;
  padding: .9rem;
  border-radius: 16px;
  border: 1px solid #bcd8f2;
  background: #f2f8ff;
}

.student-temp-password p {
  color: #49617f;
  font-size: .9rem;
}

.student-temp-password .done-id-pill {
  margin-top: .75rem;
}

.student-security-card {
  display: flex;
  align-items: center;
  gap: .85rem;
  margin-top: 1rem;
  padding: .95rem;
  background: #eaf4ff;
  box-shadow: none;
}

.student-security-card span {
  width: 42px;
  height: 42px;
  background: #dceeff;
}

.student-security-card p {
  color: #375172;
  font-size: .88rem;
  line-height: 1.45;
}

.student-feature-card {
  display: grid;
  gap: 0;
  margin-top: 1rem;
  overflow: hidden;
  box-shadow: 0 12px 34px rgba(17, 44, 84, .08);
}

.student-feature-card article {
  display: grid;
  grid-template-columns: 42px 1fr;
  column-gap: .8rem;
  align-items: center;
  padding: .95rem;
}

.student-feature-card article + article {
  border-top: 1px solid #e0ebf6;
}

.student-feature-card article > span {
  grid-row: span 2;
  width: 42px;
  height: 42px;
}

.student-feature-card h3 {
  color: #0b1d44;
  font-size: .98rem;
  letter-spacing: 0;
}

.student-feature-card p {
  color: #687b95;
  font-size: .84rem;
  line-height: 1.4;
}

.student-mobile-shell {
  min-height: 100vh;
  width: min(100%, 540px);
  margin: 0 auto;
  padding: calc(.55rem + env(safe-area-inset-top)) .85rem calc(5.8rem + env(safe-area-inset-bottom));
  background: #f5faff;
  color: #071a43;
}

.student-mobile-shell svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.student-mobile-top {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: .55rem;
  min-height: 52px;
  margin: -.55rem -.85rem .65rem;
  padding: calc(.55rem + env(safe-area-inset-top)) .85rem .55rem;
  background: rgba(248, 252, 255, .92);
  backdrop-filter: blur(16px);
}

.student-icon-btn,
.student-avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #075fd2;
  cursor: pointer;
  flex: none;
}

.student-icon-btn:hover,
.student-avatar:hover {
  background: #eaf3ff;
}

.student-mobile-brand {
  display: flex;
  align-items: center;
  gap: .48rem;
  min-width: 0;
}

.student-mobile-brand img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  border-radius: 50%;
  flex: none;
}

.student-mobile-brand strong {
  display: block;
  color: #075fd2;
  font-family: var(--display);
  font-size: 1.08rem;
  line-height: 1;
  letter-spacing: 0;
}

.student-mobile-brand span {
  display: block;
  max-width: 160px;
  overflow: hidden;
  color: #174b91;
  font-size: .62rem;
  font-weight: 700;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.student-bell {
  position: relative;
  color: #39506e;
}

.student-bell b {
  position: absolute;
  top: 4px;
  right: 2px;
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #f04444;
  color: #fff;
  font-size: .62rem;
  line-height: 1;
}

.student-avatar {
  background: #1267e8;
  color: #fff;
  font-weight: 900;
  letter-spacing: .02em;
  box-shadow: 0 8px 18px rgba(18, 103, 232, .22);
}

.student-dashboard {
  display: grid;
  gap: 1rem;
}

.student-hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(92px, .75fr);
  gap: .7rem;
  align-items: center;
  min-height: 150px;
  padding: 1.05rem;
  border: 1px solid #d7e9fb;
  border-radius: 24px;
  background: #eff7ff;
  box-shadow: 0 14px 34px rgba(18, 72, 132, .09);
  overflow: hidden;
}

.student-hero-card p {
  margin-bottom: .35rem;
  color: #075fd2;
  font-size: 1.02rem;
  font-weight: 900;
}

.student-hero-card h2 {
  color: #071a43;
  font-size: clamp(1.55rem, 7vw, 2rem);
  line-height: 1.12;
  letter-spacing: 0;
}

.student-hero-card span {
  display: block;
  margin-top: .58rem;
  color: #3d5577;
  font-size: .9rem;
  line-height: 1.45;
}

.student-hero-art {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 116px;
}

.student-hero-art span {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 92px;
  height: 72px;
  border: 1px solid #b8d8ff;
  border-radius: 18px;
  background: #fff;
  color: #1267e8;
  box-shadow: 0 12px 22px rgba(18, 103, 232, .15);
  transform: rotate(-5deg);
}

.student-hero-art span svg {
  width: 48px;
  height: 48px;
}

.student-hero-art b,
.student-hero-art i {
  position: absolute;
  display: block;
  border-radius: 999px;
}

.student-hero-art b {
  right: 0;
  bottom: 10px;
  width: 64px;
  height: 34px;
  background: #1267e8;
  box-shadow: inset 0 -8px 0 rgba(0, 0, 0, .08);
}

.student-hero-art i {
  right: 54px;
  top: 10px;
  width: 34px;
  height: 60px;
  border: 4px solid #9cc8ff;
  border-left-color: transparent;
  transform: rotate(42deg);
}

.student-dash-stats,
.student-detail-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .08rem;
  overflow: hidden;
  border: 1px solid #e1ecf8;
  border-radius: 16px;
  background: #e1ecf8;
  box-shadow: 0 12px 28px rgba(18, 72, 132, .08);
}

.student-detail-stats {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 1rem;
}

.student-dash-stat {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: .28rem;
  min-height: 118px;
  padding: .75rem .45rem;
  background: #fff;
  text-align: center;
}

.student-dash-stat > span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: #eaf3ff;
  color: #1267e8;
}

.student-dash-stat.assignments > span { background: #e9f9ef; color: #07954d; }
.student-dash-stat.exams > span { background: #fff1df; color: #f07b00; }
.student-dash-stat.grade > span { background: #f1e9ff; color: #8f31d8; }
.student-dash-stat.attendance > span { background: #e6fbf8; color: #009b92; }
.student-dash-stat.attention > span { background: #ffeceb; color: #e33f45; }

.student-dash-stat strong {
  color: #071a43;
  font-family: var(--display);
  font-size: 1.28rem;
  line-height: 1;
  letter-spacing: 0;
}

.student-dash-stat b {
  color: #17294d;
  font-size: .72rem;
  line-height: 1.2;
}

.student-dash-stat small {
  color: #516684;
  font-size: .7rem;
  line-height: 1.2;
}

.student-mobile-section {
  display: grid;
  gap: .7rem;
  padding: .75rem 0 0;
}

.student-mobile-section h2,
.student-section-head h2 {
  color: #071a43;
  font-size: 1.02rem;
  letter-spacing: 0;
}

.student-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}

.student-section-head button,
.student-view-all,
.student-back-link {
  display: inline-flex;
  align-items: center;
  gap: .28rem;
  min-height: 38px;
  border: 0;
  background: transparent;
  color: #075fd2;
  font: inherit;
  font-size: .86rem;
  font-weight: 900;
  cursor: pointer;
}

.student-section-head button svg,
.student-view-all svg {
  width: 16px;
  height: 16px;
}

.student-course-list,
.student-upcoming-list {
  display: grid;
  gap: .58rem;
}

.student-course-row,
.student-upcoming-row,
.student-result-row,
.student-empty-card {
  width: 100%;
  border: 1px solid #e1ecf8;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(18, 72, 132, .065);
}

.student-course-row,
.student-upcoming-row {
  display: grid;
  align-items: center;
  border: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.student-course-row {
  grid-template-columns: 88px minmax(0, 1fr) auto 22px;
  gap: .72rem;
  min-height: 96px;
  padding: .58rem .55rem;
}

.student-course-row:active,
.student-upcoming-row:active {
  transform: scale(.992);
}

.student-course-thumb {
  display: grid;
  place-items: center;
  width: 88px;
  height: 74px;
  border-radius: 10px;
  color: #075fd2;
  background: #a9ccff;
  overflow: hidden;
}

.student-course-thumb svg {
  width: 44px;
  height: 44px;
  filter: drop-shadow(0 6px 10px rgba(3, 41, 91, .18));
}

.student-course-thumb.anatomy { background: #d7e2ef; color: #b34538; }
.student-course-thumb.microbiology { background: #b9a2ff; color: #21115f; }
.student-course-thumb.pharmacology { background: #a5e6f4; color: #0a6690; }
.student-course-thumb.maternal { background: #ffd3e5; color: #9f245b; }

.student-course-copy {
  display: grid;
  gap: .2rem;
  min-width: 0;
}

.student-course-copy strong,
.student-upcoming-copy strong,
.student-result-row strong {
  overflow: hidden;
  color: #071a43;
  font-size: .92rem;
  font-weight: 900;
  line-height: 1.25;
  text-overflow: ellipsis;
}

.student-course-copy small {
  overflow: hidden;
  color: #314c75;
  font-size: .78rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.student-course-copy em,
.student-upcoming-copy small,
.student-result-row small {
  overflow: hidden;
  color: #506786;
  font-style: normal;
  font-size: .74rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.student-term-badge {
  align-self: start;
  padding: .24rem .42rem;
  border-radius: 8px;
  background: #eaf3ff;
  color: #075fd2;
  font-size: .68rem;
  font-weight: 900;
  white-space: nowrap;
}

.student-course-row > i,
.student-upcoming-row > i {
  display: grid;
  place-items: center;
  color: #075fd2;
}

.student-course-row > i svg,
.student-upcoming-row > i svg {
  width: 20px;
  height: 20px;
}

.student-view-all {
  justify-self: center;
  min-height: 44px;
  margin-top: .1rem;
}

.student-upcoming-row {
  grid-template-columns: 56px minmax(0, 1fr) auto 18px;
  gap: .66rem;
  min-height: 76px;
  padding: .65rem .6rem;
}

.student-date-badge {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 12px;
  background: #eaf3ff;
  color: #075fd2;
}

.student-date-badge b {
  font-size: .62rem;
  line-height: 1;
}

.student-date-badge strong {
  color: #071a43;
  font-family: var(--display);
  font-size: 1.24rem;
  line-height: 1;
}

.student-upcoming-copy {
  display: grid;
  gap: .22rem;
  min-width: 0;
}

.student-days-left {
  padding: .26rem .45rem;
  border-radius: 8px;
  background: #eaf3ff;
  color: #075fd2;
  font-size: .7rem;
  font-weight: 900;
  white-space: nowrap;
}

.student-days-left.soon {
  background: #fff1df;
  color: #e26b00;
}

.student-days-left.warm {
  background: #ffeceb;
  color: #d83038;
}

.student-quick-links {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .65rem;
}

.student-quick-links button {
  display: grid;
  justify-items: center;
  gap: .4rem;
  min-height: 82px;
  padding: .55rem .2rem;
  border: 0;
  background: transparent;
  color: #1d3357;
  font: inherit;
  font-size: .72rem;
  font-weight: 800;
  cursor: pointer;
}

.student-quick-links svg {
  width: 42px;
  height: 42px;
  padding: .58rem;
  border-radius: 14px;
  background: #eaf3ff;
  color: #1267e8;
}

.student-bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 35;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  width: min(100%, 540px);
  padding: .55rem .5rem calc(.45rem + env(safe-area-inset-bottom));
  border-top: 1px solid #dfe9f5;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 -12px 30px rgba(18, 72, 132, .08);
  transform: translateX(-50%);
}

.student-bottom-nav button {
  display: grid;
  place-items: center;
  gap: .22rem;
  min-height: 48px;
  border: 0;
  background: transparent;
  color: #526783;
  font: inherit;
  font-size: .64rem;
  font-weight: 900;
  cursor: pointer;
}

.student-bottom-nav button.on {
  color: #075fd2;
}

.student-bottom-nav svg {
  width: 23px;
  height: 23px;
}

.student-more-veil {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  align-items: end;
  background: rgba(7, 26, 67, .28);
}

.student-more-sheet {
  display: grid;
  gap: .35rem;
  width: min(100%, 540px);
  margin: 0 auto;
  padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom));
  border-radius: 24px 24px 0 0;
  background: #fff;
  box-shadow: 0 -18px 45px rgba(7, 26, 67, .18);
}

.student-more-sheet > b {
  color: #071a43;
  font-size: 1.05rem;
  margin-bottom: .2rem;
}

.student-more-sheet button {
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  background: #f4f8fd;
  color: #1d3357;
  font: inherit;
  font-weight: 800;
  text-align: left;
  padding: 0 .85rem;
  cursor: pointer;
}

.student-more-sheet button.danger {
  background: #fff0ef;
  color: #c63235;
}

.student-back-link {
  min-height: 44px;
  margin-bottom: .5rem;
}

.student-back-link svg {
  transform: rotate(180deg);
}

.student-course-detail-head {
  padding: 1rem;
  margin-bottom: .85rem;
  border: 1px solid #d7e9fb;
  border-radius: 22px;
  background: #eff7ff;
  box-shadow: 0 12px 26px rgba(18, 72, 132, .08);
}

.student-course-detail-head h1 {
  color: #071a43;
  font-size: 1.55rem;
  letter-spacing: 0;
}

.student-course-detail-head p {
  margin-top: .22rem;
  color: #314c75;
}

.student-course-detail-head span {
  display: block;
  margin-top: .45rem;
  color: #506786;
  font-size: .84rem;
}

.student-mobile-shell.course-open .student-mobile-top {
  display: none;
}

.student-course-detail {
  display: grid;
  gap: .85rem;
}

.student-course-top {
  position: sticky;
  top: 0;
  z-index: 32;
  display: flex;
  align-items: center;
  gap: .55rem;
  min-height: 52px;
  margin: calc(-.55rem - env(safe-area-inset-top)) -.85rem 0;
  padding: calc(.55rem + env(safe-area-inset-top)) .85rem .55rem;
  background: rgba(248, 252, 255, .94);
  backdrop-filter: blur(16px);
}

.student-course-top > strong {
  color: #071a43;
  font-size: 1rem;
  letter-spacing: 0;
}

.student-course-hero {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: .85rem;
  align-items: center;
  min-height: 172px;
  padding: .85rem;
  border: 1px solid #d7e9fb;
  border-radius: 24px;
  background: #eff7ff;
  box-shadow: 0 14px 34px rgba(18, 72, 132, .09);
}

.student-course-hero-art {
  display: grid;
  place-items: center;
  width: 112px;
  height: 132px;
  border-radius: 18px;
  background: #a9ccff;
  color: #075fd2;
  overflow: hidden;
}

.student-course-hero-art svg {
  width: 62px;
  height: 62px;
  filter: drop-shadow(0 8px 12px rgba(3, 41, 91, .18));
}

.student-course-hero-art.anatomy { background: #d7e2ef; color: #b34538; }
.student-course-hero-art.microbiology { background: #b9a2ff; color: #21115f; }
.student-course-hero-art.pharmacology { background: #a5e6f4; color: #0a6690; }
.student-course-hero-art.maternal { background: #ffd3e5; color: #9f245b; }

.student-course-hero small {
  display: inline-flex;
  max-width: 100%;
  padding: .24rem .45rem;
  border-radius: 8px;
  background: #dcecff;
  color: #075fd2;
  font-size: .68rem;
  font-weight: 900;
}

.student-course-hero h1 {
  margin-top: .42rem;
  color: #071a43;
  font-size: 1.32rem;
  line-height: 1.16;
  letter-spacing: 0;
}

.student-course-hero p {
  margin-top: .28rem;
  color: #314c75;
  font-size: .84rem;
  line-height: 1.25;
}

.student-course-hero em {
  display: block;
  margin-top: .38rem;
  color: #506786;
  font-style: normal;
  font-size: .78rem;
}

.student-course-hero b {
  display: flex;
  align-items: center;
  gap: .38rem;
  margin-top: .55rem;
  color: #1d3357;
  font-size: .78rem;
  line-height: 1.25;
}

.student-course-hero b span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #1267e8;
  color: #fff;
  font-size: .68rem;
  flex: none;
}

.student-muted-value {
  color: #7b8da4;
  font-weight: 800;
}

.student-course-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .58rem;
}

.student-course-info-grid article {
  display: grid;
  gap: .35rem;
  min-height: 112px;
  padding: .78rem;
  border: 1px solid #e1ecf8;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(18, 72, 132, .06);
}

.student-course-info-grid span:first-child {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: #f1e9ff;
  color: #8f31d8;
}

.student-course-info-grid .schedule span:first-child { background: #e9f9ef; color: #07954d; }
.student-course-info-grid .location span:first-child { background: #fff1df; color: #f07b00; }
.student-course-info-grid .duration span:first-child { background: #eaf3ff; color: #1267e8; }

.student-course-info-grid strong {
  color: #071a43;
  font-size: .9rem;
  line-height: 1.2;
}

.student-course-info-grid small {
  color: #506786;
  font-size: .72rem;
  font-weight: 800;
}

.student-course-tabs {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding: .15rem .05rem 0;
  border-bottom: 1px solid #dfe9f5;
  scrollbar-width: none;
}

.student-course-tabs::-webkit-scrollbar {
  display: none;
}

.student-course-tabs button {
  display: inline-flex;
  align-items: center;
  gap: .32rem;
  flex: none;
  min-height: 42px;
  padding: 0 0 .65rem;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #526783;
  font: inherit;
  font-size: .84rem;
  font-weight: 900;
  cursor: pointer;
}

.student-course-tabs button svg {
  width: 17px;
  height: 17px;
}

.student-course-tabs button.on {
  color: #075fd2;
  border-bottom-color: #075fd2;
}

.student-course-detail.grades-active .student-course-hero {
  min-height: 128px;
  grid-template-columns: 84px minmax(0, 1fr);
  padding: .72rem;
  border-radius: 18px;
  background: #fff;
}

.student-course-detail.grades-active .student-course-hero-art {
  width: 84px;
  height: 96px;
  border-radius: 15px;
}

.student-course-detail.grades-active .student-course-hero-art svg {
  width: 48px;
  height: 48px;
}

.student-course-detail.grades-active .student-course-hero small {
  padding: .2rem .42rem;
  font-size: .64rem;
}

.student-course-detail.grades-active .student-course-hero h1 {
  margin-top: .32rem;
  font-size: 1.05rem;
  line-height: 1.18;
}

.student-course-detail.grades-active .student-course-hero p {
  margin-top: .18rem;
  font-size: .76rem;
}

.student-course-detail.grades-active .student-course-hero em {
  margin-top: .28rem;
  font-size: .72rem;
}

.student-course-detail.grades-active .student-course-hero b {
  margin-top: .38rem;
  font-size: .72rem;
}

.student-course-detail.grades-active .student-course-hero b span {
  width: 24px;
  height: 24px;
  font-size: .6rem;
}

#student-course-tab-panel {
  display: grid;
  gap: .75rem;
}

.student-detail-card {
  display: grid;
  gap: .7rem;
  padding: .95rem;
  border: 1px solid #e1ecf8;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(18, 72, 132, .06);
}

.student-detail-card h2 {
  color: #071a43;
  font-size: 1rem;
  letter-spacing: 0;
}

.student-detail-card p {
  color: #3d5577;
  font-size: .86rem;
  line-height: 1.48;
}

.student-announcement-list {
  display: grid;
  gap: .35rem;
}

.student-announcement-list button {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) 18px;
  gap: .55rem;
  align-items: center;
  min-height: 68px;
  padding: .55rem 0;
  border: 0;
  border-top: 1px solid #edf3fb;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.student-announcement-list button:first-child {
  border-top: 0;
}

.student-announcement-list i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1267e8;
}

.student-announcement-list .dot-2 { background: #07954d; }
.student-announcement-list .dot-3 { background: #f07b00; }

.student-announcement-list span {
  display: grid;
  gap: .14rem;
  min-width: 0;
}

.student-announcement-list strong {
  color: #071a43;
  font-size: .88rem;
  line-height: 1.2;
}

.student-announcement-list small,
.student-announcement-list em {
  overflow: hidden;
  color: #506786;
  font-style: normal;
  font-size: .74rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.student-announcement-list svg {
  color: #075fd2;
}

.student-attendance-summary {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: .85rem;
  align-items: center;
}

.student-attendance-ring {
  display: grid;
  place-items: center;
  align-content: center;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #fff 58%, transparent 59%),
    conic-gradient(#07954d var(--pct), #e4edf7 0);
}

.student-attendance-ring strong {
  color: #071a43;
  font-family: var(--display);
  font-size: 1.42rem;
  line-height: 1;
}

.student-attendance-ring span {
  margin-top: .18rem;
  color: #506786;
  font-size: .62rem;
  font-weight: 900;
  text-align: center;
}

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

.student-attendance-counts span {
  display: grid;
  gap: .12rem;
  min-height: 48px;
  padding: .5rem;
  border-radius: 12px;
  background: #f5faff;
  color: #506786;
  font-size: .7rem;
  font-weight: 800;
}

.student-attendance-counts b {
  color: #071a43;
  font-family: var(--display);
  font-size: 1.08rem;
  line-height: 1;
}

.student-attendance-counts .present b { color: #07954d; }
.student-attendance-counts .absent b { color: #c63235; }
.student-attendance-counts .late b { color: #e26b00; }
.student-attendance-counts .excused b { color: #075fd2; }

.student-session-list {
  display: grid;
  gap: .45rem;
}

.student-session-list article {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: .6rem;
  align-items: center;
  padding: .65rem;
  border-radius: 14px;
  background: #f8fbff;
}

.student-session-list article > span {
  padding: .28rem .35rem;
  border-radius: 999px;
  background: #eaf3ff;
  color: #075fd2;
  font-size: .68rem;
  font-weight: 900;
  text-align: center;
  text-transform: capitalize;
}

.student-session-list .present { background: #e9f9ef; color: #07954d; }
.student-session-list .absent { background: #fff0ef; color: #c63235; }
.student-session-list .late { background: #fff1df; color: #e26b00; }

.student-session-list strong {
  color: #071a43;
  font-size: .86rem;
}

.student-session-list small {
  display: block;
  margin-top: .14rem;
  color: #506786;
  font-size: .74rem;
}

.student-result-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: .65rem;
  align-items: center;
  min-height: 66px;
  padding: .75rem;
}

.student-result-row b {
  color: #075fd2;
  font-family: var(--mono);
  font-size: .86rem;
}

.student-result-row b.missing {
  color: #c63235;
}

.student-result-row a {
  color: #075fd2;
  font-size: .78rem;
  font-weight: 900;
  text-decoration: none;
}

.student-grades-page {
  display: grid;
  gap: .78rem;
}

.student-current-grade-card {
  position: relative;
  display: grid;
  min-height: 176px;
  padding: 1.15rem;
  border: 1px solid #b9d7ff;
  border-radius: 22px;
  background:
    radial-gradient(circle at 88% 18%, rgba(255,255,255,.5) 0 46px, transparent 47px),
    linear-gradient(135deg, #075fd2 0%, #1285ff 100%);
  color: #fff;
  overflow: hidden;
  box-shadow: 0 16px 34px rgba(7, 95, 210, .22);
}

.student-current-grade-card > span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 15px;
  background: rgba(255,255,255,.18);
  color: #fff;
}

.student-current-grade-card small {
  margin-top: .8rem;
  color: rgba(255,255,255,.82);
  font-size: .78rem;
  font-weight: 900;
}

.student-current-grade-card strong {
  margin-top: .12rem;
  font-family: var(--display);
  font-size: clamp(3rem, 18vw, 4.7rem);
  line-height: .92;
  letter-spacing: 0;
}

.student-current-grade-card b {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  display: grid;
  place-items: center;
  min-width: 68px;
  height: 58px;
  padding: 0 .65rem;
  border-radius: 18px;
  background: rgba(255,255,255,.18);
  font-family: var(--display);
  font-size: 1.55rem;
}

.student-grade-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .58rem;
}

.student-grade-mini {
  display: grid;
  gap: .3rem;
  min-height: 108px;
  padding: .78rem;
  border: 1px solid #e1ecf8;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(18, 72, 132, .06);
}

.student-grade-mini span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: #eaf3ff;
  color: #075fd2;
}

.student-grade-mini.green span { background: #e9f9ef; color: #07954d; }
.student-grade-mini.purple span { background: #f1e9ff; color: #8f31d8; }
.student-grade-mini.amber span { background: #fff1df; color: #f07b00; }

.student-grade-mini strong {
  min-width: 0;
  color: #071a43;
  font-family: var(--display);
  font-size: 1.08rem;
  line-height: 1.05;
  word-break: break-word;
}

.student-grade-mini small {
  color: #506786;
  font-size: .72rem;
  font-weight: 850;
}

.student-grade-breakdown-card .student-section-head button,
.student-recent-grades-card .student-section-head button {
  font-size: .68rem;
}

.student-grade-breakdown {
  display: grid;
  gap: .28rem;
}

.student-grade-break-row {
  border-top: 1px solid #edf3fb;
}

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

.student-grade-break-main {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto 18px;
  gap: .58rem;
  align-items: center;
  width: 100%;
  min-height: 74px;
  padding: .62rem 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.student-grade-break-main svg:last-child {
  color: #075fd2;
  transition: transform .18s ease;
}

.student-grade-break-row.open .student-grade-break-main svg:last-child {
  transform: rotate(90deg);
}

.grade-break-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: #eaf3ff;
  color: #075fd2;
}

.student-grade-break-row.assignments .grade-break-icon { background: #e9f9ef; color: #07954d; }
.student-grade-break-row.exams .grade-break-icon { background: #fff1df; color: #f07b00; }
.student-grade-break-row.participation .grade-break-icon { background: #e6fbf8; color: #009b92; }

.grade-break-copy {
  display: grid;
  gap: .32rem;
  min-width: 0;
}

.grade-break-copy strong {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .45rem;
  color: #071a43;
  font-size: .86rem;
}

.grade-break-copy em {
  color: #075fd2;
  font-style: normal;
  font-size: .72rem;
}

.grade-break-copy i {
  display: block;
  height: 7px;
  border-radius: 999px;
  background: #e7f0fb;
  overflow: hidden;
}

.grade-break-copy i b {
  display: block;
  width: var(--bar);
  max-width: 100%;
  height: 100%;
  border-radius: inherit;
  background: #075fd2;
}

.student-grade-break-row.assignments .grade-break-copy i b { background: #07954d; }
.student-grade-break-row.exams .grade-break-copy i b { background: #f07b00; }
.student-grade-break-row.participation .grade-break-copy i b { background: #009b92; }

.grade-break-copy small {
  color: #506786;
  font-size: .7rem;
  font-weight: 800;
}

.grade-break-score {
  color: #071a43;
  font-family: var(--display);
  font-size: .98rem;
  font-weight: 900;
}

.student-grade-break-items {
  display: grid;
  gap: .34rem;
  padding: 0 0 .62rem 2.9rem;
}

.student-grade-break-items p {
  margin: 0;
  color: #506786;
  font-size: .78rem;
}

.student-grade-item-row,
.student-recent-grade {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: .55rem;
  align-items: center;
  width: 100%;
  min-height: 62px;
  padding: .58rem;
  border: 1px solid #edf3fb;
  border-radius: 14px;
  background: #f8fbff;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.student-recent-grade {
  grid-template-columns: 36px minmax(0, 1fr) auto 16px;
  background: #fff;
}

.student-grade-item-row > span:first-child,
.student-recent-grade > span:first-child {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: #eaf3ff;
  color: #075fd2;
}

.student-grade-item-row strong,
.student-recent-grade strong {
  display: block;
  color: #071a43;
  font-size: .82rem;
  line-height: 1.2;
}

.student-grade-item-row small,
.student-recent-grade small {
  display: block;
  margin-top: .16rem;
  color: #506786;
  font-size: .7rem;
}

.student-grade-item-row b,
.student-recent-grade b {
  display: grid;
  gap: .12rem;
  color: #071a43;
  font-size: .78rem;
  text-align: right;
}

.student-grade-item-row b em,
.student-recent-grade b em {
  color: #075fd2;
  font-style: normal;
  font-family: var(--display);
  font-size: .9rem;
}

.student-recent-grade-list {
  display: grid;
  gap: .45rem;
}

.student-recent-grade > svg {
  color: #075fd2;
}

.student-grade-note {
  display: flex;
  align-items: center;
  gap: .45rem;
  margin: 0;
  padding: .74rem .82rem;
  border: 1px solid #d7e9fb;
  border-radius: 14px;
  background: #f2f8ff;
  color: #506786;
  font-size: .76rem;
  font-weight: 800;
}

.student-grade-note svg {
  flex: none;
  width: 18px;
  height: 18px;
  color: #075fd2;
}

.student-empty-card {
  padding: 1.1rem;
  color: #506786;
  text-align: center;
}

.student-empty-card h3 {
  margin-bottom: .25rem;
  color: #071a43;
}

@media (max-width: 374px) {
  .student-mobile-shell {
    padding-left: .65rem;
    padding-right: .65rem;
  }
  .student-mobile-top {
    margin-left: -.65rem;
    margin-right: -.65rem;
    padding-left: .65rem;
    padding-right: .65rem;
  }
  .student-mobile-brand span {
    max-width: 130px;
  }
  .student-dash-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .student-course-row {
    grid-template-columns: 74px minmax(0, 1fr) 18px;
  }
  .student-course-hero {
    grid-template-columns: 82px minmax(0, 1fr);
    padding: .7rem;
  }
  .student-course-hero-art {
    width: 82px;
    height: 112px;
  }
  .student-course-hero-art svg {
    width: 48px;
    height: 48px;
  }
  .student-course-info-grid {
    gap: .45rem;
  }
  .student-attendance-summary {
    grid-template-columns: 1fr;
    justify-items: center;
  }
  .student-course-thumb {
    width: 74px;
    height: 66px;
  }
  .student-term-badge {
    grid-column: 2;
    justify-self: start;
  }
  .student-upcoming-row {
    grid-template-columns: 50px minmax(0, 1fr) 18px;
  }
  .student-days-left {
    grid-column: 2;
    justify-self: start;
  }
  .student-quick-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ================================================== STUDENT — join & finish */

.verification-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2.4rem 1.25rem;
  background: #eef3f8;
}

.portal-card {
  width: min(1100px, 100%);
  min-height: 680px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 28px 80px rgba(17, 44, 84, .16), 0 2px 10px rgba(17, 44, 84, .08);
}

.portal-left {
  display: flex;
  flex-direction: column;
  padding: 3.2rem;
  color: #fff;
  background: linear-gradient(145deg, #1f73d2 0%, #0c54ae 48%, #073b86 100%);
}

.school-lockup {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.school-lockup img {
  width: 76px;
  height: 76px;
  object-fit: contain;
  border-radius: 50%;
  background: #fff;
  padding: .2rem;
  box-shadow: 0 10px 28px rgba(0, 20, 60, .18);
}

.school-lockup strong {
  display: block;
  font-family: var(--display);
  font-size: 1.45rem;
  letter-spacing: .03em;
}

.school-lockup span {
  display: block;
  max-width: 280px;
  margin-top: .2rem;
  color: rgba(255, 255, 255, .82);
  font-size: .9rem;
  line-height: 1.35;
}

.portal-intro {
  margin-top: 5.2rem;
  max-width: 420px;
}

.portal-kicker,
.form-kicker {
  margin: 0 0 .75rem;
  font-family: var(--mono);
  font-size: .74rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  font-weight: 600;
}

.portal-kicker { color: rgba(255, 255, 255, .72); }

.portal-intro h1 {
  font-size: 3.25rem;
  letter-spacing: 0;
}

.portal-intro p:not(.portal-kicker) {
  max-width: 360px;
  margin-top: 1rem;
  color: rgba(255, 255, 255, .8);
  font-size: 1rem;
}

.quiz-info-card {
  margin-top: auto;
  padding: 1.4rem;
  border: 1px solid rgba(255, 255, 255, .26);
  border-radius: 18px;
  background: rgba(255, 255, 255, .14);
  box-shadow: 0 18px 45px rgba(0, 23, 72, .16);
}

.quiz-info-card label {
  color: rgba(255, 255, 255, .9);
}

.quiz-info-card .code-input {
  color: #113a73;
  background: #fff;
  border-color: transparent;
  box-shadow: 0 12px 26px rgba(0, 28, 90, .14);
}

.quiz-info-note {
  margin-top: .7rem;
  color: rgba(255, 255, 255, .74);
  font-size: .86rem;
}

.portal-right {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4rem 4.25rem;
  background: #fff;
}

.verified-badge {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  margin-bottom: 2.1rem;
  padding: .45rem .7rem;
  border-radius: 999px;
  background: #eaf7ef;
  color: #167443;
  font-size: .82rem;
  font-weight: 700;
}

.verified-badge span {
  width: .55rem;
  height: .55rem;
  border-radius: 50%;
  background: #20a35b;
}

.form-kicker {
  color: #2263ad;
}

.portal-right h2 {
  color: #10243f;
  font-size: 2.55rem;
  letter-spacing: 0;
}

.verification-copy {
  margin-top: .8rem;
  color: #62748a;
}

.verify-form {
  margin-top: 2rem;
}

.verify-form .field,
.verify-form input {
  width: 100%;
}

.verify-form input {
  display: block;
  min-height: 48px;
  border-color: #d8e2ed;
  border-radius: 12px;
  background: #fbfdff;
}

.verify-form input:focus {
  border-color: #2472ce;
  box-shadow: 0 0 0 4px rgba(36, 114, 206, .12);
}

.btn-portal {
  width: 100%;
  min-height: 52px;
  margin-top: .4rem;
  border-radius: 12px;
  border-color: #1766c2;
  background: #1766c2;
  box-shadow: 0 14px 30px rgba(23, 102, 194, .22);
}

.btn-portal:hover {
  background: #0e56a8;
  border-color: #0e56a8;
}

.security-note {
  margin-top: 1.35rem;
  color: #75869a;
  font-size: .84rem;
  text-align: center;
}

/* Student self-registration */
.registration-page {
  min-height: 100%;
  background: #f4f8fd;
}

.registration-top {
  min-height: 74px;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem max(1.25rem, calc((100vw - 1120px) / 2));
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid #dfeaf5;
}

.registration-top .top-brand small {
  color: var(--blue);
  font-weight: 700;
}

.registration-login {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: .5rem;
  color: #60758c;
  font-size: .9rem;
}

.registration-login a {
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
}

.registration-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

.registration-form {
  display: grid;
  gap: 1.15rem;
}

.registration-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
  position: relative;
  margin-bottom: .4rem;
}

.registration-steps::before {
  content: '';
  position: absolute;
  left: 8%;
  right: 8%;
  top: 18px;
  height: 1px;
  background: #cfe1f5;
}

.step {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: .45rem;
  text-align: center;
  color: #60758c;
  font-size: .78rem;
}

.step span {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #edf4fb;
  color: #334b65;
  font-family: var(--mono);
  font-weight: 700;
}

.step.active {
  color: var(--blue);
}

.step.active span {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 8px 18px rgba(23, 102, 194, .22);
}

/* A step already finished - blue outline, not the solid fill .active uses,
   so mid-flow it's clear at a glance which step is current vs already done. */
.step.completed {
  color: var(--blue-deep);
}

.step.completed span {
  background: var(--blue-wash);
  color: var(--blue);
  border: 1.5px solid var(--blue);
}

.registration-title {
  display: flex;
  align-items: flex-start;
  gap: .9rem;
  padding: .6rem 0 .2rem;
}

.registration-title h1 {
  color: #10243f;
}

.registration-title p:not(.eyebrow) {
  margin-top: .45rem;
  color: #60758c;
}

.title-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 10px;
  background: var(--blue-wash);
  color: var(--blue);
}

.registration-card {
  background: #fff;
  border: 1px solid #dbe7f2;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(21, 61, 108, .07);
  padding: 1.35rem;
}

.registration-card h2 {
  display: flex;
  align-items: center;
  gap: .45rem;
  color: #10243f;
}

.registration-card h2 span {
  color: var(--blue);
}

.reg-grid {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

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

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

.registration-form input,
.registration-form select {
  min-height: 46px;
  border-radius: 10px;
  border-color: #d8e4f0;
  background: #fbfdff;
}

.field-error {
  display: block;
  min-height: 1.1rem;
  margin-top: .28rem;
  color: #a83a24;
  font-size: .78rem;
}

.field.has-error input,
.field.has-error select {
  border-color: #d99686;
  box-shadow: 0 0 0 3px rgba(168, 58, 36, .08);
}

/* Review & Confirm: read-only summary cards, same shell as the editable
   .registration-card but with a label+value pair instead of an input. */
.review-card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.review-edit-btn {
  display: inline-flex; align-items: center; gap: .35rem; flex: none;
  padding: .4rem .75rem; border-radius: 8px;
  background: #fff; border: 1.5px solid var(--blue); color: var(--blue);
  font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer;
}
.review-edit-btn:hover { background: var(--blue-wash); }
.review-field span { display: block; font-size: .76rem; color: #60758c; margin-bottom: .3rem; }
.review-field strong { display: block; color: #10243f; font-size: .95rem; font-weight: 600; word-break: break-word; }

.registration-page .req { color: var(--flag); }

/* This page isn't instructor-scoped, so the shared .check checkbox would
   otherwise pick up --pine (green) - the brief asks for a blue checkbox here. */
.registration-page .check input { accent-color: var(--blue); }
.registration-page .check { margin: 1.1rem 0 0; }
.registration-confirm {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  width: fit-content;
  max-width: 100%;
  padding: .75rem .9rem;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #10243f;
  line-height: 1.35;
  cursor: pointer;
}
.registration-confirm:hover {
  background: var(--blue-wash);
  border-color: var(--blue-line);
}
.registration-confirm input {
  width: 18px;
  height: 18px;
  margin: 0;
  cursor: pointer;
}
.registration-confirm span {
  display: block;
}

.registration-safe {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: 1rem;
  border: 1px solid var(--blue-line);
  border-radius: 10px;
  background: var(--blue-wash);
  color: var(--blue-deep);
}

.registration-safe p {
  margin-top: .25rem;
  color: #496178;
  font-size: .9rem;
}

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

.registration-actions .btn {
  min-width: 190px;
}

.registration-done {
  /* Wide enough to hold the two-column Registration Summary at full card
     width, same as the Step 1/2 cards - not the narrow single-fact card
     this screen used to be. */
  max-width: 760px;
  margin: 1.75rem auto 0;
  text-align: center;
}

.done-icon-wrap {
  position: relative;
  width: 64px; height: 64px;
  margin: 0 auto 1.1rem;
}

.done-icon {
  width: 100%; height: 100%;
  display: grid; place-items: center; border-radius: 50%;
  background: var(--pine-wash); color: var(--pine);
  position: relative; z-index: 1;
}

/* A handful of small dots around the checkmark - deliberately understated
   ("subtle celebratory accents", not confetti) rather than an animation or
   an icon library, keeping this dependency-light. */
.confetti-dot {
  position: absolute;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--blue);
}
.confetti-dot.dot-a { top: -6px; left: 6px; background: var(--amber); }
.confetti-dot.dot-b { top: 4px; left: -22px; width: 8px; height: 8px; background: var(--pine); opacity: .5; }
.confetti-dot.dot-c { bottom: -8px; left: 14px; background: #e78bb0; }
.confetti-dot.dot-d { top: -4px; right: -20px; width: 8px; height: 8px; }
.confetti-dot.dot-e { bottom: -2px; right: -24px; background: var(--amber); opacity: .6; }
.confetti-dot.dot-f { top: 26px; left: -30px; width: 5px; height: 5px; background: var(--blue); opacity: .5; }

.registration-done h1 { margin-top: .3rem; }
.registration-done > p.muted { margin-top: .6rem; }

.done-status {
  margin-top: .35rem;
  color: var(--pine);
  font-weight: 600;
}

/* Shown only when the backend confirms an email actually went out
   (result.emailed === true) - never rendered speculatively. */
.done-email-notice {
  margin-top: 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  text-align: left;
  padding: .85rem 1rem;
  border-radius: 10px;
  background: var(--pine-wash);
  border: 1px solid #bcd8ce;
  color: var(--pine-deep);
}

.done-email-icon {
  flex: none;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: #fff;
  color: var(--pine);
}

.done-email-notice strong { display: block; font-size: .92rem; }
.done-email-notice p { margin-top: .15rem; color: var(--pine-deep); font-size: .88rem; }

/* Truthful fallback for when SMTP isn't configured or sending failed - no
   green "sent" claim, just the plain notice text so the student still knows
   to write the ID down. */
.done-email-fallback {
  margin-top: 1rem;
  text-align: center;
  font-size: .85rem;
  color: var(--amber);
}

.done-summary {
  margin-top: 1.75rem;
  text-align: left;
}

.done-summary-head {
  display: flex;
  align-items: center;
  gap: .6rem;
}

.done-summary-head h2 { color: #10243f; }

.done-id-block {
  text-align: center;
  margin: 1.35rem 0 .5rem;
}

.done-id-block .eyebrow {
  display: block;
}

.done-id-pill {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  margin-top: .5rem;
  padding: .6rem 1.25rem;
  border-radius: 999px;
  background: var(--blue-wash);
  border: 1px solid var(--blue-line);
}

.done-id-pill .mono {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--blue);
  letter-spacing: .02em;
}

.done-id-copy {
  display: grid; place-items: center;
  width: 26px; height: 26px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--blue-deep);
  cursor: pointer;
}
.done-id-copy:hover { background: #fff; }

.done-id-copied {
  font-size: .8rem;
  font-weight: 600;
  color: var(--pine);
}

.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 2.5rem;
  margin-top: 1.5rem;
}

.summary-col .review-field {
  padding: .65rem 0;
  border-bottom: 1px solid #eef3f9;
}
.summary-col .review-field:last-child { border-bottom: none; }

/* A quiet break between the academic rows and the emergency-contact rows in
   the right column - not a nested card, just a rule, so Emergency Contact
   stays inside the one Registration Summary container. */
.done-field-divider {
  border-top: 1px solid #eef3f9;
  margin-top: .1rem;
  padding-top: 1rem !important;
}

.centred {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
}

.join { width: 100%; max-width: 430px; }

.join-mark {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin-bottom: 1.75rem;
}
.join-mark .bubbles { display: flex; gap: .28rem; }
.join-mark .bubbles i {
  width: 11px; height: 11px; border-radius: 50%;
  border: 1.5px solid var(--graphite); display: block;
}
.join-mark .bubbles i:nth-child(2) { background: var(--ink); border-color: var(--ink); }
.join-mark strong {
  font-family: var(--display); font-size: .95rem;
  letter-spacing: .01em; font-weight: 700;
}

/* ---------------------------------------------------------- quiz start */

.start-shell {
  min-height: 100vh;
  background:
    radial-gradient(700px 260px at -8% 100%, rgba(23, 102, 194, .12), transparent 72%),
    radial-gradient(560px 220px at 108% 86%, rgba(23, 102, 194, .10), transparent 70%),
    #f3f8fe;
  color: #0b1c3d;
}

.start-header {
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  padding: 1rem 1.5rem;
  background: rgba(255, 255, 255, .92);
  border-bottom: 1px solid #c9d9ec;
  box-shadow: 0 1px 0 rgba(17, 44, 84, .03);
}

.start-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.start-brand img {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.start-brand strong {
  display: block;
  font-family: var(--display);
  font-size: 2rem;
  letter-spacing: 0;
  color: #102a5f;
  line-height: 1;
}

.start-brand span {
  display: block;
  margin-top: .35rem;
  color: #344868;
  font-size: .95rem;
}

.start-header-rule {
  width: 1px;
  height: 48px;
  background: #c7d4e4;
}

.start-portal {
  display: flex;
  align-items: center;
  gap: .8rem;
  color: var(--blue-deep);
  font-weight: 600;
  font-size: 1.2rem;
}

.start-portal-icon,
.start-icon {
  display: inline-grid;
  place-items: center;
  flex: none;
  color: var(--blue);
  background: var(--blue-wash);
  border-radius: 8px;
}

.start-portal-icon {
  width: 38px;
  height: 38px;
}

.start-portal-icon svg { width: 18px; height: 18px; }

.start-main {
  position: relative;
  display: flex;
  justify-content: center;
  padding: 2.8rem 1.25rem 4rem;
}

.start-card {
  width: min(860px, 100%);
  background: #fff;
  border: 1px solid #cbd9e8;
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(17, 44, 84, .13), 0 2px 8px rgba(17, 44, 84, .06);
  padding: 2rem 2.3rem 2.2rem;
}

.start-card .eyebrow {
  color: #005fd0;
  font-weight: 700;
  margin-bottom: .85rem;
}

.start-card h1 {
  color: #101d37;
  font-size: 2.45rem;
  letter-spacing: 0;
  padding-bottom: 1.35rem;
  border-bottom: 1px solid #cbd9e8;
}

.start-summary {
  display: grid;
  margin-top: .85rem;
}

.start-row {
  display: grid;
  grid-template-columns: 42px minmax(130px, .6fr) 1fr;
  align-items: center;
  gap: 1rem;
  min-height: 58px;
  border-bottom: 1px solid #dbe6f2;
}

.start-row:last-child { border-bottom: none; }

.start-icon {
  width: 36px;
  height: 36px;
}

.start-icon svg { width: 18px; height: 18px; }

.start-label {
  color: #425679;
  font-size: 1rem;
}

.start-row strong {
  color: #0f1930;
  font-size: 1rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.start-note {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  margin-top: 1rem;
  padding: 1.05rem 1.15rem;
  border: 1px solid;
  border-radius: 8px;
  font-size: 1rem;
  line-height: 1.55;
}

.start-note p {
  margin: 0;
}

.start-note-icon {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  flex: none;
  border-radius: 50%;
}

.start-note-icon svg {
  width: 28px;
  height: 28px;
}

.start-note-warn {
  background: #fff8e9;
  border-color: #f0bd4f;
  color: #7b4a00;
}

.start-note-warn .start-note-icon {
  color: #e79800;
}

.start-note-info {
  background: #eef7ff;
  border-color: #afd2fb;
  color: #15396e;
}

.start-note-info .start-note-icon {
  color: var(--blue);
}

#confirm-instructions {
  align-items: flex-start;
}

.start-actions {
  display: grid;
  grid-template-columns: 128px 1fr;
  gap: 1rem;
  margin-top: 1.35rem;
  padding-top: 1.35rem;
  border-top: 1px solid #dbe6f2;
}

.start-back,
.start-begin {
  min-height: 54px;
  border-radius: 7px;
  font-size: 1.05rem;
}

.start-back {
  background: #fff;
  border-color: #b7c9df;
  color: #102a5f;
}

.start-back:hover {
  background: #f7fbff;
  border-color: var(--blue);
  color: var(--blue-deep);
}

.start-begin {
  justify-self: end;
  width: min(330px, 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .65rem;
  background: linear-gradient(180deg, #0d64d8, #064aa7);
  border-color: #0a55bd;
  box-shadow: 0 10px 20px rgba(7, 75, 168, .24);
}

.start-begin:hover {
  background: linear-gradient(180deg, #0b58c1, #063f91);
  border-color: #08489f;
}

/* ------------------------------------------------------- submitted result */

.result-shell {
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(650px 280px at 0% 100%, rgba(23, 102, 194, .12), transparent 72%),
    radial-gradient(560px 250px at 100% 92%, rgba(23, 102, 194, .10), transparent 72%),
    #f4f9ff;
  color: #0b1c3d;
}

.result-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url("/logo.png");
  background-repeat: no-repeat;
  background-position: center 57%;
  background-size: min(68vw, 920px);
  opacity: .04;
}

.result-header,
.result-main {
  position: relative;
  z-index: 1;
}

.result-header {
  min-height: 104px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem max(4.8vw, calc((100vw - 1540px) / 2));
  background: rgba(255, 255, 255, .94);
  border: 1px solid #c9d9ec;
  border-left: 0;
  border-right: 0;
  box-shadow: 0 1px 0 rgba(17, 44, 84, .04);
}

.result-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.result-brand img {
  width: 70px;
  height: 70px;
  object-fit: contain;
}

.result-brand strong {
  font-family: var(--display);
  font-size: 2.35rem;
  color: #102a5f;
  letter-spacing: 0;
  line-height: 1;
}

.result-brand-rule {
  width: 1px;
  height: 46px;
  background: #c7d4e4;
}

.result-brand div span,
.result-student span {
  display: block;
  color: #344868;
}

.result-brand div b {
  display: block;
  color: var(--blue-deep);
  font-size: 1rem;
  margin-top: .15rem;
}

.result-student {
  display: flex;
  align-items: center;
  gap: .75rem;
  min-width: 265px;
  justify-content: center;
  padding: .82rem 1rem;
  border: 1px solid #cbd9e8;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 26px rgba(17, 44, 84, .06);
}

.result-student-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 50%;
  color: #0f3f86;
  background: #e8f2ff;
}

.result-student-icon svg {
  width: 28px;
  height: 28px;
}

.result-student strong {
  display: block;
  color: #102147;
  font-weight: 700;
  line-height: 1.2;
  text-align: left;
}

.result-student span {
  margin-top: .15rem;
  font-size: .9rem;
}

.result-student-chev {
  display: grid !important;
  place-items: center;
  margin-left: auto;
  color: #102a5f !important;
}

.result-student-chev svg,
.result-button-icon svg {
  width: 18px;
  height: 18px;
}

.result-main {
  display: grid;
  justify-items: center;
  padding: 2.65rem 1.25rem 3rem;
}

.result-card {
  width: min(760px, 100%);
  padding: 1.7rem 1.85rem;
  border: 1px solid #cbd9e8;
  border-radius: 16px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 24px 60px rgba(17, 44, 84, .13), 0 2px 8px rgba(17, 44, 84, .06);
}

.result-success {
  position: relative;
  display: grid;
  justify-items: center;
  text-align: center;
  padding-top: .2rem;
}

.result-success::before,
.result-success::after {
  content: none;
}

.result-check {
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  margin-bottom: .7rem;
  border-radius: 50%;
  color: #079653;
  background: #dcfce7;
  border: 3px solid #25c36b;
  box-shadow: 0 0 0 11px rgba(34, 197, 94, .1);
}

.result-check svg {
  width: 33px;
  height: 33px;
}

.result-success .eyebrow {
  color: #05864e;
  font-weight: 700;
  margin-bottom: .3rem;
}

.result-success h1 {
  color: #0b1c3d;
  font-size: 1.95rem;
  letter-spacing: 0;
}

.result-score {
  margin-top: 1.1rem;
  padding-top: 1.15rem;
  border-top: 1px solid #cbd9e8;
  text-align: center;
}

.result-score div {
  font-family: var(--display);
  font-size: clamp(3.6rem, 7vw, 4.85rem);
  font-weight: 700;
  line-height: .95;
  color: #0d47b7;
  letter-spacing: 0;
}

.result-score p {
  margin-top: .4rem;
  color: #466083;
  font-size: 1.05rem;
  font-weight: 600;
}

.result-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .75rem;
  margin-top: 1.35rem;
}

.result-stat {
  min-height: 128px;
  display: grid;
  grid-template-rows: auto auto;
  align-items: center;
  justify-content: center;
  justify-items: center;
  place-items: center;
  text-align: center;
  gap: .5rem;
  padding: .85rem;
  border: 1px solid #d1e0f1;
  border-radius: 10px;
  background: #fff;
}

.result-stat-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  justify-self: center;
  flex: none;
  margin-inline: auto;
  border-radius: 50%;
  color: #0e56a8;
  background: var(--blue-wash);
}

.result-stat > div {
  width: 100%;
  display: grid;
  justify-items: center;
  text-align: center;
}

.result-stat-icon svg {
  width: 27px;
  height: 27px;
}

.result-stat span {
  display: block;
  color: #5a7193;
  font-size: .82rem;
}

.result-stat strong {
  display: block;
  margin-top: .15rem;
  color: #102147;
  font-size: 1rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.result-stat-ok .result-stat-icon {
  color: #047a46;
  background: #dcfce7;
}

.result-stat-ok .result-stat-icon svg {
  width: 30px;
  height: 30px;
}

.result-stat-ok strong {
  color: #05864e;
}

.result-message,
.result-review {
  display: grid;
  grid-template-columns: 70px 1fr;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
  padding: 1rem 1.05rem;
  border: 1px solid #afd2fb;
  border-radius: 10px;
  background: #f3f9ff;
}

.result-message-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--blue);
  background: #e8f2ff;
  border: 1px solid #c9dfff;
  box-shadow: 0 0 0 1px rgba(23, 102, 194, .06);
}

.result-message-icon svg {
  width: 29px;
  height: 29px;
}

.result-message h2,
.result-review h2 {
  font-size: 1.05rem;
  color: #102147;
}

.result-message p,
.result-review p {
  margin-top: .3rem;
  color: #466083;
  font-size: .92rem;
}

.result-review {
  grid-template-columns: 70px 1fr minmax(230px, 280px);
}

.result-review-button {
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .7rem;
  text-decoration: none;
  border-radius: 8px;
  box-shadow: 0 10px 22px rgba(7, 75, 168, .22);
}

.result-button-icon {
  display: inline-grid;
  place-items: center;
  flex: none;
}

.result-security {
  display: flex;
  align-items: center;
  gap: .8rem;
  margin-top: 1.45rem;
  color: #315f9c;
  font-size: .95rem;
  text-align: left;
}

.result-security span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 50%;
  color: var(--blue);
  background: #dfeeff;
  border: 1px solid #bdd8fa;
}

.result-security svg {
  width: 21px;
  height: 21px;
}

.code-input {
  font-family: var(--mono);
  font-size: 1.45rem;
  font-weight: 500;
  letter-spacing: .34em;
  text-align: center;
  text-transform: uppercase;
  padding: .75rem .5rem .75rem .84rem;
}

.brief {
  border-top: 1px solid var(--rule);
  margin-top: 1.25rem;
  padding-top: 1.25rem;
}
.brief dl { display: grid; grid-template-columns: auto 1fr; gap: .4rem 1.25rem; margin: 0; font-size: .9rem; }
.brief dt { color: var(--graphite); }
.brief dd { margin: 0; font-family: var(--mono); font-variant-numeric: tabular-nums; }

.score-badge {
  font-family: var(--mono);
  font-size: 3.4rem;
  font-weight: 600;
  letter-spacing: -.03em;
  color: var(--pine);
  line-height: 1;
  margin: .5rem 0 .25rem;
}

/* ========================================================== STUDENT — exam */

.exam { display: none; min-height: 100vh; flex-direction: column; }
.exam.on { display: flex; }

.exam-bar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 1rem;
  padding: .7rem 1.25rem;
  background: var(--card);
  border-bottom: 1px solid var(--rule);
}
.exam-bar .who { min-width: 0; flex: 1; }
.exam-bar .who strong {
  display: block; font-family: var(--display); font-size: .98rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.exam-bar .who span { font-size: .8rem; color: var(--graphite); }

.clock {
  font-family: var(--mono);
  font-size: 1.5rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
  padding: .15rem .6rem;
  border-radius: var(--radius);
  border: 1px solid var(--rule);
  background: #f6f8f9;
  flex: none;
}
.clock small {
  display: block; font-size: .58rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--graphite); text-align: center;
  margin-top: -.2rem; margin-bottom: .1rem;
}
.clock.low { color: var(--amber); border-color: #e8d5a8; background: var(--amber-wash); }
.clock.critical {
  color: var(--flag); border-color: #e8c4bb; background: var(--flag-wash);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: .55; } }

.exam-body {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 224px;
  gap: 1.75rem;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 5.5rem;
  align-items: start;
}

.paper { min-width: 0; }

.q-head {
  display: flex; align-items: baseline; gap: .75rem;
  margin-bottom: .9rem;
}
.q-head .num {
  font-family: var(--mono); font-size: .78rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--graphite);
}
.q-text {
  font-size: 1.16rem;
  line-height: 1.5;
  margin-bottom: 1.4rem;
  white-space: pre-wrap;
}

.choices { display: flex; flex-direction: column; gap: .55rem; }

.choice {
  display: flex; align-items: flex-start; gap: .8rem;
  padding: .8rem .95rem;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  width: 100%;
  transition: border-color .12s ease, background .12s ease;
}
.choice:hover { border-color: var(--graphite); }
.choice .bubble {
  flex: none;
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--rule);
  display: grid; place-items: center;
  font-family: var(--mono); font-size: .78rem; font-weight: 500;
  color: var(--graphite);
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.choice .label { padding-top: .1rem; }
.choice[aria-checked=true] { border-color: var(--pine); background: var(--pine-wash); }
.choice[aria-checked=true] .bubble { background: var(--pine); border-color: var(--pine); color: #fff; }

.q-nav {
  display: flex; align-items: center; gap: .75rem;
  margin-top: 1.75rem; padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
}
.q-nav .spacer { flex: 1; }

/* ------- signature element: the answer sheet ------- */

.sheet {
  position: sticky; top: 5.2rem;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 1rem;
  box-shadow: var(--shadow);
}
.sheet h3 {
  font-family: var(--mono); font-size: .68rem; font-weight: 500;
  letter-spacing: .16em; text-transform: uppercase; color: var(--graphite);
  margin-bottom: .8rem;
}
.sheet-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 5px;
  max-height: 46vh;
  overflow-y: auto;
  margin-bottom: .9rem;
}
.sheet-cell {
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1.5px solid var(--rule-soft);
  background: #fbfcfd;
  color: var(--graphite);
  font-family: var(--mono); font-size: .66rem; font-variant-numeric: tabular-nums;
  display: grid; place-items: center;
  cursor: pointer; padding: 0;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.sheet-cell:hover { border-color: var(--graphite); }
.sheet-cell.filled { background: var(--pine); border-color: var(--pine); color: #fff; }
.sheet-cell.flagged { border-color: var(--amber); border-width: 2px; }
.sheet-cell.here { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--ink); }

.sheet-tally {
  font-family: var(--mono); font-size: .74rem;
  color: var(--graphite);
  border-top: 1px solid var(--rule-soft);
  padding-top: .7rem;
  display: flex; justify-content: space-between;
}
.sheet-tally b { color: var(--ink); font-weight: 600; }

.sheet-toggle { display: none; }

/* ---------------------------------------------------------------- modal */

.veil {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(19, 27, 38, .45);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 1.25rem;
}
.veil .card { max-width: 440px; width: 100%; box-shadow: var(--shadow-lift); }
.modal-actions { display: flex; gap: .6rem; justify-content: flex-end; margin-top: 1.25rem; }

.student-edit-veil {
  background: rgba(15, 23, 42, .36);
}

body.student-edit-modal-open {
  overflow: hidden;
}

.student-edit-modal {
  width: min(1080px, calc(100vw - 2rem));
  max-height: min(92vh, 920px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #d8e4f0;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(15, 44, 78, .22);
}

.student-edit-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.35rem;
  border-bottom: 1px solid #e5edf7;
  background: linear-gradient(180deg, #fff, #f8fbff);
}

.student-edit-title {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.student-edit-title h2 {
  color: #10243f;
  font-size: 1.35rem;
  letter-spacing: 0;
}

.student-edit-title p,
.student-edit-section-head p {
  margin-top: .25rem;
  color: var(--graphite);
  font-size: .88rem;
}

.modal-close-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: none;
  border: 1px solid #d8e4f0;
  border-radius: 10px;
  background: #fff;
  color: #4d6380;
  cursor: pointer;
}

.modal-close-btn:hover {
  color: var(--blue);
  border-color: var(--blue-line);
  background: var(--blue-wash);
}

.student-edit-modal .notice {
  margin: 1rem 1.35rem 0;
}

.student-edit-body {
  display: grid;
  gap: 1rem;
  overflow-y: auto;
  padding: 1rem 1.35rem 1.15rem;
  background: #f6f9fd;
}

.student-edit-section {
  padding: 1rem;
  border: 1px solid #dce7f4;
  border-radius: 12px;
}

.student-edit-section.personal {
  border-color: #dcebff;
  background: #f5f9ff;
}

.student-edit-section.academic {
  border-color: #e8e1ff;
  background: #f8f6ff;
}

.student-edit-section.emergency {
  border-color: #d8f2e7;
  background: #f3fbf8;
}

.student-edit-section.notes {
  border-color: #e2e8f0;
  background: #f8fafc;
}

.student-edit-section-head {
  margin-bottom: .9rem;
}

.student-edit-section-head h3,
.student-edit-note-row,
.edit-reset-btn,
.student-edit-save {
  display: flex;
  align-items: center;
  gap: .45rem;
}

.student-edit-section-head h3 {
  color: #10243f;
  font-size: 1rem;
  letter-spacing: 0;
}

.student-edit-grid {
  display: grid;
  gap: .85rem;
}

.student-edit-grid + .student-edit-grid {
  margin-top: .85rem;
}

.student-edit-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.student-edit-field {
  display: grid;
  gap: .38rem;
  margin: 0;
}

.student-edit-field span {
  color: #344b68;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.student-edit-field input,
.student-edit-field select,
.student-edit-field textarea {
  min-height: 42px;
  border-color: #d8e4f0;
  border-radius: 10px;
  background: #fff;
  font-family: var(--body);
  font-size: .94rem;
}

.student-edit-field textarea {
  min-height: 108px;
  line-height: 1.55;
  resize: vertical;
}

.student-edit-field small {
  min-height: 16px;
  color: #b42318;
  font-size: .75rem;
}

.student-edit-field.invalid input,
.student-edit-field.invalid select,
.student-edit-field.invalid textarea {
  border-color: #e18b80;
  box-shadow: 0 0 0 3px rgba(220, 55, 45, .1);
}

.student-edit-note-row {
  justify-content: space-between;
  gap: 1rem;
  margin-top: .5rem;
  color: #5f7288;
  font-size: .82rem;
}

.student-edit-note-row small {
  flex: none;
  color: #6f8197;
}

.student-edit-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.35rem;
  border-top: 1px solid #e5edf7;
  background: #fff;
}

.student-edit-footer-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .6rem;
}

.edit-reset-btn {
  color: #55708f;
}

.student-edit-save {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

@media (max-width: 860px) {
  .student-edit-modal {
    width: min(760px, calc(100vw - 1.4rem));
  }
  .student-edit-grid.three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .veil.student-edit-veil {
    padding: .5rem;
    align-items: stretch;
  }
  .student-edit-modal {
    width: 100%;
    max-height: calc(100vh - 1rem);
    border-radius: 14px;
  }
  .student-edit-header,
  .student-edit-footer {
    padding: 1rem;
  }
  .student-edit-body {
    padding: .85rem 1rem 1rem;
  }
  .student-edit-title {
    align-items: flex-start;
  }
  .student-edit-title .student-profile-icon {
    width: 56px;
    height: 56px;
  }
  .student-edit-grid.three,
  .student-edit-grid.two {
    grid-template-columns: 1fr;
  }
  .student-edit-footer {
    display: grid;
  }
  .student-edit-footer-actions {
    display: grid;
    width: 100%;
  }
  .student-edit-footer .btn {
    width: 100%;
    justify-content: center;
  }
}

.export-modal {
  max-width: 560px !important;
}

.export-modal .modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.export-format-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .7rem;
  margin-top: 1rem;
}

.export-format {
  position: relative;
  display: grid;
  gap: .25rem;
  align-content: start;
  min-height: 112px;
  border: 1px solid #d8e4f5;
  border-radius: 8px;
  padding: .85rem;
  color: #17376b;
  background: #fff;
  cursor: pointer;
}

.export-format input {
  position: absolute;
  top: .7rem;
  right: .7rem;
}

.export-format svg {
  color: #0b5be7;
}

.export-format small {
  color: #526b93;
  font-size: .78rem;
}

.export-format.is-recommended {
  background: #eef5ff;
  border-color: #8eb8ff;
}

.export-format.is-recommended::after {
  content: "Recommended";
  position: absolute;
  left: .75rem;
  bottom: .65rem;
  color: #0b5be7;
  font-size: .68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.export-scope {
  display: grid;
  gap: .45rem;
  border: 1px solid #e0e9f6;
  border-radius: 8px;
  padding: .8rem;
  margin-top: 1rem;
  background: #fbfdff;
}

.export-scope label {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .9rem;
  color: #17376b;
}

.export-count {
  margin-top: .9rem;
  color: #526b93;
  font-size: .9rem;
}

.toast {
  position: fixed; left: 50%; bottom: 1.5rem; z-index: 60;
  transform: translateX(-50%);
  background: var(--ink); color: #fff;
  font-size: .87rem; padding: .6rem 1rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift);
}
.toast.bad { background: var(--flag); }

/* ==================================================== INSTRUCTOR interface */

.top {
  background: var(--card);
  border-bottom: 1px solid var(--rule);
  padding: .8rem 1.5rem;
  display: flex; align-items: center; gap: 1rem;
  position: sticky; top: 0; z-index: 20;
}
.top .brand { font-family: var(--display); font-weight: 700; font-size: 1rem; letter-spacing: -.01em; }
.top .spacer { flex: 1; }
.top .who { font-family: var(--mono); font-size: .8rem; color: var(--graphite); }

.wrap { max-width: 1080px; margin: 0 auto; padding: 1.75rem 1.5rem 4rem; }

.page-head {
  display: flex; align-items: flex-end; gap: 1rem;
  margin-bottom: 1.5rem; flex-wrap: wrap;
}
.page-head .spacer { flex: 1; }

.quiz-list { display: grid; gap: .8rem; }

.quiz-row {
  display: flex; align-items: center; gap: 1.25rem;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  cursor: pointer;
  transition: border-color .14s ease, box-shadow .14s ease;
}
.quiz-row:hover { border-color: var(--graphite); box-shadow: var(--shadow); }
.quiz-row .code {
  font-family: var(--mono); font-size: 1.02rem; font-weight: 500;
  letter-spacing: .12em; color: var(--ink);
  background: #f4f7f8; border: 1px solid var(--rule-soft);
  padding: .4rem .6rem; border-radius: var(--radius); flex: none;
}
.quiz-row .main { flex: 1; min-width: 0; }
.quiz-row .main strong { display: block; font-family: var(--display); font-size: 1rem; }
.quiz-row .main span { font-size: .82rem; color: var(--graphite); }
.quiz-row .stat { text-align: right; flex: none; }
.quiz-row .stat b { font-family: var(--mono); font-size: 1.1rem; font-weight: 600; display: block; }
.quiz-row .stat span { font-size: .72rem; color: var(--graphite); letter-spacing: .04em; text-transform: uppercase; }

.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--rule); margin-bottom: 1.5rem; }
.tab {
  background: none; border: none; cursor: pointer;
  font: inherit; font-size: .9rem; font-weight: 600;
  color: var(--graphite);
  padding: .6rem .9rem;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab:hover { color: var(--ink); }
.tab.on { color: var(--pine); border-bottom-color: var(--pine); }

.share-strip {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  background: var(--pine-wash);
  border: 1px solid #bcd8ce;
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}
.share-strip .big-code {
  font-family: var(--mono); font-size: 1.9rem; font-weight: 600;
  letter-spacing: .18em; color: var(--pine-deep); line-height: 1;
}
.share-strip .link {
  font-family: var(--mono); font-size: .82rem; color: var(--pine-deep);
  word-break: break-all; flex: 1; min-width: 200px;
}

table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th {
  text-align: left; font-family: var(--mono); font-weight: 500;
  font-size: .7rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--graphite);
  padding: .55rem .7rem;
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}
td { padding: .65rem .7rem; border-bottom: 1px solid var(--rule-soft); vertical-align: top; }
tbody tr:hover { background: #f7f9fa; }
td.num { font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }

.bar {
  height: 5px; border-radius: 3px; background: var(--rule-soft);
  overflow: hidden; min-width: 60px; margin-top: .35rem;
}
.bar i { display: block; height: 100%; background: var(--pine); border-radius: 3px; }
.bar.low i { background: var(--flag); }

.q-item {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: .9rem 1.1rem;
  margin-bottom: .6rem;
}
.q-item .row { display: flex; gap: .8rem; align-items: flex-start; }
.q-item .idx {
  font-family: var(--mono); font-size: .78rem; color: var(--graphite);
  flex: none; padding-top: .15rem; min-width: 1.8rem;
}
.q-item .body { flex: 1; min-width: 0; }
.q-item .stem { font-weight: 500; margin-bottom: .5rem; }
.q-item ol { margin: 0; padding-left: 1.4rem; font-size: .87rem; color: var(--ink-soft); }
.q-item ol li { padding: .1rem 0; }
.q-item ol li.right { color: var(--pine-deep); font-weight: 600; }
.q-item ol li.right::after { content: ' ✓'; }
.q-item .tools { display: flex; gap: .8rem; flex: none; }

.empty {
  text-align: center;
  padding: 3rem 1.5rem;
  border: 1px dashed var(--rule);
  border-radius: var(--radius-lg);
  color: var(--graphite);
}
.empty h3 { color: var(--ink); margin-bottom: .4rem; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: start; }

.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem; margin-bottom: 1.5rem; }
.stat-box {
  background: var(--card); border: 1px solid var(--rule);
  border-radius: var(--radius-lg); padding: .9rem 1rem;
}
.stat-box b {
  display: block; font-family: var(--mono); font-size: 1.5rem;
  font-weight: 600; letter-spacing: -.02em; line-height: 1.2;
}
.stat-box span { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--graphite); }

/* -------------------------------------------------------- courses dashboard */

.courses-page {
  color: #0b1d44;
  max-width: 1180px;
  margin: 0 auto;
}

.courses-page svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.course-page-head {
  display: flex;
  align-items: flex-end;
  gap: .85rem;
  margin-bottom: 1.45rem;
  flex-wrap: wrap;
}

.course-page-head h1 {
  margin-top: .35rem;
  color: #081b45;
  font-size: 2.6rem;
  letter-spacing: 0;
}

.course-khmer-subtitle {
  margin-top: .35rem;
  color: #587391;
  font-size: .98rem;
}

.course-page-head .spacer {
  flex: 1;
}

.course-primary-btn,
.course-secondary-btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  border-radius: 8px;
  padding: .65rem 1.05rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, box-shadow .16s ease, transform .08s ease;
}

.course-primary-btn {
  color: #fff;
  border: 1px solid var(--blue-deep);
  background: #1766c2;
  box-shadow: 0 12px 24px rgba(13, 85, 199, .22);
}

.course-secondary-btn {
  color: var(--blue-deep);
  border: 1px solid #c5d8ef;
  background: #fff;
}

.course-primary-btn:hover,
.course-secondary-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.course-overview-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(340px, .92fr);
  gap: 1.05rem;
  margin-bottom: 1.05rem;
}

.course-panel {
  background: rgba(255, 255, 255, .94);
  border: 1px solid #d7e5f4;
  border-radius: 8px;
  box-shadow: 0 16px 42px rgba(20, 66, 119, .07), 0 1px 3px rgba(20, 66, 119, .05);
  padding: 1.15rem;
}

.course-panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .9rem;
}

.course-panel-title h2 {
  color: #082052;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0;
}

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

.course-summary-card {
  min-height: 148px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1rem;
  border: 1px solid #dfeaf6;
  border-radius: 8px;
  background: #fbfdff;
}

.course-summary-card span,
.course-info-list > button > span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  color: var(--blue);
  background: #edf6ff;
  border: 1px solid #d8e9fb;
}

.course-summary-card p {
  color: #607692;
  font-size: .84rem;
  font-weight: 700;
}

.course-summary-card strong {
  color: #081b45;
  font-family: var(--display);
  font-size: 2.08rem;
  line-height: 1;
  letter-spacing: 0;
}

.course-summary-card small {
  color: #7a8ca4;
  font-size: .78rem;
}

.course-info-list {
  display: grid;
  gap: .45rem;
}

.course-info-list button {
  display: grid;
  grid-template-columns: 42px 1fr 22px;
  align-items: center;
  gap: .75rem;
  width: 100%;
  padding: .7rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.course-info-list button:hover {
  background: #f5f9ff;
  border-color: #dce8f5;
}

.course-info-list strong {
  display: block;
  color: #102854;
  font-size: .9rem;
  line-height: 1.25;
}

.course-info-list p {
  margin-top: .1rem;
  color: #607692;
  font-size: .81rem;
  line-height: 1.35;
}

.course-info-list button > svg {
  color: #7c91ad;
}

.course-toolbar {
  display: grid;
  grid-template-columns: minmax(310px, 1fr) 190px 170px;
  gap: .8rem;
  align-items: center;
  margin-bottom: 1.1rem;
  padding: .9rem;
  border: 1px solid #d7e5f4;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(20, 66, 119, .055);
}

.course-search {
  position: relative;
  display: flex;
  align-items: center;
  margin: 0;
}

.course-search span {
  position: absolute;
  left: .85rem;
  color: #6883a4;
  pointer-events: none;
}

.course-search input,
.course-toolbar select {
  min-height: 48px;
  border-color: #c9d9ed;
  border-radius: 8px;
  background: #fff;
  color: #0b1d44;
  font-size: .92rem;
}

.course-search input {
  padding-left: 2.65rem;
}

.course-search input:focus,
.course-toolbar select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-ring);
}

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

.course-card {
  position: relative;
  overflow: hidden;
  border: 1px solid #d8e5f2;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(18, 58, 104, .08), 0 1px 3px rgba(18, 58, 104, .05);
  cursor: pointer;
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}

.course-card:hover {
  transform: translateY(-2px);
  border-color: #abc6e8;
  box-shadow: 0 18px 42px rgba(17, 44, 84, .12), 0 2px 6px rgba(17, 44, 84, .08);
}

.course-card-banner {
  position: relative;
  min-height: 184px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: .8rem;
  padding: 1rem;
  overflow: hidden;
  color: #fff;
}

.course-card-banner::before,
.course-card-banner::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.course-card-banner::before {
  width: 180px;
  height: 180px;
  right: -56px;
  top: -54px;
  background: rgba(255, 255, 255, .18);
}

.course-card-banner::after {
  width: 128px;
  height: 128px;
  right: 24px;
  bottom: -38px;
  border: 1px solid rgba(255, 255, 255, .28);
}

.course-card-banner.nursing { background: linear-gradient(135deg, #1766c2 0%, #0d8db0 100%); }
.course-card-banner.anatomy { background: linear-gradient(135deg, #255fc8 0%, #6c71d8 100%); }
.course-card-banner.lab { background: linear-gradient(135deg, #0873a9 0%, #13a28e 100%); }
.course-card-banner.medicine { background: linear-gradient(135deg, #1b65c8 0%, #5f86dd 100%); }
.course-card-banner.assessment { background: linear-gradient(135deg, #1469b8 0%, #2e9db8 100%); }
.course-card-banner.surgical { background: linear-gradient(135deg, #165ca8 0%, #5790ca 100%); }
.course-card-banner.community { background: linear-gradient(135deg, #0e7c9d 0%, #2aa174 100%); }
.course-card-banner.maternal { background: linear-gradient(135deg, #1e6abd 0%, #9b74cb 100%); }

.course-banner-copy,
.course-banner-art {
  position: relative;
  z-index: 1;
}

.course-banner-copy span {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  margin-bottom: .65rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .28);
  backdrop-filter: blur(8px);
}

.course-banner-copy span svg {
  width: 34px;
  height: 34px;
}

.course-card-banner p {
  color: rgba(255, 255, 255, .88);
  font-size: .8rem;
  font-weight: 700;
}

.course-banner-art {
  width: 124px;
  height: 122px;
  margin: 0 .2rem .1rem 0;
  flex: none;
}

.course-banner-art i,
.course-banner-art b,
.course-banner-art small {
  position: absolute;
  display: block;
}

.course-art-plate {
  inset: 22px 9px 6px 9px;
  border-radius: 18px;
  background: rgba(255, 255, 255, .2);
  border: 1px solid rgba(255, 255, 255, .34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .24), 0 18px 28px rgba(2, 26, 68, .12);
}

.course-banner-art b {
  right: 30px;
  bottom: 34px;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: #fff;
  color: var(--blue-deep);
  box-shadow: 0 14px 26px rgba(0, 33, 80, .18);
}

.course-banner-art b svg {
  width: 32px;
  height: 32px;
}

.course-art-line {
  left: 24px;
  width: 70px;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .5);
}

.course-art-line.line-a { top: 38px; }
.course-art-line.line-b { top: 52px; width: 48px; opacity: .65; }

.course-art-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .7);
}

.course-art-dot.dot-a { right: 16px; top: 18px; }
.course-art-dot.dot-b { left: 12px; bottom: 18px; width: 9px; height: 9px; opacity: .72; }

.course-banner-art small {
  max-width: 88px;
  padding: .25rem .45rem;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 999px;
  background: rgba(255, 255, 255, .18);
  color: rgba(255, 255, 255, .92);
  font-size: .62rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.course-banner-art .cue-a { top: 4px; left: 5px; }
.course-banner-art .cue-b { right: 0; bottom: 4px; }

.course-menu-btn {
  position: absolute;
  top: .75rem;
  right: .75rem;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, .38);
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, .14);
  cursor: pointer;
}

.course-menu-btn:hover {
  background: rgba(255, 255, 255, .24);
}

.course-menu {
  position: absolute;
  z-index: 10;
  top: 3rem;
  right: .75rem;
  min-width: 155px;
  padding: .35rem;
  border: 1px solid #d5e3f3;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-lift);
}

.course-menu button {
  display: block;
  width: 100%;
  padding: .5rem .6rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #17345f;
  font: inherit;
  font-size: .85rem;
  text-align: left;
  cursor: pointer;
}

.course-menu button:hover {
  background: #f2f7ff;
}

.course-menu button.danger {
  color: var(--flag);
}

.course-card-body {
  display: grid;
  gap: .58rem;
  padding: 1rem 1rem 1.05rem;
}

.course-badge {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: .22rem .55rem;
  border-radius: 999px;
  background: #eaf3ff;
  color: var(--blue-deep);
  font-size: .76rem;
  font-weight: 800;
}

.course-card-body h2 {
  min-height: 2.45em;
  color: #0b1d44;
  font-size: 1.04rem;
  letter-spacing: 0;
}

.course-khmer-name {
  min-height: 2.5em;
  color: #5d7190;
  font-size: .86rem;
  line-height: 1.35;
}

.course-card-meta {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .8rem;
  padding-top: .65rem;
  border-top: 1px solid #e2edf8;
}

.course-card-meta span {
  display: grid;
  gap: .1rem;
  color: #0b1d44;
  font-family: var(--mono);
  font-size: .83rem;
}

.course-card-meta b {
  color: #7487a2;
  font-family: var(--body);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.course-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  margin-top: 1.3rem;
  padding: .35rem;
  flex-wrap: wrap;
}

.course-pagination button {
  display: grid;
  place-items: center;
  min-width: 38px;
  height: 38px;
  border: 1px solid #cbdcf0;
  border-radius: 8px;
  color: var(--blue-deep);
  background: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.course-pagination button.on {
  color: #fff;
  border-color: var(--blue-deep);
  background: var(--blue);
}

.course-pagination button[disabled] {
  opacity: .45;
  cursor: not-allowed;
}

.course-pagination label {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin-left: .5rem;
  color: #607692;
  font-size: .85rem;
}

.course-pagination select {
  width: auto;
  min-height: 38px;
  border-radius: 8px;
}

/* ------------------------------------------------------------- responsive */

@media (max-width: 860px) {
  .course-overview-layout {
    grid-template-columns: 1fr;
  }
  .course-summary-grid,
  .course-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .course-toolbar {
    grid-template-columns: 1fr;
  }
  .verification-shell { padding: 1rem; align-items: start; }
  .start-header {
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
  }
  .start-header-rule { display: none; }
  .start-main { padding: 2rem 1rem 3rem; }
  .start-card { padding: 1.6rem; }
  .result-header {
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 1rem 1.25rem;
  }
  .result-card {
    padding: 1.5rem;
  }
  .result-stat-grid {
    grid-template-columns: 1fr;
  }
  .result-review {
    grid-template-columns: 74px 1fr;
  }
  .result-review-button {
    grid-column: 1 / -1;
    width: 100%;
  }
  .portal-card {
    min-height: 0;
    grid-template-columns: 1fr;
    border-radius: 18px;
  }
  .portal-left {
    min-height: 430px;
    padding: 2rem;
  }
  .portal-intro { margin-top: 3rem; }
  .portal-right { padding: 2.25rem 2rem; }
  .profile-head,
  .student-identity,
  .identity-contact { align-items: flex-start; }
  .profile-grid,
  .student-detail-layout { grid-template-columns: 1fr; }
  .student-info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .missed-card { position: static; }
  .student-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reg-grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .exam-body { grid-template-columns: 1fr; padding-bottom: 1.5rem; }
  .split, .field-row { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }

  .sheet { position: static; order: -1; }
  .sheet-grid { grid-template-columns: repeat(10, 1fr); max-height: 30vh; }
  .sheet.folded .sheet-grid, .sheet.folded .sheet-tally { display: none; }
  .sheet-toggle {
    display: block; width: 100%; background: none; border: none;
    font: inherit; font-size: .85rem; font-weight: 600; color: var(--pine);
    cursor: pointer; text-align: left; padding: 0;
  }
  .sheet h3 { display: none; }

  .quiz-row { flex-wrap: wrap; gap: .75rem 1rem; }
  .exam-bar { padding: .6rem .9rem; }
  .clock { font-size: 1.25rem; }
  h1 { font-size: 1.5rem; }
  .wrap { padding: 1.25rem 1rem 3rem; }
  .table-scroll { overflow-x: auto; }
}

@media (max-width: 560px) {
  .course-page-head {
    align-items: stretch;
  }
  .course-page-head .spacer {
    display: none;
  }
  .course-primary-btn,
  .course-secondary-btn {
    width: 100%;
  }
  .course-summary-grid,
  .course-grid {
    grid-template-columns: 1fr;
  }
  .course-card-banner {
    min-height: 170px;
  }
  .course-card-meta {
    grid-template-columns: 1fr 1fr;
  }
  .verification-shell { padding: 0; background: #fff; }
  .start-shell { background: #f3f8fe; }
  .start-header {
    min-height: 0;
    display: grid;
    padding: 1rem;
  }
  .start-brand img { width: 54px; height: 54px; }
  .start-brand strong { font-size: 1.55rem; }
  .start-brand span { font-size: .82rem; }
  .start-portal { font-size: 1rem; }
  .start-main { padding: 1rem .85rem 2rem; }
  .start-card {
    border-radius: 12px;
    padding: 1.2rem;
  }
  .start-card h1 { font-size: 1.9rem; }
  .start-row {
    grid-template-columns: 38px 1fr;
    gap: .25rem .85rem;
    padding: .75rem 0;
  }
  .start-row strong {
    grid-column: 2;
    font-size: .98rem;
  }
  .start-note {
    align-items: flex-start;
    gap: .8rem;
    font-size: .92rem;
    padding: .9rem;
  }
  .start-note-icon {
    width: 32px;
    height: 32px;
  }
  .start-note-icon svg {
    width: 23px;
    height: 23px;
  }
  .start-actions {
    grid-template-columns: 1fr;
  }
  .start-begin {
    width: 100%;
    justify-self: stretch;
    order: -1;
  }
  .result-shell::before {
    background-size: 115vw auto;
  }
  .result-header {
    display: grid;
  }
  .result-brand {
    gap: .75rem;
  }
  .result-brand img {
    width: 54px;
    height: 54px;
  }
  .result-brand strong {
    font-size: 1.6rem;
  }
  .result-brand-rule {
    display: none;
  }
  .result-brand div span,
  .result-brand div b {
    font-size: .82rem;
  }
  .result-student {
    width: 100%;
    min-width: 0;
  }
  .result-main {
    padding: 1rem .85rem 2rem;
  }
  .result-card {
    border-radius: 13px;
    padding: 1.15rem;
  }
  .result-success h1 {
    font-size: 1.55rem;
  }
  .result-score div {
    font-size: 3rem;
  }
  .result-message,
  .result-review {
    grid-template-columns: 1fr;
    justify-items: start;
  }
  .result-message-icon {
    width: 50px;
    height: 50px;
  }
  .portal-card { border-radius: 0; box-shadow: none; }
  .portal-left { min-height: auto; padding: 1.5rem; }
  .school-lockup img { width: 62px; height: 62px; }
  .portal-intro { margin-top: 2.2rem; }
  .portal-intro h1 { font-size: 2rem; }
  .quiz-info-card { margin-top: 2.4rem; border-radius: 14px; }
  .portal-right { padding: 2rem 1.5rem 2.5rem; }
  .portal-right h2 { font-size: 1.85rem; }
  .profile-head,
  .student-identity,
  .identity-name-row,
  .detail-grid,
  .detail-grid.three,
  .student-info-grid,
  .student-summary-grid,
  .reg-grid.two,
  .reg-grid.three,
  .summary-grid { grid-template-columns: 1fr; }
  .registration-top {
    display: grid;
    justify-items: start;
  }
  .registration-login {
    margin-left: 0;
    flex-wrap: wrap;
  }
  .registration-shell {
    padding: 1.25rem 1rem 2rem;
  }
  .registration-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem .5rem;
  }
  .registration-steps::before {
    display: none;
  }
  .registration-title {
    display: grid;
  }
  .registration-card {
    padding: 1rem;
  }
  .registration-actions .btn {
    width: 100%;
  }
  .registration-link-row,
  .registration-link-actions {
    display: grid;
    width: 100%;
  }
  .registration-link-actions .btn {
    width: 100%;
  }
  .profile-head {
    display: grid;
  }
  .student-identity {
    display: grid;
  }
  .edit-student-btn {
    width: 100%;
    justify-content: center;
  }
  .student-profile-card,
  .detail-card,
  .summary-card,
  .instructor-only-note {
    border-radius: 8px;
  }
  .detail-table,
  .detail-table thead,
  .detail-table tbody,
  .detail-table tr,
  .detail-table td {
    display: block;
  }
  .detail-table thead {
    display: none;
  }
  .detail-table tr {
    padding: .85rem 0;
    border-bottom: 1px solid var(--rule-soft);
  }
  .detail-table td {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: .75rem;
    padding: .35rem 0;
    border-bottom: 0;
  }
  .detail-table td::before {
    content: attr(data-label);
    color: var(--graphite);
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* --------------------------------------------------- instructor navigation */

.nav { display: flex; gap: .15rem; margin-left: .5rem; }

.nav-item {
  background: none; border: none; cursor: pointer;
  font: inherit; font-size: .88rem; font-weight: 600;
  color: var(--graphite);
  padding: .4rem .7rem;
  border-radius: var(--radius);
}
.nav-item:hover { color: var(--ink); background: #f2f5f7; }
.nav-item.on { color: var(--pine); background: var(--pine-wash); }

/* Gradebook: many quiz columns, so the name column stays put while you scroll. */
.gradebook { font-size: .86rem; }
.gradebook th:first-child,
.gradebook td:first-child {
  position: sticky; left: 0; background: var(--card);
  border-right: 1px solid var(--rule);
  min-width: 150px;
}
.gradebook tbody tr:hover td:first-child { background: #f7f9fa; }
.gradebook td.score { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.gradebook td.absent { color: var(--rule); text-align: right; }
.gradebook td.avg {
  font-family: var(--mono); font-weight: 600; text-align: right;
  border-left: 1px solid var(--rule);
}

.attendance-list {
  display: grid;
  gap: .55rem;
  margin-top: 1rem;
  max-height: 58vh;
  overflow: auto;
  padding-right: .25rem;
}

.attendance-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto minmax(150px, 240px);
  gap: .75rem;
  align-items: center;
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: .65rem;
}

.attendance-row p { margin: .2rem 0 0; }
.attendance-statuses { display: flex; gap: .35rem; flex-wrap: wrap; }

@media (max-width: 760px) {
  .attendance-row { grid-template-columns: 1fr; }
}

/* A weak signal, so it never looks like a verdict. */
.flagcount {
  font-family: var(--mono); font-size: .78rem;
  color: var(--amber); white-space: nowrap;
}
.flagcount.none { color: var(--rule); }

.bank-topics { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: 1.25rem; }
.topic-chip {
  font: inherit; font-size: .82rem; cursor: pointer;
  background: var(--card); border: 1px solid var(--rule);
  border-radius: 999px; padding: .28rem .8rem; color: var(--ink-soft);
}
.topic-chip:hover { border-color: var(--graphite); }
.topic-chip.on { background: var(--pine); border-color: var(--pine); color: #fff; }
.topic-chip b { font-family: var(--mono); font-weight: 500; opacity: .7; margin-left: .3rem; }

.pick-row { display: flex; align-items: flex-start; gap: .7rem; }
.pick-row input[type=checkbox] { margin-top: .3rem; accent-color: var(--pine); flex: none; }

@media (max-width: 860px) {
  .nav { order: 3; width: 100%; margin: .5rem 0 0; overflow-x: auto; }
  .top { flex-wrap: wrap; }
}

/* ============================================== INSTRUCTOR — BBINS blue skin
   Scoped to body.instructor (instructor.html only) so the student exam and
   join pages keep their own look untouched. Recolors the shared control
   classes (.btn, .nav-item, .tab, inputs, links) from --pine to --blue for
   this page only, and adds the header brand lockup, quiz-card metadata
   pieces, and filter-bar pattern reused across every instructor screen.
   ============================================================================ */

/* .btn is sometimes an <a> (e.g. "Download CSV" links) - the general anchor
   color rule below would otherwise win on specificity and turn its text the
   same blue as its own background. Same for .btn-danger. */
body.instructor .btn { border-color: var(--blue); background: var(--blue); color: #fff; }
body.instructor .btn:hover { background: var(--blue-deep); border-color: var(--blue-deep); }
body.instructor .btn-danger { color: #fff; }
body.instructor .btn-quiet { background: transparent; color: var(--ink-soft); border-color: var(--rule); }
body.instructor .btn-quiet:hover { border-color: var(--blue); color: var(--blue-deep); background: var(--blue-wash); }
body.instructor a,
body.instructor .btn-link { color: var(--blue); }
body.instructor .btn-link.danger { color: var(--flag); }
body.instructor input:focus,
body.instructor textarea:focus,
body.instructor select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-ring); }
body.instructor input[type=text],
body.instructor input[type=password],
body.instructor input[type=number],
body.instructor input[type=date],
body.instructor textarea,
body.instructor select { border-radius: 10px; }
body.instructor .check input { accent-color: var(--blue); }
body.instructor .nav-item.on { color: var(--blue-deep); background: var(--blue-wash); }
body.instructor .tab.on { color: var(--blue); border-bottom-color: var(--blue); }
body.instructor .topic-chip.on { background: var(--blue); border-color: var(--blue); }
body.instructor .pick-row input[type=checkbox] { accent-color: var(--blue); }
body.instructor .notice-info { background: var(--blue-wash); border-color: var(--blue-line); color: var(--blue-deep); }
body.instructor .share-strip { background: var(--blue-wash); border-color: var(--blue-line); }
body.instructor .share-strip .big-code,
body.instructor .share-strip .link { color: var(--blue-deep); }
body.instructor .bar i { background: var(--blue); }
body.instructor { background: #f4f8fd; }

/* -------------------------------------------------- course detail workspace */

.course-detail-page {
  max-width: 1180px;
  margin: 0 auto;
  color: #0b1d44;
}

.course-detail-page svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.course-back-link {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  margin-bottom: 1rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  font: inherit;
  font-size: .92rem;
  font-weight: 700;
  cursor: pointer;
}

.course-back-link svg {
  width: 18px;
  height: 18px;
}

.course-workspace {
  display: grid;
  grid-template-columns: minmax(260px, 300px) minmax(0, 1fr);
  gap: 1.35rem;
  align-items: start;
}

.course-side {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.course-side-card,
.course-side-nav,
.course-hero-card,
.course-overview-card,
.course-quick-panel {
  background: #fff;
  border: 1px solid #d8e5f2;
  border-radius: 16px;
  box-shadow: 0 14px 36px rgba(18, 58, 104, .07), 0 1px 3px rgba(18, 58, 104, .05);
}

.course-side-card {
  overflow: hidden;
}

.course-side-card .course-card-banner {
  min-height: 190px;
  border-radius: 0;
}

.course-side-body {
  display: grid;
  gap: .55rem;
  padding: 1rem;
}

.course-side-body h2 {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: #081b45;
  font-size: 1.08rem;
  letter-spacing: 0;
}

.course-side-body h2 svg {
  width: 20px;
  height: 20px;
  color: var(--blue);
}

.course-side-body p {
  color: #5d7190;
  font-size: .86rem;
  line-height: 1.35;
}

.course-side-meta {
  display: grid;
  gap: .25rem;
  padding-top: .65rem;
  border-top: 1px solid #e4edf7;
  color: #17345f;
  font-family: var(--mono);
  font-size: .82rem;
}

.course-side-meta span {
  display: inline-flex;
  align-items: center;
  gap: .38rem;
}

.course-side-nav,
.course-side-actions {
  display: grid;
  gap: .24rem;
  padding: .65rem;
  border-radius: 14px;
}

.course-side-nav button {
  display: flex;
  align-items: center;
  gap: .65rem;
  width: 100%;
  min-height: 46px;
  padding: .6rem .68rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #38506d;
  font: inherit;
  font-size: .9rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.course-side-nav button span {
  display: grid;
  gap: .08rem;
}

.course-side-nav button b {
  font-size: .9rem;
  line-height: 1.1;
}

.course-side-nav button small {
  color: #7488a1;
  font-family: "Noto Sans Khmer", "Khmer Sangam MN", "Khmer MN", var(--font);
  font-size: .72rem;
  font-weight: 650;
  line-height: 1.25;
}

.course-side-nav button svg {
  width: 18px;
  height: 18px;
  flex: none;
  color: #6f86a3;
}

.course-side-nav button:hover,
.course-side-nav button.on {
  background: #edf6ff;
  color: var(--blue-deep);
}

.course-side-nav button:hover svg,
.course-side-nav button.on svg {
  color: var(--blue);
}

.course-side-actions {
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  border: 1px solid #d8e5f2;
  border-radius: 16px;
  box-shadow: 0 14px 36px rgba(18, 58, 104, .06), 0 1px 3px rgba(18, 58, 104, .04);
}

.course-side-actions > span {
  padding: .3rem .45rem .45rem;
  color: #6b7f99;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.course-side-actions button {
  display: flex;
  align-items: center;
  gap: .55rem;
  min-height: 38px;
  padding: .55rem .65rem;
  border: 1px solid transparent;
  border-radius: 10px;
  background: #fff;
  color: #17345f;
  font: inherit;
  font-size: .84rem;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.course-side-actions button:hover {
  border-color: #c9dcf2;
  background: #f0f7ff;
  color: var(--blue-deep);
}

.course-main {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.course-detail-page .course-main > .course-page-head {
  display: grid;
  gap: .15rem;
  padding: .15rem .1rem .05rem;
  margin-bottom: 0;
}

.course-detail-page .course-main > .course-page-head span {
  color: var(--blue);
  font-size: .76rem;
  font-weight: 900;
  letter-spacing: .12em;
}

.course-detail-page .course-main > .course-page-head p,
.course-section-title p {
  color: #6f839b;
  font-family: "Noto Sans Khmer", "Khmer Sangam MN", "Khmer MN", var(--font);
  font-size: .82rem;
  font-weight: 650;
}

.course-hero-card {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.1rem 1.2rem;
}

.course-landing-hero {
  position: relative;
  overflow: hidden;
  padding: 1.35rem 1.45rem;
  background:
    linear-gradient(135deg, rgba(10, 93, 214, .08), transparent 42%),
    linear-gradient(180deg, #fff, #f9fcff);
}

.course-landing-hero::after {
  content: "";
  position: absolute;
  inset: auto -60px -90px auto;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(10, 93, 214, .12), transparent 68%);
  pointer-events: none;
}

.course-hero-copy {
  position: relative;
  z-index: 1;
}

.course-hero-card h1 {
  color: #081b45;
  font-size: clamp(1.75rem, 2.6vw, 2.35rem);
  letter-spacing: 0;
}

.course-hero-khmer {
  margin-top: .45rem;
  color: #516b8d;
  font-size: 1rem;
}

.course-hero-meta {
  margin-top: .4rem;
  color: #7890aa;
  font-size: .9rem;
}

.course-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: .18rem .62rem;
  border: 1px solid #a9d8c4;
  border-radius: 999px;
  background: #eefbf5;
  color: #1f7b54;
  font-size: .76rem;
  font-weight: 900;
}

.course-hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .9rem;
}

.course-hero-facts span {
  display: inline-flex;
  align-items: center;
  gap: .38rem;
  min-height: 32px;
  padding: .35rem .65rem;
  border: 1px solid #dce8f5;
  border-radius: 999px;
  background: rgba(255,255,255,.8);
  color: #2e4867;
  font-size: .88rem;
}

.course-hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: .55rem;
  flex: none;
  position: relative;
  z-index: 1;
}

.course-hero-menu {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid #c5d8ef;
  border-radius: 50%;
  background: #fff;
  color: #456382;
  cursor: pointer;
}

.course-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 1fr);
  gap: 1rem;
  align-items: start;
}

.course-landing-grid {
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr);
}

.course-dashboard-left {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.course-overview-card,
.course-quick-panel {
  padding: 1.15rem;
}

.course-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  margin-bottom: .9rem;
}

.course-section-title.compact {
  margin-top: 1.05rem;
}

.course-section-title h2 {
  color: #082052;
  font-size: 1.12rem;
  letter-spacing: 0;
}

.course-section-title h3 {
  color: #102854;
  font-size: .98rem;
  letter-spacing: 0;
}

.course-text-action,
.course-link-row {
  border: 0;
  background: transparent;
  color: var(--blue);
  font: inherit;
  font-size: .84rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.course-overview-stats,
.quick-summary-grid {
  display: grid;
  gap: .75rem;
}

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

.course-stat-strip {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.quick-summary-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.detail-stat,
.quick-summary-grid article {
  display: grid;
  gap: .28rem;
  min-height: 116px;
  padding: .9rem;
  border: 1px solid #e0eaf6;
  border-radius: 12px;
  background: #fbfdff;
}

.course-stat-strip .detail-stat {
  min-height: 126px;
  background: linear-gradient(180deg, #fff, #f9fcff);
}

.detail-stat svg {
  width: 28px;
  height: 28px;
}

.detail-stat strong,
.quick-summary-grid strong {
  color: #081b45;
  font-family: var(--display);
  font-size: 1.8rem;
  line-height: 1;
  letter-spacing: 0;
}

.detail-stat span,
.quick-summary-grid span {
  color: #314865;
  font-size: .82rem;
  font-weight: 800;
}

.detail-stat small,
.quick-summary-grid small {
  color: #7287a1;
  font-size: .76rem;
}

.stat-blue svg { color: var(--blue); }
.stat-green svg,
.quick-summary-grid .good strong { color: #20845a; }
.stat-purple svg { color: #7165d8; }
.stat-amber svg { color: #b47712; }
.stat-indigo svg { color: #3255d8; }
.quick-summary-grid .danger strong { color: #b63b2c; }

.course-activity-list {
  display: grid;
  gap: .65rem;
}

.course-task-list {
  display: grid;
  gap: .55rem;
}

.course-task-list button {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  gap: .72rem;
  align-items: center;
  width: 100%;
  min-height: 58px;
  padding: .72rem .78rem;
  border: 1px solid #e0eaf6;
  border-radius: 14px;
  background: #fbfdff;
  color: #17345f;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.course-task-list button:hover {
  border-color: #bfd5ef;
  background: #f3f8ff;
}

.course-task-list i {
  width: 10px;
  height: 36px;
  border-radius: 999px;
  background: var(--blue);
}

.course-task-list i.green { background: #27a66f; }
.course-task-list i.purple { background: #7165d8; }
.course-task-list i.amber { background: #d48b16; }
.course-task-list i.rose { background: #d34d6a; }

.course-task-list b,
.course-shortcut-grid span {
  display: block;
  color: #102854;
  font-size: .9rem;
  font-weight: 900;
}

.course-task-list small {
  display: block;
  margin-top: .12rem;
  color: #6f839b;
  font-size: .78rem;
}

.course-activity-row {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: .75rem;
  align-items: center;
  padding: .75rem 0;
  border-bottom: 1px solid #e4edf7;
}

.course-activity-row:first-child {
  padding-top: 0;
}

.course-activity-row > span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: #edf6ff;
  color: var(--blue);
}

.course-activity-row small,
.quick-list small {
  display: block;
  color: #7488a1;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.course-activity-row strong,
.quick-list strong {
  display: block;
  color: #102854;
  font-size: .92rem;
}

.course-activity-row p {
  color: #5f748f;
  font-size: .81rem;
}

.course-activity-row b {
  padding: .25rem .55rem;
  border-radius: 999px;
  background: #edf6ff;
  color: var(--blue-deep);
  font-size: .72rem;
}

.course-link-row {
  margin-top: .8rem;
  padding: 0;
}

.course-next-session {
  display: grid;
  grid-template-columns: 46px repeat(2, minmax(0, 1fr));
  gap: .75rem;
  align-items: center;
}

.course-next-session > span {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: #edf6ff;
  color: var(--blue);
}

.course-next-session div {
  min-height: 54px;
  padding: .65rem .7rem;
  border: 1px solid #e0eaf6;
  border-radius: 13px;
  background: #fbfdff;
}

.course-next-session small {
  display: block;
  color: #7488a1;
  font-size: .72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.course-next-session strong {
  display: block;
  margin-top: .15rem;
  color: #102854;
  font-size: .9rem;
}

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

.course-shortcut-grid button {
  display: flex;
  align-items: center;
  gap: .65rem;
  min-height: 50px;
  padding: .75rem .8rem;
  border: 1px solid #dce8f5;
  border-radius: 14px;
  background: #fbfdff;
  color: var(--blue-deep);
  font: inherit;
  cursor: pointer;
}

.course-shortcut-grid button:hover {
  border-color: #bcd5f2;
  background: #edf6ff;
}

.course-quick-panel {
  min-width: 0;
}

.course-quick-tabs {
  display: flex;
  gap: .9rem;
  overflow-x: auto;
  border-bottom: 1px solid #dfe9f5;
}

.course-quick-tabs button {
  flex: none;
  padding: .15rem 0 .75rem;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #637995;
  font: inherit;
  font-size: .88rem;
  font-weight: 800;
  cursor: pointer;
}

.course-quick-tabs button.on {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

.course-quick-body {
  padding-top: 1rem;
}

.course-primary-btn.small,
.course-secondary-btn.small {
  min-height: 34px;
  padding: .42rem .7rem;
  font-size: .82rem;
}

.quick-table {
  display: grid;
  border: 1px solid #e0eaf6;
  border-radius: 12px;
  overflow: hidden;
}

.quick-table-head,
.quick-table-row {
  display: grid;
  grid-template-columns: 1fr minmax(120px, 1.35fr) .7fr .7fr .6fr;
  gap: .6rem;
  align-items: center;
}

.quick-table-head {
  padding: .65rem .7rem;
  background: #f5f9fe;
  color: #6c8099;
  font-size: .69rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.quick-table-row {
  width: 100%;
  padding: .72rem .7rem;
  border: 0;
  border-top: 1px solid #e6eef8;
  background: #fff;
  color: #17345f;
  font: inherit;
  font-size: .82rem;
  text-align: left;
  cursor: pointer;
}

.quick-table-row b {
  color: var(--blue);
  font-size: .8rem;
}

.quick-list,
.student-mini-list,
.exam-summary-list {
  display: grid;
  gap: .65rem;
  margin-top: .95rem;
}

.quick-list article,
.student-mini-list article,
.exam-summary-list article {
  display: grid;
  gap: .45rem;
  align-items: center;
  padding: .75rem;
  border: 1px solid #e0eaf6;
  border-radius: 12px;
  background: #fbfdff;
}

.quick-list article {
  grid-template-columns: 1fr auto auto;
}

/* Course overview layout hardening */
.course-detail-page,
.course-detail-page * {
  min-width: 0;
}

.course-detail-page {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

.course-workspace {
  width: 100%;
  max-width: 100%;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  gap: clamp(1rem, 1.5vw, 1.5rem);
}

.course-tools-card {
  border-radius: 18px;
}

.course-tools-card .course-side-body {
  gap: .48rem;
  padding: .95rem;
}

.course-tools-card .course-badge {
  color: var(--blue);
  font-size: .7rem;
  font-weight: 950;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.course-side-body h2 {
  align-items: flex-start;
  max-width: 100%;
  color: #081b45;
  font-size: clamp(1.05rem, 1.3vw, 1.25rem);
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.course-side-body h2 svg {
  margin-top: .06rem;
  flex: none;
}

.course-side-body p,
.course-hero-khmer {
  font-family: "Noto Sans Khmer", "Khmer Sangam MN", "Khmer MN", var(--font);
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.course-side-body p {
  display: -webkit-box;
  max-width: 100%;
  overflow: hidden;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.course-side-meta {
  gap: .38rem;
  padding-top: .6rem;
  font-size: .78rem;
}

.course-side-meta span {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.course-side {
  gap: .8rem;
}

.course-side-nav {
  gap: .18rem;
  padding: .5rem;
}

.course-side-nav button {
  min-height: 44px;
  padding: .48rem .58rem;
  border-radius: 12px;
  gap: .55rem;
}

.course-side-nav button b {
  font-size: .84rem;
}

.course-side-nav button small {
  font-size: .68rem;
  line-height: 1.2;
}

.course-side-actions {
  gap: .18rem;
  padding: .55rem;
}

.course-side-actions button {
  min-height: 38px;
  padding: .48rem .58rem;
}

.course-main {
  width: 100%;
  max-width: 100%;
}

.course-landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, auto);
  align-items: start;
  gap: clamp(1rem, 1.6vw, 1.5rem);
  padding: clamp(1rem, 1.35vw, 1.4rem);
  border-radius: 20px;
}

.course-landing-hero::after {
  opacity: .65;
}

.course-hero-copy {
  width: 100%;
  max-width: 100%;
}

.course-hero-card h1 {
  max-width: 100%;
  color: #071a42;
  font-size: clamp(1.9rem, 3vw, 3.25rem);
  line-height: 1.08;
  overflow-wrap: anywhere;
  word-break: normal;
}

.course-hero-khmer {
  max-width: 100%;
  margin-top: .55rem;
  color: #4f6686;
  font-size: clamp(.92rem, 1.05vw, 1.05rem);
}

.course-hero-meta {
  max-width: 100%;
  margin-top: .55rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.course-hero-facts {
  gap: .42rem;
  margin-top: .75rem;
}

.course-hero-facts span {
  max-width: 100%;
  min-height: 30px;
  padding: .32rem .58rem;
  font-size: .82rem;
  white-space: normal;
}

.course-hero-actions {
  justify-content: flex-end;
  gap: .6rem;
  max-width: 100%;
}

.course-hero-actions .course-primary-btn,
.course-hero-actions .course-secondary-btn {
  min-height: 42px;
  padding-inline: .85rem;
  white-space: nowrap;
}

.course-hero-menu {
  width: 42px;
  height: 42px;
  flex: none;
}

.course-stat-strip {
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: .85rem;
}

.course-stat-strip .detail-stat {
  min-height: 112px;
  padding: .85rem;
  border-radius: 14px;
}

.detail-stat strong,
.quick-summary-grid strong {
  font-size: clamp(1.45rem, 1.7vw, 1.8rem);
}

.course-landing-grid {
  grid-template-columns: minmax(0, 1fr) minmax(300px, .95fr);
  gap: 1rem;
}

.course-overview-card {
  width: 100%;
  max-width: 100%;
  padding: 1rem;
  border-radius: 18px;
}

.course-section-title {
  gap: .7rem;
  margin-bottom: .75rem;
}

.course-section-title > div {
  min-width: 0;
}

.course-section-title h2,
.course-section-title h3,
.course-section-title p {
  overflow-wrap: anywhere;
}

.course-activity-card,
.course-task-card {
  align-self: stretch;
}

.course-activity-list,
.course-task-list {
  gap: .55rem;
}

.course-activity-row {
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: .65rem;
  padding: .62rem 0;
}

.course-activity-row > span {
  width: 38px;
  height: 38px;
}

.course-activity-row strong,
.course-activity-row p,
.course-task-list b,
.course-task-list small {
  overflow-wrap: anywhere;
}

.course-task-list button {
  min-height: 54px;
  padding: .65rem .7rem;
}

.course-next-session {
  grid-template-columns: 42px repeat(4, minmax(115px, 1fr));
  gap: .65rem;
}

.course-next-session > span {
  width: 42px;
  height: 42px;
}

.course-next-session div {
  min-height: 50px;
  padding: .56rem .62rem;
}

.course-next-session strong {
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.course-shortcut-grid {
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: .6rem;
}

.course-shortcut-grid button {
  min-height: 46px;
  padding: .62rem .68rem;
}

.course-gradebook-card {
  overflow: hidden;
}

.course-gradebook-card .empty,
.course-gradebook-card .empty.compact {
  padding: 1rem;
}

.course-danger-row {
  display: flex;
  justify-content: flex-end;
  gap: .8rem;
  flex-wrap: wrap;
  padding: .35rem .2rem 0;
}

@media (max-width: 1280px) {
  .course-workspace {
    grid-template-columns: minmax(230px, 250px) minmax(0, 1fr);
    gap: 1rem;
  }

  .course-landing-hero {
    grid-template-columns: minmax(0, 1fr) minmax(200px, auto);
  }

  .course-hero-card h1 {
    font-size: clamp(1.8rem, 2.55vw, 2.55rem);
  }

  .course-hero-actions .course-primary-btn,
  .course-hero-actions .course-secondary-btn {
    padding-inline: .72rem;
  }

  .course-next-session {
    grid-template-columns: 42px repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1180px) {
  .course-workspace {
    grid-template-columns: minmax(220px, 240px) minmax(0, 1fr);
  }

  .course-landing-hero {
    grid-template-columns: 1fr;
  }

  .course-hero-actions {
    justify-content: flex-start;
  }

  .course-landing-grid {
    grid-template-columns: 1fr;
  }
}

/* Focused course workspace mode */
body.instructor.course-mode {
  overflow-x: hidden;
}

body.instructor.course-mode #view-course {
  background:
    radial-gradient(circle at 82% 8%, rgba(23, 102, 194, .08), transparent 30rem),
    linear-gradient(180deg, #f7fbff 0%, #eef5ff 100%);
}

.course-detail-page {
  animation: courseModeIn 230ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes courseModeIn {
  from { opacity: .01; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

body.instructor.course-mode .course-workspace {
  grid-template-columns: minmax(230px, 270px) minmax(0, 1fr);
  gap: clamp(1rem, 1.5vw, 1.5rem);
}

.course-back-link {
  display: inline-flex;
  align-items: center;
  gap: .48rem;
  min-height: 38px;
  margin-bottom: .85rem;
  padding: .42rem .68rem;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--blue);
  font-size: .9rem;
  font-weight: 850;
  text-decoration: none;
}

.course-back-link:hover {
  border-color: #cfe1f6;
  background: #eef6ff;
}

.course-tools-card {
  border-radius: 22px;
  box-shadow: 0 20px 46px rgba(20, 67, 122, .08), 0 1px 2px rgba(20, 67, 122, .04);
}

.course-side-nav {
  border-radius: 22px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 18px 42px rgba(20, 67, 122, .07), 0 1px 2px rgba(20, 67, 122, .04);
}

.course-side-nav button {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 16px;
  min-height: 48px;
  border-radius: 14px;
}

.course-side-nav button > svg:last-child {
  width: 16px;
  height: 16px;
  color: #9ab0ca;
}

.course-side-nav button.on > svg:last-child,
.course-side-nav button:hover > svg:last-child {
  color: var(--blue);
}

.course-landing-hero {
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr);
  gap: clamp(1rem, 1.6vw, 1.5rem);
  padding: clamp(1rem, 1.7vw, 1.65rem);
  border: 1px solid #dbe8f6;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 22px 52px rgba(20, 67, 122, .08), 0 1px 2px rgba(20, 67, 122, .04);
  overflow: hidden;
}

.course-landing-hero::after {
  content: none;
}

.course-program-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  width: fit-content;
  max-width: 100%;
  margin-bottom: .7rem;
  padding: .32rem .62rem;
  border: 1px solid #cfe1f6;
  border-radius: 999px;
  background: #eef6ff;
  color: var(--blue-deep);
  font-size: .76rem;
  font-weight: 900;
}

.course-hero-card h1 {
  font-size: clamp(1.75rem, 2.7vw, 2.75rem);
}

.course-hero-description {
  display: -webkit-box;
  max-width: 760px;
  margin-top: .7rem;
  overflow: hidden;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  color: #526987;
  font-size: .94rem;
  line-height: 1.62;
}

.course-hero-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(126px, 1fr));
  gap: .55rem;
  margin-top: .9rem;
}

.course-hero-meta-grid > span {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: .08rem .45rem;
  align-items: center;
  min-height: 50px;
  padding: .52rem .58rem;
  border: 1px solid #e0ebf7;
  border-radius: 14px;
  background: #f8fbff;
}

.course-hero-meta-grid svg {
  grid-row: span 2;
  color: var(--blue);
}

.course-hero-meta-grid small {
  display: block;
  color: #7890aa;
  font-size: .68rem;
  font-weight: 850;
  line-height: 1;
  text-transform: uppercase;
}

.course-hero-meta-grid b {
  display: block;
  color: #15355f;
  font-size: .83rem;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.course-status-pill {
  width: fit-content;
  border-color: #bfe7d4;
  background: #ecfbf3;
  color: #147848;
}

.course-status-pill.planning {
  border-color: #bcd8f2;
  background: #edf6ff;
  color: var(--blue-deep);
}

.course-status-pill.closed {
  border-color: #d8e1eb;
  background: #f3f6f9;
  color: #61738a;
}

.course-cover-panel {
  position: relative;
  min-height: 100%;
  height: clamp(260px, 26vw, 390px);
  border-radius: 20px;
  overflow: hidden;
}

.course-cover-panel img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 20px;
}

.course-cover-placeholder {
  display: grid;
  place-items: center;
  align-content: center;
  gap: .62rem;
  width: 100%;
  height: 100%;
  min-height: 260px;
  padding: 1.3rem;
  border: 1.5px dashed #b8d4f4;
  border-radius: 20px;
  background:
    radial-gradient(circle at 50% 25%, rgba(23, 102, 194, .11), transparent 13rem),
    #f1f7ff;
  color: #25517f;
  text-align: center;
}

.course-cover-placeholder > span {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  border-radius: 24px;
  background: #fff;
  color: var(--blue);
  box-shadow: 0 12px 28px rgba(20, 67, 122, .08);
}

.course-cover-placeholder strong {
  color: #0b2553;
  font-size: 1.05rem;
}

.course-cover-placeholder p {
  max-width: 270px;
  color: #5d789b;
  font-size: .88rem;
}

.course-cover-change {
  position: absolute;
  right: .8rem;
  top: .8rem;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  min-height: 34px;
  padding: .38rem .62rem;
  border: 1px solid rgba(255,255,255,.58);
  border-radius: 999px;
  background: rgba(255,255,255,.9);
  color: #123b70;
  font: inherit;
  font-size: .78rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0,0,0,.12);
}

@media (max-width: 1250px) {
  body.instructor.course-mode .course-workspace {
    grid-template-columns: minmax(220px, 240px) minmax(0, 1fr);
  }

  .course-landing-hero {
    grid-template-columns: minmax(0, 1fr) 300px;
  }
}

@media (max-width: 1100px) {
  .course-landing-hero {
    grid-template-columns: 1fr;
  }

  .course-cover-panel {
    height: min(300px, 45vw);
  }
}

/* Course overview card consistency */
.course-detail-page {
  --course-card-bg: #ffffff;
  --course-card-border: #dbe7f6;
  --course-card-shadow: 0 8px 24px rgba(31, 66, 135, .06);
  --course-card-radius: 20px;
  --course-card-pad: clamp(1.25rem, 1.65vw, 1.55rem);
  --course-soft-bg: #f6faff;
  --course-soft-border: #e1ebf7;
  --course-text-strong: #0f2b66;
  --course-text-muted: #607894;
}

.course-side-card,
.course-side-nav,
.course-side-actions,
.course-landing-hero,
.course-overview-card,
.course-stat-strip .detail-stat,
.course-cover-placeholder,
.course-cover-panel.has-image {
  border: 1px solid var(--course-card-border);
  border-radius: var(--course-card-radius);
  background: var(--course-card-bg);
  box-shadow: var(--course-card-shadow);
}

body.instructor.course-mode .course-workspace {
  grid-template-columns: 272px minmax(0, 1fr);
  gap: 1.5rem;
}

.course-side {
  gap: 1rem;
}

.course-tools-card .course-side-body {
  gap: .72rem;
  padding: var(--course-card-pad);
}

.course-tools-card .course-badge,
.course-program-badge {
  min-height: 28px;
  padding: .3rem .64rem;
  border: 1px solid #cfe1f6;
  border-radius: 999px;
  background: #eef6ff;
  color: var(--blue-deep);
  font-size: .7rem;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.course-side-body h2 {
  color: var(--course-text-strong);
  font-size: 1.16rem;
  line-height: 1.22;
}

.course-side-body p {
  color: var(--course-text-muted);
  font-size: .86rem;
  line-height: 1.75;
  -webkit-line-clamp: 4;
}

.course-side-meta {
  gap: .55rem;
  margin-top: .15rem;
  padding-top: .82rem;
  border-top-color: var(--course-soft-border);
  font-family: var(--body);
}

.course-side-meta span,
.course-hero-facts span {
  min-height: 34px;
  padding: .42rem .62rem;
  border: 1px solid var(--course-soft-border);
  border-radius: 999px;
  background: var(--course-soft-bg);
  color: #29486c;
  font-size: .82rem;
  font-weight: 800;
}

.course-side-meta svg,
.course-hero-facts svg {
  color: var(--blue);
}

.course-side-nav,
.course-side-actions {
  padding: .72rem;
  box-shadow: var(--course-card-shadow);
}

.course-side-nav button {
  min-height: 50px;
  padding: .52rem .6rem;
  border-radius: 14px;
  color: #2f4b70;
}

.course-side-nav button span {
  gap: .1rem;
}

.course-side-nav button b {
  color: inherit;
  font-size: .86rem;
}

.course-side-nav button small {
  color: #7c90aa;
  font-size: .7rem;
  line-height: 1.25;
}

.course-side-nav button:hover,
.course-side-nav button.on {
  background: #edf6ff;
  color: var(--blue-deep);
}

.course-side-actions > span {
  color: var(--blue);
}

.course-side-actions button {
  min-height: 42px;
  border-radius: 14px;
  background: var(--course-soft-bg);
}

.course-landing-hero {
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 360px);
  gap: clamp(1.25rem, 1.9vw, 1.75rem);
  align-items: stretch;
  padding: clamp(1.45rem, 1.9vw, 1.75rem);
  box-shadow: var(--course-card-shadow);
}

.course-hero-card h1 {
  color: var(--course-text-strong);
  font-size: clamp(2.125rem, 3vw, 3.5rem);
  line-height: 1.06;
  letter-spacing: -.02em;
}

.course-hero-khmer {
  color: #526b8b;
  font-size: clamp(.98rem, 1.05vw, 1.08rem);
  line-height: 1.8;
}

.course-hero-description {
  max-width: 820px;
  color: var(--course-text-muted);
  font-size: .96rem;
  line-height: 1.65;
}

.course-hero-meta-grid {
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: .75rem;
  margin-top: 1rem;
}

.course-hero-meta-grid > span {
  min-height: 72px;
  padding: .68rem .72rem;
  border: 1px solid var(--course-soft-border);
  border-radius: 16px;
  background: var(--course-soft-bg);
}

.course-hero-meta-grid small {
  color: #7188a4;
  font-size: .67rem;
  letter-spacing: .06em;
}

.course-hero-meta-grid b {
  color: var(--course-text-strong);
  font-size: .88rem;
}

.course-status-pill {
  min-height: 26px;
  padding: .22rem .58rem;
  border-radius: 999px;
  font-size: .78rem;
}

.course-hero-facts {
  gap: .55rem;
  margin-top: 1rem;
}

.course-hero-actions {
  justify-content: flex-start;
  gap: .65rem;
  margin-top: 1rem;
}

.course-hero-actions .course-primary-btn,
.course-hero-actions .course-secondary-btn {
  min-height: 44px;
  border-radius: 14px;
  font-weight: 900;
}

.course-cover-panel {
  height: auto;
  min-height: 100%;
  border-radius: var(--course-card-radius);
  box-shadow: none;
}

.course-cover-panel img {
  border-radius: var(--course-card-radius);
}

.course-cover-placeholder {
  min-height: 100%;
  padding: 1.35rem;
  border-style: dashed;
  border-color: #b8d4f4;
  box-shadow: none;
  background:
    radial-gradient(circle at 50% 24%, rgba(23, 102, 194, .1), transparent 12rem),
    #f2f7ff;
}

.course-cover-placeholder > span {
  width: 70px;
  height: 70px;
  border-radius: 20px;
  border: 1px solid #e0ebf7;
  box-shadow: var(--course-card-shadow);
}

.course-cover-placeholder strong {
  color: var(--course-text-strong);
}

.course-cover-placeholder p {
  color: var(--course-text-muted);
  line-height: 1.45;
}

.course-stat-strip {
  gap: 1rem;
}

.course-stat-strip .detail-stat {
  position: relative;
  min-height: 126px;
  padding: 1rem;
  background: #fff;
  box-shadow: var(--course-card-shadow);
  overflow: hidden;
}

.course-stat-strip .detail-stat::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: currentColor;
  opacity: .55;
}

.course-stat-strip .detail-stat svg {
  width: 26px;
  height: 26px;
  padding: .28rem;
  border-radius: 10px;
  background: #eef6ff;
}

.course-stat-strip .detail-stat strong {
  color: var(--course-text-strong);
  font-size: clamp(1.65rem, 1.9vw, 2rem);
}

.course-stat-strip .detail-stat span {
  color: #334d70;
}

.course-stat-strip .detail-stat small {
  color: #7b8fa8;
  line-height: 1.45;
}

.course-overview-card {
  padding: var(--course-card-pad);
  border-radius: var(--course-card-radius);
  box-shadow: var(--course-card-shadow);
}

.course-section-title h2 {
  color: var(--course-text-strong);
}

.course-section-title p {
  color: #758ba6;
  line-height: 1.55;
}

.course-activity-row > span,
.course-next-session > span,
.course-shortcut-grid button,
.course-task-list button,
.course-next-session div {
  border: 1px solid var(--course-soft-border);
  border-radius: 16px;
  background: var(--course-soft-bg);
}

@media (max-width: 1360px) {
  .course-hero-meta-grid {
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  }
}

@media (max-width: 1280px) {
  body.instructor.course-mode .course-workspace {
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 1rem;
  }

  .course-landing-hero {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 320px);
  }

  .course-hero-card h1 {
    font-size: clamp(2rem, 2.75vw, 2.7rem);
  }
}

@media (max-width: 1120px) {
  .course-landing-hero {
    grid-template-columns: 1fr;
  }

  .course-cover-panel {
    min-height: 280px;
  }
}

.quick-list article > span,
.exam-summary-list span {
  color: #6f839b;
  font-size: .8rem;
}

.quick-list article > b {
  color: var(--blue);
  font-size: .8rem;
}

.student-mini-list article {
  grid-template-columns: 40px 1fr auto;
}

.student-mini-list article > span {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #edf6ff;
  color: var(--blue-deep);
  font-family: var(--mono);
  font-size: .78rem;
  font-weight: 800;
}

.student-mini-list small {
  display: block;
  margin-top: .1rem;
  color: #6f839b;
  font-size: .78rem;
}

.student-mini-list b {
  color: #20845a;
  font-size: .78rem;
  text-transform: capitalize;
}

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

.exam-summary-list article {
  align-content: start;
}

.exam-summary-list strong {
  color: #102854;
  font-size: .96rem;
}

.course-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin-top: 1rem;
}

.course-gradebook-card {
  overflow: hidden;
}

.course-danger-row {
  padding: .5rem 0 0;
}

.empty.compact {
  padding: 1rem;
}

.attendance-page .course-workspace {
  grid-template-columns: minmax(220px, 22%) minmax(0, 1fr);
}

.attendance-head,
.attendance-work-card,
.attendance-history-card {
  background: #fff;
  border: 1px solid #d8e5f2;
  border-radius: 16px;
  box-shadow: 0 14px 36px rgba(18, 58, 104, .07), 0 1px 3px rgba(18, 58, 104, .05);
}

.attendance-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.2rem;
}

.attendance-head h1 {
  color: #081b45;
  font-size: 2.05rem;
  letter-spacing: 0;
}

.attendance-head p {
  margin-top: .35rem;
  color: #5d7190;
}

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

.attendance-head-actions a {
  text-decoration: none;
}

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

.attendance-stat {
  display: grid;
  align-content: space-between;
  gap: .35rem;
  min-height: 118px;
  padding: .85rem;
  border: 1px solid #dfeaf6;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(18, 58, 104, .055);
}

.attendance-stat svg {
  width: 28px;
  height: 28px;
}

.attendance-stat strong {
  color: #081b45;
  font-family: var(--display);
  font-size: 1.72rem;
  line-height: 1;
  letter-spacing: 0;
}

.attendance-stat span {
  color: #314865;
  font-size: .82rem;
  font-weight: 800;
}

.attendance-stat small {
  color: #7287a1;
  font-size: .78rem;
}

.attendance-stat.stat-blue svg { color: var(--blue); }
.attendance-stat.stat-green svg,
.attendance-stat.stat-green strong { color: #20845a; }
.attendance-stat.stat-red svg,
.attendance-stat.stat-red strong { color: #b63b2c; }

.attendance-work-card,
.attendance-history-card {
  padding: 1.15rem;
}

.attendance-tabs {
  display: flex;
  gap: 1.1rem;
  overflow-x: auto;
  border-bottom: 1px solid #dfe9f5;
}

.attendance-tabs button {
  flex: none;
  padding: .15rem 0 .8rem;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #637995;
  font: inherit;
  font-size: .9rem;
  font-weight: 800;
  cursor: pointer;
}

.attendance-tabs button.on {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

.attendance-controls {
  display: grid;
  grid-template-columns: 190px minmax(220px, 1fr) auto;
  gap: .8rem;
  align-items: end;
  padding: 1rem 0;
}

.attendance-controls label {
  margin: 0;
  color: #314865;
}

.attendance-controls label span {
  color: #7b8da4;
  font-weight: 500;
}

.attendance-controls input {
  margin-top: .35rem;
  min-height: 44px;
  border-color: #c9d9ed;
}

.attendance-actions {
  display: flex;
  justify-content: flex-end;
  gap: .55rem;
  flex-wrap: wrap;
}

.attendance-date-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: 1rem;
  padding: .75rem;
  border: 1px solid #dfe9f5;
  border-radius: 14px;
  background: #f8fbff;
}

.attendance-date-tools > div,
.attendance-bulk-tools {
  display: flex;
  align-items: center;
  gap: .45rem;
  flex-wrap: wrap;
}

.attendance-date-tools p {
  color: #60758f;
  font-size: .84rem;
}

.attendance-calendar-card {
  margin-bottom: 1rem;
  padding: .85rem;
  border: 1px solid #dfe9f5;
  border-radius: 16px;
  background: #fbfdff;
}

.attendance-calendar-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .65rem;
}

.attendance-calendar-head h2 {
  color: #082052;
  font-size: 1.12rem;
  letter-spacing: 0;
}

.attendance-calendar-head p {
  margin-top: .2rem;
  color: #60758f;
  font-size: .84rem;
}

.attendance-calendar-head > div:last-child {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: .45rem;
  flex-wrap: wrap;
}

.attendance-weekdays,
.attendance-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.attendance-weekdays {
  gap: .35rem;
  margin-bottom: .35rem;
}

.attendance-weekdays span {
  color: #7488a1;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-align: center;
  text-transform: uppercase;
}

.attendance-calendar-grid {
  gap: .35rem;
}

.attendance-calendar-grid button {
  display: grid;
  align-content: start;
  gap: .15rem;
  min-height: 54px;
  padding: .42rem;
  border: 1px solid #e0eaf6;
  border-radius: 10px;
  background: #fff;
  color: #17345f;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.attendance-calendar-grid button:hover {
  border-color: #bcd8f2;
  background: #f5faff;
}

.attendance-calendar-grid button strong {
  color: #102854;
  font-family: var(--mono);
  font-size: .82rem;
}

.attendance-calendar-grid button span {
  overflow: hidden;
  color: #7c8fa8;
  font-size: .62rem;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attendance-calendar-grid button.today {
  border-color: #bcd8f2;
}

.attendance-calendar-grid button.has-session::after {
  content: '';
  width: 7px;
  height: 7px;
  margin-top: auto;
  border-radius: 50%;
  background: #20845a;
}

.attendance-calendar-grid button.on {
  border-color: var(--blue);
  background: #edf6ff;
  box-shadow: inset 0 0 0 1px var(--blue);
}

.attendance-bulk-tools {
  justify-content: flex-end;
  margin-bottom: .8rem;
}

.attendance-bulk-tools > span {
  color: #60758f;
  font-size: .84rem;
  font-weight: 800;
}

.attendance-table-wrap {
  overflow-x: auto;
  border: 1px solid #dfe9f5;
  border-radius: 14px;
}

.attendance-table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
}

.attendance-table th {
  padding: .75rem .65rem;
  background: #f5f9fe;
  color: #6c8099;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-align: left;
  text-transform: uppercase;
}

.attendance-table td {
  padding: .72rem .65rem;
  border-top: 1px solid #e7eff8;
  vertical-align: middle;
}

.attendance-table tbody tr:hover td {
  background: #fbfdff;
}

.attendance-student {
  display: flex;
  align-items: center;
  gap: .65rem;
  min-width: 190px;
}

.attendance-student > span {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #edf6ff;
  color: var(--blue-deep);
  font-family: var(--mono);
  font-size: .78rem;
  font-weight: 800;
  flex: none;
}

.attendance-student small {
  display: block;
  color: #71869e;
  font-size: .78rem;
}

.attendance-student strong {
  display: block;
  color: #102854;
  font-size: .92rem;
}

.attendance-radio {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  min-height: 34px;
  padding: .35rem .52rem;
  border: 1px solid #d7e2ee;
  border-radius: 999px;
  background: #fff;
  color: #52677f;
  font: inherit;
  font-size: .8rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.attendance-radio span {
  width: 10px;
  height: 10px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.attendance-radio.on.present {
  border-color: #9dd9be;
  background: #ebfaf3;
  color: #20845a;
}

.attendance-radio.on.absent {
  border-color: #efb6ae;
  background: #fff0ee;
  color: #b63b2c;
}

.attendance-radio.on.late {
  border-color: #efd09b;
  background: #fff7e8;
  color: #9a650c;
}

.attendance-radio.on.excused {
  border-color: #bcd8f2;
  background: #edf6ff;
  color: var(--blue-deep);
}

.attendance-radio.on span {
  box-shadow: inset 0 0 0 2px #fff;
  background: currentColor;
}

.attendance-table input[data-role=note] {
  min-width: 150px;
  min-height: 36px;
  padding: .45rem .55rem;
  border-color: #d7e2ee;
  font-size: .86rem;
}

.attendance-history-card .course-section-title span {
  color: #6f839b;
  font-size: .84rem;
  font-weight: 800;
}

.attendance-page .course-main {
  gap: 1rem;
}

.attendance-head {
  align-items: center;
  padding: 1.25rem 1.35rem;
  background: linear-gradient(180deg, #fff 0%, #f8fbff 100%);
}

.attendance-eyebrow {
  display: inline-flex;
  margin-bottom: .35rem;
  color: #1f63d8;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.attendance-head h1 {
  display: flex;
  align-items: baseline;
  gap: .65rem;
  margin: 0;
  font-size: 2rem;
}

.attendance-head h1 small {
  color: #496485;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 800;
}

.attendance-summary-grid {
  gap: .9rem;
}

.attendance-stat {
  position: relative;
  min-height: 136px;
  padding: 1rem;
  border-color: #e3edf8;
  border-radius: 18px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 18px 38px rgba(21, 65, 118, .07), 0 1px 2px rgba(21, 65, 118, .04);
}

.attendance-stat-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: #edf5ff;
  color: #1262da;
}

.attendance-stat.stat-green .attendance-stat-icon { background: #eafaf3; color: #198754; }
.attendance-stat.stat-red .attendance-stat-icon { background: #fff0ef; color: #c24135; }
.attendance-stat.stat-amber .attendance-stat-icon { background: #fff7e7; color: #b66a07; }

.attendance-stat small {
  color: #334a67;
  font-size: .82rem;
  font-weight: 900;
}

.attendance-stat em {
  color: #7388a3;
  font-size: .76rem;
  font-style: normal;
  font-weight: 700;
}

.attendance-stat strong {
  margin-top: .1rem;
  font-size: 2rem;
}

.attendance-stat b {
  position: absolute;
  right: .9rem;
  bottom: .9rem;
  padding: .24rem .5rem;
  border-radius: 999px;
  background: #f2f7fd;
  color: #526a87;
  font-size: .72rem;
}

.attendance-work-card {
  padding: 1rem;
  border-radius: 20px;
  background: linear-gradient(180deg, #fff 0%, #f7fbff 100%);
}

.attendance-date-panel {
  display: grid;
  grid-template-columns: minmax(190px, .8fr) minmax(210px, .9fr) auto minmax(260px, 1.05fr);
  gap: .85rem;
  align-items: center;
  padding: .9rem;
  border: 1px solid #e0ebf7;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(24, 72, 124, .055);
}

.attendance-date-title,
.attendance-help-card {
  display: flex;
  align-items: center;
  gap: .7rem;
}

.attendance-date-title > span {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 15px;
  background: #eef6ff;
  color: var(--blue);
}

.attendance-date-title strong,
.attendance-help-card strong {
  display: block;
  color: #0e2854;
  font-size: .92rem;
}

.attendance-date-title small,
.attendance-help-card small {
  display: block;
  margin-top: .18rem;
  color: #6f849f;
  font-size: .77rem;
  font-weight: 700;
}

.attendance-date-picker {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 56px;
  margin: 0;
  padding: .5rem .8rem;
  border: 1px solid #cfe0f3;
  border-radius: 16px;
  background: #f8fbff;
  cursor: pointer;
}

.attendance-date-picker input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: .01;
  cursor: pointer;
}

.attendance-date-picker b {
  color: #0b2553;
  font-size: 1rem;
}

.attendance-day-buttons {
  display: flex;
  gap: .45rem;
  flex-wrap: wrap;
}

.attendance-day-buttons .course-secondary-btn {
  min-height: 42px;
}

.attendance-help-card {
  align-items: flex-start;
  padding: .75rem .85rem;
  border-radius: 16px;
  background: #f2f7ff;
}

.attendance-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(140px, .35fr) minmax(140px, .35fr) auto auto;
  gap: .7rem;
  align-items: center;
  padding: 1rem 0;
}

.attendance-search {
  display: flex;
  align-items: center;
  gap: .55rem;
  min-height: 46px;
  margin: 0;
  padding: 0 .8rem;
  border: 1px solid #d4e2f2;
  border-radius: 14px;
  background: #fff;
  color: #536c8c;
}

.attendance-search input {
  width: 100%;
  min-height: 42px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.attendance-toolbar select {
  min-height: 46px;
  border: 1px solid #d4e2f2;
  border-radius: 14px;
  background-color: #fff;
  color: #1d3559;
  font-weight: 800;
}

.attendance-quick-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  min-height: 46px;
  padding: .65rem .9rem;
  border: 1px solid #d4e2f2;
  border-radius: 14px;
  background: #fff;
  color: #304b6d;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.attendance-quick-btn.success {
  border-color: #b8e8ce;
  background: #ecfbf3;
  color: #147848;
}

.attendance-table-wrap {
  border-color: #dfeaf7;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 14px 30px rgba(24, 72, 124, .045);
}

.attendance-table {
  min-width: 1180px;
}

.attendance-table th {
  padding: .85rem .75rem;
  background: #f6f9fd;
  color: #516783;
  letter-spacing: .04em;
}

.attendance-table td {
  padding: .85rem .75rem;
}

.attendance-student {
  min-width: 220px;
}

.attendance-khmer-name {
  color: #20395d;
  font-weight: 800;
}

.attendance-gender-pill {
  display: inline-flex;
  align-items: center;
  gap: .38rem;
  min-width: 86px;
  padding: .32rem .55rem;
  border-radius: 999px;
  color: #52677f;
  background: #eef3f8;
  font-size: .78rem;
  font-weight: 900;
}

.attendance-gender-pill b {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  color: inherit;
  font-size: .72rem;
}

.attendance-gender-pill.female {
  background: #ffeef8;
  color: #c33a86;
}

.attendance-gender-pill.male {
  background: #eaf4ff;
  color: #1769c5;
}

.attendance-status-group {
  display: flex;
  align-items: center;
  gap: .38rem;
  flex-wrap: wrap;
  min-width: 390px;
}

.attendance-radio {
  min-height: 38px;
  padding: .42rem .62rem;
  border-color: #dbe6f3;
  background: #f9fbfe;
}

.attendance-radio.present:hover,
.attendance-radio.on.present {
  border-color: #8dd9b3;
  background: #e8faf1;
  color: #147848;
}

.attendance-radio.absent:hover,
.attendance-radio.on.absent {
  border-color: #efb0a8;
  background: #fff0ef;
  color: #b33c32;
}

.attendance-radio.late:hover,
.attendance-radio.on.late {
  border-color: #efcf93;
  background: #fff6e5;
  color: #a46108;
}

.attendance-radio.excused:hover,
.attendance-radio.on.excused {
  border-color: #b7d7f6;
  background: #edf6ff;
  color: #155fb7;
}

.attendance-note-cell {
  display: flex;
  align-items: center;
  gap: .42rem;
}

.attendance-note-btn,
.attendance-row-menu {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  min-height: 36px;
  border: 1px solid #d8e4f1;
  border-radius: 12px;
  background: #fff;
  color: #385577;
  font: inherit;
  font-size: .8rem;
  font-weight: 900;
  cursor: pointer;
}

.attendance-note-btn {
  padding: .4rem .6rem;
}

.attendance-row-menu {
  width: 36px;
  padding: 0;
}

.attendance-note-cell input[data-role=note] {
  display: none;
  min-width: 170px;
}

.attendance-note-cell input[data-role=note].open,
.attendance-note-cell input[data-role=note]:not(:placeholder-shown) {
  display: block;
}

.attendance-footer {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto minmax(240px, 1fr);
  gap: .8rem;
  align-items: center;
  padding-top: 1rem;
}

.attendance-footer p {
  color: #536b89;
  font-size: .86rem;
  font-weight: 800;
}

.attendance-pagination,
.attendance-footer-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  flex-wrap: wrap;
}

.attendance-footer-actions {
  justify-content: flex-end;
}

.attendance-pagination button {
  min-width: 36px;
  min-height: 36px;
  padding: .35rem .55rem;
  border: 1px solid #d7e4f2;
  border-radius: 11px;
  background: #fff;
  color: #34506f;
  font: inherit;
  font-size: .82rem;
  font-weight: 900;
  cursor: pointer;
}

.attendance-pagination button.on {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.attendance-pagination button:disabled {
  cursor: not-allowed;
  opacity: .5;
}

.course-students-page .course-workspace {
  grid-template-columns: minmax(220px, 22%) minmax(0, 1fr);
}

.course-students-head,
.course-roster-add,
.course-roster-note,
.course-roster-card {
  background: #fff;
  border: 1px solid #d8e5f2;
  border-radius: 16px;
  box-shadow: 0 14px 36px rgba(18, 58, 104, .07), 0 1px 3px rgba(18, 58, 104, .05);
}

.course-students-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.2rem;
}

.course-students-head h1 {
  color: #081b45;
  font-size: 2.05rem;
  letter-spacing: 0;
}

.course-students-head p {
  margin-top: .35rem;
  color: #5d7190;
}

.course-students-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .55rem;
  flex-wrap: wrap;
}

.course-students-actions a {
  text-decoration: none;
}

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

.course-roster-add {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: .8rem;
  align-items: end;
  padding: 1rem;
}

.course-roster-add label {
  margin: 0;
  color: #314865;
  font-size: .86rem;
  font-weight: 800;
}

.course-roster-add select {
  margin-top: .35rem;
  min-height: 44px;
  border-color: #c9d9ed;
}

.course-roster-note {
  margin: 0;
  padding: .85rem 1rem;
  color: #526b88;
  font-size: .88rem;
}

.course-roster-card {
  padding: 1.15rem;
}

.course-roster-card .course-section-title span {
  color: #6f839b;
  font-size: .84rem;
  font-weight: 800;
}

.course-roster-table-wrap {
  overflow-x: auto;
  border: 1px solid #dfe9f5;
  border-radius: 14px;
}

.course-roster-table {
  width: 100%;
  min-width: 1080px;
  border-collapse: collapse;
}

.course-roster-table th {
  padding: .75rem .65rem;
  background: #f5f9fe;
  color: #6c8099;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-align: left;
  text-transform: uppercase;
}

.course-roster-table td {
  padding: .74rem .65rem;
  border-top: 1px solid #e7eff8;
  color: #17345f;
  font-size: .84rem;
  vertical-align: middle;
}

.course-roster-table tbody tr:hover td {
  background: #fbfdff;
}

.course-roster-table .num {
  color: #102854;
  font-family: var(--mono);
  font-weight: 800;
}

.course-text-action.danger {
  color: #b63b2c;
}

.grading-page .course-workspace {
  grid-template-columns: minmax(220px, 22%) minmax(0, 1fr);
}

.grading-head,
.grading-work-card {
  background: #fff;
  border: 1px solid #d8e5f2;
  border-radius: 16px;
  box-shadow: 0 14px 36px rgba(18, 58, 104, .07), 0 1px 3px rgba(18, 58, 104, .05);
}

.grading-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.2rem;
}

.grading-head h1 {
  color: #081b45;
  font-size: 2.05rem;
  letter-spacing: 0;
}

.grading-head p {
  margin-top: .35rem;
  color: #5d7190;
}

.grading-head-actions {
  display: flex;
  justify-content: flex-end;
  gap: .55rem;
  flex-wrap: wrap;
}

.grading-head-actions a {
  text-decoration: none;
}

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

.grade-stat {
  display: grid;
  align-content: space-between;
  gap: .35rem;
  min-height: 118px;
  padding: .85rem;
  border: 1px solid #dfeaf6;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(18, 58, 104, .055);
}

.grade-stat svg {
  width: 28px;
  height: 28px;
}

.grade-stat strong {
  color: #081b45;
  font-family: var(--display);
  font-size: 1.8rem;
  line-height: 1;
  letter-spacing: 0;
}

.grade-stat span {
  color: #314865;
  font-size: .8rem;
  font-weight: 800;
}

.grade-stat small {
  overflow: hidden;
  color: #7287a1;
  font-size: .76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.grade-stat.stat-blue svg { color: var(--blue); }
.grade-stat.stat-green svg,
.grade-stat.stat-green strong { color: #20845a; }
.grade-stat.stat-red svg,
.grade-stat.stat-red strong { color: #b63b2c; }
.grade-stat.stat-amber svg,
.grade-stat.stat-amber strong { color: #9a650c; }

.grading-work-card {
  padding: 1.15rem;
}

.grading-tabs {
  display: flex;
  gap: 1.1rem;
  overflow-x: auto;
  border-bottom: 1px solid #dfe9f5;
}

.grading-tabs button {
  flex: none;
  padding: .15rem 0 .8rem;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #637995;
  font: inherit;
  font-size: .9rem;
  font-weight: 800;
  cursor: pointer;
}

.grading-tabs button.on {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

.grading-toolbar {
  display: grid;
  grid-template-columns: 180px 170px minmax(240px, 1fr) auto auto;
  gap: .75rem;
  align-items: center;
  padding: 1rem 0;
}

.grading-toolbar select,
.grading-toolbar input {
  min-height: 44px;
  border-color: #c9d9ed;
}

.grading-toolbar a {
  text-decoration: none;
}

.grading-search {
  position: relative;
  margin: 0;
}

.grading-search span {
  position: absolute;
  left: .85rem;
  top: 50%;
  display: grid;
  place-items: center;
  color: #6883a4;
  transform: translateY(-50%);
  pointer-events: none;
}

.grading-search input {
  padding-left: 2.65rem;
}

.grading-filter-note {
  margin-bottom: .75rem;
  color: #5f748f;
  font-size: .86rem;
}

.grading-policy {
  margin: -.25rem 0 1rem;
  padding: .65rem .8rem;
  border: 1px solid #dfe9f5;
  border-radius: 12px;
  background: #f8fbff;
  color: #526b88;
  font-size: .84rem;
}

.gradebook-table-wrap {
  overflow-x: auto;
  border: 1px solid #dfe9f5;
  border-radius: 14px;
}

.gradebook-table {
  width: 100%;
  min-width: 1220px;
  border-collapse: collapse;
}

.gradebook-table th {
  padding: .75rem .65rem;
  background: #f5f9fe;
  color: #6c8099;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-align: left;
  text-transform: uppercase;
  vertical-align: bottom;
}

.gradebook-table th small {
  display: block;
  margin-top: .15rem;
  color: #8a9ab0;
  font-size: .64rem;
  letter-spacing: 0;
  text-transform: none;
}

.gradebook-table td {
  padding: .62rem .58rem;
  border-top: 1px solid #e7eff8;
  color: #17345f;
  font-size: .84rem;
  vertical-align: middle;
}

.gradebook-table tbody tr:hover td {
  background: #fbfdff;
}

.gradebook-table td strong {
  display: block;
  color: #102854;
  font-family: var(--mono);
  font-size: .86rem;
}

.gradebook-table td small {
  display: block;
  color: #7b8da4;
  font-size: .7rem;
}

.gradebook-table tfoot td {
  background: #f3f8fe;
  color: #17345f;
  font-weight: 800;
}

.grade-student {
  display: flex;
  align-items: center;
  gap: .65rem;
  min-width: 190px;
}

.grade-student > span {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #edf6ff;
  color: var(--blue-deep);
  font-family: var(--mono);
  font-size: .78rem;
  font-weight: 800;
  flex: none;
}

.grade-student strong {
  display: block;
  color: #102854;
  font-size: .92rem;
}

.grade-missing {
  color: #8a9ab0;
  font-size: .8rem;
}

.letter-badge,
.grade-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 26px;
  padding: .2rem .5rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 800;
}

.letter-badge {
  background: #edf6ff;
  color: var(--blue-deep);
}

.grade-status.passed {
  background: #ebfaf3;
  color: #20845a;
}

.grade-status.risk {
  background: #fff7e8;
  color: #9a650c;
}

.grade-status.fail {
  background: #fff0ee;
  color: #b63b2c;
}

.grade-status.missing {
  background: #eef3f8;
  color: #60758f;
}

.grade-row-menu {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid #d7e2ee;
  border-radius: 50%;
  background: #fff;
  color: #52677f;
  cursor: pointer;
}

.grade-row-menu svg {
  width: 18px;
  height: 18px;
}

.grade-mobile-list {
  display: none;
  gap: .75rem;
}

.grade-mobile-card {
  display: grid;
  gap: .8rem;
  padding: 1rem;
  border: 1px solid #dfe9f5;
  border-radius: 14px;
  background: #fff;
}

.grade-mobile-head,
.grade-mobile-score {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}

.grade-mobile-score strong {
  color: #081b45;
  font-family: var(--display);
  font-size: 1.45rem;
}

.grade-mobile-breakdown {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .5rem;
}

.grade-mobile-breakdown span {
  display: flex;
  justify-content: space-between;
  gap: .4rem;
  padding: .55rem;
  border-radius: 10px;
  background: #f5f9fe;
  color: #60758f;
  font-size: .8rem;
}

.grade-mobile-breakdown b {
  color: #17345f;
}

.grade-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-top: 1rem;
  color: #60758f;
  font-size: .84rem;
  flex-wrap: wrap;
}

.grade-pagination > div {
  display: flex;
  gap: .3rem;
}

.grade-pagination button,
.grade-pagination select {
  min-height: 34px;
  border: 1px solid #cbdcf0;
  border-radius: 8px;
  background: #fff;
  color: var(--blue-deep);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.grade-pagination button {
  padding: .35rem .65rem;
}

.grade-pagination button.on {
  background: var(--blue);
  color: #fff;
}

.grade-pagination button[disabled] {
  opacity: .45;
  cursor: not-allowed;
}

.grade-pagination label {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin: 0;
}

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

.grade-breakdown-grid article {
  display: grid;
  gap: .35rem;
  min-height: 120px;
  padding: 1rem;
  border: 1px solid #dfe9f5;
  border-radius: 14px;
  background: #fbfdff;
}

.grade-breakdown-grid span,
.assessment-grade-list small {
  color: #7488a1;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.grade-breakdown-grid strong {
  color: #081b45;
  font-family: var(--display);
  font-size: 1.8rem;
}

.grade-breakdown-grid small {
  color: #60758f;
  font-size: .78rem;
}

.assessment-grade-list {
  display: grid;
  gap: .7rem;
}

.assessment-grade-list article {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) .65fr .8fr .55fr auto;
  gap: .75rem;
  align-items: center;
  padding: .85rem;
  border: 1px solid #dfe9f5;
  border-radius: 14px;
  background: #fff;
}

.assessment-grade-list strong {
  display: block;
  color: #102854;
}

.assessment-grade-list span {
  color: #60758f;
  font-size: .82rem;
}

.assessment-grade-list b {
  color: #081b45;
  font-family: var(--mono);
}

.grade-bulk-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .75rem;
  padding: .65rem .75rem;
  border: 1px solid #dfe9f5;
  border-radius: 12px;
  background: #f8fbff;
  color: #526b88;
  font-size: .84rem;
  flex-wrap: wrap;
}

.grade-settings-modal {
  width: min(980px, calc(100vw - 2rem));
  max-height: min(820px, calc(100vh - 2rem));
  overflow: auto;
}

.grade-settings-modal .modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.grade-settings-section {
  display: grid;
  gap: .75rem;
  padding: 1rem 0;
  border-top: 1px solid #e4edf7;
}

.grade-settings-section h3 {
  color: #102854;
  font-size: 1rem;
  letter-spacing: 0;
}

.grade-weight-grid,
.grade-assessment-form,
.grade-score-form {
  display: grid;
  gap: .7rem;
}

.grade-weight-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grade-assessment-form {
  grid-template-columns: minmax(220px, 1fr) 150px 110px 100px auto;
}

.grade-score-form {
  grid-template-columns: minmax(220px, 1fr) 110px 100px auto;
}

.grade-settings-modal label {
  margin: 0;
  color: #314865;
  font-size: .84rem;
  font-weight: 800;
}

.grade-settings-modal input,
.grade-settings-modal select {
  min-height: 42px;
  margin-top: .32rem;
  border-color: #c9d9ed;
}

.grade-student-picker {
  display: grid;
  gap: .55rem;
  max-height: 220px;
  overflow: auto;
  padding: .75rem;
  border: 1px solid #dfe9f5;
  border-radius: 12px;
  background: #fbfdff;
}

.grade-student-picker > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .35rem .75rem;
}

@media (max-width: 1060px) {
  .course-workspace,
  .course-dashboard-grid,
  .attendance-page .course-workspace,
  .grading-page .course-workspace,
  .course-students-page .course-workspace {
    grid-template-columns: 1fr;
  }
  .attendance-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .grade-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .course-student-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .grading-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grade-weight-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grade-assessment-form,
  .grade-score-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .attendance-controls {
    grid-template-columns: 1fr 1fr;
  }
  .attendance-actions {
    grid-column: 1 / -1;
  }
  .attendance-date-panel,
  .attendance-toolbar,
  .attendance-footer {
    grid-template-columns: 1fr 1fr;
  }
  .attendance-help-card,
  .attendance-search,
  .attendance-footer p {
    grid-column: 1 / -1;
  }
  .attendance-footer-actions {
    justify-content: stretch;
  }
  .course-side {
    grid-template-columns: minmax(220px, 290px) 1fr;
    align-items: start;
  }
  .course-stat-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .course-landing-grid {
    grid-template-columns: 1fr;
  }
  .course-side-nav {
    max-height: 420px;
    overflow: auto;
  }
}

@media (max-width: 760px) {
  .course-hero-card,
  .attendance-head,
  .grading-head,
  .course-students-head {
    display: grid;
  }
  .attendance-head-actions,
  .grading-head-actions,
  .course-students-actions {
    justify-content: stretch;
  }
  .attendance-head-actions .course-secondary-btn,
  .grading-head-actions .course-secondary-btn,
  .grading-head-actions .course-primary-btn,
  .course-students-actions .course-secondary-btn,
  .course-students-actions .course-primary-btn {
    flex: 1 1 180px;
  }
  .course-hero-actions {
    justify-content: space-between;
  }
  .course-hero-actions .course-primary-btn,
  .course-hero-actions .course-secondary-btn {
    flex: 1 1 170px;
  }
  .course-side {
    grid-template-columns: 1fr;
  }
  .course-side-nav {
    display: flex;
    overflow-x: auto;
    padding: .45rem;
  }
  .course-side-nav button {
    flex: 0 0 auto;
    width: auto;
    white-space: nowrap;
  }
  .course-overview-stats,
  .course-stat-strip,
  .quick-summary-grid.three,
  .quick-summary-grid.four,
  .exam-summary-list,
  .course-shortcut-grid,
  .course-next-session {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .quick-table-head {
    display: none;
  }
  .quick-table {
    border: 0;
    gap: .55rem;
  }
  .quick-table-row {
    grid-template-columns: 1fr 1fr;
    border: 1px solid #e0eaf6;
    border-radius: 12px;
  }
  .attendance-summary-grid,
  .attendance-controls,
  .attendance-date-panel,
  .attendance-toolbar,
  .attendance-footer,
  .attendance-calendar-head,
  .attendance-date-tools,
  .grade-summary-grid,
  .course-student-summary,
  .course-roster-add,
  .grading-toolbar,
  .grade-breakdown-grid,
  .assessment-grade-list article {
    grid-template-columns: 1fr;
  }
  .attendance-actions {
    justify-content: stretch;
  }
  .attendance-day-buttons,
  .attendance-footer-actions {
    justify-content: stretch;
  }
  .attendance-day-buttons .course-secondary-btn,
  .attendance-quick-btn,
  .attendance-footer-actions .course-primary-btn,
  .attendance-footer-actions .course-secondary-btn {
    flex: 1 1 170px;
  }
  .attendance-pagination {
    justify-content: flex-start;
  }
  .attendance-actions .course-primary-btn,
  .attendance-actions .course-secondary-btn {
    flex: 1 1 180px;
  }
  .attendance-calendar-grid button {
    min-height: 48px;
    padding: .4rem;
  }
  .attendance-calendar-grid button span {
    display: none;
  }
}

@media (max-width: 560px) {
  .course-detail-page {
    margin: 0;
  }
  .course-hero-card,
  .course-overview-card,
  .course-quick-panel,
  .attendance-head,
  .attendance-work-card,
  .attendance-history-card,
  .grading-head,
  .grading-work-card,
  .course-students-head,
  .course-roster-add,
  .course-roster-card {
    padding: 1rem;
    border-radius: 14px;
  }
  .attendance-head h1,
  .grading-head h1,
  .course-students-head h1 {
    font-size: 1.9rem;
  }
  .gradebook-table-wrap {
    display: none;
  }
  .grade-mobile-list {
    display: grid;
  }
  .grade-mobile-breakdown {
    grid-template-columns: 1fr;
  }
  .course-hero-card h1 {
    font-size: 1.8rem;
  }
  .course-overview-stats,
  .course-stat-strip,
  .quick-summary-grid.three,
  .quick-summary-grid.four,
  .exam-summary-list,
  .quick-list article,
  .student-mini-list article,
  .course-shortcut-grid,
  .course-next-session,
  .grade-weight-grid,
  .grade-assessment-form,
  .grade-score-form,
  .grade-student-picker > div {
    grid-template-columns: 1fr;
  }
  .course-activity-row {
    grid-template-columns: 42px 1fr;
  }
  .course-activity-row b {
    grid-column: 2;
    justify-self: start;
  }
}

/* header: BBINS logo + name, left of the section nav */
.top-brand { display: flex; align-items: center; gap: .6rem; }
.top-brand img { width: 34px; height: 34px; object-fit: contain; border-radius: 8px; flex: none; }
.top-brand strong {
  display: block; font-family: var(--display); font-weight: 700;
  font-size: 1.02rem; line-height: 1.15; color: var(--ink);
}
.top-brand span { display: block; font-size: .68rem; color: var(--graphite); line-height: 1.3; }
.top-brand small {
  display: block;
  margin-top: .1rem;
  color: #7a8ca0;
  font-size: .62rem;
  line-height: 1.2;
}

/* student detail page */
.student-profile-page {
  display: grid;
  gap: 1rem;
}

.student-back {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  justify-self: start;
  border: 0;
  background: transparent;
  color: var(--blue);
  font: inherit;
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
}

.student-profile-card,
.detail-card,
.summary-card,
.profile-info-card,
.instructor-only-note {
  background: #fff;
  border: 1px solid #d8e4f0;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(21, 61, 108, .07);
}

.student-profile-card {
  padding: 1.35rem;
}

.profile-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.student-identity {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  min-width: 0;
}

.student-profile-icon {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 50%;
}

.student-profile-icon svg {
  width: 32px;
  height: 32px;
  stroke-width: 1.8;
}

.student-profile-icon.male {
  background: #eaf3ff;
  color: #2563eb;
}

.student-profile-icon.female {
  background: #ffeaf4;
  color: #ec4899;
}

.student-profile-icon.unknown {
  background: #f1f5f9;
  color: #64748b;
}

.identity-name-row {
  display: flex;
  align-items: center;
  gap: .7rem;
  flex-wrap: wrap;
}

.student-id-line {
  margin-top: .45rem;
  color: #1c4f8f;
  font-weight: 600;
}

.identity-contact {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem 1rem;
  margin-top: .65rem;
  color: var(--graphite);
  font-size: .9rem;
}

.identity-contact span,
.btn-link,
.section-head h2,
.profile-info-card h2,
.summary-card span,
.student-unlinked-pill {
  display: inline-flex;
  align-items: center;
  gap: .42rem;
}

.edit-student-btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  color: var(--blue);
  border-color: var(--blue-line);
  white-space: nowrap;
}
.student-detail-actions {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.student-detail-actions .btn-danger {
  color: #fff;
}

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

.profile-info-card {
  min-height: 250px;
  padding: 1.1rem;
}

.profile-info-card.personal-info-card {
  border-color: #dcebff;
  background: #f5f9ff;
}

.profile-info-card.academic-info-card {
  border-color: #e8e1ff;
  background: #f8f6ff;
}

.profile-info-card.emergency-info-card {
  border-color: #d8f2e7;
  background: #f3fbf8;
}

.profile-info-card h2,
.section-head h2 {
  color: #10243f;
  font-size: 1rem;
  letter-spacing: 0;
}

.profile-info-card h2 {
  margin-bottom: 1rem;
}

.student-detail-fields {
  display: grid;
  gap: .85rem;
}

.student-detail-field {
  padding: .75rem .8rem;
  border: 1px solid #e5edf7;
  border-radius: 8px;
  background: #fff;
}

.student-detail-field span,
.summary-card span,
.section-head p {
  color: var(--graphite);
  font-size: .78rem;
}

.student-detail-field span,
.summary-card span {
  margin-bottom: .2rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.student-detail-field strong {
  display: block;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-weight: 700;
}

.student-notes-card .section-head {
  margin-bottom: .6rem;
}

.notes-text {
  min-height: 38px;
  margin-top: .2rem;
  color: var(--ink-soft);
  line-height: 1.55;
  white-space: pre-wrap;
}

.soft-warning,
.history-note,
.instructor-only-note {
  display: flex;
  align-items: flex-start;
  gap: .55rem;
}

.soft-warning {
  margin-top: 1rem;
  padding: .75rem .85rem;
  border: 1px solid #ead6aa;
  border-radius: 8px;
  background: #fff7e6;
  color: #8a6212;
  font-size: .85rem;
}

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

.summary-card {
  min-height: 120px;
  padding: 1rem;
  border-left-width: 4px;
}

.summary-card strong {
  display: block;
  color: #10243f;
  font-family: var(--mono);
  font-size: 1.7rem;
  line-height: 1.15;
}

.summary-card small {
  display: block;
  margin-top: .35rem;
  color: var(--graphite);
  font-size: .78rem;
}

.summary-card.accent-blue { border-left-color: var(--blue); }
.summary-card.accent-violet { border-left-color: #7c6ee6; }
.summary-card.accent-green { border-left-color: #249f62; }
.summary-card.accent-amber { border-left-color: #d28a1d; }

.student-detail-stack {
  display: grid;
  gap: 1rem;
}

.detail-card {
  padding: 1.25rem;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.history-card {
  overflow-x: auto;
}

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

.detail-table th {
  color: #63758a;
  font-size: .7rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.detail-table td,
.detail-table th {
  padding: .85rem .6rem;
  border-bottom: 1px solid var(--rule-soft);
  text-align: left;
  vertical-align: top;
}

.timeout-yes {
  color: #b56f10;
  font-weight: 700;
}

.student-empty-state {
  min-height: 150px;
  display: grid;
  place-items: center;
  gap: .45rem;
  padding: 2rem 1rem;
  color: var(--graphite);
  text-align: center;
}

.student-empty-state svg {
  color: #7a94b2;
}

.student-empty-state strong {
  color: #10243f;
}

.student-empty-state span {
  display: block;
  color: var(--graphite);
  font-size: .88rem;
}

.history-note {
  margin-top: 1rem;
  color: #5f7288;
  font-size: .84rem;
}

.missed-card {
  position: static;
}

.missed-group {
  padding: .9rem 0;
  border-top: 1px solid var(--rule-soft);
}

.missed-group:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.missed-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}

.missed-group-head strong {
  color: var(--blue-deep);
}

.missed-count {
  flex: none;
  border-radius: 999px;
  background: var(--amber-wash);
  color: var(--amber);
  padding: .18rem .5rem;
  font-size: .72rem;
  font-weight: 700;
}

.missed-group ul {
  display: grid;
  gap: .55rem;
  margin: .65rem 0 0;
  padding: 0;
  color: var(--ink-soft);
  list-style: none;
}

.missed-group li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  padding: .7rem .8rem;
  border: 1px solid #e5edf7;
  border-radius: 8px;
  background: #fbfdff;
}

.missed-group li span {
  color: var(--ink);
  font-weight: 700;
}

.missed-group li small {
  flex: none;
  color: #b56f10;
  font-size: .78rem;
  font-weight: 700;
}

.instructor-only-note {
  padding: .9rem 1rem;
  color: #496178;
  font-size: .88rem;
}

.registration-link-list {
  display: grid;
  gap: .75rem;
  margin-top: 1rem;
}

.registration-link-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--rule-soft);
  border-radius: 8px;
  background: #fbfdff;
}

.registration-link-url {
  margin-top: .45rem;
  overflow-wrap: anywhere;
  font-size: .78rem;
}

.registration-link-actions {
  display: flex;
  align-items: center;
  gap: .45rem;
  flex: none;
}

/* Students page: the roster is the reason instructors visit, so it gets a
   blue top accent and full room; registration links stay a plain .card
   below it, visibly secondary, collapsible once the roster is long. */
.student-info-card { border-top: 3px solid var(--blue); }

.registry-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .9rem;
  margin: .15rem 0 1rem;
}
.registry-summary-card {
  min-height: 126px;
  padding: 1rem;
  border: 1px solid var(--blue-line);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: 0 8px 24px rgba(23, 102, 194, .07);
}
.registry-summary-card > span,
.registry-cohort-card > span:first-child {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  margin-bottom: .7rem;
  border-radius: 11px;
  background: var(--blue-wash);
  color: var(--blue);
}
.registry-summary-card.active > span {
  background: #eaf8f1;
  color: #168653;
}
.registry-summary-card.links > span {
  background: #f3efff;
  color: #7254d6;
}
.registry-summary-card small,
.registry-cohort-card small {
  display: block;
  color: var(--graphite);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.registry-summary-card strong,
.registry-cohort-card strong {
  display: flex;
  align-items: center;
  gap: .25rem;
  margin-top: .22rem;
  color: #10243f;
  font-family: var(--display);
  font-size: 1.45rem;
  line-height: 1.1;
  letter-spacing: 0;
}
.registry-summary-card em,
.registry-cohort-card em {
  display: block;
  margin-top: .35rem;
  color: var(--graphite);
  font-size: .82rem;
  font-style: normal;
}
.registry-summary-card.selected-cohort {
  position: relative;
  padding: 0;
}
.registry-cohort-card {
  width: 100%;
  height: 100%;
  min-height: 126px;
  display: block;
  padding: 1rem;
  border: 0;
  border-radius: var(--radius-lg);
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: background .14s ease, transform .06s ease;
}
.registry-cohort-card:hover,
.registry-cohort-card[aria-expanded=true] {
  background: #f8fbff;
}
.registry-cohort-card:active { transform: translateY(1px); }
.registry-cohort-card strong {
  color: var(--blue-deep);
}
.student-cohort-menu {
  position: absolute;
  top: calc(100% + 7px);
  left: 0;
  z-index: 50;
  width: 100%;
  min-width: 250px;
  padding: .35rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-lift);
}
.student-cohort-menu.hidden { display: none; }
.student-cohort-menu button {
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: .5rem;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  text-align: left;
  cursor: pointer;
  padding: .5rem .6rem;
}
.student-cohort-menu button:hover,
.student-cohort-menu button[aria-selected=true] {
  background: var(--blue-wash);
  color: var(--blue-deep);
}
.student-cohort-menu button span { font-weight: 700; }
.student-cohort-menu button small {
  color: var(--graphite);
  font-size: .75rem;
}

.student-row-identity { display: flex; align-items: center; gap: .8rem; min-width: 0; }
.gender-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.gender-icon svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}
.gender-icon.male {
  background: #eaf3ff;
  color: #2563eb;
}
.gender-icon.female {
  background: #ffeaf4;
  color: #ec4899;
}
.gender-icon.unknown {
  background: #f1f5f9;
  color: #64748b;
}
.student-row-name {
  min-width: 0;
  color: var(--ink);
  line-height: 1.35;
}
.student-row-name b {
  display: block;
  overflow-wrap: anywhere;
  font-size: .96rem;
  font-weight: 700;
}
.student-name-en { color: #10243f; }
.student-name-kh {
  color: #5d6b7a;
  font-weight: 600;
}
.student-table { overflow: visible; }
.student-table table { table-layout: fixed; }
.student-roster-table th:nth-child(1) { width: 58px; }
.student-roster-table th:nth-child(2) { width: 34%; }
.student-roster-table th:nth-child(3) { width: 120px; }
.student-roster-table th:nth-child(5) { width: 130px; }
.student-roster-table th:nth-child(6) { width: 105px; }
.student-roster-table th:nth-child(7) { width: 52px; }
.student-roster-table tbody tr { height: 70px; }
.student-roster-table tbody td {
  height: 70px;
  vertical-align: middle;
}
.student-roster-table tbody td:nth-child(4) {
  overflow-wrap: anywhere;
}
.student-table tbody tr:hover td { background: #f6fbff; }
.student-roster-table .row-menu {
  overflow: visible;
  text-align: right;
}
.student-roster-table .row-menu-btn {
  margin-left: auto;
  color: #45617e;
}

.registration-link-section .page-head[data-role=reg-toggle] { cursor: pointer; user-select: none; }
.registration-link-section.is-collapsed { padding-bottom: 1.5rem; }

.pagination {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-top: 1.25rem; padding-top: 1rem;
  border-top: 1px solid var(--rule-soft); font-size: .85rem; color: var(--graphite);
}
.pagination-pages { display: flex; align-items: center; gap: .25rem; }
.pagination-pages button {
  min-width: 30px; height: 30px; padding: 0 .4rem;
  border: 1px solid var(--rule); border-radius: var(--radius);
  background: #fff; color: var(--ink-soft); font: inherit; font-size: .82rem; cursor: pointer;
}
.pagination-pages button:hover { border-color: var(--blue); color: var(--blue-deep); }
.pagination-pages button.on { background: var(--blue); border-color: var(--blue); color: #fff; cursor: default; }
.pagination-pages button[disabled] { opacity: .4; cursor: not-allowed; }
.pagination-pages span { padding: 0 .2rem; color: var(--rule); }

@media (max-width: 640px) {
  .registry-summary-grid {
    grid-template-columns: 1fr;
  }
  .student-table thead { display: none; }
  .student-table { overflow-x: visible; }
  .student-table tbody tr {
    display: grid;
    gap: .45rem;
    height: auto;
    min-height: 0;
    border-bottom: 1px solid var(--rule-soft);
    padding: .85rem 0;
  }
  .student-table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    height: auto;
    padding: .15rem 0;
    border: none;
  }
  .student-table tbody td:first-child { padding-top: 0; }
  .student-table tbody td::before { content: attr(data-label); font-size: .72rem; color: var(--graphite); text-transform: uppercase; letter-spacing: .04em; }
  .student-table tbody td[data-label="Name"]::before,
  .student-table tbody td.row-menu::before { content: none; }
  .student-table tbody td[data-label="Name"] { justify-content: flex-start; }
  .student-row-identity { align-items: center; }
  .student-row-name b { font-size: .98rem; }
  .student-roster-table .row-menu {
    position: relative;
    justify-content: flex-end;
  }
  .student-table tbody td[colspan] { display: table-cell; }
  .pagination { flex-direction: column; align-items: stretch; text-align: center; }
}

/* page-level filter bar: search + dropdowns + a passive count, one row */
.filters-bar {
  display: flex; align-items: flex-end; gap: .85rem; flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.filters-bar .field { margin-bottom: 0; }
.filters-bar .f-search { flex: 1 1 240px; min-width: 200px; }
.filters-bar .f-select { width: auto; min-width: 150px; }
.filters-bar .f-count {
  font-size: .82rem; color: var(--graphite);
  padding: .58rem 0; white-space: nowrap;
}
.filters-bar .f-count b { color: var(--ink); font-family: var(--mono); }

/* quiz/course card metadata: separate icon+label pieces, not a "·" string */
.meta-row { display: flex; flex-wrap: wrap; gap: .15rem 1rem; margin-top: .3rem; }
.meta-item {
  display: inline-flex; align-items: center; gap: .32rem;
  font-size: .8rem; color: var(--graphite); white-space: nowrap;
}
.meta-item .ic { font-size: .82rem; line-height: 1; opacity: .85; }

/* vertical divider between the two stat numbers on a quiz-row */
.stat-sep { width: 1px; align-self: stretch; background: var(--rule); flex: none; }

/* status pill with a small solid dot, used for the quiz OPEN badge */
.pill-dot { display: inline-flex; align-items: center; gap: .32rem; }
.pill-dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }

/* per-row quick-actions menu (3-dot button + dropdown) */
.row-menu { position: relative; flex: none; }
.row-menu-btn {
  width: 30px; height: 30px; display: grid; place-items: center;
  background: none; border: 1px solid transparent; border-radius: var(--radius);
  color: var(--graphite); font-size: 1.1rem; line-height: 1; cursor: pointer;
}
.row-menu-btn:hover { background: #f2f5f7; border-color: var(--rule); color: var(--ink); }
.row-menu-list {
  position: absolute; top: calc(100% + 4px); right: 0; z-index: 40;
  min-width: 170px; background: var(--card); border: 1px solid var(--rule);
  border-radius: var(--radius); box-shadow: var(--shadow-lift);
  padding: .3rem; display: flex; flex-direction: column;
}
.row-menu-list.hidden { display: none; }
.row-menu-item {
  display: block; width: 100%; text-align: left; background: none; border: none;
  font: inherit; font-size: .85rem; color: var(--ink-soft); cursor: pointer;
  padding: .5rem .6rem; border-radius: 5px;
}
.row-menu-item:hover { background: #f2f5f7; }
.row-menu-item.danger { color: var(--flag); }
.row-menu-item[disabled] { color: var(--rule); cursor: not-allowed; }
.row-menu-item[disabled]:hover { background: none; }

@media (max-width: 860px) {
  .top-brand span { display: none; }
}
@media (max-width: 640px) {
  .filters-bar { flex-direction: column; align-items: stretch; }
  .filters-bar .f-select { width: 100%; }
}

/* ==================================================== STUDENT — taking a quiz
   One question at a time. New classes throughout (.answer-option, not
   .choice) so this never touches the instructor question-editor's reuse of
   .choice/.bubble for its own correct-answer picker.
   ============================================================================ */

.exam-header {
  position: sticky; top: 0; z-index: 30;
  background: var(--blue-wash);
  border-bottom: 1px solid var(--blue-line);
}
.exam-header-inner {
  max-width: 1080px; margin: 0 auto; padding: .75rem 1.25rem;
  display: flex; align-items: center; gap: 1.25rem;
}
.exam-brand { display: flex; align-items: center; gap: .6rem; flex: none; }
.exam-brand img { width: 34px; height: 34px; object-fit: contain; border-radius: 8px; flex: none; }
.exam-brand strong { display: block; font-family: var(--display); font-weight: 700; font-size: 1rem; color: var(--ink); line-height: 1.2; }
.exam-brand span { display: block; font-size: .68rem; color: var(--graphite); line-height: 1.3; }
.exam-brand-tag { color: var(--blue-deep) !important; font-weight: 600; margin-top: 1px; }
.exam-header-divider { width: 1px; align-self: stretch; background: var(--blue-line); flex: none; }
.exam-quizinfo { flex: 1; min-width: 0; }
.exam-quizinfo strong { display: block; font-family: var(--display); font-size: 1rem; color: var(--ink); }
.exam-quizinfo > span { font-size: .8rem; color: var(--graphite); }
.exam-quizinfo .meta-row { margin-top: .3rem; }
.exam-quizinfo .meta-item { color: var(--blue-deep); }
.exam-student-card {
  flex: none; display: flex; align-items: center; gap: .6rem;
  background: #fff; border: 1px solid var(--blue-line); border-radius: var(--radius-lg);
  padding: .45rem .75rem; box-shadow: var(--shadow);
}
.exam-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  background: var(--blue); color: #fff; font-weight: 700; font-size: .85rem;
  display: grid; place-items: center;
}
.exam-student-card strong { display: block; font-size: .87rem; color: var(--ink); line-height: 1.25; }
.exam-student-card span { font-size: .74rem; color: var(--graphite); font-family: var(--mono); }

.exam-body2 { max-width: 880px; margin: 0 auto; padding: 1rem 1.25rem 1.5rem; }

.exam-status-card {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1.25rem;
  background: #fff; border: 1px solid var(--rule); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: .85rem 1.15rem; margin-bottom: .9rem;
}
.exam-status-left { text-align: left; }
.exam-status-left strong { display: block; margin-top: .18rem; font-family: var(--display); font-size: 1.18rem; color: var(--ink); }
.exam-status-center { display: flex; flex-direction: column; align-items: center; text-align: center; }
.exam-status-right { justify-self: end; max-width: 240px; }

.exam-rules-box {
  background: var(--blue-wash); border: 1px solid var(--blue-line); border-radius: var(--radius);
  padding: .7rem .9rem; font-size: .78rem;
}
.exam-rules-box strong { display: block; color: var(--blue-deep); font-size: .78rem; margin-bottom: .2rem; }
.exam-rules-box p { margin: 0; color: var(--ink-soft); line-height: 1.4; }

/* circular countdown */
.ring-timer { position: relative; width: 72px; height: 72px; margin-top: .3rem; }
.ring-timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--rule-soft); stroke-width: 5; }
.ring-fg {
  fill: none; stroke: var(--blue); stroke-width: 5; stroke-linecap: round;
  stroke-dasharray: 194.8; stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear, stroke .2s ease;
}
.ring-value {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--mono); font-size: .96rem; font-weight: 600; font-variant-numeric: tabular-nums;
  color: var(--blue);
}
.ring-timer.low .ring-fg, .ring-timer.low .ring-value { stroke: var(--amber); color: var(--amber); }
.ring-timer.critical .ring-fg, .ring-timer.critical .ring-value { stroke: var(--flag); color: var(--flag); }
.ring-timer.critical { animation: pulse 1.6s ease-in-out infinite; }

.exam-question-card {
  background: #fff; border: 1px solid var(--rule); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: 1.35rem 1.7rem;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.exam-question-card .q-head { margin-bottom: .35rem; }
.exam-question-card .q-text { font-size: 1.08rem; color: var(--ink); line-height: 1.45; margin-bottom: 1rem; }

.answer-option {
  display: flex; align-items: center; gap: 1rem;
  width: 100%; text-align: left; font: inherit; color: var(--ink);
  background: #fff; border: 1.5px solid var(--rule); border-radius: var(--radius-lg);
  min-height: 58px; padding: .72rem 1rem; cursor: pointer;
  transition: border-color .14s ease, background .14s ease;
  user-select: none;
  -webkit-user-select: none;
}
.answer-option:hover { background: var(--blue-wash); border-color: var(--blue-line); }
.answer-option:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
/* An unlabelled dot, not a lettered bubble — options are shuffled per
   student, so a letter would look like a shared reference between students
   ("the answer is B") without meaning anything. Empty ring at rest, fills
   solid on selection, like a real answer sheet. */
.answer-dot {
  flex: none; width: 28px; height: 28px; border-radius: 50%;
  border: 1.5px solid var(--rule);
  transition: background .14s ease, border-color .14s ease;
}
.answer-option .answer-text { flex: 1; }
.answer-check { flex: none; width: 20px; height: 20px; color: var(--blue); visibility: hidden; }
.answer-option[aria-checked=true] {
  background: var(--blue-wash); border-color: var(--blue); border-width: 2px; padding: calc(.72rem - .5px) calc(1rem - .5px);
}
.answer-option[aria-checked=true] .answer-dot { background: var(--blue); border-color: var(--blue); }
.answer-option[aria-checked=true] .answer-check { visibility: visible; }
.answer-option[disabled] { cursor: not-allowed; opacity: .75; }

.answer-required-box {
  display: flex; align-items: center; gap: .85rem;
  background: var(--blue-wash); border: 1px solid var(--blue-line); border-radius: var(--radius);
  padding: .7rem .9rem; margin-top: 1rem;
}
.ic-info {
  flex: none; width: 22px; height: 22px; border-radius: 50%;
  background: var(--blue); color: #fff; font-family: var(--display); font-style: normal; font-weight: 700; font-size: .8rem;
  display: grid; place-items: center;
}
.answer-required-text { flex: 1; min-width: 0; }
.answer-required-text strong { display: block; font-size: .87rem; color: var(--blue-deep); }
.answer-required-text p { margin: .15rem 0 0; font-size: .8rem; color: var(--ink-soft); }
.mini-timer { flex: none; text-align: center; }
.mini-timer span { display: block; font-family: var(--mono); font-weight: 700; font-size: 1rem; color: var(--blue-deep); }
.mini-timer small { font-size: .66rem; letter-spacing: .06em; text-transform: uppercase; color: var(--graphite); }

.exam-actions { display: flex; justify-content: flex-end; margin-top: .95rem; }
.exam-actions .btn {
  background: var(--blue); border-color: var(--blue); font-size: .9rem; padding: .68rem 1.35rem;
  box-shadow: var(--shadow);
}
.exam-actions .btn:hover { background: var(--blue-deep); border-color: var(--blue-deep); }
.exam-actions .btn[disabled] { background: #dbe6f3; border-color: #dbe6f3; color: #90a7c2; opacity: 1; }

.btn-blue {
  background: var(--blue);
  border-color: var(--blue);
}
.btn-blue:hover {
  background: var(--blue-deep);
  border-color: var(--blue-deep);
}

.live-monitor-head { align-items: flex-start; }
.live-table-card table { min-width: 980px; }
.live-time {
  font-family: var(--mono);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.live-time.warn { color: var(--amber); }
.live-time.danger { color: var(--flag); }
.live-away {
  max-width: 220px;
  color: var(--ink-soft);
  font-size: .84rem;
  line-height: 1.45;
}
.live-note {
  width: 260px;
  min-height: 46px;
  resize: vertical;
  font-family: var(--body);
  font-size: .85rem;
  line-height: 1.35;
  padding: .55rem .65rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: #fff;
}
.live-note:focus {
  outline: 2px solid var(--blue-line);
  border-color: var(--blue);
}

.import-preview {
  margin: .75rem 0;
  padding: 1rem;
  background: #fbfdff;
}
.preview-question {
  border-top: 1px solid var(--rule-soft);
  padding-top: .75rem;
  margin-top: .75rem;
}
.preview-question:first-of-type {
  border-top: 0;
  padding-top: 0;
}
.preview-question strong {
  display: block;
  color: var(--ink);
  line-height: 1.45;
}
.preview-question ol {
  margin: .55rem 0 0 1.25rem;
  color: var(--ink-soft);
  line-height: 1.5;
}
.bank-edit-options {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin: .45rem 0 1rem;
}
.bank-edit-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: .6rem;
  align-items: center;
}
.bank-edit-option input {
  min-width: 0;
}

.exam-rule-strip { text-align: center; margin: .9rem 0 0; font-size: .76rem; color: var(--graphite); }

@media (min-width: 861px) and (max-height: 820px) {
  .exam-header-inner {
    padding-top: .55rem;
    padding-bottom: .55rem;
  }
  .exam-brand img {
    width: 30px;
    height: 30px;
  }
  .exam-brand span {
    font-size: .64rem;
  }
  .exam-quizinfo strong {
    font-size: .92rem;
  }
  .exam-quizinfo .meta-row {
    margin-top: .2rem;
  }
  .exam-student-card {
    padding: .38rem .65rem;
  }
  .exam-avatar {
    width: 30px;
    height: 30px;
  }
  .exam-body2 {
    padding-top: .55rem;
    padding-bottom: 1rem;
  }
  .exam-status-card {
    grid-template-columns: 145px minmax(160px, 1fr) minmax(220px, 260px);
    gap: .85rem;
    padding: .58rem .9rem;
    margin-bottom: .7rem;
  }
  .exam-status-card .eyebrow {
    font-size: .68rem;
    letter-spacing: .12em;
  }
  .exam-status-left strong {
    font-size: 1.05rem;
  }
  .exam-rules-box {
    padding: .55rem .7rem;
  }
  .exam-rules-box p {
    line-height: 1.32;
  }
  .ring-timer {
    width: 62px;
    height: 62px;
    margin-top: .15rem;
  }
  .ring-bg,
  .ring-fg {
    stroke-width: 6;
  }
  .ring-value {
    font-size: .85rem;
  }
  .exam-question-card {
    padding: 1rem 1.35rem;
  }
  .exam-question-card .q-text {
    font-size: 1rem;
    line-height: 1.38;
    margin-bottom: .72rem;
  }
  .choices {
    gap: .42rem;
  }
  .answer-option {
    min-height: 48px;
    gap: .75rem;
    border-radius: 10px;
    padding: .52rem .78rem;
  }
  .answer-option[aria-checked=true] {
    padding: calc(.52rem - .5px) calc(.78rem - .5px);
  }
  .answer-dot {
    width: 24px;
    height: 24px;
  }
  .answer-check {
    width: 18px;
    height: 18px;
  }
  .answer-required-box {
    margin-top: .65rem;
    padding: .55rem .7rem;
  }
  .answer-required-text strong {
    font-size: .82rem;
  }
  .answer-required-text p {
    font-size: .74rem;
  }
  .mini-timer span {
    font-size: .9rem;
  }
  .exam-actions {
    margin-top: .65rem;
  }
  .exam-actions .btn {
    padding: .58rem 1.1rem;
  }
  .exam-rule-strip {
    margin-top: .55rem;
    font-size: .7rem;
  }
}

@media (max-width: 860px) {
  .exam-header-inner { flex-wrap: wrap; }
  .exam-header-divider { display: none; }
  .exam-quizinfo { order: 3; flex-basis: 100%; }
  .exam-status-card { grid-template-columns: 1fr; text-align: center; gap: 1rem; }
  .exam-status-left, .exam-status-right { justify-self: center; text-align: center; }
  .exam-question-card { padding: 1.5rem 1.25rem; }
}
@media (max-width: 560px) {
  .exam-brand span:not(.exam-brand-tag) { display: none; }
  .exam-student-card span { display: block; }
  .answer-required-box { flex-wrap: wrap; }
  .mini-timer { flex-basis: 100%; text-align: left; }
}
/* --------------------------------------------- BBINS instructor shell v2 */

#screen-app {
  min-height: 100vh;
  background:
    radial-gradient(circle at 58% 0%, rgba(26, 115, 232, .08), transparent 34rem),
    linear-gradient(180deg, #f8fbff 0%, #eef5ff 100%);
  --bbins: #075ee8;
  --bbins-deep: #063b96;
  --bbins-soft: #eaf2ff;
  --bbins-rule: #d6e4f7;
}

#screen-app h1,
#screen-app h2,
#screen-app h3 {
  letter-spacing: 0;
}

.top {
  position: fixed;
  inset: 0 0 auto 0;
  height: 72px;
  padding: 0 1.75rem;
  border-bottom: 1px solid #dce7f6;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(18px);
  box-shadow: 0 6px 22px rgba(27, 64, 116, .06);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: .75rem;
  min-width: 320px;
  color: #071a44;
}

.brand-lockup strong {
  display: block;
  font-family: var(--display);
  font-size: 1.16rem;
  line-height: 1;
}

.brand-lockup small,
.brand-lockup em {
  display: block;
  font-style: normal;
  line-height: 1.15;
  color: #123b7a;
}

.brand-lockup small { font-size: .78rem; font-weight: 600; margin-top: .2rem; }
.brand-lockup em { font-size: .7rem; }

.bbins-seal {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle, #fff 0 39%, transparent 40%),
    conic-gradient(from 25deg, #0a6bff, #7547ff, #0a6bff);
  box-shadow: inset 0 0 0 3px #fff, 0 0 0 1px #b9ccf0;
  flex: none;
}

.bbins-seal i {
  width: 18px;
  height: 24px;
  border-radius: 9px 9px 5px 5px;
  border: 2px solid #12a36c;
  border-top-color: #ef3d52;
}

.global-search {
  width: min(34vw, 340px);
  height: 40px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: 0 .85rem;
  border: 1px solid #d7e2f2;
  border-radius: 8px;
  background: #f8fbff;
  color: #43618d;
  box-shadow: inset 0 1px 2px rgba(17, 45, 89, .03);
}

.global-search input,
.bank-search input {
  border: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
  font-size: .87rem;
}

.global-search input:focus,
.bank-search input:focus {
  box-shadow: none;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border: 1px solid #d7e2f2;
  border-radius: 8px;
  background: #fff;
  color: #173b72;
  display: grid;
  place-items: center;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.lucide {
  display: block;
  flex: none;
}

.notify {
  position: relative;
  color: #173b72;
}

.notify::before {
  content: none;
}

.notify::after {
  content: '3';
  position: absolute;
  top: -7px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #ff3333;
  color: #fff;
  font-size: .68rem;
  line-height: 18px;
  text-align: center;
}

.profile-chip {
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  gap: .6rem;
  cursor: pointer;
  color: #092254;
  min-width: 126px;
}

.profile-chip b,
.profile-chip small {
  display: block;
  text-align: left;
  line-height: 1.15;
}

.profile-chip b { font-size: .82rem; }
.profile-chip small { color: #496895; font-size: .72rem; }

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 58% 33%, #0b63ee 0 26%, transparent 27%),
    radial-gradient(circle at 70% 82%, #0b63ee 0 18%, transparent 19%),
    radial-gradient(circle at 34% 77%, #78b7ff 0 25%, transparent 26%),
    #eaf3ff;
  box-shadow: 0 0 0 6px #f1f7ff;
}

.side {
  position: fixed;
  top: 72px;
  left: 0;
  bottom: 0;
  width: 236px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.4rem .85rem 1rem;
  border-right: 1px solid #dce7f6;
  background: rgba(247, 251, 255, .9);
}

.nav {
  display: grid;
  gap: .42rem;
  margin: 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: .78rem;
  width: 100%;
  padding: .72rem .9rem;
  border-radius: 8px;
  color: #405d8e;
  font-size: .93rem;
  text-align: left;
}

.nav-item span {
  width: 20px;
  display: inline-grid;
  place-items: center;
  color: #416aa9;
}

.nav-item:hover {
  color: #0d2a5f;
  background: #f0f6ff;
}

.nav-item.on {
  color: #0057df;
  background: #e8f2ff;
  box-shadow: inset 0 0 0 1px rgba(7, 94, 232, .04);
}

.nav-item.on span { color: #0057df; }

.side-bottom {
  margin-top: auto;
  display: grid;
  gap: .7rem;
}

.learn-card,
.year-card {
  border: 1px solid #dce7f6;
  border-radius: 8px;
  background: rgba(255, 255, 255, .82);
  box-shadow: 0 10px 30px rgba(35, 72, 119, .06);
}

.learn-card {
  padding: 1rem;
}

.learn-card strong {
  display: block;
  font-size: .86rem;
  color: #071a44;
}

.learn-card p {
  color: #071a44;
  font-size: .86rem;
}

.learn-card i {
  display: block;
  width: 100%;
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, #075ee8 0 20%, #c9dbf6 20%);
}

.book-stack {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin: 0 0 .6rem .4rem;
  border-radius: 8px;
  color: #075ee8;
  background: #eaf2ff;
}

.year-card {
  padding: .9rem 1rem;
}

.year-card strong,
.year-card span {
  display: block;
  font-size: .84rem;
}

.year-card strong { color: #14366d; }
.year-card span { color: #5874a1; }

.wrap {
  max-width: none;
  margin: 0 0 0 236px;
  padding: 96px 1.35rem 2rem;
}

body.instructor .side,
body.instructor .wrap {
  transition:
    margin 230ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 230ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 200ms ease,
    padding 230ms cubic-bezier(0.22, 1, 0.36, 1);
}

body.instructor.course-mode .side {
  pointer-events: none;
  opacity: 0;
  transform: translateX(-102%);
}

body.instructor.course-mode #view-course.wrap {
  margin-left: 0;
  padding-inline: clamp(1rem, 2vw, 1.9rem);
}

.btn {
  border-color: var(--bbins);
  background: var(--bbins);
  border-radius: 7px;
  box-shadow: 0 8px 20px rgba(7, 94, 232, .14);
}

.btn:hover {
  background: var(--bbins-deep);
  border-color: var(--bbins-deep);
}

.btn-quiet {
  background: #fff;
  color: #075ee8;
  border-color: #b9d2fb;
  box-shadow: none;
}

.btn-quiet:hover {
  background: #f3f8ff;
  border-color: #82aff4;
  color: #064fbf;
}

.btn-soft {
  background: #eaf2ff;
  color: #315b96;
  border-color: #eaf2ff;
  box-shadow: none;
}

.btn-delete {
  background: #fff0f0;
  color: #e01f2d;
  border-color: #ffd2d2;
  box-shadow: none;
}

.btn-delete:hover {
  background: #e01f2d;
  border-color: #e01f2d;
  color: #fff;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
}

.btn-icon .lucide {
  width: 18px;
  height: 18px;
}

.admin-dashboard {
  display: grid;
  gap: 1rem;
}

.admin-dashboard-head {
  display: flex;
  align-items: flex-end;
  gap: 1.25rem;
  justify-content: space-between;
}

.admin-dashboard-head h1 {
  margin-top: .35rem;
  color: #071a44;
  font-size: 1.9rem;
}

.admin-dashboard-head p:not(.eyebrow) {
  margin-top: .35rem;
  color: #4f6c9a;
}

.dashboard-view-select {
  width: 220px;
  margin: 0;
  display: grid;
  gap: .35rem;
  color: #173b72;
  font-size: .82rem;
  font-weight: 700;
}

.dashboard-view-select select,
.admin-panel-head select {
  height: 38px;
  border-color: #d6e3f4;
  border-radius: 7px;
  background-color: #fff;
  color: #102b5f;
}

.admin-summary-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: .75rem;
}

.admin-summary-card,
.admin-panel {
  border: 1px solid #dbe7f7;
  border-radius: 8px;
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 10px 36px rgba(30, 76, 128, .06);
}

.admin-summary-card {
  min-height: 132px;
  padding: .95rem;
  display: grid;
  align-content: start;
  gap: .38rem;
}

.admin-summary-card > span,
.quick-action-grid span,
.admin-list > button > span,
.dashboard-course-grid > button > span {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #eaf2ff;
  color: #075ee8;
}

.admin-summary-card.green > span { background: #e7f8ef; color: #11945f; }
.admin-summary-card.purple > span { background: #f0ebff; color: #7752db; }
.admin-summary-card.orange > span { background: #fff2df; color: #d68113; }
.admin-summary-card.red > span { background: #fff0f3; color: #d92b58; }
.admin-summary-card.cyan > span { background: #e7f8fb; color: #0783a3; }

.admin-summary-card p {
  margin: .2rem 0 0;
  color: #536f9b;
  font-size: .82rem;
  font-weight: 600;
}

.admin-summary-card strong {
  color: #071a44;
  font-size: 1.65rem;
  line-height: 1;
}

.admin-summary-card small {
  color: #55719c;
  font-size: .78rem;
}

.admin-dashboard-main,
.admin-dashboard-secondary {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, .8fr);
  gap: 1rem;
}

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

.admin-panel {
  padding: 1rem;
  min-width: 0;
}

.admin-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .9rem;
}

.admin-panel-head h2 {
  color: #071a44;
  font-size: 1rem;
}

.admin-panel-head p {
  margin-top: .18rem;
  color: #607ba5;
  font-size: .82rem;
}

.performance-panel {
  min-height: 292px;
}

.dashboard-chart {
  height: 190px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: .75rem;
  align-items: end;
  padding: .5rem .2rem 0;
}

.chart-month {
  height: 100%;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: .45rem;
  color: #607ba5;
  font-size: .75rem;
  text-align: center;
}

.chart-bars {
  min-height: 0;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: .24rem;
  border-bottom: 1px solid #e2ebf7;
}

.chart-bars i {
  width: 10px;
  max-height: 100%;
  border-radius: 999px 999px 0 0;
}

.chart-bars .attempts,
.chart-legend .attempts::before { background: #075ee8; }
.chart-bars .grade,
.chart-legend .grade::before { background: #27a66d; }
.chart-bars .attendance,
.chart-legend .attendance::before { background: #7752db; }

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: .85rem;
  color: #536f9b;
  font-size: .78rem;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}

.chart-legend span::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.admin-list {
  display: grid;
  gap: .55rem;
}

.admin-list > button {
  min-height: 58px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: .65rem;
  border: 0;
  border-radius: 8px;
  background: #f8fbff;
  color: #173b72;
  text-align: left;
  cursor: pointer;
  padding: .6rem;
}

.admin-list.compact > button {
  grid-template-columns: 36px minmax(0, 1fr) auto;
}

.admin-list.warning > button > span {
  background: #fff2df;
  color: #d68113;
}

.admin-list b,
.dashboard-course-grid b {
  min-width: 0;
  color: #071a44;
  font-size: .86rem;
}

.admin-list small,
.dashboard-course-grid small {
  display: block;
  margin-top: .12rem;
  color: #607ba5;
  font-weight: 500;
}

.admin-list em,
.dashboard-course-grid em {
  color: #6f87ac;
  font-style: normal;
  font-size: .76rem;
  white-space: nowrap;
}

.quick-action-grid,
.role-card-grid,
.dashboard-course-grid {
  display: grid;
  gap: .6rem;
}

.quick-action-grid {
  grid-template-columns: 1fr 1fr;
}

.quick-action-grid button,
.dashboard-course-grid button {
  border: 1px solid #dbe7f7;
  border-radius: 8px;
  background: #fbfdff;
  color: #173b72;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}

.quick-action-grid button {
  min-height: 78px;
  display: grid;
  align-content: center;
  gap: .45rem;
  padding: .7rem;
}

.role-card-grid {
  grid-template-columns: repeat(3, 1fr);
}

.role-card {
  display: grid;
  place-items: center;
  gap: .28rem;
  min-height: 116px;
  border-radius: 8px;
  background: #f8fbff;
  color: #173b72;
}

.role-card i {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: conic-gradient(#075ee8 calc(var(--pct) * 1%), #dce7f6 0);
}

.role-card.purple i { background: conic-gradient(#7752db calc(var(--pct) * 1%), #e5dcff 0); }
.role-card.green i { background: conic-gradient(#27a66d calc(var(--pct) * 1%), #dbf4e8 0); }

.role-card b {
  color: #071a44;
  font-size: 1.2rem;
}

.role-card span,
.admin-note {
  color: #607ba5;
  font-size: .78rem;
  text-align: center;
}

.admin-note {
  margin-top: .75rem;
}

.dashboard-course-grid {
  grid-template-columns: repeat(4, minmax(120px, 1fr));
}

.dashboard-course-grid button {
  min-height: 142px;
  display: grid;
  gap: .35rem;
  padding: .8rem;
}

.dashboard-course-grid button > svg {
  justify-self: end;
  color: #6f87ac;
}

/* ---------------------------------------------------------- classes page */
.classes-page {
  display: grid;
  gap: 1rem;
}

.classes-page .course-page-head {
  gap: .65rem;
  flex-wrap: wrap;
}

.classes-filter-card {
  position: sticky;
  top: 72px;
  z-index: 8;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(190px, 1fr) minmax(160px, 1fr) auto;
  gap: .85rem;
  align-items: end;
  padding: .95rem;
  border: 1px solid #d8e4f0;
  border-radius: 14px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 12px 28px rgba(21, 61, 108, .08);
  backdrop-filter: blur(10px);
}

.classes-filter-card label {
  display: grid;
  gap: .35rem;
  color: #60799b;
  font-size: .75rem;
  font-weight: 900;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.classes-filter-card select {
  min-height: 42px;
  border-color: #d8e4f0;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: .92rem;
  font-weight: 800;
  text-transform: none;
  letter-spacing: 0;
}

.classes-summary-strip {
  display: flex;
  gap: .65rem;
  flex-wrap: wrap;
  padding: .55rem;
  border: 1px solid #e2ebf6;
  border-radius: 12px;
  background: #fff;
}

.classes-summary-strip div {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 38px;
  padding: .4rem .7rem;
  border-radius: 9px;
  color: #385a84;
  background: #f6faff;
  font-size: .84rem;
  font-weight: 800;
}

.classes-summary-strip strong {
  color: var(--ink);
  font-size: 1rem;
}

.classes-summary-strip .warn {
  color: #a86108;
  background: #fff7e8;
}

.classes-table-wrap {
  overflow-x: auto;
  border: 1px solid #d8e4f0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(21, 61, 108, .06);
}

.classes-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

.classes-table th,
.classes-table td {
  padding: .8rem .75rem;
  border-bottom: 1px solid #e9f0f8;
  text-align: left;
  vertical-align: middle;
}

.classes-table th {
  color: #63758a;
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.classes-table tbody tr {
  cursor: pointer;
}

.classes-table tbody tr:hover,
.classes-table tbody tr:focus-visible {
  background: #f5faff;
  outline: none;
}

.classes-table tbody tr.closed {
  background: #f8fafc;
  opacity: .72;
}

.class-subject-cell {
  max-width: 520px;
}

.class-subject-cell strong {
  display: block;
  color: var(--ink);
  font-family: "Noto Sans Khmer", "Khmer MN", var(--body);
  font-size: 1rem;
  line-height: 1.85;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.class-subject-cell span,
.class-hours {
  display: block;
  margin-top: .25rem;
  color: var(--graphite);
  font-size: .84rem;
  line-height: 1.45;
}

.class-instructor {
  color: var(--ink);
  font-weight: 800;
}

.class-unassigned-pill {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  min-height: 34px;
  padding: .35rem .55rem;
  border: 1px solid #ffd48a;
  border-radius: 999px;
  background: #fff7e8;
  color: #9a5a05;
  font: inherit;
  font-size: .82rem;
  font-weight: 900;
  cursor: pointer;
}

.class-status {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .35rem .55rem;
  border-radius: 999px;
  font-size: .74rem;
  font-weight: 900;
}

.class-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.class-status.planned { background: #f3efff; color: #6045be; }
.class-status.planned i { background: #7452d9; }
.class-status.active { background: #eaf8f1; color: #147a4b; }
.class-status.active i { background: #1fa463; }
.class-status.closed { background: #eef2f6; color: #63758a; }
.class-status.closed i { background: #8b98a7; }

.class-row-menu-list {
  min-width: 210px;
}

.classes-empty-state,
.classes-error {
  display: grid;
  justify-items: center;
  gap: .75rem;
  padding: 2.2rem 1rem;
  border: 1px solid #d8e4f0;
  border-radius: 16px;
  background: #fff;
  text-align: center;
  box-shadow: 0 10px 28px rgba(21, 61, 108, .06);
}

.classes-empty-icon {
  width: 70px;
  height: 70px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: var(--blue-wash);
  color: var(--blue);
}

.classes-empty-state h2,
.classes-error h3 {
  color: var(--ink);
  letter-spacing: 0;
}

.classes-empty-state p {
  max-width: 620px;
  color: var(--graphite);
  font-family: "Noto Sans Khmer", "Khmer MN", var(--body);
  line-height: 1.8;
}

.classes-empty-actions {
  display: flex;
  gap: .65rem;
  flex-wrap: wrap;
  justify-content: center;
}

.classes-loading {
  display: grid;
  gap: .65rem;
  padding: 1rem;
  border: 1px solid #d8e4f0;
  border-radius: 14px;
  background: #fff;
}

.classes-loading div {
  height: 48px;
  border-radius: 10px;
  background: linear-gradient(90deg, #eef4fb, #f8fbff, #eef4fb);
  background-size: 220% 100%;
  animation: shimmer 1.4s infinite;
}

.class-assign-context {
  display: grid;
  gap: .25rem;
  margin-top: .75rem;
  padding: .8rem;
  border: 1px solid #e2ebf6;
  border-radius: 10px;
  background: #f8fbff;
}

.class-assign-context b {
  color: var(--ink);
}

.class-assign-context span {
  color: #24466f;
  font-family: "Noto Sans Khmer", "Khmer MN", var(--body);
  line-height: 1.7;
}

.class-assign-context small {
  color: var(--graphite);
  font-weight: 800;
}

.class-form-card {
  width: min(860px, calc(100vw - 2rem));
  max-height: min(92vh, 860px);
  overflow-y: auto;
  padding: 1.15rem;
  border: 1px solid #d8e4f0;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(15, 44, 78, .22);
}

.class-form-head {
  margin-bottom: 1rem;
}

.class-form-head h2 {
  display: flex;
  align-items: center;
  gap: .55rem;
  color: var(--ink);
  font-size: 1.35rem;
  letter-spacing: 0;
}

.class-form-head p {
  margin-top: .3rem;
  color: var(--graphite);
  font-size: .9rem;
}

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

.class-form-grid .wide {
  grid-column: 1 / -1;
}

.class-form-grid textarea {
  resize: vertical;
  min-height: 76px;
  font-family: "Noto Sans Khmer", "Khmer MN", var(--body);
  line-height: 1.65;
}

@keyframes shimmer {
  to { background-position: -220% 0; }
}

/* ---------------------------------------------------- instructor registry */
.instructor-registry-head h1 { margin-top: .35rem; }

.instructor-registry-card {
  display: grid;
  gap: 1rem;
  padding: 1.1rem;
  border: 1px solid #d8e4f0;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(21, 61, 108, .07);
}

.instructor-registry-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.instructor-registry-card-head h2 {
  color: #10243f;
  font-size: 1.2rem;
  letter-spacing: 0;
}

.instructor-registry-card-head p {
  margin-top: .25rem;
  color: var(--graphite);
  font-size: .88rem;
}

.instructor-info-banner {
  max-width: 360px;
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  padding: .75rem .85rem;
  border: 1px solid var(--blue-line);
  border-radius: 10px;
  background: var(--blue-wash);
  color: var(--blue-deep);
  font-size: .84rem;
}

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

.instructor-summary-card {
  min-height: 126px;
  padding: 1rem;
  border: 1px solid #d8e4f0;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(23, 102, 194, .06);
}

.instructor-summary-card > span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  margin-bottom: .7rem;
  border-radius: 10px;
}

.instructor-summary-card.blue > span { background: var(--blue-wash); color: var(--blue); }
.instructor-summary-card.green > span { background: #eaf8f1; color: #168653; }
.instructor-summary-card.purple > span { background: #f3efff; color: #7254d6; }
.instructor-summary-card.orange > span { background: #fff2df; color: #d68113; }

.instructor-summary-card small {
  display: block;
  color: var(--graphite);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.instructor-summary-card strong {
  display: block;
  margin-top: .2rem;
  color: #10243f;
  font-family: var(--display);
  font-size: 1.55rem;
  line-height: 1.1;
}

.instructor-summary-card em {
  display: block;
  margin-top: .35rem;
  color: var(--graphite);
  font-size: .82rem;
  font-style: normal;
}

.instructor-filter-bar {
  display: grid;
  grid-template-columns: minmax(260px, 1.3fr) minmax(150px, .7fr) minmax(210px, .9fr) minmax(150px, .7fr) auto;
  gap: .75rem;
  align-items: center;
  padding: .85rem;
  border: 1px solid #e4edf7;
  border-radius: 10px;
  background: #f8fbff;
}

.registry-search-field {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: 0 .8rem;
  border: 1px solid #d8e4f0;
  border-radius: 10px;
  background: #fff;
  color: #5d7390;
}

.registry-search-field input {
  border: 0;
  box-shadow: none;
  padding: 0;
  background: transparent;
}

.registry-search-field input:focus { box-shadow: none; }

.instructor-filter-bar select {
  min-height: 42px;
  border-color: #d8e4f0;
  border-radius: 10px;
  background-color: #fff;
}

.instructor-registry-table-wrap {
  border: 1px solid #e4edf7;
  border-radius: 10px;
}

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

.instructor-registry-table th {
  color: #63758a;
  font-size: .7rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.instructor-registry-table td,
.instructor-registry-table th {
  padding: .85rem .75rem;
  border-bottom: 1px solid var(--rule-soft);
  text-align: left;
  vertical-align: middle;
}

.instructor-registry-table tbody tr:hover { background: #f8fbff; }

.instructor-row-identity {
  display: flex;
  align-items: center;
  gap: .8rem;
  width: 100%;
  min-width: 0;
  padding: .2rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.instructor-row-identity:hover,
.instructor-row-identity:focus-visible {
  background: #eef6ff;
  outline: none;
}

.instructor-row-identity b {
  color: var(--ink);
  font-weight: 800;
}

.instructor-row-identity small {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-wrap: wrap;
  margin-top: .25rem;
  color: var(--graphite);
  font-size: .78rem;
}

.instructor-registry-pagination { margin-top: .25rem; }

.account-modal-veil {
  background: rgba(15, 23, 42, .36);
  backdrop-filter: blur(4px);
}

.account-modal-card {
  width: min(1020px, calc(100vw - 2rem));
  max-height: min(92vh, 880px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #d8e4f0;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(15, 44, 78, .22);
}

.account-modal-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 1.25rem 1.35rem;
  border-bottom: 1px solid #e5edf7;
  background: linear-gradient(180deg, #fff, #f8fbff);
}

.account-modal-head h2 {
  color: #10243f;
  font-size: 1.35rem;
  letter-spacing: 0;
}

.account-modal-head p,
.account-modal-note {
  color: var(--graphite);
  font-size: .86rem;
}

.account-modal-body {
  display: grid;
  gap: 1rem;
  overflow-y: auto;
  padding: 1rem 1.35rem 1.15rem;
  background: #f6f9fd;
}

.account-modal-card .notice { margin: 1rem 1.35rem 0; }

.account-modal-note {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
}

/* ------------------------------------------------ staff / instructor profile */
.staff-back-link {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  margin-bottom: .9rem;
  border: 0;
  background: transparent;
  color: var(--blue);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.staff-profile-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.25rem;
  border: 1px solid #d8e4f0;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(21, 61, 108, .08);
}

.staff-profile-main {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.staff-profile-avatar {
  width: 76px;
  height: 76px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #eef4fb;
  color: #627894;
}

.staff-profile-avatar.male { background: #e8f2ff; color: #176ee8; }
.staff-profile-avatar.female { background: #fff0f7; color: #d9468f; }
.staff-profile-avatar.unknown { background: #eef4fb; color: #627894; }

.staff-profile-titleline {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}

.staff-profile-titleline h1 {
  color: var(--ink);
  font-size: clamp(1.45rem, 2.5vw, 2rem);
  letter-spacing: 0;
}

.staff-profile-kh {
  margin-top: .25rem;
  color: #24466f;
  font-family: "Noto Sans Khmer", "Khmer MN", var(--body);
  line-height: 1.7;
}

.staff-profile-meta {
  margin-top: .2rem;
  color: var(--blue-deep);
  font-weight: 800;
}

.staff-profile-contact,
.staff-profile-actions {
  display: flex;
  align-items: center;
  gap: .65rem;
  flex-wrap: wrap;
}

.staff-profile-contact {
  margin-top: .55rem;
  color: var(--graphite);
  font-size: .9rem;
}

.staff-profile-contact span {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}

.staff-status {
  display: inline-flex;
  align-items: center;
  gap: .38rem;
  padding: .32rem .55rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.staff-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.staff-status.active { background: #eaf8f1; color: #147a4b; }
.staff-status.active i { background: #1fa463; }
.staff-status.inactive { background: #fff0f0; color: #c63333; }
.staff-status.inactive i { background: #e04444; }

.staff-profile-tabs {
  display: flex;
  gap: 1rem;
  margin: 1rem 0;
  overflow-x: auto;
  border-bottom: 1px solid #dbe7f7;
}

.staff-profile-tabs button {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 44px;
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: #627894;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.staff-profile-tabs button.active {
  color: var(--blue);
}

.staff-profile-tabs button.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  border-radius: 999px 999px 0 0;
  background: var(--blue);
}

.staff-profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(290px, .85fr);
  gap: 1rem;
  align-items: start;
}

.staff-profile-column,
.staff-profile-side {
  display: grid;
  gap: 1rem;
}

.staff-profile-card {
  padding: 1rem;
  border: 1px solid #d8e4f0;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(21, 61, 108, .06);
}

.staff-profile-card.tint-blue { background: linear-gradient(180deg, #f7fbff, #fff 42%); }
.staff-profile-card.tint-purple { background: linear-gradient(180deg, #f8f5ff, #fff 42%); }
.staff-profile-card.tint-teal { background: linear-gradient(180deg, #f2fbf9, #fff 45%); }
.staff-profile-card.tint-neutral { background: linear-gradient(180deg, #f8fbff, #fff 45%); }

.staff-profile-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .8rem;
  margin-bottom: .9rem;
}

.staff-profile-card-head h2 {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  color: var(--ink);
  font-size: 1.02rem;
  letter-spacing: 0;
}

.staff-profile-card-head p {
  margin-top: .2rem;
  color: var(--graphite);
  font-size: .84rem;
}

.staff-profile-grid,
.staff-profile-list {
  display: grid;
  gap: .75rem;
  margin: 0;
}

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

.staff-profile-kv {
  padding: .75rem;
  border: 1px solid #e4edf7;
  border-radius: 10px;
  background: rgba(255, 255, 255, .78);
}

.staff-profile-kv dt {
  display: flex;
  align-items: center;
  gap: .38rem;
  color: #6a7e98;
  font-size: .74rem;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.staff-profile-kv dd {
  margin: .3rem 0 0;
  color: var(--ink);
  font-weight: 800;
  line-height: 1.45;
}

.staff-course-table-wrap {
  overflow-x: auto;
  border: 1px solid #e4edf7;
  border-radius: 12px;
}

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

.staff-course-table th,
.staff-course-table td {
  padding: .75rem;
  border-bottom: 1px solid var(--rule-soft);
  text-align: left;
}

.staff-course-table th {
  color: #63758a;
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.staff-course-table tr:last-child td { border-bottom: 0; }
.staff-course-table b { color: var(--ink); }

.staff-action-list {
  display: grid;
  gap: .5rem;
}

.staff-action-list button {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 18px;
  align-items: center;
  gap: .65rem;
  min-height: 46px;
  padding: .65rem .7rem;
  border: 1px solid #e4edf7;
  border-radius: 10px;
  background: #fbfdff;
  color: #173b72;
  font: inherit;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.staff-action-list button:hover {
  border-color: #c8dcf4;
  background: #f6fbff;
}

.staff-action-list button.danger {
  color: #cf2f2f;
  background: #fff8f8;
  border-color: #ffd6d6;
}

.staff-notes-box {
  min-height: 112px;
  padding: .85rem;
  border: 1px solid #e4edf7;
  border-radius: 10px;
  background: #fbfdff;
  color: var(--ink);
  line-height: 1.55;
  white-space: pre-wrap;
}

.staff-notes-box.empty-note {
  color: var(--graphite);
  font-style: italic;
}

.staff-note-private {
  display: flex;
  align-items: center;
  gap: .35rem;
  margin-top: .65rem;
  color: var(--graphite);
  font-size: .78rem;
  font-weight: 700;
}

@media (max-width: 1120px) {
  .classes-page .course-page-head .spacer { display: none; }
  .classes-filter-card { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .classes-filter-card .btn { justify-content: center; }
  .instructor-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .instructor-filter-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .instructor-filter-bar .btn { justify-content: center; }
  .staff-profile-layout { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .instructor-registry-card-head,
  .instructor-registry-head,
  .staff-profile-hero {
    align-items: stretch;
    flex-direction: column;
  }
  .instructor-info-banner { max-width: none; }
  .classes-filter-card {
    position: static;
    grid-template-columns: 1fr;
  }
  .class-form-grid { grid-template-columns: 1fr; }
  .instructor-filter-bar { grid-template-columns: 1fr; }
  .account-modal-card { width: min(760px, calc(100vw - 1.4rem)); }
  .staff-profile-actions { width: 100%; }
  .staff-profile-actions .btn { flex: 1 1 170px; justify-content: center; }
}

@media (max-width: 560px) {
  .instructor-summary-grid { grid-template-columns: 1fr; }
  .instructor-registry-card { padding: .85rem; }
  .instructor-registry-table,
  .instructor-registry-table thead,
  .instructor-registry-table tbody,
  .instructor-registry-table tr,
  .instructor-registry-table td {
    display: block;
  }
  .instructor-registry-table thead { display: none; }
  .instructor-registry-table tr {
    margin-bottom: .75rem;
    padding: .8rem;
    border: 1px solid #e4edf7;
    border-radius: 10px;
    background: #fff;
  }
  .instructor-registry-table td {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: .65rem;
    padding: .45rem 0;
    border-bottom: 0;
  }
  .instructor-registry-table td::before {
    content: attr(data-label);
    color: var(--graphite);
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
  }
  .instructor-registry-table td[data-label="Instructor"] {
    display: block;
  }
  .instructor-registry-table td[data-label="Instructor"]::before {
    display: none;
  }
  .account-modal-veil {
    padding: .5rem;
    align-items: stretch;
  }
  .account-modal-card {
    width: 100%;
    max-height: calc(100vh - 1rem);
    border-radius: 14px;
  }
  .account-modal-head {
    grid-template-columns: 56px minmax(0, 1fr) 38px;
    padding: 1rem;
  }
  .account-modal-body { padding: .85rem 1rem 1rem; }
  .account-modal-note { justify-content: center; }
  .classes-table { min-width: 760px; }
  .classes-empty-actions .course-primary-btn,
  .classes-empty-actions .course-secondary-btn {
    width: 100%;
    justify-content: center;
  }
  .staff-profile-hero,
  .staff-profile-card { border-radius: 12px; padding: .85rem; }
  .staff-profile-main { align-items: flex-start; }
  .staff-profile-avatar { width: 60px; height: 60px; }
  .staff-profile-grid { grid-template-columns: 1fr; }
  .staff-course-table,
  .staff-course-table thead,
  .staff-course-table tbody,
  .staff-course-table tr,
  .staff-course-table td {
    display: block;
  }
  .staff-course-table thead { display: none; }
  .staff-course-table tr {
    padding: .7rem;
    border-bottom: 1px solid #e4edf7;
  }
  .staff-course-table td {
    display: grid;
    grid-template-columns: 108px minmax(0, 1fr);
    gap: .6rem;
    padding: .35rem 0;
    border-bottom: 0;
  }
  .staff-course-table td::before {
    content: attr(data-label);
    color: var(--graphite);
    font-size: .68rem;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
  }
}

.bank-hero {
  align-items: center;
  margin-bottom: 1rem;
}

.bank-hero h1 {
  color: #071a44;
  font-size: 1.75rem;
}

.bank-hero p {
  color: #4f6c9a;
  margin-top: .25rem;
}

.crumb {
  display: flex;
  align-items: center;
  gap: .55rem;
  color: #5874a1;
  font-size: .84rem;
}

.crumb b {
  color: #86a2c8;
  font-weight: 600;
}

.bank-tabs,
.folder-panel,
.question-bank-panel {
  border: 1px solid #dbe7f7;
  background: rgba(255, 255, 255, .84);
  box-shadow: 0 10px 36px rgba(30, 76, 128, .06);
}

.bank-tabs {
  display: flex;
  gap: .2rem;
  padding: .35rem;
  border-radius: 8px;
  margin-bottom: .75rem;
}

.bank-tabs button {
  min-width: 126px;
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #405d8e;
  font: inherit;
  font-size: .85rem;
  font-weight: 600;
  padding: .62rem 1rem;
  cursor: pointer;
}

.bank-tabs .lucide,
.bank-search .lucide {
  color: #416aa9;
}

.bank-tabs button.on {
  color: #075ee8;
  background: #eaf2ff;
}

.bank-tabs button.on .lucide {
  color: #075ee8;
}

.folder-panel {
  border-radius: 8px;
  padding: .55rem .55rem .7rem;
  margin-bottom: .75rem;
  animation: bankFadeIn .16s ease both;
}

.section-head {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .2rem .1rem .65rem;
}

.section-head h2 {
  font-size: 1.12rem;
  color: #071a44;
}

.section-head .spacer,
.bank-folder-title .spacer,
.bank-list-head .spacer,
.top .spacer {
  flex: 1;
}

.bank-search {
  height: 36px;
  min-width: 260px;
  margin: 0;
  padding: 0 .75rem;
  display: flex;
  align-items: center;
  gap: .55rem;
  border: 1px solid #d6e3f4;
  border-radius: 7px;
  background: #fbfdff;
  color: #526f99;
  font-weight: 400;
}

.view-toggle {
  display: flex;
  gap: .35rem;
}

.view-toggle button {
  width: 36px;
  height: 36px;
  border: 1px solid #d6e3f4;
  border-radius: 7px;
  background: #fbfdff;
  color: #375c91;
  font-weight: 700;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.view-toggle button.on {
  background: #eaf2ff;
  border-color: #b9d2fb;
  color: #075ee8;
}

.folder-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: .7rem;
}

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

.folder-card {
  position: relative;
  min-height: 70px;
  border: 1px solid #d9e5f5;
  border-radius: 8px;
  background: #fff;
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .9rem .95rem;
  color: #091d48;
  text-align: left;
  font: inherit;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(34, 75, 122, .04);
  transition: background .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.folder-card:focus-visible {
  outline: 2px solid rgba(7, 94, 232, .35);
  outline-offset: 2px;
}

.folder-card:hover {
  transform: translateY(-1px);
  border-color: #a9c8f4;
  box-shadow: 0 10px 24px rgba(34, 75, 122, .08);
}

.folder-card.on {
  border-color: #3d86ff;
  background: #f4f9ff;
  box-shadow: inset 0 0 0 1px rgba(61, 134, 255, .18), 0 8px 22px rgba(61, 134, 255, .08);
}

.folder-card.dragging {
  opacity: .55;
}

.folder-card.drop-target {
  border-color: #075ee8;
  box-shadow: inset 0 0 0 1px rgba(7, 94, 232, .25), 0 12px 26px rgba(7, 94, 232, .12);
}

.folder-card.menu-open {
  z-index: 12;
}

.folder-card b,
.folder-card small {
  display: block;
  line-height: 1.25;
}

.folder-card b {
  font-size: .9rem;
}

.folder-card small {
  color: #55719c;
  font-size: .8rem;
  margin-top: .22rem;
}

.folder-menu-button {
  margin-left: auto;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #325888;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.folder-menu-button:hover {
  background: #eaf2ff;
  color: #075ee8;
}

.folder-menu {
  position: absolute;
  z-index: 5;
  top: calc(100% - .45rem);
  right: .75rem;
  width: 156px;
  padding: .35rem;
  border: 1px solid #d6e3f4;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 36px rgba(18, 50, 92, .16);
}

.folder-menu button {
  width: 100%;
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: .5rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #173b72;
  font: inherit;
  font-size: .84rem;
  cursor: pointer;
  padding: .45rem .5rem;
  text-align: left;
}

.folder-menu button:hover {
  background: #f2f7ff;
}

.folder-menu button.danger {
  color: #d92836;
}

.folder-card.create {
  justify-content: center;
  border-style: dashed;
  color: #075ee8;
  background: rgba(255, 255, 255, .5);
}

.folder-pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .65rem;
  padding: .75rem .15rem 0;
  color: #55719c;
  font-size: .84rem;
}

.folder-pager span {
  margin-right: auto;
}

.folder-pager b {
  min-width: 52px;
  color: #16305e;
  text-align: center;
  font-weight: 700;
}

.folder-icon {
  width: 38px;
  height: 32px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  flex: none;
  background: linear-gradient(180deg, #7db7ff, #4d96f3);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25);
  color: #fff;
}

.folder-icon::before {
  content: none;
}

.folder-icon .lucide {
  width: 22px;
  height: 22px;
}

.folder-icon.pink { background: linear-gradient(180deg, #ff8bd0, #e85cac); }
.folder-icon.green { background: linear-gradient(180deg, #80dd9c, #55c879); }
.folder-icon.purple { background: linear-gradient(180deg, #b38dff, #8c62ec); }
.folder-icon.amber { background: linear-gradient(180deg, #ffd35a, #f4b83b); }
.folder-icon.red { background: linear-gradient(180deg, #ff888f, #f35f65); }
.folder-icon.teal { background: linear-gradient(180deg, #5bd8d0, #35bbb6); }
.folder-icon.gray { background: linear-gradient(180deg, #c2ccd8, #9aa9b8); }

.question-bank-panel {
  border-radius: 8px;
  overflow: hidden;
  animation: bankFadeIn .16s ease both;
  transition: opacity .16s ease;
}

.question-bank-panel.loading .bank-list {
  opacity: .45;
}

.bank-folder-title {
  min-height: 70px;
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .85rem 1rem;
  border-bottom: 1px solid #e0e9f6;
  background: rgba(255, 255, 255, .9);
}

.bank-folder-title h2 {
  font-size: 1.22rem;
  color: #071a44;
}

.bank-folder-title p {
  color: #4f6c9a;
  font-size: .88rem;
}

.bank-workspace {
  display: grid;
  grid-template-columns: 266px minmax(0, 1fr);
}

.bank-filter {
  border-right: 1px solid #e0e9f6;
  padding: 1rem;
  background: rgba(250, 253, 255, .74);
}

.filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .9rem;
}

.filter-head h3,
.filter-group h4 {
  font-size: .86rem;
  color: #071a44;
}

.bank-filter .bank-search {
  min-width: 0;
  width: 100%;
  margin-bottom: 1rem;
}

.filter-group {
  margin-top: .95rem;
}

.filter-group label {
  display: flex;
  align-items: center;
  gap: .55rem;
  color: #1a315d;
  font-weight: 500;
  font-size: .86rem;
  margin: .52rem 0;
}

.filter-group label b {
  margin-left: auto;
  color: #446394;
  font-weight: 600;
}

.filter-group input[type=checkbox] {
  width: 16px;
  height: 16px;
  accent-color: #075ee8;
}

.filter-group select {
  height: 36px;
  font-size: .86rem;
  background-color: #fff;
}

.bank-list {
  min-width: 0;
  transition: opacity .16s ease;
}

.bank-list-head,
.bank-list-foot {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .7rem 1rem;
}

.bank-list-head {
  border-bottom: 1px solid #e0e9f6;
  background: linear-gradient(180deg, #fbfdff, #f6f9fe);
  color: #16305e;
  font-size: .84rem;
}

.select-box {
  width: 18px;
  height: 18px;
  margin: 0;
  flex: none;
}

.select-box input {
  width: 18px;
  height: 18px;
  accent-color: #075ee8;
}

.bank-list-head label:last-of-type {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  margin: 0;
  white-space: nowrap;
}

.bank-list-head select,
.bank-list-foot select {
  width: auto;
  height: 34px;
  font-size: .84rem;
  padding: .35rem 2rem .35rem .7rem;
}

.bank-question-row {
  display: grid;
  grid-template-columns: 18px 40px minmax(0, 1fr) auto;
  align-items: start;
  gap: .75rem;
  padding: .78rem 1rem;
  border-bottom: 1px solid #e0e9f6;
  background: rgba(255, 255, 255, .82);
  animation: bankFadeIn .18s ease both;
}

.bank-question-row:hover {
  background: #f8fbff;
}

.type-badge {
  width: 38px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  font-size: .75rem;
  font-weight: 700;
  color: #075ee8;
  background: #dcecff;
}

.type-badge.tf {
  color: #098d57;
  background: #ddf7e8;
}

.bank-question-main strong {
  display: block;
  color: #081d49;
  font-size: .9rem;
  line-height: 1.35;
}

.bank-question-main p {
  margin-top: .4rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem .75rem;
  color: #526f99;
  font-size: .75rem;
}

.bank-question-main p span {
  display: inline-flex;
  align-items: center;
  gap: .28rem;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  background: #35b76e;
}

.dot.medium { background: #ff9f2d; }
.dot.hard { background: #ef4d4d; }

.bank-row-actions {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  white-space: nowrap;
  padding-top: .08rem;
}

.bank-row-actions .btn-link {
  color: #315b96;
  text-decoration: none;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: .34rem;
}

.bank-row-actions .bank-star {
  min-width: 20px;
  color: #8aa0bf;
  justify-content: center;
}

.bank-row-actions .bank-star.on {
  color: #f4a51c;
}

.bank-row-actions .btn-link.danger {
  color: #d92836;
}

@keyframes bankFadeIn {
  from { opacity: .55; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

.bank-list-foot {
  color: #405f90;
  font-size: .84rem;
}

.pager {
  display: flex;
  align-items: center;
  gap: .35rem;
  margin-left: auto;
}

.pager span {
  color: #6d86ad;
  padding: 0 .15rem;
}

.pager button {
  min-width: 34px;
  height: 34px;
  padding: 0 .55rem;
  border: 1px solid #d6e3f4;
  border-radius: 7px;
  background: #fff;
  color: #183d75;
  font: inherit;
  cursor: pointer;
}

.pager button.on {
  background: #075ee8;
  border-color: #075ee8;
  color: #fff;
}

.pager button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.bank-modal {
  max-width: 620px !important;
}

.choice-edit {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: .55rem;
  align-items: center;
  margin-bottom: .5rem;
}

.choice-edit input[type=radio] {
  accent-color: #075ee8;
}

.import-drop {
  min-height: 98px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: .2rem;
  margin: 0;
  border: 1px dashed #adc8ee;
  border-radius: 8px;
  background: #f8fbff;
  color: #1a4f9a;
  cursor: pointer;
  text-align: center;
  transition: background .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.import-drop.over {
  border-color: #075ee8;
  background: #eaf2ff;
  box-shadow: 0 0 0 3px rgba(7, 94, 232, .12);
}

.import-drop span {
  font-size: .88rem;
  font-weight: 700;
}

.import-drop small {
  color: #607da8;
  font-size: .78rem;
}

.import-drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

body.instructor .top-brand {
  min-width: 340px;
  gap: .75rem;
}

body.instructor .top-brand img {
  width: 45px;
  height: 45px;
  border-radius: 50%;
}

body.instructor .top-brand strong {
  font-size: 1.16rem;
  color: #071a44;
}

body.instructor .top-brand span,
body.instructor .top-brand small {
  color: #123b7a;
}

body.instructor .top-brand small {
  font-size: .7rem;
}

@media (max-width: 1120px) {
  .admin-summary-grid { grid-template-columns: repeat(3, 1fr); }
  .admin-dashboard-secondary,
  .dashboard-course-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-dashboard-main { grid-template-columns: 1fr; }
  .folder-grid { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
  .bank-folder-title { flex-wrap: wrap; }
}

@media (max-width: 860px) {
  .top {
    position: static;
    height: auto;
    padding: .8rem 1rem;
  }

  .brand-lockup { min-width: 0; }
  .global-search { order: 4; width: 100%; }
  .side {
    position: static;
    width: auto;
    border-right: 0;
    border-bottom: 1px solid #dce7f6;
  }

  .side-bottom { display: none; }
  .nav { display: flex; overflow-x: auto; }
  .nav-item { width: auto; white-space: nowrap; }
  .wrap { margin: 0; padding: 1rem 1rem 2rem; }
  .admin-dashboard-head {
    align-items: stretch;
    flex-direction: column;
  }
  .dashboard-view-select { width: 100%; }
  .admin-summary-grid,
  .admin-dashboard-secondary,
  .dashboard-course-grid,
  .quick-action-grid,
  .role-card-grid {
    grid-template-columns: 1fr;
  }
  .admin-list > button,
  .admin-list.compact > button {
    grid-template-columns: 36px minmax(0, 1fr);
  }
  .admin-list em,
  .admin-list > button > svg {
    display: none;
  }
  .bank-tabs { overflow-x: auto; }
  .folder-grid,
  .folder-grid.list,
  .bank-workspace {
    grid-template-columns: 1fr;
  }
  .bank-filter { border-right: 0; border-bottom: 1px solid #e0e9f6; }
  .section-head { flex-wrap: wrap; }
  .bank-search { width: 100%; min-width: 0; }
  .bank-question-row {
    grid-template-columns: 18px 38px minmax(0, 1fr);
  }
  .bank-row-actions {
    grid-column: 3;
    flex-wrap: wrap;
  }
  .bank-list-foot { flex-wrap: wrap; }
  .pager { margin-left: 0; }
  .folder-pager {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .folder-pager span {
    width: 100%;
  }
  .export-format-list {
    grid-template-columns: 1fr;
  }
  .export-format {
    min-height: 86px;
  }
}
