/* ==========================================================================
   RankX Enterprise UI Design System
   Natural, Precision Engineered Computer-Based Examination & Prep Platform
   Standards: Ultra-clean typography, zero-distortion layouts, responsive grid
   ========================================================================== */

:root {
  /* Surface Layers (Refined Slate / Neutral Dark) */
  --bg: #0b0f17;
  --bg-subtle: #111722;
  --bg-surface: #161f2e;
  --bg-elevated: #1d283c;
  --bg-input: #0f1520;

  /* Borders & Dividers */
  --line: #26334a;
  --line-strong: #364866;
  --line-focus: #3b82f6;

  /* Typography */
  --text: #f8fafc;
  --text-secondary: #cbd5e1;
  --muted: #94a3b8;
  --muted-dark: #64748b;

  /* Natural Corporate Accents */
  --brand: #3b82f6;
  --brand-hover: #2563eb;
  --brand-active: #1d4ed8;
  --brand-light: #60a5fa;
  --brand-subtle: rgba(59, 130, 246, 0.12);
  --brand-border: rgba(59, 130, 246, 0.3);

  /* Status Accents */
  --ok: #10b981;
  --ok-hover: #059669;
  --ok-bg: rgba(16, 185, 129, 0.12);
  --ok-border: rgba(16, 185, 129, 0.3);

  --warn: #f59e0b;
  --warn-bg: rgba(245, 158, 11, 0.12);
  --warn-border: rgba(245, 158, 11, 0.3);

  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.12);
  --danger-border: rgba(239, 68, 68, 0.3);

  --purple: #a855f7;
  --purple-bg: rgba(168, 85, 247, 0.12);
  --purple-border: rgba(168, 85, 247, 0.3);

  /* Geometry */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 10px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.45);

  /* Fonts */
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ==========================================================================
   CSS Reset & Base
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  color: var(--text);
  background-color: var(--bg);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: -0.015em;
  color: #fff;
  margin-top: 0;
  margin-bottom: 0;
  line-height: 1.3;
}

a {
  color: var(--brand-light);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ==========================================================================
   App Loading & Boot States
   ========================================================================== */
.boot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  gap: 14px;
  color: var(--muted);
  font-size: 13.5px;
}
.boot-spinner {
  width: 24px;
  height: 24px;
  border: 2.5px solid var(--line);
  border-top-color: var(--brand-light);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   Brand & Logo Asset
   ========================================================================== */
.brand-logo {
  height: 28px;
  width: auto;
  object-fit: contain;
  display: block;
}
.landing-brand .brand-logo { height: 30px; }
.auth-brand .brand-logo { height: 32px; margin-bottom: 16px; }
.mobile-brand { display: none; margin-bottom: 16px; }
.mobile-brand .brand-logo { height: 28px; }

/* ==========================================================================
   App Shell & Sidebar (Independent Scrolling Viewport & No-Overlap Grid)
   ========================================================================== */
.shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  height: 100vh;
  max-height: 100vh;
  width: 100vw;
  overflow: hidden;
  background: var(--bg);
}

.sidebar {
  background: var(--bg-subtle);
  border-right: 1px solid var(--line);
  padding: 16px 12px 14px;
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-height: 100vh;
  width: 240px;
  min-width: 240px;
  overflow: hidden;
  box-sizing: border-box;
}

.sidebar .brand {
  padding: 4px 6px 14px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}
.sidebar .brand-logo {
  height: 28px;
  width: auto;
  object-fit: contain;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
  min-height: 0;
}
.nav::-webkit-scrollbar { width: 4px; }
.nav::-webkit-scrollbar-track { background: transparent; }
.nav::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }

.nav .group-label {
  color: var(--muted-dark);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 14px 8px 4px;
  flex-shrink: 0;
}

.nav button {
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  width: 100%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.12s ease;
}
.nav button .nav-icon {
  font-size: 14px;
  width: 18px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  opacity: 0.85;
}
.nav button:hover {
  background: var(--bg-surface);
  color: #fff;
}
.nav button.active {
  background: var(--bg-elevated);
  color: #fff;
  font-weight: 600;
  border-color: var(--line);
  border-left: 3px solid var(--brand-light);
}
.nav button.active .nav-icon {
  opacity: 1;
}

