/*
 * QuadraEdge.LMS — Design System v3.0
 * Drop-in replacement for qe.css
 * Mobile-first. Fully responsive. No JS dependencies for layout.
 */

/* ═══════════════════════════════════════════════════════
   TOKENS
═══════════════════════════════════════════════════════ */
:root {
  /* Brand palette */
  --cobalt:       #2563eb;
  --cobalt-lt:    #3b82f6;
  --cobalt-pale:  #eff4ff;
  --cobalt-deep:  #1d4ed8;
  --teal:         #0ea5e9;
  --teal-pale:    #f0f9ff;
  --orange:       #f97316;
  --orange-lt:    #fb923c;
  --orange-pale:  #fff7ed;
  --success:      #16a34a;
  --success-lt:   #22c55e;
  --success-pale: #f0fdf4;
  --warn:         #d97706;
  --warn-pale:    #fffbeb;
  --danger:       #dc2626;
  --danger-pale:  #fef2f2;

  /* Surface scale */
  --slate-950:    #0a0f1e;
  --slate-900:    #111827;
  --slate-800:    #1e2a3a;
  --slate-700:    #2d3a4f;
  --off-white:    #f6f8fb;
  --blue-tint:    #eef2ff;
  --surface:      #ffffff;

  /* Text */
  --ink:          #0f172a;
  --ink-2:        #1e293b;
  --ink-3:        #334155;
  --muted:        #64748b;
  --muted-lt:     #94a3b8;
  --line:         #e2e8f0;
  --line-lt:      #f1f5f9;

  /* Spacing scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* Shape */
  --r:      12px;
  --r-sm:   8px;
  --r-xs:   6px;
  --r-lg:   18px;
  --r-xl:   24px;
  --r-pill: 999px;

  /* Shadows */
  --sh-xs: 0 1px 3px rgba(10,15,30,.06), 0 1px 2px rgba(10,15,30,.04);
  --sh-sm: 0 2px 8px rgba(10,15,30,.08), 0 1px 3px rgba(10,15,30,.05);
  --sh:    0 8px 24px rgba(10,15,30,.10), 0 2px 6px rgba(10,15,30,.06);
  --sh-lg: 0 20px 48px rgba(10,15,30,.14), 0 6px 16px rgba(10,15,30,.08);
  --sh-xl: 0 32px 72px rgba(10,15,30,.18);
  --sh-cobalt: 0 4px 16px rgba(37,99,235,.28);
  --sh-orange: 0 4px 14px rgba(249,115,22,.28);

  /* Motion */
  --t:      200ms cubic-bezier(.25,.8,.25,1);
  --t-fast: 120ms cubic-bezier(.25,.8,.25,1);
  --t-slow: 350ms cubic-bezier(.25,.8,.25,1);

  /* Typography */
  --font-d: 'DM Sans', system-ui, sans-serif;
  --font-b: 'Inter', system-ui, -apple-system, sans-serif;
  --font-ar:'Tajawal', system-ui, sans-serif;

  /* Layout */
  --nav-h:  68px;
  --sidebar-w: 240px;
  --max-w:  1200px;
  --max-w-sm: 840px;
  --max-w-xs: 520px;
}

/* ═══════════════════════════════════════════════════════
   RESET & BASE
═══════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  font-family: var(--font-b);
  background: var(--off-white);
  color: var(--ink-3);
  padding-top: var(--nav-h);
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
body.lang-ar { font-family: var(--font-ar); direction: rtl; }
body.no-pad { padding-top: 0; }
a { color: inherit; text-decoration: none; }
img, video, iframe { display: block; max-width: 100%; height: auto; }
ul { list-style: none; }
input, textarea, select, button { font-family: inherit; }
h1,h2,h3,h4,h5 {
  font-family: var(--font-d);
  font-weight: 700;
  line-height: 1.15;
  color: var(--ink);
  letter-spacing: -.015em;
}

/* ═══════════════════════════════════════════════════════
   TYPOGRAPHY UTILITIES
═══════════════════════════════════════════════════════ */
.eyebrow {
  display: inline-block;
  font-family: var(--font-d);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--cobalt);
  margin-bottom: .75rem;
}
.on-dark .eyebrow { color: var(--teal); }
.on-dark h1, .on-dark h2, .on-dark h3, .on-dark h4 { color: #fff; }
.on-dark p { color: rgba(255,255,255,.65); }

/* Blanket rule: headings on every dark hero/section always render white */
.hero h1,
.learn-hero h1, .learn-hero h2, .learn-hero h3,
.dash-hero h1, .dash-hero h2,
.section-dark h1, .section-dark h2, .section-dark h3, .section-dark h4,
.auth-left h1, .auth-left h2, .auth-left h3,
.tp-left h1, .tp-left h2, .tp-left h3 {
  color: #fff;
}
.lead { font-size: .97rem; line-height: 1.78; color: var(--muted); }
.text-sm { font-size: .83rem; }
.text-xs { font-size: .75rem; }
.text-muted { color: var(--muted); }
.text-ink { color: var(--ink); }
.font-d { font-family: var(--font-d); }
.font-bold { font-weight: 700; }
.font-800 { font-weight: 800; }

/* ═══════════════════════════════════════════════════════
   NAV — polished & mobile-perfect
═══════════════════════════════════════════════════════ */
.qe-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 300;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: rgba(10,15,30,.96);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(255,255,255,.07);
  transition: box-shadow var(--t);
}
.qe-nav.scrolled {
  box-shadow: 0 2px 24px rgba(0,0,0,.3);
}
.qe-nav .inner {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--space-6);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* Logo */
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-right: auto;
  text-decoration: none;
}
[dir=rtl] .nav-logo { margin-right: 0; margin-left: auto; }
.nav-logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--cobalt), var(--cobalt-deep));
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(37,99,235,.4);
}
.nav-logo-icon svg { width: 18px; height: 18px; }
.nav-brand {
  font-family: var(--font-d);
  font-weight: 800;
  font-size: .95rem;
  color: #fff;
  line-height: 1.1;
}
.nav-brand small {
  display: block;
  font-size: .58rem;
  font-weight: 500;
  color: rgba(255,255,255,.36);
  letter-spacing: .04em;
}

