/* ============================================================
   Lumina LMS — Design System
   Enterprise AI-First · RTL · Responsive
   ============================================================ */
:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --primary-soft: rgba(99,102,241,.12);
  --secondary: #8b5cf6;
  --accent: #06b6d4;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;

  --bg: #0b1220;
  --bg-elevated: #111827;
  --bg-card: #1a2332;
  --bg-soft: #243044;
  --border: rgba(148,163,184,.14);
  --border-strong: rgba(148,163,184,.28);

  --text: #e8eef7;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --shadow: 0 10px 40px rgba(0,0,0,.35);
  --shadow-sm: 0 4px 16px rgba(0,0,0,.2);
  --font: "Vazirmatn", "Tahoma", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;

  --sidebar-w: 272px;
  --topbar-h: 64px;
  --grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #06b6d4 100%);
  --grad-soft: linear-gradient(135deg, rgba(99,102,241,.2), rgba(139,92,246,.15));
  --glow: 0 0 40px rgba(99,102,241,.35);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary-light); text-decoration: none; transition: .2s; }
a:hover { color: #c7d2fe; }
img { max-width: 100%; height: auto; display: block; }
button, input, select, textarea { font-family: inherit; }
h1,h2,h3,h4,h5 { line-height: 1.3; font-weight: 700; margin: 0 0 .75rem; }
p { margin: 0 0 1rem; color: var(--text-muted); }
ul { padding-inline-start: 1.2rem; }

/* Light theme override for print/certs */
.theme-light {
  --bg: #f8fafc; --bg-elevated: #fff; --bg-card: #fff; --bg-soft: #f1f5f9;
  --text: #0f172a; --text-muted: #475569; --border: #e2e8f0;
}

/* Layout shell */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, #0f172a 0%, #111827 100%);
  border-left: 1px solid var(--border);
  position: fixed; inset-block: 0; inset-inline-start: 0;
  z-index: 100; display: flex; flex-direction: column;
  transition: transform .3s ease;
}
.sidebar-brand {
  display: flex; align-items: center; gap: .75rem;
  padding: 1.25rem 1.25rem 1rem; border-bottom: 1px solid var(--border);
}
.sidebar-brand .logo {
  width: 42px; height: 42px; border-radius: 12px;
  background: var(--grad); display: grid; place-items: center;
  font-weight: 800; color: #fff; box-shadow: var(--glow); font-size: 1.1rem;
}
.sidebar-brand .brand-text strong { display: block; font-size: 1.1rem; }
.sidebar-brand .brand-text span { font-size: .75rem; color: var(--text-dim); }
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: .75rem .65rem 1rem;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
}
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(148,163,184,.25); border-radius: 8px; }
.nav-section { font-size: .7rem; letter-spacing: .06em; color: var(--text-dim); padding: .75rem .75rem .35rem; text-transform: uppercase; }
.nav-group { margin-bottom: .35rem; }
.nav-group-toggle {
  width: 100%;
  display: flex; align-items: center; gap: .65rem;
  padding: .65rem .75rem;
  border: 0; border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font: inherit; font-size: .88rem; font-weight: 700;
  cursor: pointer; text-align: right;
  transition: .15s background, .15s color;
}
.nav-group-toggle:hover { background: var(--bg-soft); color: var(--text); }
.nav-group.is-open > .nav-group-toggle {
  background: rgba(99,102,241,.1);
  color: #c7d2fe;
}
.nav-group-toggle .nav-label { flex: 1; min-width: 0; }
.nav-group-toggle .nav-caret {
  display: inline-grid; place-items: center;
  opacity: .7; transition: transform .2s ease;
  transform: rotate(-90deg);
}
.nav-group.is-open > .nav-group-toggle .nav-caret { transform: rotate(90deg); }
.nav-group-toggle .icon,
.nav-group-toggle .icon svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-group-body {
  padding: .15rem .2rem .35rem .35rem;
  border-inline-start: 2px solid rgba(99,102,241,.25);
  margin-inline-start: .85rem;
  margin-bottom: .25rem;
}
.nav-group-body .nav-link {
  padding: .55rem .7rem;
  font-size: .86rem;
  margin-bottom: .1rem;
}
.nav-link {
  display: flex; align-items: center; gap: .7rem;
  padding: .7rem .85rem; border-radius: var(--radius-sm);
  color: var(--text-muted); margin-bottom: .2rem; font-size: .92rem;
  position: relative;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.nav-link .nav-label { flex: 1; min-width: 0; }
.nav-link:hover { background: var(--bg-soft); color: var(--text); }
.nav-link.active,
.nav-link[aria-current="page"] {
  background: linear-gradient(90deg, rgba(99,102,241,.28), rgba(99,102,241,.1) 70%);
  color: #eef2ff;
  font-weight: 800;
  border-color: rgba(129,140,248,.35);
  box-shadow:
    inset 3px 0 0 #818cf8,
    0 0 0 1px rgba(99,102,241,.12),
    0 6px 16px rgba(99,102,241,.12);
}
[dir=rtl] .nav-link.active,
[dir=rtl] .nav-link[aria-current="page"] {
  background: linear-gradient(270deg, rgba(99,102,241,.28), rgba(99,102,241,.1) 70%);
  box-shadow:
    inset -3px 0 0 #818cf8,
    0 0 0 1px rgba(99,102,241,.12),
    0 6px 16px rgba(99,102,241,.12);
}
.nav-link.active .icon,
.nav-link[aria-current="page"] .icon {
  color: #a5b4fc;
  opacity: 1;
  filter: drop-shadow(0 0 6px rgba(129,140,248,.55));
}
.nav-link.active .nav-label,
.nav-link[aria-current="page"] .nav-label {
  color: #eef2ff;
}
.nav-active-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #a5b4fc;
  box-shadow: 0 0 0 3px rgba(129,140,248,.25);
  flex-shrink: 0;
}
.nav-group.is-open:has(.nav-link.active) > .nav-group-toggle,
.nav-group.is-open:has(.nav-link[aria-current="page"]) > .nav-group-toggle {
  color: #e0e7ff;
  background: rgba(99,102,241,.16);
  border: 1px solid rgba(129,140,248,.2);
}
.nav-link .icon { width: 22px; height: 22px; display:inline-grid; place-items:center; opacity: .95; flex-shrink:0; }
.nav-link .icon svg, .nav-link svg.i { width: 18px; height: 18px; }
.topbar-title { font-size: .95rem; font-weight: 700; max-width: 42vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 720px) {
  .topbar-title.hide-sm { display: none; }
}

