/* ============================================================
   CATS Question Trainer – Main Stylesheet
   Design: Clean aviation-professional, light, mobile-first
   Font: DM Sans + DM Mono
   ============================================================ */

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  --primary:        #1a73e8;
  --primary-dark:   #1557b0;
  --primary-light:  #e8f0fe;
  --success:        #1e8a4a;
  --success-light:  #e6f4ea;
  --danger:         #c0392b;
  --danger-light:   #fde8e6;
  --warning:        #e67e22;
  --warning-light:  #fef3e2;

  --gray-50:   #f8f9fa;
  --gray-100:  #f1f3f5;
  --gray-200:  #e9ecef;
  --gray-300:  #dee2e6;
  --gray-400:  #ced4da;
  --gray-500:  #adb5bd;
  --gray-600:  #6c757d;
  --gray-700:  #495057;
  --gray-800:  #343a40;
  --gray-900:  #212529;

  --text:        #1a1d23;
  --text-muted:  #6c757d;
  --text-light:  #adb5bd;

  --border:      #e2e6ea;
  --border-dark: #ced4da;

  --bg:          #ffffff;
  --bg-subtle:   #f8f9fa;
  --bg-card:     #ffffff;

  --radius-sm:   6px;
  --radius:      10px;
  --radius-lg:   16px;
  --radius-xl:   24px;

  --shadow-sm:   0 1px 3px rgba(0,0,0,.08);
  --shadow:      0 2px 8px rgba(0,0,0,.10);
  --shadow-lg:   0 8px 24px rgba(0,0,0,.12);

  --nav-height:  60px;
  --font:        'DM Sans', -apple-system, sans-serif;
  --font-mono:   'DM Mono', 'Fira Mono', monospace;
  --transition:  .18s ease;
}

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

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg-subtle);
  min-height: 100vh;
}

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

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

/* ── Top Navigation ─────────────────────────────────────────── */
.topnav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  height: var(--nav-height);
}

.topnav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 32px;
}

.topnav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-icon {
  font-size: 22px;
  line-height: 1;
}

.brand-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.3px;
}

.topnav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.nav-link {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}

.nav-link:hover {
  background: var(--gray-100);
  color: var(--text);
  text-decoration: none;
}

.nav-link.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.topnav-user {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.user-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
}

.btn-logout {
  font-size: 13px;
  color: var(--text-muted);
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all var(--transition);
}

.btn-logout:hover {
  background: var(--gray-100);
  color: var(--text);
  text-decoration: none;
}

/* Mobile menu button */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  margin-left: auto;
}

.mobile-menu-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all var(--transition);
}

.mobile-menu {
  display: none;
  flex-direction: column;
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 8px 0;
}

.mobile-nav-link {
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--gray-100);
}

.mobile-nav-link:last-child { border-bottom: none; }

body.menu-open .mobile-menu { display: flex; }

/* ── Flash messages ─────────────────────────────────────────── */
.flash {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 500;
}

.flash button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  opacity: .6;
}

.flash-success { background: var(--success-light); color: var(--success); }
.flash-error   { background: var(--danger-light);  color: var(--danger); }

/* ── Main Content ───────────────────────────────────────────── */
.main-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 24px 48px;
}

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

.page-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.4px;
  line-height: 1.3;
}

.page-subtitle {
  font-size: 15px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
  white-space: nowrap;
}

.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 4px 12px rgba(26,115,232,.3);
  text-decoration: none;
  color: #fff;
  transform: translateY(-1px);
}

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

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-secondary:hover {
  background: var(--gray-50);
  border-color: var(--gray-500);
  text-decoration: none;
  color: var(--text);
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  background: var(--danger);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition);
}

.btn-danger:hover { background: #a93226; color: #fff; text-decoration: none; }

.btn-full { width: 100%; justify-content: center; }
.btn-sm   { padding: 6px 14px; font-size: 13px; }

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: .5px;
  font-size: 11px;
  color: var(--text-muted);
}