/* Nav links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
}
.nav-links a, .nav-links button {
  font-family: var(--font-d);
  font-size: .82rem;
  font-weight: 600;
  color: rgba(255,255,255,.68);
  padding: 7px 12px;
  border-radius: 7px;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: color var(--t), background var(--t);
  white-space: nowrap;
  text-decoration: none;
}
.nav-links a:hover, .nav-links button:hover {
  color: #fff;
  background: rgba(255,255,255,.09);
}
.nav-links a.active {
  color: #fff;
  background: rgba(255,255,255,.11);
}
.nav-sep {
  width: 1px; height: 18px;
  background: rgba(255,255,255,.1);
  margin: 0 4px;
  flex-shrink: 0;
}

/* Pill buttons in nav */
.nav-pill {
  font-family: var(--font-d) !important;
  font-size: .8rem !important;
  font-weight: 700 !important;
  padding: 7px 15px !important;
  border-radius: var(--r-sm) !important;
}
.nav-pill-orange {
  background: var(--orange) !important;
  color: #fff !important;
  box-shadow: var(--sh-orange);
}
.nav-pill-orange:hover { background: var(--orange-lt) !important; }
.nav-pill-ghost {
  background: rgba(255,255,255,.08) !important;
  color: rgba(255,255,255,.85) !important;
  border: 1px solid rgba(255,255,255,.14) !important;
}
.nav-pill-ghost:hover {
  background: rgba(255,255,255,.14) !important;
  border-color: rgba(255,255,255,.24) !important;
}
.nav-lang {
  font-size: .72rem !important;
  padding: 5px 9px !important;
  border: 1px solid rgba(255,255,255,.18) !important;
  border-radius: 6px !important;
  color: rgba(255,255,255,.55) !important;
}
.nav-lang:hover {
  border-color: rgba(255,255,255,.4) !important;
  color: #fff !important;
}

/* Hamburger */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 8px;
  padding: 7px 9px;
  cursor: pointer;
  color: #fff;
  flex-shrink: 0;
  transition: background var(--t), border-color var(--t);
}
.nav-toggle:hover {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.35);
}

/* ═══════════════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: var(--font-d);
  font-weight: 700;
  font-size: .88rem;
  padding: 11px 22px;
  border-radius: var(--r-sm);
  border: none;
  cursor: pointer;
  transition: background var(--t), transform var(--t-fast), box-shadow var(--t), border-color var(--t);
  text-decoration: none;
  white-space: nowrap;
  min-height: 44px; /* touch target */
  letter-spacing: -.01em;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: var(--cobalt);
  color: #fff;
  box-shadow: var(--sh-cobalt);
}
.btn-primary:hover {
  background: var(--cobalt-deep);
  box-shadow: 0 6px 20px rgba(37,99,235,.38);
}

.btn-orange {
  background: var(--orange);
  color: #fff;
  box-shadow: var(--sh-orange);
}
.btn-orange:hover {
  background: #ea6c10;
  box-shadow: 0 6px 18px rgba(249,115,22,.38);
}

