/*
 * Plastiliidu Kutseeksam — design system (single source of truth for UI tokens & layout).
 * ------------------------------------------------------------------------
 * • Add new colours only as :root custom properties, then reference var(--…).
 * • System dark: override tokens in @media (prefers-color-scheme: dark) (incl. footer).
 * • Do not add literal hex/rgb in PHP templates; extend this file or reuse utilities.
 * • Nav: always class="site-header-nav-link" (+ is-active when current). No breakpoint-specific link styles.
 */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
}

:root {
  /* Brand */
  --primary: #007a7a;
  --primary-dark: #1a3a3a;
  --hero-bg: var(--primary-dark);
  --hero-fg: #fff;

  /* Surfaces */
  --surface: #fff;
  --bg: #f0f2f4;
  --bg-muted: #f3f4f6;
  --bg-subtle: #f8f9fa;
  --primary-soft: #e6f5f5;
  --primary-soft-hover: #f0fafa;
  --primary-ghost: #e8f5f5;

  /* Text */
  --text: #1a2a3a;
  --text-body: #374151;
  --muted: #6b7280;

  /* Lines */
  --border: #dde1e6;
  --border-strong: #d1d9e0;
  --border-primary-soft: #c5dede;

  /* Same hue as hero ribbon — never use link-teal for org title */
  --header-org-color: var(--hero-bg);

  /* Semantics */
  --success: #0e9f6e;
  --warning: #c27803;
  --danger: #e02424;
  --secondary: #6b7280;

  --radius: 6px;
  --radius-sm: 4px;
  --shadow-dropdown: 0 4px 20px rgba(0, 0, 0, 0.12);
  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.09);

  /* Preview banner */
  --preview-bg: #fef3c7;
  --preview-border: #f0d580;
  --preview-text: #78350f;
  --preview-btn-border: #d97706;
  --preview-btn-text: #92400e;
  --preview-btn-hover: #fde68a;

  /* Alerts */
  --alert-success-bg: #f0fdf4;
  --alert-success-border: #bbf7d0;
  --alert-success-text: #166534;
  --alert-error-bg: #fef2f2;
  --alert-error-border: #fecaca;
  --alert-error-text: #991b1b;
  --alert-info-bg: #e0f2fe;
  --alert-info-border: #7dd3fc;
  --alert-info-text: #0369a1;
  --alert-warn-bg: #fff8e1;
  --alert-warn-border: #ffe082;
  --info-banner-bg: #e0f2f1;
  --info-banner-border: #80cbc4;
  --video-wrap-bg: #f8fafc;
  --questions-section-bg: #fafbfc;

  /* Peamine sisu laius (keskendatud) */
  --main-max-width: 1000px;

  /* Nupud / avatar: tekst värvilisel taustal (sõltumata --surface heledusest) */
  --solid-btn-fg: #fff;
  /* Jalus (tume riba; muted tekst ja hover) */
  --footer-muted: rgba(255, 255, 255, .6);
  --footer-link-hover: #fff;
}

@media (prefers-color-scheme: dark) {
  html { color-scheme: dark; }

  :root {
    /* Brand */
    --primary: #5eead4;
    --primary-dark: #0a1818;
    --hero-bg: #0e1f1f;
    --hero-fg: #f0faf9;

    /* Surfaces */
    --surface: #1a2229;
    --bg: #12171c;
    --bg-muted: #1a2229;
    --bg-subtle: #1f2830;
    --primary-soft: #153030;
    --primary-soft-hover: #1a3d3d;
    --primary-ghost: #142828;

    /* Text */
    --text: #e8eef3;
    --text-body: #c5ced6;
    --muted: #8b99a8;

    /* Lines */
    --border: #2a3440;
    --border-strong: #3d4754;
    --border-primary-soft: #245050;

    --header-org-color: #7dd3c0;

    --secondary: #94a3b8;

    --shadow-dropdown: 0 8px 28px rgba(0, 0, 0, 0.45);
    --shadow-card: 0 2px 16px rgba(0, 0, 0, 0.35);

    /* Preview banner */
    --preview-bg: #2d2210;
    --preview-border: #59431a;
    --preview-text: #fde68a;
    --preview-btn-border: #b45309;
    --preview-btn-text: #fcd34d;
    --preview-btn-hover: #422006;

    /* Alerts */
    --alert-success-bg: #052e16;
    --alert-success-border: #166534;
    --alert-success-text: #86efac;
    --alert-error-bg: #3f1515;
    --alert-error-border: #991b1b;
    --alert-error-text: #fecaca;
    --alert-info-bg: #082f41;
    --alert-info-border: #0369a1;
    --alert-info-text: #bae6fd;
    --alert-warn-bg: #2d1f07;
    --alert-warn-border: #b45309;
    --info-banner-bg: #122a28;
    --info-banner-border: #2d6a62;
    --video-wrap-bg: #161c22;
    --questions-section-bg: #161c22;

    --solid-btn-fg: #fff;
    --footer-muted: rgba(255, 255, 255, .62);
    --footer-link-hover: #fff;
  }

  .activate-input-row input[type="text"]:focus {
    box-shadow: 0 0 0 3px rgba(94, 234, 212, 0.22);
  }
}

body { font-family: system-ui, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; overflow-x: clip; min-height: 100vh; display: flex; flex-direction: column; }
main.container {
  flex: 1;
  width: 100%;
  max-width: var(--main-max-width);
  margin-left: auto;
  margin-right: auto;
}
a    { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Site header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.site-header-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 32px;
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center; min-height: 70px;
}
.site-header-logo { min-width: 0; }
.site-header-logo img { height: 46px; display: block; }
.site-header-brand {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none;
  color: var(--header-org-color);
}
.site-header-brand:hover { text-decoration: none; color: var(--header-org-color); }
.site-header-org {
  font-size: 16px; line-height: 1.25;
  color: inherit; white-space: nowrap;
}
.site-header-nav { display: flex; align-items: center; gap: .5rem; justify-content: center; flex-wrap: wrap; }
.site-header-nav-link {
  padding: 6px 14px;
  font-size: .9rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  box-sizing: border-box;
}
.site-header-nav-link:hover { color: var(--primary); text-decoration: none; }
.site-header-nav-link.is-active { color: var(--primary); border-bottom-color: var(--primary); }
.site-header-nav-link:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 2px;
}

.site-header-external-link {
  font-size: .82rem;
  color: var(--primary);
  text-decoration: none;
  border: 1px solid var(--border-primary-soft);
  border-radius: var(--radius-sm);
  padding: 5px 12px;
  transition: background .15s, border-color .15s;
}
.site-header-external-link:hover {
  background: var(--primary-soft-hover);
  border-color: var(--primary);
  text-decoration: none;
}

.site-header-user { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--primary); color: var(--solid-btn-fg);
  font-size: .78rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.user-name { font-size: .88rem; color: var(--text); font-weight: 500; }
/* User dropdown */
.user-menu { position: relative; }
.user-menu-trigger {
  display: flex; align-items: center; gap: 8px;
  background: none; border: none; cursor: pointer;
  padding: 4px 8px; border-radius: 6px;
  transition: background .15s;
}
.user-menu-trigger:hover { background: var(--primary-soft-hover); }
.user-menu-chevron { width: 16px; height: 16px; color: var(--muted); transition: transform .2s; }
.user-menu.open .user-menu-chevron { transform: rotate(180deg); }

.user-dropdown {
  display: none; position: absolute; right: 0; top: calc(100% + 8px);
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: var(--shadow-dropdown); min-width: 200px; z-index: 200;
  padding: 4px 0;
}
.user-menu.open .user-dropdown { display: block; }

.dropdown-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; font-size: .88rem; color: var(--text);
  text-decoration: none; background: none; border: none;
  cursor: pointer; width: 100%; text-align: left;
  font-weight: 400; transition: background .12s;
}
.dropdown-item:hover { background: var(--bg-subtle); text-decoration: none; }
.dropdown-item svg { width: 16px; height: 16px; color: var(--muted); flex-shrink: 0; }
.dropdown-item--danger { color: var(--danger); }
.dropdown-item--danger svg { color: var(--danger); }
.dropdown-item--danger:hover { background: var(--alert-error-bg); }

.dropdown-divider { border: none; border-top: 1px solid var(--border); margin: 4px 0; }
.dropdown-label { padding: 4px 14px; font-size: .75rem; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted); font-weight: 400; }

.dropdown-preview-btns { display: flex; gap: 6px; padding: 4px 14px 8px; }
.preview-btn {
  flex: 1; padding: 5px 0; font-size: .82rem; font-weight: 400;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); cursor: pointer; color: var(--text);
  transition: border-color .12s, background .12s;
}
.preview-btn:hover { border-color: var(--primary); color: var(--primary); }
.preview-btn--active { border-color: var(--primary); background: var(--primary-ghost); color: var(--primary); }

/* Preview banner */
.preview-banner {
  background: var(--preview-bg); border-bottom: 1px solid var(--preview-border);
  padding: 8px 32px; font-size: .85rem; color: var(--preview-text);
  display: flex; align-items: center; justify-content: center; gap: 16px;
  flex-wrap: wrap; text-align: center;
}
.preview-banner-close {
  background: none; border: 1px solid var(--preview-btn-border); border-radius: var(--radius-sm);
  padding: 2px 10px; font-size: .8rem; color: var(--preview-btn-text);
  cursor: pointer; transition: background .12s;
}
.preview-banner-close:hover { background: var(--preview-btn-hover); }