.userbox {
  border-top: 1px solid var(--line);
  padding: 12px 10px 10px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
  flex-shrink: 0;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.05em;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.userbox .email {
  color: #fff;
  font-weight: 600;
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.userbox .role {
  display: inline-block;
}

/* ==========================================================================
   2-Row x 3-Column Course Carousel & Minimalist Cards
   ========================================================================== */
.course-section {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  position: relative;
}
.course-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.course-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.course-section-title h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
}
.carousel-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.carousel-nav-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  transition: all 0.12s ease;
  padding: 0;
}
.carousel-nav-btn:hover:not(:disabled) {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.carousel-nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.carousel-indicator {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  padding: 0 4px;
  min-width: 50px;
  text-align: center;
}

.test-grid-carousel {
  display: grid;
  grid-template-rows: repeat(2, minmax(130px, 1fr));
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 24px) / 3);
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}
.test-grid-carousel::-webkit-scrollbar {
  height: 5px;
}
.test-grid-carousel::-webkit-scrollbar-track {
  background: var(--bg-elevated);
  border-radius: 4px;
}
.test-grid-carousel::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 4px;
}

.test-card-compact {
  scroll-snap-align: start;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 130px;
  transition: all 0.12s ease;
  position: relative;
}
.test-card-compact:hover {
  border-color: var(--line-focus);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.test-card-compact .card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
}
.test-card-compact h4 {
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
  color: #fff;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.test-card-compact .card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 6px;
}
.test-card-compact .card-meta-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
}
.test-card-compact .card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

@media (max-width: 1024px) {
  .test-grid-carousel {
    grid-auto-columns: calc((100% - 12px) / 2);
  }
}
@media (max-width: 640px) {
  .test-grid-carousel {
    grid-auto-columns: 100%;
  }
}

.main {
  height: 100vh;
  max-height: 100vh;
  width: 100%;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px 32px;
  box-sizing: border-box;
  background: var(--bg);
}
.main::-webkit-scrollbar { width: 6px; }
.main::-webkit-scrollbar-track { background: transparent; }
.main::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }

/* ==========================================================================
   Page Headers & Control Bars
   ========================================================================== */
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
}
.page-head h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}
.page-head .desc {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

.crumbs {
  color: var(--muted);
  font-size: 12.5px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}

/* ==========================================================================
   Cards & Layout Grid
   ========================================================================== */
.grid {
  display: grid;
  gap: 14px;
  width: 100%;
}
.grid.cols-2 { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }

.card {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  min-width: 0;
}
.card h3 {
  margin: 0 0 10px;
  font-size: 14.5px;
  font-weight: 600;
}

/* Metric / Stat Card */
.stat {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  min-width: 0;
}
.stat .n {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
  line-height: 1.15;
}
.stat .l {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  margin-top: 4px;
}
.stat.stat-highlight {
  border-color: var(--warn-border);
  background: var(--warn-bg);
}

/* ==========================================================================
   Buttons & Controls
   ========================================================================== */
button, .btn {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  color: var(--text);
  padding: 7px 14px;
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.4;
}
button:hover, .btn:hover {
  background: #25334d;
  border-color: var(--line-strong);
  color: #fff;
}
button:disabled, .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

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

.btn-ok {
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
  font-weight: 600;
}
.btn-ok:hover {
  background: var(--ok-hover);
  border-color: var(--ok-hover);
}

.btn-danger {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  color: #fca5a5;
}
.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}
.btn-ghost:hover {
  background: var(--bg-elevated);
  color: #fff;
  border-color: var(--line);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}
.btn-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

/* ==========================================================================
   Forms & Controls
   ========================================================================== */
label.field {
  display: block;
  margin-bottom: 12px;
  width: 100%;
}
label.field .lbl {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 5px;
}
input, select, textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text);
  background: var(--bg-input);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.12s ease;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--line-focus);
}
input::placeholder, textarea::placeholder {
  color: var(--muted-dark);
}
textarea {
  resize: vertical;
  min-height: 80px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
}
.row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  width: 100%;
}
.check {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
}
.check input {
  width: auto;
  cursor: pointer;
}

/* ==========================================================================
   Data Tables (Protected Against Horizontal Overflow & Overlap)
   ========================================================================== */
