@import url("https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400&family=Instrument+Serif:ital@0;1&display=swap");

/* ============================================================
   ILMQUEST — GLOBAL DESIGN SYSTEM
   Liquid glass · cinematic · Apple-meets-mihrab
   ============================================================ */

/* ── 1. DESIGN TOKENS ─────────────────────────────────────── */
:root {
  --obsidian: oklch(0.14 0.02 200);
  --background: oklch(0.13 0.022 200);
  --foreground: oklch(0.97 0.01 180);
  --emerald-deep: oklch(0.5 0.13 165);
  --teal-glow: oklch(0.72 0.13 190);
  --cyan-soft: oklch(0.85 0.09 200);
  --glass: oklch(1 0 0 / 0.04);
  --glass-strong: oklch(1 0 0 / 0.08);
  --destructive: oklch(0.62 0.21 25);
  --border: oklch(1 0 0 / 0.08);
  --input: oklch(1 0 0 / 0.1);
  --ring: oklch(0.72 0.13 188 / 0.55);

  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 0.875rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.25rem;
  --radius-3xl: 1.5rem;

  --shadow-glass:
    inset 0 1px 0 oklch(1 0 0 / 0.06),
    0 30px 60px -20px oklch(0 0 0 / 0.5),
    0 8px 24px -8px oklch(0 0 0 / 0.4);
  --shadow-glow: 0 0 40px -10px oklch(0.72 0.13 190 / 0.55);
  --shadow-glow-emerald: 0 0 60px -15px oklch(0.5 0.14 165 / 0.65);

  --gradient-primary: linear-gradient(135deg, oklch(0.5 0.14 165), oklch(0.72 0.13 190));
  --gradient-text: linear-gradient(135deg, oklch(0.97 0.01 180) 0%, oklch(0.85 0.09 200) 50%, oklch(0.7 0.13 165) 100%);
}

/* ── 2. PER-ROLE ACCENT OVERRIDES ─────────────────────────── */
body.role-shell-page {
  --role-accent-start: var(--emerald-deep);
  --role-accent-end: var(--teal-glow);
  --role-accent-soft: color-mix(in oklab, var(--role-accent-end) 38%, white 62%);
  --role-surface: color-mix(in oklab, var(--background) 88%, white 12%);
  --role-surface-strong: color-mix(in oklab, var(--background) 82%, white 18%);
  --role-border: oklch(1 0 0 / 0.08);
  --role-border-strong: oklch(1 0 0 / 0.14);
  --role-copy: var(--foreground);
  --role-copy-soft: oklch(0.84 0.015 190 / 0.75);
  --role-copy-muted: oklch(0.77 0.012 190 / 0.58);
  --role-shadow: 0 24px 80px rgba(0, 0, 0, 0.3);
  --role-inner-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
body.role-shell-page--teacher {
  --role-accent-start: var(--emerald-deep);
  --role-accent-end: var(--teal-glow);
}
body.role-shell-page--student {
  --role-accent-start: oklch(0.72 0.13 190);
  --role-accent-end: oklch(0.74 0.14 285);
}
body.role-shell-page--parent {
  --role-accent-start: oklch(0.74 0.13 55);
  --role-accent-end: oklch(0.72 0.12 30);
}
body.role-shell-page--admin {
  --role-accent-start: oklch(0.78 0.14 70);
  --role-accent-end: oklch(0.7 0.13 35);
}
body.role-shell-page--super-admin {
  --role-accent-start: var(--sa-accent-start, oklch(0.5 0.13 165));
  --role-accent-end:   var(--sa-accent-end,   oklch(0.62 0.17 155));
}

/* ── 3. RESET & BASE ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body.role-shell-page {
  margin: 0;
  min-height: 100vh;
  color: var(--role-copy);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(circle at 10% 12%, color-mix(in oklab, var(--role-accent-start) 28%, transparent 72%), transparent 24rem),
    radial-gradient(circle at 88% 20%, color-mix(in oklab, var(--role-accent-end) 22%, transparent 78%), transparent 22rem),
    radial-gradient(circle at 50% 0%, color-mix(in oklab, var(--role-accent-end) 10%, transparent 90%), transparent 28rem),
    linear-gradient(180deg, #0d1a16 0%, #091411 40%, #050c0b 100%);
}
body.role-shell-page a { color: inherit; text-decoration: none; }
body.role-shell-page img, body.role-shell-page svg { display: block; }

/* Aurora grain overlay */
body.role-shell-page::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 8% 30%, rgba(255,255,255,0.28) 0, rgba(255,255,255,0.28) 1.5px, transparent 2.5px),
    radial-gradient(circle at 22% 72%, rgba(255,255,255,0.18) 0, rgba(255,255,255,0.18) 1.2px, transparent 2px),
    radial-gradient(circle at 56% 18%, rgba(255,255,255,0.14) 0, rgba(255,255,255,0.14) 1.2px, transparent 2px),
    radial-gradient(circle at 74% 38%, rgba(255,255,255,0.2) 0, rgba(255,255,255,0.2) 1.4px, transparent 2.2px),
    radial-gradient(circle at 90% 78%, rgba(255,255,255,0.14) 0, rgba(255,255,255,0.14) 1px, transparent 2px);
  opacity: 0.28;
}

/* ── 4. SHELL LAYOUT ──────────────────────────────────────── */
.role-app-shell {
  display: flex;
  min-height: 100vh;
}

.role-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 256px;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1.25rem 1rem 1rem;
  background:
    linear-gradient(160deg,
      color-mix(in oklab, var(--role-accent-start) 12%, transparent 88%) 0%,
      transparent 60%),
    oklch(1 0 0 / 0.04);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border-right: 1px solid var(--role-border);
  box-shadow: var(--shadow-glass);
  border-radius: 0 var(--radius-3xl) var(--radius-3xl) 0;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  overflow-y: auto;
  scrollbar-width: none;
}
.role-sidebar::-webkit-scrollbar { display: none; }

.role-main-shell {
  min-height: 100vh;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 2rem 3rem;
}

/* ── 5. BRAND / LOGO ──────────────────────────────────────── */
.role-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.5rem 0.75rem;
  border: none;
  background: transparent;
  cursor: pointer;
  width: 100%;
  text-align: left;
  border-bottom: 1px solid var(--role-border);
  margin-bottom: 0.5rem;
}
.role-brand-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.role-brand-icon img { width: 100%; height: 100%; object-fit: cover; }
.role-brand-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--role-copy);
  margin: 0;
  line-height: 1.2;
}
.role-brand-role {
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--role-copy-muted);
  margin: 0;
}

