/* ═══════════════════════════════════════════════════════════════════════
   AW Academy — Airwave Koolitusmoodul
   Värvipalett ja fontid sünkrooniseeritud AW Wikiga.
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  /* ─── Warm latte palette (DESIGN.md v1.0) ──────────────────── */
  --bg: #f5efe4;
  --bg-2: #efe6d3;
  --card: #fdfaf3;
  --surface: #ffffff;

  /* Tekstid */
  --tx: #2d2418;
  --tx-2: #5c4e38;
  --tx-3: #8a7a5c;
  --tx2: var(--tx-2);   /* legacy alias */
  --tx3: var(--tx-3);   /* legacy alias */

  /* Anthropic terracotta — peamine aktsent ja CTA värv */
  --accent: #cc785c;
  --accent-soft: rgba(204, 120, 92, 0.06);
  --accent-dk: #993c1d;

  /* Ääred */
  --border: #d8c9a8;
  --border-soft: #e6d9c0;
  --border2: #c9b896;   /* legacy */

  /* Status-värvid (DESIGN.md tabel) */
  --ok-bg: #eaf3de;
  --ok-tx: #3b6d11;
  --warn-bg: #faeeda;
  --warn-tx: #854f0b;
  --err-bg: #fcebeb;
  --err-tx: #a32d2d;
  --info-bg: #e6f1fb;
  --info-tx: #185fa5;

  /* Avatari värvid rolli järgi */
  --avatar-master: #cc785c;   /* terracotta */
  --avatar-aw: #1d9e75;       /* teal */
  --avatar-ext: #534ab7;      /* purple */
  --avatar-anon: #888780;     /* gray */

  /* Brand-red (logo, Airwave identiteet) — mitte CTA-le */
  --red: #E2241B;
  --red-dk: #B81B12;
  --red-2: #F04438;

  /* Legacy status-värvid (ühilduvus vanade JS-de jaoks) */
  --green: #10b981;
  --yellow: #f59e0b;
  --orange: #f97316;
  --blue: #2563eb;
  --purple: #8b5cf6;

  /* Sidebar (header dark navy — säilitatud) */
  --sb: #0b1220;
  --sb-2: #111a2e;
  --sb-tx: #aab4c6;

  /* DESIGN.md: shadow'isid mitte kunagi — hoiame token'id aga väärtused
     nullitud (ja faili lõpus override'ime spetsiifilised komponendid). */
  --shadow: none;
  --shadow-md: none;
  --shadow-lg: 0 8px 30px rgba(45, 36, 24, 0.12); /* erand: modaalid */

  /* Spacing (DESIGN.md) */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 24px;
  --space-2xl: 40px;

  /* Radius (DESIGN.md: 10px kaardid, 8px nupud) */
  --radius: 10px;
  --radius-sm: 8px;
  --radius-lg: 12px;   /* DESIGN.md piirab > 12px = liiga "bubble" */

  --font: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-serif: 'Merriweather', Georgia, 'Times New Roman', serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;

  --header-h: 72px;
}

/* ─── Tume režiim — slate-blue palett (AW Wiki tumeda teema järgi) ─────
   Lülitub body.dark klassiga; lüliti-nupp all-paremas nurgas (vt theme.js).
   Kogu app kasutab var(--bg/--card/--tx/...), seega override kaskaadub. */
body.dark {
  --bg: #1a2236;
  --bg-2: #222b42;
  --card: #2a334d;
  --surface: #323c5a;

  --tx: #f1f4fa;
  --tx-2: #b8c1d6;
  --tx-3: #7a8499;

  --accent: #e0917a;
  --accent-soft: rgba(224, 145, 122, 0.14);
  --accent-dk: #cc785c;

  --border: #3a4360;
  --border-soft: #313a55;
  --border2: #4d5775;

  --ok-bg: rgba(16, 185, 129, 0.16);   --ok-tx: #6ee7b7;
  --warn-bg: rgba(245, 158, 11, 0.16); --warn-tx: #fcd34d;
  --err-bg: rgba(240, 68, 56, 0.18);   --err-tx: #fca5a5;
  --info-bg: rgba(37, 99, 235, 0.18);  --info-tx: #93c5fd;

  --red: #F04438; --red-dk: #E2241B;
  --blue: #93c5fd;

  --sb: #141b30;
  --sb-2: #1e2740;
  --sb-tx: #bcc6dc;

  --shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.5);
}
/* Vormiväljad tumedas — kindlusta loetavus (mõni väli võib kasutada fikseeritud valget). */
body.dark input,
body.dark textarea,
body.dark select {
  background: var(--surface);
  color: var(--tx);
  border-color: var(--border);
}
body.dark input::placeholder,
body.dark textarea::placeholder { color: var(--tx-3); }

/* ─── Hele/tume teema lüliti — fikseeritud ümar nupp all-paremas nurgas ── */
.aw-theme-toggle {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 60;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--tx);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease;
}
.aw-theme-toggle:hover { transform: scale(1.08); }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--tx);
  min-height: 100vh;
  line-height: 1.55;
  margin: 0;
}

/* ─── DESIGN.md sidebar shell: 220px sidebar + main content ──────── */
.aw-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}
#aw-protocol-warn {
  background: var(--warn-bg);
  color: var(--warn-tx);
  padding: 10px 18px;
  text-align: center;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}
#aw-protocol-warn code {
  background: rgba(0,0,0,0.08);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
}
@media (max-width: 768px) {
  .aw-shell {
    grid-template-columns: 1fr;
  }
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  color: var(--tx);
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 0 0 .5em;
}
h1 { font-size: clamp(1.6rem, 3vw, 2.4rem); }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }

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

button, .btn {
  font-family: inherit;
  font-size: .95rem;
  font-weight: 600;
  padding: .6rem 1.1rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--tx);
  cursor: pointer;
  transition: transform .12s, box-shadow .12s, background .15s;
  box-shadow: var(--shadow);
}
button:hover, .btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
button:disabled, .btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn--primary { background: var(--red); color: #fff; }
.btn--primary:hover { background: var(--red-dk); }
.btn--ghost { background: transparent; border-color: var(--border2); }
.btn--success { background: var(--green); color: #fff; }
.btn--warn { background: var(--yellow); color: #1a1209; }
.btn--danger { background: var(--red-2); color: #fff; }
.btn--sm { padding: .35rem .75rem; font-size: .85rem; }

input, textarea, select {
  font-family: inherit;
  font-size: .95rem;
  padding: .6rem .75rem;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--tx);
  width: 100%;
}
input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--red);
  outline-offset: 1px;
}

label {
  display: block;
  margin-bottom: 1rem;
  font-size: .9rem;
  font-weight: 600;
  color: var(--tx2);
}
label > span { display: block; margin-bottom: .3rem; }

/* ─── Sidebar (DESIGN.md v1.0) ───────────────────────────────────── */
.aw-sidebar {
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-height: 100vh;
  position: sticky;
  top: 0;
  align-self: start;
}
@media (max-width: 768px) {
  .aw-sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 240px;
    transform: translateX(-100%);
    transition: transform .2s ease;
    z-index: 60;
    min-height: 100vh;
    box-shadow: 0 0 0 9999px rgba(0,0,0,0);
  }
  .aw-sidebar--open {
    transform: translateX(0);
    box-shadow: 0 0 0 9999px rgba(45, 36, 24, 0.35);
  }
}

.aw-sidebar-toggle {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 70;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--tx);
  cursor: pointer;
  padding: 0;
  box-shadow: none;
}
@media (max-width: 768px) {
  .aw-sidebar-toggle { display: inline-flex; }
}
.aw-sidebar-toggle:hover { background: var(--accent-soft); border-color: var(--accent); }

/* Brand sidebar tipus */
.aw-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--tx) !important;
  text-decoration: none !important;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
}
.aw-brand:hover { background: var(--accent-soft); }
.aw-brand__mark {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  display: grid;
  place-items: center;
  color: #fff;
  flex-shrink: 0;
}
.aw-brand__text { display: flex; flex-direction: column; line-height: 1.2; }
.aw-brand__name {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 15px;
  color: var(--tx);
}
.aw-brand__sub {
  font-size: 10.5px;
  color: var(--tx-3);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .08em;
}

/* Nav grupp */
.aw-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  overflow-y: auto;
}
.aw-nav a {
  color: var(--tx-2);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 400;
  text-decoration: none;
  transition: background .12s, color .12s;
  display: flex;
  align-items: center;
  gap: 10px;
}
.aw-nav a:hover {
  background: var(--accent-soft);
  color: var(--tx);
  text-decoration: none;
}
.aw-nav a.active {
  background: var(--card);
  color: var(--accent-dk);
  font-weight: 500;
}