/* ── Page help: topbar trigger + body-level drawer (click-only, no layout clash) ── */
.page-help-trigger {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  height: 36px;
  padding: 0 .75rem 0 .55rem;
  border-radius: 999px;
  border: 1px solid rgba(129, 140, 248, .35);
  background: linear-gradient(135deg, rgba(99,102,241,.18), rgba(6,182,212,.1));
  color: var(--primary-light, #a5b4fc);
  font-family: inherit;
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease, background .15s ease;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1;
}
.page-help-trigger:hover,
.page-help-trigger[aria-expanded="true"] {
  border-color: rgba(129, 140, 248, .7);
  box-shadow: 0 0 0 3px rgba(99,102,241,.15);
  color: #e0e7ff;
  transform: translateY(-1px);
}
.page-help-trigger-ico {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(99,102,241,.25);
  color: #c7d2fe;
}
.page-help-trigger-ico svg { width: 14px; height: 14px; }
@media (max-width: 520px) {
  .page-help-trigger-txt { display: none; }
  .page-help-trigger { width: 36px; padding: 0; justify-content: center; }
}

.page-help-overlay {
  position: fixed;
  inset: 0;
  z-index: 320;
  background: rgba(2, 6, 23, .58);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.page-help-overlay.is-on {
  opacity: 1;
  pointer-events: auto;
}
.page-help-drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  inset-inline-end: 0;
  width: min(440px, 100vw);
  z-index: 330;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1200px 400px at 100% 0%, rgba(99,102,241,.16), transparent 55%),
    var(--bg-elevated, #111827);
  border-inline-start: 1px solid var(--border, rgba(148,163,184,.14));
  box-shadow: -18px 0 48px rgba(0,0,0,.45);
  transform: translateX(110%);
  transition: transform .28s cubic-bezier(.22, 1, .36, 1);
  pointer-events: none;
  max-height: 100dvh;
}
[dir=rtl] .page-help-drawer {
  transform: translateX(-110%);
  box-shadow: 18px 0 48px rgba(0,0,0,.45);
}
.page-help-drawer.is-on {
  transform: translateX(0);
  pointer-events: auto;
}
/* hidden attribute hides; JS clears it before .is-on animation */
.page-help-drawer:not([hidden]) { display: flex; }
.page-help-overlay:not([hidden]) { display: block; }

.page-help-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .85rem;
  padding: 1.15rem 1.2rem 1rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(99,102,241,.1), transparent);
  flex-shrink: 0;
}
.page-help-head-main { min-width: 0; flex: 1; }
.page-help-kicker {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--primary-light, #a5b4fc);
  margin-bottom: .35rem;
}
.page-help-kicker-ico { display: grid; place-items: center; opacity: .9; }
.page-help-title {
  margin: 0 0 .45rem;
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.35;
  color: var(--text);
}
.page-help-lead {
  margin: 0;
  color: var(--text-muted);
  font-size: .9rem;
  line-height: 1.75;
}
.page-help-x {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.04);
  color: var(--text-muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: .15s;
}
.page-help-x:hover {
  color: var(--text);
  border-color: rgba(239,68,68,.45);
  background: rgba(239,68,68,.12);
}