/* ── 6. SIDEBAR NAV ───────────────────────────────────────── */
.role-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}
.role-sidebar-nav-group {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding-bottom: 0.5rem;
  margin-bottom: 0.25rem;
  border-bottom: 1px solid var(--role-border);
}
.role-sidebar-nav-label {
  font-size: 0.6rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--role-copy-muted);
  padding: 0.5rem 0.75rem 0.25rem;
  margin: 0;
}
.role-sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-lg);
  font-size: 0.825rem;
  font-weight: 500;
  color: var(--role-copy-soft);
  transition: all 0.18s ease;
  position: relative;
  min-height: 44px;
}
.role-sidebar-link:hover {
  background: oklch(1 0 0 / 0.05);
  color: var(--role-copy);
}
.role-sidebar-link.active {
  background: linear-gradient(135deg,
    color-mix(in oklab, var(--role-accent-start) 18%, transparent 82%),
    color-mix(in oklab, var(--role-accent-end) 12%, transparent 88%));
  color: var(--role-copy);
  box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.08);
}
.role-sidebar-link.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--role-accent-start), var(--role-accent-end));
  box-shadow: 0 0 8px var(--role-accent-end);
}
.role-sidebar-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.role-sidebar-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.role-sidebar-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── 7. SIDEBAR WIDGETS ───────────────────────────────────── */
.role-rail-widget {
  margin-top: auto;
  padding: 0.875rem;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg,
    color-mix(in oklab, var(--role-accent-start) 14%, transparent 86%),
    color-mix(in oklab, var(--role-accent-end) 8%, transparent 92%));
  border: 1px solid var(--role-border);
  box-shadow: var(--role-inner-highlight);
}
.role-rail-widget-kicker {
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--role-accent-soft);
  margin: 0 0 0.25rem;
}
.role-rail-widget h3 {
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 0.95rem;
  font-weight: 400;
  margin: 0 0 0.25rem;
  color: var(--role-copy);
  line-height: 1.3;
}
.role-rail-widget p {
  font-size: 0.72rem;
  color: var(--role-copy-muted);
  margin: 0 0 0.625rem;
  line-height: 1.5;
}
.role-rail-widget-meter {
  height: 2px;
  border-radius: 99px;
  background: var(--role-border);
  overflow: hidden;
}
.role-rail-widget-meter span {
  display: block;
  height: 100%;
  width: 68%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--role-accent-start), var(--role-accent-end));
  box-shadow: 0 0 8px var(--role-accent-end);
}

/* ── 8. SIDEBAR PROFILE ───────────────────────────────────── */
.role-sidebar-profile {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 0.5rem;
  border-radius: var(--radius-lg);
  margin-top: 0.5rem;
  border-top: 1px solid var(--role-border);
  padding-top: 0.75rem;
  transition: background 0.15s;
  min-height: 44px;
}
.role-sidebar-profile:hover { background: oklch(1 0 0 / 0.04); }
.role-profile-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--role-accent-start), var(--role-accent-end));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  overflow: hidden;
}
.role-profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.role-profile-meta { min-width: 0; }
.role-profile-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--role-copy);
  margin: 0;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.role-profile-role {
  font-size: 0.62rem;
  color: var(--role-copy-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin: 0;
}

/* ── 9. SIDEBAR SCRIM ─────────────────────────────────────── */
.role-sidebar-scrim {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 30;
  background: oklch(0 0 0 / 0.5);
  backdrop-filter: blur(2px);
  border: none;
  cursor: pointer;
}

/* ── 10. PAGE HEADER ──────────────────────────────────────── */
.role-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--role-border);
}
.role-page-title { min-width: 0; }
.role-page-kicker {
  font-size: 0.65rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--role-copy-muted);
  margin: 0 0 0.35rem;
}
.role-page-title h1,
.role-page-title h2 {
  font-family: "Instrument Serif", Georgia, serif;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 400;
  margin: 0 0 0.35rem;
  color: var(--role-copy);
  line-height: 1.15;
}
.role-page-title p {
  font-size: 0.875rem;
  color: var(--role-copy-soft);
  margin: 0;
  max-width: 52ch;
}

/* ── 11. GLASS CARDS ──────────────────────────────────────── */
.glass-card {
  background: var(--glass);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  border: 1px solid var(--role-border);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-glass);
  position: relative;
  overflow: hidden;
}
.glass-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, oklch(1 0 0 / 0.04) 0%, transparent 60%);
  pointer-events: none;
}
.glass-card--strong {
  background: var(--glass-strong);
}
.glass-card--elevated {
  background: oklch(1 0 0 / 0.1);
  box-shadow: var(--shadow-glass), var(--shadow-glow);
}
.glass-card--interactive {
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
}
.glass-card--interactive:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-glass), 0 0 30px -8px var(--role-accent-end);
}

/* ── 12. BUTTONS ──────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-lg);
  font-size: 0.825rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  min-height: 44px;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--role-accent-start), var(--role-accent-end));
  color: white;
  box-shadow: 0 4px 16px -4px color-mix(in oklab, var(--role-accent-end) 60%, transparent 40%);
}
.btn-primary:hover {
  filter: brightness(1.12);
  box-shadow: 0 6px 24px -6px color-mix(in oklab, var(--role-accent-end) 70%, transparent 30%);
}
.btn-ghost {
  background: oklch(1 0 0 / 0.06);
  color: var(--role-copy-soft);
  border: 1px solid var(--role-border);
}
.btn-ghost:hover {
  background: oklch(1 0 0 / 0.1);
  color: var(--role-copy);
}
.btn-danger {
  background: linear-gradient(135deg, oklch(0.55 0.2 25), oklch(0.62 0.21 25));
  color: white;
}
.btn-sm {
  padding: 0.4rem 0.875rem;
  font-size: 0.775rem;
  min-height: 36px;
  border-radius: var(--radius-md);
}
.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-md);
}

/* ── 13. STATUS PILLS / BADGES ────────────────────────────── */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.status-pill::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.status-pill.status-active, .status-pill.status-present {
  background: oklch(0.5 0.13 165 / 0.18);
  color: oklch(0.72 0.13 165);
}
.status-pill.status-pending, .status-pill.status-late {
  background: oklch(0.72 0.14 70 / 0.18);
  color: oklch(0.78 0.14 70);
}
.status-pill.status-completed, .status-pill.status-paid {
  background: oklch(0.6 0.12 180 / 0.15);
  color: oklch(0.74 0.12 180);
}
.status-pill.status-failed, .status-pill.status-absent, .status-pill.status-overdue {
  background: oklch(0.62 0.21 25 / 0.18);
  color: oklch(0.72 0.18 25);
}
.status-pill.status-open {
  background: oklch(0.65 0.18 310 / 0.15);
  color: oklch(0.75 0.15 310);
}