.table-wrap {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: var(--shadow-sm);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 540px;
}
th, td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--bg-subtle);
  white-space: nowrap;
}
tr:last-child td {
  border-bottom: none;
}
tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* ==========================================================================
   Status Badges (Clean & Readable)
   ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  line-height: 1.35;
  white-space: nowrap;
}
.badge.role-superadmin {
  background: var(--purple-bg);
  color: #d8b4fe;
  border-color: var(--purple-border);
}
.badge.role-admin {
  background: var(--brand-subtle);
  color: #93c5fd;
  border-color: var(--brand-border);
}
.badge.role-coaching {
  background: var(--warn-bg);
  color: #fde68a;
  border-color: var(--warn-border);
}
.badge.role-student {
  background: rgba(148, 163, 184, 0.12);
  color: var(--muted);
  border-color: rgba(148, 163, 184, 0.25);
}
.badge.ok {
  background: var(--ok-bg);
  color: #6ee7b7;
  border-color: var(--ok-border);
}
.badge.warn {
  background: var(--warn-bg);
  color: #fde68a;
  border-color: var(--warn-border);
}
.badge.danger {
  background: var(--danger-bg);
  color: #fca5a5;
  border-color: var(--danger-border);
}
.badge.muted {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line);
}

/* ==========================================================================
   Content Tree (File Explorer)
   ========================================================================== */
.tree {
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
}
.tree .node {
  border-radius: var(--radius-xs);
}
.tree .node-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-xs);
  transition: background-color 0.1s ease;
}
.tree .node-row:hover {
  background: var(--bg-elevated);
}
.tree .twisty {
  width: 16px;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  font-size: 11px;
}
.tree .name {
  flex: 1 1 auto;
  cursor: pointer;
  font-weight: 500;
  color: var(--text);
  min-width: 0;
  word-break: break-word;
}
.tree .name.test {
  color: #e2e8f0;
  font-weight: 600;
}
.tree .children {
  margin-left: 20px;
  border-left: 1px solid var(--line);
  padding-left: 8px;
  margin-top: 2px;
}
.tree .actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

/* ==========================================================================
   CBT Exam Simulation Engine (Authentic & Professional Layout)
   ========================================================================== */
.player {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 20px;
  align-items: start;
  width: 100%;
}

.q-card {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  min-width: 0;
  overflow-wrap: break-word;
}
.q-text {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.6;
  margin-bottom: 18px;
  color: var(--text);
}

.opt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  cursor: pointer;
  background: var(--bg-subtle);
  transition: border-color 0.12s ease, background-color 0.12s ease;
  user-select: none;
  min-width: 0;
}
.opt:hover {
  border-color: var(--line-strong);
  background: var(--bg-elevated);
}
.opt.selected {
  border-color: var(--brand);
  background: var(--brand-subtle);
}
.opt.correct {
  border-color: var(--ok);
  background: var(--ok-bg);
}
.opt.wrong {
  border-color: var(--danger);
  background: var(--danger-bg);
}
.opt .k {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  background: var(--bg-surface);
  color: var(--muted);
  flex-shrink: 0;
}
.opt.selected .k {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
.opt.correct .k {
  background: var(--ok);
  color: #022016;
  border-color: var(--ok);
}

.palette {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px;
  position: sticky;
  top: 16px;
  box-shadow: var(--shadow-sm);
  width: 100%;
  box-sizing: border-box;
}
.palette .grid-nums {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin: 12px 0;
}
.pnum {
  aspect-ratio: 1;
  width: 100%;
  min-height: 34px;
  border-radius: var(--radius-xs);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--line);
  background: var(--bg-subtle);
  cursor: pointer;
  color: var(--muted);
  padding: 0;
  transition: border-color 0.1s ease, color 0.1s ease;
}
.pnum:hover {
  border-color: var(--line-strong);
  color: var(--text);
}
.pnum.answered {
  background: var(--ok-bg);
  border-color: var(--ok-border);
  color: #6ee7b7;
}
.pnum.marked {
  background: var(--purple-bg);
  border-color: var(--purple-border);
  color: #e9d5ff;
}
.pnum.current {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
  color: #fff;
}

.timer {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 13px;
  color: #6ee7b7;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--ok-bg);
  padding: 5px 10px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--ok-border);
  white-space: nowrap;
}
.timer.danger {
  color: #fca5a5;
  background: var(--danger-bg);
  border-color: var(--danger-border);
}