/* ── Stats Grid ─────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: box-shadow var(--transition);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px; height: 100%;
  background: var(--primary);
}

.stat-card:hover { box-shadow: var(--shadow); }

.stat-icon { font-size: 22px; margin-bottom: 10px; }

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.5px;
  line-height: 1.2;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
}

/* ── Section ────────────────────────────────────────────────── */
.section { margin-bottom: 32px; }

.section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
  letter-spacing: -.2px;
}

/* ── License Type Grid ──────────────────────────────────────── */
.license-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.license-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  font-size: 14px;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}

.license-card:hover {
  border-color: var(--lt-color, var(--primary));
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
  transform: translateY(-2px);
  text-decoration: none;
  color: var(--text);
}

.license-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.license-label { flex: 1; }
.license-arrow { color: var(--text-light); font-size: 16px; }

/* ── Tables ─────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  font-size: 14px;
}

.data-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-muted);
  background: var(--gray-50);
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--text);
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--gray-50); }

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .3px;
}

.badge-active   { background: var(--success-light); color: var(--success); }
.badge-finished { background: var(--primary-light);  color: var(--primary); }
.badge-paused   { background: var(--warning-light);  color: var(--warning); }
.badge-expired  { background: var(--gray-100);        color: var(--text-muted); }

.score { font-weight: 700; font-size: 14px; }
.score-pass { color: var(--success); }
.score-fail { color: var(--danger); }

/* ── Forms ──────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-dark);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,115,232,.15);
}

.form-input::placeholder { color: var(--text-light); }
.form-textarea { resize: vertical; min-height: 100px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 5px;
}

/* ── Empty State ────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 64px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.empty-state p  { color: var(--text-muted); margin-bottom: 20px; }

/* ── Site Footer ────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg);
  padding: 16px 24px;
  margin-top: auto;
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Login Page ─────────────────────────────────────────────── */
.login-body {
  background: var(--bg-subtle);
  min-height: 100vh;
  display: flex;
  align-items: stretch;
}

.login-wrap {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

.login-panel-left {
  flex: 1;
  background: var(--primary);
  background: linear-gradient(145deg, #1a73e8 0%, #0d47a1 100%);
  color: #fff;
  padding: 60px 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 32px;
}

.login-brand-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.login-brand-name {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -.5px;
}

.login-brand-sub {
  font-size: 15px;
  opacity: .75;
  margin-top: 4px;
}

.login-tagline p {
  font-size: 16px;
  line-height: 1.7;
  opacity: .85;
  max-width: 380px;
}

.login-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.login-badge {
  padding: 5px 14px;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .5px;
  color: rgba(255,255,255,.9);
}

.login-panel-right {
  width: 480px;
  flex-shrink: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
}

.login-form-wrap { width: 100%; max-width: 360px; }

.login-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.4px;
  margin-bottom: 6px;
}

.login-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.login-error {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid rgba(192,57,43,.2);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 20px;
}

.login-form { display: flex; flex-direction: column; gap: 4px; }

.login-form .btn-primary {
  margin-top: 8px;
  padding: 13px;
  font-size: 15px;
}

.login-footer-note {
  margin-top: 24px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.6;
}

/* ── Question Trainer UI ────────────────────────────────────── */
.trainer-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 20px;
  align-items: start;
}

.question-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.question-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--gray-50);
}

.question-counter {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.question-no {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-light);
  margin-left: auto;
}

.question-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.question-tab {
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  cursor: pointer;
  font-family: var(--font);
  transition: all var(--transition);
  margin-bottom: -1px;
}

.question-tab:hover { color: var(--text); }
.question-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.tab-content { display: none; padding: 24px; }
.tab-content.active { display: block; }

.question-text {
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.65;
  margin-bottom: 24px;
}

.answers { display: flex; flex-direction: column; gap: 10px; }