.page-help-body {
  padding: 1rem 1.15rem 1.5rem;
  overflow-y: auto;
  flex: 1;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.ph-block {
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem 1rem 1.05rem;
  margin-bottom: .85rem;
}
.ph-block.ph-about {
  background: linear-gradient(145deg, rgba(99,102,241,.1), rgba(6,182,212,.05));
  border-color: rgba(99,102,241,.22);
}
.ph-block-h {
  display: flex;
  align-items: center;
  gap: .55rem;
  margin-bottom: .7rem;
}
.ph-block-h h3 {
  margin: 0;
  font-size: .95rem;
  font-weight: 800;
}
.ph-badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 .55rem;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 800;
  background: rgba(99,102,241,.2);
  color: #c7d2fe;
  white-space: nowrap;
}
.ph-badge-steps { background: rgba(16,185,129,.18); color: #6ee7b7; }
.ph-badge-tips { background: rgba(245,158,11,.18); color: #fcd34d; }
.ph-badge-keys { background: rgba(59,130,246,.18); color: #93c5fd; }
.ph-badge-rel { background: rgba(139,92,246,.18); color: #d8b4fe; }

.ph-about-text {
  margin: 0;
  color: var(--text);
  line-height: 1.85;
  font-size: .92rem;
}

.ph-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .65rem;
}
.ph-steps li {
  display: flex;
  gap: .7rem;
  align-items: flex-start;
  padding: .65rem .7rem;
  border-radius: 12px;
  background: rgba(0,0,0,.18);
  border: 1px solid rgba(148,163,184,.08);
}
.ph-step-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: .78rem;
  font-weight: 800;
  background: var(--grad, linear-gradient(135deg,#6366f1,#8b5cf6));
  color: #fff;
}
.ph-step-txt {
  flex: 1;
  font-size: .9rem;
  line-height: 1.75;
  color: var(--text);
  padding-top: .15rem;
}

.ph-tips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .45rem;
}
.ph-tips li {
  position: relative;
  padding: .55rem .75rem .55rem 2rem;
  border-radius: 12px;
  background: rgba(245,158,11,.07);
  border: 1px solid rgba(245,158,11,.12);
  font-size: .88rem;
  line-height: 1.7;
  color: var(--text);
}
.ph-tips li::before {
  content: "";
  position: absolute;
  inset-inline-start: .75rem;
  top: .85rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245,158,11,.2);
}

.ph-keys {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.ph-keys li code,
.ph-path code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .8rem;
  padding: .35rem .55rem;
  border-radius: 8px;
  background: rgba(0,0,0,.28);
  border: 1px solid var(--border);
  color: #e2e8f0;
  display: inline-block;
  direction: ltr;
}
.ph-related {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}
.ph-rel-chip {
  display: inline-flex;
  align-items: center;
  padding: .4rem .75rem;
  border-radius: 999px;
  border: 1px solid rgba(139,92,246,.35);
  background: rgba(139,92,246,.1);
  color: #e9d5ff;
  text-decoration: none;
  font-size: .8rem;
  font-weight: 600;
  transition: .15s;
}
.ph-rel-chip:hover {
  background: rgba(139,92,246,.22);
  border-color: rgba(167,139,250,.7);
}

.ph-foot {
  background: transparent;
  border-style: dashed;
}
.ph-foot-txt {
  margin: 0 0 .75rem;
  font-size: .82rem;
  line-height: 1.75;
  color: var(--text-muted);
}
.ph-foot-txt kbd {
  display: inline-block;
  padding: .1rem .35rem;
  border-radius: 6px;
  border: 1px solid var(--border-strong, rgba(148,163,184,.28));
  background: rgba(255,255,255,.06);
  font-size: .75rem;
  font-family: inherit;
  direction: ltr;
}
.ph-path {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  font-size: .75rem;
  color: var(--text-dim);
}
.ph-path span { font-weight: 700; }

body.page-help-open { overflow: hidden; }
body.page-help-open .va-root { z-index: 200; } /* keep voice under help when both open */

body.theme-light .page-help-drawer {
  background:
    radial-gradient(1200px 400px at 100% 0%, rgba(99,102,241,.1), transparent 55%),
    #fff;
  box-shadow: -18px 0 48px rgba(15,23,42,.12);
}
body.theme-light .ph-steps li { background: #f8fafc; }
body.theme-light .ph-tips li { background: #fffbeb; }
body.theme-light .page-help-trigger {
  background: linear-gradient(135deg, rgba(99,102,241,.1), rgba(6,182,212,.06));
  color: #4f46e5;
}
svg.i { display:inline-block; vertical-align:middle; flex-shrink:0; }
.icon-wrap svg.i { width: 22px; height: 22px; }
.fi svg.i { width: 24px; height: 24px; color:#fff; }
.stat .icon-wrap { color: var(--primary-light); }
.btn svg.i { width: 16px; height: 16px; }
.badge svg.i { width: 12px; height: 12px; }
.icon-btn svg.i { width: 18px; height: 18px; }
.level-orb { font-variant-numeric: tabular-nums; }
.badge-medal svg.i { width: 22px; height: 22px; }
.course-thumb svg.i { width: 42px; height: 42px; opacity: .85; color: var(--primary-light); }
.float-card svg.i { width: 16px; height: 16px; }
/* Emoji fallback font stack when still used */
body { font-family: var(--font), "Noto Color Emoji", "Apple Color Emoji", "Segoe UI Emoji", sans-serif; }
.nav-link .badge-dot {
  margin-inline-start: auto; background: var(--danger);
  color: #fff; font-size: .65rem; padding: .1rem .4rem; border-radius: 999px;
}
.sidebar-footer { padding: 1rem; border-top: 1px solid var(--border); }

.main-wrap { flex: 1; margin-inline-start: var(--sidebar-w); min-width: 0; }
.topbar {
  height: var(--topbar-h); display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.5rem; border-bottom: 1px solid var(--border);
  background: rgba(11,18,32,.75); backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 50;
}
.topbar-search {
  display: flex; align-items: center; gap: .5rem;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 999px; padding: .45rem 1rem; min-width: 260px;
}
.topbar-search input {
  background: transparent; border: 0; outline: 0; color: var(--text); width: 100%;
}
.topbar-actions {
  display: flex; align-items: center; gap: .65rem;
  flex-wrap: nowrap; min-width: 0;
}
.topbar-actions .page-help-trigger { order: -1; } /* help first in actions, always visible */
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--bg-card); color: var(--text); cursor: pointer;
  display: grid; place-items: center; position: relative;
}
.icon-btn:hover { border-color: var(--primary); }
.icon-btn .ping {
  position: absolute; top: 6px; inset-inline-end: 6px;
  width: 8px; height: 8px; background: var(--danger); border-radius: 50%;
}
.user-chip {
  display: flex; align-items: center; gap: .6rem;
  padding: .3rem .6rem .3rem .3rem; border-radius: 999px;
  background: var(--bg-card); border: 1px solid var(--border); cursor: pointer;
}
.user-chip img, .avatar {
  width: 34px; height: 34px; border-radius: 50%; object-fit: cover;
}
.avatar-lg { width: 72px; height: 72px; border-radius: 50%; }
.content { padding: 1.5rem; max-width: 1400px; }

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem; gap: 1rem; flex-wrap: wrap;
}
.card-title { font-size: 1.05rem; margin: 0; }
.card-glass {
  background: linear-gradient(180deg, rgba(26,35,50,.9), rgba(26,35,50,.7));
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
}

/* Grid */
.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 1100px) {
  .grid-4, .grid-5 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; }
  .sidebar { transform: translateX(110%); }
  [dir=rtl] .sidebar { transform: translateX(-110%); }
  .sidebar.open { transform: none; }
  .main-wrap { margin-inline-start: 0; }
  .topbar-search { display: none; }
  .content { padding: 1rem; }
}

/* Stat widgets */
.stat {
  position: relative; overflow: hidden;
  padding: 1.25rem; border-radius: var(--radius);
  background: var(--bg-card); border: 1px solid var(--border);
}
.stat::after {
  content: ''; position: absolute; inset-inline-end: -20px; top: -20px;
  width: 100px; height: 100px; border-radius: 50%;
  background: var(--grad-soft); filter: blur(10px);
}
.stat .label { color: var(--text-muted); font-size: .85rem; margin-bottom: .35rem; }
.stat .value { font-size: 1.75rem; font-weight: 800; letter-spacing: -.02em; }
.stat .hint { font-size: .78rem; color: var(--text-dim); margin-top: .35rem; }
.stat .icon-wrap {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary-light); margin-bottom: .75rem; font-size: 1.2rem;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .65rem 1.15rem; border-radius: var(--radius-sm);
  border: 1px solid transparent; font-weight: 600; font-size: .9rem;
  cursor: pointer; transition: .2s; line-height: 1.2; white-space: nowrap;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary {
  background: var(--grad); color: #fff; box-shadow: 0 8px 24px rgba(99,102,241,.35);
}
.btn-primary:hover { filter: brightness(1.08); color: #fff; transform: translateY(-1px); }
.btn-secondary {
  background: var(--bg-soft); color: var(--text); border-color: var(--border);
}
.btn-secondary:hover { border-color: var(--primary-light); color: #fff; }
.btn-ghost { background: transparent; color: var(--text-muted); border-color: transparent; }
.btn-ghost:hover { background: var(--bg-soft); color: var(--text); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: rgba(239,68,68,.15); color: #fca5a5; border-color: rgba(239,68,68,.3); }
.btn-sm { padding: .4rem .75rem; font-size: .8rem; border-radius: var(--radius-xs); }
.btn-lg { padding: .9rem 1.5rem; font-size: 1rem; }
.btn-block { width: 100%; }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-label { display: block; margin-bottom: .4rem; font-size: .88rem; color: var(--text-muted); font-weight: 600; }
.form-control, .form-select, textarea.form-control {
  width: 100%; padding: .7rem .9rem;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); outline: 0;
  transition: .2s;
}
.form-control:focus, .form-select:focus, textarea.form-control:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft);
}
textarea.form-control { min-height: 110px; resize: vertical; }
.form-hint { font-size: .78rem; color: var(--text-dim); margin-top: .3rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }
.input-group { display: flex; gap: .5rem; }