/* User-paneel sidebar'i põhjas */
.aw-user {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.aw-user > .hex {
  width: 32px !important;
  flex-shrink: 0;
}
.aw-user > span:not(.hex) {
  flex: 1 1 100px;
  min-width: 0;
}
.aw-user__name {
  color: var(--tx);
  font-weight: 500;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.aw-user__role {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  letter-spacing: .04em;
  display: inline-block;
  margin-top: 2px;
}
.aw-user__role--master { background: var(--accent); color: #fff; }
.aw-user__role--coach { background: var(--accent); color: #fff; }
.aw-user__role--trainer { background: var(--accent); color: #fff; }
.aw-user__role--aw-tech { background: var(--avatar-aw); color: #fff; }
.aw-user__role--external { background: var(--avatar-ext); color: #fff; }

.aw-logout {
  color: var(--tx-2);
  cursor: pointer;
  background: transparent;
  border: 1px solid var(--border);
  padding: 6px 10px;
  font-size: 12px;
  border-radius: var(--radius-sm);
  box-shadow: none;
  font-weight: 400;
  margin-left: auto;
}
.aw-logout:hover {
  color: var(--accent-dk);
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* ─── Main ────────────────────────────────────────────────────────── */
.aw-main {
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  padding: 40px 32px 80px;
}
@media (max-width: 768px) {
  .aw-main { padding: 64px 16px 40px; }
}
.aw-loading {
  text-align: center;
  padding: 80px 20px;
  color: var(--tx2);
}
.aw-loading .hex { margin: 0 auto 1rem; }

.aw-page-hero {
  background: linear-gradient(135deg, var(--card) 0%, var(--bg-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 36px;
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
}
.aw-page-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 90% 0%, rgba(226,36,27,.08), transparent 60%);
  pointer-events: none;
}
.aw-page-hero h1 { margin: 0 0 .3em; }
.aw-page-hero p { color: var(--tx2); margin: 0; max-width: 720px; }

/* ─── Heksagoonid ──────────────────────────────────────────────────── */
.hex {
  width: 64px;
  aspect-ratio: 1 / 0.866;
  clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
  background: linear-gradient(135deg, var(--red), var(--red-dk));
  display: grid;
  place-items: center;
  color: #fff;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: .9rem;
  transition: transform .15s ease;
  position: relative;
  flex-shrink: 0;
}
.hex:hover { transform: scale(1.05); }
.hex--xs { width: 24px; }
.hex--sm { width: 40px; font-size: .7rem; }
.hex--md { width: 80px; font-size: 1.1rem; }
.hex--lg { width: 140px; font-size: 1.8rem; }
.hex--xl { width: 200px; font-size: 2.6rem; }

.hex--navy { background: linear-gradient(135deg, var(--sb-2), var(--sb)); }
.hex--green { background: linear-gradient(135deg, #16a34a, var(--green)); }
.hex--yellow { background: linear-gradient(135deg, #fbbf24, var(--yellow)); color: #1a1209; }
.hex--gray { background: linear-gradient(135deg, var(--border2), var(--tx3)); color: #fff; }

.hex--ghost {
  background: transparent;
}
.hex--ghost::before {
  content: "";
  position: absolute;
  inset: 0;
  clip-path: inherit;
  background: linear-gradient(135deg, var(--red), var(--red-dk));
  z-index: 0;
}
.hex--ghost::after {
  content: "";
  position: absolute;
  inset: 2px;
  clip-path: inherit;
  background: var(--card);
  z-index: 1;
}
.hex--ghost > * { position: relative; z-index: 2; }
.hex--ghost.hex--light-bg::after { background: var(--card); }

.hex-grid { display: flex; gap: 4px; align-items: center; }
.hex-grid--header {
  margin-left: 1rem;
}
.hex-grid--header .hex--xs { width: 20px; }
.hex-grid .hex:nth-child(even) { transform: translateY(50%); }
.hex-grid .hex:hover:nth-child(even) { transform: translateY(50%) scale(1.1); }

/* ─── Login hero ─────────────────────────────────────────────────── */
.aw-login-hero {
  display: flex;
  align-items: center;
  gap: 24px;
  text-align: left;
}
.aw-login-hero__hex { flex-shrink: 0; }
.aw-login-hero__text h1 { margin-bottom: .3em; }
.aw-login-hero__text p { margin: 0; }
@media (max-width: 600px) {
  .aw-login-hero { flex-direction: column; text-align: center; gap: 16px; }
}

/* Login layout: kaks paneeli kõrvuti */
.login-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: stretch;
}
@media (max-width: 720px) {
  .login-split { grid-template-columns: 1fr; }
}
.login-card__hint {
  color: var(--tx2);
  font-size: .88rem;
  margin: 0 0 .75rem;
  line-height: 1.5;
}
.login-trainer-hint {
  text-align: center;
  color: var(--tx3);
  font-size: .85rem;
  margin-top: 1.5rem;
}
.login-trainer-hint a { font-weight: 600; }

/* ─── Login (avalehe valikud) ─────────────────────────────────────── */
.login-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 32px;
}
.login-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: transform .2s, box-shadow .2s, border-color .2s;
  position: relative;
  overflow: hidden;
}
.login-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--red-2);
}
.login-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: var(--red);
}
.login-card__icon { margin-bottom: .5rem; }
.login-card h3 {
  font-family: var(--font-serif);
  margin: 0;
}
.login-card p {
  color: var(--tx2);
  font-size: .9rem;
  margin: 0;
  flex: 1;
}
.login-card form { display: flex; flex-direction: column; gap: .75rem; margin-top: auto; }

/* ─── Eksamikaartid (dashboard) ───────────────────────────────────── */
.exam-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}
.exam-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: .75rem;
  transition: transform .15s, box-shadow .15s, border-color .15s;
  position: relative;
}
.exam-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border2);
}
.exam-card__head { display: flex; align-items: flex-start; gap: 1rem; justify-content: space-between; }
.exam-card__title { font-family: var(--font-serif); margin: 0; font-size: 1.15rem; }
.exam-card__meta {
  display: flex; gap: .5rem; flex-wrap: wrap;
  font-size: .75rem; color: var(--tx2);
}
.exam-card__meta .tag {
  background: var(--bg-2);
  padding: .2rem .55rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: .03em;
}
.exam-card__desc { color: var(--tx2); font-size: .9rem; margin: 0; }
.exam-card__foot {
  margin-top: auto;
  padding-top: .75rem;
  border-top: 1px dashed var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.exam-card__history {
  font-size: .8rem;
  color: var(--tx3);
  font-family: var(--font-mono);
}

/* Status badges */
.status-badge {
  display: inline-block;
  padding: .2rem .6rem;
  border-radius: 999px;
  font-size: .7rem;
  font-family: var(--font-mono);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.status-badge--pending { background: rgba(245,158,11,.15); color: var(--yellow); border: 1px solid var(--yellow); }
.status-badge--approved { background: rgba(16,185,129,.15); color: var(--green); border: 1px solid var(--green); }
.status-badge--rejected { background: rgba(226,36,27,.15); color: var(--red); border: 1px solid var(--red); }
.status-badge--in-progress { background: rgba(37,99,235,.15); color: var(--blue); border: 1px solid var(--blue); }

/* ─── Exam runtime ──────────────────────────────────────────────────── */
.exam-runtime {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}
.exam-progress {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  position: sticky;
  top: calc(var(--header-h) + 8px);
  z-index: 10;
  box-shadow: var(--shadow);
}
.exam-progress__bar {
  flex: 1;
  height: 8px;
  background: var(--bg-2);
  border-radius: 999px;
  overflow: hidden;
  min-width: 200px;
}
.exam-progress__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--red), var(--red-dk));
  transition: width .3s;
}
.exam-progress__timer {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--tx);
}
.exam-progress__timer.warn { color: var(--orange); }
.exam-progress__timer.danger { color: var(--red); animation: pulse 1s infinite; }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .5; }
}

.question-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-md);
}
.question-card__num {
  font-family: var(--font-mono);
  font-size: .8rem;
  color: var(--tx3);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: .5rem;
}
.question-card__prompt {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 600;
  margin: 0 0 1.25rem;
  color: var(--tx);
}

/* MCQ pilt küsimuse kohal — grid (kõrvuti) või slider */
.mcq-figure {
  margin: 0 0 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
}
.mcq-figure--grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  text-align: center;
}
.mcq-figure--grid img {
  max-width: 100%;
  max-height: 280px;
  border-radius: var(--radius-sm);
}
.mcq-figure--slider { text-align: center; }
.mcq-slider__image-wrap img {
  max-width: 100%;
  max-height: 360px;
  border-radius: var(--radius-sm);
}
.mcq-slider__controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .5rem;
  margin-top: .5rem;
}
.mcq-figure img {
  max-width: 100%;
  max-height: 360px;
  border-radius: var(--radius-sm);
}

/* Küsimuse webi-link */
.mcq-weblink {
  margin: 0 0 1rem;
  padding: .5rem .8rem;
  background: rgba(37,99,235,.08);
  border-left: 3px solid var(--blue);
  border-radius: var(--radius-sm);
  font-size: .9rem;
}
.mcq-weblink a { color: var(--blue); text-decoration: underline; }

/* Pilt-loend admin-vormis (q-img-list) */
.q-img-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}
.q-img-thumb {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.q-img-thumb--broken {
  border-color: var(--red);
}
.q-img-thumb--broken img {
  display: none;
}
.q-img-thumb img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  display: block;
}
.q-img-thumb__pdf {
  width: 100%;
  height: 100px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--red), var(--red-dk));
  color: #fff;
  font-weight: 700;
  font-family: var(--font-mono);
}

/* Inline PDF MCQ/text küsimuses (eksamineeritavale + admin preview) */
.inline-pdf {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .6rem;
  margin: .3rem 0;
}
.inline-pdf__name {
  font-family: var(--font-mono);
  font-size: .8rem;
  color: var(--tx2);
  margin-bottom: .4rem;
  word-break: break-all;
}
.inline-pdf__nav {
  display: flex;
  gap: .4rem;
  align-items: center;
  justify-content: center;
  margin-bottom: .4rem;
}
.inline-pdf__canvas-wrap {
  text-align: center;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: auto;
  max-height: 600px;
}
.inline-pdf__canvas-wrap canvas {
  display: inline-block;
  max-width: 100%;
  height: auto;
}

.mcq-figure__slot { width: 100%; }

/* PDF link (kasutame ainult fallback'is, kui PDF.js pole laetud) */
.mcq-pdf-link {
  display: inline-block;
  padding: .6rem 1rem;
  background: linear-gradient(135deg, var(--red), var(--red-dk));
  color: #fff !important;
  text-decoration: none !important;
  border-radius: var(--radius-sm);
  font-weight: 600;
  margin: .3rem;
  transition: transform .12s, box-shadow .12s;
}
.mcq-pdf-link:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.q-img-thumb__info {
  padding: .3rem .4rem;
  display: flex;
  gap: .2rem;
  align-items: center;
  font-size: .7rem;
}
.q-img-thumb__info small {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Thumbnail koolituse-/mooduli-kaartil */
.exam-card__thumb {
  margin: -22px -22px 12px;
  height: 120px;
  overflow: hidden;
}
.exam-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.mcq-multi-hint {
  margin: 0 0 1rem;
  padding: .6rem .9rem;
  background: rgba(245,158,11,.10);
  border-left: 3px solid var(--yellow);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  color: var(--tx2);
}

/* Tekstilise küsimuse vastuseväli */
.text-answer {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 1rem;
  border-radius: var(--radius-sm);
}
.text-answer__input {
  width: 100%;
  font-size: 1.1rem;
  padding: .75rem 1rem;
  font-family: var(--font);
  background: var(--card);
  border: 2px solid var(--border2);
  border-radius: var(--radius-sm);
}
.text-answer__input:focus {
  outline: 2px solid var(--red);
  outline-offset: 1px;
}

/* MCQ valikud */
.mcq-options { display: flex; flex-direction: column; gap: .6rem; }
.mcq-option {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .9rem 1.1rem;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all .15s;
}
.mcq-option:hover {
  border-color: var(--red-2);
  background: var(--bg-2);
}
.mcq-option.selected {
  border-color: var(--red);
  background: rgba(226,36,27,.08);
}
.mcq-option input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--red);
  flex-shrink: 0;
}
.mcq-option__text { font-size: .98rem; }

/* Hotspot canvas wrapper */
.hotspot-wrapper {
  position: relative;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: crosshair;
  touch-action: none;
}
.hotspot-wrapper canvas {
  display: block;
  width: 100%;
  height: auto;
}
.hotspot-wrapper canvas.hotspot-layer {
  position: absolute;
  top: 0; left: 0;
  pointer-events: auto;
}

/* Editor variant — toetab horisontaalset/vertikaalset scrollimist suurel zoomil */
.hotspot-wrapper--editor {
  max-width: 100%;
  max-height: 70vh;
  overflow: auto;
}
.hotspot-wrapper--editor .hotspot-scroll {
  position: relative;
  display: inline-block;
}
.hotspot-wrapper--editor canvas {
  width: auto;
  height: auto;
  max-width: none;
}
.hotspot-wrapper--editor canvas.hotspot-layer {
  position: absolute;
  top: 0; left: 0;
}

/* Zoom kontrollriba */
.hotspot-zoom-bar {
  display: flex;
  gap: .4rem;
  align-items: center;
  margin-bottom: .6rem;
  flex-wrap: wrap;
}
.hotspot-zoom-pct {
  font-family: var(--font-mono);
  font-size: .8rem;
  color: var(--tx);
  min-width: 48px;
  text-align: center;
  font-weight: 700;
}

