/* ═══════════════════════════════════════════════════════════════
   GERDY LEARNING PORTAL — STYLESHEET
   Clean & Professional | Microsoft 365 aligned
═══════════════════════════════════════════════════════════════ */

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  --primary:       #0066CC;
  --primary-dark:  #004999;
  --primary-light: #E8F1FB;
  --accent:        #00A4EF;
  --success:       #107C10;
  --success-light: #DFF6DD;
  --warning:       #CA5010;
  --warning-light: #FDE9D6;
  --danger:        #A4262C;
  --danger-light:  #FDE7E9;
  --purple:        #5C2D91;
  --purple-light:  #EDE7F6;
  --teal:          #00838C;
  --teal-light:    #DDF6F7;

  --bg:            #F0F4F8;
  --surface:       #FFFFFF;
  --border:        #DCE3ED;
  --border-light:  #EEF2F7;

  --text:          #1A1A2E;
  --text-secondary:#5A6478;
  --text-muted:    #8E97A8;

  --topnav-h:      56px;
  --sidebar-w:     280px;
  --radius:        10px;
  --radius-sm:     6px;
  --shadow-sm:     0 1px 3px rgba(0,0,0,.08);
  --shadow:        0 2px 8px rgba(0,0,0,.10);
  --shadow-lg:     0 4px 20px rgba(0,0,0,.13);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
ul, ol { list-style: none; }
img { max-width: 100%; }

/* ── Top Navigation ────────────────────────────────────────── */
.topnav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--topnav-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  gap: 16px;
}
.topnav-left  { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.topnav-center{ display: flex; align-items: center; gap: 2px; flex: 1; justify-content: center; position: relative; }
.topnav-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; max-width: 460px; overflow: hidden; }

/* ── Category nav dropdown ─────────────────────────────────── */
.tnav-item { position: relative; }

.tnav-btn {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 12px; border-radius: var(--radius-sm);
  font-size: .83rem; font-weight: 600; color: var(--text);
  background: none; border: none; cursor: pointer;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.tnav-btn:hover,
.tnav-item.open .tnav-btn,
.tnav-item.active .tnav-btn { background: var(--primary-light); color: var(--primary); }

.tnav-icon {
  width: 22px; height: 22px; border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  font-size: .65rem; font-weight: 700; color: white;
  flex-shrink: 0; letter-spacing: -.3px;
}
.tnav-chevron {
  font-size: .68rem; color: var(--text-muted);
  transition: transform .2s; display: inline-block;
}
.tnav-item.open .tnav-chevron { transform: rotate(180deg); color: var(--primary); }

/* Dropdown panel */
.tnav-dropdown {
  position: absolute; top: calc(100% + 6px); left: 50%;
  transform: translateX(-50%) translateY(-6px);
  min-width: 300px; max-width: 340px;
  max-height: calc(100vh - 80px); overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden;
  transition: opacity .18s, transform .18s, visibility .18s;
  z-index: 200;
}
.tnav-item.open .tnav-dropdown {
  opacity: 1; visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Category header inside dropdown */
.tnav-cat-header {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px 10px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 1;
}
.tnav-cat-icon {
  width: 26px; height: 26px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: .68rem; font-weight: 700; color: white; flex-shrink: 0;
}
.tnav-cat-title { font-size: .83rem; font-weight: 700; color: var(--text); }

/* Track sections inside dropdown */
.tnav-track-list { padding: 6px 0 4px; }

.tnav-track-section { border-bottom: 1px solid var(--border-light); }
.tnav-track-section:last-child { border-bottom: none; }

.tnav-track-header {
  display: flex; align-items: center;
  padding: 2px 8px 2px 0;
}
.tnav-track-color {
  width: 3px; flex-shrink: 0; align-self: stretch;
  border-radius: 2px; margin: 4px 10px 4px 0;
}
.tnav-track-name-btn {
  flex: 1; display: flex; flex-direction: column; align-items: flex-start;
  gap: 2px; padding: 9px 6px 9px 0;
  background: none; border: none; cursor: pointer;
  text-align: left; font-family: var(--font);
  transition: background .12s; border-radius: var(--radius-sm);
}
.tnav-track-name-btn:hover { background: var(--primary-light); }
.tnav-track-name-btn.active { background: var(--primary-light); }
.tnav-track-name-btn.tnav-coming-soon { cursor: default; opacity: .5; }
.tnav-track-name-btn.tnav-coming-soon:hover { background: none; }

.tnav-track-title { font-size: .82rem; font-weight: 600; color: var(--text); }
.tnav-track-meta  { font-size: .72rem; color: var(--text-muted); }

.tnav-track-expand {
  width: 26px; height: 26px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem; color: var(--text-muted);
  background: none; border: none; cursor: pointer;
  border-radius: var(--radius-sm); transition: background .12s, transform .2s;
}
.tnav-track-expand:hover { background: var(--border-light); color: var(--text); }

/* Module list within a track section */
.tnav-track-modules { background: var(--bg); padding: 4px 0; }

.tnav-module-btn {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 7px 14px 7px 22px;
  background: none; border: none; cursor: pointer;
  text-align: left; transition: background .12s;
  font-family: var(--font);
}
.tnav-module-btn:hover { background: var(--primary-light); }
.tnav-module-btn.active { background: var(--primary-light); }

.tnav-mod-num {
  width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .67rem; font-weight: 700; flex-shrink: 0;
}
.tnav-mod-body { flex: 1; min-width: 0; }
.tnav-mod-title { font-size: .78rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tnav-mod-count { font-size: .68rem; color: var(--text-muted); }

.tnav-mod-done {
  font-size: .67rem; font-weight: 700; color: var(--success);
  background: var(--success-light); padding: 2px 6px;
  border-radius: 10px; flex-shrink: 0;
}

/* Divider between categories in top nav */
.tnav-divider {
  width: 1px; height: 20px; background: var(--border);
  margin: 0 2px; flex-shrink: 0;
}

.nav-home-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 8px 4px 4px;
  border-radius: var(--radius-sm);
  transition: background .15s;
}
.nav-home-btn:hover { background: var(--primary-light); }
.nav-logo-mark {
  width: 32px; height: 32px;
  background: var(--primary); color: #fff;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .9rem; flex-shrink: 0;
}
.nav-logo-text { font-weight: 600; font-size: .95rem; color: var(--text); }

.nav-breadcrumb {
  font-size: .82rem; color: var(--text-secondary);
  display: flex; align-items: center; gap: 6px;
  overflow: hidden; white-space: nowrap;
}
.nav-breadcrumb > *:not(:first-child)::before { content: '›'; margin-right: 6px; opacity: .5; }
.nav-breadcrumb .bc-current { color: var(--text); font-weight: 500; }
.nav-breadcrumb .bc-link {
  background: none; border: none; padding: 0; margin: 0;
  font-size: .82rem; color: var(--primary); cursor: pointer;
  font-family: inherit; text-decoration: underline; text-decoration-style: dotted;
  transition: color .15s;
}
.nav-breadcrumb .bc-link:hover { color: var(--primary-dark); }

.nav-progress-pill {
  background: var(--primary-light); color: var(--primary);
  padding: 3px 12px; border-radius: 20px;
  font-size: .78rem; font-weight: 600; white-space: nowrap;
}

/* ── App Layout ─────────────────────────────────────────────── */
.app-layout {
  display: flex;
  margin-top: var(--topnav-h);
  min-height: calc(100vh - var(--topnav-h));
}

/* ── Sidebar ────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  position: fixed;
  top: var(--topnav-h); left: 0;
  height: calc(100vh - var(--topnav-h));
  overflow-y: auto;
  overflow-x: hidden;
}
.sidebar-inner { padding: 16px 0 32px; }

.sidebar-empty {
  padding: 24px 20px;
  color: var(--text-muted);
  font-size: .85rem;
  text-align: center;
}

/* Sidebar sections */
.sb-section-title {
  font-size: .7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-muted);
  padding: 16px 20px 6px;
}
.sb-section-title:first-child { padding-top: 8px; }

.sb-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 20px;
  font-size: .88rem; color: var(--text-secondary);
  border-radius: 0;
  transition: background .12s, color .12s;
  cursor: pointer;
  width: 100%; text-align: left;
  border-left: 3px solid transparent;
}
.sb-item:hover { background: var(--bg); color: var(--text); }
.sb-item.active {
  background: var(--primary-light);
  color: var(--primary);
  border-left-color: var(--primary);
  font-weight: 600;
}
.sb-item.completed .sb-item-icon { color: var(--success); }
.sb-item-icon { width: 18px; flex-shrink: 0; font-size: .8rem; text-align: center; }
.sb-item-text { flex: 1; line-height: 1.3; }
.sb-item-badge {
  font-size: .7rem; font-weight: 600;
  background: var(--success-light); color: var(--success);
  padding: 1px 6px; border-radius: 10px;
}
.sb-item-badge.quiz { background: var(--primary-light); color: var(--primary); }

/* Sidebar progress bar */
.sb-progress-wrap { padding: 8px 20px 4px; }
.sb-progress-label {
  display: flex; justify-content: space-between;
  font-size: .72rem; color: var(--text-muted); margin-bottom: 4px;
}
.sb-progress-bar {
  height: 5px; background: var(--border); border-radius: 3px; overflow: hidden;
}
.sb-progress-fill {
  height: 100%; background: var(--success); border-radius: 3px;
  transition: width .4s ease;
}

/* ── Main Content ───────────────────────────────────────────── */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-height: calc(100vh - var(--topnav-h));
  overflow-x: hidden;
}

/* ── Views ──────────────────────────────────────────────────── */
.view { display: none; animation: fadeIn .2s ease; }
.view.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ═══════════════════════════════════════════════════════════════
   HOME VIEW