/* ── 14. EYEBROW / SECTION LABELS ────────────────────────── */
.section-eyebrow {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--role-copy-muted);
  margin: 0 0 0.35rem;
}
.text-gradient {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.section-title {
  font-family: "Instrument Serif", Georgia, serif;
  font-size: clamp(1.2rem, 2.5vw, 1.75rem);
  font-weight: 400;
  margin: 0 0 0.25rem;
  line-height: 1.2;
}
.section-body {
  font-size: 0.875rem;
  color: var(--role-copy-soft);
  margin: 0;
  max-width: 60ch;
}

/* ── 15. TABLES ───────────────────────────────────────────── */
.data-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-xl);
  border: 1px solid var(--role-border);
  background: oklch(1 0 0 / 0.02);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.825rem;
}
.data-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--role-copy-muted);
  border-bottom: 1px solid var(--role-border);
  background: oklch(1 0 0 / 0.02);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 2;
}
.data-table td {
  padding: 0.75rem 1rem;
  color: var(--role-copy-soft);
  border-bottom: 1px solid oklch(1 0 0 / 0.04);
  vertical-align: middle;
}
.data-table tbody tr:hover td { background: oklch(1 0 0 / 0.03); }
.data-table tbody tr:last-child td { border-bottom: none; }

/* ── 16. PROGRESS BARS ────────────────────────────────────── */
.progress-bar-wrap {
  height: 2px;
  border-radius: 99px;
  background: var(--role-border);
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--role-accent-start), var(--role-accent-end));
  transition: width 1.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 8px var(--role-accent-end);
}

/* ── 17. KPI / METRIC CARDS ───────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}
.kpi-card {
  padding: 1.25rem;
  border-radius: var(--radius-xl);
  background: oklch(1 0 0 / 0.04);
  border: 1px solid var(--role-border);
  box-shadow: var(--role-inner-highlight);
  position: relative;
  overflow: hidden;
}
.kpi-card::after {
  content: "";
  position: absolute;
  top: -20px;
  right: -20px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in oklab, var(--role-accent-end) 18%, transparent 82%) 0%, transparent 70%);
  pointer-events: none;
}
.kpi-eyebrow {
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--role-copy-muted);
  margin: 0 0 0.5rem;
}
.kpi-value {
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 2rem;
  font-weight: 400;
  color: var(--role-copy);
  margin: 0 0 0.25rem;
  line-height: 1;
}
.kpi-note {
  font-size: 0.75rem;
  color: var(--role-copy-muted);
  margin: 0;
}

/* ── 18. EMPTY STATES ─────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 2rem;
  gap: 0.75rem;
}
.empty-state-icon {
  width: 40px;
  height: 40px;
  color: var(--role-copy-muted);
  margin-bottom: 0.25rem;
}
.empty-state-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
}
.empty-state h3 {
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 1.1rem;
  font-weight: 400;
  margin: 0;
  color: var(--role-copy);
}
.empty-state p {
  font-size: 0.825rem;
  color: var(--role-copy-muted);
  margin: 0;
  max-width: 38ch;
  line-height: 1.6;
}

/* ── 19. FORM INPUTS ──────────────────────────────────────── */
.form-input {
  width: 100%;
  padding: 0.65rem 0.875rem;
  background: oklch(1 0 0 / 0.06);
  border: 1px solid var(--role-border);
  border-radius: var(--radius-lg);
  color: var(--role-copy);
  font-size: 0.875rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  min-height: 44px;
}
.form-input:focus {
  border-color: var(--role-accent-end);
  box-shadow: 0 0 0 3px var(--ring);
}
.form-input::placeholder { color: var(--role-copy-muted); }
.form-label {
  display: block;
  font-size: 0.775rem;
  font-weight: 500;
  color: var(--role-copy-soft);
  margin-bottom: 0.375rem;
}

/* ── 19b. DROPDOWNS — unified glass <select> across every role shell ──
   Single source of truth so EVERY dropdown matches (admin, teacher, student,
   parent, super-admin, profile). Custom chevron + appearance:none make them
   render identically across browsers/OSes. Specificity (0,3,2) intentionally
   beats the per-page `body.role-shell-page select` blocks. The dense gradebook
   cell selects (.gradebook-v1-select) and multi-selects keep their own look. */
body.role-shell-page select:not([multiple]):not(.gradebook-v1-select) {
  width: 100%;
  min-height: 3rem;
  border: 1px solid var(--role-border);
  border-radius: 1rem;
  background-color: rgba(255, 255, 255, 0.04);
  color: rgba(244, 250, 248, 0.96);
  padding: 0.8rem 2.6rem 0.8rem 0.95rem;
  font: inherit;
  outline: none;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23d6e9e2' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.95rem center;
  background-size: 1.05rem 1.05rem;
}
body.role-shell-page select:not([multiple]):not(.gradebook-v1-select):focus {
  border-color: color-mix(in oklab, var(--role-accent-end) 54%, white 46%);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--role-accent-end) 16%, transparent 84%);
}
body.role-shell-page select:not([multiple]):not(.gradebook-v1-select):disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
/* Multi-selects are list boxes — same glass frame, no chevron */
body.role-shell-page select[multiple] {
  width: 100%;
  border: 1px solid var(--role-border);
  border-radius: 1rem;
  background-color: rgba(255, 255, 255, 0.04);
  color: rgba(244, 250, 248, 0.96);
  padding: 0.4rem;
  font: inherit;
  outline: none;
}
body.role-shell-page select[multiple]:focus {
  border-color: color-mix(in oklab, var(--role-accent-end) 54%, white 46%);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--role-accent-end) 16%, transparent 84%);
}
/* Open-list items readable on the dark glass theme (honored where the OS allows) */
body.role-shell-page select option,
body.role-shell-page select optgroup {
  background-color: #10201d;
  color: rgba(244, 250, 248, 0.96);
}

