/* ================================================================
   Gyanam Exam Portal — Professional Light Design System
   Clean, corporate, solid colors — no gradients, no glassmorphism
================================================================ */

/* --- Reset & Base --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Brand colors — solid only */
  --primary: #1d4ed8;
  /* solid blue  */
  --primary-dark: #1e3a8a;
  --primary-light: #eff6ff;
  --primary-text: #1d4ed8;

  --success: #16a34a;
  --success-bg: #f0fdf4;
  --success-text: #15803d;

  --warning: #d97706;
  --warning-bg: #fffbeb;
  --warning-text: #b45309;

  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --danger-text: #b91c1c;

  --info: #0284c7;
  --info-bg: #f0f9ff;

  /* Neutrals */
  --white: #ffffff;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  /* Text */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;

  /* Layout */
  --sidebar-width: 240px;
  --header-height: 60px;

  /* Borders */
  --border: 1px solid #e2e8f0;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);

  --transition: all 0.18s ease;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--gray-50);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

*:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ── Typography ─────────────────────────────────────────────── */
h1 {
  font-size: 1.5rem;
  font-weight: 700;
}

h2 {
  font-size: 1.25rem;
  font-weight: 700;
}

h3 {
  font-size: 1.05rem;
  font-weight: 600;
}

h4 {
  font-size: 0.9rem;
  font-weight: 600;
}

/* ── Buttons ────────────────────────────────────────────────── */
button {
  font-family: var(--font);
  cursor: pointer;
  border: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  transition: var(--transition);
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.btn-primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.btn-outline {
  background: white;
  color: var(--text-primary);
  border-color: var(--gray-300);
}

.btn-outline:hover {
  background: var(--gray-50);
  border-color: var(--gray-400);
}

.btn-danger {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}

.btn-danger:hover {
  background: #b91c1c;
  border-color: #b91c1c;
}

.btn-success {
  background: var(--success);
  color: white;
  border-color: var(--success);
}

.btn-success:hover {
  background: #15803d;
  border-color: #15803d;
}

.btn-warning {
  background: var(--warning);
  color: white;
  border-color: var(--warning);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}

.btn-ghost:hover {
  background: var(--gray-100);
  color: var(--text-primary);
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: white;
  border: var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.card-header {
  padding: 1rem 1.25rem;
  border-bottom: var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-body {
  padding: 1.25rem;
}

.card-footer {
  padding: 1rem 1.25rem;
  border-top: var(--border);
  background: var(--gray-50);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ── Form Controls ──────────────────────────────────────────── */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.375rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: white;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-size: 0.9rem;
  color: var(--text-primary);
  transition: var(--transition);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12);
  outline: none;
}

.form-input.invalid {
  border-color: var(--danger);
}

.form-error {
  color: var(--danger);
  font-size: 0.78rem;
  margin-top: 0.25rem;
  display: none;
}

.form-error.visible {
  display: block;
}

.form-textarea {
  resize: vertical;
  min-height: 90px;
}

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0.2rem 0.55rem;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

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

.badge-green {
  background: var(--success-bg);
  color: var(--success-text);
}

.badge-red {
  background: var(--danger-bg);
  color: var(--danger-text);
}

.badge-yellow {
  background: var(--warning-bg);
  color: var(--warning-text);
}

.badge-gray {
  background: var(--gray-100);
  color: var(--gray-600);
}

/* ── Student Records page ───────────────────────────────────── */
.stu-page {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  min-height: 0;
}

.stu-header {
  margin-bottom: 0;
  align-items: center;
}

.stu-header h2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.stu-scope {
  display: inline-flex;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: none;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.stu-header-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.stu-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 0.85rem 1rem;
  background: #fff;
}

.stu-search-wrap {
  position: relative;
  width: 100%;
}

.stu-search-wrap svg {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--gray-400);
  pointer-events: none;
}

.stu-search-wrap .form-input {
  padding-left: 2.35rem;
}

.stu-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.stu-filters .form-select {
  width: auto;
  min-width: 132px;
  flex: 1 1 132px;
  max-width: 200px;
}

.stu-clear-btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

.stu-centre-filter {
  width: 200px;
  flex-shrink: 0;
}

.stu-bulk-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.65rem 1rem;
  border-radius: 12px;
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  color: #fff;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.22);
}

.stu-bulk-left {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.stu-bulk-count {
  min-width: 1.6rem;
  height: 1.6rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
}

.stu-bulk-actions {
  display: flex;
  gap: 0.45rem;
}

.stu-bulk-actions .btn {
  background: #fff;
  color: #1d4ed8;
  border: none;
  font-weight: 700;
}

.stu-bulk-actions .btn:hover {
  background: #eff6ff;
}

.stu-table-card {
  overflow: hidden;
}

.stu-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.75rem 1rem;
  border-top: 1px solid #e2e8f0;
  background: #fafbfc;
}

.stu-pager-left,
.stu-pager-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.stu-pager-size {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 650;
  color: #64748b;
}

.stu-pager-size .form-select {
  width: auto;
  min-width: 72px;
  padding: 0.3rem 0.5rem;
  font-size: 0.8rem;
}

.stu-pager-range {
  font-size: 0.78rem;
  color: #64748b;
  font-weight: 550;
}

.stu-page-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 0.45rem;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #334155;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.stu-page-btn:hover:not(:disabled):not(.is-active) {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.stu-page-btn.is-active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.stu-page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.stu-page-ellipsis {
  color: #94a3b8;
  font-size: 0.85rem;
  padding: 0 0.15rem;
}

@media (max-width: 640px) {
  .stu-pagination {
    flex-direction: column;
    align-items: stretch;
  }

  .stu-pager-right {
    justify-content: center;
  }
}

.stu-table-wrap {
  max-height: calc(100vh - 260px);
  overflow: auto;
}

.stu-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8fafc;
  box-shadow: inset 0 -1px 0 var(--gray-200);
}

.stu-table td,
.stu-table th {
  padding: 0.65rem 0.9rem;
}

.stu-check {
  width: 40px;
}

.stu-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: 0.01em;
}

.stu-name {
  font-weight: 650;
  font-size: 0.9rem;
  color: #0f172a;
  line-height: 1.25;
}

.stu-sub {
  display: none;
  font-size: 0.72rem;
  color: #64748b;
  margin-top: 0.15rem;
}

.stu-slot {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 650;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
  white-space: nowrap;
}

.stu-exam-count {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: #f8fafc;
  color: #94a3b8;
  border: 1px solid #e2e8f0;
}

.stu-exam-count.has {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.stu-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.3rem;
  width: 100%;
}

.stu-act {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  height: 32px;
  min-width: 32px;
  padding: 0 0.45rem;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #475569;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.stu-act svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.stu-act:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
}

.stu-act-primary {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
  padding: 0 0.65rem;
}

.stu-act-primary:hover {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1e40af;
}

.stu-act-danger {
  color: #b91c1c;
  border-color: #fecaca;
  background: #fff;
}

.stu-act-danger:hover {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #991b1b;
}

.stu-empty {
  text-align: center;
  padding: 2.5rem 1rem !important;
  color: #64748b;
}

