/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #f0f2f5;
  color: #1a1a2e;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: #1a237e; text-decoration: none; transition: color .15s; }
a:hover { text-decoration: underline; }

/* ── Sidebar Navigation ──────────────────────────────────── */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: 240px; background: #0d1b3e;
  display: flex; flex-direction: column;
  z-index: 100; overflow-y: auto;
  transition: transform .3s ease;
}
.sidebar-brand {
  padding: 20px 20px 16px;
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-brand:hover { text-decoration: none; }
.sidebar-brand-icon {
  width: 36px; height: 36px; flex-shrink: 0;
  background: linear-gradient(135deg, #1a237e, #3949ab);
  border-radius: 10px; display: flex; align-items: center;
  justify-content: center; color: #fff; font-weight: 800;
  font-size: 18px; box-shadow: 0 2px 8px rgba(26,35,126,.4);
}
.sidebar-brand-text {
  color: #fff; font-size: 14px; font-weight: 700;
  line-height: 1.3; letter-spacing: .2px;
}
.sidebar-nav { flex: 1; padding: 12px 0; }
.sidebar-section-label {
  padding: 16px 20px 6px;
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1.2px; color: rgba(255,255,255,.35);
}
.sidebar-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px; margin: 2px 8px; border-radius: 8px;
  color: rgba(255,255,255,.65); font-size: 14px; font-weight: 500;
  text-decoration: none; transition: all .15s;
}
.sidebar-link:hover {
  color: #fff; background: rgba(255,255,255,.08); text-decoration: none;
}
.sidebar-link.active {
  color: #fff; background: rgba(255,255,255,.12);
  font-weight: 600;
}
.sidebar-link svg {
  width: 20px; height: 20px; flex-shrink: 0;
  opacity: .7; transition: opacity .15s;
}
.sidebar-link:hover svg, .sidebar-link.active svg { opacity: 1; }
.sidebar-user {
  padding: 16px 20px; border-top: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; gap: 12px;
}
.sidebar-user-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: rgba(255,255,255,.15); display: flex;
  align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 13px;
  border: 1.5px solid rgba(255,255,255,.25);
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name {
  color: #fff; font-size: 13px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-user-role {
  color: rgba(255,255,255,.45); font-size: 11px;
  text-transform: capitalize;
}
.sidebar-logout {
  background: none; border: none; color: rgba(255,255,255,.4);
  cursor: pointer; padding: 6px; border-radius: 4px;
  display: flex; align-items: center; transition: all .15s;
}
.sidebar-logout:hover { color: #ef5350; background: rgba(255,255,255,.06); }
.sidebar-logout svg { width: 18px; height: 18px; }

/* ── Top Bar ─────────────────────────────────────────────── */
.topbar {
  position: fixed; top: 0; left: 240px; right: 0;
  height: 56px; background: #fff; z-index: 90;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; border-bottom: 1px solid #e8e8e8;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar-hamburger {
  display: none; background: none; border: none;
  font-size: 22px; cursor: pointer; padding: 4px 8px;
  border-radius: 4px; color: #333;
}
.topbar-hamburger:hover { background: #f0f2f5; }
.topbar-title { font-size: 16px; font-weight: 600; color: #1a1a2e; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-actions { display: flex; gap: 8px; }

/* ── App Layout ──────────────────────────────────────────── */
.app-layout { display: flex; min-height: 100vh; }
.app-main {
  margin-left: 240px; flex: 1; padding-top: 56px; min-height: 100vh;
}

/* ── Mobile sidebar overlay ──────────────────────────────── */
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.5); z-index: 99;
}
.sidebar-overlay.active { display: block; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-block; padding: 10px 24px; border: none; border-radius: 8px;
  font-size: 14px; font-weight: 600; cursor: pointer; transition: all .2s;
  text-decoration: none; text-align: center;
}
.btn:hover { text-decoration: none; }
.btn-primary {
  background: linear-gradient(135deg, #1a237e, #283593);
  color: #fff; box-shadow: 0 4px 14px rgba(26,35,126,.3);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #283593, #3949ab);
  box-shadow: 0 6px 20px rgba(26,35,126,.4);
  transform: translateY(-1px);
}
.btn-secondary { background: #e8eaf6; color: #1a237e; border: 1px solid #c5cae9; }
.btn-secondary:hover { background: #c5cae9; }
.btn-danger { background: #c62828; color: #fff; }
.btn-danger:hover { background: #b71c1c; }
.btn-success { background: #2e7d32; color: #fff; }
.btn-success:hover { background: #1b5e20; }
.btn-sm { padding: 7px 16px; font-size: 13px; }
.btn-block { display: block; width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: #fff; border-radius: 12px;
  box-shadow: 0 1px 8px rgba(0,0,0,.06);
  padding: 24px; transition: box-shadow .2s;
}
.card:hover { box-shadow: 0 4px 20px rgba(0,0,0,.1); }

/* ── Stat Cards ───────────────────────────────────────────── */
.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px; margin-bottom: 28px;
}
.stat-card {
  background: #fff; padding: 20px; border-radius: 12px;
  box-shadow: 0 1px 8px rgba(0,0,0,.06);
  border-left: 4px solid #1a237e;
  transition: transform .15s, box-shadow .15s;
  position: relative;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,.1); }
.stat-card .stat-icon {
  position: absolute; top: 16px; right: 16px;
  width: 36px; height: 36px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; opacity: .15;
}
.stat-card .stat-value {
  font-size: 28px; font-weight: 700; color: #1a237e; line-height: 1.2;
  white-space: nowrap; min-height: 34px; display: flex; align-items: center;
}
.stat-card .stat-value.stat-empty {
  font-size: 15px; color: #999 !important; font-weight: 600;
}
.stat-card .stat-label {
  font-size: 12px; color: #888; margin-top: 4px;
  text-transform: uppercase; letter-spacing: .5px;
}
.stat-card.accent-blue { border-left-color: #1565c0; }
.stat-card.accent-blue .stat-value { color: #1565c0; }
.stat-card.accent-green { border-left-color: #2e7d32; }
.stat-card.accent-green .stat-value { color: #2e7d32; }
.stat-card.accent-orange { border-left-color: #e65100; }
.stat-card.accent-orange .stat-value { color: #e65100; }
.stat-card.accent-purple { border-left-color: #6a1b9a; }
.stat-card.accent-purple .stat-value { color: #6a1b9a; }
.stat-trend {
  font-size: 11px; margin-top: 4px; font-weight: 600;
}
.trend-up { color: #2e7d32; }
.trend-down { color: #c62828; }
.trend-flat { color: #888; }
.trend-up-sm { color: #2e7d32; font-size: 9px; }
.trend-down-sm { color: #c62828; font-size: 9px; }

/* ── Mini Chart ──────────────────────────────────────────── */
.mini-chart-container {
  margin-bottom: 16px; padding: 12px 0;
}
.mini-chart-legend {
  display: flex; gap: 16px; margin-bottom: 8px; font-size: 11px; color: #666;
}
.mini-chart-legend-item {
  display: flex; align-items: center; gap: 4px;
}
.mini-chart-dot {
  width: 8px; height: 8px; border-radius: 2px; display: inline-block;
}
.mini-chart {
  display: flex; align-items: flex-end; gap: 2px; height: 110px;
  border-bottom: 1px solid #e0e0e0; padding-bottom: 0;
}
.mini-chart-group {
  display: flex; flex-direction: column; align-items: center;
}
.mini-chart-bars {
  display: flex; align-items: flex-end; gap: 1px; height: 100px;
}
.mini-chart-bar {
  border-radius: 2px 2px 0 0; opacity: 0.85; transition: opacity 0.15s;
}
.mini-chart-bar:hover { opacity: 1; }
.mini-chart-label {
  font-size: 9px; color: #999; margin-top: 4px; text-align: center;
}

/* Compact data table variant */
.data-table-compact th,
.data-table-compact td {
  padding: 6px 10px; font-size: 12px;
}

/* ── Badges ───────────────────────────────────────────────── */
.badge {
  display: inline-block; padding: 3px 12px; border-radius: 10px;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px;
}
.badge-pass { background: #e8f5e9; color: #2e7d32; }
.badge-fail { background: #ffebee; color: #c62828; }
.badge-info { background: #e3f2fd; color: #1565c0; }
.badge-warning { background: #fff8e1; color: #e65100; }
.badge-neutral { background: #f1f3f5; color: #666; }

/* ── Score Colors ─────────────────────────────────────────── */
.score-pass { color: #2e7d32; }
.score-fail { color: #c62828; }

/* ── Tables ───────────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left; padding: 12px 16px; background: #f8f9fc;
  font-size: 11px; text-transform: uppercase; letter-spacing: .5px;
  color: #888; border-bottom: 1px solid #e8e8e8;
}
.data-table td {
  padding: 12px 16px; border-bottom: 1px solid #f0f0f0; font-size: 14px;
}
.data-table tr:hover td { background: #f9fafe; }
.data-table-sticky thead th { position: sticky; top: 0; z-index: 1; }
.table-scroll-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table .cell-stack { line-height: 1.4; }
.data-table .cell-primary { font-weight: 600; color: #1e293b; }
.data-table .cell-secondary { font-size: 12px; color: #64748b; }
.data-table .cell-badges { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.data-table .cell-dot { color: #94a3b8; font-size: 10px; }
.billing-chart-wrap { position: relative; width: 100%; }
.billing-chart-wrap canvas { width: 100%; display: block; }
.billing-chart-legend { display: flex; gap: 16px; justify-content: center; margin-bottom: 12px; font-size: 12px; color: #64748b; }
.billing-chart-legend span::before { content: ''; display: inline-block; width: 12px; height: 3px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }
.billing-trend-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 16px; }
.billing-trend-stat { text-align: center; padding: 10px 8px; background: #f8f9fc; border-radius: 8px; }
.billing-trend-stat .bt-value { font-size: 18px; font-weight: 700; color: #1e293b; }
.billing-trend-stat .bt-label { font-size: 11px; color: #64748b; margin-top: 2px; }
.billing-trend-stat .bt-trend { font-size: 11px; margin-top: 2px; }
@media (max-width: 640px) { .billing-trend-stats { grid-template-columns: repeat(2, 1fr); } }

/* ── Forms ────────────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block; font-size: 13px; font-weight: 600;
  color: #333; margin-bottom: 6px;
}
.form-input {
  width: 100%; padding: 11px 16px; border: 1.5px solid #ddd;
  border-radius: 8px; font-size: 14px; font-family: inherit;
  transition: border-color .2s, box-shadow .2s; outline: none;
}
.form-input:focus { border-color: #1a237e; box-shadow: 0 0 0 3px rgba(26,35,126,.08); }
.form-row {
  display: flex; gap: 12px; flex-wrap: wrap;
}
.form-row .form-group { flex: 1; min-width: 140px; margin-bottom: 12px; }
.voucher-form .header-filter { font-size: 13px; }
.form-input:disabled { background: #f5f5f5; color: #888; cursor: not-allowed; }
.form-hint { font-size: 12px; color: #94a3b8; margin-top: 4px; }
.form-message { padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; }
.form-message-success { background: #e8f5e9; color: #2e7d32; }
.form-message-error { background: #fce4ec; color: #c62828; }
.form-error {
  color: #c62828; font-size: 13px; margin-top: 6px;
  display: none;
}
.form-error.visible { display: block; }
.alert {
  padding: 12px 16px; border-radius: 8px; margin-bottom: 16px;
  font-size: 14px; display: none;
}
.alert.visible { display: block; }
.alert-error { background: #ffebee; color: #c62828; border: 1px solid #ef9a9a; }
.alert-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }

/* ── Auth Pages (Login/Register) ──────────────────────────── */
.auth-page {
  min-height: 100vh; display: flex;
}
.auth-brand {
  flex: 3; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0d1b3e 0%, #1a237e 50%, #283593 100%);
  padding: 60px 48px; position: relative; overflow: hidden;
}
.auth-brand::before {
  content: ''; position: absolute; top: -30%; right: -20%;
  width: 500px; height: 500px; border-radius: 50%;
  background: rgba(255,255,255,.03);
}
.auth-brand::after {
  content: ''; position: absolute; bottom: -20%; left: -15%;
  width: 400px; height: 400px; border-radius: 50%;
  background: rgba(255,255,255,.02);
}
.auth-brand-logo {
  width: 64px; height: 64px; margin-bottom: 24px;
  background: rgba(255,255,255,.12); border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 28px;
  backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.15);
  position: relative; z-index: 1;
}
.auth-brand h2 {
  color: #fff; font-size: 28px; font-weight: 700;
  margin-bottom: 12px; text-align: center;
  position: relative; z-index: 1;
}
.auth-brand p {
  color: rgba(255,255,255,.78); font-size: 15px; text-align: center;
  max-width: 360px; line-height: 1.7;
  position: relative; z-index: 1;
}
.auth-no-cc {
  color: rgba(255,255,255,.7); font-size: 13px; text-align: center;
  margin-top: 8px; position: relative; z-index: 1;
  font-style: italic;
}
.auth-brand-features {
  list-style: none; margin-top: 24px; position: relative; z-index: 1;
}
.auth-brand-features li {
  color: rgba(255,255,255,.85); font-size: 14.5px;
  padding: 9px 0; display: flex; align-items: center; gap: 10px;
}
.auth-brand-features li::before {
  content: '\2713'; display: inline-flex; width: 22px; height: 22px;
  align-items: center; justify-content: center;
  background: rgba(102,187,106,.25); color: #81c784;
  border-radius: 50%; font-size: 12px; flex-shrink: 0;
}
/* ── Product Preview Mockup ──────────────────────────────── */
.auth-brand-preview {
  position: relative; z-index: 1; margin-top: 24px;
  width: 100%; max-width: 480px;
  background: rgba(255,255,255,.07); border-radius: 12px;
  border: 1px solid rgba(255,255,255,.1);
  padding: 20px; backdrop-filter: blur(6px);
}
.preview-header {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 16px; padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.preview-dot {
  width: 8px; height: 8px; border-radius: 50%;
}
.preview-dot.red { background: #ef5350; }
.preview-dot.yellow { background: #ffa726; }
.preview-dot.green { background: #66bb6a; }
.preview-title {
  margin-left: 8px; font-size: 11px; color: rgba(255,255,255,.55);
  letter-spacing: .5px; text-transform: uppercase; font-weight: 600;
}
.preview-stats {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px;
  margin-bottom: 16px;
}
.preview-stat-card {
  background: rgba(255,255,255,.06); border-radius: 8px;
  padding: 12px 10px; text-align: center;
  border: 1px solid rgba(255,255,255,.06);
}
.preview-stat-value {
  font-size: 20px; font-weight: 800; color: #fff; line-height: 1.2;
}
.preview-stat-label {
  font-size: 10px; color: rgba(255,255,255,.58); text-transform: uppercase;
  letter-spacing: .5px; margin-top: 3px;
}
.preview-question {
  background: rgba(255,255,255,.05); border-radius: 8px;
  padding: 14px; border: 1px solid rgba(255,255,255,.06);
  min-height: 196px;
}
.preview-question-label {
  font-size: 10px; color: rgba(255,255,255,.52); text-transform: uppercase;
  letter-spacing: .5px; margin-bottom: 8px; font-weight: 600;
}
.preview-question-text {
  font-size: 13px; color: rgba(255,255,255,.85); line-height: 1.5;
  margin-bottom: 10px;
}
.preview-option {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; margin-bottom: 4px;
  border-radius: 6px; font-size: 12px;
  color: rgba(255,255,255,.65);
}
.preview-option .preview-radio {
  width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid rgba(255,255,255,.25);
}
.preview-option.selected {
  background: rgba(102,187,106,.15);
  color: rgba(255,255,255,.85);
}
.preview-option.selected .preview-radio {
  border-color: #66bb6a; background: #66bb6a;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.9);
}
.auth-form-side {
  flex: 2; flex-shrink: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px 60px; background: #fff;
}
.auth-card {
  width: 100%; max-width: 420px;
  animation: authFadeIn .4s ease;
}
@keyframes authFadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.auth-logo {
  width: 48px; height: 48px; margin: 0 auto 20px;
  background: linear-gradient(135deg, #1a237e, #3949ab);
  border-radius: 12px; display: flex; align-items: center;
  justify-content: center; color: #fff; font-weight: 800;
  font-size: 20px; box-shadow: 0 4px 16px rgba(26,35,126,.3);
  /* Hidden on desktop since brand panel shows it */
  display: none;
}
.auth-card h1 {
  font-size: 26px; color: #1a237e; margin-bottom: 4px;
}
.auth-card .subtitle {
  color: #888; font-size: 14px; margin-bottom: 32px;
}
.auth-brand-tagline {
  color: rgba(255,255,255,.55); font-size: 13px; text-transform: uppercase;
  letter-spacing: 1.5px; margin-bottom: 8px; font-weight: 600;
  position: relative; z-index: 1;
}
.auth-brand-stats {
  display: flex; gap: 32px; margin-top: 32px; margin-bottom: 24px;
  position: relative; z-index: 1;
}
.auth-stat { text-align: center; }
.auth-stat-number {
  font-size: 28px; font-weight: 800; color: #fff; line-height: 1.2;
}
.auth-stat-label {
  font-size: 11px; color: rgba(255,255,255,.6); text-transform: uppercase;
  letter-spacing: .8px; margin-top: 4px;
}
.auth-logo-sm {
  width: 48px; height: 48px; margin: 0 auto 20px;
  background: linear-gradient(135deg, #1a237e, #3949ab);
  border-radius: 12px; display: flex; align-items: center;
  justify-content: center; color: #fff; font-weight: 800;
  font-size: 20px; box-shadow: 0 4px 16px rgba(26,35,126,.3);
  display: none; /* hidden on desktop, shown on mobile */
}
.password-wrapper {
  position: relative;
}
.password-wrapper .form-input {
  padding-right: 44px;
}
.password-toggle {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  color: #999; padding: 4px; display: flex; align-items: center;
  justify-content: center; border-radius: 4px; transition: color .15s;
}
.password-toggle:hover { color: #1a237e; }
.form-options {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px; font-size: 13px;
}
.checkbox-label {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  color: #555; font-size: 13px; user-select: none;
}
.checkbox-label input[type="checkbox"] {
  accent-color: #1a237e; width: 16px; height: 16px; cursor: pointer;
}
.auth-disclaimer {
  text-align: center; margin-top: 20px; font-size: 11.5px;
  color: #999; line-height: 1.5;
}
.auth-legal-links {
  text-align: center; margin-top: 10px; font-size: 11.5px;
}
.auth-legal-links a {
  color: #999; text-decoration: none; transition: color .15s;
}
.auth-legal-links a:hover { color: #1a237e; text-decoration: underline; }
.auth-legal-sep { color: #ccc; margin: 0 4px; }
.auth-support-link {
  text-align: center; margin-top: 12px; font-size: 11.5px; color: #999;
}
.auth-support-link a { color: #1a237e; text-decoration: none; }
.auth-support-link a:hover { text-decoration: underline; }
.forgot-link {
  font-size: 13px; color: #1a237e; text-decoration: none;
}
.forgot-link:hover { text-decoration: underline; }
.auth-card .auth-footer {
  text-align: center; margin-top: 24px; font-size: 14px; color: #666;
}
.auth-card .auth-footer a { color: #1a237e; font-weight: 600; }
.auth-back {
  margin-top: 20px; font-size: 13px; color: #999; text-decoration: none;
}
.auth-back:hover { color: #1a237e; text-decoration: none; }
.password-strength {
  height: 4px; border-radius: 2px; margin-top: 6px;
  background: #eee; overflow: hidden; transition: all .3s;
}
.password-strength-bar {
  height: 100%; border-radius: 2px; width: 0;
  transition: width .3s, background .3s;
}
.password-strength-bar.weak { width: 33%; background: #ef5350; }
.password-strength-bar.medium { width: 66%; background: #ffa726; }
.password-strength-bar.strong { width: 100%; background: #66bb6a; }
.password-strength-text {
  font-size: 11px; margin-top: 4px; color: #999;
}

/* ── Email Verification ────────────────────────────────────── */
.verify-icon { text-align: center; margin: 8px 0 16px; }
.verify-hint {
  color: #888; font-size: 13px; line-height: 1.5; margin-top: 12px;
}
.alert-success {
  background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9;
  padding: 10px 14px; border-radius: 6px; font-size: 14px;
  display: none;
}
.alert-success.visible { display: block; }
.password-requirements {
  margin-top: 8px; padding: 10px 12px;
  background: #f8f9fb; border-radius: 6px;
}
.pw-req {
  font-size: 13px; color: #888; line-height: 1.8;
  transition: color .15s;
}
.pw-req.met { color: #2e7d32; }
.pw-req-icon { display: inline-block; width: 18px; text-align: center; font-size: 12px; }

/* ── Page Layout ──────────────────────────────────────────── */
.page-container {
  max-width: 1240px; margin: 0 auto;
  padding: 36px 28px 40px;
  animation: pageIn .3s ease;
}
.page-container.page-wide { max-width: 1320px; }
@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.page-header {
  margin-bottom: 24px;
}
.page-header h1 { font-size: 22px; color: #1a1a2e; margin-bottom: 4px; font-weight: 700; }
.page-header p { color: #888; font-size: 14px; }

/* ── Section Label ───────────────────────────────────────── */
.section-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: #999; margin-bottom: 14px;
  padding-bottom: 8px; border-bottom: 1px solid #e8e8e8;
}

/* ── Exam Cards Grid ──────────────────────────────────────── */
.exam-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  align-items: stretch;
  gap: 16px; margin-bottom: 28px;
}
/* ── Exam Search ─────────────────────────────────────────── */
.exam-search-wrap { margin-bottom: 16px; }
.exam-search {
  width: 100%; padding: 10px 16px; border: 1.5px solid #ddd;
  border-radius: 8px; font-size: 14px; font-family: inherit;
  outline: none; background: #fff; transition: border-color .2s;
  box-sizing: border-box;
}
.exam-search:focus { border-color: #1a237e; box-shadow: 0 0 0 3px rgba(26,35,126,.08); }
.exam-search::placeholder { color: #aaa; }

/* ── Category Filter ──────────────────────────────────────── */
.category-filter {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px;
}
.catalog-controls {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; gap: 12px; flex-wrap: wrap;
}
.catalog-controls-right {
  display: flex; align-items: center; gap: 8px;
}
.catalog-footer {
  display: flex; align-items: center; justify-content: flex-end;
  margin-bottom: 24px;
}
.category-chip {
  padding: 7px 16px; border-radius: 20px; font-size: 13px;
  font-weight: 600; border: 1px solid #ddd; background: #fff;
  color: #555; cursor: pointer; transition: all .15s;
  white-space: nowrap;
}
.category-chip:hover { border-color: #1a237e; color: #1a237e; }
.category-chip.active {
  background: #1a237e; color: #fff; border-color: #1a237e;
}

/* ── Category Badges ─────────────────────────────────────── */
.exam-card-header { margin-bottom: 6px; }
.exam-category-badge {
  display: inline-block; padding: 3px 10px; border-radius: 12px;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px;
}
.cat-microsoft { background: #e8eaf6; color: #1a237e; }
.cat-aws { background: #fff3e0; color: #e65100; }
.cat-googlecloud { background: #e8f5e9; color: #2e7d32; }
.cat-kubernetes { background: #e3f2fd; color: #0277bd; }
.cat-docker { background: #e3f2fd; color: #0d47a1; }
.cat-linux { background: #fce4ec; color: #c62828; }
.cat-security { background: #f3e5f5; color: #6a1b9a; }
.cat-hashicorp { background: #e0f2f1; color: #00695c; }
.cat-github { background: #f5f5f5; color: #24292f; }
.cat-cisco { background: #e0f7fa; color: #006064; }
.cat-vmware { background: #efebe9; color: #4e342e; }

.exam-card {
  background: #fff; border-radius: 12px; padding: 18px;
  box-shadow: 0 1px 8px rgba(0,0,0,.06);
  border-left: 3px solid #1a237e;
  display: flex; flex-direction: column;
  min-height: 320px;
  transition: transform .15s, box-shadow .15s;
}
.exam-card:hover { transform: translateY(-2px); box-shadow: 0 4px 20px rgba(0,0,0,.1); }
.exam-card h3 { font-size: 15px; color: #1a237e; margin-bottom: 8px; line-height: 1.3; }
.exam-card .exam-desc {
  font-size: 13px; color: #666; line-height: 1.5;
  min-height: 40px; margin-bottom: 16px;
}
.exam-card .exam-bottom {
  margin-top: auto;
}
.exam-card .exam-progress-slot {
  height: 38px; padding: 0 2px; margin-bottom: 14px;
  overflow: hidden;
}
.exam-card .exam-progress-empty {
  font-size: 12px; color: #94a3b8; padding-top: 2px;
}
.exam-card .exam-progress-label {
  font-size: 10px; font-weight: 600; color: #475569;
  text-transform: uppercase; letter-spacing: .4px; margin-bottom: 4px;
}
.exam-card .exam-progress-chips {
  font-size: 12px; color: #666; font-weight: 500;
}
.exam-card .exam-progress-chips .chip-dot {
  color: #ccc; margin: 0 6px; font-weight: 400;
}
.exam-card .exam-meta {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  height: 28px; margin-bottom: 14px;
  font-size: 12px; color: #666; overflow: hidden;
}
.exam-card .exam-meta span {
  background: #f5f7ff; padding: 3px 10px; border-radius: 4px;
  font-weight: 500;
}
.exam-card .exam-bottom .btn {
  display: block; width: 100%; text-align: center;
}

/* ── Recent Attempts Mini (Score Trend < 3 attempts) ─────── */
.recent-attempts-mini {
  padding: 2px 0;
}
.recent-attempt-row {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 8px; border-radius: 6px;
  font-size: 12px;
}
.recent-attempt-row:hover { background: #f8f9ff; }
.recent-attempt-name {
  font-weight: 600; color: #1a237e; min-width: 60px;
  white-space: nowrap;
}
.recent-attempt-score {
  font-weight: 600; color: #333; white-space: nowrap; flex: 1;
}
.recent-attempt-status {
  font-size: 11px; font-weight: 700; padding: 2px 10px;
  border-radius: 10px; white-space: nowrap;
}
.recent-attempt-status.mini-pass { background: #e8f5e9; color: #2e7d32; }
.recent-attempt-status.mini-fail { background: #ffebee; color: #c62828; }
.recent-attempt-date-row {
  font-size: 11px; color: #aaa; padding: 0 8px 4px;
  border-bottom: 1px solid #f0f0f0;
}
.recent-attempt-date-row:last-of-type { border-bottom: none; }

/* ── Difficulty Badges ─────────────────────────────────────── */
.exam-diff-badge {
  display: inline-block; padding: 3px 10px; border-radius: 12px;
  font-size: 11px; font-weight: 700; margin-left: 6px;
}
.diff-foundation { background: #e8f5e9; color: #2e7d32; }
.diff-intermediate { background: #fff8e1; color: #f57f17; }
.diff-advanced { background: #fce4ec; color: #c62828; }


/* ── Exam Domains ──────────────────────────────────────────── */
.exam-domains-section { margin-bottom: 10px; }
.exam-domains-title { font-size: 11px; color: #94a3b8; font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }
.exam-domains-list {
  list-style: disc; padding-left: 20px; margin-top: 4px;
  font-size: 12px; color: #555; line-height: 1.6;
}
.exam-domains-toggle {
  list-style: none; margin-left: -20px; color: #1a237e;
  cursor: pointer; font-weight: 500; font-size: 11px;
  margin-top: 2px;
}
.exam-domains-toggle:hover { text-decoration: underline; }
.domain-q-count {
  color: #888; font-size: 11px; font-weight: 500;
  white-space: nowrap;
}
/* ── Exam Card Footer (chips top, button below-right) ─────── */
.exam-card-footer {
  margin-top: auto; padding-top: 12px;
  border-top: 1px solid #f0f0f0;
}
.exam-card-footer .exam-meta { margin-bottom: 10px; }
.exam-card-footer .btn {
  display: block; width: 100%; text-align: center;
  white-space: nowrap;
}

/* ── Section Card ─────────────────────────────────────────── */
.section-card {
  background: #fff; border-radius: 12px;
  box-shadow: 0 1px 8px rgba(0,0,0,.06); margin-bottom: 20px;
}
.section-card h3 {
  padding: 16px 20px; background: #f8f9fc; color: #1a1a2e;
  font-size: 14px; font-weight: 600; border-bottom: 1px solid #e8e8e8;
  margin: 0; display: flex; align-items: center;
  justify-content: space-between; position: relative; z-index: 2;
  border-radius: 12px 12px 0 0;
}
.section-card .section-body { padding: 16px 20px; }
.section-view-all {
  font-size: 12px; font-weight: 500; color: #1a237e;
  text-decoration: none; white-space: nowrap;
}
.section-view-all:hover { text-decoration: underline; }
#domain-section .section-body { padding: 14px 20px; }
#trend-section h3 { padding: 12px 16px; font-size: 13px; }
#trend-section .section-body { padding: 8px 12px; }
.header-filter {
  padding: 5px 10px; border: 1.5px solid #ddd; border-radius: 6px;
  font-size: 13px; font-family: inherit; outline: none;
  background: #fff; color: #333;
}
.header-filter:focus { border-color: #1a237e; }
.header-filters {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
}
select.header-filter {
  cursor: pointer;
}
.quick-filters {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px;
}
.quick-filter {
  padding: 5px 14px; border: 1.5px solid #ddd; border-radius: 20px;
  font-size: 12px; font-weight: 600; background: #fff; color: #666;
  cursor: pointer; transition: all .15s; font-family: inherit;
}
.quick-filter:hover { border-color: #1a237e; color: #1a237e; }
.quick-filter.active {
  background: #1a237e; color: #fff; border-color: #1a237e;
}

/* ── Recommended Exam Card ────────────────────────────────── */
.recommended-card {
  background: #fff; border-radius: 12px; padding: 24px;
  box-shadow: 0 1px 8px rgba(0,0,0,.06);
  border: 1px solid #e8eaf6; margin-bottom: 20px;
  display: flex; gap: 20px; align-items: center;
}
.recommended-card .rec-icon {
  width: 48px; height: 48px; flex-shrink: 0;
  background: linear-gradient(135deg, #1a237e, #3949ab);
  border-radius: 12px; display: flex; align-items: center;
  justify-content: center; color: #fff; font-size: 22px;
  box-shadow: 0 2px 10px rgba(26,35,126,.25);
}
.recommended-card .rec-content { flex: 1; }
.recommended-card .rec-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .8px;
  color: #888; margin-bottom: 4px; font-weight: 600;
}
.recommended-card .rec-title {
  font-size: 16px; font-weight: 700; color: #1a237e; margin-bottom: 4px;
}
.recommended-card .rec-desc { font-size: 13px; color: #666; }

/* ── Readiness Widget ─────────────────────────────────────── */
.readiness-widget {
  background: #fff; border-radius: 12px; padding: 16px;
  box-shadow: 0 1px 8px rgba(0,0,0,.06); margin-bottom: 16px;
  text-align: center;
}
.readiness-ring {
  width: 80px; height: 80px; margin: 0 auto 10px;
  position: relative;
}
.readiness-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.readiness-ring .ring-bg { fill: none; stroke: #eee; stroke-width: 8; }
.readiness-ring .ring-fill {
  fill: none; stroke-width: 8; stroke-linecap: round;
  transition: stroke-dashoffset .8s ease;
}
.readiness-ring .ring-text {
  position: absolute; inset: 0; display: flex;
  align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; color: #1a237e;
}
.readiness-label {
  font-size: 13px; font-weight: 600; color: #1a1a2e; margin-bottom: 2px;
}
.readiness-sub { font-size: 12px; color: #888; }

/* ── Domain Bar Chart ─────────────────────────────────────── */
.domain-bar-row {
  display: flex; align-items: center; gap: 12px;
  padding: 6px 0;
}
.domain-bar-label { font-size: 13px; font-weight: 500; color: #1e293b; min-width: 200px; }
.domain-bar {
  flex: 1; height: 8px; background: #eee;
  border-radius: 4px; overflow: hidden;
}
.domain-bar-fill {
  height: 100%; border-radius: 4px; transition: width .5s; min-width: 0;
}
.domain-bar-fill.bar-green { background: linear-gradient(90deg, #66bb6a, #43a047); }
.domain-bar-fill.bar-orange { background: linear-gradient(90deg, #ffa726, #f57c00); }
.domain-bar-fill.bar-red { background: linear-gradient(90deg, #ef5350, #c62828); }
.domain-bar-pct { font-size: 13px; font-weight: 600; min-width: 45px; text-align: right; }

/* ── Two-column layout ────────────────────────────────────── */
.grid-2col {
  display: grid; grid-template-columns: 1fr 320px; gap: 20px;
  align-items: start;
}
.grid-2col-wide { grid-template-columns: 1fr; }

/* Dashboard: normal grid, Recommended Exams starts after both columns */
.dashboard-2col {
  margin-bottom: 4px;
}

/* ── Tabs ─────────────────────────────────────────────────── */
.tabs { display: flex; gap: 2px; margin-bottom: 24px; border-bottom: 2px solid #e8e8e8; }
.tab {
  padding: 10px 20px; font-size: 14px; font-weight: 600;
  color: #888; cursor: pointer; border: none; background: none;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: all .15s;
}
.tab:hover { color: #1a237e; }
.tab.active { color: #1a237e; border-bottom-color: #1a237e; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── Filter/Search Bar ────────────────────────────────────── */
.filter-bar {
  display: flex; gap: 12px; align-items: center;
  margin-bottom: 20px; flex-wrap: wrap;
}
.filter-bar select, .filter-bar input {
  padding: 8px 14px; border: 1.5px solid #ddd; border-radius: 6px;
  font-size: 14px; font-family: inherit; outline: none;
}
.filter-bar select:focus, .filter-bar input:focus { border-color: #1a237e; }

/* ── Pagination ───────────────────────────────────────────── */
.pagination {
  display: flex; gap: 6px; justify-content: flex-end;
  margin-top: 16px; align-items: center;
}
.pagination button {
  padding: 6px 12px; border: 1px solid #e0e0e0; border-radius: 6px;
  background: #fff; cursor: pointer; font-size: 13px; min-width: 36px;
  text-align: center; transition: all .15s;
}
.pagination button:hover { background: #f5f7ff; border-color: #c5cae9; }
.pagination button:disabled { opacity: .4; cursor: not-allowed; }
.pagination button.page-active {
  background: #1a237e; color: #fff; border-color: #1a237e; font-weight: 600;
}
.pagination .page-info { font-size: 13px; color: #666; }
.pagination .page-ellipsis { font-size: 13px; color: #999; padding: 0 2px; }
.table-showing {
  font-size: 12px; color: #888; margin-bottom: 8px;
}

/* ── Loading State ────────────────────────────────────────── */
.loading {
  text-align: center; padding: 60px 20px; color: #888;
}
.loading::after {
  content: ''; display: block; width: 32px; height: 32px;
  border: 3px solid #e0e0e0; border-top-color: #1a237e;
  border-radius: 50%; margin: 16px auto 0;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Empty State ──────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 32px 20px; color: #888;
}
.section-card .empty-state { padding: 24px 20px; }
.empty-state-icon { font-size: 40px; margin-bottom: 12px; }
.empty-state h3 { color: #555; margin-bottom: 6px; font-size: 16px; }
.empty-state p { font-size: 14px; max-width: 360px; margin: 0 auto; line-height: 1.5; }
.empty-state-standalone {
  text-align: center; padding: 60px 20px; color: #888;
  background: #fff; border-radius: 12px;
  box-shadow: 0 1px 8px rgba(0,0,0,.06);
  max-width: 480px;
}
.empty-state-standalone h3 { color: #555; margin-bottom: 8px; font-size: 18px; font-weight: 600; background: none; border: none; padding: 0; }
.empty-state-standalone p { font-size: 14px; max-width: 360px; margin: 0 auto; line-height: 1.5; color: #888; }

/* ── History page ────────────────────────────────────────── */
#history-body { overflow: visible; }
#history-body .data-table { min-width: 700px; }
.history-toolbar {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 16px; flex-wrap: wrap;
}
.history-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; border-top: 1px solid #f0f0f0;
  flex-wrap: wrap; gap: 10px;
}
.history-footer-left {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: #666;
}
.history-footer-left select {
  padding: 5px 8px; border: 1px solid #ddd; border-radius: 6px;
  font-size: 13px; font-family: inherit; color: #333; background: #fff;
  cursor: pointer; outline: none; transition: border-color .15s;
}
.history-footer-left select:focus { border-color: #1a237e; }
.history-footer-left .footer-sep {
  width: 1px; height: 18px; background: #e0e0e0; margin: 0 6px;
}
.history-footer-right { display: flex; gap: 4px; align-items: center; }
.history-footer-right button {
  padding: 6px 14px; border: 1px solid #ddd; border-radius: 6px;
  background: #fff; cursor: pointer; font-size: 13px; font-family: inherit;
  color: #333; transition: all .15s; min-width: 36px; text-align: center;
  line-height: 1;
}
.history-footer-right button:hover:not(:disabled) {
  background: #f0f2ff; border-color: #c5cae9; color: #1a237e;
}
.history-footer-right button:disabled {
  color: #bbb; border-color: #eee; background: #fafafa; cursor: default;
}
.history-footer-right button.page-active {
  background: #1a237e; color: #fff; border-color: #1a237e; font-weight: 600;
}
.history-footer-right button.page-active:hover { background: #283593; }
.history-footer-right .page-ellipsis {
  font-size: 13px; color: #999; padding: 0 4px; line-height: 1;
}
.filter-summary {
  font-size: 12px; color: #888; margin-bottom: 10px; padding-left: 2px;
}
.filter-summary:empty { display: none; }
.filter-summary span { color: #555; font-weight: 500; }
.history-empty-inline {
  text-align: center; padding: 28px 20px; color: #64748b;
}
.history-empty-inline h4 {
  font-size: 15px; font-weight: 600; color: #475569; margin: 0 0 6px;
}
.history-empty-inline p {
  font-size: 13px; color: #94a3b8; margin: 0 0 16px; line-height: 1.5;
}
.history-empty-actions { display: flex; gap: 8px; justify-content: center; }
.history-row-timedout td { background: #fafbfc; }
.history-row-timedout:hover td { background: #f0f2ff; }
.history-row-clickable { cursor: pointer; }
.history-row-clickable:hover td { background: #f0f2ff; }
/* Row action menu */
.row-action-cell { position: relative; }
.row-action-trigger {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 6px;
  border: 1px solid transparent; background: none; color: #888;
  cursor: pointer; transition: all .15s; font-size: 18px;
  letter-spacing: 1px; line-height: 1;
}
.row-action-trigger:hover { background: #f0f2ff; border-color: #ddd; color: #1a237e; }
.row-action-trigger.active {
  background: #e8eaf6; border-color: #c5cae9; color: #1a237e;
}
.row-action-menu {
  display: none; position: absolute; right: 0; top: calc(100% + 6px); z-index: 50;
  background: #fff; border: 1px solid #e0e0e0; border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.12); min-width: 190px; width: max-content;
  padding: 5px 0;
}
.row-action-menu.open { display: block; }
.row-action-menu.flip-up { top: auto; bottom: calc(100% + 6px); }
.row-action-menu a, .row-action-menu button {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 9px 14px; border: none; background: none;
  font-size: 13px; font-family: inherit; color: #333;
  cursor: pointer; text-decoration: none; text-align: left;
  transition: background .1s;
}
.row-action-menu a:hover, .row-action-menu button:hover { background: #f5f7ff; }
.row-action-menu .action-icon { width: 16px; text-align: center; color: #888; font-size: 14px; }
.row-action-menu .action-danger { color: #c62828; }
.row-action-menu .action-danger:hover { background: #fef2f2; }
.row-action-menu .action-danger .action-icon { color: #c62828; }
.row-action-sep { height: 1px; background: #f0f0f0; margin: 4px 0; }
/* Danger button for modals */
.btn-danger {
  background: #c62828; color: #fff; border: none; padding: 10px 24px;
  border-radius: 8px; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: background .15s;
}
.btn-danger:hover { background: #b71c1c; }
.btn-danger:disabled { opacity: .5; cursor: not-allowed; }

/* ── Toggle Switch ────────────────────────────────────────── */
.toggle { position: relative; display: inline-block; width: 44px; height: 24px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: #ccc; border-radius: 24px; transition: .3s;
}
.toggle-slider::before {
  content: ''; position: absolute; width: 18px; height: 18px;
  left: 3px; bottom: 3px; background: #fff;
  border-radius: 50%; transition: .3s;
}
.toggle input:checked + .toggle-slider { background: #1a237e; }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ── Chart Canvas ─────────────────────────────────────────── */
.chart-container {
  position: relative; width: 100%; height: 250px;
  margin-bottom: 16px;
}
.chart-container canvas { width: 100% !important; height: 100% !important; }

/* ── Exam Header (during exam) ────────────────────────────── */
.exam-header {
  background: linear-gradient(135deg, #0d1b3e 0%, #1a237e 100%);
  color: #fff; padding: 0 24px; height: 56px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
}
.exam-header-title { font-size: 16px; font-weight: 600; letter-spacing: .3px; }
.exam-header-info { display: flex; gap: 24px; align-items: center; font-size: 13px; }
.exam-header-timer {
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 18px; font-weight: 700; padding: 4px 14px;
  border-radius: 6px; background: rgba(255,255,255,.12);
}
.timer-warning { background: #e65100 !important; animation: pulse 1s infinite; }
.timer-danger  { background: #b71c1c !important; animation: pulse .5s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.7} }

/* ── Copy Protection ──────────────────────────────────────── */
.no-copy {
  -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none;
}

/* ── Exam Content ─────────────────────────────────────────── */
.exam-body { margin-top: 59px; min-height: calc(100vh - 59px); }
.exam-main { padding: 28px 36px 80px; max-width: 900px; margin: 0 auto; }

.question-domain {
  font-size: 12px; text-transform: uppercase; letter-spacing: .5px;
  color: #5c6bc0; margin-bottom: 8px; font-weight: 600;
}
.question-text {
  font-size: 17px; line-height: 1.6; margin-bottom: 24px;
  color: #1a1a2e; font-weight: 500;
}
.multi-hint {
  display: inline-block; background: #e3f2fd; color: #1565c0;
  padding: 4px 12px; border-radius: 4px; font-size: 12px;
  font-weight: 600; margin-bottom: 16px;
}
.options-list { display: flex; flex-direction: column; gap: 10px; }
.option-item {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 14px 18px; border: 2px solid #e0e0e0; border-radius: 8px;
  cursor: pointer; transition: all .15s; background: #fff;
}
.option-item:hover { border-color: #90a4ae; background: #f5f7ff; }
.option-item.selected { border-color: #1a237e; background: #e8eaf6; }
.option-item input[type="radio"],
.option-item input[type="checkbox"] {
  margin-top: 3px; accent-color: #1a237e;
  width: 18px; height: 18px; flex-shrink: 0; cursor: pointer;
}
.option-key { font-weight: 700; color: #1a237e; min-width: 20px; margin-top: 1px; }
.option-text { font-size: 15px; line-height: 1.5; color: #333; }

/* Answer-required warning */
.answer-warning {
  display: none; align-items: center; gap: 10px;
  margin-top: 16px; padding: 12px 18px;
  background: #fff3e0; border: 1px solid #ffe0b2; border-radius: 8px;
  color: #e65100; font-size: 14px; font-weight: 600;
  animation: warningShake .4s ease;
}
.answer-warning.visible { display: flex; }
.answer-warning-icon { font-size: 20px; flex-shrink: 0; }
@keyframes warningShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* Practice mode feedback */
.option-item.correct-reveal {
  border-color: #2e7d32 !important; background: #e8f5e9 !important;
  pointer-events: none; opacity: 1 !important;
}
.option-item.wrong-reveal {
  border-color: #c62828 !important; background: #ffebee !important;
  pointer-events: none; opacity: 1 !important;
}
.option-item.neutral-reveal {
  opacity: .45 !important; pointer-events: none;
}
.reveal-icon {
  margin-left: auto; flex-shrink: 0; font-size: 20px; font-weight: 700; line-height: 1;
}
.reveal-icon.correct { color: #2e7d32; }
.reveal-icon.wrong { color: #c62828; }
.practice-feedback {
  margin-top: 24px; border-radius: 12px; font-size: 14px; line-height: 1.7;
  animation: fadeSlideIn .35s ease; overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
}
.practice-feedback.correct {
  border: 2px solid #66bb6a;
}
.practice-feedback.incorrect {
  border: 2px solid #ef5350;
}
.practice-feedback .feedback-banner {
  display: flex; align-items: center; gap: 12px; padding: 14px 20px;
  font-weight: 700; font-size: 16px; letter-spacing: .3px;
}
.practice-feedback.correct .feedback-banner {
  background: linear-gradient(135deg, #2e7d32, #43a047); color: #fff;
}
.practice-feedback.incorrect .feedback-banner {
  background: linear-gradient(135deg, #c62828, #e53935); color: #fff;
}
.practice-feedback .feedback-banner-icon {
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,.2); display: flex;
  align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.practice-feedback .feedback-body {
  padding: 16px 20px;
}
.practice-feedback.correct .feedback-body {
  background: #f1f8e9; color: #33691e;
}
.practice-feedback.incorrect .feedback-body {
  background: #fff8e1; color: #bf360c;
}
.practice-feedback .correct-hint {
  font-weight: 600; margin-bottom: 10px; font-size: 14px;
  padding: 8px 12px; border-radius: 6px;
}
.practice-feedback.incorrect .correct-hint {
  background: rgba(230, 81, 0, .08); border: 1px solid rgba(230,81,0,.15);
}
.practice-feedback .explanation-text {
  font-size: 14px; line-height: 1.7; color: #444;
}
.practice-feedback .explanation-label {
  font-weight: 700; font-size: 12px; text-transform: uppercase;
  letter-spacing: .8px; color: #888; margin-bottom: 6px;
}
/* Legacy badge fallback - hidden when banner is used */
.practice-feedback .feedback-badge { display: none; }
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Welcome screen stat chips */
/* ── Welcome Screen ──────────────────────────────────────────── */
.welcome-card {
  max-width: 680px; margin: 80px auto 40px; padding: 40px 44px;
  background: #fff; border-radius: 16px;
  box-shadow: 0 4px 32px rgba(0,0,0,.08);
  animation: authFadeIn .4s ease;
}
.welcome-header { text-align: center; margin-bottom: 24px; }
.welcome-header h1 { font-size: 24px; color: #1a237e; margin: 12px 0 6px; }
.welcome-header p { font-size: 13px; color: #666; margin: 0; line-height: 1.5; }
.welcome-provider-badge {
  display: inline-block; padding: 4px 14px; border-radius: 6px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
}
.welcome-stats {
  display: flex; justify-content: center; gap: 0;
  border: 1px solid #e8eaf6; border-radius: 10px; overflow: hidden;
  margin-bottom: 20px;
}
.welcome-stat {
  flex: 1; padding: 14px 8px; text-align: center;
  border-right: 1px solid #e8eaf6;
}
.welcome-stat:last-child { border-right: none; }
.welcome-stat-val { display: block; font-size: 18px; font-weight: 700; color: #1a237e; }
.welcome-stat-lbl { display: block; font-size: 10px; color: #94a3b8; text-transform: uppercase; letter-spacing: .3px; margin-top: 2px; }
.welcome-progress-strip {
  display: flex; justify-content: center; gap: 20px; flex-wrap: wrap;
  padding: 10px 16px; background: #f8f9fc; border-radius: 8px;
  font-size: 12px; color: #64748b; margin-bottom: 20px;
}
.welcome-progress-strip strong { color: #1e293b; }
.welcome-no-attempts { justify-content: center; color: #94a3b8; font-style: italic; }
.welcome-section-label {
  font-size: 11px; font-weight: 600; color: #94a3b8;
  text-transform: uppercase; letter-spacing: .4px; margin-bottom: 10px;
}
/* Mode cards */
.mode-cards {
  display: flex; gap: 12px; margin-bottom: 20px;
}
.mode-card {
  flex: 1; padding: 16px; border: 2px solid #e8eaf6; border-radius: 12px;
  cursor: pointer; text-align: center; transition: all .2s;
  background: #fff;
}
.mode-card:hover { border-color: #c5cae9; }
.mode-card.selected { border-color: #1a237e; background: #eef0ff; box-shadow: 0 0 0 1px #1a237e; position: relative; }
.mode-card.selected::after {
  content: '\2713'; position: absolute; top: 8px; right: 10px;
  width: 20px; height: 20px; border-radius: 50%; background: #1a237e; color: #fff;
  font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.mode-card input { display: none; }
.mode-card-icon { font-size: 24px; margin-bottom: 6px; }
.mode-card-title { font-size: 14px; font-weight: 700; color: #1a237e; margin-bottom: 4px; }
.mode-card-desc { font-size: 11px; color: #64748b; line-height: 1.4; }
/* Domain preview */
.welcome-domains {
  margin-bottom: 20px; padding: 0 4px;
}
.welcome-domain-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 5px 0; border-bottom: 1px solid #f5f5f5;
  font-size: 12px; color: #475569;
}
.welcome-domain-row:last-child { border-bottom: none; }
.welcome-domain-count { color: #94a3b8; font-size: 11px; font-weight: 500; }
.welcome-how {
  font-size: 11px; color: #94a3b8; text-align: center;
  padding: 10px 0; border-top: 1px solid #f0f0f0;
}
.welcome-select {
  padding: 10px 16px; border: 1.5px solid #ddd; border-radius: 8px;
  font-size: 14px; font-family: inherit; width: 100%;
  outline: none; background: #fff;
}

/* Bottom navigation */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: #fff; border-top: 1px solid #e0e0e0;
  padding: 10px 36px; display: flex;
  justify-content: space-between; align-items: center;
  z-index: 50; height: 60px;
}
.bottom-nav-group { display: flex; gap: 10px; }

/* ── Review Screen ────────────────────────────────────────── */
.review-container {
  max-width: 900px; margin: 80px auto 40px; padding: 32px;
  background: #fff; border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,.08);
}
.review-container h2 { color: #1a237e; margin-bottom: 6px; }
.review-summary { display: flex; gap: 24px; margin: 20px 0 24px; flex-wrap: wrap; }
.review-stat {
  padding: 10px 20px; border-radius: 8px; font-size: 14px; font-weight: 600;
}
.review-stat.answered { background: #e8f5e9; color: #2e7d32; }
.review-stat.unanswered { background: #ffebee; color: #c62828; }
.review-stat.marked { background: #fff8e1; color: #e65100; }
.review-table { width: 100%; border-collapse: collapse; margin-bottom: 24px; }
.review-table th {
  text-align: left; padding: 10px 12px; background: #f5f7ff;
  font-size: 12px; text-transform: uppercase; letter-spacing: .5px;
  color: #666; border-bottom: 2px solid #e0e0e0;
}
.review-table td { padding: 10px 12px; border-bottom: 1px solid #f0f0f0; font-size: 13px; }
.review-table tr.clickable { cursor: pointer; }
.review-table tr.clickable:hover td { background: #f5f7ff; }
.review-table tr:not(.clickable) { opacity: .7; }
.review-table .status-badge {
  display: inline-block; padding: 2px 10px; border-radius: 10px;
  font-size: 11px; font-weight: 600;
}
.status-answered { background: #e8f5e9; color: #2e7d32; }
.status-unanswered { background: #ffebee; color: #c62828; }
.status-marked { background: #fff8e1; color: #e65100; }
.review-actions {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}

/* ── Results ──────────────────────────────────────────────── */
.results-container { max-width: 900px; margin: 80px auto 40px; padding: 0 20px; }
.result-banner {
  text-align: center; padding: 40px; border-radius: 12px;
  margin-bottom: 24px; box-shadow: 0 4px 24px rgba(0,0,0,.08);
}
.result-banner.passed {
  background: linear-gradient(135deg, #e8f5e9, #c8e6c9); border: 2px solid #66bb6a;
}
.result-banner.failed {
  background: linear-gradient(135deg, #ffebee, #ffcdd2); border: 2px solid #ef5350;
}
.result-banner.practice {
  background: linear-gradient(135deg, #e8eaf6, #c5cae9); border: 2px solid #7986cb;
}
.result-banner h2 { font-size: 26px; margin-bottom: 8px; }
.result-banner.passed h2 { color: #2e7d32; }
.result-banner.failed h2 { color: #c62828; }
.result-banner.practice h2 { color: #283593; }
.result-banner .score { font-size: 48px; font-weight: 800; margin: 12px 0; }
.result-banner.passed .score { color: #1b5e20; }
.result-banner.failed .score { color: #b71c1c; }
.result-banner.practice .score { color: #1a237e; }
.result-banner .score-sub { font-size: 14px; color: #666; }

.result-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px; margin-bottom: 24px;
}
.result-note {
  text-align: center; font-size: 13px; color: var(--text-muted);
  margin: -8px 0 20px; padding: 0 16px;
}

.domain-table {
  background: #fff; border-radius: 12px; overflow: hidden;
  box-shadow: 0 1px 8px rgba(0,0,0,.06); margin-bottom: 24px;
}
.domain-table h3 {
  padding: 14px 20px; background: #f8f9fc; color: #1a1a2e;
  font-size: 14px; font-weight: 600; border-bottom: 1px solid #e8e8e8; margin: 0;
}
.domain-table table { width: 100%; border-collapse: collapse; }
.domain-table th {
  text-align: left; padding: 10px 20px; font-size: 11px;
  text-transform: uppercase; letter-spacing: .5px; color: #888;
  border-bottom: 1px solid #eee;
}
.domain-table td { padding: 12px 20px; border-bottom: 1px solid #f5f5f5; font-size: 14px; }
.domain-pass { color: #2e7d32; font-weight: 600; }
.domain-fail { color: #c77700; font-weight: 600; }
.domain-bar-fill.pass { background: linear-gradient(90deg, #66bb6a, #43a047); }
.domain-bar-fill.fail { background: linear-gradient(90deg, #ffb74d, #f59e0b); }

/* Question review in results */
.review-detail {
  background: #fff; border-radius: 12px; overflow: hidden;
  box-shadow: 0 1px 8px rgba(0,0,0,.06); margin-bottom: 24px;
}
.review-detail h3 {
  padding: 14px 20px; background: #f8f9fc; color: #1a1a2e;
  font-size: 14px; font-weight: 600; border-bottom: 1px solid #e8e8e8;
  cursor: pointer; display: flex; justify-content: space-between;
  align-items: center; margin: 0;
}
.review-detail h3:hover { background: #eef0f8; }
.review-detail h3 .toggle-icon { font-size: 14px; color: #999; margin-left: auto; padding-left: 12px; transition: transform .2s ease; }
.review-detail h3 .toggle-icon.open { transform: rotate(180deg); }
.review-questions { padding: 0; }
.review-q-item { padding: 20px 24px; border-bottom: 1px solid #f0f0f0; }
.review-q-item:last-child { border-bottom: none; }
.review-q-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
}
.review-q-num { font-weight: 700; font-size: 14px; color: #1a237e; }
.review-q-badge {
  padding: 3px 12px; border-radius: 10px; font-size: 11px;
  font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
}
.badge-correct { background: #e8f5e9; color: #2e7d32; }
.badge-incorrect { background: #ffebee; color: #c62828; }
.review-q-text { font-size: 14px; line-height: 1.5; margin-bottom: 12px; color: #333; }
.review-q-domain { font-size: 11px; color: #999; margin-bottom: 12px; }
.review-option {
  padding: 8px 12px; border-radius: 6px; margin-bottom: 4px;
  font-size: 13px; display: flex; gap: 8px; align-items: flex-start;
}
.review-option .opt-indicator {
  font-weight: 700; font-size: 11px; min-width: 60px;
  text-align: center; padding: 2px 6px; border-radius: 4px;
  flex-shrink: 0; margin-top: 1px;
}
.review-option.correct-chosen { background: #e8f5e9; }
.review-option.correct-chosen .opt-indicator { background: #c8e6c9; color: #2e7d32; }
.review-option.wrong-chosen { background: #ffebee; }
.review-option.wrong-chosen .opt-indicator { background: #ffcdd2; color: #c62828; }
.review-option.missed { background: #e8f5e9; border: 1px dashed #66bb6a; }
.review-option.missed .opt-indicator { background: #c8e6c9; color: #2e7d32; }
.review-option.neutral { background: #fafafa; }
.review-option.neutral .opt-indicator { background: #eee; color: #999; }
.review-explanation {
  margin-top: 12px; padding: 14px 16px; background: #fffde7;
  border-left: 4px solid #ffd54f; border-radius: 0 6px 6px 0;
  font-size: 13px; line-height: 1.6; color: #555;
}

/* ── Scenario Table (embedded data tables in questions) ──── */
.scenario-table-wrap {
  margin-bottom: 20px; overflow-x: auto;
}
.scenario-table {
  width: 100%; border-collapse: collapse;
  font-size: 13px; border: 1px solid #d0d5dd;
  border-radius: 8px; overflow: hidden;
}
.scenario-table thead th {
  background: #e8eaf6; color: #1a237e; font-weight: 700;
  padding: 10px 14px; text-align: left; font-size: 12px;
  text-transform: uppercase; letter-spacing: .3px;
  border-bottom: 2px solid #c5cae9;
}
.scenario-table tbody td {
  padding: 9px 14px; border-bottom: 1px solid #eee;
  color: #333; background: #fff;
}
.scenario-table tbody tr:last-child td { border-bottom: none; }
.scenario-table tbody tr:hover td { background: #f8f9ff; }

/* ── Statement Table (hotspot / yesno) ───────────────────── */
.statement-table-wrap {
  margin-bottom: 4px; overflow-x: auto;
}
.statement-table {
  width: 100%; border-collapse: collapse; table-layout: fixed;
  font-size: 14px; border: 2px solid #c5cae9;
  border-radius: 8px; overflow: hidden;
}
.statement-table thead th {
  background: #e8eaf6; color: #283593; font-weight: 700;
  padding: 10px 14px; text-align: left; font-size: 12px;
  text-transform: uppercase; letter-spacing: .3px;
  border-bottom: 2px solid #c5cae9;
}
.statement-table .stmt-text-col { width: 55%; }
.statement-table .stmt-answer-col { width: 45%; text-align: center; }
.statement-row td {
  padding: 12px 14px; border-bottom: 1px solid #eee;
  vertical-align: middle; overflow: hidden;
}
.statement-row:last-child td { border-bottom: none; }
.stmt-select {
  padding: 8px 12px; border: 2px solid #c5cae9; border-radius: 6px;
  font-size: 14px; font-weight: 600; color: #1a237e;
  background: #fff; cursor: pointer;
  width: 100%; max-width: 100%; box-sizing: border-box;
  appearance: auto; overflow: hidden; text-overflow: ellipsis;
}
.stmt-select:focus { border-color: #1a237e; outline: none; box-shadow: 0 0 0 3px rgba(26,35,126,.12); }
.stmt-select option { font-weight: 500; }

/* Yes/No radio columns (Microsoft exam style) */
.yn-table .stmt-text-col { width: auto; }
.yn-col {
  width: 60px; text-align: center; vertical-align: middle;
}
.yn-col-header {
  width: 60px; text-align: center; font-size: 13px; font-weight: 700;
  color: #1a237e; padding: 10px 8px;
  border-bottom: 2px solid #c5cae9;
}
.yn-radio {
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; margin: 0; padding: 4px;
}
.yn-radio input[type="radio"] {
  position: absolute; opacity: 0; width: 0; height: 0;
}
.yn-circle {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid #94a3b8; background: #fff;
  transition: all 0.15s ease;
  position: relative;
}
.yn-circle:hover { border-color: #1a237e; }
.yn-circle.checked {
  border-color: #1a237e; background: #fff;
}
.yn-circle.checked::after {
  content: ''; position: absolute;
  top: 4px; left: 4px; width: 10px; height: 10px;
  border-radius: 50%; background: #1a237e;
}

/* Statement feedback (practice/review) */
.statement-row.correct { background: #e8f5e9; }
.statement-row.correct td { border-bottom-color: #c8e6c9; }
.statement-row.incorrect { background: #ffebee; }
.statement-row.incorrect td { border-bottom-color: #ffcdd2; }
.stmt-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%;
  font-size: 14px; font-weight: 700; flex-shrink: 0;
  vertical-align: middle; margin-left: 8px;
}
.stmt-icon.correct { background: #c8e6c9; color: #2e7d32; }
.stmt-icon.incorrect { background: #ffcdd2; color: #c62828; }
.stmt-answer-display {
  font-weight: 600; color: #333; margin-right: 8px;
}
.stmt-correct-answer {
  display: block; font-size: 12px; color: #2e7d32; font-weight: 600; margin-top: 2px;
}

/* Review-mode statement table tweaks */
.review-stmt-table {
  margin-bottom: 12px;
}
.review-stmt-table thead th {
  font-size: 11px; padding: 8px 12px;
}
.review-stmt-table .statement-row td {
  padding: 10px 12px; font-size: 13px;
}

/* ── Order List (drag-and-drop via buttons) ──────────────── */
.order-list {
  display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px;
}
.order-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border: 2px solid #e0e0e0; border-radius: 8px;
  background: #fff; transition: all .15s;
}
.order-item:hover { border-color: #90a4ae; }
.order-num {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: #e8eaf6; color: #1a237e;
  font-weight: 800; font-size: 14px; flex-shrink: 0;
}
.order-text {
  flex: 1; font-size: 14px; line-height: 1.5; color: #333;
}
.order-btns {
  display: flex; flex-direction: column; gap: 2px; flex-shrink: 0;
}
.order-btn {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 22px; border: 1px solid #ccc;
  border-radius: 4px; background: #f5f5f5; cursor: pointer;
  font-size: 10px; color: #555; transition: all .15s;
  padding: 0; line-height: 1;
}
.order-btn:hover:not([disabled]) { background: #e0e0e0; border-color: #999; color: #1a237e; }
.order-btn[disabled] { opacity: .3; cursor: default; }
.order-icon {
  margin-left: auto; flex-shrink: 0; font-size: 18px; font-weight: 700;
}
.order-icon.correct { color: #2e7d32; }
.order-icon.wrong { color: #c62828; }

/* Order position feedback */
.order-item.correct-position {
  border-color: #66bb6a; background: #e8f5e9;
}
.order-item.correct-position .order-num { background: #c8e6c9; color: #2e7d32; }
.order-item.wrong-position {
  border-color: #ef5350; background: #ffebee;
}
.order-item.wrong-position .order-num { background: #ffcdd2; color: #c62828; }

/* Correct order reference block */
.order-correct-wrap {
  margin-top: 16px; padding: 12px 16px;
  background: #f1f8e9; border: 1px solid #c8e6c9; border-radius: 8px;
}
.order-correct-label {
  font-weight: 700; font-size: 13px; color: #2e7d32;
  margin-bottom: 8px; text-transform: uppercase; letter-spacing: .5px;
}
.order-correct-wrap .order-list { margin-bottom: 0; }
.order-correct-wrap .order-item {
  border-color: #c8e6c9; background: #fff; padding: 8px 14px;
}

/* Order review comparison (results/history) */
.order-review-comparison {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  margin-bottom: 12px;
}
.order-review-col-title {
  font-weight: 700; font-size: 12px; text-transform: uppercase;
  letter-spacing: .5px; color: #666; margin-bottom: 8px;
}
.order-review-col .order-item {
  padding: 8px 12px; margin-bottom: 4px;
}
.order-review-col .order-num {
  width: 24px; height: 24px; font-size: 12px;
}
.order-review-col .order-text { font-size: 13px; }

@media (max-width: 640px) {
  .order-review-comparison { grid-template-columns: 1fr; }
  .statement-table .stmt-text-col { width: auto; }
  .statement-table .stmt-answer-col { width: auto; }
}

/* ── Report Question Button ───────────────────────────────── */
.btn-report-question {
  background: none; border: none; cursor: pointer;
  color: #999; font-size: 12px; padding: 6px 0; margin-top: 8px;
  display: inline-flex; align-items: center; gap: 4px;
  transition: color .15s;
}
.btn-report-question::before { content: '\26A0'; font-size: 13px; }
.btn-report-question:hover { color: #e65100; }
.report-options { text-align: left; }
.report-radio {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 0; font-size: 14px; color: #333; cursor: pointer;
}
.report-radio input[type="radio"] {
  accent-color: #1a237e; width: 16px; height: 16px; cursor: pointer;
}

/* ── Online Status Badges ─────────────────────────────────── */
.online-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 600; padding: 2px 8px;
  border-radius: 10px; white-space: nowrap;
}
.online-badge::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  display: inline-block; flex-shrink: 0;
}
.online-badge.online { background: #e8f5e9; color: #2e7d32; }
.online-badge.online::before { background: #4caf50; }
.online-badge.away { background: #fff8e1; color: #e65100; }
.online-badge.away::before { background: #ff9800; }
.online-badge.offline { background: #f5f5f5; color: #999; }
.online-badge.offline::before { background: #ccc; }

/* ── Modal ────────────────────────────────────────────────── */
.modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5);
  z-index: 200; align-items: center; justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal {
  background: #fff; border-radius: 12px; padding: 32px;
  max-width: 440px; width: 90%; box-shadow: 0 20px 60px rgba(0,0,0,.2);
  text-align: center;
}
.modal h3 { color: #1a237e; margin-bottom: 12px; }
.modal p { color: #666; margin-bottom: 24px; font-size: 14px; line-height: 1.5; }
.modal-actions { display: flex; gap: 12px; justify-content: center; }

/* ── Legal Modals ────────────────────────────────────────── */
.legal-modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5);
  z-index: 250; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .2s;
}
.legal-modal-overlay.active { display: flex; opacity: 1; }
.legal-modal {
  background: #fff; border-radius: 12px; width: 90%; max-width: 600px;
  max-height: 80vh; display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.legal-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 24px 28px 0; flex-shrink: 0;
}
.legal-modal-header h3 { margin: 0; color: #1a237e; font-size: 20px; }
.legal-modal-close {
  background: none; border: none; font-size: 24px; color: #999;
  cursor: pointer; padding: 0 4px; line-height: 1;
}
.legal-modal-close:hover { color: #333; }
.legal-modal-meta {
  padding: 6px 28px 0; font-size: 12px; color: #999; flex-shrink: 0;
}
.legal-modal-body {
  padding: 20px 28px; overflow-y: auto; flex: 1;
  font-size: 14px; color: #444; line-height: 1.7;
}
.legal-modal-body h4 {
  margin: 20px 0 8px; color: #1a1a2e; font-size: 15px; font-weight: 600;
}
.legal-modal-body h4:first-child { margin-top: 0; }
.legal-modal-body p { margin: 0 0 12px; }
.legal-modal-body ul { margin: 0 0 12px; padding-left: 20px; }
.legal-modal-body li { margin-bottom: 6px; }
.legal-modal-body a { color: #1a237e; text-decoration: none; }
.legal-modal-body a:hover { text-decoration: underline; }
.legal-modal-footer {
  padding: 16px 28px 24px; text-align: center; flex-shrink: 0;
  border-top: 1px solid #eee;
}
.legal-modal-ok {
  padding: 10px 32px; font-size: 14px; border-radius: 6px;
}

/* ── Toast Notification ──────────────────────────────────── */
.toast-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 300;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex; align-items: center; gap: 10px;
  padding: 14px 20px; border-radius: 10px;
  font-size: 14px; font-weight: 500; line-height: 1.4;
  box-shadow: 0 8px 32px rgba(0,0,0,.15);
  transform: translateX(120%); opacity: 0;
  transition: transform .35s cubic-bezier(.22,1,.36,1), opacity .35s ease;
  max-width: 380px;
}
.toast.visible { transform: translateX(0); opacity: 1; }
.toast.hiding { transform: translateX(120%); opacity: 0; }
.toast-icon { font-size: 18px; flex-shrink: 0; }
.toast-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.toast-error { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.toast-info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }

/* ── Report modal inline validation ──────────────────────── */
.report-validation {
  display: none; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: #dc2626;
  margin-top: 8px;
}
.report-validation.visible { display: flex; }
.report-validation-icon { font-size: 15px; }

/* Reason badges for admin reports table */
.reason-badge {
  display: inline-block; padding: 3px 10px; border-radius: 10px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px;
  white-space: nowrap;
}
.reason-wrong_answer { background: #ffebee; color: #c62828; }
.reason-unclear { background: #fff3e0; color: #e65100; }
.reason-outdated { background: #e8eaf6; color: #283593; }
.reason-typo { background: #e0f2f1; color: #00695c; }
.reason-other { background: #f5f5f5; color: #616161; }

/* Report row expand arrow + question preview */
.report-expand-icon {
  display: inline-block; font-size: 11px; color: #999;
  transition: transform .2s ease; width: 16px; text-align: center;
}
.report-row-clickable:hover { background: #f8f9ff; }
.report-question-preview { background: #f8f9fc; border-top: 1px solid #e8e8e8; }
.rqp-inner { padding: 20px 24px; }
.rqp-meta { font-size: 12px; color: #64748b; margin-bottom: 10px; }
.rqp-question {
  font-size: 14px; color: #1a1a2e; line-height: 1.6;
  margin-bottom: 14px; white-space: pre-wrap;
}
.rqp-options { margin-bottom: 14px; }
.rqp-option {
  padding: 6px 12px; margin-bottom: 4px; border-radius: 6px;
  font-size: 13px; color: #333; background: #fff;
  border: 1px solid #eee; line-height: 1.5;
}
.rqp-option.rqp-correct {
  background: #f0fdf4; border-color: #bbf7d0; color: #166534; font-weight: 600;
}
.rqp-key { font-weight: 700; color: #1a237e; }
.rqp-check { color: #2e7d32; font-weight: 700; }
.rqp-explanation {
  font-size: 13px; color: #475569; line-height: 1.6;
  padding: 12px 16px; background: #fffbeb; border: 1px solid #fef3c7;
  border-radius: 8px; white-space: pre-wrap;
}
.report-user-link {
  color: #1a237e; text-decoration: underline; cursor: pointer; font-weight: 600;
}
.report-user-link:hover { color: #3949ab; }

/* ── Leaderboard List ──────────────────────────────────────── */
.leaderboard-list { display: flex; flex-direction: column; gap: 4px; }
.leaderboard-item {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 0; border-bottom: 1px solid #f0f0f0;
}
.leaderboard-item:last-child { border-bottom: none; }
.leaderboard-rank {
  width: 22px; height: 22px; border-radius: 50%;
  background: #e8eaf6; color: #1a237e; font-size: 11px;
  font-weight: 700; display: flex; align-items: center;
  justify-content: center; flex-shrink: 0;
}
.leaderboard-item:nth-child(1) .leaderboard-rank { background: #fff3e0; color: #e65100; }
.leaderboard-item:nth-child(2) .leaderboard-rank { background: #e8eaf6; color: #1a237e; }
.leaderboard-item:nth-child(3) .leaderboard-rank { background: #f3e5f5; color: #6a1b9a; }
.leaderboard-name {
  flex: 1; font-size: 13px; font-weight: 500; color: #333;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.leaderboard-value { font-size: 13px; font-weight: 700; color: #1a237e; white-space: nowrap; }

/* ── Sortable Table Headers ────────────────────────────────── */
.data-table-sortable th[data-sort] { cursor: pointer; user-select: none; }
.data-table-sortable th[data-sort]:hover { background: #eef0f6; color: #1a237e; }
.domain-breakdown-row td { padding: 0 !important; border-bottom: 2px solid #e8eaf6; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1024px) {
  .grid-2col { grid-template-columns: 1fr; }
  .exam-grid { grid-template-columns: repeat(2, 1fr); }
  #et-leaderboards { grid-template-columns: 1fr !important; }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-240px); }
  .sidebar.mobile-open { transform: translateX(0); }
  .app-main { margin-left: 0; }
  .topbar { left: 0; }
  .topbar-hamburger { display: block; }
  .page-container { padding: 20px 16px; }
  .exam-main { padding: 20px 16px 80px; }
  .bottom-nav { padding: 10px 16px; }
  .exam-header { padding: 0 12px; }
  .review-container { margin: 72px 12px 20px; padding: 20px; }
  .results-container { margin: 72px auto 20px; }
  .auth-brand { display: none; }
  .auth-form-side { flex: 1; padding: 48px 32px; }
  .auth-logo { display: flex; }
  .auth-logo-sm { display: flex; }
  .auth-card h1, .auth-card .subtitle { text-align: center; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .exam-grid { grid-template-columns: 1fr; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .data-table { font-size: 13px; }
  .data-table th, .data-table td { padding: 10px 12px; }
  .domain-bar-label { min-width: 120px; font-size: 12px; }
}

@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 16px 12px; }
  .stat-card .stat-value { font-size: 22px; }
  .auth-form-side { padding: 32px 20px; }
  .page-header h1 { font-size: 18px; }
}

/* Hide preview card on short viewports (laptops, small screens) */
@media (max-height: 750px) {
  .auth-brand-preview { display: none; }
}
@media (max-height: 900px) {
  .auth-brand-preview { margin-top: 24px; padding: 14px; }
  .auth-brand-preview .preview-stats { gap: 6px; margin-bottom: 10px; }
  .auth-brand-preview .preview-stat-card { padding: 8px 6px; }
  .auth-brand-preview .preview-stat-value { font-size: 16px; }
}

/* ── Pricing Page ───────────────────────────────────────────── */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
}
.pricing-card {
  background: #fff;
  border-radius: 14px;
  padding: 28px 22px;
  box-shadow: 0 2px 16px rgba(0,0,0,.06);
  display: flex;
  flex-direction: column;
  position: relative;
  border: 2px solid transparent;
  transition: border-color .2s, box-shadow .2s;
}
.pricing-card:hover {
  box-shadow: 0 6px 24px rgba(0,0,0,.1);
}
.pricing-card.popular {
  border-color: #1a237e;
  box-shadow: 0 4px 24px rgba(26,35,126,.15);
}
.pricing-card.current {
  border-color: #2e7d32;
  box-shadow: 0 4px 24px rgba(46,125,50,.12);
}
.pricing-popular-tag {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: #1a237e; color: #fff; font-size: 11px; font-weight: 700;
  padding: 3px 14px; border-radius: 20px; text-transform: uppercase;
  letter-spacing: .5px; white-space: nowrap;
}
.pricing-current-tag {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: #2e7d32; color: #fff; font-size: 11px; font-weight: 700;
  padding: 3px 14px; border-radius: 20px; text-transform: uppercase;
  letter-spacing: .5px; white-space: nowrap;
}
.pricing-card h3 {
  font-size: 20px; color: #1a237e; margin-bottom: 8px;
}
.pricing-price {
  font-size: 32px; font-weight: 800; color: #1a1a2e; margin-bottom: 4px;
}
.price-period {
  font-size: 14px; font-weight: 500; color: #888;
}
.pricing-savings {
  font-size: 12px; font-weight: 600; color: #2e7d32;
  margin-bottom: 8px;
}
.pricing-current-access {
  font-size: 12px; font-weight: 600; color: #1a237e;
  margin-bottom: 4px; text-align: center;
}
.pricing-grandfathered {
  background: #e8f5e9; color: #2e7d32; font-size: 12px; font-weight: 600;
  padding: 6px 12px; border-radius: 8px; margin-bottom: 12px;
  text-align: center;
}
.pricing-desc {
  color: #666; font-size: 13px; line-height: 1.5; margin-bottom: 16px;
  min-height: 40px;
}
.pricing-features {
  list-style: none; padding: 0; margin: 0 0 24px;
  flex: 1;
}
.pricing-features li {
  padding: 5px 0 5px 22px;
  font-size: 13px; color: #444;
  position: relative; line-height: 1.4;
}
.pricing-features li::before {
  content: '\2713';
  position: absolute; left: 0; color: #2e7d32; font-weight: 700;
}
.pricing-action {
  text-align: center;
}
.pricing-action .btn { min-width: 130px; }
.pricing-trust-line { text-align: center; font-size: 12px; color: #64748b; margin-top: 16px; }

/* ── Alerts ─────────────────────────────────────────────────── */
.alert {
  padding: 14px 20px; border-radius: 10px; font-size: 14px;
  margin-bottom: 20px; line-height: 1.5;
}
.alert-success {
  background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9;
}
.alert-warning {
  background: #fff3e0; color: #e65100; border: 1px solid #ffe0b2;
}

/* ── Badge default (gray) ───────────────────────────────────── */
.badge-default {
  background: #e0e0e0; color: #555;
}
/* ── Event severity badges ─────────────────────────────────── */
.badge-evt-blue { background: #e3f2fd; color: #1565c0; }
.badge-evt-green { background: #e8f5e9; color: #2e7d32; }
.badge-evt-indigo { background: #e8eaf6; color: #283593; }
.badge-evt-purple { background: #f3e5f5; color: #6a1b9a; }
.badge-evt-orange { background: #fff3e0; color: #e65100; }

/* ── Plan badge in sidebar ──────────────────────────────────── */
.sidebar-plan-badge {
  display: inline-block; background: linear-gradient(135deg, #ff6f00, #ff8f00);
  color: #fff; font-size: 9px; font-weight: 700; padding: 1px 6px;
  border-radius: 4px; text-transform: uppercase; letter-spacing: .5px;
  margin-left: 6px; vertical-align: middle;
}

/* ── Dashboard plan banner ──────────────────────────────────── */
.plan-banner {
  background: linear-gradient(135deg, #e8eaf6, #c5cae9);
  border-radius: 12px; padding: 16px 20px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 20px;
}
.plan-banner-text { font-size: 14px; color: #1a237e; }
.plan-banner-text strong { font-weight: 700; }

/* ── Locked feature overlay ─────────────────────────────────── */
.feature-locked {
  position: relative; pointer-events: none; opacity: .5;
}
.feature-locked::after {
  content: 'Pro Feature'; position: absolute; top: 50%; left: 50%;
  transform: translate(-50%,-50%); background: rgba(26,35,126,.9);
  color: #fff; padding: 6px 16px; border-radius: 6px;
  font-size: 12px; font-weight: 600;
}

/* ── Action dropdown menu ──────────────────────────────────── */
.action-menu {
  position: relative; display: inline-block;
}
.action-menu-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; font-size: 12px; font-weight: 600;
  background: #f5f5f5; color: #333; border: 1px solid #ddd;
  border-radius: 6px; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s;
}
.action-menu-btn:hover { background: #e8e8e8; border-color: #ccc; }
.action-menu-btn::after {
  content: ''; display: inline-block; width: 0; height: 0;
  border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 4px solid #666; margin-left: 2px;
}
.action-menu-items {
  display: none; position: absolute; right: 0; top: calc(100% + 4px);
  background: #fff; border: 1px solid #e0e0e0; border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.12); min-width: 160px;
  z-index: 50; padding: 4px 0; overflow: hidden;
}
.action-menu.open .action-menu-items { display: block; }
.action-menu-item {
  display: block; width: 100%; padding: 8px 14px;
  font-size: 13px; color: #333; background: none; border: none;
  text-align: left; cursor: pointer; white-space: nowrap;
  transition: background .1s;
}
.action-menu-item:hover { background: #f5f5f5; }
.action-menu-item.action-danger { color: #c62828; }
.action-menu-item.action-danger:hover { background: #fbe9e7; }
.action-menu-item[disabled] {
  color: #bbb; cursor: default; pointer-events: none;
}
.action-menu-sep { height: 1px; background: #eee; margin: 4px 0; }

@media (max-width: 1100px) {
  .pricing-grid { grid-template-columns: repeat(2, 1fr); max-width: 640px; }
}
@media (max-width: 640px) {
  .pricing-grid { grid-template-columns: 1fr; max-width: 380px; }
  .plan-banner { flex-direction: column; text-align: center; }
}

/* ── Profile page ────────────────────────────── */
.profile-display-value { padding: 8px 0; font-size: 14px; line-height: 1.5; }
.profile-plan-detail { font-size: 12px; color: #64748b; margin-left: 6px; }
.profile-plan-expiry { font-size: 12px; color: #94a3b8; margin-top: 4px; }

.security-info { display: flex; flex-direction: column; gap: 0; }
.security-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid #f1f5f9; }
.security-row:last-child { border-bottom: none; }
.security-label { font-size: 13px; color: #64748b; }
.security-value { font-size: 13px; color: #1e293b; font-weight: 500; }

.password-input-wrap { position: relative; display: flex; align-items: center; }
.password-input-wrap .form-input { padding-right: 44px; }
.pw-toggle {
  position: absolute; right: 10px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none; padding: 4px;
  color: #94a3b8; cursor: pointer; display: flex; align-items: center;
}
.pw-toggle:hover { color: #475569; }
.pw-toggle svg { width: 18px; height: 18px; }

.security-value-group { text-align: right; }
.security-value-warn { font-size: 13px; color: #b45309; font-weight: 500; }
.security-hint { font-size: 11px; color: #b45309; margin-top: 2px; }

.security-row-wrap { flex-wrap: wrap; }
.security-row-wrap .security-hint { width: 100%; text-align: right; }
.security-action { display: flex; align-items: center; gap: 8px; }
.security-action .badge { font-size: 11px; }
.btn-link {
  background: none; border: none; color: #1565c0; font-size: 13px;
  cursor: pointer; padding: 0; font-weight: 500;
}
.btn-link:hover { text-decoration: underline; }

/* ── Bookmark Button ─────────────────────────────────────── */
.review-q-actions {
  display: flex; align-items: center; gap: 16px; margin-top: 12px;
}
.btn-bookmark-question {
  background: none; border: 1px solid #cbd5e1; border-radius: 6px;
  cursor: pointer; color: #64748b; font-size: 12px; padding: 5px 12px;
  display: inline-flex; align-items: center; gap: 4px;
  transition: all .15s;
}
.btn-bookmark-question::before { content: '\2606'; font-size: 15px; }
.btn-bookmark-question:hover { border-color: #f59e0b; color: #d97706; }
.btn-bookmark-question.bookmarked {
  background: #fffbeb; border-color: #f59e0b; color: #d97706; font-weight: 600;
}
.btn-bookmark-question.bookmarked::before { content: '\2605'; }

/* ── Domain Readiness Enhancements ───────────────────────── */
.domain-bar-fill { overflow: hidden; border-radius: 4px; }
#domain-section .section-body { padding: 12px 20px 14px; }

/* ── Bookmarks Page ──────────────────────────────────────── */
.bookmarks-controls {
  display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap;
}
.bookmarks-exam-select {
  min-width: 280px; max-width: 420px; flex: 1;
  height: 38px; font-size: 14px;
}
.bookmarks-exam-label {
  font-size: 14px; font-weight: 600; color: #1e293b;
  padding: 0 2px; white-space: nowrap;
}
.bookmark-limit-info {
  font-size: 12px; color: #64748b; background: #f8fafc;
  padding: 4px 10px; border-radius: 6px; border: 1px solid #e2e8f0;
}
.bookmark-card {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
  padding: 16px 20px; margin-bottom: 12px;
}
.bookmark-card-header {
  display: flex; align-items: center; gap: 12px; margin-bottom: 8px;
}
.bookmark-q-num { font-weight: 700; color: #1a237e; font-size: 13px; }
.bookmark-q-domain { font-size: 12px; color: #64748b; flex: 1; }
.btn-remove-bookmark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 6px;
  background: none; border: 1px solid transparent; cursor: pointer;
  color: #94a3b8; padding: 0;
  transition: all .15s;
}
.btn-remove-bookmark:hover {
  color: #ef5350; background: #fef2f2; border-color: #fecaca;
}
.bookmark-q-text { font-size: 14px; color: #1e293b; line-height: 1.5; margin-bottom: 10px; }
.bookmark-options, .bookmark-statements { margin-bottom: 8px; }
.bookmark-option, .bookmark-statement {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 10px; border-radius: 6px; font-size: 13px; color: #475569;
  margin-bottom: 3px; background: #f8fafc;
}
.bookmark-option.correct { background: #e8f5e9; color: #2e7d32; font-weight: 500; }
.bookmark-explanation {
  font-size: 13px; color: #475569; line-height: 1.5;
  background: #f8fafc; border-radius: 6px; padding: 10px 12px; margin-top: 8px;
}
.bookmark-order { margin-bottom: 8px; }