/* ==========================================================================
   Modals & Toasts
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: grid;
  place-items: center;
  z-index: 999;
  padding: 16px;
}
.modal {
  width: 100%;
  max-width: 640px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--bg-surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--bg-surface);
  z-index: 2;
}
.modal-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}
.modal-body {
  padding: 18px;
}
.modal-foot {
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  position: sticky;
  bottom: 0;
  background: var(--bg-surface);
  z-index: 2;
}

#toast-root {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 1000;
  max-width: 380px;
  width: calc(100% - 40px);
}
.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--brand);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  word-break: break-word;
}
.toast.ok { border-left-color: var(--ok); }
.toast.err { border-left-color: var(--danger); }

/* ==========================================================================
   Course Catalog Cards
   ========================================================================== */
.course-card {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.12s ease;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  min-width: 0;
}
.course-card:hover {
  border-color: var(--line-strong);
}
.course-card .exam {
  color: var(--brand-light);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.course-card h3 {
  margin: 4px 0;
  font-size: 15px;
  font-weight: 600;
}
.course-card .price {
  color: var(--ok);
  font-size: 13px;
  font-weight: 600;
  margin-top: 8px;
}

/* ==========================================================================
   Public Landing Page
   ========================================================================== */
.landing {
  min-height: 100vh;
  width: 100%;
}
.landing-top {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px clamp(16px, 4vw, 48px);
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--line);
  width: 100%;
}
.landing-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}
.landing-nav {
  display: flex;
  gap: 8px;
  align-items: center;
}

.landing-body > section {
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(16px, 4vw, 48px);
  padding-right: clamp(16px, 4vw, 48px);
  width: 100%;
}

.hero {
  padding-top: clamp(40px, 6vw, 72px);
  padding-bottom: clamp(28px, 4vw, 48px);
  text-align: center;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  background: var(--bg-surface);
  border: 1px solid var(--line);
  padding: 4px 12px;
  border-radius: var(--radius-full);
}
.hero-h1 {
  font-size: clamp(28px, 4.5vw, 46px);
  line-height: 1.18;
  letter-spacing: -0.02em;
  margin: 16px auto 0;
  max-width: 24ch;
  color: #fff;
  font-weight: 700;
}
.hero-sub {
  color: var(--muted);
  font-size: clamp(14px, 1.6vw, 16px);
  max-width: 60ch;
  margin: 14px auto 0;
  line-height: 1.6;
}
.hero-cta {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 24px;
  flex-wrap: wrap;
}
.hero-cta .btn-primary, .hero-cta .btn-ghost {
  padding: 9px 20px;
  font-size: 13.5px;
}
.hero-points {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-top: 32px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
}
.hero-point {
  display: flex;
  align-items: center;
  gap: 6px;
}

.landing-section {
  padding-top: 40px;
  padding-bottom: 12px;
}
.landing-h2 {
  font-size: clamp(18px, 2.5vw, 24px);
  letter-spacing: -0.015em;
  margin: 0 0 16px;
  font-weight: 700;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.feature-card {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 18px;
  display: flex;
  flex-direction: column;
}
.feature-card h3 {
  font-size: 15px;
  margin: 0 0 6px;
  color: #fff;
}
.feature-card p {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
  line-height: 1.5;
}

.ann-banners {
  padding-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ann-banner {
  display: flex;
  gap: 16px;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px;
  min-width: 0;
}
.ann-banner-img {
  width: 160px;
  height: 100px;
  object-fit: cover;
  border-radius: var(--radius-xs);
  flex-shrink: 0;
}
.ann-banner-text { flex: 1 1 auto; min-width: 0; }
.ann-banner-text h2 {
  margin: 4px 0 0;
  font-size: 16px;
}
.ann-banner-text p {
  color: var(--muted);
  margin: 4px 0 0;
  font-size: 12.5px;
}

.ann-tag {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--brand-light);
  background: var(--brand-subtle);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-xs);
  padding: 2px 7px;
}
.ann-cta { margin-top: 10px; }

.ann-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.ann-card {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.ann-card-img {
  width: 100%;
  height: 130px;
  object-fit: cover;
}
.ann-card-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
  flex: 1 1 auto;
}
.ann-card-body h3 { margin: 2px 0 0; font-size: 14px; }
.ann-card-body p { color: var(--muted); margin: 2px 0 0; font-size: 12.5px; }
.ann-card-body .ann-cta { margin-top: auto; padding-top: 8px; }

.landing-course-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
}
.landing-course-foot .price {
  color: var(--ok);
  font-size: 13px;
  font-weight: 600;
  margin: 0;
}

