/* =========================================================
   AI Quiz Tech — Responsive & Accessible Stylesheet
   Breakpoints:  Mobile <768 | Tablet 768-991 | Laptop 992-1199 | Desktop 1200+
   ========================================================= */

/* ---------- 1. Design Tokens ---------- */
:root {
  --primary:       #4f46e5;
  --primary-dark:  #3730a3;
  --primary-light: #ede9fe;
  --secondary:     #06b6d4;
  --success:       #16a34a;
  --warning:       #f59e0b;
  --danger:        #dc2626;
  --dark:          #0f172a;
  --muted:         #64748b;
  --light:         #f8fafc;
  --card:          #ffffff;
  --border:        #e2e8f0;
  --shadow-sm:     0 2px 8px  rgba(15,23,42,.07);
  --shadow:        0 8px 32px rgba(15,23,42,.10);
  --shadow-lg:     0 18px 48px rgba(15,23,42,.13);
  --radius-sm:     10px;
  --radius:        18px;
  --radius-lg:     24px;
  --sidebar-w:     268px;
  --sidebar-mini:  72px;
  --topbar-h:      64px;
  --transition:    .22s ease;
  --focus-ring:    0 0 0 3px rgba(79,70,229,.45);
}

/* ---------- 2. Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: #1e293b;
  background: linear-gradient(180deg, #f8fbff 0%, #eef4ff 42%, #f8fafc 100%);
  min-height: 100vh;
  line-height: 1.6;
}
a { text-decoration: none; color: var(--primary); }
a:hover { text-decoration: underline; }
img, svg { max-width: 100%; height: auto; }
ul { list-style: none; padding: 0; }

/* ---------- 3. Accessibility ---------- */

/* Skip to content link */
.skip-link {
  position: absolute;
  top: -9999px;
  left: 0;
  background: var(--primary);
  color: #fff;
  padding: 10px 18px;
  border-radius: 0 0 var(--radius-sm) 0;
  font-weight: 700;
  font-size: .9rem;
  z-index: 9999;
  transition: top .15s ease;
}
.skip-link:focus {
  top: 0;
  outline: none;
  color: #fff;
  text-decoration: none;
}

/* Visible focus ring for all interactive elements */
:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring) !important;
}
a:focus-visible, button:focus-visible,
input:focus-visible, select:focus-visible,
textarea:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  box-shadow: var(--focus-ring);
}
/* Remove default outline only when :focus-visible is available */
:focus:not(:focus-visible) { outline: none; }

