/* ============================================================
   EDU360 LITE — DESIGN SYSTEM (design.md / Coinbase Institutional)
   Clean, Editorial, Deep Institutional Trust
   Accent: Coinbase Blue (#0052ff)
   Typography: Inter (Display & Sans), JetBrains Mono (Numbers/Metrics)
   Radius scale: pill (100px), card (24px), inputs (12px)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Brand & Accent Tokens */
  --primary: #0052ff;
  --primary-active: #003ecc;
  --primary-disabled: #a8b8cc;
  --primary-soft: rgba(0, 82, 255, 0.08);
  --primary-soft-border: rgba(0, 82, 255, 0.2);
  --accent-yellow: #f4b000;

  /* Surfaces */
  --canvas: #ffffff;
  --surface-soft: #f7f7f7;
  --surface-strong: #eef0f3;
  --surface-dark: #0a0b0d;
  --surface-dark-elevated: #16181c;

  /* Hairlines & Dividers */
  --hairline: #dee1e6;
  --hairline-soft: #eef0f3;

  /* Text & Inks */
  --ink: #0a0b0d;
  --body: #5b616e;
  --body-strong: #0a0b0d;
  --muted: #7c828a;
  --muted-soft: #a8acb3;
  --on-primary: #ffffff;
  --on-dark: #ffffff;
  --on-dark-soft: #a8acb3;

  /* Trading & Metric Semantics (Color only) */
  --semantic-up: #05b169;
  --semantic-down: #cf202f;
  --semantic-warn: #f59e0b;

  /* Geometry & Layout */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 100px;
  --radius-full: 9999px;

  --sidebar-w: 260px;
  --topbar-h: 70px;
  --shadow-subtle: 0 4px 12px rgba(0, 0, 0, 0.04);
  --shadow-float: 0 20px 40px -15px rgba(10, 11, 13, 0.12);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--surface-soft);
  color: var(--ink);
  line-height: 1.5;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── NUMBER / MONO OVERRIDE ── */
.mono-num,
.stat-value,
.number-display,
.pbar-label,
.table-num {
  font-family: 'JetBrains Mono', monospace !important;
  font-variant-numeric: tabular-nums;
}

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

/* ── SIDEBAR NAVIGATION ── */
.sidebar {
  width: var(--sidebar-w);
  background-color: var(--surface-dark);
  color: var(--on-dark);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-brand {
  padding: 24px 24px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-icon {
  width: 40px;
  height: 40px;
  background: var(--primary);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 0 20px rgba(0, 82, 255, 0.4);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.brand-icon:hover {
  transform: scale(1.08) rotate(5deg);
}

.brand-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.3px;
  color: var(--on-dark);
}

.brand-sub {
  font-size: 12px;
  color: var(--on-dark-soft);
}

.sidebar-class-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-pill);
  padding: 5px 12px;
  margin: 14px 20px 0;
  position: relative;
  cursor: pointer;
  transition: all 0.2s ease;
  width: fit-content;
  max-width: calc(100% - 40px);
}

.sidebar-class-picker:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.22);
}

.sidebar-class-picker:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(0, 82, 255, 0.25);
}

.sidebar-class-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background: transparent;
  border: none;
  outline: none;
  color: var(--on-dark);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding-right: 18px;
  margin: 0;
}

.sidebar-class-select option {
  background: #111216;
  color: #fff;
  font-size: 13px;
  padding: 8px;
}

.sidebar-class-arrow {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  color: rgba(255, 255, 255, 0.5);
  pointer-events: none;
  transition: transform 0.2s ease;
}

.sidebar-class-picker:hover .sidebar-class-arrow {
  color: var(--on-dark);
}

.badge-session {
  display: inline-block;
  background: rgba(255, 255, 255, 0.08);
  color: var(--on-dark-soft);
  font-size: 11px;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  margin: 14px 24px 0;
  width: fit-content;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-menu {
  flex: 1;
  padding: 20px 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.menu-category {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: rgba(255, 255, 255, 0.35);
  padding: 16px 14px 6px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-pill);
  color: var(--on-dark-soft);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  white-space: nowrap;
}

.nav-link span {
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--on-dark);
  background-color: rgba(255, 255, 255, 0.06);
  transform: translateX(3px);
}

.nav-link.active {
  color: var(--on-dark);
  background-color: var(--surface-dark-elevated);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.nav-link.active::before {
  content: '';
  position: absolute;
  left: 6px;
  width: 4px;
  height: 18px;
  background-color: var(--primary);
  border-radius: var(--radius-pill);
}

.nav-num {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.3);
  font-family: 'JetBrains Mono', monospace;
}

.nav-link.active .nav-num {
  color: var(--primary);
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
  color: var(--on-dark-soft);
  background: rgba(0, 0, 0, 0.15);
}