.landing-foot {
  max-width: 1100px;
  margin: 48px auto 0;
  padding: 20px clamp(16px, 4vw, 48px) 32px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
}
.landing-foot-links { display: flex; gap: 10px; }

/* ==========================================================================
   Auth Layout
   ========================================================================== */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  width: 100%;
  background: var(--bg);
}
.auth-split {
  width: 100%;
  max-width: 840px;
  min-height: 500px;
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.auth-side {
  padding: 32px 26px;
  display: flex;
  flex-direction: column;
  background: var(--bg-subtle);
  border-right: 1px solid var(--line);
  justify-content: space-between;
}
.auth-brand {
  margin-bottom: 20px;
}
.auth-features {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 8px 0 20px;
}
.auth-feature-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-secondary);
}
.auth-feature-icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--ok-bg);
  color: var(--ok);
  border: 1px solid var(--ok-border);
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}
.auth-quote {
  margin: 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.auth-quote blockquote {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text);
}
.auth-quote figcaption {
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
}
.auth-panel {
  padding: 32px 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  background: var(--bg-surface);
}
.auth-h1 {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 4px;
}
.auth-h1-sub {
  color: var(--muted);
  margin: 0 0 16px;
  font-size: 12.5px;
}
.auth-seg {
  display: flex;
  gap: 4px;
  margin-bottom: 18px;
  background: var(--bg);
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}
.auth-tab {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 7px 12px;
  border-radius: var(--radius-xs);
  font-size: 12.5px;
  font-weight: 500;
  font-family: inherit;
  transition: color 0.12s ease, background-color 0.12s ease;
  text-align: center;
}
.auth-tab:hover { color: var(--text); }
.auth-tab.active {
  background: var(--bg-elevated);
  color: #fff;
  font-weight: 600;
}

.pw-wrap {
  position: relative;
  display: block;
  width: 100%;
}
.pw-wrap input {
  padding-right: 64px;
}
.pw-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: auto;
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 500;
  padding: 4px 6px;
  border-radius: 4px;
}
.pw-toggle:hover {
  color: var(--text);
  background: var(--bg-elevated);
}

.otp-input {
  font-family: var(--font-mono) !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  letter-spacing: 0.3em !important;
  text-align: center !important;
  padding: 10px 12px !important;
  background: var(--bg-input) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius-sm) !important;
  color: #fff !important;
}
.otp-input:focus {
  border-color: var(--brand) !important;
}

.auth-meta {
  display: flex;
  justify-content: flex-end;
  margin: -2px 0 14px;
}
.auth-link {
  color: var(--brand-light);
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
}
.auth-link:hover { text-decoration: underline; }

.auth-foot {
  margin-top: 16px;
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}

.auth-back {
  align-self: flex-start;
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 0 0 12px;
  cursor: pointer;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.auth-back:hover { color: var(--text); }

/* Progress Bar */
.progress-bar-wrap {
  width: 100%;
  height: 5px;
  background: var(--bg-subtle);
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 1px solid var(--line);
  margin-top: 4px;
}
.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.25s ease;
}

/* Empty State */
.empty {
  color: var(--muted);
  text-align: center;
  padding: 32px 16px;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
}

/* Utilities */
.inline-note { color: var(--muted); font-size: 12px; }
.ellipsis { max-width: 320px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
  width: 100%;
}
.bar > input, .bar > select {
  max-width: 300px;
  flex: 1 1 180px;
}
.hr { height: 1px; background: var(--line); margin: 14px 0; border: none; }
.mono { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; height: auto; max-height: none; overflow: visible; }
  .sidebar { height: auto; max-height: none; width: 100%; min-width: 0; overflow: visible; }
  .main { height: auto; max-height: none; overflow: visible; padding: 16px; width: 100%; }
  .player { grid-template-columns: 1fr; }
  .auth-split { grid-template-columns: 1fr; max-width: 420px; }
  .auth-side { display: none; }
  .auth-panel { padding: 24px 20px; }
  .auth-panel .mobile-brand { display: flex; }
  .ann-banner { flex-direction: column; align-items: stretch; }
  .ann-banner-img { width: 100%; height: 140px; }
  .landing-foot { flex-direction: column; text-align: center; }
}

/* ==========================================================================
   Print & PDF Export Styling
   ========================================================================== */