/* Minimum 44×44px touch targets */
button, [role="button"], a.btn,
.btn, .nav-link, .dropdown-item {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.nav-link { min-height: 44px; }

/* Screen-reader only utility */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- 4. Typography ---------- */
h1,h2,h3,h4,h5,h6 { font-weight: 700; color: var(--dark); line-height: 1.25; letter-spacing: -.025em; }
.hero-title    { font-size: clamp(2rem, 5vw, 4.5rem); font-weight: 900; letter-spacing: -.06em; line-height: 1.02; }
.section-title { font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 900; letter-spacing: -.04em; }
.metric-number { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 900; color: var(--dark); }
.text-muted-soft   { color: var(--muted) !important; }
.gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- 5. Utility ---------- */
.bg-soft-primary { background: rgba(79,70,229,.09)  !important; }
.bg-soft-success { background: rgba(22,163,74,.11)  !important; }
.bg-soft-warning { background: rgba(245,158,11,.13) !important; }
.bg-soft-danger  { background: rgba(220,38,38,.11)  !important; }
.bg-soft-info    { background: rgba(6,182,212,.12)  !important; }
.text-primary    { color: var(--primary) !important; }

/* ---------- 6. Public Navbar ---------- */
.app-navbar {
  backdrop-filter: blur(16px);
  background: rgba(255,255,255,.92);
  border-bottom: 1px solid rgba(226,232,240,.9);
  min-height: var(--topbar-h);
}
.app-brand {
  font-weight: 800; color: var(--dark) !important; letter-spacing: -.04em;
  font-size: 1.15rem;
  text-decoration: none !important;
}
.brand-mark {
  width: 38px; height: 38px; border-radius: 13px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.1rem;
  box-shadow: 0 8px 20px rgba(79,70,229,.28);
}
.navbar .nav-link {
  font-weight: 650; color: #334155; border-radius: var(--radius-sm);
  padding: .5rem .9rem; min-height: 44px; display: inline-flex; align-items: center;
}
.navbar .nav-link:hover,
.navbar .nav-link.active { color: var(--primary); background: var(--primary-light); }

/* ---------- 7. Buttons ---------- */
.btn-gradient {
  border: none; color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  box-shadow: 0 8px 20px rgba(79,70,229,.24);
  font-weight: 700; border-radius: 50px;
  padding: .5rem 1.25rem; transition: var(--transition);
}
.btn-gradient:hover, .btn-gradient:focus {
  color: #fff; transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(79,70,229,.34);
}
.btn-gradient:active { transform: translateY(0); }

.btn-outline-gradient {
  border: 2px solid rgba(79,70,229,.3); color: var(--primary);
  background: #fff; font-weight: 700; border-radius: 50px;
  padding: .5rem 1.25rem; transition: var(--transition);
}
.btn-outline-gradient:hover, .btn-outline-gradient:focus {
  background: var(--primary-light); color: var(--primary);
  border-color: var(--primary);
}

/* ---------- 8. Dashboard Layout (Sidebar + Main) ---------- */

/* Sidebar overlay backdrop */
.sidebar-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(15,23,42,.45); z-index: 1030;
  backdrop-filter: blur(2px);
}
.sidebar-backdrop.show { display: block; }

/* Sidebar */
.sidebar {
  position: fixed; top: 0; left: 0; height: 100vh;
  width: var(--sidebar-w); background: #fff;
  border-right: 1px solid var(--border);
  z-index: 1040; padding: 18px 14px;
  overflow-y: auto; overflow-x: hidden;
  display: flex; flex-direction: column;
  transition: transform var(--transition), width var(--transition);
  scrollbar-width: thin; scrollbar-color: #e2e8f0 transparent;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 4px; }

.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; min-height: 44px;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; color: var(--dark) !important;
  font-size: 1.05rem; letter-spacing: -.03em;
  text-decoration: none !important; flex: 1; overflow: hidden;
}
.sidebar-brand-text { white-space: nowrap; overflow: hidden; }

/* Sidebar section label */
.sidebar-label {
  font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: #94a3b8;
  padding: .5rem .5rem .25rem; margin-top: 8px;
  white-space: nowrap; overflow: hidden;
  transition: opacity var(--transition);
}

/* Sidebar nav links */
.sidebar .nav-link {
  border-radius: 13px; color: #475569;
  font-weight: 600; font-size: .9rem;
  padding: .65rem .85rem; margin-bottom: 3px;
  display: flex; align-items: center; gap: .65rem;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap; min-height: 44px;
}
.sidebar .nav-link i {
  font-size: 1.15rem; width: 22px; text-align: center; flex-shrink: 0;
}
.sidebar .nav-link .nav-label { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.sidebar .nav-link:hover { background: var(--primary-light); color: var(--primary); text-decoration: none; }
.sidebar .nav-link.active {
  background: var(--primary-light); color: var(--primary); font-weight: 700;
}
.sidebar .nav-link.active::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 60%; background: var(--primary); border-radius: 0 3px 3px 0;
}
.sidebar .nav { position: relative; }

/* AI Tip box in sidebar */
.sidebar-tip {
  margin-top: auto; padding: 14px;
  background: var(--primary-light); border-radius: 14px;
  overflow: hidden;
}
.sidebar-tip-title { font-weight: 700; color: var(--dark); font-size: .85rem; margin-bottom: 4px; }
.sidebar-tip p { font-size: .8rem; color: var(--muted); margin: 0; }
.sidebar-tip-text { overflow: hidden; }