.btn-white  { background: #fff; color: var(--cobalt); }
.btn-white:hover { box-shadow: var(--sh); }

.btn-outline {
  background: transparent;
  color: var(--cobalt);
  border: 1.5px solid var(--cobalt);
}
.btn-outline:hover { background: var(--cobalt-pale); }

.btn-ghost-dark {
  background: rgba(255,255,255,.09);
  color: rgba(255,255,255,.9);
  border: 1px solid rgba(255,255,255,.16);
}
.btn-ghost-dark:hover { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.28); }

.btn-outline-white {
  background: transparent;
  color: #fff;
  border: 1.5px solid rgba(255,255,255,.38);
}
.btn-outline-white:hover {
  border-color: rgba(255,255,255,.7);
  background: rgba(255,255,255,.07);
}

.btn-danger  { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-muted   { background: var(--off-white); color: var(--muted); border: 1px solid var(--line); }
.btn-muted:hover { border-color: var(--cobalt); color: var(--cobalt); }

.btn-sm  { padding: 8px 16px; font-size: .8rem; min-height: 36px; }
.btn-lg  { padding: 14px 30px; font-size: 1rem; min-height: 52px; }
.btn-block { width: 100%; justify-content: center; }
.btn-icon { padding: 9px; aspect-ratio: 1; }

/* ═══════════════════════════════════════════════════════
   FORMS
═══════════════════════════════════════════════════════ */
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-label {
  font-family: var(--font-d);
  font-size: .8rem;
  font-weight: 700;
  color: var(--ink);
}
.form-hint  { font-size: .74rem; color: var(--muted); }
.form-control {
  width: 100%;
  font-family: var(--font-b);
  font-size: .92rem;
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  padding: 11px 14px;
  outline: none;
  transition: border-color var(--t), box-shadow var(--t), background var(--t);
  min-height: 44px; /* touch target */
}
.form-control:focus {
  border-color: var(--cobalt);
  box-shadow: 0 0 0 3px rgba(37,99,235,.13);
  background: var(--surface);
}
.form-control:hover:not(:focus) { border-color: var(--muted-lt); }
.form-control.is-error { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(220,38,38,.1); }
textarea.form-control { resize: vertical; min-height: 110px; }
select.form-control { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' stroke='%2364748b' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; padding-right: 40px; }
.form-error { font-size: .76rem; color: var(--danger); margin-top: 3px; display: flex; align-items: center; gap: 4px; }
.form-row  { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }

.form-pass-wrap { position: relative; }
.form-pass-wrap input { padding-right: 44px; }
.form-pass-toggle {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; color: var(--muted); padding: 4px;
  transition: color var(--t);
}
.form-pass-toggle:hover { color: var(--cobalt); }

/* ═══════════════════════════════════════════════════════
   ALERTS
═══════════════════════════════════════════════════════ */
.alert {
  padding: 13px 16px;
  border-radius: 10px;
  font-size: .89rem;
  line-height: 1.55;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
  border: 1px solid transparent;
}
.alert-success { background: var(--success-pale); color: #166534; border-color: #bbf7d0; }
.alert-error   { background: var(--danger-pale);  color: #991b1b; border-color: #fecaca; }
.alert-warn    { background: var(--warn-pale);    color: #92400e; border-color: #fde68a; }
.alert-info    { background: var(--cobalt-pale);  color: #1e40af; border-color: #bfdbfe; }

/* ═══════════════════════════════════════════════════════
   CARDS
═══════════════════════════════════════════════════════ */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--sh-sm);
}
.card-body { padding: var(--space-6); }
.card-hover { transition: box-shadow var(--t), transform var(--t); }
.card-hover:hover { box-shadow: var(--sh); transform: translateY(-2px); }

/* ═══════════════════════════════════════════════════════
   BADGES
═══════════════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-d);
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: var(--r-pill);
}
.badge-blue   { background: var(--cobalt-pale); color: var(--cobalt); }
.badge-green  { background: var(--success-pale); color: #166534; }
.badge-orange { background: var(--orange-pale);  color: #c2410c; }
.badge-gray   { background: var(--off-white);    color: var(--muted); border: 1px solid var(--line); }
.badge-teal   { background: var(--teal-pale);    color: #0369a1; }

/* ═══════════════════════════════════════════════════════
   PROGRESS
═══════════════════════════════════════════════════════ */
.progress {
  height: 7px;
  background: var(--line);
  border-radius: var(--r-pill);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: var(--r-pill);
  transition: width .7s cubic-bezier(.4,0,.2,1);
}
.progress-fill-cobalt,
.pf-cobalt { background: linear-gradient(90deg, var(--cobalt), var(--cobalt-lt)); }
.pf-green  { background: linear-gradient(90deg, var(--success), var(--success-lt)); }
.pf-orange { background: linear-gradient(90deg, #ea580c, var(--orange)); }
/* Tall variant for section headers */
.progress-lg { height: 10px; }

/* ═══════════════════════════════════════════════════════
   TABLES
═══════════════════════════════════════════════════════ */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--r); border: 1px solid var(--line); }
.qe-table { width: 100%; border-collapse: collapse; min-width: 600px; }
.qe-table th {
  font-family: var(--font-d);
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  background: var(--line-lt);
  padding: 11px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.qe-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  font-size: .89rem;
  color: var(--ink-2);
  vertical-align: middle;
}
.qe-table tr:last-child td { border-bottom: none; }
.qe-table tr:hover td { background: var(--line-lt); }
[dir=rtl] .qe-table th, [dir=rtl] .qe-table td { text-align: right; }

/* ═══════════════════════════════════════════════════════
   LAYOUT PRIMITIVES
═══════════════════════════════════════════════════════ */
.section    { padding: 80px 0; }
.section-sm { padding: 52px 0; }
.section-alt  { background: var(--surface); }
.section-dark { background: var(--slate-900); }
.container    { max-width: var(--max-w);    margin: 0 auto; padding: 0 var(--space-6); }
.container-sm { max-width: var(--max-w-sm); margin: 0 auto; padding: 0 var(--space-6); }
.container-xs { max-width: var(--max-w-xs); margin: 0 auto; padding: 0 var(--space-6); }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 52px; }
.section-head h2 {
  font-size: clamp(1.75rem, 4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -.025em;
  margin-bottom: .85rem;
}
.section-head p { font-size: .96rem; line-height: 1.78; color: var(--muted); }

/* Grids */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }

/* ═══════════════════════════════════════════════════════
   COURSE CARDS — upgraded
═══════════════════════════════════════════════════════ */
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 18px;
}
.course-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--t), transform var(--t), border-color var(--t);
}
.course-card:hover {
  box-shadow: var(--sh-lg);
  transform: translateY(-3px);
  border-color: rgba(37,99,235,.2);
}
.course-card.hidden { display: none; }