/* Fullscreen editor — kogu vaade */
.hotspot-editor--fullscreen {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: var(--bg);
  padding: 16px;
  overflow: auto;
}
.hotspot-editor--fullscreen .hotspot-tool {
  grid-template-columns: 1fr 320px;
  height: calc(100vh - 32px);
}
.hotspot-editor--fullscreen .hotspot-wrapper--editor {
  max-height: calc(100vh - 200px);
  max-width: none;
}
.hotspot-editor--fullscreen .hotspot-tool__panel {
  position: sticky;
  top: 0;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}
@media (max-width: 900px) {
  .hotspot-editor--fullscreen .hotspot-tool { grid-template-columns: 1fr; }
}
.hotspot-hint {
  margin-top: .75rem;
  font-size: .85rem;
  color: var(--tx3);
  font-style: italic;
  text-align: center;
}
.hotspot-controls {
  display: flex; justify-content: center; gap: .5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}
.hotspot-pdf-nav {
  display: flex; align-items: center; gap: .75rem;
  margin-bottom: .75rem;
  justify-content: center;
}

.question-card__actions {
  display: flex;
  justify-content: space-between;
  margin-top: 1.5rem;
  gap: 1rem;
}

/* Mooduli statistika tulemuste lehel */
.module-stats {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
  margin-top: 1rem;
}
.module-stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
}
.module-stat__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: .4rem;
}
.module-stat__pct { font-family: var(--font-mono); font-weight: 700; }
.module-stat__bar {
  height: 6px;
  background: var(--bg-2);
  border-radius: 999px;
  overflow: hidden;
}
.module-stat__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--red), var(--red-dk));
  transition: width .4s;
}
.module-stat__detail {
  font-size: .8rem;
  color: var(--tx3);
  margin-top: .3rem;
}

/* Master banner — kuvatakse master vaates */
.master-banner {
  background: linear-gradient(90deg, #f59e0b, #d97706);
  color: #1a1209;
  padding: .65rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: .9rem;
  font-weight: 600;
}

/* Preview banner — kuvatakse koolitaja eelvaate ajal */
.preview-banner {
  background: linear-gradient(90deg, var(--yellow), var(--orange));
  color: #1a1209;
  padding: .65rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: .9rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
}
.preview-banner a {
  color: #1a1209;
  text-decoration: underline;
  font-weight: 700;
}

/* OneDrive profiilide-jagamise banner — info-tasemel, sinine */
.aw-fs-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .65rem 1rem;
  background: linear-gradient(90deg, var(--blue), #1d4ed8);
  color: #fff;
  font-size: .85rem;
}
.aw-fs-banner[hidden] { display: none; }
.aw-fs-banner__text {
  flex: 1;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.aw-fs-banner__icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}
.aw-fs-banner__msg strong { font-weight: 700; }
.aw-fs-banner__actions {
  display: flex;
  gap: .5rem;
  flex-shrink: 0;
}
.aw-fs-banner__btn-pick {
  font-size: .82rem;
  padding: .35rem .8rem;
}
.aw-fs-banner__btn-ghost {
  background: transparent;
  border: 1px solid rgba(255,255,255,.4);
  color: #fff;
  padding: .35rem .8rem;
  border-radius: var(--radius-sm);
  font-size: .82rem;
  cursor: pointer;
  font-family: inherit;
}
.aw-fs-banner__btn-ghost:hover {
  background: rgba(255,255,255,.12);
}
/* "Luba kaotatud" variant — kollasem hoiatus-toon */
.aw-fs-banner--warn {
  background: linear-gradient(90deg, var(--yellow), var(--orange));
  color: #1a1209;
}
.aw-fs-banner--warn .aw-fs-banner__btn-ghost {
  border-color: rgba(26,18,9,.35);
  color: #1a1209;
}
.aw-fs-banner--warn .aw-fs-banner__btn-ghost:hover {
  background: rgba(0,0,0,.08);
}
@media (max-width: 640px) {
  .aw-fs-banner {
    flex-direction: column;
    align-items: stretch;
    padding: .55rem .8rem;
  }
  .aw-fs-banner__actions {
    justify-content: flex-end;
  }
}

/* ─── Result / sertifikaat ──────────────────────────────────────────── */
.result-hero {
  text-align: center;
  padding: 40px 20px;
}
.result-hero .hex--xl { margin: 0 auto 1rem; }
.result-hero h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
.result-detail {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 2rem;
}
.result-detail__cell {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
}
.result-detail__label {
  font-size: .75rem;
  color: var(--tx3);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-family: var(--font-mono);
  margin-bottom: .5rem;
}
.result-detail__value {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--tx);
}

/* ─── Eksami detail-vaade (admin) ──────────────────────────────────── */
.exam-admin-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.exam-admin-row-wrap {
  display: flex;
  align-items: stretch;
  gap: 6px;
}
.exam-admin-row-wrap .exam-admin-row { flex: 1; }
.exam-row-del {
  align-self: stretch;
  padding: 0 14px;
  font-size: 1rem;
}
.exam-admin-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none !important;
  color: var(--tx) !important;
  transition: border-color .15s, transform .12s, box-shadow .15s;
}
.exam-admin-row:hover {
  border-color: var(--red);
  transform: translateX(2px);
  box-shadow: var(--shadow-md);
}

.question-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color .12s, transform .12s, box-shadow .12s;
}
.question-row:hover {
  border-color: var(--red);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.question-row--reviewed {
  border-left: 4px solid var(--green);
  background: linear-gradient(90deg, rgba(16,185,129,.05), var(--card) 40%);
}
.question-row__check {
  display: flex;
  align-items: center;
  padding-top: 4px;
}
.question-row__check input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: var(--green);
  cursor: pointer;
}

/* Review-progress riba mooduli päises */
.review-progress {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 14px;
}
.review-progress--done {
  border-color: var(--green);
  background: linear-gradient(90deg, rgba(16,185,129,.08), var(--card) 40%);
}
.review-progress__bar {
  margin-top: .6rem;
  height: 6px;
  background: var(--bg-2);
  border-radius: 999px;
  overflow: hidden;
}
.review-progress__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--yellow), var(--green));
  transition: width .3s ease;
}

/* Mooduli rida eksami detail-vaates */
.module-list { display: flex; flex-direction: column; gap: 8px; }
.module-row {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  border-left: 4px solid var(--red);
}
.module-row__head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.module-row__head a { color: var(--tx); text-decoration: none; }
.module-row__head a:hover { color: var(--red); text-decoration: underline; }
.question-row__num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-2);
  color: var(--tx);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-weight: 700;
  flex-shrink: 0;
}
.question-row__body { flex: 1; min-width: 0; }
.question-row__type {
  font-size: .75rem;
  color: var(--tx3);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: .25rem;
}
.question-row__prompt {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
  color: var(--tx);
}
.question-row__actions {
  display: flex;
  gap: .3rem;
  flex-shrink: 0;
  flex-wrap: wrap;
  align-items: center;
}
@media (max-width: 700px) {
  .question-row { flex-direction: column; }
  .question-row__actions { width: 100%; justify-content: flex-end; }
}

/* Admin küsimuse redaktor — abimäged */
/* Question browser (Moodulite tab → Kõik küsimused) */
.q-browser {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.q-browser__toolbar {
  display: flex;
  gap: .6rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: .6rem;
}
.q-browser__tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .3rem;
  margin-bottom: .8rem;
  padding-bottom: .6rem;
  border-bottom: 1px dashed var(--border);
}
.q-browser__tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
}
.tag-pill {
  background: var(--bg-2);
  color: var(--tx);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .25rem .65rem;
  font-size: .78rem;
  font-family: var(--font-mono);
  cursor: pointer;
  box-shadow: none;
  white-space: nowrap;
}
.tag-pill:hover { background: var(--bg); transform: none; box-shadow: none; }
.tag-pill--sm { padding: .15rem .5rem; font-size: .7rem; }
.tag-pill--active {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}
.q-browser__row {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .65rem .85rem;
  margin-bottom: 6px;
  cursor: pointer;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "head    actions"
    "tags    actions"
    "usage   actions";
  gap: .25rem .8rem;
  transition: border-color .12s, box-shadow .12s;
}
.q-browser__row:hover { border-color: var(--red); box-shadow: var(--shadow); }
.q-browser__head { grid-area: head; font-family: var(--font-serif); font-size: .95rem; }
.q-browser__head .q-browser__type { margin-right: .4rem; font-family: var(--font-mono); }
.q-browser__meta:nth-of-type(2) { grid-area: tags; }
.q-browser__meta:nth-of-type(3) { grid-area: usage; }
.q-browser__actions { grid-area: actions; display: flex; gap: .3rem; align-items: center; }

.paste-zone {
  margin-top: .4rem;
  padding: .9rem 1rem;
  background: var(--bg);
  border: 2px dashed var(--border2);
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: .88rem;
  color: var(--tx2);
  cursor: text;
  outline: none;
  transition: border-color .15s, background .15s;
}
.paste-zone:focus, .paste-zone:hover {
  border-color: var(--red);
  background: var(--bg-2);
}
.paste-zone--hover {
  border-color: var(--red);
  background: rgba(226,36,27,.06);
}