/* Page hero — shared between login and inner pages */
.page-hero {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  background: var(--hero-bg);
  color: var(--hero-fg); text-align: center;
  padding: 26px 32px;
  font-size: 1.5rem; font-weight: 300; letter-spacing: .02em;
}

/* Container */
.container { max-width: 1200px; margin: 0 auto; padding: 1.5rem 32px; }

/* Login */
.login-page {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  min-height: 100vh;
}
.login-box   { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
               padding: 2.5rem 2rem; width: 100%; max-width: 400px; }
.login-logo  { text-align: center; margin-bottom: 2rem; }
.login-logo h1 { font-size: 1.8rem; }
.login-logo p  { color: var(--muted); }
.login-help  { text-align: center; margin-top: 1rem; color: var(--muted); font-size: 12px; }
.login-status { text-align: center; color: var(--muted); padding: .75rem; }

/* Login page (public shell, shares tokens only) */
.login-page .site-header { padding: 16px 0; }
.login-page .site-header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 0;
}
.login-page .site-header-logo img { height: 50px; }
.login-page .page-hero {
  padding: 52px 32px;
  font-size: clamp(1.15rem, 4vw, 2.4rem);
}
.login-main {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  padding: 52px 32px 60px;
  display: grid;
  grid-template-columns: 1fr minmax(0, 300px);
  gap: 60px;
  align-items: start;
}
.login-intro,
.login-panel {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 36px;
  min-height: 0;
}
.login-intro {
  min-height: 260px;
}
.login-intro p {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-body);
  margin-bottom: 1.1em;
}
.login-intro a { color: var(--primary); text-decoration: none; }
.login-intro a:hover { text-decoration: underline; }
.login-auth-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
/* Telefon: ID-kaart eeldab lugijat; ära näita kitsal vaates (sama läve kui loginDeviceClass mobile). */
@media (max-width: 767.98px) {
  .login-auth-btn.login-auth-btn--idcard-desktop-only {
    display: none !important;
  }
}
.login-auth-btn {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  color: var(--text);
  text-align: left;
  transition: border-color .15s, box-shadow .15s, background .15s;
  overflow: hidden;
  width: 100%;
}
.login-auth-btn:hover:not(:disabled) {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 122, 122, .08);
  background: var(--primary-soft-hover, #f0fafa);
}
.login-auth-btn:active:not(:disabled) {
  background: var(--primary-soft, #e6f5f5);
}
.login-auth-btn:disabled {
  opacity: .45;
  cursor: default;
}
.login-auth-btn.is-selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 122, 122, .12);
}
.login-auth-btn__icon {
  flex-shrink: 0;
  width: 64px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid var(--border);
  padding: 8px 14px;
}
.login-auth-btn__icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.login-auth-btn__label {
  flex: 1;
  padding: 0 16px;
  font-size: 15px;
}
.login-auth-btn__arrow {
  flex-shrink: 0;
  padding-right: 14px;
  color: var(--border-strong, #c5dede);
}
.login-auth-btn:hover:not(:disabled) .login-auth-btn__arrow {
  color: var(--primary);
}
.login-panel #login-status {
  margin-top: 16px;
  font-size: .85rem;
  color: var(--primary);
  min-height: 18px;
  text-align: center;
}
.login-alert-error { margin-top: 12px; margin-bottom: 0; }

/* Smart-ID: modaal (desktop + mobiil) */
.login-smartid-modal {
  z-index: 500;
  padding: 16px;
}
.login-smartid-modal .modal-box {
  max-width: 400px;
  padding: 1.25rem 1.35rem 1.15rem;
}
.login-smartid-modal .modal-box h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 600;
  text-align: center;
  color: var(--text);
}
.login-smartid-vc-hint {
  font-size: 0.8rem;
  color: var(--text-body);
  text-align: center;
  margin: 0 0 0.35rem;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.login-smartid-qr-note {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  margin: 0.35rem 0 0;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.login-smartid-modal-status {
  margin-top: 0.55rem;
  padding-top: 0.2rem;
  text-align: center;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--primary);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 1.35em;
}
body.login-smartid-modal-open {
  overflow: hidden;
}
.login-smartid-vc {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  font-variant-numeric: tabular-nums;
  color: var(--primary-dark);
  text-align: center;
  margin: 6px 0 10px;
}
.login-smartid-qr {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 0;
  margin-bottom: 8px;
  overflow: auto;
  max-height: min(42vh, 300px);
  -webkit-overflow-scrolling: touch;
}
.login-smartid-qr svg {
  display: block;
  width: auto;
  max-width: min(210px, 100%);
  height: auto;
  max-height: min(210px, 40vh, calc(90vh - 13rem));
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 6px;
  box-sizing: content-box;
}
.login-smartid-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 0.85rem;
}
.login-smartid-cancel {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  font-size: 0.85rem;
}
.login-smartid-cancel:hover {
  border-color: var(--muted);
}

@media (max-width: 440px) {
  .login-smartid-vc-hint,
  .login-smartid-qr-note,
  .login-smartid-modal-status {
    white-space: normal;
    text-overflow: unset;
    overflow: visible;
  }
}

/* Activate: modal-style card anchored below hero, page dimmed */
.activate-page-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.activate-page-body .page-hero {
  position: relative;
  z-index: 1;
}
.activate-overlay {
  flex: 1;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-bottom: 60px;
  margin-top: -28px;
}
.activate-card {
  position: relative;
  top: 0;
  z-index: 1;
  background: var(--surface);
  border-radius: 10px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.22);
  padding: 36px 40px 32px;
  width: calc(100% - 32px);
  max-width: 400px;
  text-align: center;
}
.activate-lead {
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 22px;
  line-height: 1.5;
  white-space: nowrap;
}
.activate-input-row {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
}
.activate-input-row input[type="text"] {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  font-size: 1rem;
  letter-spacing: .06em;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}
.activate-input-row input[type="text"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,122,122,.1);
}
.activate-error {
  margin-bottom: 14px;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--alert-error-bg);
  border: 1px solid var(--alert-error-border);
  color: var(--alert-error-text);
  font-size: .9rem;
}
.activate-status {
  margin-top: 14px;
  font-size: .85rem;
  color: var(--primary);
  min-height: 18px;
  text-align: center;
}
@media (max-width: 640px) {
  .activate-overlay { margin-top: 0; }
  .activate-card { top: 28px; padding: 28px 20px 24px; }
  .activate-lead { white-space: normal; }
}

/* Site footer */
.site-footer {
  background: var(--hero-bg);
  border-top: none;
  margin-top: auto;
}
.site-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px 24px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 13px 32px calc(13px + env(safe-area-inset-bottom, 0));
  font-size: .78rem;
  color: var(--footer-muted);
}
.site-footer__org { text-align: left; }
.site-footer__cookies { text-align: center; }
.site-footer__plast { text-align: right; white-space: nowrap; }
.site-footer__plast a {
  color: var(--footer-muted);
  text-decoration: none;
}
.site-footer__plast a:hover { color: var(--footer-link-hover); }

@media (max-width: 640px) {
  .login-page .site-header .site-header-external-link { display: none; }
  .site-footer__inner { flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom, 0)); }
  .site-footer__cookies, .site-footer__plast { text-align: left; }
}

@media (min-width: 901px) and (max-height: 820px) {
  .login-page .page-hero {
    padding: 28px 32px;
    font-size: clamp(1rem, 2.2vw, 1.85rem);
  }
  .login-main {
    padding: 28px 32px 40px;
    gap: 36px;
  }
  .login-intro,
  .login-panel {
    padding: 22px 26px 18px;
  }
  .login-intro { min-height: 0; }
  .login-smartid-qr svg {
    max-height: min(200px, 40vh, calc(100vh - 21rem));
    max-width: min(200px, 100%);
  }
}

@media (max-width: 900px) {
  .login-page .site-header-inner { padding: 0 16px; flex-wrap: wrap; }
  .login-main {
    padding: 28px 16px 48px;
    gap: 28px;
    grid-template-columns: 1fr;
  }
  .login-page .page-hero { padding: 28px 16px; }
  .login-intro,
  .login-panel {
    padding: 22px 18px 20px;
    min-height: 0;
  }
}

@media (max-width: 480px) {
  .login-page .site-header-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .login-page .page-hero { padding: 22px 14px; }
  .login-auth-grid { flex-direction: column; gap: 10px; }
  .login-auth-btn {
    flex-direction: row;
    justify-content: center;
    padding: 16px 12px;
  }
  .login-page .site-header-logo img { height: 42px; }
  .login-page .site-header-org { font-size: .8rem; white-space: normal; }
}

