:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-soft: #eef0ff;
  --success: #16a34a;
  --error: #dc2626;
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #1a1d29;
  --muted: #6b7280;
  --border: #e8e9ef;
  --radius: 12px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-md: 0 2px 8px rgba(16, 24, 40, 0.06), 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-lg: 0 8px 24px rgba(16, 24, 40, 0.08), 0 2px 6px rgba(16, 24, 40, 0.04);
  --sidebar-bg: #14161f;
  --sidebar-bg-soft: #1b1e2b;
  --sidebar-text: #a6a9bd;
  --sidebar-text-active: #ffffff;
  --sidebar-border: #262838;
  --sidebar-width: 264px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.brand {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--primary-dark);
  text-decoration: none;
  display: flex;
  align-items: center;
}
.brand-logo {
  max-height: 36px;
  max-width: 220px;
  display: block;
}
.topbar nav { display: flex; align-items: center; gap: 12px; }
.user-chip { color: var(--muted); font-size: 0.9rem; }

/* ==========================================================
   App shell — sidebar navigation (admin + student)
   ========================================================== */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 40;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 16px;
  text-decoration: none;
  flex-shrink: 0;
}
.sidebar-brand:hover { text-decoration: none; }
.sidebar-brand-logo { max-height: 32px; max-width: 100%; display: block; }
.sidebar-brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}
.sidebar-brand-text {
  color: #fff;
  font-weight: 700;
  font-size: 1.02rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-nav {
  flex: 1;
  padding: 4px 12px 16px;
  overflow-y: auto;
}
.sidebar-group { margin-bottom: 4px; }
.sidebar-group-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #5c5f75;
  padding: 14px 12px 6px;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--sidebar-text);
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  margin-bottom: 2px;
  transition: background 0.12s, color 0.12s;
}
.sidebar-link svg { flex-shrink: 0; opacity: 0.85; }
.sidebar-link:hover { background: var(--sidebar-bg-soft); color: #fff; text-decoration: none; }
.sidebar-link.active {
  background: var(--primary);
  color: #fff;
}
.sidebar-link.active svg { opacity: 1; }

.sidebar-footer {
  border-top: 1px solid var(--sidebar-border);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.sidebar-user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sidebar-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.sidebar-user-info { min-width: 0; }
.sidebar-user-name {
  color: #fff;
  font-size: 0.86rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 130px;
}
.sidebar-user-role { color: var(--sidebar-text); font-size: 0.74rem; }
.sidebar-logout {
  color: var(--sidebar-text);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  flex-shrink: 0;
}
.sidebar-logout:hover { background: var(--sidebar-bg-soft); color: #fff; text-decoration: none; }

.main-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.mobile-topbar {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 30;
}
.mobile-menu-btn {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--text);
  display: flex;
}
.mobile-topbar-title { font-weight: 700; font-size: 1rem; }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 15, 25, 0.5);
  z-index: 35;
}
.sidebar-overlay.show { display: block; }

@media (max-width: 900px) {
  .mobile-topbar { display: flex; }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
}

.btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.12s, border-color 0.12s, box-shadow 0.12s, transform 0.05s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 1px 2px rgba(79, 70, 229, 0.25); }
.btn-primary:hover { background: var(--primary-dark); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: #f0f0f5; text-decoration: none; }
.btn-danger { background: var(--error); color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 0.8rem; }
.btn-block { display: block; width: 100%; text-align: center; }

.page {
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
  padding: 28px 32px 60px;
  flex: 1;
}
@media (max-width: 600px) {
  .page { padding: 18px 16px 40px; }
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.card-narrow { max-width: 420px; margin: 40px auto; }

h1 { font-size: 1.6rem; margin: 0 0 6px; }
h2 { font-size: 1.25rem; margin: 0 0 14px; }
.subtitle { color: var(--muted); margin: 0 0 20px; }

.form-group { margin-bottom: 16px; }
label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.9rem; }
input[type=text], input[type=email], input[type=password], input[type=number],
textarea, select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #fff;
}
textarea { resize: vertical; min-height: 80px; }
.help-text { color: var(--muted); font-size: 0.82rem; margin-top: 4px; }