═══════════════════════════════════════════════════════════════ */
.home-hero {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 60%, var(--accent) 100%);
  color: white;
  padding: 56px 48px;
}
.home-hero-badge {
  display: inline-block;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.3);
  padding: 4px 14px; border-radius: 20px;
  font-size: .75rem; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; margin-bottom: 16px;
}
.home-hero-title {
  font-size: 2.4rem; font-weight: 700; line-height: 1.15;
  margin-bottom: 16px; letter-spacing: -.02em;
}
.home-hero-sub {
  font-size: 1.05rem; opacity: .85; max-width: 560px; line-height: 1.6;
}

/* Home stats bar */
.home-stats-bar {
  display: flex; gap: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.stat-item {
  flex: 1; padding: 20px 24px;
  border-right: 1px solid var(--border);
  text-align: center;
}
.stat-item:last-child { border-right: none; }
.stat-value {
  font-size: 1.8rem; font-weight: 700; color: var(--primary);
  line-height: 1;
}
.stat-label {
  font-size: .75rem; color: var(--text-muted);
  margin-top: 4px; text-transform: uppercase; letter-spacing: .05em;
}

/* ─── Start Here path ───────────────────────────────────────── */
.home-path {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 28px 40px 32px;
}
.home-path-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 20px; gap: 20px;
}
.home-path-eyebrow {
  display: inline-block;
  background: var(--primary-light); color: var(--primary);
  font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 3px 12px; border-radius: 20px; margin-bottom: 7px;
}
.home-path-title {
  font-size: 1.15rem; font-weight: 700; color: var(--text); margin: 0 0 4px;
}
.home-path-sub {
  font-size: .83rem; color: var(--text-secondary); margin: 0;
}
.home-path-pill {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 12px; padding: 10px 16px; text-align: center;
  flex-shrink: 0; min-width: 120px;
}
.home-path-pill-label {
  font-size: .68rem; color: var(--text-muted); text-transform: uppercase;
  letter-spacing: .05em; margin-bottom: 3px;
}
.home-path-pill-count {
  font-size: 1rem; font-weight: 700; color: var(--text); line-height: 1; margin-bottom: 5px;
}
.home-path-pill-bar  { height: 4px; background: var(--border); border-radius: 3px; overflow: hidden; }
.home-path-pill-fill { height: 100%; background: var(--primary); border-radius: 3px; transition: width .4s ease; }

.path-category-label {
  display: flex; align-items: center; gap: 10px;
  font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-muted); margin: 16px 0 8px;
}
.path-category-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.path-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.path-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px;
  cursor: pointer; transition: border-color .15s, background .15s;
}
.path-item:hover { border-color: var(--primary); background: var(--primary-light); }
.path-item.done  { opacity: .6; }

.path-num {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  background: var(--primary); color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 700; transition: background .2s;
}
.path-item.done .path-num { background: var(--success); }

.path-body { flex: 1; min-width: 0; }
.path-track-badge {
  display: inline-block; font-size: .65rem; font-weight: 700;
  padding: 2px 8px; border-radius: 10px; margin-bottom: 3px;
}
.path-title {
  font-size: .82rem; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.path-item.done .path-title { text-decoration: line-through; color: var(--text-muted); }
.path-why {
  font-size: .73rem; color: var(--text-muted); line-height: 1.4;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.path-arrow { color: var(--text-muted); font-size: 1rem; flex-shrink: 0; }

/* Continue cards */
.home-continue { padding: 32px 40px 8px; }
.continue-cards { display: flex; gap: 16px; flex-wrap: wrap; }
.continue-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 24px;
  min-width: 300px; flex: 1; cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .15s, transform .15s;
  display: flex; align-items: center; gap: 16px;
}
.continue-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.continue-card-icon {
  width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 700; color: white; flex-shrink: 0;
}
.continue-card-body { flex: 1; }
.continue-card-track { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.continue-card-title { font-size: .95rem; font-weight: 600; color: var(--text); margin: 2px 0; }
.continue-card-meta { font-size: .78rem; color: var(--text-muted); }
.continue-card-arrow { color: var(--text-muted); font-size: 1.2rem; flex-shrink: 0; }

/* Home tracks */
.home-tracks { padding: 32px 40px 48px; }
.section-heading {
  font-size: 1.15rem; font-weight: 700; color: var(--text);
  margin-bottom: 20px;
}

/* Track grid */
.track-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }

.track-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm); cursor: pointer;
  transition: box-shadow .15s, transform .15s;
  display: flex; flex-direction: column;
}
.track-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.track-card.coming-soon { opacity: .65; cursor: default; }
.track-card.coming-soon:hover { box-shadow: var(--shadow-sm); transform: none; }

.track-card-banner {
  height: 8px;
}
.track-card-body { padding: 24px; flex: 1; }
.track-card-header { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 12px; }
.track-card-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: .95rem; font-weight: 800; color: white; flex-shrink: 0;
}
.track-card-meta { flex: 1; }
.track-card-exam { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); }
.track-card-title { font-size: 1.05rem; font-weight: 700; color: var(--text); margin: 2px 0 0; }

.track-card-desc { font-size: .85rem; color: var(--text-secondary); line-height: 1.55; margin-bottom: 16px; }

.track-card-stats { display: flex; gap: 16px; margin-bottom: 16px; }
.track-stat { font-size: .78rem; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }
.track-stat-num { font-weight: 700; color: var(--text-secondary); }

.track-card-progress { margin-bottom: 4px; }
.track-progress-bar { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.track-progress-fill { height: 100%; border-radius: 3px; transition: width .4s ease; }
.track-progress-label { font-size: .72rem; color: var(--text-muted); margin-top: 5px; }

.track-card-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: space-between;
}
.track-btn {
  padding: 7px 18px;
  background: var(--primary); color: white;
  border-radius: var(--radius-sm);
  font-size: .82rem; font-weight: 600;
  transition: background .15s;
}
.track-btn:hover { background: var(--primary-dark); }
.track-coming-badge {
  padding: 5px 14px;
  background: var(--border-light); color: var(--text-muted);
  border-radius: 20px; font-size: .78rem; font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════
   VIEW HEADERS
═══════════════════════════════════════════════════════════════ */
.view-header {
  padding: 36px 48px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.view-header-top { display: flex; align-items: flex-start; gap: 20px; }
.view-header-icon {
  width: 56px; height: 56px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; font-weight: 800; color: white; flex-shrink: 0;
}
.view-header-body { flex: 1; }
.view-header-eyebrow { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); margin-bottom: 4px; }
.view-header-title { font-size: 1.7rem; font-weight: 700; color: var(--text); letter-spacing: -.02em; line-height: 1.2; }
.view-header-desc { font-size: .9rem; color: var(--text-secondary); margin-top: 8px; max-width: 700px; line-height: 1.6; }
.view-header-stats { display: flex; gap: 24px; margin-top: 16px; flex-wrap: wrap; }
.vh-stat { display: flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--text-muted); }
.vh-stat-icon { font-size: .85rem; }
.vh-stat strong { color: var(--text-secondary); }

/* ═══════════════════════════════════════════════════════════════
   TRACK VIEW
═══════════════════════════════════════════════════════════════ */
.track-body { display: flex; align-items: flex-start; padding: 32px 40px; gap: 28px; }
.module-list { flex: 1; display: flex; flex-direction: column; gap: 14px; }

.module-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm); cursor: pointer;
  transition: box-shadow .15s, transform .15s;
}
.module-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }

.module-card-header {
  display: flex; align-items: center; gap: 16px;
  padding: 20px 24px;
}
.module-num {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--primary-light); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .9rem; flex-shrink: 0;
}
.module-num.done { background: var(--success-light); color: var(--success); }
.module-card-body { flex: 1; }
.module-card-weighting { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.module-card-title { font-size: 1rem; font-weight: 700; color: var(--text); }
.module-card-desc { font-size: .83rem; color: var(--text-secondary); margin-top: 3px; }
.module-card-arrow { color: var(--text-muted); font-size: 1.1rem; }

.module-card-footer {
  padding: 12px 24px;
  border-top: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg);
}
.module-card-stats { display: flex; gap: 20px; }
.module-stat { font-size: .78rem; color: var(--text-muted); }
.module-stat strong { color: var(--text-secondary); }

.module-progress-wrap { display: flex; align-items: center; gap: 10px; }
.module-progress-bar { width: 80px; height: 5px; background: var(--border); border-radius: 3px; overflow: hidden; }
.module-progress-fill { height: 100%; background: var(--success); border-radius: 3px; transition: width .4s; }
.module-progress-pct { font-size: .72rem; font-weight: 600; color: var(--text-muted); }

/* Track sidebar panel */
.track-sidebar-panel {
  width: 260px; flex-shrink: 0;
}
.panel-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.panel-card-header { padding: 14px 18px; border-bottom: 1px solid var(--border-light); }
.panel-card-title { font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.panel-card-body { padding: 14px 18px; }
.panel-stat-row { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--border-light); }
.panel-stat-row:last-child { border-bottom: none; }
.panel-stat-label { font-size: .83rem; color: var(--text-secondary); }
.panel-stat-value { font-size: .83rem; font-weight: 600; color: var(--text); }
.exam-banner {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: white; padding: 16px 18px; border-radius: var(--radius);
  margin-bottom: 16px; text-align: center;
}
.exam-banner-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; opacity: .8; margin-bottom: 4px; }
.exam-banner-code { font-size: 1.4rem; font-weight: 800; }
.exam-banner-name { font-size: .8rem; opacity: .85; margin-top: 2px; }