/* Alerts */
.alert         { padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; }
.alert-success { background: var(--alert-success-bg); border: 1px solid var(--alert-success-border); color: var(--alert-success-text); }
.alert-error   { background: var(--alert-error-bg); border: 1px solid var(--alert-error-border); color: var(--alert-error-text); }
.alert-danger  { background: var(--alert-error-bg); border: 1px solid var(--alert-error-border); color: var(--alert-error-text); }
.alert-info {
  background: var(--alert-info-bg);
  border: 1px solid var(--alert-info-border);
  color: var(--alert-info-text);
}
.alert-warn {
  background: var(--alert-warn-bg);
  border: 1px solid var(--alert-warn-border);
  color: var(--warning);
}
.btn { display: inline-flex; align-items: center; gap: .4rem; padding: .5rem 1rem;
  border: none; border-radius: var(--radius); cursor: pointer; font-size: 14px; font-weight: 500; }
.btn-primary   { background: var(--primary);   color: var(--solid-btn-fg); }
.btn-success   { background: var(--success);   color: var(--solid-btn-fg); }
.btn-warning   { background: var(--warning);   color: var(--solid-btn-fg); }
.btn-danger    { background: var(--danger);    color: var(--solid-btn-fg); }
.btn-secondary { background: var(--secondary); color: var(--solid-btn-fg); }
.btn-sm  { padding: .3rem .6rem; font-size: 12px; }
.btn-lg  { padding: .8rem 1.5rem; font-size: 16px; }
.btn-block { width: 100%; justify-content: center; }
.btn:hover { opacity: .9; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* Page header */
.page-header { display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.5rem; gap: 1rem; flex-wrap: wrap; }
.page-header--lead { justify-content: flex-start; }
.page-header--exam-detail { flex-wrap: wrap; gap: .75rem; align-items: center; }
.page-header--exam-detail .page-header-lead {
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; flex: 1 1 auto; min-width: 0;
}
.page-header--reviewer-dashboard { align-items: baseline; }
.page-header h2 { font-size: 1.4rem; margin: 0; }
.page-header h2 small {
  font-weight: 400;
  opacity: 0.88;
  font-size: 0.88em;
}
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .85rem;
  color: var(--muted);
  padding: .3rem .6rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  text-decoration: none;
  margin-bottom: 0;
  flex-shrink: 0;
}
.btn-back:hover {
  color: var(--text);
  text-decoration: none;
  background: var(--bg);
}
.page-header--lead .btn-back { align-self: flex-start; }