.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 18px;
  font-size: 0.92rem;
}
.alert-success { background: #ecfdf3; color: #166534; border: 1px solid #bbf7d0; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 0.92rem; }
th { color: var(--muted); font-weight: 600; font-size: 0.82rem; text-transform: uppercase; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-green { background: #ecfdf3; color: #166534; }
.badge-gray { background: #f3f4f6; color: #4b5563; }
.badge-red { background: #fef2f2; color: #991b1b; }

.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 720px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

.stat-value { font-size: 1.8rem; font-weight: 700; color: var(--primary-dark); }
.stat-label { color: var(--muted); font-size: 0.85rem; }

/* ==========================================================
   Pagination
   ========================================================== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}
.page-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 6px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  transition: background 0.12s, color 0.12s, box-shadow 0.12s;
}
.page-btn:hover { background: var(--primary-soft); color: var(--primary-dark); text-decoration: none; }
.page-btn-icon { color: var(--muted); }
.page-btn-icon svg { display: block; }
.page-btn-icon.disabled { opacity: 0.3; pointer-events: none; }
.page-btn-number.active {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.page-btn-number.active:hover { background: var(--primary); color: #fff; }
.page-ellipsis { color: var(--muted); padding: 0 4px; font-size: 0.85rem; }
.page-total { color: var(--muted); font-size: 0.82rem; }

.option-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  cursor: pointer;
}
.option-row:hover { border-color: var(--primary); }
.option-row input { width: auto; }

.question-nav { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.question-nav a {
  display: inline-block;
  width: 34px; height: 34px;
  line-height: 34px;
  text-align: center;
  border-radius: 6px;
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  font-size: 0.85rem;
}
.question-nav a.answered { background: var(--primary); color: #fff; border-color: var(--primary); }
.question-nav a.current { border-color: var(--primary-dark); border-width: 2px; }

.autosave-status {
  font-style: italic;
  min-width: 60px;
  text-align: right;
}

.timer {
  font-weight: 700;
  color: var(--error);
  font-size: 1.05rem;
}

.footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
  padding: 20px;
}

.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.text-right { text-align: right; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }

/* ==========================================================
   Auth pages (login / register) — split-screen layout
   ========================================================== */
.auth-wrap {
  min-height: 100vh;
  display: flex;
}

.auth-visual {
  flex: 1 1 46%;
  background: linear-gradient(155deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 56px;
  position: relative;
  overflow: hidden;
}
.auth-visual::before,
.auth-visual::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}
.auth-visual::before { width: 340px; height: 340px; top: -120px; right: -100px; }
.auth-visual::after { width: 220px; height: 220px; bottom: -80px; left: -60px; }

.auth-visual-inner {
  position: relative;
  z-index: 1;
  max-width: 420px;
}
.auth-visual-logo {
  max-height: 42px;
  max-width: 220px;
  margin-bottom: 36px;
  filter: brightness(0) invert(1);
}
.auth-visual-brand {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 36px;
  opacity: 0.95;
}
.auth-visual h1 {
  font-size: 2rem;
  line-height: 1.25;
  margin: 0 0 16px;
  color: #fff;
}
.auth-visual-tagline {
  font-size: 1.02rem;
  opacity: 0.88;
  margin: 0 0 32px;
  line-height: 1.6;
}
.auth-feature-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.auth-feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
  font-size: 0.95rem;
  opacity: 0.95;
}
.auth-feature-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.auth-feature-icon svg { width: 12px; height: 12px; }

.auth-form-panel {
  flex: 1 1 54%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: var(--bg);
}
.auth-form-box {
  width: 100%;
  max-width: 380px;
}
.auth-form-box h1 {
  font-size: 1.5rem;
  margin: 0 0 6px;
}
.auth-role-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  background: #eef0f7;
  padding: 4px;
  border-radius: 10px;
}
.auth-role-tabs a {
  flex: 1;
  text-align: center;
  padding: 8px 10px;
  border-radius: 7px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
}
.auth-role-tabs a.active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

@media (max-width: 880px) {
  .auth-wrap { flex-direction: column; }
  .auth-visual { flex: none; padding: 40px 28px; text-align: left; }
  .auth-visual::before, .auth-visual::after { display: none; }
  .auth-visual-tagline, .auth-feature-list { display: none; }
  .auth-visual h1 { font-size: 1.5rem; margin-bottom: 4px; }
  .auth-form-panel { flex: none; padding: 32px 20px 48px; }
}

/* ==========================================================
   Exam window — professional test-taking interface
   ========================================================== */
.exam-body {
  background: #f1f2f7;
  margin: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.exam-topbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  gap: 16px;
  flex-wrap: wrap;
}
.exam-topbar-left { display: flex; align-items: center; gap: 12px; }
.exam-topbar-logo { max-height: 32px; max-width: 140px; display: block; flex-shrink: 0; }
.exam-topbar-title { font-weight: 700; font-size: 1.05rem; }
.exam-topbar-sub { color: var(--muted); font-size: 0.8rem; }
.exam-topbar-right { display: flex; align-items: center; gap: 14px; }
.exam-timer {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  background: #f3f4f6;
  padding: 6px 14px;
  border-radius: 8px;
  font-variant-numeric: tabular-nums;
}
.exam-timer.low-time { color: #fff; background: var(--error); animation: exam-pulse 1s infinite; }
@keyframes exam-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }

.exam-violation-badge {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  background: #fef2f2;
  color: var(--error);
  border: 1px solid #fecaca;
  display: none;
}
.exam-violation-badge.show { display: inline-block; }

.exam-warning-banner {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: #fef2f2;
  border: 1.5px solid var(--error);
  color: #991b1b;
  padding: 14px 22px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.92rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  max-width: 90%;
  text-align: center;
}
.exam-warning-banner.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.exam-main {
  flex: 1;
  display: flex;
  overflow: hidden;
}

.exam-question-pane {
  flex: 1;
  overflow-y: auto;
  padding: 28px 32px 100px;
}
.exam-question-card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 28px 32px;
  max-width: 760px;
  margin: 0 auto;
}
.exam-q-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  font-size: 0.82rem;
  color: var(--muted);
}
.exam-q-number {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  width: 30px;
  height: 30px;
  line-height: 30px;
  text-align: center;
  border-radius: 50%;
  margin-right: 10px;
}
.exam-q-text {
  font-size: 1.15rem;
  line-height: 1.55;
  margin: 0 0 24px;
  color: var(--text);
}
.exam-option-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.exam-option-row:hover { border-color: var(--primary); background: #fafaff; }
.exam-option-row.selected { border-color: var(--primary); background: #eef0ff; }
.exam-option-row input { width: auto; margin-top: 3px; flex-shrink: 0; }
.exam-option-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #eee;
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
}
.exam-option-row.selected .exam-option-letter { background: var(--primary); color: #fff; }

.exam-nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 760px;
  margin: 20px auto 0;
  flex-wrap: wrap;
  gap: 10px;
}
.exam-nav-bar-left, .exam-nav-bar-right { display: flex; gap: 8px; flex-wrap: wrap; }

.exam-palette-pane {
  width: 280px;
  flex-shrink: 0;
  background: #fff;
  border-left: 1px solid var(--border);
  padding: 20px;
  overflow-y: auto;
}
.exam-palette-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 18px;
}
.exam-palette-stat {
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  gap: 6px;
}
.exam-palette-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.exam-palette-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.exam-palette-btn {
  aspect-ratio: 1;
  border-radius: 6px;
  border: none;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  color: #fff;
  background: #d1d5db;
  position: relative;
}
.exam-palette-btn.current { outline: 3px solid var(--primary-dark); outline-offset: 1px; }
.exam-palette-btn.not-visited { background: #d1d5db; color: #4b5563; }
.exam-palette-btn.not-answered { background: #ef4444; }
.exam-palette-btn.answered { background: #22c55e; }
.exam-palette-btn.marked { background: #a855f7; }
.exam-palette-btn.answered-marked { background: #6366f1; }
.exam-palette-btn.answered-marked::after {
  content: "✓";
  position: absolute;
  bottom: -2px;
  right: -2px;
  background: #22c55e;
  border-radius: 50%;
  width: 14px;
  height: 14px;
  font-size: 9px;
  line-height: 14px;
}

.exam-submit-modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 15, 25, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.exam-submit-modal-backdrop.show { display: flex; }
.exam-submit-modal {
  background: #fff;
  border-radius: 14px;
  padding: 28px;
  max-width: 420px;
  width: 92%;
}

.exam-proctor-overlay {
  position: fixed; inset: 0;
  background: rgba(10, 10, 20, 0.92);
  color: #fff;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}
.exam-proctor-overlay-box { max-width: 480px; }
.exam-proctor-overlay h2 { color: #fff; font-size: 1.4rem; }
.exam-proctor-overlay ul { text-align: left; color: #d1d5db; font-size: 0.92rem; line-height: 1.7; }

.exam-select-none { user-select: none; -webkit-user-select: none; }

.exam-warning-banner {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: #7c2d12;
  color: #fff;
  padding: 14px 22px;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  font-size: 0.92rem;
  font-weight: 600;
  z-index: 300;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  max-width: 90vw;
  text-align: center;
}
.exam-warning-banner.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 900px) {
  .exam-main { flex-direction: column; }
  .exam-palette-pane { width: 100%; border-left: none; border-top: 1px solid var(--border); max-height: 40vh; }
  .exam-question-pane { padding: 18px 16px 24px; }
  .exam-question-card { padding: 20px; }
}

/* ==========================================================
   Charts — inline SVG, no JS library
   ========================================================== */
.chart-svg {
  width: 100%;
  height: auto;
  display: block;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.chart-grid { stroke: #eef0f4; stroke-width: 1; }
.chart-axis { stroke: var(--border); stroke-width: 1; }
.chart-axis-label { font-size: 10px; fill: var(--muted); }
.chart-value-label { font-size: 11px; fill: var(--text); font-weight: 600; }
.chart-line { stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart-area { opacity: 0.12; }
.chart-point { stroke: #fff; stroke-width: 1.5; }
.chart-donut-total { font-size: 28px; font-weight: 700; fill: var(--text); }

.chart-donut-wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.chart-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.88rem;
}
.chart-legend li { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.chart-legend-dot { width: 11px; height: 11px; border-radius: 3px; flex-shrink: 0; }

.chart-stackedbar-wrap { width: 100%; }
.chart-stackedbar-svg { width: 100%; height: 26px; display: block; }
.chart-legend-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin-top: 12px;
}
.chart-legend-inline li { margin-bottom: 0; font-size: 0.85rem; }

.chart-card-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 800px) {
  .chart-card-row { grid-template-columns: 1fr; }
}

/* ==========================================================
   Code editor — coding questions
   ========================================================== */
.code-editor-frame {
  display: flex;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #1e1e2e;
  height: 320px;
}
.code-editor-gutter {
  background: #181825;
  color: #6c7086;
  font-family: "SF Mono", Monaco, Consolas, "Courier New", monospace;
  font-size: 0.85rem;
  line-height: 1.55;
  padding: 12px 10px;
  text-align: right;
  white-space: pre;
  overflow: hidden;
  user-select: none;
  flex-shrink: 0;
  min-width: 36px;
}
.code-editor-textarea {
  flex: 1;
  border: none;
  border-radius: 0;
  background: #1e1e2e;
  color: #cdd6f4;
  font-family: "SF Mono", Monaco, Consolas, "Courier New", monospace;
  font-size: 0.85rem;
  line-height: 1.55;
  padding: 12px;
  resize: vertical;
  white-space: pre;
  overflow: auto;
  tab-size: 4;
}
.code-editor-textarea:focus { outline: none; box-shadow: none; border: none; }
.code-output-panel {
  margin-top: 10px;
  background: #181825;
  color: #a6e3a1;
  font-family: "SF Mono", Monaco, Consolas, "Courier New", monospace;
  font-size: 0.82rem;
  padding: 12px;
  border-radius: 8px;
  max-height: 200px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