/* Light theme — flip the glass fill, border and chevron so selects stay legible */
html[data-theme="light"] body.role-shell-page select:not([multiple]):not(.gradebook-v1-select),
html[data-theme="light"] body.role-shell-page select[multiple] {
  background-color: oklch(1 0 0 / 0.78);
  border-color: oklch(0 0 0 / 0.12);
  color: var(--role-copy);
}
html[data-theme="light"] body.role-shell-page select:not([multiple]):not(.gradebook-v1-select) {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%230f1a18' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}
html[data-theme="light"] body.role-shell-page select option,
html[data-theme="light"] body.role-shell-page select optgroup {
  background-color: #ffffff;
  color: #0f1a18;
}

/* ── 20. TWO-PANE MESSAGING LAYOUT ───────────────────────── */
.two-pane-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 0;
  height: calc(100vh - 14rem);
  border-radius: var(--radius-2xl);
  border: 1px solid var(--role-border);
  overflow: hidden;
  background: oklch(1 0 0 / 0.02);
}
.two-pane-list {
  border-right: 1px solid var(--role-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.two-pane-list-header {
  padding: 1rem;
  border-bottom: 1px solid var(--role-border);
  flex-shrink: 0;
}
.two-pane-list-items {
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: var(--role-border) transparent;
}
.two-pane-thread-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid oklch(1 0 0 / 0.04);
  transition: background 0.12s;
  min-height: 72px;
}
.two-pane-thread-item:hover { background: oklch(1 0 0 / 0.04); }
.two-pane-thread-item.active { background: oklch(1 0 0 / 0.06); }
.thread-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: white;
  background: linear-gradient(135deg, var(--role-accent-start), var(--role-accent-end));
}
.thread-meta { flex: 1; min-width: 0; }
.thread-name {
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--role-copy);
  margin: 0 0 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.thread-preview {
  font-size: 0.75rem;
  color: var(--role-copy-muted);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.thread-unread {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--role-accent-start), var(--role-accent-end));
  box-shadow: 0 0 8px var(--role-accent-end);
  flex-shrink: 0;
}
.two-pane-chat {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.two-pane-chat-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--role-border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.two-pane-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  scrollbar-width: thin;
  scrollbar-color: var(--role-border) transparent;
}
.chat-bubble {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  max-width: 72%;
}
.chat-bubble.self { align-self: flex-end; align-items: flex-end; }
.chat-bubble.other { align-self: flex-start; align-items: flex-start; }
.bubble-text {
  padding: 0.6rem 0.875rem;
  border-radius: var(--radius-xl);
  font-size: 0.825rem;
  line-height: 1.55;
}
.chat-bubble.self .bubble-text {
  background: linear-gradient(135deg, var(--role-accent-start), var(--role-accent-end));
  color: white;
  border-bottom-right-radius: 4px;
}
.chat-bubble.other .bubble-text {
  background: oklch(1 0 0 / 0.07);
  color: var(--role-copy);
  border-bottom-left-radius: 4px;
  border: 1px solid var(--role-border);
}
.bubble-meta {
  font-size: 0.68rem;
  color: var(--role-copy-muted);
}
.two-pane-compose {
  padding: 0.875rem 1rem;
  border-top: 1px solid var(--role-border);
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-shrink: 0;
}
.two-pane-compose-input {
  flex: 1;
  background: oklch(1 0 0 / 0.06);
  border: 1px solid var(--role-border);
  border-radius: var(--radius-xl);
  padding: 0.6rem 1rem;
  color: var(--role-copy);
  font-size: 0.825rem;
  font-family: inherit;
  outline: none;
  resize: none;
  min-height: 42px;
}
.two-pane-compose-input:focus {
  border-color: var(--role-accent-end);
  box-shadow: 0 0 0 2px var(--ring);
}
.two-pane-compose-send {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, var(--role-accent-start), var(--role-accent-end));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: filter 0.15s;
}
.two-pane-compose-send:hover { filter: brightness(1.12); }
.two-pane-compose-send svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── 21. FILTER CHIPS ─────────────────────────────────────── */
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.875rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--role-border);
  background: oklch(1 0 0 / 0.04);
  color: var(--role-copy-soft);
  transition: all 0.15s;
  white-space: nowrap;
  min-height: 34px;
}
.filter-chip:hover { background: oklch(1 0 0 / 0.08); color: var(--role-copy); }
.filter-chip.active {
  background: linear-gradient(135deg,
    color-mix(in oklab, var(--role-accent-start) 22%, transparent 78%),
    color-mix(in oklab, var(--role-accent-end) 16%, transparent 84%));
  border-color: color-mix(in oklab, var(--role-accent-end) 40%, transparent 60%);
  color: var(--role-copy);
}

/* ── 22. ANNOUNCEMENT CARDS ───────────────────────────────── */
.announcement-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.25rem;
  border-radius: var(--radius-xl);
  background: oklch(1 0 0 / 0.03);
  border: 1px solid var(--role-border);
  transition: background 0.15s;
}
.announcement-card:hover { background: oklch(1 0 0 / 0.05); }
.announcement-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.announcement-icon-wrap svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
}
.announcement-audience-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.5rem;
  border-radius: 99px;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.06em;
}
.announcement-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--role-copy);
  margin: 0.25rem 0 0.35rem;
  line-height: 1.35;
}
.announcement-body {
  font-size: 0.825rem;
  color: var(--role-copy-soft);
  margin: 0 0 0.5rem;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.announcement-meta {
  font-size: 0.72rem;
  color: var(--role-copy-muted);
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.announcement-pin-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--role-accent-soft);
  padding: 0.1rem 0.4rem;
  border-radius: 99px;
  background: color-mix(in oklab, var(--role-accent-end) 12%, transparent 88%);
}

/* ── 23. LEADERBOARD PODIUM ───────────────────────────────── */
.podium-grid {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 1rem;
  padding: 2rem 1rem 1rem;
}
.podium-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.25rem 1rem 1rem;
  border-radius: var(--radius-2xl);
  background: oklch(1 0 0 / 0.04);
  border: 1px solid var(--role-border);
  min-width: 130px;
  text-align: center;
  position: relative;
}
.podium-tile.place-1 {
  background: linear-gradient(160deg,
    color-mix(in oklab, var(--role-accent-start) 18%, transparent 82%),
    color-mix(in oklab, var(--role-accent-end) 10%, transparent 90%));
  border-color: color-mix(in oklab, var(--role-accent-end) 35%, transparent 65%);
  box-shadow: var(--shadow-glow);
  padding-top: 1.75rem;
  min-height: 180px;
}
.podium-rank {
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 2rem;
  font-weight: 400;
  color: var(--role-copy-muted);
  line-height: 1;
}
.podium-tile.place-1 .podium-rank {
  color: var(--role-accent-soft);
  font-size: 2.5rem;
}
.podium-crown {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.4rem;
  filter: drop-shadow(0 0 8px oklch(0.8 0.18 75));
}
.podium-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--role-copy);
  margin: 0;
}
.podium-xp {
  font-size: 0.75rem;
  color: var(--role-copy-soft);
  margin: 0;
}
.podium-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--role-accent-start), var(--role-accent-end));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: white;
}

/* ── 24. PAGE-LEVEL LAYOUT HELPERS ───────────────────────── */
.page-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}
.page-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}
.page-content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.page-content-grid--2 { grid-template-columns: repeat(2, 1fr); }
.page-content-grid--3 { grid-template-columns: repeat(3, 1fr); }