/* Color accent strip */
.cc-band { height: 5px; flex-shrink: 0; }
.cc-band-blue   { background: linear-gradient(90deg, var(--cobalt), var(--teal)); }
.cc-band-orange { background: linear-gradient(90deg, var(--orange), #fbbf24); }
.cc-band-green  { background: linear-gradient(90deg, var(--success), var(--teal)); }
.cc-band-purple { background: linear-gradient(90deg, #7c3aed, var(--cobalt)); }

.cc-body { padding: 18px 18px 16px; flex: 1; display: flex; flex-direction: column; }
.cc-meta { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; gap: 6px; flex-wrap: wrap; }
.cc-cat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-d);
  font-size: .63rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 3px 9px;
  border-radius: var(--r-pill);
}
.cc-level {
  font-family: var(--font-d);
  font-size: .65rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--off-white);
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  padding: 2px 7px;
}
.cc-title {
  font-family: var(--font-d);
  font-size: .96rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.3;
  margin-bottom: 7px;
  letter-spacing: -.01em;
}
.cc-desc {
  font-size: .82rem;
  line-height: 1.66;
  color: var(--muted);
  flex: 1;
  margin-bottom: 13px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cc-stats {
  display: flex;
  gap: 14px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  margin-top: auto;
}
.cc-stat {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-d);
  font-size: .7rem;
  font-weight: 600;
  color: var(--muted);
}
.cc-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  gap: 8px;
}
.cc-free {
  font-family: var(--font-d);
  font-size: .7rem;
  font-weight: 700;
  color: var(--success);
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ═══════════════════════════════════════════════════════
   STAT / METRIC CARDS
═══════════════════════════════════════════════════════ */
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin: 18px 0 28px; }
.metric {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 18px 20px;
  box-shadow: var(--sh-xs);
  transition: box-shadow var(--t), transform var(--t);
}
.metric:hover { box-shadow: var(--sh-sm); transform: translateY(-1px); }
.metric-num {
  font-family: var(--font-d);
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1;
  margin-bottom: 5px;
  letter-spacing: -.03em;
}
.metric-lbl { font-size: .78rem; color: var(--muted); font-family: var(--font-d); font-weight: 500; }

.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 22px; box-shadow: var(--sh-xs); }
.stat-card-num { font-family: var(--font-d); font-size: 2rem; font-weight: 800; color: var(--ink); line-height: 1; margin-bottom: 4px; }
.stat-card-label { font-size: .8rem; color: var(--muted); }
.stat-card-icon { font-size: 1.5rem; margin-bottom: 10px; }