.stu-empty-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.88rem;
}

.stu-empty-icon {
  font-size: 1.4rem;
  opacity: 0.7;
}

.stu-row:hover .stu-act {
  border-color: #cbd5e1;
}

@media (max-width: 900px) {
  .stu-centre-col {
    display: none;
  }

  .stu-sub {
    display: block;
  }

  .stu-act-primary span,
  .stu-act-primary {
    padding: 0 0.45rem;
  }

  .stu-act-primary {
    font-size: 0;
  }

  .stu-act-primary svg {
    margin: 0;
  }
}

@media (max-width: 640px) {
  .stu-table-wrap {
    max-height: calc(100vh - 300px);
  }

  .stu-centre-filter {
    width: 100%;
  }
}

/* ── Table ──────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead tr {
  background: var(--gray-50);
}

th {
  padding: 0.625rem 1rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: var(--border);
  white-space: nowrap;
}

td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--gray-100);
  color: var(--text-primary);
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: var(--gray-50);
}

/* ── Stats Grid ─────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

/* ── Admin Dashboard page ───────────────────────────────────── */
.dash-page {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.dash-page-header {
  margin-bottom: 0;
  align-items: center;
}

.dash-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.45rem;
  margin: 0.2rem 0 0;
  font-size: 0.8rem;
  color: #64748b;
}

.dash-meta-sep {
  color: #cbd5e1;
}