@media print {
  body {
    background: #fff !important;
    color: #000 !important;
  }
  .sidebar,
  .btn-row,
  .page-head .btn-row,
  button,
  .modal-backdrop,
  .toast-wrap {
    display: none !important;
  }
  .shell {
    display: block !important;
    height: auto !important;
    overflow: visible !important;
  }
  .main {
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    overflow: visible !important;
  }
  .card, .q-card {
    background: #fff !important;
    border: 1px solid #ccc !important;
    color: #000 !important;
    page-break-inside: avoid;
    margin-bottom: 16px !important;
    box-shadow: none !important;
  }
  .opt {
    background: #fff !important;
    border: 1px solid #ddd !important;
    color: #000 !important;
  }
  .opt.correct {
    background: #f0fdf4 !important;
    border-color: #16a34a !important;
    color: #15803d !important;
  }
  .opt.wrong {
    background: #fef2f2 !important;
    border-color: #dc2626 !important;
    color: #b91c1c !important;
  }
  .badge {
    border: 1px solid #ccc !important;
  }
  .stat {
    border: 1px solid #ddd !important;
    background: #fff !important;
  }
  table {
    border-collapse: collapse;
    width: 100%;
  }
  th, td {
    border: 1px solid #ddd !important;
    color: #000 !important;
  }
}

/* ==========================================================================
   Authentic NTA / TCS iON Computer-Based Test (CBT) Simulation Styles
   ========================================================================== */

/* Pre-Exam Instructions & Readiness Screen */
.cbt-inst-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}
.cbt-inst-card {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}
.cbt-inst-header {
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.cbt-inst-section {
  margin-bottom: 24px;
}
.cbt-inst-section h4 {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-heading);
}
.cbt-legend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.cbt-legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  padding: 8px 12px;
  font-size: 12.5px;
  color: var(--text-secondary);
}
.cbt-declaration {
  background: rgba(37, 99, 235, 0.06);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin: 24px 0 20px;
}
.cbt-declaration label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
}
.cbt-declaration input[type="checkbox"] {
  margin-top: 3px;
  accent-color: var(--brand);
}

/* CBT Exam Engine Main Layout */
.cbt-screen {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 120px);
  width: 100%;
}
.cbt-topbar {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  gap: 14px;
  flex-wrap: wrap;
}
.cbt-exam-info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.cbt-exam-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-heading);
  letter-spacing: -0.01em;
}
.cbt-timer-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: #34d399;
}
.cbt-timer-box.danger {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
  animation: pulse-timer 1.5s infinite;
}
@keyframes pulse-timer {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.cbt-candidate-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  font-size: 12px;
}
.cbt-candidate-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 12px;
}

/* CBT Two-Column Body */
.cbt-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
  align-items: start;
  flex: 1;
}

/* Section Tabs */
.cbt-section-nav {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
  overflow-x: auto;
}
.cbt-section-tab {
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: var(--radius-xs);
  border: 1px solid var(--line);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.1s ease;
}
.cbt-section-tab:hover {
  background: var(--bg-elevated);
  color: var(--text);
}
.cbt-section-tab.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.cbt-section-tab .tab-badge {
  font-size: 11px;
  background: rgba(0, 0, 0, 0.2);
  padding: 1px 6px;
  border-radius: 10px;
}