.hint-box {
  background: rgba(37,99,235,.08);
  border-left: 3px solid var(--blue);
  padding: .7rem 1rem;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  color: var(--tx2);
  margin-bottom: 1rem;
  line-height: 1.5;
}
.mcq-edit-row {
  display: flex;
  gap: .5rem;
  align-items: center;
  background: var(--bg);
  padding: .4rem .6rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.mcq-edit-row input[type="checkbox"]:checked + span,
.mcq-edit-row:has(input[type="checkbox"]:checked) {
  background: rgba(16,185,129,.10);
  border-color: var(--green);
}

/* ─── Admin dashboard ───────────────────────────────────────────────── */
.admin-tabs {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 24px;
  overflow: visible;
}
.admin-tab {
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  border-bottom: 2px solid transparent;
  color: var(--tx-2);
  cursor: pointer;
  font-weight: 400;
  font-size: 13px;
  white-space: nowrap;
  box-shadow: none;
  margin-bottom: -1px;
  transition: background .12s, color .12s, border-color .12s;
}
.admin-tab:hover {
  color: var(--accent-dk);
  background: var(--accent-soft);
  transform: none;
  box-shadow: none;
}
.admin-tab.active {
  color: var(--accent-dk);
  border-bottom-color: var(--accent);
  font-weight: 500;
}
@media (max-width: 480px) {
  .admin-tab { padding: 6px 8px; font-size: 12px; }
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.admin-table th, .admin-table td {
  padding: .75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: .9rem;
}
.admin-table th {
  background: var(--bg-2);
  font-weight: 700;
  color: var(--tx);
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.admin-table tr:hover { background: var(--bg); }
.admin-table tr:last-child td { border-bottom: none; }

.admin-actions {
  display: flex;
  gap: .5rem;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.admin-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--tx3);
  font-style: italic;
}

/* Admin küsimuse loomine — hotspot-tool */
.hotspot-tool {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 16px;
}
@media (max-width: 900px) {
  .hotspot-tool { grid-template-columns: 1fr; }
}
.hotspot-tool__panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.hotspot-tool__panel h4 {
  margin: 0 0 .75rem;
  font-family: var(--font);
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--tx2);
}
.area-list { list-style: none; padding: 0; margin: 0; }
.area-list li {
  padding: .5rem .75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: .4rem;
  font-family: var(--font-mono);
  font-size: .75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.area-list .remove {
  cursor: pointer;
  color: var(--red);
  font-weight: 700;
  background: transparent;
  border: none;
  padding: 0;
  box-shadow: none;
}
.area-list .remove:hover { transform: none; box-shadow: none; }

/* Review võrdluse vaade */
.review-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}
@media (max-width: 800px) {
  .review-compare { grid-template-columns: 1fr; }
}
.review-compare__panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.review-compare__panel h4 { margin: 0 0 .75rem; }

/* ─── Modal ─────────────────────────────────────────────────────────── */
.aw-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
}
.aw-modal[hidden] { display: none; }
.aw-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11,18,32,.6);
  backdrop-filter: blur(4px);
}
.aw-modal__panel {
  position: relative;
  background: var(--card);
  border-radius: var(--radius-lg);
  max-width: 720px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
.aw-modal__close {
  position: absolute;
  top: 12px; right: 12px;
  background: transparent;
  border: none;
  font-size: 1.8rem;
  line-height: 1;
  color: var(--tx2);
  cursor: pointer;
  padding: .2rem .5rem;
  border-radius: var(--radius-sm);
  box-shadow: none;
}
.aw-modal__close:hover { background: var(--bg-2); transform: none; box-shadow: none; }
.aw-modal__body { padding: 32px; }

/* ─── Busy overlay ─────────────────────────────────────────────────── */
.aw-busy-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(11,18,32,.55);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
}
.aw-busy-overlay[hidden] { display: none; }
.aw-busy-overlay__panel {
  background: var(--card);
  padding: 32px 48px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.aw-busy-overlay__panel .hex { margin: 0 auto .75rem; animation: spin 1.5s linear infinite; }
.aw-busy-overlay__panel p { margin: 0; color: var(--tx2); font-weight: 600; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* ─── Toast ─────────────────────────────────────────────────────────── */
.aw-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  pointer-events: none;
}
.toast-item {
  background: var(--sb);
  color: #fff;
  padding: .8rem 1.2rem;
  border-radius: var(--radius);
  margin-top: .5rem;
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--red);
  font-size: .9rem;
  max-width: 360px;
  pointer-events: auto;
  animation: slidein .25s ease;
}
.toast-item--success { border-left-color: var(--green); }
.toast-item--warn { border-left-color: var(--yellow); }
.toast-item--error { border-left-color: var(--red-2); }
@keyframes slidein {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ─── Footer ────────────────────────────────────────────────────────── */
.aw-footer {
  padding: 16px 32px 24px 252px;
  font-size: 11px;
  color: var(--tx-3);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .08em;
}
@media (max-width: 768px) {
  .aw-footer { padding: 16px; text-align: center; }
}
.aw-footer__inner {
  display: flex;
  gap: 1rem;
}
.aw-footer__warn {
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--yellow);
  padding: .2rem .6rem;
  border: 1px solid var(--yellow);
  border-radius: 999px;
}

/* ─── Mobile breakpoint ─────────────────────────────────────────────── */
@media (max-width: 760px) {
  .aw-header__inner { gap: .75rem; padding: 0 16px; }
  .aw-brand__text { display: none; }
  .hex-grid--header { display: none; }
  .aw-nav { gap: 0; }
  .aw-nav a { padding: .3rem .6rem; font-size: .8rem; }
  .aw-user__name { display: none; }
  .aw-main { padding: 16px 16px 60px; }
  .question-card { padding: 18px; }
  .question-card__prompt { font-size: 1.1rem; }
  .question-card__actions { flex-direction: column-reverse; }
  .question-card__actions button { width: 100%; }
}