.dash-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.dash-chip-blue {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.dash-page-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

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

.dash-kpi {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 0.95rem 1rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  border-left: 3px solid #94a3b8;
}

.dash-kpi-blue { border-left-color: #2563eb; }
.dash-kpi-green { border-left-color: #16a34a; }
.dash-kpi-red { border-left-color: #dc2626; }
.dash-kpi-amber { border-left-color: #d97706; }
.dash-kpi-slate { border-left-color: #64748b; }

.dash-kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.dash-kpi-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}

.dash-kpi-icon {
  font-size: 0.78rem;
  opacity: 0.7;
}

.dash-kpi-value {
  font-size: 1.55rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.1;
}

.dash-kpi-sub {
  margin-top: 0.3rem;
  font-size: 0.74rem;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.dash-mid-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1rem;
}

.dash-panel {
  overflow: hidden;
}

.dash-panel-head {
  align-items: flex-start;
}

.dash-panel-head h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 750;
  color: #0f172a;
}

.dash-panel-sub {
  margin: 0.2rem 0 0;
  font-size: 0.74rem;
  color: #64748b;
  font-weight: 500;
}

.dash-table-wrap {
  max-height: 320px;
  overflow: auto;
}

.dash-table td,
.dash-table th {
  padding: 0.65rem 0.9rem;
}

.dash-strong {
  font-weight: 700;
  color: #0f172a;
  font-size: 0.86rem;
}

.dash-muted {
  color: #64748b;
  font-size: 0.78rem;
}

.dash-score {
  font-weight: 750;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}

.dash-empty {
  padding: 2rem 1.25rem;
  text-align: center;
}

.dash-empty-icon {
  font-size: 1.4rem;
  margin-bottom: 0.4rem;
  opacity: 0.8;
}

.dash-empty-title {
  font-weight: 700;
  color: #334155;
  font-size: 0.9rem;
}

.dash-empty-text {
  margin-top: 0.25rem;
  font-size: 0.78rem;
  color: #94a3b8;
  max-width: 280px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.45;
}

.dash-live-body {
  padding: 1.5rem 1.25rem 1.1rem;
  text-align: center;
}

.dash-live-count {
  font-size: 2.4rem;
  font-weight: 850;
  color: #94a3b8;
  line-height: 1;
}

.dash-live-count.is-live {
  color: #16a34a;
}

.dash-live-label {
  margin: 0.4rem 0 1rem;
  font-size: 0.82rem;
  color: #64748b;
}

.dash-quick-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
  padding: 0 1rem 1rem;
}

.dash-link {
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #334155;
  border-radius: 8px;
  padding: 0.55rem 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s;
}

.dash-link:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.dash-passbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 110px;
}

.dash-passbar span {
  font-size: 0.78rem;
  font-weight: 750;
  min-width: 2.4rem;
}

.dash-passbar-track {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.dash-passbar-fill {
  height: 100%;
  border-radius: 999px;
}

@media (max-width: 1100px) {
  .dash-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dash-mid-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .dash-kpi-grid {
    grid-template-columns: 1fr;
  }

  .dash-quick-links {
    grid-template-columns: 1fr;
  }
}

/* ── Results & Analytics page ───────────────────────────────── */
.res-page {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.res-kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.res-panel {
  overflow: hidden;
}

.res-chart-wrap {
  height: 240px;
  padding: 0.5rem 1rem 1rem;
  position: relative;
}

.res-chart-wide {
  height: 260px;
}

.res-chart-wrap .dash-empty {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

@media (max-width: 1100px) {
  .res-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .res-kpi-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Assign Bank page ───────────────────────────────────────── */
.assign-page {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.assign-back {
  padding-left: 0 !important;
  color: #64748b !important;
}

/* ── Exam Configuration form page ───────────────────────────── */
.exam-form-page {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: none;
  width: 100%;
}

.exam-form-card {
  padding: 1.5rem 1.6rem 1.35rem;
  width: 100%;
  box-sizing: border-box;
}

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

.exam-form-grid .form-group {
  margin: 0;
}

.exam-span-2 {
  grid-column: span 2;
}

.exam-span-3 {
  grid-column: 1 / -1;
}

.exam-form-section {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0.35rem 0 0.15rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid #e8edf5;
}

.exam-form-section:first-child {
  margin-top: 0;
}

.exam-form-section-title {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
}

.exam-form-section-line {
  flex: 1;
  height: 1px;
  background: transparent;
}

.exam-bank-hint {
  margin: 0.4rem 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.exam-bank-hint strong {
  color: #334155;
}

@media (max-width: 1100px) {
  .exam-form-grid {
    grid-template-columns: 1fr 1fr;
  }
  .exam-span-2,
  .exam-span-3 {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .exam-form-grid,
  .exam-mode-grid,
  .exam-proct-grid {
    grid-template-columns: 1fr;
  }
  .exam-span-2,
  .exam-span-3 {
    grid-column: 1 / -1;
  }
}

.exam-mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.exam-mode-card {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.85rem 0.95rem;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.exam-mode-card input {
  margin-top: 2px;
  flex-shrink: 0;
}

.exam-mode-card.is-active-normal {
  border-color: #16a34a;
  background: #f0fdf4;
}

.exam-mode-card.is-active-proctored {
  border-color: #dc2626;
  background: #fef2f2;
}

.exam-mode-title {
  display: block;
  font-weight: 700;
  font-size: 0.88rem;
}

.exam-mode-desc {
  display: block;
  font-size: 0.72rem;
  color: #64748b;
  margin-top: 0.15rem;
  line-height: 1.4;
}

.exam-proct-panel {
  margin-top: 0.75rem;
  padding: 0.85rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

.exam-proct-head {
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.6rem;
}

.exam-proct-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.exam-proct-opt {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.55rem 0.65rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
}

.exam-proct-opt input {
  width: 15px;
  height: 15px;
  margin-top: 2px;
  accent-color: #dc2626;
  flex-shrink: 0;
}

.exam-proct-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 650;
  color: #1e293b;
  line-height: 1.25;
}

.exam-proct-desc {
  display: block;
  font-size: 0.68rem;
  color: #64748b;
  margin-top: 0.12rem;
  line-height: 1.35;
}

.exam-tab-limit {
  margin-top: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.exam-tab-limit label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #374151;
}

.exam-tab-limit .form-input {
  width: 80px;
}

.exam-form-note {
  font-size: 0.76rem;
  color: #64748b;
  margin: 1rem 0 0;
  line-height: 1.45;
}

.exam-form-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.65rem;
  margin-top: 1.15rem;
  padding-top: 1rem;
  border-top: 1px solid #e8edf5;
}

.field-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.assign-bank-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1.15rem;
}

.assign-bank-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #eff6ff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.assign-bank-title {
  font-weight: 750;
  font-size: 1rem;
  color: #0f172a;
}

.assign-bank-sub {
  font-size: 0.78rem;
  color: #64748b;
  margin-top: 0.15rem;
}

.assign-list-card {
  overflow: hidden;
}

.assign-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  background: #fafbfc;
}

.assign-scope-card {
  padding: 1rem 1.15rem 1.05rem;
}

.assign-scope-title {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 0.75rem;
}

.assign-scope-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.assign-scope-opt {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.75rem 0.85rem;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}

.assign-scope-opt:has(input:checked) {
  border-color: #4361ee;
  background: #eef2ff;
}

.assign-scope-opt strong {
  display: block;
  font-size: 0.85rem;
  color: #0f172a;
}

.assign-scope-opt small {
  display: block;
  font-size: 0.72rem;
  color: #64748b;
  margin-top: 0.2rem;
  line-height: 1.35;
}

.assign-scope-hint {
  margin: 0.75rem 0 0;
  font-size: 0.8rem;
  color: #475569;
}

.assign-list-card.is-scope-locked {
  opacity: 0.92;
}

.assign-row.is-locked {
  cursor: default;
  opacity: 0.85;
}

@media (max-width: 960px) {
  .assign-scope-grid {
    grid-template-columns: 1fr;
  }
}

.assign-select-all {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 650;
  color: #334155;
  cursor: pointer;
}

.assign-list-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.assign-centre-list {
  max-height: calc(100vh - 420px);
  min-height: 280px;
  overflow: auto;
}

.assign-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  transition: background 0.12s;
}

.assign-row:hover {
  background: #f8fafc;
}

.assign-row.is-selected {
  background: #eff6ff;
}

.assign-row input {
  margin-top: 0.2rem;
  width: 16px;
  height: 16px;
  accent-color: #2563eb;
}

.assign-row-body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.assign-row-top {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.assign-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  color: #0f172a;
}

.assign-type-tag {
  font-size: 0.68rem;
  font-weight: 700;
  background: #e0e7ff;
  color: #4338ca;
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
}

.assign-pill {
  font-size: 0.65rem;
  font-weight: 700;
  background: #dcfce7;
  color: #15803d;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
}

.assign-name {
  font-size: 0.78rem;
  color: #64748b;
}

.stat-card {
  background: white;
  border: var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-card .stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-card .stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.stat-card .stat-sub {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.stat-card-blue {
  border-left: 3px solid var(--primary);
}

.stat-card-green {
  border-left: 3px solid var(--success);
}

.stat-card-red {
  border-left: 3px solid var(--danger);
}

.stat-card-yellow {
  border-left: 3px solid var(--warning);
}

/* ── Portal Layout (Admin/ATC/DLC) ──────────────────────────── */
.portal-layout {
  display: flex;
  min-height: 100vh;
}

.portal-sidebar {
  width: var(--sidebar-width);
  background: var(--gray-900);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

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

.sidebar-brand-icon {
  width: 46px;
  height: 46px;
  background: #fff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 4px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}

.sidebar-brand-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.sidebar-brand-icon svg {
  width: 18px;
  height: 18px;
  color: white;
}

.sidebar-brand-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: white;
}

.sidebar-brand-role {
  font-size: 0.7rem;
  color: var(--gray-400);
}

.sidebar-nav {
  flex: 1;
  padding: 0.75rem 0;
}

.sidebar-nav-section {
  padding: 0.5rem 1rem 0.25rem;
  font-size: 0.65rem;
  color: var(--gray-500);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 1.25rem;
  color: var(--gray-400);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  border-radius: 0;
  text-decoration: none;
}

.sidebar-link:hover {
  color: white;
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-link.active {
  color: white;
  background: var(--primary);
}

.sidebar-link svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 0.875rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 0.75rem;
}

.sidebar-avatar {
  width: 30px;
  height: 30px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.sidebar-user-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: white;
}

.sidebar-user-role {
  font-size: 0.7rem;
  color: var(--gray-500);
}

/* ── Portal Main ────────────────────────────────────────────── */
.portal-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.portal-topbar {
  height: var(--header-height);
  background: white;
  border-bottom: var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 30;
}

.portal-topbar-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.portal-topbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.portal-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

/* ── Page Header ────────────────────────────────────────────── */
.page-header {
  margin-bottom: 1.5rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.page-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.page-header p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ── Section ────────────────────────────────────────────────── */
.section {
  margin-bottom: 1.5rem;
}

.section-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.875rem;
}

/* ── Alert ──────────────────────────────────────────────────── */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  margin-bottom: 1rem;
  border-width: 1px;
  border-style: solid;
}

.alert svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.alert-error {
  background: var(--danger-bg);
  color: var(--danger-text);
  border-color: #fecaca;
}

.alert-success {
  background: var(--success-bg);
  color: var(--success-text);
  border-color: #bbf7d0;
}

.alert-warning {
  background: var(--warning-bg);
  color: var(--warning-text);
  border-color: #fde68a;
}

.alert-info {
  background: var(--info-bg);
  color: var(--info);
  border-color: #bae6fd;
}

.alert.hidden {
  display: none;
}

/* ── Modal ──────────────────────────────────────────────────── */
#modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.45);
  align-items: center;
  justify-content: center;
}

.modal-card {
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  max-width: 420px;
  width: 90vw;
  padding: 1.5rem;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.exam-config-modal .modal-header {
  margin-bottom: 0;
}

.exam-config-modal {
  max-height: min(92vh, 900px);
}

@media (max-width: 560px) {
  .exam-config-modal [style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
}

.modal-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.modal-icon svg {
  width: 20px;
  height: 20px;
}

.modal-icon.warning {
  background: var(--warning-bg);
  color: var(--warning);
}

.modal-icon.danger {
  background: var(--danger-bg);
  color: var(--danger);
}

.modal-icon.success {
  background: var(--success-bg);
  color: var(--success);
}

.modal-icon.info {
  background: var(--info-bg);
  color: var(--info);
}

.modal-title {
  font-size: 1rem;
  font-weight: 700;
}

.modal-message {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  line-height: 1.6;
}

.modal-actions {
  display: flex;
  gap: 0.625rem;
  justify-content: flex-end;
}

.modal-btn {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
}

.modal-btn-cancel {
  background: white;
  border-color: var(--gray-300);
  color: var(--text-secondary);
}

.modal-btn-cancel:hover {
  background: var(--gray-50);
}

.modal-btn-confirm {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.modal-btn-confirm:hover {
  background: var(--primary-dark);
}

.modal-btn-danger {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}

.modal-btn-danger:hover {
  background: #b91c1c;
}

/* ── Security toast ─────────────────────────────────────────── */
.security-toast {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%) translateY(-80px);
  background: #7c2d12;
  color: #fed7aa;
  border-radius: var(--radius-lg);
  padding: 0.75rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  z-index: 10000;
  box-shadow: var(--shadow-md);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 1px solid #c2410c;
  white-space: nowrap;
}

.security-toast.visible {
  transform: translateX(-50%) translateY(0);
}

/* ── Admin Login (institutional — matches student portal) ───── */
.gap-root {
  --navy: #0f2744;
  --navy-2: #16355c;
  --red: #c41e3a;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f4f6f9;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: 'Source Sans 3', 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--ink);
}

.gap-root * { box-sizing: border-box; }

.gap-header {
  position: relative;
  background: #fff;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  isolation: isolate;
}

.gap-header-pattern {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.55;
  background-color: #f8fafc;
  background-image:
    radial-gradient(circle at 12% 40%, rgba(196, 30, 58, 0.06), transparent 42%),
    radial-gradient(circle at 88% 20%, rgba(15, 39, 68, 0.07), transparent 40%),
    url("data:image/svg+xml,%3Csvg width='120' height='104' viewBox='0 0 120 104' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%2394a3b8' stroke-width='0.9' opacity='0.45'%3E%3Cpath d='M30 2l28 16v32L30 66 2 50V18z'/%3E%3Cpath d='M90 2l28 16v32L90 66 62 50V18z'/%3E%3Cpath d='M60 36l28 16v32L60 100 32 84V52z'/%3E%3Ccircle cx='30' cy='2' r='2.2' fill='%2394a3b8'/%3E%3Ccircle cx='58' cy='18' r='2.2' fill='%2394a3b8'/%3E%3Ccircle cx='90' cy='2' r='2.2' fill='%2394a3b8'/%3E%3Ccircle cx='30' cy='66' r='2.2' fill='%2394a3b8'/%3E%3Ccircle cx='60' cy='36' r='2.2' fill='%2394a3b8'/%3E%3C/g%3E%3C/svg%3E");
  background-size: auto, auto, 120px 104px;
}

.gap-header-inner {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

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

.gap-brand-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
  filter: drop-shadow(0 2px 6px rgba(15, 39, 68, 0.12));
}

.gap-brand-text strong {
  display: block;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.gap-brand-text span {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.gap-header-badge {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  background: rgba(15, 39, 68, 0.06);
  border: 1px solid rgba(15, 39, 68, 0.1);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.gap-header-badge i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.2);
}

.gap-nav {
  background: var(--navy);
  box-shadow: 0 2px 8px rgba(15, 39, 68, 0.18);
}

.gap-nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: stretch;
}

.gap-nav-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.7rem 1.1rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: rgba(255,255,255,0.72);
}

.gap-nav-item svg { width: 15px; height: 15px; }

.gap-nav-item.is-active {
  background: var(--red);
  color: #fff;
}

.gap-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.25rem 3rem;
  position: relative;
}

.gap-main::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 500px 280px at 50% 0%, rgba(15, 39, 68, 0.05), transparent 70%);
  pointer-events: none;
}

.gap-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 980px;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 1.75rem;
  align-items: stretch;
}

.gap-aside {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.75rem 1.6rem;
  box-shadow: 0 10px 30px rgba(15, 39, 68, 0.05);
  display: flex;
  flex-direction: column;
  justify-content: center;
  animation: gapIn 0.45s ease both;
}

.gap-aside-kicker {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 0.55rem;
}

.gap-aside h1 {
  font-size: clamp(1.55rem, 2.4vw, 2rem);
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

.gap-aside p {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 1.35rem;
}

.gap-points {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin: 0;
  padding: 0;
}

.gap-points li {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: #334155;
  line-height: 1.4;
}

.gap-points li::before {
  content: '';
  width: 8px;
  height: 8px;
  margin-top: 0.4rem;
  border-radius: 50%;
  background: var(--red);
  flex-shrink: 0;
  box-shadow: 0 0 0 4px rgba(196, 30, 58, 0.12);
}

.gap-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.85rem 1.7rem 1.6rem;
  box-shadow: 0 16px 40px rgba(15, 39, 68, 0.08);
  animation: gapIn 0.5s ease 0.05s both;
}

@keyframes gapIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.gap-card-head {
  margin-bottom: 1.35rem;
  padding-bottom: 1rem;
  border-bottom: 1px dashed var(--line);
}

.gap-card-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.gap-card-title em {
  font-style: normal;
  color: var(--red);
}

.gap-card-sub {
  margin-top: 0.35rem;
  font-size: 0.88rem;
  color: var(--muted);
  font-weight: 500;
}

.gap-error {
  display: none;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.8rem 0.9rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 10px;
  margin-bottom: 1.1rem;
}

.gap-error:not(.hidden) {
  display: flex;
}

.gap-error-icon { flex-shrink: 0; }
.gap-error-text {
  color: #b91c1c;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.45;
}

.gap-field { margin-bottom: 1.05rem; }

.gap-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 0.4rem;
}

.gap-input-wrap { position: relative; }

.gap-input-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  color: #94a3b8;
  pointer-events: none;
}

.gap-input {
  width: 100%;
  padding: 0.78rem 1rem 0.78rem 2.6rem;
  background: #f8fafc;
  border: 1.5px solid #dbe3ee;
  border-radius: 10px;
  color: var(--ink);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color .18s, box-shadow .18s, background .18s;
}

.gap-input-pw { padding-right: 2.75rem; }

.gap-input:focus {
  background: #fff;
  border-color: #94a3b8;
  box-shadow: 0 0 0 3px rgba(15, 39, 68, 0.08);
}

.gap-pw-toggle {
  position: absolute;
  right: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  padding: 0.35rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
}

.gap-pw-toggle:hover { color: var(--navy); background: #f1f5f9; }

.gap-btn {
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.85rem 1rem;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--red) 0%, #9f1830 100%);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(196, 30, 58, 0.28);
  transition: transform .15s, box-shadow .15s, filter .15s;
}

.gap-btn:hover:not(:disabled) {
  filter: brightness(1.05);
  box-shadow: 0 10px 24px rgba(196, 30, 58, 0.34);
}

.gap-btn:active:not(:disabled) { transform: translateY(1px); }
.gap-btn:disabled { opacity: 0.65; cursor: not-allowed; }

.gap-help {
  margin-top: 1rem;
  font-size: 0.78rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.45;
}

.gap-student-link {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
}

.gap-student-link a {
  color: var(--red);
  text-decoration: none;
  font-weight: 800;
}

.gap-student-link a:hover { text-decoration: underline; }

.gap-footer {
  background: var(--navy);
  color: rgba(226, 232, 240, 0.85);
  padding: 0.9rem 1.5rem 1.05rem;
}

.gap-footer-top {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.8rem;
  font-weight: 600;
}

.gap-footer .accent { color: #fca5a5; }

.gap-footer-note {
  max-width: 1120px;
  margin: 0.45rem auto 0;
  font-size: 0.72rem;
  color: rgba(226, 232, 240, 0.45);
  font-weight: 500;
}

@media (max-width: 860px) {
  .gap-shell { grid-template-columns: 1fr; max-width: 440px; }
  .gap-aside { display: none; }
  .gap-header-badge { display: none; }
  .gap-brand-text strong { font-size: 0.95rem; }
}

@media (max-width: 480px) {
  .gap-header-inner { padding: 0.9rem 1rem; }
  .gap-brand-logo { width: 58px; height: 58px; }
  .gap-card { padding: 1.35rem 1.15rem 1.25rem; }
  .gap-footer-top { justify-content: center; text-align: center; }
}

/* ── Exam Portal (Student) ──────────────────────────────────── */
.exam-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--gray-50);
}