/* Question Box */
.cbt-q-pane {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  min-height: 480px;
}
.cbt-q-header {
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-subtle);
  border-top-left-radius: var(--radius-sm);
  border-top-right-radius: var(--radius-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.cbt-q-body {
  padding: 22px;
  flex: 1;
  overflow-y: auto;
  line-height: 1.65;
  font-size: 15px;
}
.cbt-q-text {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 22px;
}
.cbt-options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cbt-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  cursor: pointer;
  transition: all 0.12s ease;
  user-select: none;
}
.cbt-option:hover {
  border-color: var(--line-strong);
  background: var(--bg-elevated);
}
.cbt-option.selected {
  border-color: var(--brand);
  background: var(--brand-subtle);
}
.cbt-option-radio {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  background: var(--bg-surface);
  color: var(--text-secondary);
  flex-shrink: 0;
}
.cbt-option.selected .cbt-option-radio {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

/* CBT Bottom Action Bar */
.cbt-footer-bar {
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  background: var(--bg-subtle);
  border-bottom-left-radius: var(--radius-sm);
  border-bottom-right-radius: var(--radius-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.btn-save-next {
  background: #16a34a !important;
  border-color: #15803d !important;
  color: #fff !important;
  font-weight: 600 !important;
}
.btn-save-next:hover {
  background: #15803d !important;
}
.btn-mark-review {
  background: #9333ea !important;
  border-color: #7e22ce !important;
  color: #fff !important;
  font-weight: 600 !important;
}
.btn-mark-review:hover {
  background: #7e22ce !important;
}
.btn-clear-choice {
  background: var(--bg-elevated) !important;
  color: var(--text-secondary) !important;
}
.btn-submit-cbt {
  background: #2563eb !important;
  border-color: #1d4ed8 !important;
  color: #fff !important;
  font-weight: 700 !important;
  padding: 8px 18px !important;
}
.btn-submit-cbt:hover {
  background: #1d4ed8 !important;
}

/* Question Palette (Right Pane) */
.cbt-palette-card {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 16px;
}
.cbt-palette-legend {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  font-size: 11px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}
.cbt-legend-stat {
  display: flex;
  align-items: center;
  gap: 6px;
}
.cbt-stat-badge {
  min-width: 22px;
  height: 20px;
  padding: 0 4px;
  border-radius: 3px;
  font-size: 10.5px;
  font-weight: 700;
  display: grid;
  place-items: center;
  color: #fff;
  font-family: var(--font-mono);
}
.cbt-stat-badge.st-ans { background: #16a34a; }
.cbt-stat-badge.st-not-ans { background: #dc2626; }
.cbt-stat-badge.st-not-vis { background: var(--bg-elevated); color: var(--muted); border: 1px solid var(--line-strong); }
.cbt-stat-badge.st-marked { background: #9333ea; border-radius: 50%; }
.cbt-stat-badge.st-ans-marked { background: #7e22ce; border-radius: 50%; position: relative; }
.cbt-stat-badge.st-ans-marked::after {
  content: '✓';
  position: absolute;
  bottom: -2px;
  right: -2px;
  font-size: 8px;
  background: #16a34a;
  border-radius: 50%;
  width: 10px;
  height: 10px;
  display: grid;
  place-items: center;
}

/* Palette Grid Numbers */
.cbt-palette-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 4px;
}
.pnum {
  aspect-ratio: 1;
  min-height: 34px;
  width: 100%;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  border-radius: var(--radius-xs);
  border: 1.5px solid var(--line);
  background: var(--bg-subtle);
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  position: relative;
  transition: transform 0.08s ease, border-color 0.1s ease;
}
.pnum:hover {
  transform: scale(1.06);
  border-color: var(--line-strong);
}
.pnum.st-not-visited {
  background: var(--bg-subtle);
  border-color: var(--line);
  color: var(--muted);
}
.pnum.st-not-answered {
  background: #dc2626;
  border-color: #b91c1c;
  color: #fff;
  clip-path: polygon(0% 0%, 100% 0%, 100% 75%, 50% 100%, 0% 75%);
}
.pnum.st-answered {
  background: #16a34a;
  border-color: #15803d;
  color: #fff;
  clip-path: polygon(0% 25%, 50% 0%, 100% 25%, 100% 100%, 0% 100%);
}
.pnum.st-marked {
  background: #9333ea;
  border-color: #7e22ce;
  color: #fff;
  border-radius: 50%;
}
.pnum.st-answered-marked {
  background: #7e22ce;
  border-color: #6b21a8;
  color: #fff;
  border-radius: 50%;
}
.pnum.st-answered-marked::after {
  content: '✓';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 12px;
  height: 12px;
  background: #16a34a;
  border: 1px solid #fff;
  border-radius: 50%;
  font-size: 8px;
  display: grid;
  place-items: center;
  color: #fff;
}
.pnum.current-q {
  outline: 2.5px solid #3b82f6;
  outline-offset: 1.5px;
  z-index: 2;
}

/* Exam Summary Table Modal */
.cbt-summary-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 13px;
}
.cbt-summary-table th {
  background: var(--bg-elevated);
  padding: 10px 12px;
  border: 1px solid var(--line);
  font-weight: 600;
  text-align: left;
}
.cbt-summary-table td {
  padding: 8px 12px;
  border: 1px solid var(--line);
}
.cbt-summary-table tr:nth-child(even) td {
  background: var(--bg-subtle);
}

@media (max-width: 900px) {
  .cbt-body {
    grid-template-columns: 1fr;
  }
  .cbt-palette-card {
    position: static;
  }
}