/* ─── Print ─────────────────────────────────────────────────────────── */
@media print {
  .aw-header, .aw-footer, .aw-nav, .aw-user, button { display: none !important; }
  body { background: #fff; }
  .result-hero { padding: 0; }
}

/* ═══════════════════════════════════════════════════════════════════════
   BIGTHEMES (sünk AW Wikiga: body.bigtheme-cyberpunk / -newspaper / -noir)
   Iga ülekirjutab paleti, fondid, kaartide stiili.
   ═══════════════════════════════════════════════════════════════════════ */

/* ───────── BIGTHEME: CYBERPUNK ───────── */
body.bigtheme-cyberpunk {
  --bg: #04060f;
  --bg-2: #0a0e1f;
  --card: #0d1428;
  --tx: #e2faff;
  --tx2: #7afff5;
  --tx3: #5ce8ff;
  --border: #1a2a4a;
  --border2: #27e0ff;
  --red: #ff2a6d;
  --red-dk: #ff0044;
  --font: 'JetBrains Mono', 'Courier New', monospace;
  --font-serif: 'JetBrains Mono', 'Courier New', monospace;
  --neon-cyan: #00f0ff;
  --neon-magenta: #ff00ff;
  --neon-yellow: #fff200;
  --shadow: 0 0 12px rgba(0,240,255,.3);
  --shadow-lg: 0 0 24px rgba(255,42,109,.4);
}
body.bigtheme-cyberpunk {
  background:
    radial-gradient(1200px 600px at 80% 0%, rgba(255,42,109,.15), transparent 60%),
    radial-gradient(900px 500px at 20% 100%, rgba(0,240,255,.14), transparent 55%),
    #04060f;
  color: var(--tx);
  position: relative;
}
body.bigtheme-cyberpunk::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 9999;
  background: repeating-linear-gradient(0deg, transparent 0, transparent 2px, rgba(0,240,255,.025) 2px, rgba(0,240,255,.025) 3px);
  mix-blend-mode: overlay;
}
body.bigtheme-cyberpunk .aw-header {
  background: linear-gradient(180deg, #04060f 0%, #0a0e1f 100%);
  border-bottom: 1px solid var(--neon-cyan);
  box-shadow: 0 4px 20px rgba(0,240,255,.2);
}
body.bigtheme-cyberpunk .aw-brand__mark {
  background: linear-gradient(135deg, var(--neon-magenta), var(--neon-cyan));
  box-shadow: 0 0 12px var(--neon-magenta);
}
body.bigtheme-cyberpunk .aw-brand__name {
  color: var(--neon-cyan);
  text-shadow: 0 0 8px var(--neon-cyan);
  text-transform: uppercase;
  letter-spacing: .1em;
}
body.bigtheme-cyberpunk .aw-page-hero,
body.bigtheme-cyberpunk .login-card,
body.bigtheme-cyberpunk .exam-card,
body.bigtheme-cyberpunk .question-card,
body.bigtheme-cyberpunk .result-detail__cell,
body.bigtheme-cyberpunk .admin-table,
body.bigtheme-cyberpunk .aw-modal__panel,
body.bigtheme-cyberpunk .mcq-option {
  background: var(--card);
  border: 1px solid var(--border2);
  box-shadow: 0 0 16px rgba(0,240,255,.15);
}
body.bigtheme-cyberpunk .login-card::before {
  background: linear-gradient(90deg, var(--neon-magenta), var(--neon-cyan));
  height: 2px;
}
body.bigtheme-cyberpunk h1, body.bigtheme-cyberpunk h2,
body.bigtheme-cyberpunk h3, body.bigtheme-cyberpunk h4,
body.bigtheme-cyberpunk .aw-page-hero h1 {
  color: var(--neon-cyan);
  text-shadow: 0 0 10px var(--neon-cyan);
  text-transform: uppercase;
  letter-spacing: .04em;
}
body.bigtheme-cyberpunk .btn--primary,
body.bigtheme-cyberpunk button.btn--primary {
  background: linear-gradient(90deg, var(--neon-magenta), var(--neon-cyan));
  color: #000;
  text-shadow: none;
  border: none;
}
body.bigtheme-cyberpunk .btn--primary:hover {
  box-shadow: 0 0 20px var(--neon-cyan);
}
body.bigtheme-cyberpunk a { color: var(--neon-cyan); text-shadow: 0 0 4px rgba(0,240,255,.6); }
body.bigtheme-cyberpunk a:hover { color: var(--neon-magenta); text-shadow: 0 0 8px var(--neon-magenta); }
body.bigtheme-cyberpunk .status-badge { font-family: var(--font-mono); border-width: 2px; }
body.bigtheme-cyberpunk .admin-table thead tr {
  background: linear-gradient(90deg, var(--neon-magenta), var(--neon-cyan));
}
body.bigtheme-cyberpunk .admin-table th { color: #000; }
body.bigtheme-cyberpunk .hex {
  background: linear-gradient(135deg, var(--neon-magenta), var(--neon-cyan));
  box-shadow: 0 0 16px var(--neon-cyan);
  color: #000;
}
body.bigtheme-cyberpunk .aw-footer {
  background: #04060f;
  border-top: 1px solid var(--neon-cyan);
}

/* ───────── BIGTHEME: NEWSPAPER ───────── */
body.bigtheme-newspaper {
  --bg: #f0e6d2;
  --bg-2: #e6dbc3;
  --card: #fbf7ec;
  --tx: #1a1612;
  --tx2: #3d342a;
  --tx3: #7a6b56;
  --border: #c9b893;
  --border2: #a89472;
  --red: #7c1b1b;
  --red-dk: #5a0f0f;
  --font: 'Newsreader', 'Times New Roman', serif;
  --font-serif: 'Newsreader', 'Times New Roman', serif;
  --shadow: 0 1px 0 rgba(0,0,0,.08);
  --shadow-md: 0 2px 0 rgba(0,0,0,.10);
  --shadow-lg: 0 2px 0 rgba(0,0,0,.12);
  --radius: 0; --radius-sm: 0; --radius-lg: 0;
}
body.bigtheme-newspaper {
  background:
    repeating-linear-gradient(0deg, transparent 0, transparent 28px, rgba(122,107,86,.03) 28px, rgba(122,107,86,.03) 29px),
    var(--bg);
}
body.bigtheme-newspaper .aw-header {
  background: #1a1612;
  border-bottom: 4px double var(--card);
}
body.bigtheme-newspaper .aw-brand__mark { background: var(--red); border-radius: 0; }
body.bigtheme-newspaper .aw-brand__name {
  font-family: 'Newsreader', serif;
  font-weight: 900;
  font-size: 1.3rem;
  letter-spacing: -.01em;
  text-transform: none;
}
body.bigtheme-newspaper .aw-page-hero {
  background: var(--card);
  border: 1px solid var(--border);
  border-top: 6px double var(--tx);
  border-radius: 0;
}
body.bigtheme-newspaper .aw-page-hero h1 {
  font-family: 'Newsreader', serif;
  font-weight: 900;
  letter-spacing: -.02em;
  border-bottom: 3px double var(--tx);
  padding-bottom: 8px;
}
body.bigtheme-newspaper .aw-page-hero p { font-style: italic; }
body.bigtheme-newspaper .login-card,
body.bigtheme-newspaper .exam-card,
body.bigtheme-newspaper .question-card,
body.bigtheme-newspaper .result-detail__cell,
body.bigtheme-newspaper .admin-table,
body.bigtheme-newspaper .aw-modal__panel,
body.bigtheme-newspaper .mcq-option {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0;
  box-shadow: none;
}
body.bigtheme-newspaper .login-card::before {
  height: 3px;
  background: var(--tx);
}
body.bigtheme-newspaper .exam-card { border-top: 3px solid var(--tx); }
body.bigtheme-newspaper .exam-card__title,
body.bigtheme-newspaper .question-card__prompt {
  font-family: 'Newsreader', serif;
  font-weight: 800;
  letter-spacing: -.015em;
}
body.bigtheme-newspaper .btn {
  border-radius: 0;
  border: 1px solid var(--tx);
  background: var(--card);
  color: var(--tx);
}
body.bigtheme-newspaper .btn:hover { background: var(--tx); color: var(--card); }
body.bigtheme-newspaper .btn--primary { background: var(--tx); color: var(--card); }
body.bigtheme-newspaper .btn--primary:hover { background: var(--red); color: #fff; }
body.bigtheme-newspaper a { color: var(--red); text-decoration: underline; }
body.bigtheme-newspaper .status-badge,
body.bigtheme-newspaper .tag,
body.bigtheme-newspaper .exam-card__meta .tag {
  background: var(--tx) !important;
  color: var(--card) !important;
  border-radius: 0;
  border: none;
  font-family: var(--font);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
}
body.bigtheme-newspaper .admin-table thead tr { background: var(--tx); color: var(--card); }
body.bigtheme-newspaper .admin-table th { color: var(--card); }
body.bigtheme-newspaper .hex {
  background: var(--tx);
  color: var(--card);
  clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
}
body.bigtheme-newspaper .aw-footer {
  background: #1a1612;
  border-top: 4px double var(--card);
}

/* ───────── BIGTHEME: NOIR ───────── */
body.bigtheme-noir {
  --bg: #0a0a0a;
  --bg-2: #161616;
  --card: #1c1c1c;
  --tx: #fafafa;
  --tx2: #bfbfbf;
  --tx3: #7a7a7a;
  --border: #2a2a2a;
  --border2: #404040;
  --red: #ffffff;
  --red-dk: #dddddd;
  --font: 'Inter', 'Helvetica Neue', sans-serif;
  --font-serif: 'Newsreader', Georgia, serif;
  --shadow: none;
  --shadow-md: none;
  --shadow-lg: none;
  --radius: 0; --radius-sm: 0; --radius-lg: 0;
}
body.bigtheme-noir { background: #0a0a0a; color: var(--tx); }
body.bigtheme-noir .aw-header {
  background: #000;
  border-bottom: 1px solid #fff;
}
body.bigtheme-noir .aw-brand__mark {
  background: transparent;
  border: 1px solid #fff;
  border-radius: 0;
}
body.bigtheme-noir .aw-brand__name {
  font-family: 'Newsreader', serif;
  font-weight: 200;
  letter-spacing: -.02em;
}
body.bigtheme-noir h1, body.bigtheme-noir h2,
body.bigtheme-noir h3, body.bigtheme-noir .aw-page-hero h1 {
  font-family: 'Newsreader', serif;
  font-weight: 200;
  color: #fff;
  letter-spacing: -.03em;
}
body.bigtheme-noir .aw-page-hero {
  background: #000;
  border: 1px solid #fff;
  border-radius: 0;
  padding: 56px 40px;
}
body.bigtheme-noir .aw-page-hero p { font-size: 1.05rem; color: #bfbfbf; font-weight: 300; }
body.bigtheme-noir .login-card,
body.bigtheme-noir .exam-card,
body.bigtheme-noir .question-card,
body.bigtheme-noir .result-detail__cell,
body.bigtheme-noir .admin-table,
body.bigtheme-noir .aw-modal__panel,
body.bigtheme-noir .mcq-option {
  background: #0a0a0a;
  border: 1px solid #fff;
  border-radius: 0;
  box-shadow: none;
  color: #fff;
}
body.bigtheme-noir .login-card::before { display: none; }
body.bigtheme-noir .exam-card:hover,
body.bigtheme-noir .login-card:hover { background: #fff; color: #000; }
body.bigtheme-noir .exam-card:hover *,
body.bigtheme-noir .login-card:hover * { color: #000 !important; }
body.bigtheme-noir .btn {
  background: transparent;
  border: 1px solid #fff;
  color: #fff;
  border-radius: 0;
  font-weight: 300;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-size: .8rem;
}
body.bigtheme-noir .btn:hover { background: #fff; color: #000; }
body.bigtheme-noir .btn--primary { background: #fff; color: #000; }
body.bigtheme-noir .btn--primary:hover { background: #000; color: #fff; outline: 1px solid #fff; }
body.bigtheme-noir a { color: #fff; text-decoration: underline; }
body.bigtheme-noir .status-badge,
body.bigtheme-noir .tag,
body.bigtheme-noir .exam-card__meta .tag {
  background: #fff !important;
  color: #000 !important;
  border-radius: 0;
  border: none;
  font-weight: 300;
  letter-spacing: .16em;
}
body.bigtheme-noir .admin-table thead tr { background: #fff; }
body.bigtheme-noir .admin-table th { color: #000; }
body.bigtheme-noir .admin-table tbody tr:hover { background: #fff; color: #000; }
body.bigtheme-noir .admin-table tbody tr:hover * { color: #000 !important; }
body.bigtheme-noir .hex {
  background: #fff;
  color: #000;
  font-weight: 200;
}
body.bigtheme-noir .hex--ghost::after { background: #0a0a0a; }
body.bigtheme-noir .aw-footer {
  background: #000;
  border-top: 1px solid #fff;
}

/* ═══════════════════════════════════════════════════════════════════════
   Settings dropdown (sünk AW Wiki settings-popover'iga)
   ═══════════════════════════════════════════════════════════════════════ */
.aw-settings {
  position: relative;
}
.aw-settings__trigger {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--tx-2);
  padding: 6px 10px;
  font-size: 13px;
  border-radius: var(--radius-sm);
  box-shadow: none;
  cursor: pointer;
}
.aw-settings__trigger:hover {
  color: var(--accent-dk);
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: none;
  box-shadow: none;
}
/* Sidebar-kontekstis avaneb paneel ÜLES (paremale ekraani serv),
   et mahtuda nähtavaks. Vana ülemise header'i jaoks oli top:100%. */
.aw-settings__panel {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 16px;
  min-width: 260px;
  max-width: 90vw;
  z-index: 100;
}
@media (max-width: 768px) {
  .aw-settings__panel {
    left: 0;
    right: auto;
    min-width: 240px;
  }
}
.aw-settings__panel[hidden] { display: none; }
.settings-section { margin-bottom: 14px; }
.settings-section:last-of-type { margin-bottom: 8px; }
.settings-section h5 {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--tx3);
  margin: 0 0 .4rem;
  font-family: var(--font-mono);
}
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}
.settings-opt {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--tx);
  padding: .4rem .6rem;
  font-size: .8rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  box-shadow: none;
}
.settings-opt:hover { background: var(--bg-2); transform: none; box-shadow: none; }
.settings-opt.active {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}
.settings-note {
  font-size: .72rem;
  color: var(--tx3);
  margin: 8px 0 0;
  font-style: italic;
  border-top: 1px dashed var(--border);
  padding-top: 8px;
}

/* ═══════════════════════════════════════════════════════════════════════
   DESIGN.md v1.0 overrides — Anthropic terracotta + warm latte
   Cascade asub allpool kõiki teisi reegleid, et token-uuendused
   jõuaksid jõustada. (Lisatud Lauri Aav, mai 2026)
   ═══════════════════════════════════════════════════════════════════════ */

/* ─── Lingid: terracotta accent ─────────────────────────────────── */
a { color: var(--accent); }
a:hover { color: var(--accent-dk); text-decoration: underline; text-underline-offset: 3px; }

/* ─── Nupud: ei transform-i hover'il, peamine CTA terracotta ─────── */
button, .btn {
  box-shadow: none;
  transition: background .15s, border-color .15s, color .15s;
  font-weight: 500;
  border-radius: var(--radius-sm);
}
button:hover, .btn:hover { transform: none; box-shadow: none; }
.btn--primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn--primary:hover { background: var(--accent-dk); border-color: var(--accent-dk); }
.btn--ghost { background: transparent; color: var(--tx-2); border: 1px solid var(--border); }
.btn--ghost:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-dk); }

/* ─── Sisendid: terracotta fookus ───────────────────────────────── */
input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}

/* ─── Kaardid: 0.5px border, ei shadow'isid, 10px radius ─────────── */
.exam-card, .login-card, .summary-card, .question-card,
.module-card, .ann-card, .review-row, .aw-settings__panel {
  box-shadow: none !important;
  border-width: 1px;
  border-radius: var(--radius);
}
.exam-card:hover, .login-card:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--accent);
}

/* ─── Login-kaardi top-riba: accent terracotta ─────────────────── */
.login-card::before { background: var(--accent); }

/* ─── Page hero: flat (mitte gradient), accent halo eemaldatud ─── */
.aw-page-hero {
  background: var(--card);
  border-radius: var(--radius);
}
.aw-page-hero::after { display: none; }

/* ─── Header: säilita brand-red sb-stiil (Airwave identiteet) ──── */
/* (.aw-header taustaks dark navy gradient — disain ei ütle muuta) */

/* ─── Header brand-mark: säilita brand-red ──────────────────────── */
/* (.aw-brand__mark = Airwave logo, jääb punaseks) */

/* ─── Aktiivne nav-link: terracotta (mitte red) ────────────────── */
.aw-nav a.active { background: var(--accent); }

/* ─── Coach/Trainer rolli-rinnamärk: terracotta ────────────────── */
.aw-user__role--coach,
.aw-user__role--trainer {
  background: var(--accent);
  border-color: var(--accent);
}

/* ─── Eksami staatus-pillid (DESIGN.md komponentide spec) ──────── */
.status-pill {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 500;
  letter-spacing: .02em;
}
.status-pill--ok { background: var(--ok-bg); color: var(--ok-tx); }
.status-pill--warn { background: var(--warn-bg); color: var(--warn-tx); }
.status-pill--err { background: var(--err-bg); color: var(--err-tx); }
.status-pill--info { background: var(--info-bg); color: var(--info-tx); }

/* ─── Avatari värvid (DESIGN.md komponendid) ──────────────────── */
.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
}
.avatar--master, .avatar--coach { background: var(--avatar-master); }
.avatar--aw-tech { background: var(--avatar-aw); }
.avatar--external { background: var(--avatar-ext); }
.avatar--anon { background: var(--avatar-anon); }

/* ─── Tüpograafia DESIGN.md järgi: weight 400/500, ei 600/700 ──── */
h1, h2, h3, h4 { font-weight: 500; }
strong, b { font-weight: 500; }
button, .btn { font-weight: 500; }

/* ─── Hex element header'is: säilita brand-red gradient ─────────── */
/* (Airwave logo — ei muutu DESIGN.md alla) */

/* ─── Hover-overlay vältimine kaartidel (DESIGN.md anti-pattern) ── */
.exam-card, .login-card, .summary-card, .question-card {
  transition: border-color .15s ease;
}

/* ═══════════════════════════════════════════════════════════════════════
   DESIGN.md v1.0 — Töölaud (dashboard) komponendid
   ═══════════════════════════════════════════════════════════════════════ */

/* Page header (greeting block) */
.page-head { margin-bottom: 28px; }
.page-head__title {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 500;
  margin: 0 0 4px;
  color: var(--tx);
  letter-spacing: -0.01em;
}
.page-head__sub {
  margin: 0;
  font-size: 14.5px;
  color: var(--tx-2);
  line-height: 1.5;
}

/* Stat-kaartide grid */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 36px;
}
@media (max-width: 768px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-card__label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--tx-3);
}
.stat-card__value {
  font-size: 28px;
  font-weight: 500;
  color: var(--tx);
  line-height: 1.1;
  margin-top: 4px;
}
.stat-card__hint {
  font-size: 12.5px;
  color: var(--tx-3);
  line-height: 1.4;
}

/* Sektsioon (h2 + sisu blokk) */
.section { margin-bottom: 36px; }
.section__title {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 500;
  margin: 0 0 14px;
  color: var(--tx);
}

/* Kaartide loend (vertikaalne, gap) */
.card-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Resume row (jätka pooleliolev eksami) */
.resume-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  color: var(--tx);
  text-decoration: none;
  transition: border-color .12s, background .12s;
}
.resume-row:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  text-decoration: none;
}
.resume-row__info { flex: 1; min-width: 0; }
.resume-row__title {
  font-weight: 500;
  font-size: 15px;
  color: var(--tx);
  margin-bottom: 4px;
}
.resume-row__meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--tx-3);
  font-family: var(--font-mono);
}
.resume-row__cta {
  font-size: 13px;
  font-weight: 500;
  color: var(--accent-dk);
  white-space: nowrap;
}