/* Main content area */
.main-content {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex; flex-direction: column;
  transition: margin-left var(--transition);
}

/* Topbar */
.topbar {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(248,250,252,.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(226,232,240,.8);
  height: var(--topbar-h);
  display: flex; align-items: center;
}
.topbar-inner {
  width: 100%; padding: 0 20px 0 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.topbar-left { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.topbar-title { font-size: 1.1rem; font-weight: 700; color: var(--dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-subtitle { font-size: .78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.mobile-menu-btn {
  display: none;
  background: none; border: none; padding: 0;
  width: 44px; height: 44px; border-radius: var(--radius-sm);
  color: var(--dark); font-size: 1.4rem; cursor: pointer;
  align-items: center; justify-content: center;
  transition: background var(--transition);
}
.mobile-menu-btn:hover { background: var(--primary-light); color: var(--primary); }

/* Avatar */
.avatar {
  width: 40px; height: 40px; border-radius: 13px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: .85rem; flex-shrink: 0;
}

/* Page body */
.page-body { padding: 24px; flex: 1; }

/* ---------- 9. Cards ---------- */
.content-card, .metric-card, .quiz-card, .feature-card {
  background: var(--card); border: 1px solid rgba(226,232,240,.9);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}
.content-card:hover, .feature-card:hover { box-shadow: var(--shadow); }
.metric-card {
  border-radius: var(--radius); padding: 20px;
  cursor: default;
}
.metric-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.metric-icon {
  width: 46px; height: 46px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; font-size: 1.3rem;
  margin-bottom: 12px;
}
.feature-icon {
  width: 52px; height: 52px; border-radius: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.45rem; color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
}

/* ---------- 10. Forms ---------- */
.form-control, .form-select {
  border-radius: 13px; padding: .72rem 1rem;
  border-color: #dbe3ef; font-size: .92rem;
  min-height: 46px; transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus, .form-select:focus {
  box-shadow: var(--focus-ring); border-color: var(--primary);
}
.form-label { font-weight: 600; font-size: .88rem; margin-bottom: .4rem; }
.form-text { font-size: .78rem; }
input[type="file"].form-control { padding: .55rem 1rem; }

/* ---------- 11. Auth Pages ---------- */
.auth-wrapper {
  min-height: calc(100vh - var(--topbar-h));
  display: flex; align-items: center; padding: 40px 0;
}
.auth-card {
  background: #fff; border-radius: 28px; box-shadow: var(--shadow-lg);
  border: 1px solid rgba(226,232,240,.9); overflow: hidden;
}
.auth-side {
  background: linear-gradient(145deg, var(--primary-dark), var(--primary) 48%, var(--secondary));
  color: #fff; position: relative; overflow: hidden; min-height: 280px;
}
.auth-side::after {
  content: ''; position: absolute; right: -80px; bottom: -80px;
  width: 200px; height: 200px; border-radius: 50%;
  background: rgba(255,255,255,.1);
}

/* ---------- 12. Badges, Status ---------- */
.status-pill {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .35rem .7rem; border-radius: 999px;
  font-size: .78rem; font-weight: 700;
}
.difficulty-badge {
  font-weight: 700; border-radius: 999px; padding: .32rem .7rem;
  font-size: .78rem; display: inline-block;
}
.difficulty-easy   { background: rgba(22,163,74,.12);  color: #15803d; }
.difficulty-medium { background: rgba(245,158,11,.14); color: #b45309; }
.difficulty-hard   { background: rgba(220,38,38,.12);  color: #b91c1c; }

/* ---------- 13. Quiz Interface ---------- */
.quiz-option {
  padding: 14px 18px; border: 2px solid var(--border);
  border-radius: 14px; margin-bottom: 10px; cursor: pointer;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
  background: #fff; user-select: none;
}
.quiz-option:hover {
  border-color: var(--primary);
  background: rgba(79,70,229,.04);
  box-shadow: 0 4px 16px rgba(79,70,229,.1);
}
.quiz-option.active {
  background: linear-gradient(135deg, rgba(79,70,229,.1), rgba(6,182,212,.07));
  border-color: var(--primary);
  box-shadow: 0 6px 20px rgba(79,70,229,.15);
}
.quiz-option.correct { background: rgba(22,163,74,.1); border-color: #16a34a; }
.quiz-option.wrong   { background: rgba(220,38,38,.1); border-color: #dc2626; }

.timer-box {
  background: #0f172a; color: #fff;
  border-radius: 14px; padding: 10px 16px;
  font-weight: 900; font-size: 1rem;
  display: inline-flex; align-items: center; gap: 8px;
}
.timer-box.warning { background: #dc2626; }

.question-number {
  width: 36px; height: 36px; border-radius: 10px;
  border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .85rem; background: #fff; cursor: default;
}
.question-number.active   { background: var(--primary); color: #fff; border-color: var(--primary); }
.question-number.answered { background: rgba(22,163,74,.12); color: #15803d; border-color: rgba(22,163,74,.3); }

/* ---------- 14. Progress ---------- */
.progress { height: 8px; border-radius: 999px; background: #e2e8f0; }
.progress-bar { border-radius: 999px; transition: width .4s ease; }

/* ---------- 15. Tables ---------- */
.table-responsive { border-radius: var(--radius); overflow: hidden; }
.table { vertical-align: middle; margin: 0; }
.table th {
  color: var(--muted); font-size: .78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em;
  background: #f8fafc; border-color: var(--border);
}
.table td { border-color: var(--border); font-size: .9rem; }
.table-hover tbody tr:hover { background: rgba(79,70,229,.03); }

/* Responsive table → card stacking on mobile */
@media (max-width: 575.98px) {
  .table-card-mobile thead { display: none; }
  .table-card-mobile tbody tr {
    display: block; margin-bottom: 12px;
    border: 1px solid var(--border); border-radius: 14px;
    padding: 12px; background: #fff;
  }
  .table-card-mobile tbody td {
    display: flex; justify-content: space-between; align-items: center;
    padding: 6px 0; border: none; font-size: .85rem;
  }
  .table-card-mobile tbody td::before {
    content: attr(data-label); font-weight: 700; color: var(--muted);
    font-size: .75rem; text-transform: uppercase; letter-spacing: .03em;
  }
}

/* ---------- 16. Charts ---------- */
.chart-bars {
  display: flex; gap: 10px; align-items: flex-end;
  min-height: 180px; padding: 20px 16px 28px;
  border-radius: var(--radius); background: linear-gradient(180deg,#fff,#f8fafc);
  border: 1px solid var(--border); overflow: hidden;
}
.chart-bar {
  flex: 1; min-width: 0; border-radius: 12px 12px 6px 6px;
  background: linear-gradient(180deg, var(--primary), var(--secondary));
  min-height: 28px; position: relative; transition: opacity var(--transition);
}
.chart-bar:hover { opacity: .85; }
.chart-bar span {
  position: absolute; bottom: -24px; left: 50%;
  transform: translateX(-50%); font-size: .7rem;
  color: var(--muted); font-weight: 600; white-space: nowrap;
}
.donut {
  width: 160px; height: 160px; border-radius: 50%;
  background: conic-gradient(var(--primary) 0 74%, #e2e8f0 74% 100%);
  display: grid; place-items: center; margin: auto;
}
.donut::before {
  content: '74%'; width: 106px; height: 106px; border-radius: 50%;
  background: #fff; display: grid; place-items: center;
  font-weight: 900; color: var(--dark); font-size: 1.5rem;
}

/* ---------- 17. Notifications ---------- */
.notification-item {
  border: 1px solid var(--border); border-radius: 16px;
  padding: 14px 16px; background: #fff; margin-bottom: 10px;
  transition: box-shadow var(--transition);
}
.notification-item.unread {
  border-color: rgba(79,70,229,.3); background: rgba(79,70,229,.035);
}
.notification-item:hover { box-shadow: var(--shadow-sm); }

/* ---------- 18. Empty State ---------- */
.empty-state {
  border: 2px dashed #cbd5e1; border-radius: var(--radius-lg);
  padding: 40px 24px; text-align: center; background: #fff;
}

/* ---------- 19. Timeline ---------- */
.timeline { position: relative; padding-left: 24px; }
.timeline::before {
  content: ''; position: absolute; left: 7px; top: 4px; bottom: 0;
  width: 2px; background: var(--border);
}
.timeline-item { position: relative; margin-bottom: 20px; }
.timeline-item::before {
  content: ''; position: absolute; left: -21px; top: 5px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--primary); box-shadow: 0 0 0 5px rgba(79,70,229,.13);
}

/* ---------- 20. Hero & Sections ---------- */
.hero-section {
  position: relative; overflow: hidden; padding: 90px 0 65px;
}
.hero-section::before {
  content: ''; position: absolute; inset: -100px -80px auto auto;
  width: 400px; height: 400px; border-radius: 50%;
  background: radial-gradient(circle, rgba(6,182,212,.22), transparent 70%);
  pointer-events: none;
}
.hero-section::after {
  content: ''; position: absolute; left: -140px; bottom: -140px;
  width: 380px; height: 380px; border-radius: 50%;
  background: radial-gradient(circle, rgba(79,70,229,.16), transparent 70%);
  pointer-events: none;
}
.hero-subtitle { font-size: 1.1rem; color: #475569; max-width: 650px; }
.hero-card, .glass-card {
  background: rgba(255,255,255,.88); border: 1px solid rgba(255,255,255,.72);
  box-shadow: var(--shadow); border-radius: var(--radius-lg);
  backdrop-filter: blur(14px);
}
.section-padding { padding: 70px 0; }
.section-subtitle { color: var(--muted); max-width: 680px; margin: auto; }

/* ---------- 21. Footer ---------- */
.footer { background: #0f172a; color: #94a3b8; padding: 40px 0; }
.footer a { color: #cbd5e1; }
.footer a:hover { color: #fff; }

/* ---------- 22. Alerts ---------- */
.alert { border-radius: var(--radius); border: none; }
.alert-success { background: rgba(22,163,74,.1);  color: #15803d; }
.alert-danger  { background: rgba(220,38,38,.1);  color: #991b1b; }
.alert-warning { background: rgba(245,158,11,.12); color: #92400e; }
.alert-info    { background: rgba(6,182,212,.1);   color: #0369a1; }

/* Dropdown polish */
.dropdown-menu {
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 6px;
}
.dropdown-item {
  border-radius: 10px; padding: .6rem .9rem;
  font-size: .88rem; font-weight: 600; color: #334155;
  min-height: 44px; display: flex; align-items: center;
}
.dropdown-item:hover { background: var(--primary-light); color: var(--primary); }

/* Modal polish */
.modal-content { border-radius: var(--radius-lg); border: none; }
.modal-header { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }

/* Badge */
.badge { font-weight: 700; }

/* =========================================================
   RESPONSIVE BREAKPOINTS
   ========================================================= */

/* ---------- DESKTOP & LAPTOP ≥ 992px (sidebar always open) ---------- */
@media (min-width: 992px) {
  .mobile-menu-btn { display: none !important; }
  .close-sidebar-btn { display: none; }
}

/* ---------- TABLET: 768px – 991px (mini sidebar, icons only) ---------- */
@media (min-width: 768px) and (max-width: 991.98px) {
  .sidebar {
    width: var(--sidebar-mini);
    padding: 14px 8px;
    align-items: center;
  }
  .sidebar-header { justify-content: center; }
  .sidebar-brand-text,
  .sidebar-label,
  .sidebar-tip-text,
  .nav-label { display: none !important; }

  .sidebar-brand { justify-content: center; }
  .sidebar-tip { padding: 10px; text-align: center; }
  .sidebar .nav-link {
    justify-content: center; padding: .7rem;
    border-radius: 14px; width: 100%;
    position: relative;
  }
  .sidebar .nav-link i { width: auto; font-size: 1.3rem; }
  /* Tooltip via title attribute is enough for mini sidebar */

  .main-content { margin-left: var(--sidebar-mini); }

  .mobile-menu-btn { display: none !important; }
  .close-sidebar-btn { display: none !important; }
  .sidebar-backdrop { display: none !important; }
}

/* ---------- MOBILE: < 768px (overlay sidebar) ---------- */
@media (max-width: 767.98px) {
  .sidebar {
    width: min(var(--sidebar-w), 85vw);
    transform: translateX(-110%);
    box-shadow: none;
  }
  .sidebar.show {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  .main-content { margin-left: 0; }
  .mobile-menu-btn { display: inline-flex !important; }

  .page-body { padding: 16px 14px; }
  .topbar-title { font-size: .95rem; }
  .topbar-subtitle { display: none; }

  .hero-section { padding: 60px 0 44px; }
  .hero-subtitle { font-size: .97rem; }
  .section-padding { padding: 48px 0; }

  .auth-side { min-height: 200px; padding: 28px !important; }
  .auth-wrapper { padding: 20px 0; align-items: flex-start; }
  .auth-card { border-radius: 22px; }

  .metric-card { padding: 16px; }
  .metric-icon { width: 40px; height: 40px; font-size: 1.1rem; }

  .chart-bars { gap: 6px; min-height: 140px; padding: 14px 12px 30px; }
  .chart-bar span { font-size: .65rem; }

  .timer-box { width: 100%; justify-content: center; }

  .quiz-option { padding: 12px 14px; }

  .empty-state { padding: 28px 16px; }

  /* Hide desktop-only decorative elements */
  .desktop-only { display: none !important; }
}

/* ---------- SMALL MOBILE: < 576px ---------- */
@media (max-width: 575.98px) {
  .content-card, .metric-card, .quiz-card, .feature-card {
    border-radius: var(--radius);
  }
  .auth-card { border-radius: 18px; }

  /* Stack btn groups */
  .btn-group-mobile {
    flex-direction: column !important; align-items: stretch !important;
  }
  .btn-group-mobile .btn { width: 100%; justify-content: center; }

  /* Full-width dropdowns */
  .dropdown-menu { min-width: 100%; }

  /* Table overflow hint */
  .table-responsive::before {
    content: '← scroll →';
    display: block; text-align: center;
    font-size: .72rem; color: var(--muted);
    padding: 4px 0 0;
  }

  /* Reduce hero glow blobs */
  .hero-section::before { width: 220px; height: 220px; }
  .hero-section::after  { width: 200px; height: 200px; }
}

/* ---------- LARGE DESKTOP: ≥ 1400px ---------- */
@media (min-width: 1400px) {
  .page-body { padding: 28px 32px; }
  .sidebar { width: 288px; padding: 20px 16px; }
  .main-content { margin-left: 288px; }
}

/* =========================================================
   HIGH CONTRAST MODE
   ========================================================= */
@media (forced-colors: active) {
  .btn-gradient, .btn-outline-gradient { forced-color-adjust: none; }
  .sidebar .nav-link.active { forced-color-adjust: none; }
  :focus-visible { outline: 3px solid ButtonText !important; }
}

/* =========================================================
   PRINT
   ========================================================= */
@media print {
  .sidebar, .topbar, .mobile-menu-btn, .sidebar-backdrop { display: none !important; }
  .main-content { margin-left: 0 !important; }
  .page-body { padding: 0; }
  body { background: #fff; }
  .content-card, .metric-card { box-shadow: none; border: 1px solid #ddd; }
}