/* Table */
.table { width: 100%; border-collapse: collapse; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.table th, .table td { padding: .6rem .9rem; text-align: left; border-bottom: 1px solid var(--border); }
.table th { background: var(--bg-muted); font-weight: 600; font-size: 12px; text-transform: uppercase; }
.table tr:last-child td { border-bottom: none; }
.table tr.row-inactive td { opacity: .5; }
.text-center { text-align: center; }
.text-muted  { color: var(--muted); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }

/* Card */
.card        { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.card-header { display: flex; align-items: center; justify-content: space-between;
  padding: .75rem 1rem; border-bottom: 1px solid var(--border); }
.card-header h3 { font-size: 1rem; }
.card-body   { padding: 1rem; }
.mb-3        { margin-bottom: 1rem; }
.grid-3      { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }

/* Badges */
.badge { display: inline-block; padding: .2rem .5rem; border-radius: var(--radius-sm);
  font-size: 11px; font-weight: 600; text-transform: uppercase; }
.badge-admin     { background: #ede9fe; color: #5b21b6; }
.badge-manager   { background: #dbeafe; color: #1e40af; }
.badge-hindaja   { background: #fef3c7; color: #92400e; }
.badge-reviewer  { background: #fef3c7; color: #92400e; }
.badge-sooritaja { background: #d1fae5; color: #065f46; }
.badge-applicant { background: #d1fae5; color: #065f46; }
.badge-lg        { font-size: 13px; padding: .3rem .8rem; }
.badge-status-planning   { background: var(--bg-muted); color: var(--muted); }
.badge-status-open       { background: #d1fae5; color: #065f46; }
.badge-status-closed     { background: #fef3c7; color: #92400e; }
.badge-status-evaluation,
.badge-status-completed  { background: #fef3c7; color: #92400e; }
.badge-status-archived   { background: #1f2937; color: #f3f4f6; }

/* Forms */
.form-row   { margin-bottom: 1rem; }
.form-row label { display: block; font-weight: 500; margin-bottom: .3rem; font-size: 13px; }
.form-row input, .form-row select, .form-row textarea {
  width: 100%; padding: .5rem .75rem; border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 14px; }
.form-row input:focus, .form-row select:focus { outline: 2px solid var(--primary); }
.form-actions { display: flex; justify-content: flex-end; gap: .75rem; margin-top: 1.5rem; flex-wrap: wrap; }
.form-hint { font-size: .78rem; color: var(--muted); margin-top: .5rem; }
.form-hint code { background: var(--bg-muted); padding: .05em .3em; border-radius: 3px; font-size: .9em; }
.form-hint-md {
  font-size: .78rem; color: var(--muted); margin-top: .6rem;
  background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--radius);
  padding: .6rem .9rem;
}
.form-hint-md strong { color: var(--text); font-weight: 600; }
.form-hint-md ul { margin: .35rem 0 0 1.1rem; padding: 0; }
.form-hint-md li { margin-bottom: .2rem; }
.form-hint-md code { background: #eef0f3; padding: .05em .3em; border-radius: 3px; font-family: monospace; font-size: .95em; }

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal.is-open {
  display: flex;
}
.modal-box { background: var(--surface); border-radius: var(--radius); padding: 2rem;
  width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto; }
.modal-box h3 { margin-bottom: 1.5rem; font-size: 1.2rem; }

/* Layout utilities — use instead of inline styles in views */
.mb-0 { margin-bottom: 0; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-sm { margin-bottom: .85rem; }
.mt-3 { margin-top: .75rem; }
.mt-nudge { margin-top: .35rem; }
.mt-nudge-sm { margin-top: .25rem; }
.mt-4 { margin-top: 1rem; }
.mt-5 { margin-top: 1.25rem; }
.py-empty { padding: 3rem 1rem; }
.text-82 { font-size: .82rem; }
.text-78 { font-size: .78rem; }
.text-80 { font-size: .8rem; }
.text-85 { font-size: .85rem; }
.text-88 { font-size: .88rem; }
.text-75 { font-size: .75rem; }
.fw-normal { font-weight: 400; }
.text-warn { color: var(--warning); }
.max-w-md { max-width: 640px; }
.max-w-sm { max-width: 520px; }
.form-inline { display: inline; }
.card-body--flush { padding: 0 0 1.25rem; }
.card--border-primary { border-color: var(--primary); }
.card-header--soft-primary { background: var(--primary-soft-hover); }
.card-title--primary { color: var(--primary); display: flex; align-items: center; gap: .3rem; }
.icon-leading { vertical-align: middle; margin-right: .3rem; }
.textarea-compact { font-size: .875rem; line-height: 1.65; }
.card-questions-highlight {
  margin-top: 1.25rem;
  border-color: var(--primary);
}
.card-questions-highlight .card-header {
  background: var(--primary-soft-hover);
}
.card-questions-highlight .card-header h3 {
  color: var(--primary);
}
.body-question-intro {
  font-size: .88rem;
  margin-bottom: .85rem;
  color: var(--text-body);
}
.body-comfortable { padding: 1rem 1.25rem; }
.flex-align-gap { display: flex; gap: .75rem; align-items: center; }
.upload-progress-hd {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .5rem;
}
.upload-filename {
  font-size: .9rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 70%;
}
.upload-pct { font-size: .82rem; color: var(--muted); flex-shrink: 0; }
.muted-80 { font-size: .8rem; color: var(--muted); margin-top: .4rem; }
.badge-ml { margin-left: .4rem; }
.section-mt-nudge { margin-top: .5rem; }
.section-mt { margin-top: .75rem; }
.section-mb { margin-bottom: .75rem; }
.section-border-t {
  margin-top: .85rem;
  padding-top: .75rem;
  border-top: 1px solid var(--border);
}
.q-sent-block--answer {
  margin-top: .75rem;
  background: var(--alert-success-bg);
  border: 1px solid var(--alert-success-border);
}
.q-label--success { color: var(--success); }

/* Applicant video upload + player */
.info-banner {
  padding: .6rem 1rem;
  border-radius: var(--radius);
  background: var(--info-banner-bg);
  border: 1px solid var(--info-banner-border);
  font-size: .85rem;
}
.info-banner--warn {
  background: var(--alert-warn-bg);
  border-color: var(--alert-warn-border);
  color: var(--warning);
}
.video-item-page {
  border-bottom: 1px solid var(--border);
}
.video-item-page:last-child { border-bottom: none; }
.video-row-page {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1rem;
}
.video-row-icon-page { color: var(--primary); flex-shrink: 0; }
.video-row-info-page { flex: 1; min-width: 0; }
.video-row-name-page {
  font-size: .9rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.video-row-meta-page { font-size: .78rem; color: var(--muted); margin-top: .1rem; }
.btn-play-video {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .3rem .65rem;
  cursor: pointer;
  color: var(--primary);
  font-size: .8rem;
  font-weight: 500;
  flex-shrink: 0;
  white-space: nowrap;
}
.btn-play-video:hover,
.btn-play-video.active {
  background: var(--primary);
  color: var(--solid-btn-fg);
  border-color: var(--primary);
}
.btn-delete-video-page {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: .3rem;
  border-radius: 4px;
  flex-shrink: 0;
  line-height: 0;
}
.btn-delete-video-page:hover {
  color: var(--danger);
  background: var(--alert-error-bg);
}
.video-player-wrap-page {
  padding: .75rem 1rem 1rem;
  background: var(--video-wrap-bg);
}
.video-player-page {
  width: 100%;
  border-radius: 4px;
  background: #000;
  display: block;
  max-height: 480px;
}
.drop-zone-page {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
  color: var(--muted);
}
.drop-zone-page:hover,
.drop-zone-page.drag-over {
  border-color: var(--primary);
  background: var(--primary-soft-hover);
  color: var(--primary);
}
.drop-zone-page.is-busy {
  pointer-events: none;
  opacity: 0.5;
}
.drop-zone-page p { margin: .6rem 0 0; font-size: .9rem; }
.link-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--primary);
  font-size: inherit;
  text-decoration: underline;
  padding: 0;
}
.progress-track-page {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.progress-bar-page {
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
  transition: width .15s;
  width: 0;
}

/* Reviewer dashboard (hindaja) */
.reviewer-list { display: flex; flex-direction: column; gap: .75rem; }
.reviewer-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.reviewer-card-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .85rem 1.25rem;
  cursor: pointer;
  user-select: none;
  position: relative;
}
.reviewer-card-header:hover { background: var(--bg); }
.reviewer-card-name { flex: 1; font-weight: 600; font-size: .95rem; min-width: 0; }
.reviewer-card-meta { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.reviewer-card .badge-ok,
.reviewer-card-meta .badge-ok { background: #d1fae5; color: #065f46; font-size: .72rem; padding: .2rem .5rem; border-radius: 4px; font-weight: 500; text-transform: none; }
.reviewer-card .badge-empty,
.reviewer-card-meta .badge-empty { background: var(--bg-muted); color: var(--muted); font-size: .72rem; padding: .2rem .5rem; border-radius: 4px; font-weight: 500; text-transform: none; }
.reviewer-card .badge-theory,
.reviewer-card-meta .badge-theory { background: #e0f2fe; color: #0369a1; font-size: .72rem; padding: .2rem .5rem; border-radius: 4px; font-weight: 500; text-transform: none; }
.reviewer-card .badge-draft,
.reviewer-card-meta .badge-draft { background: #fef3c7; color: #92400e; font-size: .72rem; padding: .2rem .5rem; border-radius: 4px; font-weight: 500; text-transform: none; }
.reviewer-card .badge-sent,
.reviewer-card-meta .badge-sent { background: #dbeafe; color: #1d4ed8; font-size: .72rem; padding: .2rem .5rem; border-radius: 4px; font-weight: 500; text-transform: none; }
.reviewer-card .badge-reply,
.reviewer-card-meta .badge-reply { background: #d1fae5; color: #065f46; font-size: .72rem; padding: .2rem .5rem; border-radius: 4px; font-weight: 500; text-transform: none; }
.reviewer-card-meta .badge-hb-meta {
  font-size: .7rem;
  padding: .18rem .45rem;
  border-radius: 4px;
  font-weight: 600;
  text-transform: none;
}
.reviewer-card-meta .badge-hb-meta--ok {
  background: #d1fae5;
  color: #065f46;
}
.reviewer-card-meta .badge-hb-meta--open {
  background: #fef3c7;
  color: #92400e;
}
.reviewer-card-meta .badge-hb-meta--neutral {
  background: var(--bg-muted);
  color: var(--muted);
}
.reviewer-card-meta .badge-hb-agg {
  font-size: .7rem;
  padding: .18rem .5rem;
  border-radius: 4px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-transform: none;
}
.reviewer-theory-inline {
  font-size: .78rem;
  font-weight: 600;
  color: var(--text);
  opacity: .92;
}
.reviewer-video-section {
  border-bottom: 1px solid var(--border);
}
.reviewer-panel-head {
  font-size: .78rem;
  font-weight: 700;
  padding: .65rem 1.25rem .45rem;
  color: var(--text);
  letter-spacing: .02em;
}
.reviewer-theory-panel {
  border-bottom: 1px solid var(--border);
  background: var(--bg, rgba(0,0,0,.15));
}
.reviewer-theory-panel--standalone {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card-bg, var(--bg));
}
.reviewer-theory-toggle {
  display: flex;
  align-items: center;
  gap: .5rem;
  width: 100%;
  padding: .65rem 1rem;
  margin: 0;
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: .82rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.reviewer-theory-toggle:hover {
  background: var(--bg-muted);
}
.reviewer-theory-toggle-text { flex: 1; min-width: 0; }
.reviewer-theory-toggle-hint {
  font-size: .72rem;
  font-weight: 500;
  color: var(--muted);
  flex-shrink: 0;
}
.reviewer-theory-toggle-chevron {
  flex-shrink: 0;
  color: var(--muted);
  transition: transform .2s;
}
.reviewer-theory-toggle.is-open .reviewer-theory-toggle-chevron {
  transform: rotate(180deg);
}
.reviewer-theory-detail {
  padding: 0 1rem 1rem;
  border-top: 1px solid var(--border);
}
.reviewer-theory-mistakes-list {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  padding-top: .55rem;
}
.reviewer-theory-mistake-row {
  background: var(--video-wrap-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .5rem .65rem;
  font-size: .8rem;
}
.reviewer-theory-mistake-num {
  font-weight: 700;
  color: var(--primary);
  font-size: .72rem;
  margin-bottom: .25rem;
}
.reviewer-theory-mistake-q {
  margin-bottom: .35rem;
  line-height: 1.35;
}
.reviewer-theory-mistake-given {
  font-size: .8rem;
  line-height: 1.35;
  word-break: break-word;
}
.reviewer-theory-mistake-val--wrong {
  color: #f87171;
  font-weight: 600;
}
.reviewer-theory-mistake-correct-hint {
  font-size: .72rem;
  color: var(--muted);
  margin-top: .35rem;
  line-height: 1.35;
}
.reviewer-theory-detail-msg {
  padding: .55rem 0 0;
  font-size: .82rem;
}
.reviewer-card .chevron { color: var(--muted); transition: transform .2s; flex-shrink: 0; }
.reviewer-card .chevron.open { transform: rotate(180deg); }
.reviewer-card-body { border-top: 1px solid var(--border); }
.reviewer-section-empty { padding: .75rem 1.25rem; color: var(--muted); font-size: .85rem; }
.reviewer-video-block { padding: .85rem 1.25rem; border-bottom: 1px solid var(--border); }
.reviewer-video-title {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .85rem;
  font-weight: 500;
  margin-bottom: .55rem;
  flex-wrap: wrap;
  word-break: break-word;
}
.reviewer-video-player {
  width: 100%;
  border-radius: 4px;
  background: #000;
  display: block;
  max-height: 480px;
}

.reviewer-my-hinnang {
  padding: .65rem 1.25rem 0.85rem;
  border-top: 1px solid var(--border);
}
.reviewer-my-hinnang--theory {
  border-top: none;
  padding-top: 0.35rem;
  padding-left: 1rem;
  padding-right: 1rem;
  padding-bottom: 0.55rem;
  background: var(--bg-muted);
}
.reviewer-my-hinnang-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}
.reviewer-my-hinnang-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}
.reviewer-my-hinnang-row--switch {
  flex: 1 1 auto;
  width: 100%;
  align-items: center;
  gap: 0.45rem 0.55rem;
}

/* Slider: off = lõik hinnatud märkimata (open); on = OK (salvestatud) */
.reviewer-h-switch {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  cursor: pointer;
}
.reviewer-h-switch-ui {
  position: relative;
  display: block;
  width: 2rem;
  height: 0.95rem;
  border-radius: 999px;
  background: var(--border-strong);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}
.reviewer-h-switch-ui::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 0.12rem;
  width: 0.7rem;
  height: 0.7rem;
  margin-top: -0.35rem;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease;
}
.reviewer-h-toggle:focus-visible + .reviewer-h-switch-ui {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}
.reviewer-h-toggle:checked + .reviewer-h-switch-ui {
  background: var(--success);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--success) 55%, transparent),
    0 0 12px color-mix(in srgb, var(--success) 35%, transparent);
}
.reviewer-h-toggle:checked + .reviewer-h-switch-ui::after {
  transform: translateX(calc(2rem - 0.24rem - 0.7rem));
}
.reviewer-h-toggle:disabled + .reviewer-h-switch-ui {
  opacity: 0.55;
  cursor: wait;
}
.reviewer-h-switch:has(.reviewer-h-toggle:disabled) {
  cursor: wait;
}
.reviewer-hinnang-msg { display: block; margin-top: 0.35rem; min-height: 1.1em; }

.reviewer-questions-section { padding: .85rem 1.25rem; background: var(--questions-section-bg); }
.reviewer-questions-head {
  display: flex;
  align-items: center;
  gap: .35rem;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: .75rem;
  flex-wrap: wrap;
}
.reviewer-q-sent { background: var(--video-wrap-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: .65rem .85rem; }
.reviewer-q-other {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .6rem .85rem;
  margin-bottom: .5rem;
}
.reviewer-q-my {
  background: var(--surface);
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  padding: .65rem .85rem;
}
.reviewer-q-label { font-size: .75rem; font-weight: 600; color: var(--muted); margin-bottom: .3rem; }
.reviewer-question-pre {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  font-size: .85rem;
  line-height: 1.6;
  margin: 0;
}
.reviewer-q-actions { display: flex; align-items: center; gap: .6rem; margin-top: .5rem; }
.reviewer-form-textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .5rem .7rem;
  font-family: inherit;
  font-size: .85rem;
  line-height: 1.5;
  resize: vertical;
}
.reviewer-form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 122, 122, 0.1);
}
.exam-status-badge {
  font-size: .75rem;
  padding: .25rem .6rem;
  border-radius: 4px;
  background: var(--bg-muted);
  color: var(--muted);
  font-weight: 500;
}
.status-open { background: #d1fae5; color: #065f46; }
.status-closed,
.status-evaluation { background: #fef3c7; color: #92400e; }

.reviewer-q-row { padding: .85rem 1.25rem; border-bottom: 1px solid var(--border); }
.reviewer-q-row:last-child { border-bottom: none; }
.reviewer-q-author { font-size: .82rem; font-weight: 600; color: var(--primary); margin-bottom: .35rem; }
.reviewer-send-meta {
  margin-top: .6rem;
  font-size: .82rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: .3rem;
}

/* Shared question / textarea (küsimused, saada) */
.question-pre {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  line-height: 1.6;
  margin: 0;
  color: var(--text);
  background: transparent;
}
.question-pre--tight { font-size: .88rem; }
.question-pre--relaxed { font-size: .9rem; line-height: 1.7; }
.badge-saved { font-size: .75rem; color: var(--success); font-weight: 500; }
.form-textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .65rem .85rem;
  font-family: inherit;
  font-size: .9rem;
  line-height: 1.6;
  resize: vertical;
  color: var(--text);
}
.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 122, 122, 0.1);
}

@media (max-width: 640px) {
  .video-row-page {
    flex-wrap: wrap;
    align-items: flex-start;
    padding: .65rem .85rem;
    gap: .5rem .65rem;
  }
  .video-row-info-page { flex: 1 1 calc(100% - 2rem); min-width: 0; }
  .video-row-name-page { white-space: normal; word-break: break-word; }
  .video-row-page .btn-play-video,
  .video-row-page .btn-delete-video-page {
    flex: 1 1 calc(50% - .4rem);
    justify-content: center;
    min-height: 40px;
  }
  .drop-zone-page { padding: 1.5rem 1rem; }
  .card-header .text-muted { line-height: 1.35; }
  .video-player-page { max-height: 56vh; }

  .reviewer-card-header {
    flex-wrap: wrap;
    align-items: flex-start;
    padding: .75rem 1rem;
    gap: .5rem .65rem;
  }
  .reviewer-card-name { padding-right: 2.25rem; }
  .reviewer-card-meta { flex: 1 1 100%; order: 3; }
  .reviewer-card-header .chevron {
    position: absolute;
    top: 1rem;
    right: 1rem;
  }
  .reviewer-questions-head { flex-wrap: wrap; align-items: flex-start; }
}

.exam-detail-instructions-card { margin-top: 1.5rem; scroll-margin-top: 1.25rem; }

/* Role guides (/juhend) */
.guide-page { max-width: 52rem; }
.guide-card { scroll-margin-top: 5rem; }
.guide-exam-meta {
  margin: 0 1rem;
  padding-bottom: 0;
  font-size: .85rem;
}
.guide-abi-note {
  margin-top: 1.25rem;
  font-size: .88rem;
}
.guide-abi-note a { color: var(--primary); }
.guide-intro-card .guide-env-list {
  margin: .75rem 0 0;
  padding-left: 1.2rem;
  font-size: .85rem;
}
.guide-toc-inner {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem .85rem;
}
.guide-toc-link {
  color: var(--primary);
  font-size: .9rem;
  font-weight: 500;
  text-decoration: none;
}
.guide-toc-link:hover { text-decoration: underline; }
.guide-db-note {
  margin-top: 1rem;
  padding-top: .75rem;
  border-top: 1px solid var(--border);
  font-size: .82rem;
}
.applicant-guide-link-wrap {
  margin: 1.25rem 0 0;
  text-align: center;
}
.applicant-guide-link {
  color: var(--primary);
  font-weight: 500;
  text-decoration: none;
}
.applicant-guide-link:hover { text-decoration: underline; }

/* Archived exam — read-only review */
.exam-archive-title { margin: 0 0 .35rem; font-size: 1.35rem; }
.exam-archive-meta { margin: 0 0 1.25rem; font-size: .88rem; }
.exam-archive-hint {
  font-size: .82rem;
  margin: 0 0 1rem;
  padding: .65rem .85rem;
  background: var(--bg-muted);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.exam-archive-hint code { font-size: .78rem; }
.exam-archive-guide { border: 1px solid var(--border); }
.exam-archive-guide-summary {
  cursor: pointer;
  padding: .85rem 1rem;
  font-weight: 600;
  list-style: none;
}
.exam-archive-guide-summary::-webkit-details-marker { display: none; }
.exam-archive-guide-summary::before {
  content: '▸ ';
  display: inline-block;
  transition: transform .15s ease;
}
.exam-archive-guide[open] .exam-archive-guide-summary::before { transform: rotate(90deg); }
.exam-archive-guide-body { font-size: .9rem; line-height: 1.5; border-top: 1px solid var(--border); }
.exam-archive-guide-body ul { margin: .5rem 0 .5rem 1.1rem; }
.exam-archive-applicant-list { display: flex; flex-direction: column; gap: 1rem; }
.exam-archive-applicant {
  padding: .85rem 0;
  border-bottom: 1px solid var(--border);
}
.exam-archive-applicant:last-child { border-bottom: none; padding-bottom: 0; }
.exam-archive-applicant-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .35rem .75rem;
  align-items: baseline;
  margin-bottom: .5rem;
}
.exam-archive-applicant-name { font-size: 1rem; }
.exam-archive-applicant-co {
  display: block;
  font-size: .82rem;
  font-weight: 400;
  color: var(--muted);
}
.exam-archive-applicant-stats {
  font-size: .82rem;
  color: var(--muted);
  white-space: nowrap;
}
.exam-archive-stat-sep { opacity: .6; }
.exam-archive-videos {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.exam-archive-video-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .35rem .75rem;
  font-size: .88rem;
}
.exam-archive-video-date { font-size: .78rem; color: var(--muted); }
.exam-archive-no-videos { margin: 0; font-size: .85rem; }
.exam-archive-reviewer-list {
  list-style: none;
  margin: 0;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.exam-archive-section--komisjon .card-header h3 { margin: 0; }
.exam-archive-reviewer {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .35rem .75rem;
  padding: .55rem 0;
  border-bottom: 1px solid var(--border);
  font-size: .9rem;
}
.exam-archive-reviewer:last-child { border-bottom: none; }
.exam-archive-reviewer-name {
  font-weight: 600;
  font-size: .95rem;
  color: var(--primary);
  letter-spacing: .01em;
}
.exam-archive-reviewer-stats {
  font-size: .82rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.exam-archive-video-btn {
  display: inline;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  font: inherit;
  color: var(--primary);
  font-weight: 500;
  text-align: left;
}
.exam-archive-video-btn:hover { text-decoration: underline; }
.exam-archive-video-btn .exam-archive-video-name {
  font-weight: 400;
  color: var(--muted);
  margin-left: .25rem;
}
.modal--archive-video { background: rgba(0, 0, 0, 0.72); }
.modal-box--archive-video {
  max-width: min(960px, 96vw);
  padding: 1rem 1.25rem 1.25rem;
}
.modal-archive-video-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .75rem;
}
.modal-archive-video-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
  flex: 1;
  min-width: 0;
}
.exam-archive-video-player {
  width: 100%;
  max-height: min(70vh, 540px);
  background: #000;
  border-radius: var(--radius);
}
body.exam-archive-video-modal-open { overflow: hidden; }

/* Applicant dashboard */
.applicant-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 2rem;
}
.applicant-section-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 2rem 1rem; text-align: center; color: var(--muted); gap: .75rem;
}
.applicant-section-empty svg { width: 44px; height: 44px; color: var(--border); }

.video-list { display: flex; flex-direction: column; gap: .5rem; }
.video-item {
  display: flex; align-items: center; gap: .5rem; padding: .5rem .75rem;
  background: var(--bg); border-radius: var(--radius); font-size: .85rem;
}
.video-item svg { width: 16px; height: 16px; color: var(--primary); flex-shrink: 0; }
.video-item small { margin-left: auto; color: var(--muted); }

.theory-result { text-align: center; padding: 1.5rem 0; }
.theory-result-score { font-size: 3rem; font-weight: 300; color: var(--primary); line-height: 1; }
.theory-result-label { font-size: .82rem; color: var(--muted); margin-top: .25rem; }

/* Exam guide — collapsible */
.exam-instructions {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden;
}
.guide-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  outline: none;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  padding: 1.25rem 1.5rem;
  text-align: left;
  transition: background .12s;
}
.guide-toggle:hover { background: var(--bg-subtle); }
.guide-chevron {
  width: 18px;
  height: 18px;
  color: var(--muted);
  flex-shrink: 0;
  transition: transform .2s;
}
.exam-instructions.is-open .guide-chevron { transform: rotate(180deg); }
.exam-instructions-body {
  font-size: .9rem; line-height: 1.75; color: var(--text-body);
  padding: 1.5rem;
}

/* Markdown rendered output */
.md-render p { margin-bottom: .85em; }
.md-render p:last-child { margin-bottom: 0; }
.md-render h1,.md-render h2,.md-render h3 {
  font-weight: 600; margin: 1.25em 0 .5em; color: var(--text);
}
.md-render h1 { font-size: 1.2rem; }
.md-render h2 { font-size: 1.05rem; }
.md-render h3 { font-size: .95rem; }
.md-render ul,.md-render ol { padding-left: 1.5em; margin-bottom: .85em; }
.md-render li { margin-bottom: .2em; }
.md-render a { color: var(--primary); text-decoration: none; word-break: break-word; }
.md-render a:hover { text-decoration: underline; }
.md-render strong { font-weight: 600; }
.md-render code { background: var(--bg-muted); padding: .1em .35em; border-radius: 3px; font-size: .88em; }

/* Visually hidden (a11y labels) */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Exam card (current exam view) */
.exam-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem; margin-bottom: 1rem;
  box-sizing: border-box;
  width: 100%;
}
.exam-card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.exam-card-title { font-size: 1.1rem; font-weight: 600; margin-bottom: .25rem; }
.exam-card-title a { color: var(--text); text-decoration: none; }
.exam-card-title a:hover { color: var(--primary); }
.exam-card-meta { font-size: .85rem; color: var(--muted); }
.exam-card-meta--with-links { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .5rem; }
.exam-card-quiet-link { color: var(--primary); text-decoration: none; white-space: nowrap; }
.exam-card-quiet-link:hover { text-decoration: underline; color: var(--primary-dark); }
button.exam-card-quiet-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: .88rem;
  cursor: pointer;
  text-align: left;
}
.exam-card-footer-actions { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.person-name-link { flex: 0 1 auto; min-width: 0; max-width: 100%; }

.exam-applicant-list { display: flex; flex-direction: column; }

/* Spetsiifilisem kui .person-row { display:flex } — muidu ikoonid jooksevad nime järele */
.person-row.person-row--applicant,
.person-row.person-row--reviewer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto minmax(3.25rem, max-content) 2rem;
  gap: .5rem 0.75rem;
  align-items: center;
  padding: .25rem 0;
  font-size: .88rem;
  color: var(--text-body);
}
.person-row.person-row--inactive {
  opacity: .5;
}
.person-row-name {
  min-width: 0;
  display: flex;
  align-items: baseline;
}
.person-row-hint {
  min-width: 0;
  justify-self: end;
  text-align: right;
  padding-left: .5rem;
}
.person-row-hint .person-hint {
  display: inline-block;
  max-width: 14rem;
}
.person-invite-cell {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  justify-self: stretch;
  width: 100%;
  min-width: 0;
  min-height: 1.35rem;
}
.person-invite-quick-form {
  display: flex;
  margin: 0;
  padding: 0;
  align-items: center;
  justify-content: flex-end;
}
.btn-icon-invite-send {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--primary);
  font-size: 1.05rem;
  line-height: 1;
  padding: 0 1px;
  opacity: .88;
}
.btn-icon-invite-send:hover {
  opacity: 1;
  color: var(--primary-dark);
}
.person-invite-none {
  font-size: .85rem;
  color: var(--border-strong);
  cursor: default;
  user-select: none;
}
.person-invite-sent {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  line-height: 0;
}
/* Olekud: ainult ikooni värv (taustata) */
.person-invite-sent--sent {
  color: #9ca3af;
}
.person-invite-sent--sent .person-invite-count { color: #9ca3af; }
.person-invite-sent--opened {
  color: #b45309;
}
.person-invite-sent--opened .person-invite-count { color: #b45309; }
.person-invite-sent--verified {
  color: var(--success);
}
.person-invite-sent--verified .person-invite-count {
  color: var(--success);
  opacity: .9;
}
.person-invite-count {
  font-size: .68rem;
  font-weight: 700;
  line-height: 1;
}
.invite-envelope-svg { flex-shrink: 0; display: block; }
.person-invite-icon { flex-shrink: 0; }
.person-row-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  justify-self: stretch;
  width: 100%;
}
.exam-card-actions { display: flex; align-items: center; gap: .75rem; }
.exam-card-dates {
  display: flex; gap: 1.5rem; flex-wrap: wrap;
  margin-top: 1rem; padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: .82rem; color: var(--muted);
  align-items: center;
}

/* Empty state */
.empty-state {
  text-align: center; padding: 3rem; color: var(--muted);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}

code { background: var(--bg-muted); padding: .1rem .3rem; border-radius: 3px; font-size: 12px; word-break: break-word; }

/* Applicant/reviewer hero */
.hero-exam-name { font-size: 1.55rem; font-weight: 300; letter-spacing: .02em; }
.hero-exam-dates { font-size: .88rem; opacity: .75; letter-spacing: .01em; }

/* Header context title (applicant/reviewer) */
.site-header-nav-context {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .35rem 1rem;
  justify-content: center;
}
.header-context-title {
  font-size: .95rem; font-weight: 600; color: var(--header-org-color); letter-spacing: .01em;
}

/* End-preview button (left of avatar) */
.preview-exit-form { display: flex; align-items: center; }
.btn-end-preview {
  font-size: .75rem; color: var(--primary);
  border: 1px solid var(--border-primary-soft); border-radius: var(--radius-sm);
  padding: 5px 10px; background: var(--surface); cursor: pointer;
  white-space: nowrap; transition: border-color .15s, background .15s;
}
.btn-end-preview:hover { border-color: var(--primary); background: var(--primary-soft-hover); }

/* site-header-user flex to hold both end-preview + user-menu */
.site-header-user { display: flex; align-items: center; gap: .75rem; justify-content: flex-end; flex-shrink: 0; }
.user-menu-trigger { max-width: min(100vw - 24px, 320px); }

/* ---- Responsive (phones & small tablets) ---- */
.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1rem;
}
.table-scroll .table { min-width: 520px; }

.card .table-scroll { margin-bottom: 0; }

.table-cell-actions-split {
  vertical-align: middle;
  white-space: nowrap;
}
.table-cell-actions-split .btn + .btn { margin-left: .35rem; }

.page-header--reviewer-dashboard .exam-status-badge {
  flex-shrink: 0;
  align-self: flex-start;
}
@media (max-width: 900px) {
  .site-header-inner {
    display: flex;
    flex-wrap: wrap;
    padding: 10px 16px;
    gap: 10px 12px;
    min-height: 0;
  }
  .site-header-logo {
    flex: 1 1 auto;
    min-width: 0;
    order: 1;
  }
  .site-header-user {
    order: 2;
    margin-left: auto;
  }
  .site-header-nav {
    order: 3;
    flex: 1 1 100%;
    width: 100%;
    justify-content: flex-start;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    margin: 0 -16px;
    padding-left: 16px;
    padding-right: 16px;
    box-sizing: border-box;
    gap: 6px 8px;
  }
  .site-header-org {
    white-space: normal;
    line-height: 1.3;
    font-size: .82rem;
  }
  .user-name {
    max-width: 36vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .header-context-title {
    font-size: .88rem;
    line-height: 1.35;
    text-align: left;
    flex: 1 1 auto;
  }
  .page-hero {
    padding: 1.1rem 16px;
    font-size: 1.15rem;
  }
  .hero-exam-name { font-size: 1.25rem; }
  .hero-exam-dates { font-size: .8rem; }
  .container { padding: 1rem 16px; }
  .preview-banner { padding: 10px 16px; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .applicant-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
  }
  .exam-instructions { padding: 0; }
  .guide-toggle { padding: 1rem 1.1rem; }
  .exam-instructions-body { padding: 1rem 1.1rem; }
  .empty-state { padding: 1.75rem 1rem; }
}

@media (max-width: 640px) {
  .user-name { display: none; }
  .user-menu-trigger { padding: 6px; gap: 4px; }
  .btn-end-preview { font-size: .68rem; padding: 4px 8px; white-space: normal; text-align: center; line-height: 1.25; max-width: 9rem; }
  .grid-3 { grid-template-columns: 1fr; }
  .page-header {
    flex-direction: column;
    align-items: stretch;
    gap: .75rem;
  }
  .page-header h2 { font-size: 1.2rem; }
  .page-header h2 small { display: block; margin-top: 0.2rem; line-height: 1.3; }
  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: .35rem;
  }
  .exam-card-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .exam-card-actions {
    width: 100%;
    flex-wrap: wrap;
  }
  .exam-card-title,
  .exam-card-title a { word-break: break-word; }
  .modal { padding: 12px; align-items: flex-end; }
  .modal-box {
    width: 100%;
    max-width: none;
    max-height: min(90vh, 640px);
    padding: 1.25rem 1rem;
    border-radius: var(--radius) var(--radius) 0 0;
  }
  .form-actions { justify-content: stretch; }
  .form-actions .btn { flex: 1 1 auto; justify-content: center; }
  .user-dropdown {
    right: 0;
    left: auto;
    max-width: min(calc(100vw - 24px), 300px);
  }
  .dropdown-preview-btns { flex-direction: column; }
  .theory-result-score { font-size: 2.25rem; }
}

@media (max-width: 480px) {
  .site-header img,
  .site-header-logo img { height: 40px !important; }
  .user-avatar { width: 32px; height: 32px; font-size: .72rem; }
}

/* ---- Exam index: participants grid ---- */
.exam-card-people {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--border);
  margin: .75rem -1.5rem -1.5rem;
}
.exam-card-col { padding: .875rem 1.5rem 1.125rem; }
.exam-card-col + .exam-card-col { border-left: 1px solid var(--border); }
.exam-card-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .6rem;
}
.people-label {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
}
.person-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .25rem 0;
  font-size: .88rem;
  color: var(--text-body);
}
.person-name { flex: 1; min-width: 0; }
.person-row-name .person-name { flex: 0 1 auto; }
.person-hint { font-size: .75rem; color: var(--muted); }
.person-dot  { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.dot-done     { background: var(--success); }
.dot-partial  { background: var(--warning); }
.dot-none     { background: var(--border-strong); }
/* dot-reviewer: legacy; hindajal kasutatakse dot-none / dot-done (kutse olek) */
.dot-reviewer { background: var(--muted); }
.btn-icon-add {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--primary);
  font-size: 1.2rem;
  line-height: 1;
  padding: 0 2px;
  flex-shrink: 0;
  transition: color .12s;
}
.btn-icon-add:hover { color: var(--primary-dark); }
.btn-icon-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--border-strong);
  font-size: .95rem;
  line-height: 1;
  padding: 0;
  flex-shrink: 0;
  transition: color .12s;
}
.btn-icon-remove:hover { color: var(--danger); }
.exam-menu { position: relative; }
.exam-menu.open .user-dropdown { display: block; }
.status-picker { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .4rem; }
.status-opt {
  padding: .3rem .7rem;
  border-radius: var(--radius-sm);
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  outline: none;
  opacity: .55;
  transition: opacity .12s;
  user-select: none;
}
.status-opt:hover { opacity: .85; }
.status-opt.is-selected { opacity: 1; }
.exam-status-menu { position: relative; display: flex; align-items: center; gap: .5rem; }
.exam-status-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-dropdown);
  min-width: 160px;
  z-index: 50;
  padding: 4px 0;
}
.exam-status-menu.open .exam-status-dropdown { display: block; }
.btn-icon-edit {
  background: none;
  border: none;
  outline: none;
  appearance: none;
  cursor: pointer;
  color: var(--muted);
  font-size: .95rem;
  line-height: 1;
  padding: 0 2px;
  flex-shrink: 0;
  transition: color .12s;
  margin-left: auto;
}
.btn-icon-edit:hover { color: var(--primary); }
.link-add-exam { display: block; margin-top: 1.25rem; font-size: .88rem; }