/* Tühi olek */
.empty-state {
  padding: 28px 20px;
  background: var(--card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  text-align: center;
  font-size: 14px;
  color: var(--tx-2);
}

/* ═══════════════════════════════════════════════════════════════════════
   DESIGN.md v1.0 — Eksami sooritamine (two-column + sticky paneel)
   ═══════════════════════════════════════════════════════════════════════ */

/* Header riba (moodul + küsimus N/M + taimer + lõpeta hiljem) */
.exam-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 4px 12px;
  flex-wrap: wrap;
}
.exam-head__left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.exam-head__crumb {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 500;
  color: var(--tx);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.exam-head__qnum {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--tx-3);
}
.exam-head__right {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Taimer (mono, terracotta ikoon) */
.exam-timer {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--accent-dk);
  background: var(--accent-soft);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
}
.exam-timer.warn { color: var(--warn-tx); background: var(--warn-bg); }
.exam-timer.danger { color: var(--err-tx); background: var(--err-bg); }

.exam-save-later {
  font-size: 13px;
  color: var(--tx-2);
  text-decoration: none;
  white-space: nowrap;
}
.exam-save-later:hover {
  color: var(--accent-dk);
  text-decoration: underline;
  text-underline-offset: 3px;
}
@media (max-width: 480px) {
  .exam-save-later { display: none; }
}

/* 3px progress bar (DESIGN.md spec) */
.exam-progress-track {
  height: 3px;
  background: var(--border-soft);
  border-radius: 999px;
  margin: 0 4px 28px;
  overflow: hidden;
}
.exam-progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width .18s ease;
}

/* Two-column shell — 1.3fr / 1fr */
.exam-shell {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 28px;
  align-items: start;
}
@media (max-width: 900px) {
  .exam-shell { grid-template-columns: 1fr; }
}

.exam-left { min-width: 0; }

/* Sticky right panel */
.exam-side {
  position: sticky;
  top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
@media (max-width: 900px) {
  .exam-side { position: static; }
}

.side-card {
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.side-card--help {
  background: var(--accent-soft);
  border-color: rgba(204,120,92,0.18);
}
.side-card__label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--tx-3);
  margin-bottom: 10px;
}
.side-card__body {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--tx-2);
}

/* Edenemis-punktid (8px ribakesed, grid) */
.side-progress {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 4px;
  margin-bottom: 8px;
}
.dot {
  height: 8px;
  border-radius: 2px;
  background: var(--border-soft);
  border: 0;
  padding: 0;
  cursor: pointer;
  transition: background .12s, transform .12s, outline .12s;
}
.dot:hover { transform: scaleY(1.3); }
.dot--done {
  background: var(--accent);
  opacity: 0.6;
}
.dot--current {
  background: var(--accent-dk);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.side-progress__meta {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--tx-3);
  letter-spacing: 0.04em;
}

/* Eelmine / Järgmine nupud sticky paneeli põhjas */
.side-nav {
  display: flex;
  gap: 8px;
}
.side-nav .btn {
  flex: 1;
  justify-content: center;
  text-align: center;
}

/* Question card sees kohendused (eksami-vaates pole topelt-card-i) */
.exam-left .question-card {
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 24px 28px;
}
.exam-left .question-card__num {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--tx-3);
  margin-bottom: 12px;
}
.exam-left .question-card__prompt {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 500;
  margin: 0 0 18px;
  color: var(--tx);
  line-height: 1.35;
}

/* Preview-banner peenem stiil (kollased ribad eemaldatud) */
.preview-banner {
  background: var(--info-bg);
  color: var(--info-tx);
  border: 1px solid rgba(24, 95, 165, 0.2);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 12.5px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.preview-banner a { color: var(--info-tx); font-weight: 500; }

/* ═══════════════════════════════════════════════════════════════════════
   DESIGN.md v1.0 — Coach screens (filter chips, pending row, users table)
   ═══════════════════════════════════════════════════════════════════════ */

/* Filter chip'id (Ootab kontrolli, Kasutajad) */
.filter-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.filter-chip {
  background: var(--card);
  border: 1px solid var(--border-soft);
  color: var(--tx-2);
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 500;
  border-radius: 999px;
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
  box-shadow: none;
}
.filter-chip:hover {
  border-color: var(--accent);
  color: var(--accent-dk);
  background: var(--accent-soft);
}
.filter-chip--active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.filter-chip--active:hover {
  background: var(--accent-dk);
  color: #fff;
  border-color: var(--accent-dk);
}

/* Pending review row (Ootab kontrolli) */
.pending-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--tx);
  transition: border-color .12s, background .12s;
}
.pending-row:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  text-decoration: none;
}
.pending-row > .avatar { flex-shrink: 0; }
.pending-row__info { flex: 1; min-width: 0; }
.pending-row__name {
  font-weight: 500;
  font-size: 14.5px;
  color: var(--tx);
  margin-bottom: 4px;
}
.pending-row__meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--tx-3);
  font-family: var(--font-mono);
}
.pending-row__score {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}
.pending-row__pct {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 500;
  color: var(--tx);
}
.pending-row__pct-label {
  font-size: 10.5px;
  color: var(--tx-3);
  text-transform: uppercase;
  letter-spacing: .04em;
  font-family: var(--font-mono);
}
.pending-row__score--low .pending-row__pct { color: var(--err-tx); }
.pending-row__cta {
  font-size: 13px;
  font-weight: 500;
  color: var(--accent-dk);
  white-space: nowrap;
  margin-left: 6px;
}

/* Kasutajate tabel (Kasutajad) */
.users-toolbar {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 18px;
}
.users-toolbar__search {
  flex: 1;
  min-width: 220px;
  padding: 8px 12px;
  font-size: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--tx);
}
.users-toolbar__search:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}
.users-toolbar .filter-chips { margin-bottom: 0; }

.users-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 13.5px;
}
.users-table thead th {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--tx-3);
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-soft);
}
.users-table tbody tr {
  border-bottom: 1px solid var(--border-soft);
  transition: background .1s;
}
.users-table tbody tr:last-child { border-bottom: 0; }
.users-table tbody tr:hover { background: rgba(0,0,0,0.015); }
.users-table td {
  padding: 12px 14px;
  vertical-align: middle;
  color: var(--tx);
}
.users-table__name {
  display: flex;
  align-items: center;
  gap: 10px;
}
.users-table__name strong { font-weight: 500; display: block; }
.users-table__name small {
  color: var(--tx-3);
  font-size: 11.5px;
  font-family: var(--font-mono);
}
.users-table__num { font-family: var(--font-mono); }
.users-table__date {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--tx-3);
}
.users-table__actions {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
@media (max-width: 768px) {
  .users-table { font-size: 12.5px; }
  .users-table td { padding: 10px 8px; }
}

/* Inline rolli-muutmise pill (master vaates) */
.role-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
}
.role-cell__select {
  width: 28px;
  height: 24px;
  padding: 0 4px;
  font-size: 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--tx-2);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='%238a7a5c' d='M2 4l4 4 4-4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 10px;
}
.role-cell__select:hover {
  border-color: var(--accent);
  color: var(--accent-dk);
}
.role-cell__select:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}

/* ═══════════════════════════════════════════════════════════════════════
   Mobile audit — Etapp 5 (DESIGN.md järgi)
   ═══════════════════════════════════════════════════════════════════════ */

/* Users-table: ≤600px peida vähemtähtsad veerud, kompaktsemaks */
@media (max-width: 600px) {
  /* Peida: Ettevõte (3.), Liitus (5.), Konto (6.) — säilita Nimi/Roll/Sooritusi/Actions */
  .users-table thead th:nth-child(3),
  .users-table thead th:nth-child(5),
  .users-table thead th:nth-child(6),
  .users-table tbody td:nth-child(3),
  .users-table tbody td:nth-child(5),
  .users-table tbody td:nth-child(6) {
    display: none;
  }
  .users-table { font-size: 12px; }
  .users-table td { padding: 8px 6px; }
  .users-table__name { gap: 8px; }
  .users-table__actions {
    flex-direction: column;
    align-items: stretch;
    gap: 3px;
  }
  .users-table__actions .btn--sm {
    padding: 4px 6px;
    font-size: 11px;
    min-width: 44px;
  }
}

/* Pending-row: ≤500px stack score allapoole */
@media (max-width: 500px) {
  .pending-row {
    flex-wrap: wrap;
    gap: 10px;
  }
  .pending-row__score {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    margin-left: auto;
  }
  .pending-row__pct-label { display: none; }
  .pending-row__cta { width: 100%; text-align: right; }
}

/* Filter chip'id: ≤480px tighter */
@media (max-width: 480px) {
  .filter-chip {
    padding: 5px 9px;
    font-size: 11.5px;
  }
}

/* Page-head: ≤480px kompaktsem */
@media (max-width: 480px) {
  .page-head { margin-bottom: 20px; }
  .page-head__title { font-size: 22px; }
  .page-head__sub { font-size: 13px; }
}