/* ═══════════════════════════════════════════════════════════════
   MODULE VIEW
═══════════════════════════════════════════════════════════════ */
.lesson-list { padding: 28px 40px 48px; display: flex; flex-direction: column; gap: 10px; }

.lesson-item {
  display: flex; align-items: center; gap: 16px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 20px;
  cursor: pointer; transition: box-shadow .15s, border-color .15s;
}
.lesson-item:hover { box-shadow: var(--shadow); border-color: var(--primary); }
.lesson-item.completed { border-left: 4px solid var(--success); }
.lesson-item.quiz-item { border-left: 4px solid var(--primary); }

.lesson-num {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--bg); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: .82rem; font-weight: 600; color: var(--text-muted); flex-shrink: 0;
}
.lesson-num.done { background: var(--success-light); border-color: var(--success); color: var(--success); }
.lesson-num.quiz { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }

.lesson-item-body { flex: 1; }
.lesson-item-title { font-size: .95rem; font-weight: 600; color: var(--text); }
.lesson-item-meta { font-size: .78rem; color: var(--text-muted); margin-top: 2px; display: flex; gap: 12px; }

.lesson-item-right {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.lesson-item-status {
  padding: 3px 10px; border-radius: 20px;
  font-size: .72rem; font-weight: 600; flex-shrink: 0;
}
.lesson-item-status.complete { background: var(--success-light); color: var(--success); }
.lesson-item-status.in-progress { background: var(--primary-light); color: var(--primary); }
.lesson-item-status.locked { background: var(--border-light); color: var(--text-muted); }
.lesson-item-status.available { background: var(--border-light); color: var(--text-secondary); }

.lesson-activity-badge {
  font-size: .7rem; font-weight: 600; padding: 3px 8px;
  border-radius: 20px; white-space: nowrap; flex-shrink: 0;
}
.lesson-activity-badge.lab-done {
  background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0;
}
.lesson-activity-badge.fc-done {
  background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd;
}

.lesson-divider {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 0 4px;
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-muted);
}
.lesson-divider::before, .lesson-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ═══════════════════════════════════════════════════════════════
   LESSON VIEW
═══════════════════════════════════════════════════════════════ */
.lesson-top-bar {
  padding: 20px 40px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px;
}
.lesson-top-meta { flex: 1; }
.lesson-top-title { font-size: 1.3rem; font-weight: 700; color: var(--text); }
.lesson-top-sub { font-size: .82rem; color: var(--text-muted); margin-top: 2px; }
.lesson-top-progress { display: flex; align-items: center; gap: 10px; }
.lesson-progress-dots { display: flex; gap: 4px; }
.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--border);
  transition: background .2s;
}
.dot.active { background: var(--primary); }
.dot.done { background: var(--success); }

.lesson-layout { display: flex; gap: 0; }
.lesson-body { flex: 1; padding: 32px 40px 80px; max-width: 820px; }
.lesson-nav-panel {
  width: 220px; flex-shrink: 0;
  padding: 24px 20px;
  border-left: 1px solid var(--border-light);
  position: sticky; top: var(--topnav-h);
  max-height: calc(100vh - var(--topnav-h));
  overflow-y: auto;
}

/* Lesson sections */
.lesson-section { margin-bottom: 40px; }
.lesson-section-title {
  font-size: 1.05rem; font-weight: 700; color: var(--text);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary-light);
  display: flex; align-items: center; gap: 8px;
}
.section-icon { font-size: 1rem; }

/* Objectives list */
.objectives-list { display: flex; flex-direction: column; gap: 8px; }
.objective-item {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: .9rem; color: var(--text-secondary); line-height: 1.5;
}
.objective-bullet {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--primary-light); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: .65rem; font-weight: 700; flex-shrink: 0; margin-top: 2px;
}

/* Theory content */
.theory-intro {
  font-size: .95rem; color: var(--text-secondary); line-height: 1.7;
  margin-bottom: 24px; padding: 16px 20px;
  background: var(--bg); border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.theory-section { margin-bottom: 24px; }
.theory-heading {
  font-size: .98rem; font-weight: 700; color: var(--text);
  margin-bottom: 10px; cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  user-select: none;
}
.theory-heading:hover { color: var(--primary); }
.theory-toggle { font-size: .7rem; transition: transform .2s; }
.theory-toggle.open { transform: rotate(90deg); }
.theory-body {
  font-size: .88rem; color: var(--text-secondary); line-height: 1.75;
  overflow: hidden; transition: max-height .3s ease;
}
.theory-body p { margin-bottom: 12px; }
.theory-body p:last-child { margin-bottom: 0; }

/* Inline lesson diagrams */
.lesson-diagram-wrap {
  margin: 18px 0;
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
}
.lesson-diagram-svg { width: 100%; overflow-x: auto; }
.lesson-diagram-svg svg { max-width: 100%; height: auto; display: block; margin: 0 auto; }
/* Mermaid diagram container */
.lesson-diagram-mermaid { width: 100%; overflow-x: auto; }
.lesson-diagram-mermaid pre.mermaid { margin: 0; background: transparent; }
.lesson-diagram-mermaid svg { max-width: 100%; height: auto; display: block; margin: 0 auto; }
.lesson-diagram-caption {
  margin-top: 10px;
  font-size: .78rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Callouts */
.callout {
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin: 16px 0;
  border-left: 4px solid;
  display: flex; gap: 12px;
}
.callout-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }
.callout-content { flex: 1; }
.callout-title { font-size: .82rem; font-weight: 700; margin-bottom: 4px; text-transform: uppercase; letter-spacing: .04em; }
.callout-body { font-size: .85rem; line-height: 1.65; }

.callout.pro-tip { background: var(--purple-light); border-color: var(--purple); }
.callout.pro-tip .callout-title { color: var(--purple); }
.callout.msp-example { background: var(--primary-light); border-color: var(--primary); }
.callout.msp-example .callout-title { color: var(--primary); }
.callout.common-mistake { background: var(--danger-light); border-color: var(--danger); }
.callout.common-mistake .callout-title { color: var(--danger); }
.callout.watch-out { background: var(--warning-light); border-color: var(--warning); }
.callout.watch-out .callout-title { color: var(--warning); }

/* MSP Examples — collapsible accordion */
.msp-example-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); margin-bottom: 10px;
  border-left: 3px solid var(--primary); overflow: hidden;
}
.msp-example-heading {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 16px; cursor: pointer;
  font-size: .84rem; font-weight: 600; color: var(--text);
  user-select: none;
  transition: background .15s;
}
.msp-example-heading:hover { background: var(--primary-light); }
.msp-toggle {
  font-size: 1rem; color: var(--primary); flex-shrink: 0;
  transition: transform .25s; display: inline-block;
}
.msp-toggle.open { transform: rotate(90deg); }
.msp-example-body {
  max-height: 0; overflow: hidden;
  transition: max-height .3s ease;
  padding: 0 16px;
}
.msp-example-body.open { padding: 0 16px 14px; }
.msp-example-desc {
  font-size: .87rem; color: var(--text-secondary); line-height: 1.65;
  padding: 12px 0 4px;
}

/* Lab card */
.lab-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.lab-card-header {
  padding: 16px 20px;
  background: linear-gradient(135deg, #1A3A5C 0%, #0066CC 100%);
  color: white; display: flex; align-items: center; gap: 12px;
}
.lab-card-title-wrap { flex: 1; }
.lab-card-type { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; opacity: .8; margin-bottom: 2px; }
.lab-card-title { font-size: 1rem; font-weight: 700; }
.lab-time-badge {
  background: rgba(255,255,255,.2);
  padding: 4px 12px; border-radius: 20px;
  font-size: .78rem; font-weight: 600;
}
.lab-card-body { padding: 20px; }
.lab-steps { counter-reset: lab-step; display: flex; flex-direction: column; gap: 10px; }
.lab-step {
  counter-increment: lab-step;
  display: flex; gap: 12px; align-items: flex-start;
  font-size: .87rem; color: var(--text-secondary); line-height: 1.6;
}
.lab-step::before {
  content: counter(lab-step);
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--primary-light); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 700; flex-shrink: 0; margin-top: 2px;
}
.lab-outcome {
  margin-top: 16px; padding: 12px 16px;
  background: var(--success-light); border-radius: var(--radius-sm);
  font-size: .85rem; color: var(--success); line-height: 1.5;
  display: flex; gap: 8px; align-items: flex-start;
}

/* Summary card */
.summary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.summary-card-header {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 24px;
  background: linear-gradient(135deg, #f0f9f0 0%, #e6f4e6 100%);
  border-bottom: 1px solid #c3e0c3;
  cursor: pointer; user-select: none;
  transition: background .15s;
}
.summary-card-header:hover { background: linear-gradient(135deg, #e6f4e6 0%, #d6ead6 100%); }
.summary-card-icon { font-size: 1.8rem; flex-shrink: 0; }
.summary-card-title { font-size: 1rem; font-weight: 700; color: #1b5e1b; }
.summary-card-sub   { font-size: .75rem; color: #4a8a4a; margin-top: 2px; }
.summary-toggle {
  font-size: 1.1rem; color: #4a8a4a; flex-shrink: 0;
  transition: transform .25s; display: inline-block; margin-left: auto;
}
.summary-toggle.open { transform: rotate(90deg); }
.summary-list {
  display: flex; flex-direction: column;
  max-height: 0; overflow: hidden;
  transition: max-height .3s ease;
}
.summary-item {
  display: flex; gap: 14px; align-items: flex-start;
  font-size: .88rem; color: var(--text-secondary); line-height: 1.6;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border-light);
  transition: background .12s;
}
.summary-item:last-child { border-bottom: none; }
.summary-item:hover { background: var(--bg); }
.summary-check {
  color: var(--success); flex-shrink: 0;
  font-size: .82rem; font-weight: 700;
  margin-top: 3px; width: 16px; text-align: center;
}

/* Lesson nav panel */
.lnp-title { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); margin-bottom: 10px; }
.lnp-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: var(--radius-sm);
  font-size: .82rem; color: var(--text-muted); cursor: pointer;
  transition: background .12s, color .12s;
  text-align: left; width: 100%;
}
.lnp-item:hover { background: var(--bg); color: var(--text); }
.lnp-item.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.lnp-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }

/* Key Takeaways — right nav panel */
.lnp-kt-section {
  margin-top: 14px;
  border-top: 1px solid var(--border-light);
  padding-top: 12px;
}
.lnp-kt-title {
  font-size: .66rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--text-muted); margin-bottom: 8px;
}
.lnp-kt-item {
  display: flex; align-items: flex-start; gap: 6px;
  font-size: .72rem; color: var(--text-secondary);
  line-height: 1.45; margin-bottom: 7px;
}
.lnp-kt-check { color: var(--success); flex-shrink: 0; font-size: .75rem; margin-top: 1px; }