/* Badges & chips */
.badge {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .2rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 600;
  background: var(--bg-soft); color: var(--text-muted);
}
.badge-primary { background: var(--primary-soft); color: #c7d2fe; }
.badge-success { background: rgba(16,185,129,.15); color: #6ee7b7; }
.badge-warning { background: rgba(245,158,11,.15); color: #fcd34d; }
.badge-danger { background: rgba(239,68,68,.15); color: #fca5a5; }
.badge-info { background: rgba(59,130,246,.15); color: #93c5fd; }

/* Progress */
.progress {
  height: 8px; background: var(--bg-soft); border-radius: 999px; overflow: hidden;
}
.progress > span {
  display: block; height: 100%; border-radius: 999px;
  background: var(--grad); transition: width .5s ease;
}
.progress-lg { height: 12px; }

/* Tables */
.table-wrap { overflow-x: auto; }
table.data {
  width: 100%; border-collapse: collapse; font-size: .9rem;
}
table.data th, table.data td {
  padding: .85rem 1rem; text-align: right; border-bottom: 1px solid var(--border);
}
table.data th { color: var(--text-dim); font-weight: 600; font-size: .78rem; letter-spacing: .04em; }
table.data tr:hover td { background: rgba(255,255,255,.02); }

/* Alerts / flash */
.alert {
  padding: .9rem 1.1rem; border-radius: var(--radius-sm); margin-bottom: 1rem;
  border: 1px solid var(--border); display: flex; gap: .75rem; align-items: flex-start;
}
.alert-success { background: rgba(16,185,129,.1); border-color: rgba(16,185,129,.3); color: #a7f3d0; }
.alert-error, .alert-danger { background: rgba(239,68,68,.1); border-color: rgba(239,68,68,.3); color: #fecaca; }
.alert-info { background: rgba(59,130,246,.1); border-color: rgba(59,130,246,.3); color: #bfdbfe; }
.alert-warning { background: rgba(245,158,11,.1); border-color: rgba(245,158,11,.3); color: #fde68a; }

/* Course cards */
.course-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: .25s; display: flex; flex-direction: column;
}
.course-card:hover { transform: translateY(-4px); border-color: rgba(99,102,241,.4); box-shadow: var(--glow); }
.course-thumb {
  height: 150px; background: var(--grad-soft);
  display: grid; place-items: center; font-size: 2.5rem; position: relative;
}
.course-thumb .level-tag {
  position: absolute; top: .75rem; inset-inline-start: .75rem;
}
.course-body { padding: 1.1rem; flex: 1; display: flex; flex-direction: column; }
.course-body h3 { font-size: 1.05rem; margin-bottom: .35rem; }
.course-meta { display: flex; flex-wrap: wrap; gap: .5rem; margin: .75rem 0; font-size: .8rem; color: var(--text-dim); }
.course-footer { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: .5rem; }

/* XP / gamification */
.xp-bar-wrap { margin: .5rem 0 0; }
.level-orb {
  width: 88px; height: 88px; border-radius: 50%;
  background: var(--grad); display: grid; place-items: center;
  font-size: 1.6rem; font-weight: 800; color: #fff;
  box-shadow: var(--glow); position: relative;
}
.level-orb small { position: absolute; bottom: -4px; font-size: .65rem; background: var(--bg-elevated); padding: .15rem .5rem; border-radius: 999px; border: 1px solid var(--border); }
.badge-medal {
  width: 64px; height: 64px; border-radius: 16px;
  display: grid; place-items: center; font-size: 1.6rem;
  border: 1px solid var(--border); background: var(--bg-soft);
}
.badge-medal.locked { filter: grayscale(1); opacity: .45; }
.streak-fire { color: #f97316; font-weight: 800; }

/* AI chat */
.ai-layout { display: grid; grid-template-columns: 260px 1fr; gap: 1rem; min-height: 70vh; }
@media (max-width: 900px) { .ai-layout { grid-template-columns: 1fr; } }
.chat-panel {
  display: flex; flex-direction: column; height: calc(100vh - 140px); min-height: 480px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.chat-messages { flex: 1; overflow-y: auto; padding: 1.25rem; display: flex; flex-direction: column; gap: 1rem; }
.bubble {
  max-width: 85%; padding: .9rem 1.1rem; border-radius: 16px; line-height: 1.7; font-size: .95rem;
  white-space: pre-wrap; word-break: break-word;
}
.bubble-user {
  align-self: flex-start; background: var(--primary); color: #fff;
  border-bottom-right-radius: 4px;
}
.bubble-ai {
  align-self: flex-end; background: var(--bg-soft); border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.chat-input {
  display: flex; gap: .5rem; padding: 1rem; border-top: 1px solid var(--border); background: var(--bg-elevated);
}
.chat-input textarea {
  flex: 1; min-height: 48px; max-height: 120px; resize: none;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); padding: .7rem .9rem;
}

/* Learn player */
.learn-shell { display: grid; grid-template-columns: 300px 1fr; min-height: 100vh; }
.learn-sidebar {
  background: var(--bg-elevated); border-left: 1px solid var(--border);
  overflow-y: auto; position: sticky; top: 0; height: 100vh; padding: 1rem;
}
.learn-main { padding: 1.5rem 2rem; max-width: 900px; }
.lesson-item {
  display: flex; align-items: center; gap: .6rem; padding: .55rem .7rem;
  border-radius: 8px; color: var(--text-muted); font-size: .88rem; margin-bottom: .15rem;
}
.lesson-item:hover { background: var(--bg-soft); color: var(--text); }
.lesson-item.active { background: var(--primary-soft); color: #c7d2fe; }
.lesson-item.done { color: var(--success); }
.lesson-check {
  width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border-strong);
  display: grid; place-items: center; font-size: .65rem; flex-shrink: 0;
}
.lesson-item.done .lesson-check { background: var(--success); border-color: var(--success); color: #fff; }
@media (max-width: 900px) {
  .learn-shell { grid-template-columns: 1fr; }
  .learn-sidebar { position: relative; height: auto; max-height: 240px; }
  .learn-main { padding: 1rem; }
}

/* Micro cards flip */
.flip-card { perspective: 1000px; height: 280px; cursor: pointer; }
.flip-inner {
  position: relative; width: 100%; height: 100%; transition: transform .6s;
  transform-style: preserve-3d;
}
.flip-card.flipped .flip-inner { transform: rotateY(180deg); }
.flip-face {
  position: absolute; inset: 0; backface-visibility: hidden;
  border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--bg-card); display: grid; place-items: center;
  padding: 2rem; text-align: center; font-size: 1.15rem; font-weight: 600;
}
.flip-back { transform: rotateY(180deg); background: linear-gradient(160deg, #1e1b4b, #1a2332); color: #e0e7ff; }

/* Landing */
.landing-nav {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.25rem 5%; position: sticky; top: 0; z-index: 50;
  background: rgba(11,18,32,.8); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border);
}
.hero {
  padding: 5rem 5% 4rem; display: grid; grid-template-columns: 1.2fr 1fr; gap: 3rem; align-items: center;
}
.hero h1 {
  font-size: clamp(2rem, 4.5vw, 3.4rem); line-height: 1.2;
  background: linear-gradient(90deg, #fff, #a5b4fc, #67e8f9);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.hero-lead { font-size: 1.15rem; max-width: 36rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }
.hero-visual {
  position: relative; border-radius: 24px; padding: 1.5rem;
  background: var(--grad-soft); border: 1px solid var(--border);
  box-shadow: var(--glow);
}
.hero-visual .float-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px;
  padding: 1rem; margin-bottom: .75rem; animation: float 4s ease-in-out infinite;
}
.hero-visual .float-card:nth-child(2) { animation-delay: .5s; margin-inline-start: 1.5rem; }
.hero-visual .float-card:nth-child(3) { animation-delay: 1s; }
@keyframes float {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.section { padding: 4rem 5%; }
.section-title { text-align: center; margin-bottom: 2.5rem; }
.section-title h2 { font-size: 2rem; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.feature {
  padding: 1.5rem; border-radius: var(--radius); background: var(--bg-card);
  border: 1px solid var(--border); transition: .25s;
}
.feature:hover { border-color: rgba(99,102,241,.45); transform: translateY(-3px); }
.feature .fi {
  width: 48px; height: 48px; border-radius: 14px; background: var(--grad);
  display: grid; place-items: center; color: #fff; margin-bottom: 1rem; font-size: 1.3rem;
}
.landing-footer {
  border-top: 1px solid var(--border); padding: 2rem 5%;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
  color: var(--text-dim); font-size: .9rem;
}
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 3rem; }
  .feature-grid { grid-template-columns: 1fr; }
}

/* Auth */
.auth-page {
  min-height: 100vh; display: grid; place-items: center;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(99,102,241,.25), transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(6,182,212,.15), transparent 50%),
    var(--bg);
  padding: 1.5rem;
}
.auth-card {
  width: 100%; max-width: 440px; padding: 2rem;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 20px;
  box-shadow: var(--shadow);
}
.auth-logo { text-align: center; margin-bottom: 1.5rem; }
.auth-logo .mark {
  width: 56px; height: 56px; margin: 0 auto .75rem; border-radius: 16px;
  background: var(--grad); display: grid; place-items: center; font-size: 1.5rem; font-weight: 800; color: #fff;
}

/* Certificate */
.cert-paper {
  max-width: 900px; margin: 2rem auto; padding: 3rem;
  background: #fffaf0; color: #1c1917; border: 12px solid #b45309;
  border-radius: 8px; text-align: center; position: relative;
}
.cert-paper h1 { color: #92400e; font-size: 2.2rem; }
.cert-ornament { color: #d97706; letter-spacing: .3em; }

/* Empty state */
.empty {
  text-align: center; padding: 3rem 1rem; color: var(--text-dim);
}
.empty .big { font-size: 3rem; margin-bottom: 1rem; opacity: .5; }

/* Utilities */
.flex { display: flex; } .flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-1 { gap: .5rem; } .gap-2 { gap: 1rem; } .gap-3 { gap: 1.5rem; }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2rem; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }
.text-muted { color: var(--text-muted); } .text-dim { color: var(--text-dim); }
.text-success { color: var(--success); } .text-warning { color: var(--warning); }
.text-center { text-align: center; } .text-sm { font-size: .85rem; }
.fw-bold { font-weight: 700; } .w-100 { width: 100%; }
.hidden { display: none !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prose { line-height: 1.85; color: var(--text); }
.prose h2, .prose h3 { margin-top: 1.5rem; }
.prose img { border-radius: var(--radius-sm); margin: 1rem 0; }
.divider { height: 1px; background: var(--border); margin: 1.25rem 0; border: 0; }

/* Mobile menu toggle */
.menu-toggle { display: none; }
@media (max-width: 720px) {
  .menu-toggle { display: grid; }
  .sidebar-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 99;
  }
  .sidebar-overlay.show { display: block; }
}

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, var(--bg-soft) 25%, var(--bg-card) 50%, var(--bg-soft) 75%);
  background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 8px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Leaderboard ranks */
.rank-1 { color: #fbbf24; font-weight: 800; }
.rank-2 { color: #94a3b8; font-weight: 800; }
.rank-3 { color: #d97706; font-weight: 800; }

/* Quiz */
.quiz-option {
  display: flex; align-items: center; gap: .75rem;
  padding: 1rem 1.15rem; border: 1px solid var(--border); border-radius: var(--radius-sm);
  margin-bottom: .6rem; cursor: pointer; transition: .2s; background: var(--bg);
}
.quiz-option:hover { border-color: var(--primary-light); }
.quiz-option.selected, .quiz-option:has(input:checked) {
  border-color: var(--primary); background: var(--primary-soft);
}
.quiz-option input { accent-color: var(--primary); }

/* SSO buttons on login */
.sso-stack { display: flex; flex-direction: column; gap: .55rem; }
.sso-btn { font-weight: 600; border-width: 1px; }
.sso-btn:hover { transform: translateY(-1px); border-color: var(--primary-light); }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-soft); border-radius: 8px; }

/* —— Board reports / KPI —— */
.export-bar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .85rem;
}
@media (max-width: 1100px) { .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .kpi-grid { grid-template-columns: 1fr; } }
.kpi-card {
  display: flex; gap: .85rem; align-items: center;
  padding: 1rem 1.1rem;
  border-radius: 14px;
  background: var(--card, #fff);
  border: 1px solid var(--border, #e2e8f0);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.kpi-icon {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center;
  background: #eef2ff; color: #4f46e5;
}
.kpi-value { font-size: 1.35rem; font-weight: 800; line-height: 1.2; color: var(--text, #0f172a); }
.kpi-label { font-size: .82rem; color: var(--muted, #64748b); margin-top: .15rem; }
.kpi-card.tone-indigo .kpi-icon { background: #eef2ff; color: #4f46e5; }
.kpi-card.tone-violet .kpi-icon { background: #f5f3ff; color: #7c3aed; }
.kpi-card.tone-emerald .kpi-icon { background: #ecfdf5; color: #059669; }
.kpi-card.tone-sky .kpi-icon { background: #e0f2fe; color: #0284c7; }
.kpi-card.tone-amber .kpi-icon { background: #fffbeb; color: #d97706; }
.kpi-card.tone-rose .kpi-icon { background: #fff1f2; color: #e11d48; }
.kpi-card.tone-cyan .kpi-icon { background: #ecfeff; color: #0891b2; }
.kpi-card.tone-slate .kpi-icon { background: #f1f5f9; color: #475569; }
.activity-bars {
  display: flex; align-items: flex-end; gap: 4px; height: 72px;
  padding-top: .5rem;
}
.activity-bar { flex: 1; display: flex; align-items: flex-end; justify-content: center; height: 100%; }
.activity-bar span {
  display: block; width: 100%; max-width: 18px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, #818cf8, #4f46e5);
}
.badge-warn {
  display: inline-block; padding: .15rem .5rem; border-radius: 999px;
  background: #fff7ed; color: #c2410c; font-size: .8rem; font-weight: 600;
}

/* —— Whitelabel / brand —— */
.brand-logo-img.logo,
img.brand-logo-img.logo {
  width: 42px; height: 42px; border-radius: 12px;
  object-fit: contain; background: transparent;
  display: block; flex-shrink: 0;
}
.brand-logo-img.mark,
.auth-logo .brand-logo-img {
  width: 56px; height: 56px; border-radius: 14px;
  object-fit: contain; margin: 0 auto .5rem;
}
.logo.logo-sm, .brand-logo-img.logo-sm {
  width: 36px; height: 36px; border-radius: 10px;
}
.app-footer {
  padding: .75rem 1.5rem 1.25rem;
  text-align: center;
  border-top: 1px solid var(--border);
  margin-top: auto;
}
.powered-by { opacity: .75; }

.theme-toggle-row { display: flex; gap: .6rem; flex-wrap: wrap; }
.theme-opt {
  flex: 1; min-width: 140px;
  display: flex; align-items: center; gap: .5rem;
  padding: .75rem 1rem; border-radius: 12px;
  border: 1px solid var(--border); cursor: pointer;
  background: var(--bg-soft);
}
.theme-opt.active, .theme-opt:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 0 0 1px var(--primary);
}
.theme-opt input { accent-color: var(--primary); }

.color-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
@media (max-width: 720px) { .color-row { grid-template-columns: 1fr; } }
.color-input { display: flex; gap: .5rem; align-items: center; }
.color-input input[type=color] {
  width: 44px; height: 44px; border: none; padding: 0;
  background: transparent; cursor: pointer; border-radius: 10px;
}
.color-input .form-control { flex: 1; font-family: var(--mono); direction: ltr; text-align: left; }

.brand-preview {
  border-radius: 14px; overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-card);
}
.brand-preview .bp-bar {
  height: 10px;
  background: linear-gradient(90deg, var(--p), var(--s), var(--a));
}
.brand-preview .bp-body {
  padding: 1rem; display: flex; gap: .75rem; align-items: center; flex-wrap: wrap;
}
.brand-preview .bp-btn {
  background: linear-gradient(135deg, var(--p), var(--s));
  color: #fff; font-weight: 700; padding: .45rem 1rem; border-radius: 10px;
}
.brand-preview .bp-chip {
  background: color-mix(in srgb, var(--a) 20%, transparent);
  color: var(--a); padding: .3rem .7rem; border-radius: 999px; font-size: .85rem; font-weight: 600;
}

.preset-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: .5rem;
}
.preset-swatch {
  display: flex; flex-direction: column; gap: 4px;
  padding: .55rem; border-radius: 12px;
  border: 1px solid var(--border); background: var(--bg-soft);
  cursor: pointer; color: inherit; font: inherit; text-align: center;
}
.preset-swatch span { height: 10px; border-radius: 4px; display: block; }
.preset-swatch em { font-style: normal; font-size: .72rem; color: var(--text-dim); }
.preset-swatch:hover { border-color: var(--primary); }

.brand-asset-row { display: flex; gap: .75rem; align-items: center; margin-bottom: .5rem; }
.brand-thumb {
  max-height: 48px; max-width: 140px; object-fit: contain;
  border-radius: 8px; background: var(--bg-soft); padding: 4px;
  border: 1px solid var(--border);
}
.brand-thumb.sm { max-height: 32px; max-width: 32px; }
.brand-thumb.wide { max-height: 64px; max-width: 180px; }

/* Light theme extras for components that hard-code dark */
body.theme-light .sidebar-nav .nav-link:hover {
  background: var(--primary-soft);
  color: var(--primary-dark);
}
body.theme-light .sidebar-nav .nav-link.active,
body.theme-light .sidebar-nav .nav-link[aria-current="page"] {
  background: linear-gradient(90deg, rgba(99,102,241,.2), rgba(99,102,241,.08) 75%);
  color: #312e81;
  border-color: rgba(99,102,241,.35);
  box-shadow: inset 3px 0 0 var(--primary), 0 4px 14px rgba(99,102,241,.1);
  font-weight: 800;
}
[dir=rtl] body.theme-light .sidebar-nav .nav-link.active,
[dir=rtl] body.theme-light .sidebar-nav .nav-link[aria-current="page"] {
  background: linear-gradient(270deg, rgba(99,102,241,.2), rgba(99,102,241,.08) 75%);
  box-shadow: inset -3px 0 0 var(--primary), 0 4px 14px rgba(99,102,241,.1);
}
body.theme-light .nav-link.active .nav-label,
body.theme-light .nav-link[aria-current="page"] .nav-label {
  color: #312e81;
}
body.theme-light .nav-active-dot {
  background: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,.2);
}
body.theme-light .nav-group.is-open > .nav-group-toggle {
  background: var(--primary-soft);
  color: var(--primary-dark);
}
body.theme-light .nav-group-body {
  border-inline-start-color: color-mix(in srgb, var(--primary) 35%, var(--border));
}
/* page-help light theme: see main block above */
body.theme-light .sidebar {
  background: linear-gradient(180deg, #0f172a 0%, #111827 100%);
}
body.theme-light .form-control,
body.theme-light input, body.theme-light select, body.theme-light textarea {
  background: #fff;
  border-color: var(--border-strong);
  color: var(--text);
}
body.theme-light .data th {
  background: #f8fafc;
  color: var(--text-muted);
}
body.theme-light .auth-card {
  background: #fff;
  box-shadow: var(--shadow);
}
body.theme-light .kpi-card {
  background: #fff;
}

/* —— Sales demo walkthrough —— */
.demo-hero {
  padding: 3.5rem 5% 2rem;
  background:
    radial-gradient(ellipse at 10% 0%, var(--primary-soft), transparent 50%),
    radial-gradient(ellipse at 90% 20%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 45%);
}
.demo-hero-inner { max-width: 920px; margin: 0 auto; }
.demo-hero h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: .75rem 0; }
.demo-hero .lead { font-size: 1.05rem; max-width: 40rem; }
.demo-status { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: 1rem; }
.demo-status .pill {
  font-size: .8rem; font-weight: 600;
  padding: .3rem .7rem; border-radius: 999px;
  background: var(--bg-soft); border: 1px solid var(--border); color: var(--text-muted);
}
.demo-status .pill.ok { background: color-mix(in srgb, var(--success) 15%, transparent); color: var(--success); border-color: transparent; }
.demo-status .pill.warn { background: color-mix(in srgb, var(--warning) 18%, transparent); color: var(--warning); border-color: transparent; }

.demo-timeline {
  max-width: 920px; margin: 0 auto; padding: 1rem 5% 2rem;
  display: flex; flex-direction: column; gap: 1rem;
}
.demo-step {
  display: grid;
  grid-template-columns: 110px 48px 1fr;
  gap: 1rem; align-items: start;
  padding: 1.25rem 1.35rem;
}
@media (max-width: 640px) {
  .demo-step { grid-template-columns: 1fr; }
}
.demo-min {
  font-size: .78rem; font-weight: 700; color: var(--primary-light);
  background: var(--primary-soft); padding: .35rem .55rem; border-radius: 8px;
  text-align: center; height: fit-content;
}
.demo-step-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--grad); color: #fff;
}
.demo-step h2 { font-size: 1.1rem; margin: 0 0 .4rem; }
.demo-step p { margin: 0 0 .75rem; }
.demo-hint {
  display: inline-block; margin-bottom: .75rem;
  padding: .25rem .55rem; border-radius: 6px;
  background: var(--bg-soft); font-size: .8rem;
}
.demo-accounts, .demo-timeline + .card, section.card.demo-accounts {
  max-width: 920px; margin-inline: auto; margin-bottom: 1rem;
}
section.card.mt-3 { max-width: 920px; margin-inline: auto; margin-bottom: 2rem; }
.demo-check { line-height: 1.9; }
.demo-check code { direction: ltr; font-size: .85em; }

/* certificates */
.cert-card { position: relative; overflow: hidden; }
.cert-card-ribbon {
  position: absolute; top: 0; inset-inline: 0; height: 4px;
}

/* —— Compliance / missions / kudos —— */
.compliance-alert {
  border: 1px solid color-mix(in srgb, var(--warning) 35%, var(--border));
  background: linear-gradient(135deg, color-mix(in srgb, var(--warning) 8%, var(--bg-card)), var(--bg-card));
}
.mandatory-list { display: flex; flex-direction: column; gap: .55rem; }
.mandatory-row {
  display: flex; justify-content: space-between; gap: 1rem; align-items: center;
  padding: .65rem .85rem; border-radius: 12px; background: var(--bg-soft);
  border: 1px solid var(--border);
}
.mandatory-row.status-overdue {
  border-color: color-mix(in srgb, var(--danger) 40%, transparent);
  background: color-mix(in srgb, var(--danger) 10%, var(--bg-soft));
}
.text-danger { color: var(--danger) !important; }
.compliance-matrix .cm-cell {
  text-align: center; font-weight: 700; min-width: 2.2rem;
}
.cm-done { color: var(--success); background: color-mix(in srgb, var(--success) 12%, transparent); }
.cm-overdue { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }
.cm-active { color: var(--primary-light); }
.cm-missing { color: var(--text-dim); }
.mission-chip {
  padding: .55rem .75rem; border-radius: 10px; background: var(--bg-soft);
  margin-bottom: .4rem; border: 1px solid var(--border);
}
.kudos-item {
  padding: .75rem 0; border-bottom: 1px solid var(--border);
}
.kudos-item:last-child { border-bottom: 0; }
.star-row { display: flex; flex-direction: column; gap: .35rem; }
.star-opt {
  display: flex; align-items: center; gap: .5rem; cursor: pointer;
  padding: .35rem .5rem; border-radius: 8px;
}
.star-opt:has(input:checked) { background: var(--primary-soft); }
.star-opt span { color: #f59e0b; letter-spacing: 2px; }

/* —— HR risk + skills —— */
.risk-hero.tone-emerald { border-color: color-mix(in srgb, var(--success) 40%, var(--border)); }
.risk-hero.tone-amber { border-color: color-mix(in srgb, var(--warning) 45%, var(--border)); }
.risk-hero.tone-rose { border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); }
.risk-score { font-size: 3rem; font-weight: 800; line-height: 1.1; }
.risk-bars {
  display: grid; grid-template-columns: repeat(2, minmax(120px,1fr)); gap: .6rem 1.25rem;
}
.risk-bars div { display: flex; flex-direction: column; }
.risk-bars span { font-size: .78rem; color: var(--text-dim); }
.risk-bars strong { font-size: 1.15rem; }
.skill-self-row {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: .45rem 0; border-bottom: 1px solid var(--border);
}
.gap-row { padding: .75rem 0; border-bottom: 1px solid var(--border); }
.gap-row.priority-high { border-inline-start: 3px solid var(--danger); padding-inline-start: .75rem; }
.gap-row.priority-medium { border-inline-start: 3px solid var(--warning); padding-inline-start: .75rem; }
.skill-meter {
  position: relative; height: 8px; border-radius: 99px; background: var(--bg-soft); margin-top: .4rem; overflow: hidden;
}
.skill-meter .need {
  position: absolute; inset: 0 auto 0 0; height: 100%;
  background: color-mix(in srgb, var(--primary) 25%, transparent); border-radius: 99px;
}
.skill-meter .have {
  position: absolute; inset: 0 auto 0 0; height: 100%;
  background: var(--grad); border-radius: 99px; z-index: 1;
}
.ai-plan-card { border: 1px solid color-mix(in srgb, var(--primary) 30%, var(--border)); }
.badge-danger { background: color-mix(in srgb, var(--danger) 18%, transparent); color: var(--danger); }

/* —— Live classroom —— */
.live-card.status-live { border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }
.live-room { min-height: calc(100vh - 20px); display: flex; flex-direction: column; gap: .75rem; padding: .75rem; }
.live-top {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: .75rem 1rem; border-radius: 14px; background: var(--bg-card); border: 1px solid var(--border);
}
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--text-dim); display: inline-block; }
.live-dot.on { background: #ef4444; box-shadow: 0 0 0 4px rgba(239,68,68,.25); animation: pulse 1.5s infinite; }
@keyframes pulse { 50% { opacity: .6; } }
.live-grid { display: grid; grid-template-columns: 1fr 320px; gap: .75rem; flex: 1; min-height: 0; }
@media (max-width: 900px) { .live-grid { grid-template-columns: 1fr; } }
.live-stage { min-height: 360px; }
.live-embed-hint { text-align: center; padding: 2rem 1rem; }
.live-embed-hint .big-icon { color: var(--primary); margin-bottom: 1rem; }
.live-side { display: flex; flex-direction: column; gap: .75rem; min-height: 0; }
.att-list { list-style: none; padding: 0; margin: 0; max-height: 140px; overflow: auto; }
.att-list li { padding: .25rem 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
.live-chat { display: flex; flex-direction: column; flex: 1; min-height: 280px; }
.chat-log { flex: 1; overflow: auto; max-height: 320px; padding: .5rem 0; }
.chat-line { padding: .35rem 0; font-size: .9rem; border-bottom: 1px dashed var(--border); }
.chat-line strong { margin-left: .35rem; color: var(--primary-light); }
.chat-form { display: flex; gap: .4rem; margin-top: .5rem; }

/* —— WebRTC live stage —— */
.rtc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: .6rem;
  margin-bottom: .75rem;
}
.rtc-tile {
  position: relative;
  background: #0b1220;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 4/3;
  border: 1px solid var(--border);
}
.rtc-tile video {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.rtc-tile span {
  position: absolute; bottom: .35rem; right: .45rem;
  background: rgba(0,0,0,.55); color: #fff; font-size: .72rem;
  padding: .15rem .45rem; border-radius: 6px;
}

/* —— Mobile bottom nav (PWA) —— */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  inset: auto 0 0 0;
  z-index: 90;
  background: color-mix(in srgb, var(--bg-card) 92%, transparent);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding: .35rem .5rem calc(.35rem + env(safe-area-inset-bottom, 0px));
  justify-content: space-around;
  gap: .25rem;
}
.mobile-bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .15rem;
  padding: .4rem .2rem;
  font-size: .68rem;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 10px;
}
.mobile-bottom-nav a .icon { width: 22px; height: 22px; }
.mobile-bottom-nav a.active,
.mobile-bottom-nav a[aria-current="page"] {
  color: #e0e7ff;
  background: rgba(99,102,241,.22);
  font-weight: 800;
  box-shadow: inset 0 2px 0 #818cf8;
}
.mobile-bottom-nav a:hover { color: var(--primary-light); background: var(--primary-soft); }
@media (max-width: 768px) {
  .mobile-bottom-nav { display: flex; }
  body.has-bottom-nav .main-wrap { padding-bottom: 72px; }
  body.has-bottom-nav .app-footer { margin-bottom: 64px; }
}


/* live pro v2.2 */
.live-room .host-panel { margin-top: .5rem; }
.live-room #pinned-banner { margin: 0 .75rem; }

/* ── Voice assistant (global FAB) ── */
.va-root {
  position: fixed;
  inset-inline-end: 1.1rem;
  bottom: 1.1rem;
  z-index: 240;
  font-family: inherit;
  direction: rtl;
}
@media (max-width: 768px) {
  body.has-bottom-nav .va-root {
    bottom: calc(72px + .75rem);
  }
}
.va-fab {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  background: var(--grad, linear-gradient(135deg, #6366f1, #8b5cf6));
  color: #fff;
  box-shadow: 0 8px 28px rgba(99, 102, 241, .45);
  position: relative;
  transition: transform .2s ease, box-shadow .2s;
}
.va-fab:hover { transform: scale(1.06); }
.va-fab.is-open { box-shadow: 0 4px 16px rgba(0,0,0,.25); }
.va-fab.is-busy { animation: va-pulse-ring 1.2s ease infinite; }
.va-fab-pulse {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(99,102,241,.55);
  animation: va-pulse-ring 1.4s ease infinite;
  pointer-events: none;
}
@keyframes va-pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(99,102,241,.5); }
  70% { box-shadow: 0 0 0 14px rgba(99,102,241,0); }
  100% { box-shadow: 0 0 0 0 rgba(99,102,241,0); }
}
.va-panel {
  position: absolute;
  inset-inline-end: 0;
  bottom: calc(56px + .65rem);
  width: min(380px, calc(100vw - 1.5rem));
  max-height: min(520px, calc(100vh - 8rem));
  display: flex;
  flex-direction: column;
  background: var(--surface, #12141c);
  border: 1px solid var(--border, rgba(255,255,255,.1));
  border-radius: 18px;
  box-shadow: 0 18px 48px rgba(0,0,0,.45);
  overflow: hidden;
}
.va-panel[hidden] { display: none !important; }
.va-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--border, rgba(255,255,255,.08));
  background: linear-gradient(180deg, rgba(99,102,241,.12), transparent);
}
.va-head-actions { display: flex; gap: .25rem; }
.va-btn-sm { width: 32px; height: 32px; }
.va-btn-sm.is-muted { opacity: .45; }
.va-messages {
  flex: 1;
  overflow-y: auto;
  padding: .75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .55rem;
  min-height: 140px;
  max-height: 260px;
}
.va-msg {
  max-width: 92%;
  padding: .55rem .75rem;
  border-radius: 14px;
  font-size: .88rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
.va-msg-user {
  align-self: flex-start;
  background: var(--primary-soft, rgba(99,102,241,.18));
  color: var(--text, #e8eaf0);
  border-bottom-right-radius: 4px;
}
.va-msg-bot {
  align-self: flex-end;
  background: var(--bg-elevated, rgba(255,255,255,.06));
  border: 1px solid var(--border, rgba(255,255,255,.06));
  border-bottom-left-radius: 4px;
}
.va-msg-extra { margin-top: .4rem; }
.va-results {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
.va-results a {
  display: block;
  padding: .35rem .5rem;
  border-radius: 8px;
  background: rgba(99,102,241,.1);
  color: var(--primary-light, #a5b4fc);
  text-decoration: none;
  font-size: .82rem;
}
.va-results a:hover { background: rgba(99,102,241,.22); }
.va-examples {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  padding: 0 .85rem .5rem;
}
.va-chip {
  border: 1px solid var(--border, rgba(255,255,255,.12));
  background: transparent;
  color: var(--text-muted, #9aa3b5);
  border-radius: 99px;
  padding: .25rem .65rem;
  font-size: .72rem;
  cursor: pointer;
  transition: .15s;
}
.va-chip:hover {
  border-color: var(--primary, #6366f1);
  color: var(--primary-light, #c7d2fe);
  background: rgba(99,102,241,.1);
}
.va-status { padding: 0 1rem .35rem; }
.va-input-row {
  display: flex;
  gap: .4rem;
  padding: .65rem .75rem .75rem;
  border-top: 1px solid var(--border, rgba(255,255,255,.08));
  align-items: center;
}
.va-text { flex: 1; min-width: 0; font-size: .85rem !important; padding: .45rem .65rem !important; }
.va-mic {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  border: 1px solid var(--border);
  background: var(--bg-elevated, rgba(255,255,255,.05));
  color: var(--text);
  border-radius: 12px;
  padding: .4rem .55rem;
  font-size: .75rem;
  cursor: pointer;
  white-space: nowrap;
}
.va-mic.is-listening {
  border-color: #ef4444;
  color: #fecaca;
  background: rgba(239,68,68,.15);
  animation: va-pulse-ring 1s ease infinite;
}
.va-hint {
  padding: 0 .85rem .7rem;
  text-align: center;
}