.sidebar-mobile-close {
  display: none;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--on-dark);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-left: auto;
  transition: all 0.15s ease;
}

.sidebar-mobile-close:hover {
  background: rgba(255, 255, 255, 0.18);
}

.nav-link-portal {
  background: rgba(0, 82, 255, 0.14) !important;
  color: #60a5fa !important;
  border: 1px solid rgba(0, 82, 255, 0.28);
  font-weight: 600;
  margin-top: 6px;
}

.nav-link-portal:hover {
  background: rgba(0, 82, 255, 0.28) !important;
  color: #ffffff !important;
  border-color: rgba(0, 82, 255, 0.55);
}

.mobile-hamburger-btn {
  display: none;
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink);
  transition: all 0.15s ease;
}

.mobile-hamburger-btn:hover {
  background: var(--surface-soft);
  border-color: var(--primary);
  color: var(--primary);
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 11, 13, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.24s ease, visibility 0.24s ease;
}

.sidebar-backdrop.active {
  opacity: 1;
  visibility: visible;
}

/* ── MAIN CONTENT & TOPBAR ── */
.main-wrapper {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: var(--topbar-h);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--hairline);
  position: sticky;
  top: 0;
  z-index: 90;
  padding: 0 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar-meta h1 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.3px;
  color: var(--ink);
}

.topbar-meta p {
  font-size: 13px;
  color: var(--muted);
}

/* ── COINBASE BUTTONS ── */
.btn-coinbase {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 22px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary {
  background-color: var(--primary);
  color: var(--on-primary);
  box-shadow: 0 4px 14px rgba(0, 82, 255, 0.25);
}

.btn-primary:hover {
  background-color: var(--primary-active);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 82, 255, 0.32);
}

.btn-secondary {
  background-color: var(--surface-strong);
  color: var(--ink);
}

.btn-secondary:hover {
  background-color: var(--hairline);
}

/* ── HERO BANNER (COINBASE DARK EDITORIAL HERO) ── */
.hero-band-dark {
  background-color: var(--surface-dark);
  color: var(--on-dark);
  border-radius: var(--radius-xl);
  padding: 44px 48px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-float);
  margin-bottom: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.hero-band-dark::before {
  content: '';
  position: absolute;
  top: -120px;
  right: -80px;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(0, 82, 255, 0.2) 0%, rgba(10, 11, 13, 0) 70%);
  pointer-events: none;
}

.hero-content h2 {
  font-size: 38px;
  font-weight: 400;
  /* Coinbase editorial calm rule */
  letter-spacing: -1.2px;
  color: var(--on-dark);
  margin-bottom: 8px;
}

.hero-content p {
  color: var(--on-dark-soft);
  font-size: 15px;
  max-width: 580px;
  line-height: 1.6;
}

.hero-metrics {
  display: flex;
  gap: 36px;
  margin-top: 28px;
}

.hero-metric-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hero-metric-val {
  font-size: 32px;
  font-weight: 500;
  color: var(--on-dark);
}

.hero-metric-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--on-dark-soft);
  font-weight: 500;
}

.hero-card-float {
  background: var(--surface-dark-elevated);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-xl);
  padding: 24px 28px;
  min-width: 280px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── EDITORIAL CARDS ── */