.lesson-complete-bar {
  margin-top: 40px; padding: 24px;
  background: linear-gradient(135deg, var(--primary-light), #EEF5FF);
  border: 1px solid var(--border); border-radius: var(--radius);
  text-align: center;
}
.lesson-complete-bar h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 6px; }
.lesson-complete-bar p { font-size: .85rem; color: var(--text-secondary); margin-bottom: 16px; }
.btn-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ═══════════════════════════════════════════════════════════════
   QUIZ VIEW
═══════════════════════════════════════════════════════════════ */
.quiz-container { max-width: 760px; margin: 0 auto; padding: 32px 40px 80px; }

.quiz-header { margin-bottom: 28px; text-align: center; }
.quiz-title { font-size: 1.4rem; font-weight: 700; color: var(--text); }
.quiz-subtitle { font-size: .88rem; color: var(--text-muted); margin-top: 6px; }

.quiz-progress-wrap { margin: 16px 0 24px; }
.quiz-progress-bar { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.quiz-progress-fill { height: 100%; background: var(--primary); border-radius: 4px; transition: width .3s ease; }
.quiz-progress-label { display: flex; justify-content: space-between; font-size: .75rem; color: var(--text-muted); margin-top: 5px; }

.question-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}
.question-num { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.question-text { font-size: 1rem; font-weight: 600; color: var(--text); line-height: 1.55; margin: 10px 0 20px; }

.options-list { display: flex; flex-direction: column; gap: 10px; }
.option-btn {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 16px;
  background: var(--bg); border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .88rem; color: var(--text); line-height: 1.5;
  cursor: pointer; transition: border-color .15s, background .15s;
  text-align: left; width: 100%;
}
.option-btn:hover:not(:disabled) { border-color: var(--primary); background: var(--primary-light); }
.option-btn.selected { border-color: var(--primary); background: var(--primary-light); }
.option-btn.correct { border-color: var(--success); background: var(--success-light); color: var(--success); }
.option-btn.incorrect { border-color: var(--danger); background: var(--danger-light); color: var(--danger); }
.option-btn:disabled { cursor: default; }
.option-letter {
  width: 22px; height: 22px; border-radius: 50%;
  background: white; border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 700; flex-shrink: 0;
}
.option-btn.selected .option-letter,
.option-btn.correct .option-letter  { background: var(--primary); border-color: var(--primary); color: white; }
.option-btn.incorrect .option-letter { background: var(--danger); border-color: var(--danger); color: white; }

.explanation-box {
  margin-top: 16px; padding: 14px 16px;
  background: var(--bg); border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary);
  font-size: .85rem; color: var(--text-secondary); line-height: 1.6;
}
.explanation-box strong { color: var(--text); }

.quiz-action-row { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }

/* Quiz result screen */
.quiz-result {
  text-align: center; padding: 40px 20px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.result-badge {
  width: 80px; height: 80px; border-radius: 50%;
  margin: 0 auto 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
}
.result-badge.pass { background: var(--success-light); color: var(--success); }
.result-badge.fail { background: var(--danger-light); color: var(--danger); }
.result-score { font-size: 3rem; font-weight: 800; line-height: 1; }
.result-score.pass { color: var(--success); }
.result-score.fail { color: var(--danger); }
.result-label { font-size: .85rem; color: var(--text-muted); margin: 4px 0 8px; }
.result-title { font-size: 1.3rem; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.result-desc { font-size: .88rem; color: var(--text-secondary); max-width: 400px; margin: 0 auto 24px; line-height: 1.6; }
.result-stats { display: flex; justify-content: center; gap: 32px; margin-bottom: 28px; }
.result-stat-item { text-align: center; }
.result-stat-num { font-size: 1.6rem; font-weight: 700; color: var(--text); }
.result-stat-label { font-size: .72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }

/* ═══════════════════════════════════════════════════════════════
   ADMIN MODE — Login, Badge, Editor Panel, Audit Log
═══════════════════════════════════════════════════════════════ */

/* ── Edit button in lesson top bar ──────────────────────────── */
.admin-edit-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: var(--radius-sm);
  background: var(--warning-light); color: var(--warning);
  border: 1px solid #f0b87a;
  font-size: .8rem; font-weight: 600;
  cursor: pointer; white-space: nowrap; flex-shrink: 0;
  transition: background .15s;
}
.admin-edit-btn:hover { background: #f8e0c8; }

.admin-edit-btn-disabled,
.admin-edit-btn-disabled:hover {
  background: var(--bg-subtle, #f0f0f0);
  color: var(--text-muted, #888);
  border-color: var(--border-light, #ddd);
  cursor: not-allowed;
  opacity: .75;
}

/* ── Admin nav badge ─────────────────────────────────────────── */
.admin-nav-badge {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 20px;
  background: var(--warning-light); color: var(--warning);
  border: 1px solid #f0b87a;
  font-size: .78rem; font-weight: 600; cursor: pointer;
  white-space: nowrap; transition: background .15s;
}
.admin-nav-badge:hover { background: #f8e0c8; }

/* ── Admin dropdown menu ─────────────────────────────────────── */
.admin-menu {
  position: fixed; z-index: 500;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
  min-width: 180px; overflow: hidden;
}
.admin-menu-item {
  display: block; width: 100%;
  padding: 10px 16px; text-align: left;
  font-size: .85rem; color: var(--text); background: none;
  cursor: pointer; transition: background .12s;
}
.admin-menu-item:hover { background: var(--bg); }
.admin-menu-danger { color: var(--danger); }
.admin-menu-danger:hover { background: var(--danger-light); }
.admin-menu-divider { height: 1px; background: var(--border); margin: 2px 0; }

/* ── Modal overlay backdrop ──────────────────────────────────── */
.admin-overlay {
  position: fixed; inset: 0; z-index: 800;
  background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}

/* ── Modal box ───────────────────────────────────────────────── */
.admin-modal {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 440px;
  display: flex; flex-direction: column; max-height: 90vh;
}
.admin-modal-wide { max-width: 860px; }

.admin-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px 14px;
  border-bottom: 1px solid var(--border);
}
.admin-modal-title { font-size: 1rem; font-weight: 700; color: var(--text); }
.admin-modal-close {
  width: 28px; height: 28px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem; color: var(--text-muted);
  cursor: pointer; transition: background .12s;
}
.admin-modal-close:hover { background: var(--bg); color: var(--text); }

.admin-modal-body { padding: 20px 24px; overflow-y: auto; }
.admin-modal-scroll { max-height: 60vh; overflow-y: auto; }

.admin-modal-note {
  font-size: .82rem; color: var(--text-secondary);
  background: var(--primary-light); border-radius: var(--radius-sm);
  padding: 10px 14px; margin-bottom: 18px; line-height: 1.55;
}

.admin-modal-footer {
  display: flex; gap: 10px; justify-content: flex-end;
  padding: 14px 24px; border-top: 1px solid var(--border);
}

/* ── Login form fields ───────────────────────────────────────── */
.admin-field-label {
  display: block; font-size: .8rem; font-weight: 600;
  color: var(--text-secondary); margin-bottom: 5px; margin-top: 14px;
}
.admin-field-label:first-of-type { margin-top: 0; }
.admin-field-input {
  width: 100%; padding: 8px 12px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: .88rem; color: var(--text); background: var(--surface);
  font-family: var(--font); transition: border-color .15s;
}
.admin-field-input:focus { outline: none; border-color: var(--primary); }
.admin-login-error {
  margin-top: 10px; padding: 8px 12px; border-radius: var(--radius-sm);
  background: var(--danger-light); color: var(--danger);
  font-size: .82rem; font-weight: 500;
}

/* ── Editor slide-in panel ───────────────────────────────────── */
.editor-panel {
  position: fixed; top: var(--topnav-h); right: 0; bottom: 0;
  width: 420px; z-index: 400;
  background: var(--surface); border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform .3s ease;
}
.editor-panel.open { transform: translateX(0); }

.editor-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.editor-panel-title { font-size: .95rem; font-weight: 700; color: var(--text); }
.editor-close-btn {
  width: 28px; height: 28px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem; color: var(--text-muted); cursor: pointer;
  transition: background .12s;
}
.editor-close-btn:hover { background: var(--bg); color: var(--text); }

.editor-panel-body {
  flex: 1; overflow-y: auto; padding: 16px 20px;
  display: flex; flex-direction: column; gap: 2px;
}
.editor-panel-footer {
  display: flex; gap: 10px; justify-content: flex-end;
  padding: 12px 20px; border-top: 1px solid var(--border); flex-shrink: 0;
}

.editor-admin-tag {
  font-size: .75rem; color: var(--text-muted);
  background: var(--bg); border-radius: var(--radius-sm);
  padding: 6px 10px; margin-bottom: 4px;
}
.editor-admin-tag strong { color: var(--warning); }
.editor-hint {
  font-size: .75rem; color: var(--text-muted);
  padding: 6px 10px; margin-bottom: 8px; line-height: 1.5;
}

.editor-format-hint {
  font-size: .7rem; color: var(--text-muted);
  margin-top: 5px; line-height: 1.5;
}
.editor-format-hint code {
  font-size: .68rem; background: var(--bg-muted, rgba(127,127,127,.15));
  padding: 1px 4px; border-radius: 3px;
}

.editor-field { margin-bottom: 14px; }
.editor-label {
  display: block; font-size: .75rem; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em;
  margin-bottom: 5px;
}
.editor-label-hint { font-weight: 400; text-transform: none; letter-spacing: 0; }
.editor-input {
  width: 100%; padding: 8px 10px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: .85rem; color: var(--text); background: var(--surface);
  font-family: var(--font); transition: border-color .15s;
}
.editor-input:focus { outline: none; border-color: var(--primary); }
.editor-textarea {
  width: 100%; padding: 8px 10px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: .85rem; color: var(--text); background: var(--surface);
  font-family: var(--font); line-height: 1.6; resize: vertical;
  transition: border-color .15s; min-height: 80px;
}
.editor-textarea:focus { outline: none; border-color: var(--primary); }
.editor-empty {
  padding: 24px; text-align: center;
  color: var(--text-muted); font-size: .88rem;
}
.editor-select { cursor: pointer; appearance: auto; }
.editor-section-heading {
  font-size: .8rem; font-weight: 700; color: var(--text);
  text-transform: uppercase; letter-spacing: .04em;
  margin: 20px 0 10px; padding-top: 14px; border-top: 1px solid var(--border);
}
.editor-section-heading:first-child { margin-top: 0; padding-top: 0; border-top: none; }

/* ── Audit log table ─────────────────────────────────────────── */
.audit-table {
  width: 100%; border-collapse: collapse;
  font-size: .82rem; color: var(--text);
}
.audit-table th {
  background: var(--bg); color: var(--text-muted);
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; padding: 10px 12px;
  border-bottom: 2px solid var(--border); text-align: left; white-space: nowrap;
}
.audit-table td {
  padding: 10px 12px; border-bottom: 1px solid var(--border-light);
  vertical-align: top; line-height: 1.5;
}
.audit-table tbody tr:hover td { background: var(--bg); }
.audit-time { font-size: .72rem; color: var(--text-muted); margin-top: 2px; }
.audit-count { text-align: center; font-weight: 700; color: var(--primary); }
.audit-empty { text-align: center; padding: 32px; color: var(--text-muted); }

.audit-changes { display: flex; flex-direction: column; gap: 6px; }
.audit-change-row {
  display: flex; flex-direction: column; gap: 2px;
  background: var(--bg); border-radius: var(--radius-sm);
  padding: 6px 8px; font-size: .75rem;
}
.audit-field { font-weight: 600; color: var(--text-muted); font-size: .7rem; }
.audit-diff { display: flex; align-items: flex-start; gap: 6px; flex-wrap: wrap; }
.audit-old { color: var(--danger); text-decoration: line-through; max-width: 240px; }
.audit-arrow { color: var(--text-muted); font-weight: 700; flex-shrink: 0; }
.audit-new  { color: var(--success); max-width: 240px; }
/* NOTE (2026-07-02): a CSS rule was found here with its selector and
   opening properties missing — likely a small circular avatar/counter
   badge (20x20, primary bg, white text) judging by the surviving
   properties, but nothing in app.js currently references a matching
   class name, so it was safely removed rather than guessed at. If this
   was meant to style something specific in the admin/audit UI, it'll
   need to be re-added with the correct selector. */

/* Inline code */
.md-code {
  font-family: 'Courier New', Courier, monospace;
  font-size: .8rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
  color: var(--danger);
}

/* Tables */
.md-table-wrap {
  overflow-x: auto;
  margin: 16px 0 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.md-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
}
.md-table th {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 2px solid var(--primary);
  white-space: nowrap;
}
.md-table td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
  vertical-align: top;
  line-height: 1.5;
}
.md-table tr:last-child td { border-bottom: none; }
.md-table tbody tr:nth-child(even) td { background: var(--bg); }
.md-table td strong { color: var(--text); }

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ═══════════════════════════════════════════════════════════════
   INLINE MICRO-EXERCISES
═══════════════════════════════════════════════════════════════ */
.inline-check {
  margin-top: 20px;
  border-top: 1px dashed var(--border);
  padding-top: 16px;
}
.inline-check-label {
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--teal); margin-bottom: 8px;
}
.inline-check-question {
  font-size: .9rem; font-weight: 600; color: var(--text);
  margin-bottom: 12px; line-height: 1.5;
}
.inline-check-options {
  display: flex; flex-direction: column; gap: 6px;
}
.inline-check-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-align: left; font-size: .85rem; color: var(--text);
  transition: border-color .15s, background .15s;
  width: 100%;
}
.inline-check-btn:hover:not(:disabled) {
  border-color: var(--primary); background: var(--primary-light);
}
.inline-check-btn:disabled { cursor: default; }
.inline-check-btn .ic-letter {
  display: flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--border-light); font-size: .75rem; font-weight: 700;
  flex-shrink: 0;
}
.inline-check-btn.correct {
  border-color: var(--success); background: var(--success-light);
}
.inline-check-btn.correct .ic-letter { background: var(--success); color: white; }
.inline-check-btn.incorrect {
  border-color: var(--danger); background: var(--danger-light);
}
.inline-check-btn.incorrect .ic-letter { background: var(--danger); color: white; }
.inline-check-feedback {
  display: none;
  margin-top: 12px; font-size: .84rem; color: var(--text-secondary);
  line-height: 1.6; padding: 10px 12px;
  background: var(--bg); border-radius: var(--radius-sm);
}
.ic-correct  { color: var(--success); font-weight: 700; margin-right: 4px; }
.ic-incorrect { color: var(--danger);  font-weight: 700; margin-right: 4px; }

/* ═══════════════════════════════════════════════════════════════
   FLASHCARD DRILL
═══════════════════════════════════════════════════════════════ */
.fc-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; font-size: .83rem; color: var(--text-secondary);
}
.fc-counter { font-weight: 700; color: var(--text); }
.fc-known-bar { display: flex; align-items: center; gap: 8px; }
.fc-bar {
  width: 80px; height: 6px; background: var(--border);
  border-radius: 3px; overflow: hidden;
}
.fc-bar-fill { height: 100%; background: var(--success); border-radius: 3px; transition: width .3s; }
.fc-known-count { font-size: .78rem; color: var(--success); font-weight: 600; }

.fc-card {
  perspective: 1000px;
  height: 200px; cursor: pointer; margin-bottom: 16px;
}
.fc-card-inner {
  width: 100%; height: 100%;
  transition: transform .5s;
  transform-style: preserve-3d;
  position: relative;
}
.fc-card-inner.flipped { transform: rotateY(180deg); }
.fc-card-front, .fc-card-back {
  position: absolute; width: 100%; height: 100%;
  backface-visibility: hidden;
  border-radius: var(--radius);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px; text-align: center;
  box-shadow: var(--shadow);
}
.fc-card-front {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
}
.fc-card-back {
  background: linear-gradient(135deg, var(--teal) 0%, #005f67 100%);
  color: white;
  transform: rotateY(180deg);
}
.fc-card-label {
  font-size: .65rem; font-weight: 700; letter-spacing: .1em;
  opacity: .7; margin-bottom: 12px; text-transform: uppercase;
}
.fc-card-text { font-size: 1.05rem; font-weight: 600; line-height: 1.5; }
.fc-tap-hint {
  position: absolute; bottom: 14px;
  font-size: .72rem; opacity: .6;
}
.fc-buttons {
  display: flex; gap: 10px; justify-content: center;
}
.fc-btn-review {
  flex: 1; padding: 10px;
  background: var(--warning-light); color: var(--warning);
  border: 1.5px solid var(--warning); border-radius: var(--radius-sm);
  font-weight: 600; font-size: .88rem; cursor: pointer;
  transition: background .15s, color .15s;
}
.fc-btn-known {
  flex: 1; padding: 10px;
  background: var(--success-light); color: var(--success);
  border: 1.5px solid var(--success); border-radius: var(--radius-sm);
  font-weight: 600; font-size: .88rem; cursor: pointer;
  transition: background .15s, color .15s;
}
.fc-btn-review:hover { background: var(--warning); color: white; }
.fc-btn-known:hover  { background: var(--success); color: white; }

.fc-complete {
  text-align: center; padding: 32px 20px;
}
.fc-complete-score {
  font-size: 3rem; font-weight: 800; color: var(--primary); line-height: 1;
}
.fc-complete-label { font-size: .9rem; color: var(--text-secondary); margin-bottom: 4px; }
.fc-complete-pct { font-size: 1.5rem; font-weight: 700; color: var(--text); margin-bottom: 12px; }
.fc-complete-msg { font-size: .9rem; color: var(--text-secondary); }

/* ═══════════════════════════════════════════════════════════════
   DECISION TREE — SCENARIO EXERCISE
═══════════════════════════════════════════════════════════════ */
.dt-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  overflow: hidden;
}