.exam-header {
  background: white;
  border-bottom: var(--border);
  padding: 0.75rem 1.25rem;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: var(--shadow-sm);
}

.exam-header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.exam-header-left h2 {
  font-size: 1rem;
  font-weight: 700;
}

.exam-header-left p {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 1px;
}

.exam-timer {
  font-size: 1.5rem;
  font-weight: 800;
  padding: 0.4rem 1rem;
  border-radius: var(--radius-md);
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid #bbf7d0;
  font-variant-numeric: tabular-nums;
  min-width: 100px;
  text-align: center;
  transition: var(--transition);
}

.exam-timer.warning {
  background: var(--warning-bg);
  color: var(--warning);
  border-color: #fde68a;
}

.exam-timer.danger {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: #fecaca;
}

@keyframes timerPulse {

  0%,
  100% {
    opacity: 1
  }

  50% {
    opacity: 0.7
  }
}

.timer-pulse {
  animation: timerPulse 1s ease-in-out infinite;
}

.exam-body {
  flex: 1;
  display: flex;
  max-height: calc(100vh - 60px);
  overflow: hidden;
}

.exam-question-area {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

.exam-question-area::-webkit-scrollbar {
  width: 5px;
}

.exam-question-area::-webkit-scrollbar-thumb {
  background: var(--gray-200);
  border-radius: 3px;
}

.question-card {
  max-width: 740px;
  margin: 0 auto;
  background: white;
  border: var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
}

.question-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: var(--border);
}