.page-container {
  padding: 36px;
  display: none;
  flex-direction: column;
  gap: 28px;
  animation: fadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.page-container.active {
  display: flex;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card-editorial {
  background-color: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-subtle);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-editorial:hover {
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.04);
}

.card-header-clean {
  padding: 24px 30px;
  border-bottom: 1px solid var(--hairline-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header-clean h3 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.3px;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-body-clean {
  padding: 28px 30px;
}

/* ── STATS GRID ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
}

.stat-box {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s ease;
}

.stat-box:hover {
  transform: translateY(-2px);
  border-color: #cbd2dc;
  box-shadow: var(--shadow-subtle);
}

.stat-header {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.stat-value {
  font-size: 34px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1;
}

.stat-footer {
  font-size: 13px;
  color: var(--muted);
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── TABLES (COINBASE LIST STYLE) ── */
.table-responsive {
  overflow-x: auto;
}

.editorial-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.editorial-table thead th {
  background-color: var(--surface-soft);
  padding: 14px 20px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  border-bottom: 1px solid var(--hairline);
  white-space: nowrap;
}

.editorial-table tbody tr {
  border-bottom: 1px solid var(--hairline-soft);
  transition: background-color 0.15s ease;
}

.editorial-table tbody tr:hover {
  background-color: var(--surface-soft);
}

.editorial-table tbody td {
  padding: 14px 20px;
  color: var(--body);
  vertical-align: middle;
}

.td-student-name {
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.2px;
}

/* ── PILL BADGES ── */
.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
}

.badge-blue {
  background-color: var(--primary-soft);
  color: var(--primary);
}

.badge-green {
  background-color: rgba(5, 177, 105, 0.1);
  color: var(--semantic-up);
}

.badge-red {
  background-color: rgba(207, 32, 47, 0.1);
  color: var(--semantic-down);
}

.badge-warn {
  background-color: rgba(245, 158, 11, 0.12);
  color: var(--semantic-warn);
}

.badge-gray {
  background-color: var(--surface-strong);
  color: var(--body);
}

/* ── RANK CHIPS ── */
.rank-chip {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
}

.rank-1 {
  background-color: #fef3c7;
  color: #b45309;
}

.rank-2 {
  background-color: #f1f5f9;
  color: #475569;
}

.rank-3 {
  background-color: #ffedd5;
  color: #c2410c;
}

.rank-other {
  background-color: var(--surface-soft);
  color: var(--muted);
}

/* ── PROGRESS BARS ── */
.progress-clean {
  width: 100%;
  height: 8px;
  background-color: var(--surface-strong);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.progress-clean-bar {
  height: 100%;
  border-radius: var(--radius-pill);
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── CONTROLS & SELECTS ── */
.editorial-select {
  height: 40px;
  padding: 0 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--hairline);
  background: var(--canvas);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.editorial-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 82, 255, 0.15);
}

/* ── TABS (COINBASE PILL TOGGLES) ── */
.pill-tab-group {
  display: inline-flex;
  background: var(--surface-strong);
  padding: 4px;
  border-radius: var(--radius-pill);
  gap: 4px;
}

.pill-tab-btn {
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  border: none;
  background: transparent;
  color: var(--body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pill-tab-btn.active {
  background: var(--canvas);
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.tab-panel {
  display: none !important;
  width: 100%;
}

.tab-panel.active {
  display: block !important;
  animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ── GRID SYSTEM ── */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* ── RESPONSIVE ── */
@media (max-width: 1100px) {
  .hero-band-dark {
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1024px) {
  .mobile-hamburger-btn {
    display: inline-flex;
  }
  .sidebar-mobile-close {
    display: flex;
  }
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1000;
    width: 280px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.6);
  }

  .sidebar.open {
    transform: translateX(0);
  }


  .main-wrapper {
    margin-left: 0;
  }

  .topbar {
    padding: 0 16px;
  }

  .page-container {
    padding: 16px;
  }
}

/* ═══════════════ CLICKABLE STAT BOX STYLES ═══════════════ */
.stat-box.clickable {
  cursor: pointer;
  position: relative;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease;
}

.stat-box.clickable:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  box-shadow: 0 12px 28px -6px rgba(0, 82, 255, 0.12), 0 4px 12px rgba(0, 0, 0, 0.04);
}

.stat-box.clickable:active {
  transform: translateY(-1px);
}

.stat-box.clickable .stat-interactive-cue {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  transform: translateX(-4px);
}

.stat-box.clickable:hover .stat-interactive-cue {
  opacity: 1;
  transform: translateX(0);
}

/* ═══════════════ TILE DETAIL MODAL (COINBASE INSTITUTIONAL) ═══════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 11, 13, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(10px, 3vw, 24px);
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.22s;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-sheet {
  background: var(--canvas);
  border-radius: var(--radius-xl);
  border: 1px solid var(--hairline);
  box-shadow: 0 25px 60px -15px rgba(10, 11, 13, 0.35);
  width: 100%;
  max-width: 980px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.97) translateY(10px);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal-sheet {
  transform: scale(1) translateY(0);
}

.modal-header {
  padding: clamp(16px, 2.5vw, 22px) clamp(18px, 3vw, 28px);
  border-bottom: 1px solid var(--hairline-soft);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  background: #fafbfc;
  flex-shrink: 0;
}

.modal-header-info {
  flex: 1;
  min-width: 0;
}

.modal-header-info h2 {
  font-size: clamp(17px, 2.5vw, 20px);
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.modal-header-info p {
  font-size: 13px;
  color: var(--body);
  line-height: 1.4;
}

.modal-close-btn {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--muted);
  transition: all 0.15s ease;
}

.modal-close-btn:hover {
  background: var(--surface-soft);
  color: var(--ink);
  border-color: #cbd2dc;
}

.modal-controls {
  padding: 12px clamp(18px, 3vw, 28px);
  border-bottom: 1px solid var(--hairline-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--canvas);
  flex-wrap: wrap;
  flex-shrink: 0;
}

.modal-search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-soft);
  border: 1px solid var(--hairline);
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  flex: 1;
  min-width: 220px;
  max-width: 380px;
}

.modal-search input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 13px;
  font-family: inherit;
  color: var(--ink);
  width: 100%;
}

.modal-body {
  padding: 0;
  overflow-y: auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
}

.modal-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
}

.modal-table th {
  background: #fafbfc;
  padding: 12px 18px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  border-bottom: 1px solid var(--hairline-soft);
  position: sticky;
  top: 0;
  z-index: 10;
  text-align: left;
  white-space: nowrap;
}

.modal-table td {
  padding: 12px 18px;
  border-bottom: 1px solid var(--hairline-soft);
  font-size: 13.5px;
  color: var(--ink);
  vertical-align: middle;
}

.modal-table tr:hover {
  background: #fbfcfe;
}

.modal-footer {
  padding: 12px clamp(18px, 3vw, 28px);
  border-top: 1px solid var(--hairline-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fafbfc;
  font-size: 13px;
  color: var(--muted);
  flex-wrap: wrap;
  gap: 10px;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .modal-overlay {
    padding: 8px;
    align-items: flex-end;
  }
  .modal-sheet {
    max-height: 94vh;
    border-radius: 18px 18px 0 0;
  }
  .modal-controls {
    flex-direction: column;
    align-items: stretch;
  }
  .modal-search {
    max-width: 100%;
    min-width: 100%;
  }
  .modal-controls .pill-tab-group {
    width: 100%;
    display: flex;
  }
  .modal-controls .pill-tab-group .pill-tab-btn {
    flex: 1;
    text-align: center;
    padding: 6px 10px;
  }
  .modal-footer {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    gap: 12px;
  }
  .modal-footer > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  #flag-modal-context {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 12px;
  }
}
  background: #fafbfc;
  font-size: 13px;
  color: var(--muted);
}

/* ═══════════════ SUPPORT FLAG PILL & POPUP ═══════════════ */
.support-flag-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(207, 32, 47, 0.08);
  border: 1px solid rgba(207, 32, 47, 0.25);
  color: var(--semantic-down);
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.support-flag-pill:hover {
  background: rgba(207, 32, 47, 0.16);
  border-color: var(--semantic-down);
  transform: translateY(-1px);
}

.flag-issue-card {
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-bottom: 12px;
  border-left: 4px solid var(--semantic-down);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.flag-issue-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flag-issue-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.flag-issue-meta {
  font-size: 12.5px;
  color: var(--body);
  line-height: 1.4;
}

/* ═══════════════ EXCEL-STYLE MASTER SPREADSHEET ═══════════════ */
.excel-spreadsheet-container {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-subtle);
}

.excel-toolbar {
  padding: 16px 24px;
  border-bottom: 1px solid var(--hairline);
  background: #fafbfc;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.excel-grid-wrapper {
  overflow-x: auto;
  overflow-y: auto;
  max-height: 70vh;
}

.excel-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.excel-table th {
  background: #f1f3f6;
  color: var(--body-strong);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 10px 14px;
  border-right: 1px solid #dee2e6;
  border-bottom: 2px solid #cbd2dc;
  position: sticky;
  top: 0;
  z-index: 10;
  white-space: nowrap;
}

.excel-table td {
  padding: 10px 14px;
  border-right: 1px solid #edf0f4;
  border-bottom: 1px solid #edf0f4;
  vertical-align: middle;
  background: #fff;
  white-space: nowrap;
}

/* ═══════════════ CO-BRAND DUAL LOCKUP (EDU360 × JAIPURIA) ═══════════════ */
.dual-brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  user-select: none;
}

.lockup-unit {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lockup-edu360-logo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: #ffffff;
  padding: 1.5px;
  border: 1.5px solid rgba(0, 82, 255, 0.5);
  box-shadow: 0 0 10px rgba(0, 82, 255, 0.35);
  flex-shrink: 0;
}

.lockup-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.lockup-title {
  font-size: 14px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.2px;
}

.lockup-sub {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
}

.lockup-divider {
  width: 1.5px;
  height: 30px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 1px;
  flex-shrink: 0;
}

.lockup-jaipuria-flame {
  height: 34px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}

.lockup-school {
  font-size: 13px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.2px;
  line-height: 1.15;
}

.lockup-campus {
  font-size: 8px;
  font-weight: 800;
  color: #f59e0b;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  margin-top: 1px;
}

.excel-table tr:hover td {
  background: #f8faff;
}

/* Highlight for Gapped / Missing Data */
.cell-gapped {
  background: #fef9c3 !important; /* Soft yellow excel warning */
  border: 1px solid #fde047 !important;
  color: #b45309 !important;
  text-align: center;
  font-weight: 600;
  position: relative;
  cursor: help;
}

.cell-gapped::before {
  content: '—';
  color: #b45309;
  font-size: 12px;
}

.excel-subject-th {
  text-align: center;
  background: #eef2f7 !important;
}

.sticky-col-1 {
  position: sticky;
  left: 0;
  z-index: 5;
  background: #fff;
  border-right: 2px solid #dee2e6 !important;
}

.excel-table th.sticky-col-1 {
  z-index: 15;
  background: #f1f3f6;
}