/* Header bar */
.dt-intro-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--primary-light); border-bottom: 1px solid var(--primary);
  padding: 10px 16px;
}
.dt-intro-label {
  font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--primary); white-space: nowrap;
}
.dt-intro-title { font-size: .85rem; font-weight: 600; color: var(--primary-dark); flex: 1; }
.dt-reset-link {
  font-size: .75rem; color: var(--primary); background: none; border: none;
  cursor: pointer; padding: 2px 6px; border-radius: var(--radius-sm);
  text-decoration: underline; white-space: nowrap;
}
.dt-reset-link:hover { background: rgba(0,102,204,.12); }

/* Decision trail */
.dt-trail {
  padding: 12px 20px 0;
  display: flex; flex-direction: column; gap: 4px;
  border-bottom: 1px dashed var(--border-light);
  padding-bottom: 12px;
}
.dt-trail-step {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: .76rem; color: var(--text-muted); line-height: 1.4;
}
.dt-trail-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--border); font-size: .65rem; font-weight: 700;
  flex-shrink: 0; color: var(--text-secondary);
}

/* Current situation */
.dt-situation {
  padding: 20px 20px 18px;
  font-size: .9rem; color: var(--text); line-height: 1.75;
  border-bottom: 1px dashed var(--border-light);
}

/* Choice buttons */
.dt-choices { padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 8px; }
.dt-choice-btn {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); background: var(--bg);
  text-align: left; font-size: .87rem; color: var(--text);
  cursor: pointer; width: 100%;
  transition: border-color .15s, background .15s, transform .12s;
}
.dt-choice-btn:hover {
  border-color: var(--primary); background: var(--primary-light);
  transform: translateX(4px);
}
.dt-choice-letter {
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--border-light); font-size: .75rem; font-weight: 700;
  flex-shrink: 0; color: var(--text-secondary);
  transition: background .15s, color .15s;
}
.dt-choice-btn:hover .dt-choice-letter { background: var(--primary); color: white; }