/* ── 25. SEGMENTED CONTROL / TABS ────────────────────────── */
.segmented-control {
  display: inline-flex;
  gap: 2px;
  background: oklch(1 0 0 / 0.04);
  border: 1px solid var(--role-border);
  border-radius: var(--radius-xl);
  padding: 3px;
}
.segmented-btn {
  padding: 0.4rem 1rem;
  border-radius: var(--radius-lg);
  border: none;
  background: transparent;
  color: var(--role-copy-muted);
  font-size: 0.775rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s;
  min-height: 36px;
  font-family: inherit;
}
.segmented-btn.active,
.segmented-btn[aria-selected="true"] {
  background: linear-gradient(135deg,
    color-mix(in oklab, var(--role-accent-start) 20%, transparent 80%),
    color-mix(in oklab, var(--role-accent-end) 14%, transparent 86%));
  color: var(--role-copy);
}

/* ── 26. THEME TOGGLE ─────────────────────────────────────── */
.theme-toggle-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.625rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--role-border);
  background: transparent;
  color: var(--role-copy-muted);
  font-size: 0.75rem;
  cursor: pointer;
  margin-bottom: 0.25rem;
  min-height: 36px;
  font-family: inherit;
  transition: background 0.15s;
}
.theme-toggle-btn:hover { background: oklch(1 0 0 / 0.06); }
.theme-toggle-icon { font-size: 0.9rem; }

/* ── 27. SIDEBAR SEARCH ───────────────────────────────────── */
.sidebar-search-shell {
  position: relative;
  margin-bottom: 0.5rem;
}
.sidebar-search-shell input {
  width: 100%;
  padding: 0.45rem 0.75rem 0.45rem 2rem;
  background: oklch(1 0 0 / 0.05);
  border: 1px solid var(--role-border);
  border-radius: var(--radius-lg);
  color: var(--role-copy);
  font-size: 0.775rem;
  font-family: inherit;
  outline: none;
  min-height: 34px;
}
.sidebar-search-shell input:focus { border-color: var(--role-accent-end); }
.sidebar-search-icon {
  position: absolute;
  left: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--role-copy-muted);
  pointer-events: none;
}
.sidebar-search-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

/* ── 28. ROLE-SPECIFIC PILL TAGS ──────────────────────────── */
.role-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 99px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.role-pill--teacher { background: oklch(0.5 0.13 165 / 0.18); color: oklch(0.72 0.13 165); }
.role-pill--student { background: oklch(0.74 0.14 285 / 0.18); color: oklch(0.8 0.12 285); }
.role-pill--parent { background: oklch(0.74 0.13 55 / 0.18); color: oklch(0.78 0.13 55); }
.role-pill--admin { background: oklch(0.78 0.14 70 / 0.18); color: oklch(0.82 0.14 70); }

/* ── 29. ADAB REMINDER (Chat Footer) ─────────────────────── */
.adab-reminder {
  text-align: center;
  font-size: 0.7rem;
  color: var(--role-copy-muted);
  padding: 0.35rem 1rem;
  border-top: 1px solid oklch(1 0 0 / 0.04);
  font-style: italic;
}