/* Stat-grid mobile: kindel et value font ei ulatu üle kasti */
@media (max-width: 480px) {
  .stat-card { padding: 14px 16px; }
  .stat-card__value { font-size: 24px; }
}

/* Resume-row mobile: vähenda padding */
@media (max-width: 480px) {
  .resume-row { padding: 12px 14px; gap: 10px; }
  .resume-row__cta { font-size: 12px; }
}

/* Exam-head mobile: timer ja "Lõpeta hiljem" mahu jaoks */
@media (max-width: 480px) {
  .exam-head { padding: 10px 4px 8px; gap: 10px; }
  .exam-head__crumb { font-size: 14px; }
  .exam-timer { font-size: 13px; padding: 4px 8px; }
}

/* Sidebar overlay: mobile peab klõpsates sulguma backdrop-i peal */
@media (max-width: 768px) {
  .aw-sidebar--open::before {
    content: '';
    position: fixed;
    top: 0; left: 240px; right: 0; bottom: 0;
    background: transparent;
    z-index: -1;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   User-history modaal + tabeli interaktiivsed elemendid
   ═══════════════════════════════════════════════════════════════════════ */

.users-table__row { cursor: default; }
.users-table__name {
  cursor: pointer;
  transition: color .12s;
}
.users-table__name:hover strong { color: var(--accent-dk); }
.users-table__name:hover small { color: var(--accent-dk); }

/* Ettevõte-veerg link-laadi (filtreeri klõpsu peal) */
.users-table__company {
  background: transparent;
  border: 0;
  padding: 2px 4px;
  margin: -2px -4px;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background .12s, color .12s;
  font-size: 13px;
}
.users-table__company:hover {
  background: var(--accent-soft);
  color: var(--accent-dk);
}

/* Sooritus-arvu klikitav nupp */
.users-table__count {
  background: transparent;
  border: 0;
  padding: 0 6px;
  font: inherit;
  font-family: var(--font-mono);
  color: var(--tx);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background .12s, color .12s;
}
.users-table__count:hover {
  background: var(--accent-soft);
  color: var(--accent-dk);
}

/* Suurem avatar modaali jaoks */
.avatar--xl {
  width: 56px;
  height: 56px;
  font-size: 18px;
  border-radius: 50%;
}

/* User-history modaali head */
.user-history__head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-soft);
}

/* Toolbar: nupud paigutus */
.users-toolbar #users-export-btn { margin-left: auto; }
@media (max-width: 600px) {
  .users-toolbar #users-export-btn { margin-left: 0; width: 100%; }
}

/* ═══════════════════════════════════════════════════════════════════════
   HotspotRunner — kasutaja PDF-küsimuses suurem vaade + zoom
   ═══════════════════════════════════════════════════════════════════════ */

.hotspot-runner-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 4px 12px;
  flex-wrap: wrap;
}
.hotspot-runner-bar__label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--tx-3);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-right: 4px;
}
.hotspot-runner-bar__zoom {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--tx);
  padding: 0 8px;
  min-width: 50px;
  text-align: center;
}
.hotspot-runner-bar [data-fullscreen] {
  margin-left: auto;
}

/* Fullscreen kasutaja-runner — scroll'iga (X + Y) ja sticky tooli'ga */
.hotspot-host--fullscreen {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: var(--bg);
  /* Block layout (mitte flex), et canvas saaks loomulikult viewport'i ületada
     ja host scroll'iks mõlemas suunas */
  overflow: auto;
  padding: 0;
  display: block;
}
.hotspot-host--fullscreen .hotspot-runner-bar {
  position: sticky;
  top: 0;
  left: 0;
  background: var(--bg);
  z-index: 3;
  padding: 10px 20px;
  margin: 0;
  border-bottom: 1px solid var(--border-soft);
  min-width: 100vw;
  box-sizing: border-box;
}
.hotspot-host--fullscreen .hotspot-pdf-nav {
  position: sticky;
  top: 56px;
  left: 0;
  background: var(--bg);
  z-index: 2;
  padding: 6px 20px;
  border-bottom: 1px solid var(--border-soft);
  min-width: 100vw;
  box-sizing: border-box;
}
.hotspot-host--fullscreen .hotspot-wrapper {
  display: inline-block;
  position: relative;
  max-width: none;
  max-height: none;
  margin: 16px 20px 24px;
  vertical-align: top;
}
.hotspot-host--fullscreen canvas.asset-layer,
.hotspot-host--fullscreen canvas.hotspot-layer {
  /* Width: auto — kasuta canvas.width attribute'i (PDF.js renderdab
     baseScale * scale'iga). Vana .hotspot-wrapper canvas {width:100%}
     reegel sunniks fullscreen'is canvas'i wrapper'i suurusele ja
     zoom oleks visuaalselt nähtamatu. */
  width: auto;
  max-width: none;
  height: auto;
  display: block;
}
.hotspot-host--fullscreen .hotspot-hint {
  display: block;
  padding: 6px 20px 16px;
  min-width: 100vw;
  box-sizing: border-box;
  margin: 0;
}

/* ═══════════════════════════════════════════════════════════════════════
   Sidebar FS-staatuse indikaator (OneDrive ühenduse-staatus)
   ═══════════════════════════════════════════════════════════════════════ */