.answer-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 18px;
  border: 1.5px solid var(--border-dark);
  border-radius: var(--radius);
  background: var(--bg);
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: all var(--transition);
}

.answer-btn:hover:not([disabled]) {
  border-color: var(--primary);
  background: var(--primary-light);
}

.answer-letter {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--gray-100);
  border: 1.5px solid var(--border-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
  transition: all var(--transition);
}

.answer-btn.correct {
  border-color: var(--success) !important;
  background: var(--success-light) !important;
  color: var(--success);
}

.answer-btn.correct .answer-letter {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.answer-btn.wrong {
  border-color: var(--danger) !important;
  background: var(--danger-light) !important;
  color: var(--danger);
}

.answer-btn.wrong .answer-letter {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.answer-btn.reveal {
  border-color: var(--success) !important;
  background: var(--success-light) !important;
}

.answer-btn.reveal .answer-letter {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

/* Question navigation grid (right panel) */
.question-nav-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: calc(var(--nav-height) + 20px);
}

.nav-panel-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.question-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 5px;
}

.q-dot {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--gray-50);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

.q-dot:hover     { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }
.q-dot.current   { background: var(--primary); color: #fff; border-color: var(--primary); }
.q-dot.answered  { background: var(--gray-200); color: var(--text-muted); }
.q-dot.correct   { background: var(--success-light); color: var(--success); border-color: var(--success); }
.q-dot.wrong     { background: var(--danger-light);  color: var(--danger);  border-color: var(--danger); }

/* Exam timer */
.exam-timer {
  text-align: center;
  padding: 12px;
  background: var(--gray-50);
  border-radius: var(--radius);
  margin-bottom: 16px;
  border: 1px solid var(--border);
}

.timer-value {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 2px;
}

.timer-value.warn { color: var(--danger); animation: pulse 1s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .5; } }

.timer-label { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* Flag buttons */
.question-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  background: var(--gray-50);
}

.flag-group { display: flex; gap: 6px; }

.flag-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--border-dark);
  background: var(--bg);
  cursor: pointer;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  title: attr(title);
}

.flag-btn:hover  { transform: scale(1.15); border-color: var(--primary); }
.flag-btn.active { border-color: var(--primary); background: var(--primary-light); }

.nav-buttons { display: flex; gap: 8px; }

/* ── Admin UI ────────────────────────────────────────────────── */
.admin-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.admin-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
  color: var(--text);
  transition: all var(--transition);
}

.admin-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--primary);
  transform: translateY(-2px);
  text-decoration: none;
  color: var(--text);
}

.admin-card-icon {
  font-size: 32px;
  flex-shrink: 0;
}

.admin-card-value {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.5px;
  color: var(--text);
}

.admin-card-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Search bar */
.search-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.search-bar .form-input { max-width: 320px; }

/* Annex image */
.annex-wrap {
  margin: 16px 0;
  background: var(--gray-50);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  text-align: center;
  position: relative;
}

.annex-label {
  position: absolute;
  top: -10px;
  left: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.annex-wrap img { max-height: 300px; border-radius: var(--radius-sm); }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .trainer-layout { grid-template-columns: 1fr; }
  .question-nav-panel { position: static; }
  .question-grid { grid-template-columns: repeat(8, 1fr); }
  .admin-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .main-content { padding: 20px 16px 40px; }
  .topnav-links, .topnav-user { display: none; }
  .mobile-menu-btn { display: flex; }
  .topnav { height: var(--nav-height); }
  .login-panel-left { display: none; }
  .login-panel-right { width: 100%; padding: 40px 24px; }
  .page-header { flex-direction: column; align-items: stretch; }
  .page-header .btn-primary { text-align: center; justify-content: center; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .admin-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .question-grid { grid-template-columns: repeat(6, 1fr); }
  .stat-value { font-size: 22px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .admin-grid { grid-template-columns: 1fr; }
  .license-grid { grid-template-columns: 1fr; }
}