/* ── 30. RESPONSIVE ────────────────────────────────────────── */
@media (max-width: 1024px) {
  .role-sidebar {
    transform: translateX(-100%);
    border-radius: 0 var(--radius-3xl) var(--radius-3xl) 0;
    z-index: 50;
  }
  .role-sidebar.open,
  .role-app-shell.is-sidebar-open .role-sidebar { transform: translateX(0); }
  .role-sidebar-scrim { display: block; opacity: 0; pointer-events: none; transition: opacity 0.25s; }
  .role-sidebar.open ~ .role-sidebar-scrim,
  .role-app-shell.is-sidebar-open .role-sidebar-scrim { opacity: 1; pointer-events: auto; }
  .role-main-shell { margin-left: 0; padding: 1rem 1rem 4rem; }
  .two-pane-layout { grid-template-columns: 1fr; height: auto; }
  .two-pane-list { display: none; }
  .page-content-grid--2, .page-content-grid--3 { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .podium-grid { gap: 0.5rem; }
  .podium-tile { min-width: 90px; padding: 0.875rem 0.5rem 0.875rem; }
  .data-table-wrap { border-radius: var(--radius-lg); }
  .role-page-header { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ── 31. LIGHT MODE ────────────────────────────────────────── */
html[data-theme="light"] {
  --background: oklch(0.96 0.006 185);
  --foreground: oklch(0.14 0.022 200);
  --glass: oklch(1 0 0 / 0.72);
  --glass-strong: oklch(1 0 0 / 0.88);
  --border: oklch(0 0 0 / 0.09);
  --input: oklch(0 0 0 / 0.07);
  --shadow-glass:
    inset 0 1px 0 oklch(1 0 0 / 0.85),
    0 16px 40px -10px oklch(0 0 0 / 0.1),
    0 4px 12px -4px oklch(0 0 0 / 0.07);
}

html[data-theme="light"] body.role-shell-page {
  --role-surface: oklch(0.99 0.003 185);
  --role-surface-strong: oklch(1 0 0);
  --role-border: oklch(0 0 0 / 0.09);
  --role-border-strong: oklch(0 0 0 / 0.16);
  --role-copy: oklch(0.14 0.022 200);
  --role-copy-soft: oklch(0.32 0.018 200 / 0.82);
  --role-copy-muted: oklch(0.46 0.012 200 / 0.7);
  --role-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
  --role-inner-highlight: inset 0 1px 0 oklch(1 0 0 / 0.9);
  color: var(--role-copy);
  background:
    radial-gradient(circle at 10% 12%, color-mix(in oklab, var(--role-accent-start) 8%, transparent 92%), transparent 24rem),
    radial-gradient(circle at 88% 20%, color-mix(in oklab, var(--role-accent-end) 6%, transparent 94%), transparent 22rem),
    linear-gradient(180deg, oklch(0.94 0.008 185) 0%, oklch(0.96 0.006 185) 55%, oklch(0.97 0.004 185) 100%);
}

html[data-theme="light"] body.role-shell-page::before { opacity: 0.05; }

/* The ambient bottom orb (::after) was authored for dark glass: its
   `color-mix(in oklab, <accent>, transparent)` drags lightness toward black
   (the `transparent` keyword carries black RGB), so on light surfaces it renders
   as a large dark dome. Recolor it to a soft light glow by mixing the accent with
   white instead of transparent — no black-drag — and keep it subtle. */
html[data-theme="light"] body.role-shell-page::after {
  background: radial-gradient(circle,
    color-mix(in oklab, var(--role-accent-end) 18%, white 82%) 0%,
    transparent 70%);
  opacity: 0.5;
}

html[data-theme="light"] .role-sidebar {
  background:
    linear-gradient(160deg,
      color-mix(in oklab, var(--role-accent-start) 6%, transparent 94%) 0%,
      transparent 55%),
    oklch(1 0 0 / 0.82);
  border-right-color: oklch(0 0 0 / 0.08);
  box-shadow:
    inset 0 1px 0 oklch(1 0 0 / 0.9),
    0 8px 32px -8px oklch(0 0 0 / 0.08);
}

html[data-theme="light"] .role-sidebar-brand { border-bottom-color: oklch(0 0 0 / 0.08); }

html[data-theme="light"] .sidebar-search-shell input {
  background: oklch(0 0 0 / 0.04);
  border-color: oklch(0 0 0 / 0.1);
  color: var(--role-copy);
}
html[data-theme="light"] .sidebar-search-shell input::placeholder { color: var(--role-copy-muted); }

html[data-theme="light"] .role-sidebar-nav-group { border-bottom-color: oklch(0 0 0 / 0.07); }

html[data-theme="light"] .glass-card,
html[data-theme="light"] .glass-card-subtle { background: oklch(1 0 0 / 0.78); border-color: oklch(0 0 0 / 0.08); }

html[data-theme="light"] .btn-ghost {
  border-color: oklch(0 0 0 / 0.13);
  color: var(--role-copy-soft);
}
html[data-theme="light"] .btn-ghost:hover { background: oklch(0 0 0 / 0.04); }

html[data-theme="light"] .theme-toggle-btn { border-color: oklch(0 0 0 / 0.12); }
html[data-theme="light"] .theme-toggle-btn:hover { background: oklch(0 0 0 / 0.05); }

html[data-theme="light"] .form-input,
html[data-theme="light"] .form-select,
html[data-theme="light"] .form-textarea {
  background: oklch(1 0 0 / 0.75);
  border-color: oklch(0 0 0 / 0.12);
  color: var(--role-copy);
}
html[data-theme="light"] .form-input::placeholder,
html[data-theme="light"] .form-textarea::placeholder { color: var(--role-copy-muted); }

html[data-theme="light"] .data-table-wrap { background: oklch(1 0 0 / 0.72); border-color: oklch(0 0 0 / 0.08); }
html[data-theme="light"] .data-table th { border-bottom-color: oklch(0 0 0 / 0.08); color: var(--role-copy-muted); }
html[data-theme="light"] .data-table td { border-bottom-color: oklch(0 0 0 / 0.05); }
html[data-theme="light"] .data-table tbody tr:hover { background: oklch(0 0 0 / 0.02); }

/* ============================================================
   Light-mode TEXT corrections for role-shell content pages.
   Generated by backend/scripts/gen-teacher-light-overrides.js — these
   selectors hardcode near-white text authored for dark glass; on the
   forced-light surfaces that text is unreadable. Remap to dark copy
   tokens. Specificity (html[data-theme] prefix) beats the originals.
   ============================================================ */

html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .action-btn,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .active-badge,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .admin-flash,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .admin-page-title h1,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .attendance-download-btn:hover,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .attendance-status-chip,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .auth-shell-heading,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .average-badge,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .badge-btn,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .billing-child-row h4,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .brand-name,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .breakdown-label,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .btn-outline,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .btn-secondary,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .calendar-nav-btn:hover,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .card-value,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .class-quick-row strong,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .day-btn,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .day-schedule-header span,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .finance-billing-stat strong,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .finance-kpi-value,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .flash-message,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .ghost-action,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .grade-item .name,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .grade-item .points,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .gradebook-v1-btn-secondary,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .gradebook-v1-detail-btn:hover,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .gradebook-v1-drawer-close:hover,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .gradebook-v1-flash,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .gradebook-v1-hero h1,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .gradebook-v1-hero-stats strong,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .gradebook-v1-select,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .gradebook-v1-student-card strong,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .gradebook-v1-summary,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .inline-section-icon,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .kpi-icon,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .kpi-value,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .meta-pill,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .metric-value,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .parent-action-link-soft,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .parent-brand-name,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .parent-flash,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .parent-header-user span,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .parent-hero-card h2,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .parent-hero-stats .metric-value,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .parent-page-title h1,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .parent-profile-avatar,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .parent-profile-name,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .parent-sidebar-link:focus-visible,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .parent-sidebar-link:hover,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .parent-sidebar-toggle:hover,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .profile-avatar,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .profile-name,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .progress-hero-card h1,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .progress-hero-card h2,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .progress-metric-card .metric-value,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .quick-action-icon,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .remove-day,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .role-brand-name,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .role-header-user span,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .role-page-title h1,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .role-page-title h2,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .role-profile-avatar,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .role-profile-name,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .role-sidebar-link:focus-visible,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .role-sidebar-link:hover,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .schedule-heading,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .section-head h2,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .semester-header,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .settings-shortcut,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .sidebar-link:focus-visible,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .sidebar-link:hover,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .sidebar-toggle:hover,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .status-chip,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .student-brand-name,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .student-hero-card h2,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .student-hero-progress strong,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .student-page-title h1,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .student-profile-avatar,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .student-profile-name,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .student-section-link,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .student-sidebar-link:focus-visible,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .student-sidebar-link:hover,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .student-stat-icon,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .student-stat-value,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .subject-block > header,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .teacher-brand-name,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .teacher-flash,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .teacher-header-user span,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .teacher-library-item h3,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .teacher-mission-hero h1,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .teacher-mission-hero-panel strong,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .teacher-page-hero h1,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .teacher-page-title h2,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .teacher-profile-avatar,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .teacher-profile-name,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .teacher-section-link,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .teacher-sidebar-link:focus-visible,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .teacher-sidebar-link:hover,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .teacher-stat-value,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .theme-toggle-btn:hover,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .timeline-type-icon,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) input[type="date"],
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) input[type="email"],
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) input[type="number"],
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) input[type="password"],
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) input[type="search"],
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) input[type="text"],
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) select,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) textarea,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) thead th {
  color: var(--role-copy);
}

html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .gradebook-v1-cell-symbol,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) label {
  color: var(--role-copy-soft);
}

html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) input::placeholder,
html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) textarea::placeholder {
  color: var(--role-copy-muted);
}

/* ============================================================
   ALL ROLES: dark green/teal SURFACE backgrounds -> light surfaces.
   (dark-mode panel/sidebar/hero fills flipped to near-white; alpha +
   gradient structure preserved). Generated by gen-light-surface-overrides.js
   ============================================================ */

html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .admin-flash-success {
  background: rgba(248, 248, 248, 0.5);
}

html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .admin-sidebar-scrim {
  background: rgba(254, 254, 254, 0.55);
}