.aw-fs-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-soft);
  background: var(--card);
  font-size: 12px;
}
.aw-fs-status__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.aw-fs-status--ok .aw-fs-status__dot { background: var(--ok-tx, #3b6d11); }
.aw-fs-status--off .aw-fs-status__dot {
  background: var(--err-tx, #a32d2d);
  animation: aw-fs-pulse 1.6s ease-in-out infinite;
}
@keyframes aw-fs-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
.aw-fs-status__body {
  flex: 1;
  min-width: 0;
  line-height: 1.3;
}
.aw-fs-status__title {
  font-weight: 500;
  color: var(--tx);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.aw-fs-status--ok .aw-fs-status__title { color: var(--ok-tx, #3b6d11); }
.aw-fs-status--off .aw-fs-status__title { color: var(--err-tx, #a32d2d); }
.aw-fs-status__detail {
  font-size: 11px;
  color: var(--tx-3);
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.aw-fs-status__btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--tx-2);
  padding: 5px 9px;
  font-size: 11px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: none;
  white-space: nowrap;
  font-family: inherit;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.aw-fs-status__btn:hover {
  border-color: var(--accent);
  color: var(--accent-dk);
  background: var(--accent-soft);
}
.aw-fs-status__btn--primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.aw-fs-status__btn--primary:hover {
  background: var(--accent-dk);
  border-color: var(--accent-dk);
  color: #fff;
}

/* Review tab toolbar: filter-chips + sync nupp */
.review-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.review-toolbar #review-sync-btn {
  margin-left: auto;
}
@media (max-width: 600px) {
  .review-toolbar #review-sync-btn { margin-left: 0; }
}

/* Reviewed-row delete-nupu sile paigutus */
.pending-row--reviewed [data-del-reviewed] {
  flex-shrink: 0;
  margin-left: 8px;
  width: 30px;
  height: 30px;
  padding: 0;
  font-size: 16px;
  line-height: 1;
}

/* Exam-admin row thumbnail (Koolitused tab) */
.exam-admin-row__thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-2);
  border: 1px solid var(--border-soft);
  flex-shrink: 0;
}
.exam-admin-row__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ═══════════════════════════════════════════════════════════════════════
   MOODULITE PUU + FILTRID (Moodulid tab)
   ═══════════════════════════════════════════════════════════════════════ */
.filter-chips { display: flex; gap: .35rem; flex-wrap: wrap; }
.filter-chip {
  background: var(--bg-2);
  color: var(--tx2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .3rem .8rem;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: none;
  white-space: nowrap;
  transition: background .12s, color .12s, border-color .12s;
}
.filter-chip:hover { background: var(--bg); color: var(--tx); transform: none; box-shadow: none; }
.filter-chip--active {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}

.link-badge {
  display: inline-block;
  padding: .12rem .55rem;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 700;
  vertical-align: middle;
  white-space: nowrap;
}
.link-badge--linked { background: rgba(16,185,129,.14); color: var(--green); }
.link-badge--free   { background: rgba(245,158,11,.14); color: var(--yellow); }
.link-badge--warn   { background: rgba(226,36,27,.12);  color: var(--red); margin-left: .4rem; }

.q-tree__group {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  margin-bottom: 8px;
  overflow: hidden;
}
.q-tree__group[open] { background: var(--card); box-shadow: var(--shadow); }
.q-tree__summary {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .65rem .85rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
  flex-wrap: wrap;
}
.q-tree__summary::-webkit-details-marker { display: none; }
.q-tree__summary:hover { background: var(--bg-2); }
.q-tree__caret {
  display: inline-block;
  font-size: .8rem;
  color: var(--tx3);
  transition: transform .15s ease;
}
details[open] > summary .q-tree__caret { transform: rotate(90deg); color: var(--red); }
.q-tree__icon { font-size: .9rem; }
.q-tree__title { font-family: var(--font-serif); }
.q-tree__count {
  margin-left: auto;
  font-size: .75rem;
  font-family: var(--font-mono);
  color: var(--tx3);
  white-space: nowrap;
}
.q-tree__items { padding: .5rem .85rem .65rem; border-top: 1px dashed var(--border); }

/* ═══════════════════════════════════════════════════════════════════════
   STATISTIKA (stats.js) — kaardid, graafikud, heatmap, saavutused
   ═══════════════════════════════════════════════════════════════════════ */
.stats-fade { animation: statsFadeUp .35s ease both; }
@keyframes statsFadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.stats-subtabs {
  display: flex;
  gap: .4rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.stats-subtab {
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--tx2);
  border-radius: 999px;
  padding: .45rem 1rem;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: none;
  white-space: nowrap;
}
.stats-subtab:hover { background: var(--bg); color: var(--tx); transform: none; box-shadow: none; }
.stats-subtab--active { background: var(--sb); color: #fff; border-color: var(--sb); }

.stats-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.stats-cards--3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.stats-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  position: relative;
  overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease;
}
.stats-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stats-card::after {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--red), var(--orange));
  opacity: .75;
}
.stats-card--navy::after  { background: linear-gradient(90deg, var(--sb), var(--blue)); }
.stats-card--green::after { background: linear-gradient(90deg, var(--green), #34d399); }
.stats-card--yellow::after{ background: linear-gradient(90deg, var(--yellow), var(--orange)); }
.stats-card__icon { font-size: 1.15rem; margin-bottom: .15rem; }
.stats-card__value {
  font-size: 1.7rem;
  font-weight: 800;
  font-family: var(--font-mono);
  letter-spacing: -.02em;
  line-height: 1.15;
}
.stats-card__label { font-size: .8rem; font-weight: 600; color: var(--tx2); margin-top: .1rem; }
.stats-card__sub { font-size: .72rem; color: var(--tx3); margin-top: .2rem; }
.stats-card--donut { display: flex; align-items: center; gap: 12px; }
.stats-donut { width: 84px; height: 84px; flex: none; }
.stats-donut circle { transition: stroke-dasharray .6s ease; }
.stats-donut__text {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 19px;
  fill: var(--tx);
}

.stats-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 18px;
  overflow-x: auto; /* laiad tabelid kerivad paneeli sees, mitte üle lehe */
}
.stats-panel > h3 { margin: 0 0 .8rem; font-size: 1.02rem; }
.stats-panel > h4, .stats-acc__body h4 { margin: 0 0 .5rem; font-size: .9rem; color: var(--tx2); }
.stats-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.stats-2col > .stats-panel { margin-bottom: 0; }
.stats-2col { margin-bottom: 18px; }
@media (max-width: 760px) { .stats-2col { grid-template-columns: 1fr; } }

.stats-facts { list-style: none; padding: 0; margin: 0; }
.stats-facts li {
  padding: .45rem 0;
  border-bottom: 1px dashed var(--border);
  font-size: .88rem;
  color: var(--tx2);
  line-height: 1.45;
}
.stats-facts li:last-child { border-bottom: none; }

/* Heatmap (GitHub-stiilis) */
.hm { display: flex; gap: 4px; align-items: flex-start; overflow-x: auto; padding-bottom: 4px; }
.hm__days { display: flex; flex-direction: column; gap: 3px; flex: none; }
.hm__daylabel {
  height: 13px;
  font-size: .6rem;
  color: var(--tx3);
  font-family: var(--font-mono);
  line-height: 13px;
  width: 14px;
}
.hm__grid { display: flex; gap: 3px; }
.hm__col { display: flex; flex-direction: column; gap: 3px; }
.hm__cell {
  width: 13px;
  height: 13px;
  border-radius: 3px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  flex: none;
}
.hm__cell--future { opacity: .25; }
.hm__cell--l1 { background: rgba(226,36,27,.25); border-color: rgba(226,36,27,.3); }
.hm__cell--l2 { background: rgba(226,36,27,.5);  border-color: rgba(226,36,27,.5); }
.hm__cell--l3 { background: rgba(226,36,27,.75); border-color: rgba(226,36,27,.7); }
.hm__cell--l4 { background: var(--red); border-color: var(--red-dk); }
.hm__legend {
  display: flex;
  gap: 4px;
  align-items: center;
  margin-top: 6px;
  font-size: .68rem;
  color: var(--tx3);
}

/* Histogramm */
.stats-hist {
  display: flex;
  gap: 6px;
  align-items: stretch;
  height: 150px;
}
.stats-hist__col { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.stats-hist__barwrap { flex: 1; display: flex; align-items: flex-end; }
.stats-hist__bar {
  width: 100%;
  border-radius: 4px 4px 0 0;
  min-height: 2px;
  transition: height .4s ease;
}
.stats-hist__bar--bad  { background: linear-gradient(180deg, var(--red-2), var(--red)); }
.stats-hist__bar--mid  { background: linear-gradient(180deg, var(--yellow), var(--orange)); }
.stats-hist__bar--good { background: linear-gradient(180deg, #34d399, var(--green)); }
.stats-hist__x {
  font-size: .62rem;
  text-align: center;
  color: var(--tx3);
  font-family: var(--font-mono);
  margin-top: 3px;
}

/* Joongraafik */
.stats-line { width: 100%; height: auto; }
.stats-line__grid { stroke: var(--border); stroke-width: 1; stroke-dasharray: 2 4; }
.stats-line__tick { font-size: 10px; fill: var(--tx3); font-family: var(--font-mono); }
.stats-line__pass { stroke: var(--yellow); stroke-width: 1.5; stroke-dasharray: 6 4; opacity: .8; }
.stats-line__area { fill: rgba(226,36,27,.09); stroke: none; }
.stats-line__path { fill: none; stroke: var(--red); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.stats-line__dot { stroke: var(--card); stroke-width: 2; }
.stats-line__dot.is-pass { fill: var(--green); }
.stats-line__dot.is-fail { fill: var(--red); }

/* Horisontaalsed pulgad */
.stats-bar { display: flex; align-items: center; gap: .6rem; padding: .3rem 0; }
.stats-bar__label {
  width: 38%;
  min-width: 110px;
  font-size: .82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stats-bar__track {
  flex: 1;
  height: 12px;
  background: var(--bg-2);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.stats-bar__fill { height: 100%; border-radius: 999px; transition: width .5s ease; }
.stats-bar__fill--good { background: linear-gradient(90deg, #34d399, var(--green)); }
.stats-bar__fill--mid  { background: linear-gradient(90deg, var(--yellow), var(--orange)); }
.stats-bar__fill--bad  { background: linear-gradient(90deg, var(--red-2), var(--red)); }
.stats-bar__val { font-family: var(--font-mono); font-size: .8rem; font-weight: 700; white-space: nowrap; }

/* Pjedestaal */
.stats-podium {
  display: flex;
  gap: 18px;
  align-items: flex-end;
  justify-content: center;
  margin: 10px 0 18px;
}
.stats-podium__slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .25rem;
  width: 130px;
  min-width: 0;
}
.stats-podium__medal { font-size: 1.5rem; }
.stats-podium__name {
  font-size: .82rem;
  font-weight: 700;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stats-podium__score { font-family: var(--font-mono); font-weight: 800; color: var(--red); }
.stats-podium__bar {
  width: 100%;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, var(--bg-2), var(--border));
  border: 1px solid var(--border);
  border-bottom: 3px solid var(--red);
}
.stats-podium__slot--1 .stats-podium__bar { background: linear-gradient(180deg, rgba(245,158,11,.35), var(--bg-2)); border-bottom-color: var(--yellow); }

/* Kasutaja valik + päis */
.stats-userpick {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.stats-hint { font-size: .8rem; color: var(--tx3); margin: 0 0 .4rem; }
.stats-userhead {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 18px;
}
.stats-confchip {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .45rem .9rem;
  font-size: .85rem;
  font-weight: 700;
}

/* Saavutused */
.stats-badges {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 8px;
}
.stats-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .15rem;
  text-align: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .6rem .4rem;
  opacity: .42;
  filter: grayscale(1);
  transition: transform .15s ease, opacity .2s, filter .2s;
  cursor: default;
}
.stats-badge--got {
  opacity: 1;
  filter: none;
  border-color: var(--yellow);
  background: linear-gradient(180deg, rgba(245,158,11,.10), var(--bg));
  box-shadow: var(--shadow);
}
.stats-badge:hover { transform: translateY(-2px); }
.stats-badge__icon { font-size: 1.4rem; line-height: 1; }
.stats-badge__name { font-size: .68rem; font-weight: 700; color: var(--tx2); }

/* Koolituse/mooduli akordion */
.stats-secthead { margin: 0 0 .6rem; }
.stats-acc {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  overflow: hidden;
}
.stats-acc[open] { box-shadow: var(--shadow); }
.stats-acc__summary {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .7rem .9rem;
  cursor: pointer;
  list-style: none;
  flex-wrap: wrap;
  user-select: none;
}
.stats-acc__summary::-webkit-details-marker { display: none; }
.stats-acc__summary:hover { background: var(--bg-2); }
.stats-acc__title { font-family: var(--font-serif); }
.stats-acc__meta {
  margin-left: auto;
  display: flex;
  gap: .8rem;
  font-size: .78rem;
  font-family: var(--font-mono);
  color: var(--tx2);
  white-space: nowrap;
}
.stats-acc__body { padding: .8rem .9rem 1rem; border-top: 1px dashed var(--border); }

.stats-topuser {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .3rem 0;
  font-size: .88rem;
}
.stats-topuser__medal { width: 1.6rem; text-align: center; }
.stats-topuser__name {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Küsimuste tabel */
.stats-qtable td { vertical-align: middle; }
.stats-mini { display: flex; align-items: center; gap: .5rem; min-width: 130px; }
.stats-mini__track {
  flex: 1;
  height: 9px;
  background: var(--bg-2);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.stats-mini__fill { height: 100%; border-radius: 999px; }
.stats-mini__fill--good { background: var(--green); }
.stats-mini__fill--mid  { background: var(--yellow); }
.stats-mini__fill--bad  { background: var(--red); }

@media (max-width: 640px) {
  .stats-podium { gap: 8px; }
  .stats-podium__slot { width: 31%; }
  .stats-bar__label { width: 32%; min-width: 80px; }
}

/* ─── Statistika r81: edetabeli scope, tegijate täistabel, koolituse drill-down ─── */
.stats-panel__head {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: .8rem;
}
.stats-scope {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin: 0 0 0 auto;
  font-size: .82rem;
  color: var(--tx2);
  font-weight: 500;
}
.stats-scope > span { white-space: nowrap; }
.stats-scope-select {
  width: auto;
  min-width: 180px;
  max-width: 260px;
  padding: .35rem .5rem;
  font-size: .82rem;
}

.stats-lb-details { margin-top: .8rem; }
.stats-lb-details > summary {
  cursor: pointer;
  font-size: .85rem;
  font-weight: 600;
  color: var(--tx2);
  padding: .35rem 0;
  user-select: none;
  list-style: none;
}
.stats-lb-details > summary::-webkit-details-marker { display: none; }
.stats-lb-details > summary::before { content: '▸ '; color: var(--tx3); }
.stats-lb-details[open] > summary::before { content: '▾ '; }
.stats-lb-details[open] > summary { color: var(--red); }

.stats-tablewrap { overflow-x: auto; }
.stats-perftable { font-size: .85rem; }
.stats-perftable th, .stats-perftable td { padding: .4rem .55rem; }
.stats-perftable__rank { white-space: nowrap; text-align: center; font-weight: 700; }
.stats-perftable tbody tr:hover { background: var(--bg-2); }
.stats-tie {
  display: inline-block;
  color: var(--blue);
  cursor: help;
  font-size: .8rem;
  vertical-align: middle;
}

/* Üldine / Moodulid toggle koolituse sees */
.stats-viewtoggle {
  display: inline-flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: .9rem;
  background: var(--bg);
}
.stats-viewtoggle__btn {
  background: transparent;
  border: none;
  color: var(--tx2);
  padding: .4rem 1rem;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: none;
  white-space: nowrap;
}
.stats-viewtoggle__btn:hover { background: var(--bg-2); transform: none; box-shadow: none; }
.stats-viewtoggle__btn.is-active { background: var(--sb); color: #fff; }

/* Pesastatud mooduli-akordion koolituse "Moodulid" vaates */
.stats-acc--nested {
  border-color: var(--border2);
  margin-bottom: 6px;
  background: var(--bg);
}
.stats-acc--nested > .stats-acc__summary { padding: .55rem .7rem; }
.stats-acc--nested .stats-acc__title { font-family: var(--font); font-weight: 600; font-size: .92rem; }
.stats-courseview h4 { margin: 0 0 .5rem; font-size: .9rem; color: var(--tx2); }
.stats-courseview h4:not(:first-child) { margin-top: .8rem; }

/* Grid-item blowout fix: luba peasisul kahaneda alla laia tabeli min-laiuse,
   et .stats-tablewrap (overflow-x:auto) saaks mobiilis horisontaalselt kerida. */
.aw-main { min-width: 0; }
.stats-tablewrap { max-width: 100%; -webkit-overflow-scrolling: touch; }
.stats-perftable { min-width: 460px; }