/* ═══════════════════════════════════════════════════════
   ADMIN SHELL
═══════════════════════════════════════════════════════ */
.admin-layout { display: flex; min-height: calc(100vh - var(--nav-h)); }
.admin-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--slate-900);
  padding: 20px 0;
  position: sticky;
  top: var(--nav-h);
  height: calc(100vh - var(--nav-h));
  overflow-y: auto;
  border-right: 1px solid rgba(255,255,255,.05);
}
.admin-main { flex: 1; min-width: 0; padding: 32px 40px 80px; }
.adm-lbl {
  font-family: var(--font-d);
  font-size: .59rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.22);
  padding: 4px 18px;
  display: block;
  margin-top: 18px;
  margin-bottom: 3px;
}
.adm-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  font-family: var(--font-d);
  font-size: .83rem;
  font-weight: 600;
  color: rgba(255,255,255,.58);
  transition: background var(--t), color var(--t);
  text-decoration: none;
  border-left: 2px solid transparent;
  margin: 1px 0;
}
.adm-link:hover { background: rgba(255,255,255,.07); color: rgba(255,255,255,.9); }
.adm-link.active { background: rgba(37,99,235,.22); color: var(--cobalt-lt); border-left-color: var(--cobalt); }
.adm-icon { font-size: .92rem; width: 18px; text-align: center; flex-shrink: 0; }
.page-title { font-family: var(--font-d); font-size: 1.6rem; font-weight: 800; color: var(--ink); margin-bottom: 4px; letter-spacing: -.02em; }
.page-sub   { font-size: .86rem; color: var(--muted); margin-bottom: 28px; }
.admin-section { margin-bottom: 36px; }

/* Admin mobile drawer */
.admin-menu-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  background: var(--slate-900);
  color: rgba(255,255,255,.8);
  border: none;
  padding: 12px 16px;
  font-family: var(--font-d);
  font-size: .84rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  text-align: left;
  margin-bottom: 16px;
  border-radius: var(--r-sm);
}

/* ═══════════════════════════════════════════════════════
   AUTH PAGES
═══════════════════════════════════════════════════════ */
.auth-split { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-page  { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }

.auth-left {
  background: var(--slate-900);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 64px 56px;
  position: relative;
  overflow: hidden;
}
.auth-left::before {
  content: '';
  position: absolute;
  top: -20%; left: -10%;
  width: 60%; height: 80%;
  background: radial-gradient(ellipse, rgba(37,99,235,.22) 0%, transparent 65%);
  pointer-events: none;
}
.auth-left::after {
  content: '';
  position: absolute;
  bottom: -10%; right: -5%;
  width: 40%; height: 55%;
  background: radial-gradient(ellipse, rgba(14,165,233,.14) 0%, transparent 60%);
  pointer-events: none;
}
.auth-left-inner { position: relative; z-index: 1; }
.auth-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 36px; }
.auth-logo-icon {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--cobalt), var(--cobalt-deep));
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(37,99,235,.4);
}
.auth-logo-icon svg { width: 22px; height: 22px; }
.auth-logo-text { font-family: var(--font-d); font-weight: 800; font-size: 1.1rem; color: #fff; }
.auth-headline {
  font-family: var(--font-d);
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
  margin-bottom: 1rem;
  letter-spacing: -.025em;
}
.auth-headline em {
  font-style: normal;
  background: linear-gradient(90deg, var(--cobalt-lt), var(--teal));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.auth-bullets { margin-top: 28px; display: flex; flex-direction: column; gap: 10px; }
.auth-bullet { display: flex; align-items: center; gap: 10px; font-size: .88rem; color: rgba(255,255,255,.7); }
.auth-bullet-dot {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: rgba(37,99,235,.2);
  border: 1px solid rgba(37,99,235,.4);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: .7rem;
  color: var(--cobalt-lt);
  font-weight: 700;
}
.auth-right {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 56px;
  background: var(--off-white);
  overflow-y: auto;
}
.auth-right-inner { max-width: 420px; width: 100%; }
.auth-title { font-family: var(--font-d); font-size: 1.7rem; font-weight: 800; color: var(--ink); margin-bottom: .4rem; letter-spacing: -.025em; }
.auth-sub   { font-size: .87rem; color: var(--muted); margin-bottom: 24px; }
.auth-sub a { color: var(--cobalt); font-weight: 600; }
.auth-card  { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 28px; box-shadow: var(--sh); }
.auth-divider {
  text-align: center;
  font-size: .77rem;
  color: var(--muted);
  margin: 16px 0;
  position: relative;
}
.auth-divider::before {
  content: '';
  position: absolute;
  top: 50%; left: 0; right: 0;
  height: 1px;
  background: var(--line);
}
.auth-divider span { background: var(--surface); padding: 0 12px; position: relative; }
.auth-switch { text-align: center; margin-top: 18px; font-size: .84rem; color: var(--muted); }
.auth-switch a { color: var(--cobalt); font-weight: 600; }
.auth-team-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--off-white);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 13px 16px;
  font-family: var(--font-d);
  font-size: .87rem;
  font-weight: 700;
  color: var(--ink-2);
  cursor: pointer;
  width: 100%;
  transition: border-color var(--t), background var(--t), box-shadow var(--t);
  text-decoration: none;
  min-height: 60px;
}
.auth-team-btn:hover {
  border-color: var(--cobalt);
  background: var(--cobalt-pale);
  color: var(--cobalt);
  box-shadow: var(--sh-sm);
}
.auth-team-icon { font-size: 1.3rem; flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════
   DASHBOARD
═══════════════════════════════════════════════════════ */
.dash-hero {
  background: linear-gradient(135deg, var(--slate-900) 0%, var(--slate-800) 100%);
  color: #fff;
  padding: 44px 0 40px;
  position: relative;
  overflow: hidden;
}
.dash-hero::before {
  content: '';
  position: absolute;
  top: -30%; right: -5%;
  width: 50%; height: 160%;
  background: radial-gradient(ellipse, rgba(37,99,235,.15) 0%, transparent 70%);
  pointer-events: none;
}
.dash-hero h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 800; letter-spacing: -.025em; margin-bottom: .4rem; color: #fff; }
.dash-hero p  { color: rgba(255,255,255,.65); font-size: .95rem; }
.dash-body    { padding: 32px 0 80px; }

/* ═══════════════════════════════════════════════════════
   COURSE CARD (dashboard view with progress)
═══════════════════════════════════════════════════════ */
.course-card-body { padding: 20px 20px 16px; flex: 1; display: flex; flex-direction: column; }
.course-card-body h3 { font-family: var(--font-d); font-size: .96rem; font-weight: 800; margin: 8px 0 6px; color: var(--ink); letter-spacing: -.01em; }
.course-card-body p  { font-size: .82rem; color: var(--muted); line-height: 1.6; margin-bottom: 12px; flex: 1; }
.course-card-body .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }

/* ═══════════════════════════════════════════════════════
   LEARN PAGE
═══════════════════════════════════════════════════════ */
.learn-hero { background: var(--slate-900); color: #fff; padding: 48px 0; }
.learn-hero h1 { font-family: var(--font-d); font-size: clamp(1.7rem, 4vw, 2.6rem); font-weight: 800; max-width: 850px; letter-spacing: -.025em; color: #fff; }
.learn-hero p   { color: rgba(255,255,255,.7); max-width: 780px; font-size: .96rem; margin-top: .6rem; }
.learn-body     { padding: 32px 0 80px; }
.learn-layout   { display: grid; grid-template-columns: 270px 1fr; gap: 24px; }

/* Sidebar lesson list */
.lesson-list {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 14px;
  height: max-content;
  position: sticky;
  top: calc(var(--nav-h) + 16px);
  max-height: calc(100vh - var(--nav-h) - 32px);
  overflow-y: auto;
}
.lesson-list-head {
  font-family: var(--font-d);
  font-size: .76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  padding: 6px 8px 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}
.lesson-link {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 10px;
  border-radius: 9px;
  color: var(--ink-2);
  text-decoration: none;
  font-weight: 600;
  font-size: .84rem;
  transition: background var(--t), color var(--t);
  line-height: 1.4;
}
.lesson-link:hover { background: var(--off-white); }
.lesson-link.done  { color: var(--muted); }

/* Lesson cards */
.lesson-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 28px;
  margin-bottom: 18px;
  transition: box-shadow var(--t);
}
.lesson-card:hover { box-shadow: var(--sh-sm); }
.lesson-card h2 { font-family: var(--font-d); font-size: 1.2rem; font-weight: 800; margin: 8px 0 14px; letter-spacing: -.015em; }
.lesson-content { color: var(--ink-2); line-height: 1.75; font-size: .94rem; }
.lesson-content p + p { margin-top: .75em; }
.resource-list { display: grid; gap: 10px; margin: 16px 0; }
.resource-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--off-white);
  display: flex;
  align-items: center;
  gap: 12px;
  transition: border-color var(--t);
}
.resource-item:hover { border-color: var(--cobalt); }
.complete-box {
  margin: 20px 0;
  padding: 16px 18px;
  border-radius: 12px;
  background: var(--success-pale);
  border: 1px solid #bbf7d0;
  color: #166534;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .9rem;
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════════
   HERO (landing page)
═══════════════════════════════════════════════════════ */
.hero {
  background: var(--slate-900);
  min-height: 82vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding: 56px 0 0;
}
.hero::before {
  content: '';
  position: absolute;
  top: -20%; left: -10%;
  width: 55%; height: 80%;
  background: radial-gradient(ellipse, rgba(37,99,235,.22) 0%, transparent 65%);
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: -10%; right: -5%;
  width: 40%; height: 55%;
  background: radial-gradient(ellipse, rgba(14,165,233,.13) 0%, transparent 60%);
  pointer-events: none;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 56px;
  align-items: center;
  position: relative;
  z-index: 1;
}
.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(37,99,235,.16);
  border: 1px solid rgba(37,99,235,.32);
  border-radius: var(--r-pill);
  padding: 4px 13px 4px 7px;
  margin-bottom: 22px;
}
.hero-kicker-dot {
  width: 7px; height: 7px;
  background: var(--cobalt-lt);
  border-radius: 50%;
  animation: pdot 2s ease-in-out infinite;
}
@keyframes pdot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .45; transform: scale(.75); }
}
.hero-kicker span { font-family: var(--font-d); font-size: .72rem; font-weight: 600; color: var(--cobalt-lt); }
.hero h1 {
  font-family: var(--font-d);
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.06;
  letter-spacing: -.03em;
  margin-bottom: 1rem;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(90deg, var(--cobalt-lt), var(--teal));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-lead { font-size: .99rem; line-height: 1.78; color: rgba(255,255,255,.66); max-width: 500px; margin-bottom: 1.75rem; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 1.5rem; }
.hero-proof { display: flex; flex-wrap: wrap; gap: 5px 14px; }
.hero-proof-item {
  font-size: .76rem;
  color: rgba(255,255,255,.48);
  font-family: var(--font-d);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ═══════════════════════════════════════════════════════
   FILTER BAR
═══════════════════════════════════════════════════════ */
.filter-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
  position: sticky;
  top: var(--nav-h);
  z-index: 100;
}
.filter-inner { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-pill {
  font-family: var(--font-d);
  font-size: .78rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  border: 1.5px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all var(--t);
  min-height: 36px;
}
.filter-pill:hover { border-color: var(--cobalt); color: var(--cobalt); background: var(--cobalt-pale); }
.filter-pill.active { background: var(--cobalt); border-color: var(--cobalt); color: #fff; }

/* Search bar */
.search-wrap { position: relative; flex: 1; min-width: 200px; max-width: 340px; }
.search-wrap svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-input {
  width: 100%;
  padding: 9px 14px 9px 38px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-pill);
  font-size: .85rem;
  font-family: var(--font-b);
  background: var(--off-white);
  color: var(--ink);
  outline: none;
  transition: border-color var(--t), box-shadow var(--t);
  min-height: 40px;
}
.search-input:focus { border-color: var(--cobalt); box-shadow: 0 0 0 3px rgba(37,99,235,.12); background: var(--surface); }

/* ═══════════════════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════════════════ */
.qe-footer {
  background: var(--slate-950);
  color: rgba(255,255,255,.48);
  padding: 52px 0 24px;
}
.qe-footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 36px;
}
.qe-footer-brand { font-family: var(--font-d); font-size: .95rem; font-weight: 800; color: #fff; margin-bottom: 8px; }
.qe-footer-desc  { font-size: .8rem; line-height: 1.72; }
.qe-footer-col-head {
  font-family: var(--font-d);
  font-size: .63rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.25);
  margin-bottom: 14px;
  display: block;
}
.qe-footer-col ul { display: flex; flex-direction: column; gap: 10px; }
.qe-footer-col a { font-size: .81rem; color: rgba(255,255,255,.48); transition: color var(--t); }
.qe-footer-col a:hover { color: rgba(255,255,255,.9); }
.qe-footer-bottom {
  border-top: 1px solid rgba(255,255,255,.07);
  padding-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.qe-footer-bottom p { font-size: .76rem; }
.qe-footer-links    { display: flex; gap: 18px; }
.qe-footer-links a  { font-size: .76rem; color: rgba(255,255,255,.3); transition: color var(--t); }
.qe-footer-links a:hover { color: rgba(255,255,255,.8); }

/* ═══════════════════════════════════════════════════════
   TEAM PASS PAGE
═══════════════════════════════════════════════════════ */
.tp-page { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.tp-left { background: linear-gradient(145deg, var(--slate-900), var(--slate-800)); display: flex; flex-direction: column; justify-content: center; padding: 64px 56px; }
.tp-card { background: var(--surface); border-radius: var(--r-xl); padding: 40px; box-shadow: var(--sh-xl); }

/* ═══════════════════════════════════════════════════════
   CERTIFICATE PAGE
═══════════════════════════════════════════════════════ */
.cert-wrapper {
  background: var(--off-white);
  padding: 40px 0 80px;
}
.cert-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.cert-card {
  background: var(--surface);
  border-radius: var(--r-xl);
  padding: 48px;
  box-shadow: var(--sh-lg);
  text-align: center;
  max-width: 680px;
  margin: 0 auto;
  border: 1px solid var(--line);
}

/* ═══════════════════════════════════════════════════════
   MOBILE NAV DRAWER
═══════════════════════════════════════════════════════ */
@media (max-width: 767px) {
  :root {
    --nav-h: 60px;
    --sidebar-w: 0;
  }

  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    background: rgba(10,15,30,.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 14px 18px 20px;
    gap: 4px;
    z-index: 299;
    border-bottom: 1px solid rgba(255,255,255,.08);
    box-shadow: 0 12px 32px rgba(0,0,0,.4);
  }
  .nav-links.open a,
  .nav-links.open button {
    width: 100%;
    padding: 12px 16px;
    border-radius: 9px;
    font-size: .9rem;
  }
  .nav-links.open .nav-sep { display: none; }
  .nav-links.open .nav-pill { margin-top: 4px; }
  .nav-toggle { display: flex; align-items: center; justify-content: center; }
  .nav-brand small { display: none; } /* save space */

  /* Sections */
  .section    { padding: 52px 0; }
  .section-sm { padding: 36px 0; }
  .container, .container-sm, .container-xs { padding: 0 16px; }

  /* Grids collapse */
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-row, .form-grid { grid-template-columns: 1fr; }

  /* Auth */
  .auth-split, .auth-page, .tp-page {
    grid-template-columns: 1fr;
  }
  .auth-left, .tp-left { display: none; }
  .auth-right { padding: 32px 20px; min-height: 100vh; justify-content: flex-start; padding-top: 48px; }
  .auth-right-inner { max-width: 100%; }
  .tp-card { padding: 28px 20px; }

  /* Learn */
  .learn-layout { grid-template-columns: 1fr; }
  .lesson-list  { position: static; max-height: none; }
  .learn-hero   { padding: 32px 0; }
  .lesson-card  { padding: 20px 18px; }

  /* Admin */
  .admin-sidebar { display: none; }
  .admin-sidebar.open {
    display: block;
    position: fixed;
    top: var(--nav-h);
    left: 0; bottom: 0;
    z-index: 200;
    width: min(280px, 80vw);
    box-shadow: var(--sh-xl);
  }
  .admin-main  { padding: 18px 16px 60px; }
  .admin-menu-toggle { display: flex; }

  /* Hero */
  .hero { min-height: auto; padding: 48px 0 28px; }
  .hero-inner { grid-template-columns: 1fr; gap: 28px; }
  .hero-visual { display: none; }
  .hero h1 { font-size: clamp(1.7rem, 7vw, 2.4rem); }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; }

  /* Dash hero */
  .dash-hero { padding: 32px 0 28px; }

  /* Footer */
  .qe-footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .qe-footer-bottom { flex-direction: column; align-items: flex-start; }

  /* Cert */
  .cert-card { padding: 28px 20px; }
  .cert-actions { flex-direction: column; }

  /* Touch targets everywhere */
  .btn { min-height: 48px; }
  .form-control { min-height: 48px; font-size: 16px; } /* prevents iOS zoom */
  .filter-pill  { min-height: 40px; }

  /* Tables */
  .table-wrap { border-radius: var(--r-sm); }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .qe-footer-grid  { grid-template-columns: 1fr 1fr; }
  .hero-inner      { grid-template-columns: 1fr 320px; gap: 36px; }
  .learn-layout    { grid-template-columns: 240px 1fr; }
  .admin-sidebar   { width: 200px; }
  .admin-main      { padding: 24px 24px 60px; }
  .auth-left       { padding: 48px 40px; }
  .auth-right      { padding: 48px 40px; }
}

/* ═══════════════════════════════════════════════════════
   MISC / UTILS
═══════════════════════════════════════════════════════ */
.flex       { display: flex; }
.flex-col   { flex-direction: column; }
.items-center { align-items: center; }
.gap-2      { gap: 8px; }
.gap-3      { gap: 12px; }
.gap-4      { gap: 16px; }
.mt-auto    { margin-top: auto; }
.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; }

/* Scroll overlay on admin sidebar for mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 199;
}
.sidebar-overlay.open { display: block; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0ms !important;
    animation: none !important;
  }
}

/* Print */
@media print {
  .qe-nav, .qe-footer, .admin-sidebar, .print-actions, .lesson-list, .filter-bar { display: none !important; }
  body { background: #fff !important; padding-top: 0 !important; }
  .admin-main { padding: 0 !important; }
  .cert-card { box-shadow: none !important; border: 2px solid #000 !important; }
}