html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .admin-stat-card {
  background: linear-gradient(180deg, rgba(251, 251, 251, 0.82) 0%, rgba(253, 253, 253, 0.92) 100%);
}

html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .announcement-stream {
  background: linear-gradient(180deg, rgba(251, 251, 251, 0.82) 0%, rgba(253, 253, 253, 0.92) 100%);
}

html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .attendance-board-card {
  background: linear-gradient(180deg, rgba(251, 251, 251, 0.82) 0%, rgba(253, 253, 253, 0.92) 100%);
}

html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .attendance-calendar-card {
  background: linear-gradient(180deg, rgba(251, 251, 251, 0.82) 0%, rgba(253, 253, 253, 0.92) 100%);
}

html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .attendance-info-card {
  background: linear-gradient(180deg, rgba(251, 251, 251, 0.82) 0%, rgba(253, 253, 253, 0.92) 100%);
}

html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .billing-upcoming-item {
  background: linear-gradient(180deg, rgba(251, 251, 251, 0.82) 0%, rgba(253, 253, 253, 0.92) 100%);
}

html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .card {
  background: linear-gradient(180deg, rgba(251, 251, 251, 0.82) 0%, rgba(253, 253, 253, 0.92) 100%);
}

html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .class-panel {
  background: linear-gradient(180deg, rgba(251, 251, 251, 0.82) 0%, rgba(253, 253, 253, 0.92) 100%);
}

html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .class-utility-card {
  background: linear-gradient(180deg, rgba(251, 251, 251, 0.82) 0%, rgba(253, 253, 253, 0.92) 100%);
}

html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .dashboard-card {
  background: linear-gradient(180deg, rgba(251, 251, 251, 0.82) 0%, rgba(253, 253, 253, 0.92) 100%);
}

html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .finance-card {
  background: linear-gradient(180deg, rgba(251, 251, 251, 0.82) 0%, rgba(253, 253, 253, 0.92) 100%);
}

html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .finance-kpi-card {
  background: linear-gradient(180deg, rgba(251, 251, 251, 0.82) 0%, rgba(253, 253, 253, 0.92) 100%);
}

html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .flash-info {
  background: rgba(248, 248, 248, 0.5);
}

html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .gradebook-v1-class-panel {
  background: linear-gradient(180deg, rgba(251, 251, 251, 0.82) 0%, rgba(253, 253, 253, 0.92) 100%);
}

html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .gradebook-v1-drawer {
  background: rgba(253, 253, 253, 0.92);
}

html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .gradebook-v1-drawer-backdrop {
  background: rgba(254, 254, 254, 0.6);
}

html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .gradebook-v1-empty {
  background: linear-gradient(180deg, rgba(251, 251, 251, 0.82) 0%, rgba(253, 253, 253, 0.92) 100%);
}

html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .gradebook-v1-flash-success {
  background: rgba(248, 248, 248, 0.5);
}

html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .gradebook-v1-hero {
  background: linear-gradient(180deg, rgba(251, 251, 251, 0.82) 0%, rgba(253, 253, 253, 0.92) 100%);
}

html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .gradebook-v1-table .sticky-col {
  background: rgba(253, 253, 253, 0.96);
}

html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .kpi-card {
  background: linear-gradient(180deg, rgba(251, 251, 251, 0.82) 0%, rgba(253, 253, 253, 0.92) 100%);
}

html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .library-resource-item {
  background: linear-gradient(180deg, rgba(251, 251, 251, 0.82) 0%, rgba(253, 253, 253, 0.92) 100%);
}

html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .library-summary-card {
  background: linear-gradient(180deg, rgba(251, 251, 251, 0.82) 0%, rgba(253, 253, 253, 0.92) 100%);
}

html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .panel {
  background: linear-gradient(180deg, rgba(251, 251, 251, 0.82) 0%, rgba(253, 253, 253, 0.92) 100%);
}

html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .parent-announcement-item {
  background: linear-gradient(180deg, rgba(251, 251, 251, 0.82) 0%, rgba(253, 253, 253, 0.92) 100%);
}

html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .parent-card {
  background: linear-gradient(180deg, rgba(251, 251, 251, 0.82) 0%, rgba(253, 253, 253, 0.92) 100%);
}

html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .parent-flash-success {
  background: rgba(248, 248, 248, 0.5);
}

html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .progress-hero-card {
  background: linear-gradient(180deg, rgba(251, 251, 251, 0.82) 0%, rgba(253, 253, 253, 0.92) 100%);
}

html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .progress-metric-card {
  background: linear-gradient(180deg, rgba(251, 251, 251, 0.82) 0%, rgba(253, 253, 253, 0.92) 100%);
}

html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .progress-panel {
  background: linear-gradient(180deg, rgba(251, 251, 251, 0.82) 0%, rgba(253, 253, 253, 0.92) 100%);
}

html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .progress-rank-panel {
  background: linear-gradient(180deg, rgba(251, 251, 251, 0.82) 0%, rgba(253, 253, 253, 0.92) 100%);
}

html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .quick-action-card {
  background: linear-gradient(180deg, rgba(251, 251, 251, 0.82) 0%, rgba(253, 253, 253, 0.92) 100%);
}

html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .role-sidebar-scrim {
  background: rgba(254, 254, 254, 0.55);
}

html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .sa-sidebar-scrim {
  background: rgba(254, 254, 254, 0.55);
}

html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .schedule-section {
  background: linear-gradient(180deg, rgba(251, 251, 251, 0.82) 0%, rgba(253, 253, 253, 0.92) 100%);
}

html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .section-card {
  background: linear-gradient(180deg, rgba(251, 251, 251, 0.82) 0%, rgba(253, 253, 253, 0.92) 100%);
}

html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .selected-child-card {
  background: linear-gradient(180deg, rgba(251, 251, 251, 0.82) 0%, rgba(253, 253, 253, 0.92) 100%);
}

html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .selected-progress-card {
  background: linear-gradient(180deg, rgba(251, 251, 251, 0.82) 0%, rgba(253, 253, 253, 0.92) 100%);
}

html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .semester-section {
  background: linear-gradient(180deg, rgba(251, 251, 251, 0.82) 0%, rgba(253, 253, 253, 0.92) 100%);
}

html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .settings-card {
  background: linear-gradient(180deg, rgba(251, 251, 251, 0.82) 0%, rgba(253, 253, 253, 0.92) 100%);
}

html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .settings-shortcut {
  background: linear-gradient(180deg, rgba(251, 251, 251, 0.82) 0%, rgba(253, 253, 253, 0.92) 100%);
}

html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .student-card {
  background: linear-gradient(180deg, rgba(251, 251, 251, 0.82) 0%, rgba(253, 253, 253, 0.92) 100%);
}