@media (max-width: 640px) {
  .exam-card-people { grid-template-columns: 1fr; margin: .75rem -1.5rem -1.5rem; }
  .exam-card-col + .exam-card-col { border-left: none; border-top: 1px solid var(--border); }
}

/* ---- Users page ---- */
.users-filters {
  display: flex;
  gap: .75rem;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.users-search {
  flex: 1 1 220px;
  min-width: 0;
  padding: .45rem .75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .9rem;
  background: var(--surface);
}
.users-search:focus { outline: 2px solid var(--primary); }
.users-filter-select {
  padding: .45rem .65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .88rem;
  background: var(--surface);
  cursor: pointer;
}
.users-filter-select:focus { outline: 2px solid var(--primary); }
.user-name-cell { font-weight: 500; }
.user-status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.table-actions {
  white-space: nowrap;
  text-align: right;
}
.table-actions .btn + .btn,
.table-actions form + form,
.table-actions form + .btn,
.table-actions .btn + form { margin-left: .35rem; }
.users-temp-link-disabled:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.table-actions--wrap {
  white-space: normal;
  text-align: right;
}
.users-action-btns {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

/* Kutse saadetud — roheline ümbrik (kasutajad, eksami modaal) */
.invite-sent-status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  font-size: .76rem;
  line-height: 1.25;
  max-width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-body);
}
.invite-sent-status--table { margin-top: 6px; }
.invite-sent-status--modal { width: 100%; }
.invite-sent-status__icon {
  display: inline-flex;
  flex-shrink: 0;
  color: var(--muted);
  line-height: 0;
}
.invite-sent-status__meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.invite-sent-status__label {
  font-weight: 600;
  font-size: .68rem;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.invite-sent-status__when {
  font-size: .74rem;
  opacity: .95;
}
.invite-sent-status__count {
  font-weight: 700;
  margin-left: 4px;
}
.invite-sent-status__text {
  flex: 1;
  min-width: 0;
  font-size: .8rem;
}
.invite-sent-status--sent {
  color: #6b7280;
  background: #f3f4f6;
  border-color: #e5e7eb;
}
.invite-sent-status--sent .invite-sent-status__icon { color: #9ca3af; }
.invite-sent-status--opened {
  color: #92400e;
  background: #fdf8f3;
  border-color: #e7c08d;
}
.invite-sent-status--opened .invite-sent-status__icon { color: #b45309; }
.invite-sent-status--verified {
  color: var(--alert-success-text);
  background: var(--alert-success-bg);
  border-color: var(--alert-success-border);
}
.invite-sent-status--verified .invite-sent-status__icon { color: var(--success); }

.audit-logs-pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  margin: .75rem 0 1rem;
}
.audit-logs-pager--bottom {
  margin: 1rem 0 2rem;
}
.audit-logs-pager-nav {
  display: inline-flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.audit-logs-table .audit-col-time { white-space: nowrap; }
.audit-logs-table .audit-col-ip { white-space: nowrap; }
.audit-action { font-size: .8rem; }
.audit-json {
  font-size: .72rem;
  word-break: break-word;
}
.audit-data-cell {
  max-width: 340px;
  vertical-align: top;
}
.users-empty-msg {
  text-align: center;
  color: var(--muted);
  padding: 2rem 1rem;
  font-size: .9rem;
}

@media (max-width: 640px) {
  .users-filters { gap: .5rem; }
  .users-search { flex: 1 1 100%; }
  .table-actions { white-space: normal; }
}

/* ── Theory test ─────────────────────────────────────────────────────────── */
.theory-wrap { max-width: 760px; margin: 0 auto; padding: 0 1rem 4rem; }

.theory-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 0 .5rem; gap: 1rem;
  position: sticky; top: 0; background: var(--bg); z-index: 10;
}
.theory-progress-label { font-size: .85rem; color: var(--muted); }
.theory-timer {
  display: flex; align-items: center; gap: 5px;
  font-size: .9rem; font-weight: 600; color: var(--muted);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 4px 10px;
}
.theory-timer--warn { color: var(--danger); border-color: var(--danger); }

.theory-progress-track {
  height: 4px; background: var(--border); border-radius: 2px; margin-bottom: 1.5rem;
}
.theory-progress-bar {
  height: 100%; background: var(--primary); border-radius: 2px;
  transition: width .3s ease;
}

.theory-question {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem 1.5rem;
  margin-bottom: 1rem; transition: border-color .15s;
}
.theory-question.is-answered { border-color: var(--border-primary-soft); }

.theory-question-hd { display: flex; gap: .75rem; align-items: flex-start; margin-bottom: .75rem; }
.theory-question-num {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%;
  background: var(--bg-muted); color: var(--muted);
  font-size: .78rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.theory-question.is-answered .theory-question-num {
  background: var(--primary-soft); color: var(--primary);
}
.theory-question-text { font-size: .95rem; line-height: 1.5; color: var(--text); padding-top: 3px; }
.theory-question-hint { font-size: .78rem; color: var(--muted); margin-bottom: .6rem; padding-left: 2px; }

.theory-question-img { margin: .75rem 0; }
.theory-question-img img {
  max-width: 100%; max-height: 140px; margin-left: 5%;
  border-radius: var(--radius-sm); border: 1px solid var(--border); display: block;
}

.theory-options { display: flex; flex-direction: column; gap: .4rem; }
.theory-option {
  display: flex; align-items: flex-start; gap: .65rem;
  padding: .55rem .75rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg-subtle);
  cursor: pointer; transition: border-color .12s, background .12s;
  line-height: 1.4;
}
.theory-option input { position: absolute; opacity: 0; pointer-events: none; }
.theory-option:hover { border-color: var(--primary); background: var(--primary-soft-hover); }
.theory-option.is-selected { border-color: var(--primary); background: var(--primary-soft); }

.theory-option-check {
  flex-shrink: 0; width: 18px; height: 18px; margin-top: 1px;
  border: 2px solid var(--border-strong); border-radius: 3px;
  background: var(--surface); transition: border-color .12s, background .12s;
  display: flex; align-items: center; justify-content: center;
}
.theory-option input[type=radio] ~ .theory-option-check { border-radius: 50%; }
.theory-option.is-selected .theory-option-check {
  border-color: var(--primary); background: var(--primary);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2 6l3 3 5-5' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center; background-size: 10px;
}
.theory-option-text { font-size: .9rem; color: var(--text-body); }

.theory-submit-row {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 1rem; margin-top: 2rem; padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.theory-submit-note { font-size: .85rem; color: var(--muted); }

/* Timeout overlay */
.theory-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.55);
  display: none; align-items: center; justify-content: center; z-index: 1000;
}
.theory-overlay:not([hidden]) { display: flex; }
.theory-overlay-box {
  background: var(--surface); border-radius: 12px;
  padding: 2.5rem 3rem; text-align: center; max-width: 360px;
  display: flex; flex-direction: column; align-items: center; gap: 1rem;
}
.theory-overlay-box svg { color: var(--warning); }
.theory-overlay-box h2 { font-size: 1.3rem; color: var(--text); }
.theory-overlay-box p  { font-size: .9rem; color: var(--muted); }

.login-ip { font-size: .75rem; font-family: monospace; color: var(--muted); }
.login-ip--unknown {
  color: var(--warning);
  background: var(--alert-warn-bg);
  border: 1px solid var(--alert-warn-border);
  border-radius: 3px;
  padding: 1px 5px;
  font-size: .73rem;
  font-family: monospace;
}

.user-name-link {
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--primary); font-size: inherit; font-weight: 400;
  text-align: left; text-decoration: none;
}
a.user-name-link, a.user-name-link:visited { color: var(--primary); }
.user-name-link:hover { text-decoration: underline; }