/* Outcome screen */
.dt-outcome {
  margin: 16px 20px 20px; border-radius: var(--radius-sm);
  padding: 20px; text-align: center; border: 1.5px solid var(--border);
}
.dt-outcome.success { border-color: var(--success); background: var(--success-light); }
.dt-outcome.fail    { border-color: var(--danger);  background: var(--danger-light); }
.dt-outcome.partial { border-color: var(--warning); background: #fffbe6; }
.dt-outcome-icon { font-size: 2.2rem; margin-bottom: 6px; }
.dt-outcome-label {
  font-size: .78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; margin-bottom: 12px;
}
.dt-outcome.success .dt-outcome-label { color: var(--success); }
.dt-outcome.fail    .dt-outcome-label { color: var(--danger); }
.dt-outcome.partial .dt-outcome-label { color: var(--warning, #b45309); }
.dt-feedback {
  font-size: .85rem; color: var(--text-secondary);
  line-height: 1.65; text-align: left; margin-bottom: 4px;
}

/* ═══════════════════════════════════════════════════════════════
   LAB EXERCISE — RIGHT NAV BUTTON
═══════════════════════════════════════════════════════════════ */
.lnp-lab-btn {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; margin-top: 14px; padding: 10px 14px;
  background: var(--surface); border: 1.5px solid var(--primary);
  border-radius: var(--radius-sm); cursor: pointer;
  font-size: .82rem; font-weight: 600; color: var(--primary);
  transition: background .15s, color .15s, box-shadow .15s;
  text-align: left;
}
.lnp-lab-btn:hover {
  background: var(--primary); color: white; box-shadow: 0 2px 6px rgba(0,102,204,.25);
}
.lnp-lab-time {
  font-size: .72rem; font-weight: 400; opacity: .75;
}
.lnp-lab-btn:hover .lnp-lab-time { opacity: .9; }

/* ═══════════════════════════════════════════════════════════════
   LAB EXERCISE — MODAL
═══════════════════════════════════════════════════════════════ */
.lab-modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,.55); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .25s;
  padding: 20px;
}
.lab-modal-overlay.open { opacity: 1; }

.lab-modal {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  width: 100%; max-width: 680px; max-height: 88vh;
  display: flex; flex-direction: column;
  transform: translateY(16px); transition: transform .25s;
  overflow: hidden;
}
.lab-modal-overlay.open .lab-modal { transform: translateY(0); }

.lab-modal-header {
  display: flex; align-items: center; gap: 12px; flex-shrink: 0;
  padding: 16px 20px;
  background: linear-gradient(135deg, #1a5fa8 0%, var(--primary) 100%);
  color: white;
}
.lab-modal-icon { font-size: 1.4rem; }
.lab-modal-title { font-size: .95rem; font-weight: 700; flex: 1; }
.lab-modal-badge {
  font-size: .72rem; background: rgba(255,255,255,.2);
  padding: 3px 10px; border-radius: 20px; white-space: nowrap;
}
.lab-modal-close {
  background: rgba(255,255,255,.15); border: none; border-radius: 50%;
  width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 1.1rem; color: white; flex-shrink: 0;
  transition: background .15s;
}
.lab-modal-close:hover { background: rgba(255,255,255,.3); }

.lab-modal-body {
  overflow-y: auto; flex: 1; padding: 20px 24px;
}

.lab-modal-footer {
  flex-shrink: 0; border-top: 1px solid var(--border);
  padding: 12px 24px; display: flex; justify-content: flex-end;
}
.lab-modal-footer-btn {
  padding: 9px 20px; background: var(--primary); color: white;
  border: none; border-radius: var(--radius-sm); font-size: .87rem;
  font-weight: 600; cursor: pointer; transition: background .15s;
}
.lab-modal-footer-btn:hover { background: var(--primary-dark); }

/* Flashcard modal — teal header to distinguish from lab */
.fc-modal-header {
  background: linear-gradient(135deg, #005f67 0%, var(--teal) 100%) !important;
}
/* Flashcard modal body — no extra padding; fc-* components handle their own */
.fc-modal-body { padding: 16px 20px; }

/* Flashcard nav button */
.lnp-fc-btn {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; margin-top: 8px; padding: 10px 14px;
  background: var(--surface); border: 1.5px solid var(--teal);
  border-radius: var(--radius-sm); cursor: pointer;
  font-size: .82rem; font-weight: 600; color: var(--teal);
  transition: background .15s, color .15s, box-shadow .15s;
  text-align: left;
}
.lnp-fc-btn:hover {
  background: var(--teal); color: white;
  box-shadow: 0 2px 6px rgba(0,95,103,.25);
}

/* Knowledge Check nav button */
.lnp-kc-btn {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; margin-top: 8px; padding: 10px 14px;
  background: var(--surface); border: 1.5px solid var(--purple);
  border-radius: var(--radius-sm); cursor: pointer;
  font-size: .82rem; font-weight: 600; color: var(--purple);
  transition: background .15s, color .15s, box-shadow .15s;
  text-align: left;
}
.lnp-kc-btn:hover {
  background: var(--purple); color: white;
  box-shadow: 0 2px 6px rgba(92,45,145,.25);
}

/* Completed state for Lab / Flashcard / Knowledge Check nav buttons */
.lnp-lab-btn.lnp-btn-done {
  border-color: var(--success); color: var(--success);
}
.lnp-lab-btn.lnp-btn-done:hover { background: var(--success); color: white; box-shadow: 0 2px 6px rgba(22,163,74,.25); }
.lnp-fc-btn.lnp-btn-done  {
  border-color: var(--success); color: var(--success);
}
.lnp-fc-btn.lnp-btn-done:hover  { background: var(--success); color: white; box-shadow: 0 2px 6px rgba(22,163,74,.25); }
.lnp-kc-btn.lnp-btn-done {
  border-color: var(--success); color: var(--success);
}
.lnp-kc-btn.lnp-btn-done:hover { background: var(--success); color: white; box-shadow: 0 2px 6px rgba(22,163,74,.25); }

/* Lab modal footer — two buttons side by side */
.lab-modal-footer { gap: 10px; }
.lab-modal-footer-secondary {
  background: var(--bg); color: var(--text-secondary);
  border: 1.5px solid var(--border);
}
.lab-modal-footer-secondary:hover { background: var(--border-light); color: var(--text); }
.lab-modal-footer-complete {
  background: var(--success); color: white;
}
.lab-modal-footer-complete:hover { background: #15803d; }

/* Responsive */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .main-content { margin-left: 0; }
  .track-body { flex-direction: column; padding: 16px; }
  .track-sidebar-panel { width: 100%; }
  .lesson-nav-panel { display: none; }
  .home-hero { padding: 32px 24px; }
  .home-hero-title { font-size: 1.8rem; }
  .home-tracks, .home-continue { padding: 24px; }
  .lesson-body { padding: 20px 24px 60px; }
  .quiz-container { padding: 20px 16px 60px; }
}

/* ═══════════════════════════════════════════════════════════════
   SEARCH — search bar, results panel, filters, highlighting
═══════════════════════════════════════════════════════════════ */
.topnav-search {
  position: relative;
  flex: 0 1 320px;
  min-width: 180px;
  display: flex;
  align-items: center;
}
.search-trigger-mobile { display: none; font-size: 1.05rem; padding: 6px 10px; border-radius: var(--radius-sm); }
.search-trigger-mobile:hover { background: var(--primary-light); }
.search-mobile-header { display: none; }

.search-bar-wrap {
  display: flex; align-items: center; gap: 8px;
  width: 100%;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 7px 12px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.topnav-search.search-open .search-bar-wrap,
.search-bar-wrap:focus-within {
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.search-bar-icon { font-size: .85rem; opacity: .55; flex-shrink: 0; }
.search-bar-input {
  border: none; background: transparent; outline: none;
  font-family: var(--font); font-size: .85rem; color: var(--text);
  flex: 1; min-width: 0;
}
.search-bar-input::placeholder { color: var(--text-muted); }
.search-bar-clear {
  font-size: .7rem; color: var(--text-muted); flex-shrink: 0;
  padding: 2px 5px; border-radius: 50%;
}
.search-bar-clear:hover { background: var(--border-light); color: var(--text); }
.search-bar-kbd {
  font-family: var(--font); font-size: .68rem; color: var(--text-muted);
  border: 1px solid var(--border); border-radius: 4px;
  padding: 1px 6px; flex-shrink: 0; background: var(--surface);
}
.topnav-search.search-open .search-bar-kbd,
.search-bar-input:not(:placeholder-shown) ~ .search-bar-kbd { display: none; }

/* ── Results panel ─────────────────────────────────────────── */
.search-results-panel {
  position: absolute; top: calc(100% + 8px); left: 0;
  width: 440px; max-width: 90vw;
  max-height: 70vh; overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 200;
}

.search-filter-bar {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 10px 12px; border-bottom: 1px solid var(--border-light);
  position: sticky; top: 0; background: var(--surface); z-index: 1;
}
.search-filter-chip {
  font-size: .72rem; font-weight: 600; color: var(--text-secondary);
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 999px; padding: 4px 10px; white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
}
.search-filter-chip:hover { border-color: var(--primary); color: var(--primary); }
.search-filter-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.search-filter-sep { width: 1px; align-self: stretch; background: var(--border); margin: 2px 4px; }

.search-results-list { padding: 6px; }
.search-result-item {
  display: flex; gap: 10px; align-items: flex-start;
  width: 100%; text-align: left;
  padding: 10px 10px; border-radius: var(--radius-sm);
  transition: background .12s;
}
.search-result-item:hover, .search-result-item.kb-active { background: var(--primary-light); }
.search-result-icon { font-size: 1.05rem; flex-shrink: 0; margin-top: 1px; }
.search-result-body { min-width: 0; flex: 1; }
.search-result-title { font-size: .86rem; font-weight: 700; color: var(--text); line-height: 1.35; }
.search-result-meta { font-size: .7rem; color: var(--text-muted); margin-top: 2px; }
.search-result-snippet {
  font-size: .75rem; color: var(--text-secondary); margin-top: 5px; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.search-result-matchtag {
  font-size: .66rem; color: var(--primary); font-weight: 600; margin-top: 5px;
  text-transform: uppercase; letter-spacing: .02em;
}
.search-result-item mark, .search-result-snippet mark {
  background: #FEF3C7; color: #92400E; border-radius: 2px; padding: 0 1px; font-weight: 700;
}

/* ── Empty / no-results states ─────────────────────────────── */
.search-empty-state { padding: 14px 16px 16px; }
.search-section-label {
  font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-muted); margin: 10px 0 8px;
}
.search-section-label:first-child { margin-top: 0; }
.search-chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.search-suggest-chip {
  font-size: .75rem; font-weight: 600; color: var(--text);
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 999px; padding: 5px 12px;
  transition: background .15s, border-color .15s, color .15s;
}
.search-suggest-chip:hover { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }
.search-no-results { font-size: .82rem; color: var(--text-secondary); margin-bottom: 4px; }

/* ── Mobile ────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .topnav-search { flex: 0 0 auto; min-width: 0; }
  .search-bar-wrap { display: none; }
  .search-trigger-mobile { display: inline-flex; align-items: center; justify-content: center; }

  .topnav-search.search-mobile-open {
    position: fixed; inset: 0; z-index: 500;
    background: var(--surface); display: flex; flex-direction: column;
    padding: 10px 14px;
  }
  .topnav-search.search-mobile-open .search-trigger-mobile { display: none; }
  .topnav-search.search-mobile-open .search-mobile-header {
    display: flex; align-items: center; justify-content: space-between;
    padding-bottom: 10px; border-bottom: 1px solid var(--border-light); margin-bottom: 10px;
  }
  .search-mobile-title { font-weight: 700; font-size: .95rem; }
  .search-mobile-close { font-size: 1rem; padding: 6px 10px; border-radius: var(--radius-sm); }
  .search-mobile-close:hover { background: var(--border-light); }
  .topnav-search.search-mobile-open .search-bar-wrap { display: flex; }
  .topnav-search.search-mobile-open .search-results-panel {
    position: static; width: 100%; max-width: none; flex: 1;
    max-height: none; box-shadow: none; border: none; margin-top: 10px;
    display: block !important;
  }
}

/* ═══════════════════════════════════════════════════════════════
   HOME PAGE REDESIGN (2026-07-07)
   Full-width home, Start Here summary card, vendor track sections
═══════════════════════════════════════════════════════════════ */

/* Hide the lesson sidebar on home + Start Here views */
body.no-sidebar .sidebar { display: none; }
body.no-sidebar .main-content { margin-left: 0; }

/* Compact hero */
.home-hero { padding: 36px 40px; }
.home-hero-title { font-size: 1.9rem; margin-bottom: 10px; }
.home-hero-sub { font-size: .95rem; }

/* "Next Up" stat */
.stat-item.stat-next { text-align: left; flex: 1.8; cursor: pointer; transition: background .15s; min-width: 0; }
.stat-item.stat-next:hover { background: var(--primary-light); }
.stat-item.stat-next .stat-label { margin-top: 0; color: var(--primary); font-weight: 700; }
.stat-next-title { font-size: .92rem; font-weight: 700; color: var(--text); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-next-meta { font-size: .72rem; color: var(--text-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Start Here summary card (home) */
.home-start-card-wrap { padding: 28px 40px 8px; }
.start-card {
  display: flex; align-items: stretch;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  cursor: pointer; overflow: hidden;
  transition: box-shadow .15s, transform .15s;
}
.start-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.start-card-banner { width: 6px; background: linear-gradient(180deg, var(--primary), var(--accent)); flex-shrink: 0; }
.start-card-icon {
  width: 52px; height: 52px; border-radius: 12px;
  background: var(--primary-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; flex-shrink: 0; align-self: center; margin-left: 24px;
}
.start-card-body { flex: 1; min-width: 0; padding: 20px 24px; }
.start-card-eyebrow { font-size: .68rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--primary); }
.start-card-title { font-size: 1.1rem; font-weight: 700; color: var(--text); margin: 3px 0 4px; }
.start-card-desc { font-size: .83rem; color: var(--text-secondary); margin-bottom: 12px; }
.start-card-cta { display: flex; align-items: center; padding: 0 24px; flex-shrink: 0; }
.start-card-next {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 12px; padding: 7px 12px;
  background: var(--primary-light); border: 1px solid transparent;
  border-radius: 999px; max-width: 100%;
  transition: border-color .15s, background .15s;
}
.start-card-next:hover { border-color: var(--primary); }
.start-card-next-label { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--primary); flex-shrink: 0; }
.start-card-next-title { font-size: .8rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.start-card-next-arrow { color: var(--primary); font-weight: 700; flex-shrink: 0; }

/* Vendor track sections */
.track-section { margin-bottom: 36px; }
.track-section:last-child { margin-bottom: 0; }
.track-section-heading {
  display: flex; align-items: center; gap: 10px;
  font-size: .95rem; font-weight: 700; color: var(--text);
  margin-bottom: 14px;
}
.track-section-heading::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.track-section-icon {
  width: 26px; height: 26px; border-radius: 7px; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .62rem; font-weight: 700; flex-shrink: 0;
}
.track-section-count { font-size: .7rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }

/* Start Here dedicated page */
.start-here-page { padding: 32px 40px 48px; max-width: 1100px; margin: 0 auto; }

@media (max-width: 760px) {
  .home-hero { padding: 28px 20px; }
  .home-hero-title { font-size: 1.5rem; }
  .home-start-card-wrap { padding: 20px 16px 4px; }
  .start-card { flex-direction: column; }
  .start-card-banner { width: 100%; height: 6px; }
  .start-card-icon { margin: 20px 0 0 20px; }
  .start-card-cta { padding: 0 20px 20px; }
  .start-here-page { padding: 24px 16px 40px; }
}

/* ── Home track cards: module breakdown + practice summary (2026-07-08) ── */
.track-card { position: relative; }
.track-complete-badge {
  position: absolute; top: 16px; right: 16px; z-index: 2;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--warning-light); color: var(--warning);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem; box-shadow: var(--shadow-sm);
}
.track-card.track-complete { border-color: var(--success); }

.track-section-label {
  font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-muted); margin: 16px 0 10px;
}

.track-modules { margin-top: 6px; }
.track-module-row { margin-bottom: 11px; }
.track-module-row:last-child { margin-bottom: 0; }
.track-module-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 4px; }
.track-module-name { font-size: .8rem; color: var(--text); display: flex; align-items: center; gap: 6px; }
.track-module-tick {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--success); color: #fff; font-size: .6rem; font-weight: 700; flex-shrink: 0;
}
.track-module-count { font-size: .76rem; color: var(--text-muted); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.track-module-count.done { color: var(--success); font-weight: 700; }
.track-module-bar { height: 4px; background: var(--border); border-radius: 3px; overflow: hidden; }
.track-module-fill { height: 100%; border-radius: 3px; transition: width .4s ease; }
.track-module-fill.done { background: var(--success); }

.track-practice { margin-top: 14px; padding-top: 2px; border-top: 1px solid var(--border-light); }
.track-practice-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.track-practice-row:last-child { margin-bottom: 0; }
.track-practice-label { font-size: .8rem; color: var(--text); }
.track-practice-pill { font-size: .72rem; font-weight: 700; padding: 3px 11px; border-radius: 20px; white-space: nowrap; }
.track-practice-pill.is-done     { background: var(--success-light); color: var(--success); }
.track-practice-pill.is-progress { background: var(--warning-light); color: var(--warning); }
.track-practice-pill.is-none     { background: var(--border-light); color: var(--text-muted); }
.track-practice-pill.is-locked   { background: var(--border-light); color: var(--text-muted); }

/* ── Locked module assessment row (2026-07-08) ── */
.lesson-item.quiz-item.locked { cursor: default; opacity: .8; }
.lesson-item.quiz-item.locked:hover { box-shadow: none; transform: none; background: var(--surface); }
.lesson-num.quiz.locked { background: var(--border-light); color: var(--text-muted); }
.lesson-item-status.locked {
  background: var(--border-light); color: var(--text-muted);
  padding: 4px 12px; border-radius: 20px; font-size: .72rem; font-weight: 700; white-space: nowrap;
}

/* ── Track detail: module status chips + header trophy (2026-07-08) ── */
.vh-trophy { font-size: .85em; margin-left: 6px; }
.module-card.done { border-color: var(--success); }
.module-chips { display: flex; flex-wrap: wrap; gap: 7px; padding: 12px 24px 16px; }
.mod-chip { font-size: .72rem; font-weight: 700; padding: 3px 10px; border-radius: 20px; white-space: nowrap; }
.mod-chip.is-done     { background: var(--success-light); color: var(--success); }
.mod-chip.is-progress { background: var(--warning-light); color: var(--warning); }
.mod-chip.is-none     { background: var(--border-light); color: var(--text-muted); }

/* ── Top nav Gerdy Solutions logo (2026-07-08) ── */
.nav-logo-img { height: 30px; width: auto; display: block; }
.nav-logo-text { border-left: 1px solid var(--border); padding-left: 10px; margin-left: 2px; }

/* ══════════════════════════════════════════════════════════════
   Admin User Stats Dashboard (2026-07-10)
══════════════════════════════════════════════════════════════ */
.admin-dashboard-page { padding: 28px 32px 60px; max-width: 1200px; margin: 0 auto; }

.admin-dash-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.admin-dash-title { font-size: 1.4rem; font-weight: 800; color: var(--text); }
.admin-dash-sub { font-size: .85rem; color: var(--text-muted); margin-top: 4px; }

.admin-error-box {
  background: var(--danger-light); color: var(--danger); border-radius: var(--radius);
  padding: 16px 20px; font-size: .88rem;
}

.admin-stall-banner {
  background: var(--warning-light); color: var(--warning); border-radius: var(--radius);
  padding: 12px 18px; font-size: .85rem; font-weight: 600; margin-bottom: 18px;
}

/* Summary + leaderboard cards */
.admin-summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 24px; }
.admin-summary-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow-sm); text-align: center;
}
.admin-summary-value { font-size: 1.6rem; font-weight: 800; color: var(--primary); line-height: 1.2; }
.admin-summary-label { font-size: .74rem; color: var(--text-muted); margin-top: 4px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.admin-summary-lb { display: flex; align-items: center; gap: 12px; text-align: left; }
.admin-summary-lb-icon { font-size: 1.6rem; flex-shrink: 0; }
.admin-summary-lb-name { font-size: .92rem; font-weight: 700; color: var(--text); line-height: 1.3; }
.admin-summary-lb .admin-summary-label { text-transform: none; letter-spacing: normal; font-weight: 500; margin-top: 2px; }

/* Toolbar: search + sort */
.admin-roster-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.admin-search-input {
  flex: 1; min-width: 220px; padding: 9px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: .88rem; font-family: var(--font); background: var(--surface);
}
.admin-search-input:focus { outline: none; border-color: var(--primary); }
.admin-sort-controls { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.admin-sort-btn {
  background: none; border: 1px solid var(--border); border-radius: 20px; padding: 5px 12px;
  font-size: .78rem; font-weight: 600; color: var(--text-secondary); cursor: pointer; transition: all .12s;
}
.admin-sort-btn:hover { border-color: var(--primary); color: var(--primary); }
.admin-sort-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* Roster: card grid */
.admin-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.admin-user-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow-sm); cursor: pointer; transition: box-shadow .15s, transform .15s;
  position: relative;
}
.admin-user-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.admin-user-card-top { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.admin-user-card-id { flex: 1; min-width: 0; }
.admin-user-card-name { font-size: .92rem; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-user-card-email { font-size: .74rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-user-card-meta { display: flex; justify-content: space-between; font-size: .74rem; color: var(--text-muted); margin-top: 8px; }
.admin-stall-badge {
  margin-top: 10px; display: inline-block; background: var(--warning-light); color: var(--warning);
  font-size: .7rem; font-weight: 700; padding: 3px 10px; border-radius: 20px;
}

.admin-user-avatar {
  width: 38px; height: 38px; border-radius: 50%; background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .82rem; flex-shrink: 0;
}
.admin-user-avatar-lg { width: 56px; height: 56px; font-size: 1.1rem; }

.admin-role-badge { font-size: .68rem; font-weight: 700; padding: 3px 9px; border-radius: 20px; white-space: nowrap; }
.admin-role-admin { background: var(--purple-light); color: var(--purple); }
.admin-role-learner { background: var(--primary-light); color: var(--primary); }

.admin-roster-bar-wrap { height: 6px; background: var(--border-light); border-radius: 3px; overflow: hidden; }
.admin-roster-bar-fill { height: 100%; background: var(--primary); border-radius: 3px; transition: width .3s ease; }
.admin-roster-muted { font-size: .74rem; color: var(--text-muted); }
.admin-roster-empty { padding: 24px; text-align: center; color: var(--text-muted); font-size: .85rem; grid-column: 1 / -1; }

/* Roster table (assessment history, still tabular) */
.admin-roster-table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.admin-roster-table th {
  text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted);
  padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--bg);
}
.admin-roster-table td { padding: 12px 16px; border-bottom: 1px solid var(--border-light); font-size: .86rem; color: var(--text); }
.admin-roster-table tr:last-child td { border-bottom: none; }

.admin-score-badge { font-size: .74rem; font-weight: 700; padding: 3px 10px; border-radius: 20px; }
.admin-score-badge.is-pass { background: var(--success-light); color: var(--success); }
.admin-score-badge.is-fail { background: var(--danger-light); color: var(--danger); }

/* Per-user header */
.admin-user-header {
  display: flex; align-items: center; gap: 18px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 24px; box-shadow: var(--shadow-sm); flex-wrap: wrap;
}
.admin-user-name { font-size: 1.15rem; font-weight: 800; color: var(--text); display: flex; align-items: center; gap: 10px; }
.admin-user-email { font-size: .84rem; color: var(--text-secondary); margin-top: 2px; }
.admin-user-meta { font-size: .78rem; color: var(--text-muted); margin-top: 4px; }
.admin-user-headline-stats { display: flex; gap: 22px; margin-left: auto; }

/* Track breakdown blocks */
.admin-track-block-list { display: flex; flex-direction: column; gap: 14px; }
.admin-track-block { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; box-shadow: var(--shadow-sm); }
.admin-track-block-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.admin-track-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.admin-track-block-title { font-weight: 700; font-size: .92rem; color: var(--text); flex: 1; }
.admin-track-block-pct { font-weight: 700; color: var(--primary); font-size: .88rem; }
.admin-track-block-meta { font-size: .76rem; color: var(--text-muted); margin-top: 6px; }
.admin-module-chip-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.admin-module-chip { font-size: .72rem; font-weight: 600; padding: 3px 10px; border-radius: 20px; background: var(--border-light); color: var(--text-muted); }
.admin-module-chip.is-done { background: var(--success-light); color: var(--success); }
.admin-module-chip.is-progress { background: var(--warning-light); color: var(--warning); }

/* Heatmap */
.admin-heatmap-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm); overflow-x: auto; }
.admin-heatmap-grid { display: flex; gap: 3px; width: max-content; }
.admin-heatmap-col { display: flex; flex-direction: column; gap: 3px; }
.admin-heatmap-cell { width: 11px; height: 11px; border-radius: 2px; background: var(--border-light); }
.admin-heatmap-cell.is-empty { background: transparent; }
.admin-heatmap-cell.level-0 { background: var(--border-light); }
.admin-heatmap-cell.level-1 { background: #C6E4C6; }
.admin-heatmap-cell.level-2 { background: #8FCB8F; }
.admin-heatmap-cell.level-3 { background: var(--success); }
.admin-heatmap-cell.level-4 { background: #0A5C0A; }
.admin-heatmap-legend { display: flex; align-items: center; gap: 4px; margin-top: 12px; font-size: .72rem; color: var(--text-muted); }
.admin-heatmap-legend .admin-heatmap-cell { width: 10px; height: 10px; }

/* Chronological logs (activity + sessions) */
.admin-daylog-list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); max-height: 340px; overflow-y: auto; }
.admin-daylog-item { display: flex; justify-content: space-between; gap: 14px; padding: 10px 18px; border-bottom: 1px solid var(--border-light); font-size: .82rem; }
.admin-daylog-item:last-child { border-bottom: none; }
.admin-daylog-item span:first-child { color: var(--text-muted); flex-shrink: 0; }
.admin-daylog-item span:last-child { color: var(--text); text-align: right; }

/* Content flags */
.admin-flag-list { display: flex; flex-direction: column; gap: 8px; }
.admin-flag-item {
  display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 16px; font-size: .82rem;
}
.admin-flag-item > div { flex: 1; }
.admin-flag-lesson { font-weight: 600; color: var(--text); }

@media (max-width: 640px) {
  .admin-dashboard-page { padding: 20px 16px 48px; }
  .admin-user-header { flex-direction: column; align-items: flex-start; }
  .admin-user-headline-stats { margin-left: 0; }
}