html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .student-dashboard-notice {
  background: linear-gradient(180deg, rgba(251, 251, 251, 0.82) 0%, rgba(253, 253, 253, 0.92) 100%);
}

html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .student-grades-empty {
  background: linear-gradient(180deg, rgba(251, 251, 251, 0.82) 0%, rgba(253, 253, 253, 0.92) 100%);
}

html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .subject-block {
  background: linear-gradient(180deg, rgba(251, 251, 251, 0.82) 0%, rgba(253, 253, 253, 0.92) 100%);
}

html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .success {
  background: rgba(248, 248, 248, 0.5);
}

html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .teacher-flash-success {
  background: rgba(248, 248, 248, 0.5);
}

html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .teacher-library-form-card {
  background: linear-gradient(180deg, rgba(251, 251, 251, 0.82) 0%, rgba(253, 253, 253, 0.92) 100%);
}

html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .teacher-library-list-card {
  background: linear-gradient(180deg, rgba(251, 251, 251, 0.82) 0%, rgba(253, 253, 253, 0.92) 100%);
}

html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .teacher-mission-hero {
  background: linear-gradient(180deg, rgba(251, 251, 251, 0.82) 0%, rgba(253, 253, 253, 0.92) 100%);
}

html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher) .teacher-mission-stat-card {
  background: linear-gradient(180deg, rgba(251, 251, 251, 0.82) 0%, rgba(253, 253, 253, 0.92) 100%);
}

html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher)--admin .dialog::backdrop {
  background: rgba(254, 254, 254, 0.7);
}

html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher)--student .library-classes-card {
  background: linear-gradient(180deg, rgba(252, 252, 252, 0.86), rgba(253, 253, 253, 0.94));
}

html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher)--student .library-resources-card {
  background: linear-gradient(180deg, rgba(252, 252, 252, 0.86), rgba(253, 253, 253, 0.94));
}

html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher)--student .library-updates-card {
  background: linear-gradient(180deg, rgba(252, 252, 252, 0.86), rgba(253, 253, 253, 0.94));
}

html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher)--student .mission-side-card {
  background: linear-gradient(180deg, rgba(252, 252, 252, 0.86), rgba(253, 253, 253, 0.94));
}

html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher)--student .mission-table-panel {
  background: linear-gradient(180deg, rgba(252, 252, 252, 0.86), rgba(253, 253, 253, 0.94));
}

html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher)--student .modal {
  background: linear-gradient(180deg, rgba(252, 252, 252, 0.96), rgba(254, 254, 254, 0.98));
}

html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher)--student .modal-overlay {
  background: rgba(254, 254, 254, 0.68);
}

html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher)--student .student-dashboard-notice {
  background: linear-gradient(180deg, rgba(252, 252, 252, 0.86), rgba(253, 253, 253, 0.94));
}

html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher)--student .student-grades-empty {
  background: linear-gradient(180deg, rgba(252, 252, 252, 0.86), rgba(253, 253, 253, 0.94));
}

html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher)--student .student-page-header {
  background: linear-gradient(140deg, rgba(120, 235, 255, 0.08), transparent 38%),
    linear-gradient(180deg, rgba(252, 252, 252, 0.84), rgba(253, 253, 253, 0.94));
}

html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher)--student .student-section {
  background: linear-gradient(180deg, rgba(252, 252, 252, 0.86), rgba(253, 253, 253, 0.94));
}

html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher)--student .table-wrap thead th {
  background: rgba(253, 253, 253, 0.94);
}

html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher)--student .table-wrap {
  background: rgba(253, 253, 253, 0.42);
}

html[data-theme="light"] body.role-shell-page:not(.role-shell-page--teacher)--student .workflow-card {
  background: linear-gradient(180deg, rgba(252, 252, 252, 0.86), rgba(253, 253, 253, 0.94));
}



/* ============================================================================
   Native in-app dialogs — toasts + confirm/prompt modals (app-shell.js).
   Replaces browser alert()/confirm()/prompt(). Self-contained; uses role theme
   variables where available with neutral fallbacks so it works on every page.
   ============================================================================ */
.ilm-toast-host {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 2147483000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: min(24rem, calc(100vw - 2rem));
  pointer-events: none;
}
.ilm-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.7rem 0.8rem 0.7rem 0.9rem;
  border-radius: 0.7rem;
  background: var(--role-surface-strong, #fff);
  color: var(--role-copy, #1b1a17);
  border: 1px solid var(--role-border, rgba(0, 0, 0, 0.08));
  border-left: 3px solid var(--ilm-toast-accent, #0d9488);
  box-shadow: 0 10px 30px -8px rgba(0, 0, 0, 0.25);
  font-size: 0.84rem;
  line-height: 1.4;
  opacity: 0;
  transform: translateX(12px) scale(0.98);
  transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.ilm-toast--in { opacity: 1; transform: translateX(0) scale(1); }
.ilm-toast--out { opacity: 0; transform: translateX(12px) scale(0.98); }
.ilm-toast--success { --ilm-toast-accent: oklch(0.72 0.13 165); }
.ilm-toast--error { --ilm-toast-accent: var(--destructive, #d65f59); }
.ilm-toast--info { --ilm-toast-accent: var(--role-accent, #0d9488); }
.ilm-toast-msg { flex: 1; }
.ilm-toast-close {
  flex: none;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
  color: var(--role-copy-muted, #888);
  padding: 0 0.1rem;
}
.ilm-toast-close:hover { color: var(--role-copy, #1b1a17); }

.ilm-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483100;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(15, 16, 20, 0.55);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.ilm-modal-overlay--in { opacity: 1; }
.ilm-modal-overlay--out { opacity: 0; }
.ilm-modal {
  width: min(26rem, calc(100vw - 2rem));
  background: var(--role-surface-strong, #fff);
  color: var(--role-copy, #1b1a17);
  border: 1px solid var(--role-border, rgba(0, 0, 0, 0.08));
  border-radius: 1rem;
  padding: 1.4rem;
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.4);
  transform: translateY(8px) scale(0.97);
  transition: transform 0.2s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.ilm-modal-overlay--in .ilm-modal { transform: translateY(0) scale(1); }
.ilm-modal-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 0.4rem;
  color: var(--role-copy, #1b1a17);
}
.ilm-modal-message {
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--role-copy-soft, #555);
  margin: 0 0 1rem;
}
.ilm-modal-input { width: 100%; margin: 0 0 1rem; }
.ilm-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}
.ilm-btn-danger {
  background: var(--destructive, #d65f59);
  color: #fff;
  border: 1px solid transparent;
}
.ilm-btn-danger:hover { filter: brightness(0.94); }
@media (max-width: 480px) {
  .ilm-toast-host { left: 1rem; right: 1rem; max-width: none; }
}