.question-number {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.question-marks {
  font-size: 0.78rem;
  color: var(--success);
  font-weight: 600;
  background: var(--success-bg);
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
}

.question-text {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-primary);
  font-weight: 500;
  margin-bottom: 1.5rem;
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.option-item {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.875rem 1rem;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  background: white;
}

.option-item:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.option-item.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}

.option-letter {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--gray-100);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
  transition: var(--transition);
}

.option-item.selected .option-letter {
  background: var(--primary);
  color: white;
}

.option-text {
  flex: 1;
  font-size: 0.925rem;
  color: var(--text-primary);
}

.exam-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: var(--border);
}

/* Palette */
.exam-palette {
  width: 280px;
  flex-shrink: 0;
  background: white;
  border-left: var(--border);
  display: flex;
  flex-direction: column;
}

.palette-header {
  padding: 1rem 1.25rem;
  border-bottom: var(--border);
}

.palette-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.palette-stats {
  display: flex;
  gap: 0.625rem;
  margin-top: 0.625rem;
}

.palette-stat {
  flex: 1;
  text-align: center;
  padding: 0.4rem;
  border-radius: var(--radius-md);
  font-size: 0.72rem;
  font-weight: 600;
}

.palette-stat .num {
  font-size: 1rem;
  font-weight: 800;
  display: block;
}

.palette-stat.answered {
  background: var(--success-bg);
  color: var(--success-text);
}

.palette-stat.marked {
  background: var(--warning-bg);
  color: var(--warning-text);
}

.palette-stat.pending {
  background: var(--gray-100);
  color: var(--gray-600);
}

.palette-grid {
  flex: 1;
  overflow-y: auto;
  padding: 0.875rem;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.4rem;
  align-content: start;
}

.palette-btn {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  background: var(--gray-100);
  color: var(--text-secondary);
  border: 1.5px solid transparent;
}

.palette-btn:hover {
  transform: scale(1.08);
}