.form-actions--spread {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap;
}
.form-actions-right { display: flex; gap: .5rem; }

.attempt-badge {
  display: inline-block; font-size: .75rem; padding: 2px 7px;
  border-radius: 10px; margin-right: 3px; white-space: nowrap;
}
.attempt-badge--done  { background: #d1fae5; color: #065f46; }
.attempt-badge--empty { background: var(--bg-muted); color: var(--muted); }

/* Admin exam detail: hindajate täielik OK (video+teooria) loendur taotleja kohta */
.exam-hb-sum {
  display: inline-block;
  font-size: .75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}
.exam-hb-sum--full {
  background: #d1fae5;
  color: #065f46;
}
.exam-hb-sum--partial {
  background: var(--alert-warn-bg);
  color: #92400e;
  border: 1px solid var(--alert-warn-border);
}
.exam-hb-sum--none {
  background: var(--bg-muted);
  color: var(--muted);
}
.exam-hb-sum--split {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  flex-wrap: wrap;
}
.exam-hb-bit { white-space: nowrap; }
.exam-hb-sep { opacity: 0.55; font-weight: 500; }

/* Score history row on dashboard */
.theory-scores-row {
  display: flex; gap: 1.5rem; justify-content: center; align-items: flex-end;
  flex-wrap: wrap; padding: 1rem 0 .5rem;
}
.theory-score-item { text-align: center; }
.theory-score-item--faded .theory-result-score { color: var(--muted); font-size: 2rem; }
.theory-score-item--faded .theory-result-label  { color: var(--muted); }

.theory-correction-cta { margin-top: 1.25rem; }
.theory-correction-note {
  font-size: .78rem; color: var(--muted); text-align: center;
  margin-top: .4rem;
}

/* Correction mode — banner */
.theory-correction-banner {
  background: #eff6ff; border: 1px solid #bfdbfe;
  border-radius: var(--radius); padding: .75rem 1.25rem;
  margin-bottom: 1.25rem;
}
.theory-correction-round { font-size: .9rem; color: #1e40af; }
.theory-correction-hint  { font-size: .82rem; color: var(--muted); }

/* Theory reset button in card header (top-right, discreet) */
.theory-reset-form { margin: 0; }
.theory-reset-btn {
  display: inline-flex; align-items: center; gap: .3rem;
  background: none; border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: .2rem .55rem;
  font-size: .75rem; color: var(--muted); cursor: pointer;
  transition: color .12s, border-color .12s, background .12s;
  line-height: 1.4;
}
.theory-reset-btn:hover {
  color: var(--danger); border-color: #fca5a5; background: #fef2f2;
}

/* Locked view — banner */
.theory-locked-banner {
  background: #f0fdf4; border: 1px solid #bbf7d0;
  border-radius: var(--radius); padding: .75rem 1.25rem;
  margin-bottom: 1.25rem;
}
.theory-locked-title {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .9rem; font-weight: 600; color: var(--success);
}
.theory-locked-hint { font-size: .82rem; color: var(--muted); }

/* Locked view — correct/wrong option highlights */
.theory-option.is-answer-correct {
  border-color: #6ee7b7; background: #f0fdf4;
}
.theory-option.is-answer-correct .theory-option-text { color: #065f46; font-weight: 500; }
.theory-option.is-answer-wrong {
  border-color: var(--danger); background: #fef2f2;
}
.theory-option.is-answer-wrong .theory-option-text { color: #991b1b; }
.theory-option-correct-icon {
  flex-shrink: 0; margin-left: auto; color: var(--success);
}

/* Dashboard — locked state indicator */
.theory-locked-state {
  display: flex; align-items: center; gap: .5rem; justify-content: center;
  margin-top: 1rem; font-size: .82rem; color: var(--success);
}

/* Dashboard — lock offer below correction button */
.theory-lock-offer {
  margin-top: .75rem; padding-top: .75rem;
  border-top: 1px solid var(--border);
}

/* Post-correction result screen */
.theory-corr-result-screen {
  display: flex; align-items: center; justify-content: center;
  min-height: 60vh; padding: 2rem 0;
}
.theory-corr-result-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 2.5rem 2rem;
  text-align: center; max-width: 380px; width: 100%;
  display: flex; flex-direction: column; align-items: center; gap: .75rem;
}
.theory-corr-result-score { font-size: 3.5rem; font-weight: 300; color: var(--primary); line-height: 1; }
.theory-corr-result-label { font-size: .85rem; color: var(--muted); }
.theory-corr-result-choices { display: flex; gap: .75rem; margin-top: .75rem; flex-wrap: wrap; justify-content: center; }
.theory-corr-result-note  { font-size: .78rem; color: var(--muted); max-width: 280px; }

/* Review mode — banner */
.theory-review-banner {
  background: var(--alert-warn-bg); border: 1px solid var(--alert-warn-border);
  border-radius: var(--radius); padding: .75rem 1.25rem;
  margin-bottom: 1.25rem;
}
.theory-review-banner-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
}
.theory-review-summary { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.theory-review-all-ok {
  display: flex; align-items: center; gap: .4rem;
  font-size: .9rem; font-weight: 600; color: var(--success);
}
.theory-review-stat {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .875rem; font-weight: 600; padding: .25rem .6rem;
  border-radius: 20px;
}
.theory-review-stat--wrong   { background: #fee2e2; color: #991b1b; }
.theory-review-stat--skipped { background: var(--bg-muted); color: var(--muted); }
.theory-review-hint { font-size: .82rem; color: var(--warning); }

/* Review mode — question states */
.theory-question.review-correct {
  opacity: .55; background: var(--bg-muted); border-color: var(--border);
}
.theory-question.review-correct .theory-question-num {
  background: #d1fae5; color: #065f46;
}
.theory-question.review-wrong   { border-color: #fca5a5; }
.theory-question.review-skipped { border-color: var(--border); }

/* Locked options (correct answers) */
.theory-option.is-locked         { cursor: default; pointer-events: none; }
.theory-option.is-locked:hover   { border-color: var(--border); background: var(--bg-subtle); }
.theory-option.is-locked.is-selected {
  border-color: var(--border-primary-soft); background: var(--bg-muted);
}
.theory-option.is-locked.is-selected .theory-option-check {
  border-color: var(--muted); background: var(--muted);
}
.theory-option.is-locked .theory-option-text { color: var(--muted); }

/* is-answer-wrong overrides is-locked — must come after is-locked rules */
.theory-option.is-locked.is-answer-wrong {
  border-color: var(--danger); background: #fef2f2;
}
.theory-option.is-locked.is-answer-wrong .theory-option-text { color: #991b1b; }
.theory-option.is-locked.is-answer-wrong .theory-option-check {
  border-color: var(--muted); background: var(--muted);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2 6l3 3 5-5' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center; background-size: 10px;
}

/* Review link on dashboard */
.theory-review-link {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .85rem; color: var(--danger); text-decoration: none;
  font-weight: 500;
}
.theory-review-link:hover { text-decoration: underline; }

.theory-start-screen {
  display: flex; align-items: center; justify-content: center;
  padding: 3rem 0;
}
.theory-start-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 2.5rem 3rem;
  text-align: center; max-width: 400px; width: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 1rem;
}
.theory-start-box svg { color: var(--primary); }
.theory-start-box h2 { font-size: 1.3rem; color: var(--text); }
.theory-start-box p  { font-size: .9rem; color: var(--muted); margin: 0; }
.theory-start-note   { font-size: .82rem !important; color: var(--muted) !important; }
.theory-start-error  { color: var(--danger); font-size: .85rem; margin-top: .25rem; }

@media (max-width: 600px) {
  .theory-wrap { padding: 0 .5rem 3rem; }
  .theory-question { padding: 1rem; }
  .theory-submit-row { flex-direction: column; align-items: stretch; }
  .theory-submit-row .btn { width: 100%; }
  .theory-start-box { padding: 2rem 1.5rem; }
}