.palette-btn.current {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.palette-btn.answered {
  background: var(--success);
  color: white;
}

.palette-btn.marked {
  background: var(--warning);
  color: white;
}

.palette-legend {
  padding: 0.875rem 1.25rem;
  border-top: var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

.palette-submit {
  margin: 0.75rem;
  padding: 0.75rem;
  background: var(--danger);
  color: white;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.875rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: none;
}

.palette-submit:hover {
  background: #b91c1c;
}

/* ── Result Screen ──────────────────────────────────────────── */
.result-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #f3f5f8;
  font-family: 'Source Sans 3', var(--font), sans-serif;
}

.result-header {
  position: relative;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  overflow: hidden;
  isolation: isolate;
  flex-shrink: 0;
}

.result-header-pattern {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.55;
  background-color: #f8fafc;
  background-image:
    radial-gradient(circle at 12% 40%, rgba(196, 30, 58, 0.06), transparent 42%),
    radial-gradient(circle at 88% 20%, rgba(15, 39, 68, 0.07), transparent 40%),
    url("data:image/svg+xml,%3Csvg width='120' height='104' viewBox='0 0 120 104' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%2394a3b8' stroke-width='0.9' opacity='0.45'%3E%3Cpath d='M30 2l28 16v32L30 66 2 50V18z'/%3E%3Cpath d='M90 2l28 16v32L90 66 62 50V18z'/%3E%3Cpath d='M60 36l28 16v32L60 100 32 84V52z'/%3E%3Ccircle cx='30' cy='2' r='2.2' fill='%2394a3b8'/%3E%3Ccircle cx='58' cy='18' r='2.2' fill='%2394a3b8'/%3E%3Ccircle cx='90' cy='2' r='2.2' fill='%2394a3b8'/%3E%3C/g%3E%3C/svg%3E");
  background-size: auto, auto, 120px 104px;
}

.result-header-inner {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
  padding: 0.55rem 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.result-brand {
  text-align: center;
  min-width: 0;
}

.result-brand-name {
  font-size: 0.9rem;
  font-weight: 800;
  color: #0f2744;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.result-brand-sub {
  font-size: 0.68rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.08rem;
}

.result-main {
  flex: 1;
  padding: 1rem 1rem 1.5rem;
  overflow-y: auto;
}

.result-page-inner {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
}

.result-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(15, 39, 68, 0.06);
}

.result-card-accent {
  height: 4px;
  width: 100%;
}

.result-card-accent.pass {
  background: linear-gradient(90deg, #16a34a, #22c55e);
}

.result-card-accent.fail {
  background: linear-gradient(90deg, #c41e3a, #9f1830);
}

.result-card-body {
  padding: 1.35rem 1.25rem 1.25rem;
}

@media (min-width: 560px) {
  .result-card-body {
    padding: 1.5rem 1.5rem 1.35rem;
  }
}

.result-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  text-align: left;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.result-hero-text {
  flex: 1;
  min-width: 180px;
}

.result-notice {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  text-align: left;
  margin: 0 0 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
}

.result-notice-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #c41e3a;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.9rem;
  font-weight: 800;
}

.result-notice-title {
  font-weight: 800;
  font-size: 0.86rem;
  margin-bottom: 0.15rem;
}

.result-notice-text {
  font-size: 0.78rem;
  line-height: 1.45;
  opacity: 0.92;
}

.result-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.55rem;
}

.result-status-pill.pass {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.result-status-pill.fail {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.result-title {
  font-size: clamp(1.35rem, 4vw, 1.65rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 0.3rem;
  color: #0f2744;
  line-height: 1.2;
}

.result-title.pass { color: #15803d; }
.result-title.fail { color: #c41e3a; }

.result-subtitle {
  color: #64748b;
  font-size: 0.86rem;
  font-weight: 500;
  margin: 0;
  line-height: 1.4;
}

.result-score-wrap {
  position: relative;
  width: 130px;
  height: 130px;
  flex-shrink: 0;
}

.result-score-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.result-score-ring circle {
  fill: none;
  stroke-width: 8;
}

.result-score-ring .track {
  stroke: #e2e8f0;
}

.result-score-ring .progress.pass {
  stroke: #16a34a;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s ease;
}

.result-score-ring .progress.fail {
  stroke: #c41e3a;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s ease;
}

.result-score-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.result-score-value {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}

.result-score-value.pass { color: #16a34a; }
.result-score-value.fail { color: #c41e3a; }

.result-score-label {
  margin-top: 0.25rem;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #94a3b8;
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.55rem;
  margin-bottom: 0.25rem;
}

@media (max-width: 520px) {
  .result-stats { grid-template-columns: 1fr 1fr; }
  .result-hero { justify-content: center; text-align: center; }
  .result-hero-text { min-width: 0; }
}

.result-stat {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.7rem 0.65rem;
  text-align: center;
}

.result-stat-label {
  font-size: 0.62rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}

.result-stat-value {
  font-size: 1.15rem;
  font-weight: 800;
  margin-top: 0.2rem;
  color: #0f2744;
  letter-spacing: -0.02em;
}

.result-stat-value.pass { color: #16a34a; }
.result-stat-value.fail { color: #c41e3a; }

.result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  margin-top: 0.65rem;
  font-size: 0.72rem;
  color: #94a3b8;
  font-weight: 600;
}

.result-review {
  text-align: left;
  margin-top: 1.25rem;
  padding-top: 1.15rem;
  border-top: 1px solid #e8edf3;
}

.result-review-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  padding: 0.45rem 0.65rem;
  background: #0f2744;
  border-radius: 8px;
}

.result-review-title {
  font-weight: 800;
  font-size: 0.72rem;
  color: #fff;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.result-review-count {
  font-size: 0.68rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.12);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}

.result-review-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 0.15rem;
}

.result-answer {
  border-radius: 10px;
  padding: 0.75rem 0.85rem;
  border: 1px solid;
}

.result-answer.correct {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.result-answer.wrong {
  background: #fff;
  border-color: #fecaca;
  border-left: 3px solid #c41e3a;
}

.result-answer-top {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin-bottom: 0.55rem;
}

.result-answer-num {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: #0f2744;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.result-answer-q {
  flex: 1;
  font-size: 0.86rem;
  font-weight: 650;
  color: #0f2744;
  line-height: 1.45;
  min-width: 0;
}

.result-answer-badge {
  font-size: 0.62rem;
  font-weight: 800;
  padding: 0.18rem 0.45rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

.result-answer.correct .result-answer-badge {
  background: #dcfce7;
  color: #15803d;
}

.result-answer.wrong .result-answer-badge {
  background: #fee2e2;
  color: #b91c1c;
}

.result-answer-rows {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding-left: 1.75rem;
}

.result-answer-row {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.result-answer-row em {
  font-style: normal;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94a3b8;
}

.result-answer-row strong {
  font-size: 0.84rem;
  font-weight: 650;
  color: #334155;
  line-height: 1.4;
}

.result-answer-row strong.ok { color: #15803d; }
.result-answer-row strong.bad { color: #c41e3a; }

.result-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  font-size: 0.65rem;
  font-weight: 800;
  margin-right: 0.35rem;
  vertical-align: middle;
}

.result-answer-row strong.ok .result-letter {
  background: #dcfce7;
  border-color: #86efac;
  color: #15803d;
}

.result-answer-row strong.bad .result-letter {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}

.result-challenge-btn {
  margin-top: 0.55rem;
  margin-left: 1.75rem;
  background: transparent;
  border: 1px solid #cbd5e1;
  color: #475569;
  padding: 0.35rem 0.7rem;
  border-radius: 7px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, color 0.15s;
}

.result-challenge-btn:hover {
  border-color: #c41e3a;
  color: #c41e3a;
}

.result-actions {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid #e8edf3;
  text-align: center;
}

.result-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: linear-gradient(135deg, #0f2744, #16355c);
  color: #fff;
  border: none;
  padding: 0.7rem 1.5rem;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 4px 14px rgba(15, 39, 68, 0.2);
  transition: transform 0.15s, box-shadow 0.15s;
}

.result-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(15, 39, 68, 0.25);
}

.result-btn-primary:active {
  transform: translateY(0);
}

.result-footer {
  background: #1a1f2a;
  color: #e2e8f0;
  flex-shrink: 0;
}

.result-footer-top {
  max-width: 760px;
  margin: 0 auto;
  padding: 0.45rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.result-footer-top .accent { color: #f87171; }

.result-footer-bot {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.3rem 1rem 0.4rem;
  text-align: center;
  font-size: 0.62rem;
  color: rgba(226, 232, 240, 0.5);
  font-weight: 500;
}

.result-challenge-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 39, 68, 0.45);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.result-challenge-dialog {
  background: #fff;
  border-radius: 14px;
  padding: 1.35rem 1.25rem;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 20px 50px rgba(15, 39, 68, 0.2);
}

.result-challenge-dialog h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f2744;
}

.result-challenge-q {
  font-size: 0.8rem;
  color: #64748b;
  margin: 0 0 1rem;
  line-height: 1.45;
}

.result-challenge-dialog label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: #475569;
  margin-bottom: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.result-challenge-dialog select,
.result-challenge-dialog textarea {
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
  font-size: 0.86rem;
  font-family: inherit;
  margin-bottom: 0.85rem;
}

.result-challenge-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.result-challenge-actions button {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  font-family: inherit;
}

.result-challenge-cancel {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #475569;
}

.result-challenge-submit {
  background: #c41e3a;
  border: none;
  color: #fff;
}

/* ── Pre-exam gate ──────────────────────────────────────────── */
.peg-page {
  min-height: 100vh;
  padding: 0 0 2rem;
  background:
    radial-gradient(ellipse 70% 45% at 50% -10%, rgba(29, 78, 216, 0.14), transparent),
    linear-gradient(180deg, #0f2744 0%, #16355c 32%, #f1f5f9 32%);
  font-family: var(--font);
}

.peg-shell {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 1rem;
}

.peg-top {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 -1rem 1.15rem;
  padding: 0.85rem 1.15rem;
  overflow: hidden;
  isolation: isolate;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(15, 39, 68, 0.55);
}

.peg-top-pattern {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.55;
  background-image:
    radial-gradient(circle at 12% 40%, rgba(196, 30, 58, 0.12), transparent 42%),
    radial-gradient(circle at 88% 20%, rgba(255, 255, 255, 0.08), transparent 40%),
    url("data:image/svg+xml,%3Csvg width='120' height='104' viewBox='0 0 120 104' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23cbd5e1' stroke-width='0.9' opacity='0.55'%3E%3Cpath d='M30 2l28 16v32L30 66 2 50V18z'/%3E%3Cpath d='M90 2l28 16v32L90 66 62 50V18z'/%3E%3Cpath d='M60 36l28 16v32L60 100 32 84V52z'/%3E%3Ccircle cx='30' cy='2' r='2.2' fill='%23cbd5e1'/%3E%3Ccircle cx='58' cy='18' r='2.2' fill='%23cbd5e1'/%3E%3Ccircle cx='90' cy='2' r='2.2' fill='%23cbd5e1'/%3E%3Ccircle cx='30' cy='66' r='2.2' fill='%23cbd5e1'/%3E%3Ccircle cx='60' cy='36' r='2.2' fill='%23cbd5e1'/%3E%3C/g%3E%3C/svg%3E");
  background-size: auto, auto, 120px 104px;
}

.peg-brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #fff;
  min-width: 0;
}

.peg-brand img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.25));
}

.peg-brand-name {
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}

.peg-brand-sub {
  font-size: 0.7rem;
  color: #94a3b8;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 0.1rem;
}

.peg-cancel {
  position: relative;
  z-index: 1;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #e2e8f0;
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  font-weight: 650;
  font-size: 0.8rem;
  cursor: pointer;
  flex-shrink: 0;
}

.peg-cancel:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.35);
  color: #fecaca;
}

.peg-exam-bar {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 0.9rem 1.1rem;
  margin-bottom: 1.15rem;
  color: #fff;
}

.peg-exam-title {
  font-weight: 750;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.peg-exam-meta {
  margin-top: 0.25rem;
  font-size: 0.78rem;
  color: #cbd5e1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.peg-pill {
  display: inline-flex;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.peg-pill-red {
  background: #fef2f2;
  color: #b91c1c;
}

.peg-pill-green {
  background: #f0fdf4;
  color: #15803d;
}

.peg-steps {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 1rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.peg-step {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 650;
}

.peg-step.is-active { color: #1d4ed8; }
.peg-step.is-done { color: #15803d; }

.peg-step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  background: #e2e8f0;
  color: #475569;
}

.peg-step.is-active .peg-step-num {
  background: #1d4ed8;
  color: #fff;
}

.peg-step.is-done .peg-step-num {
  background: #16a34a;
  color: #fff;
}

.peg-step-line {
  flex: 1;
  min-width: 16px;
  height: 2px;
  background: #cbd5e1;
  border-radius: 2px;
}

.peg-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 1.35rem 1.35rem 1.2rem;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

.peg-h2 {
  margin: 0 0 0.35rem;
  font-size: 1.2rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.peg-lead {
  margin: 0 0 1.15rem;
  color: #64748b;
  font-size: 0.88rem;
  line-height: 1.45;
}

.peg-identity {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1.15rem;
  margin-bottom: 1.1rem;
}

@media (max-width: 640px) {
  .peg-identity {
    grid-template-columns: 1fr;
  }
}

.peg-photo-col {
  text-align: center;
}

.peg-avatar {
  width: 140px;
  height: 140px;
  margin: 0 auto;
  border-radius: 18px;
  background: linear-gradient(135deg, #1d4ed8, #3730a3);
  color: #fff;
  font-size: 3rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.peg-camera-wrap {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid #e2e8f0;
  background: #0f172a;
  aspect-ratio: 4 / 3;
}

.peg-camera-wrap.is-captured {
  border-color: #16a34a;
}

.peg-camera,
.peg-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.peg-camera {
  transform: scaleX(-1);
}

.peg-camera-tag {
  position: absolute;
  left: 0.5rem;
  top: 0.5rem;
  background: rgba(15, 23, 42, 0.85);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 750;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
}

.peg-camera-tag-ok {
  background: rgba(22, 163, 74, 0.95);
}

.peg-photo-actions {
  margin-top: 0.65rem;
  display: flex;
  justify-content: center;
}

.peg-btn-sm {
  padding: 0.5rem 0.9rem !important;
  font-size: 0.8rem !important;
  border-radius: 8px !important;
  margin-left: 0 !important;
  box-shadow: none !important;
}

.peg-hint {
  margin: 0.55rem 0 0;
  font-size: 0.72rem;
  color: #94a3b8;
  line-height: 1.35;
}

.peg-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.peg-info {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  text-align: left;
}

.peg-info span {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94a3b8;
}

.peg-info strong {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.9rem;
  color: #0f172a;
  font-weight: 750;
}

.peg-check {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.85rem 0.95rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  cursor: pointer;
  font-size: 0.84rem;
  color: #334155;
  line-height: 1.4;
  text-align: left;
}

.peg-check input {
  margin-top: 0.15rem;
  width: 16px;
  height: 16px;
  accent-color: #1d4ed8;
  flex-shrink: 0;
}

.peg-rules {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin: 0 0 1rem;
}

.peg-rules li {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  text-align: left;
}

.peg-rules strong {
  display: block;
  font-size: 0.84rem;
  color: #0f172a;
  margin-bottom: 0.15rem;
}

.peg-rules span {
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.4;
}

.peg-terms {
  text-align: left;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
  max-height: 280px;
  overflow: auto;
}

.peg-terms ol {
  margin: 0;
  padding-left: 1.15rem;
  color: #334155;
  font-size: 0.84rem;
  line-height: 1.55;
}

.peg-terms li { margin-bottom: 0.45rem; }

.peg-instructions {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid #e2e8f0;
}

.peg-instructions-label {
  font-size: 0.72rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  margin-bottom: 0.35rem;
}

.peg-instructions-body {
  font-size: 0.84rem;
  color: #0f172a;
  line-height: 1.5;
}

.peg-ready-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.peg-ready-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.8rem;
  text-align: left;
}

.peg-ready-item span {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94a3b8;
}

.peg-ready-item strong {
  display: block;
  margin-top: 0.2rem;
  font-size: 1.05rem;
  color: #0f172a;
}

.peg-checklist {
  margin: 0 0 1rem;
  padding-left: 1.15rem;
  text-align: left;
  color: #475569;
  font-size: 0.84rem;
  line-height: 1.55;
}

.peg-alert {
  text-align: left;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  font-size: 0.8rem;
  line-height: 1.45;
}

.peg-alert-blue {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e40af;
}

.peg-footer {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1rem;
}

.peg-btn {
  border: none;
  border-radius: 10px;
  padding: 0.75rem 1.15rem;
  font-weight: 750;
  font-size: 0.9rem;
  cursor: pointer;
}

.peg-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.peg-btn-ghost {
  background: #fff;
  border: 1px solid #e2e8f0;
  color: #475569;
}

.peg-btn-primary {
  background: #1d4ed8;
  color: #fff;
  box-shadow: 0 6px 16px rgba(29, 78, 216, 0.25);
  margin-left: auto;
}

.peg-btn-primary:hover:not(:disabled) {
  background: #1e40af;
}

.peg-footnote {
  margin: 0.65rem 0 0;
  color: #b91c1c;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
}

/* ── Exam Selection Screen ──────────────────────────────────── */
.selection-page {
  min-height: 100vh;
  background: var(--gray-50);
  padding: 2rem;
}

.selection-inner {
  max-width: 860px;
  margin: 0 auto;
}

.selection-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: var(--border);
}

.selection-topbar h2 {
  font-size: 1.1rem;
  font-weight: 700;
}

.exam-select-card {
  background: white;
  border: var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  cursor: pointer;
  transition: var(--transition);
}

.exam-select-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.exam-select-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.875rem;
}

.exam-select-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.exam-select-subject {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.exam-select-metas {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.exam-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  background: var(--gray-100);
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
}

.exam-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

/* ── Live Session indicator ─────────────────────────────────── */
.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  margin-right: 4px;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {

  0%,
  100% {
    opacity: 1
  }

  50% {
    opacity: 0.4
  }
}

/* ── Divider ────────────────────────────────────────────────── */
.divider {
  border: none;
  border-top: var(--border);
  margin: 1.25rem 0;
}

/* ── Empty state ─────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  background: white;
  border: 1px dashed var(--gray-300);
  border-radius: var(--radius-lg);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  color: var(--gray-300);
  margin: 0 auto 1rem;
}

.empty-state h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.375rem;
}

.empty-state p {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .portal-sidebar {
    display: none;
  }

  .exam-body {
    flex-direction: column;
    max-height: none;
  }

  .exam-palette {
    width: 100%;
    border-left: none;
    border-top: var(--border);
    max-height: 240px;
  }

  .portal-content {
    padding: 1rem;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ================================================================
   Student Dashboard — Light / Solid Theme
================================================================ */
.dashboard-wrapper {
  min-height: 100vh;
  background: #f8fafc;
  font-family: 'Inter', sans-serif;
}

.dash-header {
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.dash-header-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.dash-logo {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.dash-avatar {
  width: 44px;
  height: 44px;
  background: #1d4ed8;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 800;
  color: white;
  flex-shrink: 0;
}

.dash-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.dash-subtitle {
  font-size: 0.8rem;
  color: #64748b;
  margin: 0.1rem 0 0;
}

.dash-user-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.dash-info-pill {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #475569;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 500;
}

.dash-logout-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  padding: 0.4rem 0.875rem;
  border-radius: 0.625rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.dash-logout-btn:hover {
  background: #fee2e2;
}

.dash-refresh-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  padding: 0.4rem 0.875rem;
  border-radius: 0.625rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.dash-refresh-btn:hover {
  background: #dbeafe;
  border-color: #93c5fd;
}

.dash-refresh-btn.animate-spin-once svg {
  animation: dash-spin 0.6s ease-out;
}

@keyframes dash-spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.dash-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.dash-section {
  margin-bottom: 2.5rem;
}

.dash-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.dash-section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.125rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.dash-badge {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

/* Exam Grid */
.exam-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.exam-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 0.875rem;
  padding: 1.5rem;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
  cursor: default;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.exam-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 4px 16px rgba(29, 78, 216, 0.1);
  transform: translateY(-2px);
}

.exam-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.exam-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-demo {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.badge-main {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}

.exam-card-icon {
  font-size: 1.5rem;
}

.exam-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 0.25rem;
  line-height: 1.3;
}

.exam-card-subject {
  font-size: 0.82rem;
  color: #64748b;
  margin: 0 0 1rem;
}

.exam-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.exam-meta-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  color: #64748b;
}

.start-exam-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: #1d4ed8;
  color: white;
  border: none;
  border-radius: 0.625rem;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.start-exam-btn:hover {
  background: #1e3a8a;
}

.exam-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1rem;
  border-radius: 0.875rem;
  color: #64748b;
}

@keyframes shimmer {
  0% {
    opacity: 0.6;
  }

  50% {
    opacity: 1;
  }

  100% {
    opacity: 0.6;
  }
}

/* ── Toasts ─────────────────────────────────────────────────── */
.portal-toast {
  position: fixed;
  right: 24px;
  background: white;
  padding: 12px 18px;
  border-radius: var(--radius-xl);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
  border-left: 4px solid var(--primary);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 10000;
  transform: translateX(120%);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: 320px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
}

.portal-toast.visible {
  transform: translateX(0);
}

.portal-toast svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.toast-success {
  border-left-color: var(--success);
}

.toast-success svg {
  color: var(--success);
}

.toast-error {
  border-left-color: var(--danger);
}

.toast-error svg {
  color: var(--danger);
}

.toast-warning {
  border-left-color: var(--warning);
}

.toast-warning svg {
  color: var(--warning);
}

.toast-info {
  border-left-color: var(--info);
}

.toast-info svg {
  color: var(--info);
}

/* ── Exam History Result Modal Animations ───────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* -- Proctor Cameras (live monitor) --------------------------- */
.proctor-cams-note {
  font-size: 0.78rem;
  color: #64748b;
  margin: 0 0 0.85rem;
  line-height: 1.45;
}

.proctor-cams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.85rem;
}

.proctor-cam-card {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  display: flex;
  flex-direction: column;
}

.proctor-cam-photo-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #0f172a;
}

.proctor-cam-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.proctor-cam-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 800;
  color: #94a3b8;
  background: #1e293b;
}

.proctor-cam-live-tag {
  position: absolute;
  top: 0.45rem;
  left: 0.45rem;
  background: #dc2626;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 750;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
}

.proctor-cam-meta {
  padding: 0.65rem 0.75rem 0.35rem;
}

.proctor-cam-name {
  font-weight: 750;
  font-size: 0.88rem;
  color: #0f172a;
}

.proctor-cam-sub {
  font-size: 0.72rem;
  color: #64748b;
  margin-top: 0.15rem;
}

.proctor-cam-actions {
  padding: 0.5rem 0.75rem 0.75rem;
}

.proctor-live-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(15, 23, 42, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.proctor-live-dialog {
  background: #fff;
  border-radius: 16px;
  width: min(640px, 100%);
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
}

.proctor-live-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid #e2e8f0;
}

.proctor-live-title {
  font-weight: 750;
  font-size: 1rem;
}

.proctor-live-sub {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 0.1rem;
}

.proctor-live-video {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #0f172a;
  object-fit: cover;
  display: block;
  transform: scaleX(-1);
}

.proctor-live-status {
  padding: 0.65rem 1rem 0.9rem;
  font-size: 0.8rem;
  color: #475569;
  font-weight: 600;
}
