/* ============================================================
   SceneReady — Dashboard Styles v2
   Deep Navy sidebar · Electric Blue accents · Inter font
   ============================================================ */

:root {
  --sr-brand: #2563eb;
  --sr-accent: #0f172a;
  --sr-bg: #f3f6fb;
  --sr-surface: #ffffff;
  --sr-border: #e2e8f0;
  --sr-text: #0f172a;
  --sr-text-muted: #64748b;
  --sr-shadow-sm: 0 1px 3px rgba(2, 6, 23, .08), 0 1px 2px rgba(2, 6, 23, .06);
  --sr-shadow-md: 0 8px 24px rgba(2, 6, 23, .08), 0 2px 6px rgba(2, 6, 23, .06);
}

.dash-body {
  margin: 0;
  background:
    radial-gradient(1200px 480px at 95% -10%, rgba(37, 99, 235, .14) 0%, rgba(37, 99, 235, 0) 60%),
    linear-gradient(180deg, #f8fbff 0%, var(--sr-bg) 45%, #eef3fb 100%);
  color: var(--sr-text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.dash-layout {
  display: grid;
  grid-template-columns: 270px 1fr;
  min-height: calc(100vh - 56px);
}

.dash-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 56px;
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 0 1rem;
  background: rgba(255, 255, 255, .84);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--sr-border);
}

.dash-topbar__toggle {
  border: 1px solid var(--sr-border);
  background: #fff;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  font-size: 1.05rem;
  cursor: pointer;
  color: #334155;
  /* Hidden on desktop — only meaningful on mobile */
  display: none;
}

/* Full-screen dim overlay behind the mobile sidebar */
.dash-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 59;
  background: rgba(0, 0, 0, .45);
  backdrop-filter: blur(2px);
}
.dash-overlay--visible {
  display: block;
}

.dash-topbar__title {
  font-size: .92rem;
  font-weight: 700;
  color: #0f172a;
}

.dash-sidebar {
  position: sticky;
  top: 56px;
  align-self: start;
  height: calc(100vh - 56px);
  overflow-y: auto;
  background: linear-gradient(180deg, #0c1326 0%, #0f172a 100%);
  border-right: 1px solid rgba(255, 255, 255, .08);
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
}

.dash-sidebar__brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: 1rem 1rem .9rem;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  color: #fff;
}

.dash-sidebar__logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.dash-sidebar__name {
  font-weight: 800;
  letter-spacing: -.02em;
  font-size: .92rem;
}

.dash-nav {
  padding: .65rem;
  display: flex;
  flex-direction: column;
  gap: .3rem;
  flex: 1;
}

.dash-nav__section-label {
  color: rgba(226, 232, 240, .55);
  font-size: .62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  padding: .45rem .5rem .2rem;
}

.dash-nav__link {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .52rem .58rem;
  color: rgba(226, 232, 240, .86);
  border-radius: 9px;
  text-decoration: none;
  font-size: .825rem;
  border: 1px solid transparent;
}

.dash-nav__link:hover {
  background: rgba(255, 255, 255, .08);
}

.dash-nav__link--active {
  background: rgba(37, 99, 235, .24);
  border-color: rgba(147, 197, 253, .3);
  color: #dbeafe;
}

.dash-nav__icon {
  width: 1.05rem;
  text-align: center;
  opacity: .95;
}

.dash-sidebar__footer {
  border-top: 1px solid rgba(255, 255, 255, .08);
  padding: .8rem;
}

.dash-sidebar__user {
  display: flex;
  gap: .55rem;
  align-items: center;
}

.dash-sidebar__avatar {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: rgba(37, 99, 235, .25);
  color: #dbeafe;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  font-weight: 700;
}

.dash-sidebar__user-name {
  color: #fff;
  font-size: .8rem;
  font-weight: 600;
}

.dash-sidebar__user-role {
  color: rgba(226, 232, 240, .6);
  font-size: .67rem;
}

.dash-sidebar__signout {
  display: inline-flex;
  margin-top: .6rem;
  color: #fca5a5;
  font-size: .76rem;
  text-decoration: none;
}

.dash-main {
  padding: 1.05rem;
  min-width: 0;
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
}

.dash-content {
  padding: 1.05rem;
  min-width: 0;
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
}

.dash-page-header {
  margin-bottom: .9rem;
}

.dash-page-title {
  margin: 0;
  font-size: 1.32rem;
  font-weight: 800;
  letter-spacing: -.03em;
}

.dash-page-subtitle {
  margin: .2rem 0 0;
  color: var(--sr-text-muted);
  font-size: .84rem;
}

.dash-section {
  background: var(--sr-surface);
  border: 1px solid var(--sr-border);
  box-shadow: var(--sr-shadow-sm);
  border-radius: 14px;
  padding: 1rem;
}

.dash-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .9rem;
  padding: .85rem 1rem;
  border-bottom: 1px solid #eff3f9;
  text-decoration: none;
  color: inherit;
}

.dash-list-row:last-child {
  border-bottom: none;
}

.dash-list-row:hover {
  background: #f8fbff;
}

.dash-list-row__primary {
  font-size: .86rem;
  font-weight: 600;
  color: #0f172a;
}

.dash-list-row__secondary {
  font-size: .77rem;
  color: #64748b;
}

.dash-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: .8rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
}

.data-table th,
.data-table td {
  padding: .66rem .82rem;
  border-bottom: 1px solid #edf2f9;
  text-align: left;
}

.data-table th {
  font-size: .68rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #64748b;
  background: #f8fbff;
}

.card-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: .7rem;
}

.card-list li {
  border: 1px solid #edf2f8;
  border-radius: 10px;
  padding: .7rem .75rem;
  background: #fff;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  border-radius: 8px;
  padding: .52rem .86rem;
  font-size: .82rem;
  font-weight: 600;
  border: 1px solid transparent;
  text-decoration: none;
}

.btn--primary {
  background: var(--sr-brand);
  color: #fff;
  border-color: var(--sr-brand);
}

.btn--primary:hover {
  filter: brightness(.95);
}

.btn--secondary {
  background: #fff;
  border-color: var(--sr-border);
  color: #334155;
}

.btn--secondary:hover {
  background: #f8fbff;
}

.btn--ghost {
  background: #f8fbff;
  border-color: #dbe6f4;
  color: #1e40af;
}

.btn--ghost:hover {
  background: #eef5ff;
}

.btn--sm {
  padding: .34rem .58rem;
  font-size: .74rem;
}

/* ── Keyboard shortcut modal ─────────────────────────────── */
.kb-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, .58);
  backdrop-filter: blur(6px);
  z-index: 120;
  padding: 1rem;
}

.kb-modal.is-open {
  display: flex;
}

.kb-modal__box {
  width: min(100%, 420px);
  background: #fff;
  border-radius: 16px;
  border: 1px solid #dbe3ef;
  box-shadow: 0 18px 60px rgba(15, 23, 42, .24);
  padding: 1rem 1rem .9rem;
}

.kb-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .75rem;
}

.kbd-modal-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, .58);
  backdrop-filter: blur(6px);
  z-index: 120;
  padding: 1rem;
}
.kb-modal__header h3 {
  margin: 0;
  font-size: .96rem;
  font-weight: 800;
  color: #0f172a;
}

.kbd-modal-overlay.is-open {
  display: flex;
}

.kbd-modal {
  width: min(100%, 420px);
  background: #fff;
  border-radius: 16px;
  border: 1px solid #dbe3ef;
  box-shadow: 0 18px 60px rgba(15, 23, 42, .24);
  padding: 1rem 1rem .9rem;
}

.kbd-modal__title {
  font-size: .96rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: .75rem;
}

.kbd-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .55rem 0;
  border-bottom: 1px solid #edf2f7;
  font-size: .85rem;
  color: #334155;
}

.kbd-row kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.4rem;
  padding: .12rem .38rem;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  box-shadow: inset 0 -1px 0 rgba(15, 23, 42, .05);
  font-size: .78rem;
  font-weight: 700;
}

.kbd-modal__close {
  float: right;
  width: 30px;
  height: 30px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  cursor: pointer;
}

.kbd-modal__close:hover {
  background: #f8fafc;
}

.kbd-modal__hint {
  margin-top: .75rem;
  font-size: .77rem;
  color: #64748b;
}

.kb-modal__close {
  width: 30px;
  height: 30px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  cursor: pointer;
}

.kb-modal__close:hover {
  background: #f8fafc;
}

.kb-modal .kb-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .55rem 0;
  border-bottom: 1px solid #edf2f7;
  font-size: .85rem;
  color: #334155;
}

.kb-modal .kb-row kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.4rem;
  padding: .12rem .38rem;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  box-shadow: inset 0 -1px 0 rgba(15, 23, 42, .05);
  font-size: .78rem;
  font-weight: 700;
}

button#backToTop {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid #dbe3ef;
  background: #fff;
  color: #0f172a;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .14);
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
}

button#backToTop.btt--visible {
  opacity: 1;
  pointer-events: auto;
}

button#backToTop:hover {
  transform: translateY(-1px);
}

@media (max-width: 980px) {
  .dash-layout {
    grid-template-columns: 1fr;
  }

  .dash-topbar__toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .dash-sidebar {
    position: fixed;
    top: 56px;
    left: 0;
    width: 270px;
    height: calc(100vh - 56px);
    transform: translateX(-110%);
    transition: transform .25s cubic-bezier(.4, 0, .2, 1);
    z-index: 60;
  }

  /* Both class names accepted for robustness */
  .dash-sidebar.open,
  .dash-sidebar.dash-sidebar--open {
    transform: translateX(0);
  }

  .dash-main {
    padding: .9rem;
  }
}

/* ── Layout Shell ─────────────────────────────────────────── */
.dashboard-shell {
  display: flex;
  min-height: 100vh;
  background: #f0f2f7;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar {
  width: 15.5rem;
  background: #0f172a;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 40;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255,255,255,.06);
  transition: width .2s cubic-bezier(.16,1,.3,1);
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.1) transparent;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 9999px; }

.sidebar__header {
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  text-decoration: none;
}

.sidebar__logo {
  height: 2.25rem;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
  filter: brightness(1.1);
}

.sidebar__app-name {
  font-size: .9375rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -.02em;
  white-space: nowrap;
}

.sidebar__app-sub {
  font-size: .625rem;
  font-weight: 500;
  color: rgba(255,255,255,.35);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-top: .05rem;
}

/* User info strip */
.sidebar__user {
  padding: .875rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}

.sidebar__user-role {
  font-size: .625rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--blue-400, #60a5fa);
  margin-bottom: .2rem;
}

.sidebar__user-name {
  font-size: .875rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Nav sections */
.sidebar__nav {
  flex: 1;
  padding: .75rem .75rem;
  display: flex;
  flex-direction: column;
  gap: .125rem;
}

.sidebar__section-label {
  font-size: .6375rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255,255,255,.25);
  padding: .75rem .625rem .3rem;
  margin-top: .375rem;
}
.sidebar__section-label:first-child { margin-top: 0; }

.sidebar__link {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .55rem .75rem;
  border-radius: 8px;
  font-size: .8375rem;
  font-weight: 500;
  color: rgba(255,255,255,.55);
  text-decoration: none;
  transition: background .13s ease, color .13s ease, border-color .13s ease;
  border-left: 3px solid transparent;
  margin-left: -3px;
  position: relative;
  white-space: nowrap;
}
.sidebar__link:hover {
  background: rgba(255,255,255,.07);
  color: rgba(255,255,255,.85);
}
.sidebar__link.active, .sidebar__link--active {
  background: rgba(59,130,246,.15);
  color: #93c5fd;
  border-left-color: #3b82f6;
  font-weight: 600;
}
.sidebar__link.active .sidebar__icon,
.sidebar__link--active .sidebar__icon { opacity: 1; }

.sidebar__icon {
  width: 1.125rem;
  text-align: center;
  font-size: .9375rem;
  flex-shrink: 0;
  opacity: .65;
}

/* Badge pill on nav item */
.sidebar__badge {
  margin-left: auto;
  background: rgba(59,130,246,.2);
  color: #93c5fd;
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .03em;
  padding: .1rem .45rem;
  border-radius: 9999px;
  border: 1px solid rgba(59,130,246,.25);
}

.sidebar__footer {
  padding: .875rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}

.sidebar__logout {
  display: flex;
  align-items: center;
  gap: .75rem;
  font-size: .8375rem;
  font-weight: 500;
  color: rgba(255,255,255,.4);
  text-decoration: none;
  transition: color .13s ease;
  padding: .4rem .25rem;
  border-radius: 6px;
}
.sidebar__logout:hover { color: #fca5a5; }

/* ── Main Content Area ────────────────────────────────────── */
.main-content {
  margin-left: 15.5rem;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ── Top Bar ──────────────────────────────────────────────── */
.topbar {
  background: #fff;
  border-bottom: 1px solid #e5e9f0;
  padding: 0 1.75rem;
  height: 3.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 30;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

.topbar__title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -.02em;
}

.topbar__right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.topbar__user {
  display: flex;
  align-items: center;
  gap: .625rem;
  font-size: .8125rem;
  color: #64748b;
  font-weight: 500;
}

.topbar__avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Page Content Wrapper ─────────────────────────────────── */
.page-content {
  padding: 1.75rem;
  flex: 1;
  max-width: 1200px;
  width: 100%;
}

/* Legacy wrapper class support */
.dashboard-content { padding: 1.75rem; flex: 1; }

/* ── Page Hero / Header Banner ────────────────────────────── */
.page-hero {
  background:
    radial-gradient(ellipse at 90% 50%, rgba(6,182,212,.2) 0%, transparent 50%),
    linear-gradient(135deg, #0f172a 0%, #1e3a8a 55%, #2563eb 100%);
  border-radius: 16px;
  padding: 2rem 2.25rem;
  margin-bottom: 1.75rem;
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(15,23,42,.25);
}

.page-hero::before {
  content: '';
  position: absolute; inset: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,.04) 1px, transparent 0);
  background-size: 28px 28px;
}

.page-hero__content { position: relative; }

.page-hero__eyebrow {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #93c5fd;
  margin-bottom: .4rem;
}

.page-hero__title {
  font-size: 1.625rem;
  font-weight: 800;
  letter-spacing: -.025em;
  line-height: 1.15;
  margin-bottom: .4rem;
  color: #fff;
}

.page-hero__sub {
  font-size: .9rem;
  color: rgba(255,255,255,.65);
  line-height: 1.55;
  max-width: 48rem;
}

.page-hero__actions {
  margin-top: 1.25rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}

/* Compact page header (non-banner) */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.page-header__title {
  font-size: 1.375rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -.025em;
  line-height: 1.2;
}
.page-header__sub {
  font-size: .875rem;
  color: #64748b;
  margin-top: .25rem;
}
.page-header__actions { display: flex; align-items: center; gap: .625rem; flex-shrink: 0; }

/* ── Stat Cards ───────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
  gap: 1.125rem;
  margin-bottom: 1.75rem;
}

.stat-card {
  background: #fff;
  border-radius: 14px;
  padding: 1.375rem 1.5rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.07), 0 4px 12px rgba(0,0,0,.05);
  border: 1px solid #e8ecf2;
  transition: box-shadow .18s ease, transform .18s ease;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  border-radius: 0 2px 2px 0;
  background: var(--stat-accent, #3b82f6);
}
.stat-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.1), 0 2px 6px rgba(0,0,0,.06); transform: translateY(-1px); }

.stat-card--blue   { --stat-accent: #3b82f6; }
.stat-card--green  { --stat-accent: #22c55e; }
.stat-card--amber  { --stat-accent: #f59e0b; }
.stat-card--red    { --stat-accent: #ef4444; }
.stat-card--purple { --stat-accent: #8b5cf6; }
.stat-card--cyan   { --stat-accent: #06b6d4; }

.stat-card__body { min-width: 0; }

.stat-card__label {
  font-size: .725rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: .35rem;
}

.stat-card__value {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  color: #0f172a;
  letter-spacing: -.035em;
  margin-bottom: .2rem;
}

.stat-card__delta {
  font-size: .75rem;
  font-weight: 500;
  color: #64748b;
}
.stat-card__delta--up   { color: #16a34a; }
.stat-card__delta--down { color: #dc2626; }

.stat-card__icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
  background: color-mix(in srgb, var(--stat-accent, #3b82f6) 12%, #fff);
  color: var(--stat-accent, #3b82f6);
}

/* Legacy stat card class */
.stat-grid  { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem,1fr)); gap: 1.125rem; margin-bottom: 1.75rem; }
.stat-box   { background: #fff; border-radius: 14px; padding: 1.375rem 1.5rem; box-shadow: 0 1px 3px rgba(0,0,0,.07),0 4px 12px rgba(0,0,0,.05); border: 1px solid #e8ecf2; position: relative; overflow: hidden; transition: box-shadow .18s, transform .18s; }
.stat-box::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; border-radius: 0 2px 2px 0; background: #3b82f6; }
.stat-box--green::before  { background: #22c55e; }
.stat-box--amber::before  { background: #f59e0b; }
.stat-box--purple::before { background: #8b5cf6; }
.stat-box--cyan::before   { background: #06b6d4; }
.stat-box__label { font-size: .725rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #64748b; margin-bottom: .3rem; }
.stat-box__value { font-size: 2rem; font-weight: 800; line-height: 1; color: #0f172a; letter-spacing: -.035em; }
.stat-box__sub   { font-size: .75rem; color: #94a3b8; margin-top: .25rem; }
.stat-box:hover  { box-shadow: 0 4px 16px rgba(0,0,0,.1); transform: translateY(-1px); }

/* ── Section Cards ────────────────────────────────────────── */
.card {
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e8ecf2;
  box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.04);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.125rem 1.5rem;
  border-bottom: 1px solid #f1f3f7;
  gap: 1rem;
  flex-wrap: wrap;
}

.card-header__left {
  display: flex;
  align-items: center;
  gap: .625rem;
}

.card-header__accent {
  width: 4px;
  height: 1.125rem;
  border-radius: 9999px;
  background: #3b82f6;
  flex-shrink: 0;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -.02em;
}

.card-sub {
  font-size: .8125rem;
  color: #64748b;
  margin-top: .125rem;
}

.card-body { padding: 1.5rem; }
.card-body--compact { padding: 1rem 1.5rem; }
.card-body--flush   { padding: 0; }
.card-footer {
  padding: .875rem 1.5rem;
  border-top: 1px solid #f1f3f7;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .75rem;
  font-size: .8125rem;
  color: #64748b;
}

/* Section heading inside a card */
.section-title {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -.02em;
  margin-bottom: .375rem;
}
.section-sub {
  font-size: .8125rem;
  color: #64748b;
  margin-bottom: 1.25rem;
}

/* ── Tables ───────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: .8375rem;
}
.table th {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #64748b;
  padding: .75rem 1.25rem;
  text-align: left;
  background: #f8fafc;
  border-bottom: 1.5px solid #e8ecf2;
  white-space: nowrap;
}
.table td {
  padding: .875rem 1.25rem;
  border-bottom: 1px solid #f1f3f7;
  color: #334155;
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background .1s ease; }
.table tbody tr:hover { background: #f8fafc; }
.table--striped tbody tr:nth-child(even) { background: #fafbfc; }
.table--striped tbody tr:nth-child(even):hover { background: #f1f5f9; }

/* ── Badges / Status Pills ────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center; gap: .25rem;
  font-size: .7rem; font-weight: 700;
  padding: .2rem .625rem;
  border-radius: 9999px;
  white-space: nowrap; letter-spacing: .015em;
  border: 1px solid transparent;
}
.pill::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex-shrink: 0; }

.pill--blue     { background: #dbeafe; color: #1e40af; border-color: #bfdbfe; }
.pill--green    { background: #dcfce7; color: #166534; border-color: #86efac; }
.pill--amber    { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.pill--red      { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.pill--gray     { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }
.pill--purple   { background: #ede9fe; color: #5b21b6; border-color: #c4b5fd; }
.pill--cyan     { background: #cffafe; color: #155e75; border-color: #a5f3fc; }

/* Legacy badge class compat */
.badge         { display: inline-flex; align-items: center; gap: .25rem; font-size: .7rem; font-weight: 700; padding: .2rem .6rem; border-radius: 9999px; white-space: nowrap; letter-spacing: .01em; border: 1px solid transparent; }
.badge--yellow { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.badge--blue   { background: #dbeafe; color: #1e40af; border-color: #bfdbfe; }
.badge--green  { background: #dcfce7; color: #166534; border-color: #86efac; }
.badge--red    { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.badge--orange { background: #ffedd5; color: #9a3412; border-color: #fed7aa; }
.badge--gray   { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }
.badge--purple { background: #ede9fe; color: #5b21b6; border-color: #c4b5fd; }

/* ── Form Controls (dashboard context) ───────────────────── */
.form-row     { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.form-inline  { display: flex; align-items: center; gap: .5rem; }

.input {
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  padding: .55rem .875rem;
  font-size: .875rem;
  font-family: inherit;
  color: #0f172a;
  background: #fff;
  outline: none;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.input:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,.18); }

.select {
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  padding: .55rem 2.25rem .55rem .875rem;
  font-size: .875rem;
  font-family: inherit;
  color: #0f172a;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right .625rem center;
  appearance: none; -webkit-appearance: none;
  outline: none;
  transition: border-color .12s ease, box-shadow .12s ease;
  cursor: pointer;
}
.select:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,.18); }

/* ── Targeted page polish helpers ─────────────────────────── */
.ux-page-header-split {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .85rem;
}

.ux-link-warn {
  color: #d97706;
  font-weight: 700;
}

.ux-link-warn:hover {
  color: #b45309;
  text-decoration: underline;
}

.ux-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .55rem;
  padding: .8rem;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border: 1px solid #dce6f1;
  border-radius: 12px;
  box-shadow: 0 3px 10px rgba(15, 23, 42, .05);
  margin-bottom: 1rem;
}

.ux-grow {
  flex: 1;
  min-width: 220px;
}

.ux-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: #94a3b8;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  background: #f8fbff;
}

.ux-list-shell {
  padding: .45rem !important;
}

.ux-checkoff-row {
  flex-direction: column;
  align-items: flex-start;
  gap: .65rem;
  padding: 1rem;
  border: 1px solid #e3ebf4;
  border-radius: 12px;
  margin: .35rem;
  background: linear-gradient(180deg, #fff 0%, #f8fbff 100%);
  transition: border-color .12s ease, box-shadow .12s ease, transform .12s ease;
}

.ux-checkoff-row:hover {
  border-color: #bfdbfe;
  box-shadow: 0 8px 18px rgba(37, 99, 235, .09);
  transform: translateY(-1px);
}

.ux-checkoff-main {
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: flex-start;
  gap: .75rem;
}

.ux-checkoff-meta {
  display: flex;
  flex-direction: column;
  gap: .2rem;
}

.ux-checkoff-aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .3rem;
  flex-shrink: 0;
}

.ux-review-link {
  font-size: .8rem;
  color: #2563eb;
  font-weight: 700;
}

.ux-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}

.ux-tag {
  font-size: .74rem;
  background: #eef2f7;
  color: #475569;
  border: 1px solid #e2e8f0;
  padding: .15rem .5rem;
  border-radius: 999px;
}

.ux-tag--muted {
  color: #94a3b8;
  background: transparent;
  border-color: transparent;
  padding-left: .15rem;
}

.ux-user-grid {
  grid-template-columns: 1.8fr 2fr 1fr .8fr .9fr 1.3fr !important;
}

.ux-actions {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
  align-items: center;
}

.ux-role-select {
  min-width: 126px;
  font-size: .75rem;
  padding: .25rem .45rem;
}

.ux-back-link {
  font-size: .85rem;
  color: #64748b;
  font-weight: 600;
}

.ux-back-link:hover {
  color: #334155;
  text-decoration: underline;
}

.ux-form-shell {
  max-width: 52rem;
}

.ux-form-shell--narrow {
  max-width: 34rem;
}

/* Shared form polish for dashboard/admin forms */
.dash-main .ux-form-shell,
.dash-main .ux-form-shell--narrow {
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 1.1rem;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
}

.dash-main .field {
  border-radius: 10px;
  border: 1px solid #cfd9e5;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  transition: border-color .14s ease, box-shadow .14s ease, background .14s ease;
}

.dash-main .field:hover {
  border-color: #a7bdd8;
}

.dash-main .field:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .14);
  background: #ffffff;
}

.dash-main .field-group .field-label {
  font-weight: 700;
  color: #334155;
  letter-spacing: .01em;
}

.dash-main .ux-checkline {
  padding: .5rem .65rem;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
}

.dash-main .ux-checkline input[type="checkbox"],
.dash-main .ux-checkline input[type="radio"] {
  accent-color: #2563eb;
}

.dash-main .ux-scroll-list {
  border-radius: .8rem;
  border-color: #d7e2ef;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8);
}

.ux-form-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ux-field-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .9rem;
}

.ux-field-full {
  grid-column: 1 / -1;
}

.ux-required {
  color: #dc2626;
}

.ux-help {
  font-size: .78rem;
  color: #94a3b8;
  margin-top: .3rem;
}

.ux-option-row {
  display: flex;
  align-items: center;
  gap: .55rem;
  margin-bottom: .5rem;
}

.ux-option-toggle {
  width: 1.2rem;
  height: 1.2rem;
  flex-shrink: 0;
}

.ux-option-input {
  flex: 1;
}

.ux-no-shrink {
  flex-shrink: 0;
}

.ux-actions-row {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}

.ux-header-actions {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  align-items: center;
}

.ux-inline-form {
  display: inline;
}

.ux-warning-note {
  color: #b45309;
  font-size: .88rem;
  font-weight: 600;
  margin-top: .2rem;
}

.ux-warning-note--spaced {
  margin-bottom: 1rem;
}

.ux-status-badge {
  margin-bottom: 1rem;
  display: inline-block;
}

.ux-checkline {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.ux-checkline-wrap {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.ux-scroll-list {
  max-height: 28rem;
  overflow-y: auto;
  border: 1px solid #dbe4ee;
  border-radius: .6rem;
}

.ux-filter-row {
  margin-bottom: .75rem;
  display: flex;
  gap: .75rem;
  align-items: center;
  flex-wrap: wrap;
}

.ux-field-max-280 { max-width: 280px; }
.ux-field-max-320 { max-width: 320px; }

.ux-list-row-detailed {
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.15rem;
}

.ux-list-row-main {
  flex: 1;
  min-width: 0;
}

.ux-list-row-titleline {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: .25rem;
}

.ux-list-row-link {
  font-size: .94rem;
  font-weight: 700;
  color: #0f172a;
  text-decoration: none;
}

.ux-list-row-link:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

.ux-list-row-meta {
  font-size: .79rem;
  color: #64748b;
  display: flex;
  flex-wrap: wrap;
  gap: .25rem .75rem;
}

.ux-list-row-actions {
  display: flex;
  gap: .4rem;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.ux-list-empty {
  text-align: center;
  padding: 3rem 1.5rem;
}

.ux-list-empty-text {
  color: #94a3b8;
  font-size: 1rem;
  margin-bottom: 1.1rem;
}

/* Compact density mode for heavy list pages */
body.is-compact .dash-list-row,
body.is-compact .list-table__row {
  padding-top: .5rem !important;
  padding-bottom: .5rem !important;
}

body.is-compact .dash-list-row__primary,
body.is-compact .ux-list-row-link {
  font-size: .86rem;
}

body.is-compact .dash-list-row__meta,
body.is-compact .dash-list-row__secondary,
body.is-compact .ux-list-row-meta,
body.is-compact .badge,
body.is-compact .btn--sm {
  font-size: .72rem;
}

body.is-compact .ux-toolbar {
  padding: .55rem;
  gap: .4rem;
}

body.is-compact .field {
  min-height: 2.2rem;
  padding-top: .45rem;
  padding-bottom: .45rem;
}

@media (max-width: 860px) {
  .ux-field-grid-2 {
    grid-template-columns: 1fr;
  }

  .ux-user-grid {
    min-width: 860px;
  }
}

/* Global form polish across dashboard surfaces */
.dash-main input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
.dash-main select,
.dash-main textarea,
.dash-content input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
.dash-content select,
.dash-content textarea,
.main-content input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
.main-content select,
.main-content textarea {
  border: 1.5px solid #d4dfec;
  border-radius: 11px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  color: #0f172a;
  transition: border-color .14s ease, box-shadow .14s ease, background .14s ease;
}

.dash-main input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):focus,
.dash-main select:focus,
.dash-main textarea:focus,
.dash-content input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):focus,
.dash-content select:focus,
.dash-content textarea:focus,
.main-content input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):focus,
.main-content select:focus,
.main-content textarea:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 4px rgba(56, 189, 248, .16);
  background: #fff;
  outline: none;
}

/* Custom checkboxes and radios for dashboard forms */
.dash-main input[type="checkbox"],
.dash-content input[type="checkbox"],
.main-content input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 1.1rem;
  height: 1.1rem;
  border: 1.6px solid #93a8c0;
  border-radius: .34rem;
  background: #fff;
  display: inline-grid;
  place-content: center;
  cursor: pointer;
  transition: border-color .12s ease, box-shadow .12s ease, background .12s ease;
}

.dash-main input[type="checkbox"]::before,
.dash-content input[type="checkbox"]::before,
.main-content input[type="checkbox"]::before {
  content: "";
  width: .56rem;
  height: .56rem;
  transform: scale(0);
  transition: transform .12s ease;
  clip-path: polygon(14% 49%, 0 63%, 43% 100%, 100% 19%, 84% 5%, 42% 69%);
  background: #fff;
}

.dash-main input[type="checkbox"]:checked,
.dash-content input[type="checkbox"]:checked,
.main-content input[type="checkbox"]:checked {
  border-color: #2563eb;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.dash-main input[type="checkbox"]:checked::before,
.dash-content input[type="checkbox"]:checked::before,
.main-content input[type="checkbox"]:checked::before {
  transform: scale(1);
}

.dash-main input[type="radio"],
.dash-content input[type="radio"],
.main-content input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 1.1rem;
  height: 1.1rem;
  border: 1.6px solid #93a8c0;
  border-radius: 999px;
  background: #fff;
  display: inline-grid;
  place-content: center;
  cursor: pointer;
  transition: border-color .12s ease, box-shadow .12s ease;
}

.dash-main input[type="radio"]::before,
.dash-content input[type="radio"]::before,
.main-content input[type="radio"]::before {
  content: "";
  width: .52rem;
  height: .52rem;
  border-radius: 999px;
  transform: scale(0);
  transition: transform .12s ease;
  background: #2563eb;
}

.dash-main input[type="radio"]:checked,
.dash-content input[type="radio"]:checked,
.main-content input[type="radio"]:checked {
  border-color: #2563eb;
}

.dash-main input[type="radio"]:checked::before,
.dash-content input[type="radio"]:checked::before,
.main-content input[type="radio"]:checked::before {
  transform: scale(1);
}

/* ── Buttons (dashboard context) ─────────────────────────── */
.btn-primary {
  display: inline-flex; align-items: center; gap: .4rem;
  background: #2563eb; color: #fff; border: none;
  padding: .6rem 1.25rem; border-radius: 8px;
  font-size: .875rem; font-weight: 600; font-family: inherit;
  cursor: pointer; text-decoration: none;
  box-shadow: 0 1px 2px rgba(37,99,235,.3), 0 2px 8px rgba(37,99,235,.15);
  transition: background .12s ease, box-shadow .12s ease, transform .12s ease;
  white-space: nowrap; letter-spacing: -.01em;
}
.btn-primary:hover   { background: #1d4ed8; box-shadow: 0 2px 6px rgba(37,99,235,.4), 0 4px 12px rgba(37,99,235,.2); }
.btn-primary:active  { transform: translateY(1px); }
.btn-primary--sm     { padding: .4rem .875rem; font-size: .8rem; }
.btn-primary--lg     { padding: .75rem 1.75rem; font-size: .9375rem; }

.btn-secondary {
  display: inline-flex; align-items: center; gap: .4rem;
  background: #fff; color: #334155; border: 1.5px solid #e2e8f0;
  padding: .575rem 1.125rem; border-radius: 8px;
  font-size: .875rem; font-weight: 600; font-family: inherit;
  cursor: pointer; text-decoration: none;
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
  transition: background .12s ease, border-color .12s ease, box-shadow .12s ease, transform .12s ease;
  white-space: nowrap; letter-spacing: -.01em;
}
.btn-secondary:hover  { background: #f8fafc; border-color: #cbd5e1; box-shadow: 0 2px 6px rgba(0,0,0,.08); }
.btn-secondary:active { transform: translateY(1px); }
.btn-secondary--sm    { padding: .35rem .75rem; font-size: .8rem; }

.btn-danger-outline {
  display: inline-flex; align-items: center; gap: .4rem;
  background: #fff; color: #dc2626; border: 1.5px solid #fca5a5;
  padding: .575rem 1.125rem; border-radius: 8px;
  font-size: .875rem; font-weight: 600; font-family: inherit;
  cursor: pointer; text-decoration: none;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.btn-danger-outline:hover { background: #dc2626; color: #fff; border-color: #dc2626; }

.btn-icon {
  width: 2.25rem; height: 2.25rem; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #fff; border: 1.5px solid #e2e8f0; color: #64748b;
  cursor: pointer; transition: background .12s ease, color .12s ease, border-color .12s ease;
  font-size: .95rem; flex-shrink: 0;
}
.btn-icon:hover { background: #f1f5f9; color: #0f172a; border-color: #cbd5e1; }

/* ── Progress Bars ────────────────────────────────────────── */
.progress-track {
  height: 8px;
  background: #e8ecf2;
  border-radius: 9999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 9999px;
  background: linear-gradient(90deg, #2563eb, #60a5fa);
  transition: width .5s cubic-bezier(.16,1,.3,1);
}
.progress-fill--green  { background: linear-gradient(90deg, #16a34a, #4ade80); }
.progress-fill--amber  { background: linear-gradient(90deg, #d97706, #fbbf24); }
.progress-fill--red    { background: linear-gradient(90deg, #dc2626, #f87171); }
.progress-fill--purple { background: linear-gradient(90deg, #7c3aed, #a78bfa); }

.progress-bar { /* Legacy compat */
  height: 8px; background: #e8ecf2; border-radius: 9999px; overflow: hidden;
}
.progress-bar__fill {
  height: 100%; border-radius: 9999px;
  background: linear-gradient(90deg, #2563eb, #60a5fa);
}

/* ── Test / Queue styles ──────────────────────────────────── */
.queue-table { width: 100%; border-collapse: collapse; font-size: .8375rem; }
.queue-table th {
  font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: #64748b; padding: .7rem 1rem; text-align: left;
  background: #f8fafc; border-bottom: 1.5px solid #e8ecf2;
}
.queue-table td { padding: .8rem 1rem; border-bottom: 1px solid #f1f3f7; color: #334155; }
.queue-table tr:last-child td { border-bottom: none; }
.queue-table tr:hover td { background: #f8fafc; }

/* ── Adaptive Test UI ─────────────────────────────────────── */
.test-shell {
  display: flex;
  min-height: 100vh;
  background: #f0f2f7;
}

.test-header {
  background: #0f172a;
  color: #fff;
  padding: 1rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky; top: 0; z-index: 20;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}

.test-header__brand { display: flex; align-items: center; gap: .75rem; }
.test-header__logo  { height: 2rem; object-fit: contain; }
.test-header__name  { font-size: .9375rem; font-weight: 700; color: #fff; letter-spacing: -.02em; }
.test-header__meta  { font-size: .8rem; color: rgba(255,255,255,.5); margin-top: .1rem; }
.test-header__right { display: flex; align-items: center; gap: 1.25rem; }
.test-header__timer { font-size: .875rem; font-weight: 700; color: #93c5fd; font-variant-numeric: tabular-nums; }
.test-header__timer--warn { color: #fbbf24; }
.test-header__timer--danger { color: #f87171; }

.test-body {
  max-width: 56rem; margin: 2rem auto; padding: 0 1.5rem 3rem; width: 100%;
}

.question-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,.09), 0 1px 4px rgba(0,0,0,.06);
  border: 1px solid #e8ecf2;
  overflow: hidden;
}

.question-card__header {
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid #f1f3f7;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  gap: .75rem;
  flex-wrap: wrap;
}

.question-card__meta { display: flex; align-items: center; gap: .625rem; }

.question-card__num {
  font-size: .7rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase;
  color: #2563eb;
}

.question-card__difficulty {
  font-size: .7rem; font-weight: 600; padding: .15rem .5rem; border-radius: 9999px;
}
.question-card__difficulty--easy   { background: #dcfce7; color: #166534; }
.question-card__difficulty--medium { background: #fef3c7; color: #92400e; }
.question-card__difficulty--hard   { background: #fee2e2; color: #991b1b; }

.question-card__body { padding: 1.75rem; }

.question-text {
  font-size: 1.0625rem;
  font-weight: 500;
  line-height: 1.65;
  color: #0f172a;
  margin-bottom: 1.75rem;
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: .625rem;
}

.option {
  display: flex;
  align-items: flex-start;
  gap: .875rem;
  padding: .875rem 1.125rem;
  border-radius: 10px;
  border: 1.5px solid #e2e8f0;
  cursor: pointer;
  transition: border-color .13s ease, background .13s ease, box-shadow .13s ease;
  user-select: none;
}
.option:hover { border-color: #93c5fd; background: #eff6ff; }
.option.selected { border-color: #3b82f6; background: #eff6ff; box-shadow: 0 0 0 3px rgba(59,130,246,.12); }
.option.correct  { border-color: #22c55e; background: #f0fdf4; }
.option.incorrect { border-color: #ef4444; background: #fef2f2; }
.option input[type="radio"] { margin-top: .2rem; flex-shrink: 0; accent-color: #2563eb; }
.option__letter {
  width: 1.75rem; height: 1.75rem; border-radius: 6px;
  background: #f1f5f9; border: 1.5px solid #e2e8f0;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 800; color: #475569;
  flex-shrink: 0; transition: background .13s, border-color .13s, color .13s;
}
.option:hover .option__letter     { background: #dbeafe; border-color: #93c5fd; color: #1e40af; }
.option.selected .option__letter  { background: #dbeafe; border-color: #3b82f6; color: #1e40af; }
.option.correct  .option__letter  { background: #dcfce7; border-color: #22c55e; color: #166534; }
.option.incorrect .option__letter { background: #fee2e2; border-color: #ef4444; color: #991b1b; }
.option__text { font-size: .9rem; line-height: 1.55; color: #334155; }

.question-card__footer {
  padding: 1.25rem 1.75rem;
  border-top: 1px solid #f1f3f7;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .75rem;
}

/* CAT progress indicator */
.test-progress { background: #fff; border-radius: 12px; padding: 1rem 1.5rem; margin-bottom: 1.25rem; border: 1px solid #e8ecf2; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.test-progress__label { font-size: .8125rem; font-weight: 600; color: #0f172a; margin-bottom: .5rem; display: flex; justify-content: space-between; }
.test-progress__sub   { font-size: .75rem; color: #64748b; }

/* Explanation panel */
.explanation-panel {
  background: #f0fdf4; border: 1.5px solid #86efac; border-radius: 10px;
  padding: 1.125rem 1.25rem; margin-top: 1.25rem;
}
.explanation-panel__label { font-size: .7rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: #16a34a; margin-bottom: .4rem; }
.explanation-panel__text  { font-size: .9rem; color: #14532d; line-height: 1.6; }

/* ── Skills / Checklist builder ───────────────────────────── */
.skill-card {
  background: #fff; border-radius: 12px; border: 1px solid #e8ecf2;
  box-shadow: 0 1px 3px rgba(0,0,0,.06); padding: 1.25rem 1.5rem; margin-bottom: .875rem;
  transition: box-shadow .15s ease, border-color .15s ease;
}
.skill-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.09); border-color: #bfdbfe; }
.skill-card__title { font-size: .9375rem; font-weight: 700; color: #0f172a; margin-bottom: .25rem; letter-spacing: -.015em; }
.skill-card__meta  { font-size: .8rem; color: #64748b; }
.skill-card__actions { display: flex; align-items: center; gap: .5rem; margin-top: .875rem; }

.checklist-item {
  display: flex; align-items: flex-start; gap: .875rem;
  padding: .875rem 1.125rem; border-radius: 10px; border: 1.5px solid #e8ecf2;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%); margin-bottom: .625rem;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .05);
  transition: border-color .12s ease, box-shadow .12s ease, transform .12s ease;
}
.checklist-item:hover { border-color: #93c5fd; box-shadow: 0 6px 16px rgba(37, 99, 235, .12); transform: translateY(-1px); }
.checklist-item__cb { margin-top: .175rem; flex-shrink: 0; }
.checklist-item__body { flex: 1; min-width: 0; }
.checklist-item__text { font-size: .9rem; font-weight: 500; color: #334155; line-height: 1.5; }
.checklist-item__meta { font-size: .75rem; color: #94a3b8; margin-top: .2rem; }
.checklist-item--checked .checklist-item__text { color: #94a3b8; text-decoration: line-through; }

/* ── Labs / Test cards (instructor/student) ───────────────── */
.lab-card {
  background: #fff; border-radius: 14px; border: 1px solid #e8ecf2;
  box-shadow: 0 1px 4px rgba(0,0,0,.06),0 4px 12px rgba(0,0,0,.04);
  padding: 1.5rem; margin-bottom: 1rem;
  display: flex; align-items: flex-start; gap: 1.25rem;
  transition: box-shadow .18s, transform .18s, border-color .18s;
}
.lab-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,.09); transform: translateY(-1px); border-color: #bfdbfe; }

.lab-card__icon {
  width: 3rem; height: 3rem; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 1.375rem;
  background: #eff6ff; color: #2563eb;
}
.lab-card__icon--green  { background: #f0fdf4; color: #16a34a; }
.lab-card__icon--amber  { background: #fffbeb; color: #d97706; }
.lab-card__icon--purple { background: #f5f3ff; color: #7c3aed; }

.lab-card__body { flex: 1; min-width: 0; }
.lab-card__title { font-size: 1rem; font-weight: 700; color: #0f172a; margin-bottom: .25rem; letter-spacing: -.02em; }
.lab-card__desc  { font-size: .8375rem; color: #64748b; line-height: 1.55; margin-bottom: .75rem; }
.lab-card__meta  { display: flex; align-items: center; gap: .625rem; flex-wrap: wrap; }
.lab-card__actions { display: flex; align-items: center; gap: .5rem; margin-top: .875rem; flex-wrap: wrap; }

/* ── Eval / Scoring ───────────────────────────────────────── */
.eval-score-ring {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
}
.eval-score-ring__value {
  position: absolute; font-size: 1.625rem; font-weight: 800; color: #0f172a; letter-spacing: -.04em;
}
.eval-score-ring__label { position: absolute; bottom: .75rem; font-size: .65rem; font-weight: 600; color: #64748b; text-transform: uppercase; letter-spacing: .06em; }

.eval-section { background: #fff; border-radius: 12px; border: 1px solid #e8ecf2; padding: 1.25rem 1.5rem; margin-bottom: 1rem; }
.eval-section__title { font-size: .875rem; font-weight: 700; color: #0f172a; margin-bottom: .875rem; display: flex; align-items: center; gap: .5rem; }
.eval-section__title::before { content: ''; width: 3px; height: .875rem; border-radius: 9999px; background: #3b82f6; flex-shrink: 0; }

/* ── Notifications / Alerts ───────────────────────────────── */
.notice {
  display: flex; align-items: flex-start; gap: .75rem;
  padding: .875rem 1.125rem; border-radius: 10px;
  font-size: .875rem; font-weight: 500; line-height: 1.55;
  border: 1.5px solid transparent; margin-bottom: 1.25rem;
}
.notice__icon { flex-shrink: 0; font-size: 1rem; margin-top: .05rem; }
.notice--info    { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.notice--success { background: #f0fdf4; border-color: #86efac; color: #166534; }
.notice--warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.notice--danger  { background: #fef2f2; border-color: #fca5a5; color: #991b1b; }

/* ── Empty States ─────────────────────────────────────────── */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 3rem 2rem; color: #94a3b8;
}
.empty-state__icon  { font-size: 3rem; margin-bottom: 1rem; line-height: 1; opacity: .5; }
.empty-state__title { font-size: 1rem; font-weight: 700; color: #475569; margin-bottom: .4rem; }
.empty-state__desc  { font-size: .875rem; line-height: 1.55; max-width: 28rem; }
.empty-state__cta   { margin-top: 1.25rem; }

/* ── Tabs ─────────────────────────────────────────────────── */
.tab-bar {
  display: flex; gap: .25rem;
  border-bottom: 2px solid #e8ecf2;
  margin-bottom: 1.5rem;
  overflow-x: auto;
}
.tab-bar::-webkit-scrollbar { display: none; }

.tab-btn {
  padding: .6rem 1.125rem; font-size: .875rem; font-weight: 600;
  color: #64748b; background: transparent; border: none; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: color .12s ease, border-color .12s ease;
  white-space: nowrap; font-family: inherit; border-radius: 8px 8px 0 0;
}
.tab-btn:hover { color: #334155; background: #f8fafc; }
.tab-btn.active { color: #2563eb; border-bottom-color: #2563eb; background: transparent; }

/* ── Drag handles / sortable ──────────────────────────────── */
.drag-handle {
  cursor: grab; color: #cbd5e1; font-size: 1rem;
  transition: color .12s ease;
  display: flex; align-items: center;
}
.drag-handle:hover { color: #94a3b8; }
.drag-handle:active { cursor: grabbing; }

/* ── Misc layout helpers ──────────────────────────────────── */
.flex-row   { display: flex; align-items: center; gap: .75rem; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.flex-wrap  { flex-wrap: wrap; }
.gap-sm     { gap: .5rem; }
.gap-md     { gap: 1rem; }
.gap-lg     { gap: 1.5rem; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.text-sm    { font-size: .8125rem; }
.text-xs    { font-size: .75rem; }
.text-muted { color: #64748b; }
.font-bold  { font-weight: 700; }
.font-medium{ font-weight: 500; }

/* ── Mobile sidebar ───────────────────────────────────────── */
@media (max-width: 767px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s cubic-bezier(.16,1,.3,1); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .page-content { padding: 1rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .page-hero { padding: 1.5rem; border-radius: 12px; }
  .page-hero__title { font-size: 1.25rem; }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .sidebar { width: 13.5rem; }
  .main-content { margin-left: 13.5rem; }
}

/* ------------------------------------------------------------------------------
   DARK MODE � toggled by body.dark-mode via dashboard.js localStorage preference
   ------------------------------------------------------------------------------- */
body.dark-mode {
  --sr-bg:         #0d1117;
  --sr-surface:    #161b22;
  --sr-border:     #30363d;
  --sr-text:       #e6edf3;
  --sr-text-muted: #8b949e;
  --sr-shadow-sm:  0 1px 3px rgba(0,0,0,.4), 0 1px 2px rgba(0,0,0,.3);
  --sr-shadow-md:  0 8px 24px rgba(0,0,0,.4), 0 2px 6px rgba(0,0,0,.3);
  color-scheme: dark;
}

/* Body & layout */
body.dark-mode { background: var(--sr-bg); color: var(--sr-text); }
body.dark-mode .dash-body {
  background:
    radial-gradient(1200px 480px at 95% -10%, rgba(37,99,235,.07) 0%, rgba(37,99,235,0) 60%),
    linear-gradient(180deg, #0d1117 0%, #0d1117 100%);
  color: var(--sr-text);
}

/* Topbar */
body.dark-mode .dash-topbar {
  background: rgba(22, 27, 34, .92);
  border-bottom-color: var(--sr-border);
}
body.dark-mode .dash-topbar__title { color: var(--sr-text); }
body.dark-mode .dash-topbar__toggle {
  background: var(--sr-surface);
  border-color: var(--sr-border);
  color: var(--sr-text);
}

/* Sidebar is already dark � just soften border */
body.dark-mode .dash-sidebar { border-right-color: var(--sr-border); }

/* Main content area */
body.dark-mode .dash-main { background: var(--sr-bg); }

/* Cards / sections */
body.dark-mode .dash-section {
  background: var(--sr-surface);
  border-color: var(--sr-border);
  box-shadow: var(--sr-shadow-sm);
}

/* Tables */
body.dark-mode .data-table th {
  background: #1c2230;
  color: var(--sr-text-muted);
  border-bottom-color: var(--sr-border);
}
body.dark-mode .data-table td { border-bottom-color: var(--sr-border); color: var(--sr-text); }
body.dark-mode .data-table tbody tr:hover { background: #1c2230; }

/* Form fields */
body.dark-mode .field,
body.dark-mode input[type="text"],
body.dark-mode input[type="email"],
body.dark-mode input[type="password"],
body.dark-mode input[type="date"],
body.dark-mode input[type="number"],
body.dark-mode select,
body.dark-mode textarea {
  background: #0d1117;
  border-color: var(--sr-border);
  color: var(--sr-text);
}
body.dark-mode .field::placeholder { color: var(--sr-text-muted); }
body.dark-mode label { color: var(--sr-text); }

/* Buttons */
body.dark-mode .btn {
  border-color: var(--sr-border);
  color: var(--sr-text);
  background: #1c2230;
}
body.dark-mode .btn--primary { background: #1d4ed8; color: #fff; border-color: #1d4ed8; }
body.dark-mode .btn--primary:hover { background: #2563eb; border-color: #2563eb; }
body.dark-mode .btn--secondary { background: #1c2230; color: var(--sr-text); border-color: var(--sr-border); }
body.dark-mode .btn--secondary:hover { background: #243048; }
body.dark-mode .btn--danger { background: #7f1d1d; color: #fca5a5; border-color: #991b1b; }
body.dark-mode .btn--danger:hover { background: #991b1b; }
body.dark-mode .btn--sm,
body.dark-mode .btn--xs { background: #1c2230; }

/* Flash messages */
body.dark-mode .flash--success { background: #14532d; color: #86efac; border-color: #166534; }
body.dark-mode .flash--error   { background: #7f1d1d; color: #fca5a5; border-color: #991b1b; }
body.dark-mode .flash--info    { background: #1e3a5f; color: #93c5fd; border-color: #1d4ed8; }
body.dark-mode .flash--warning { background: #78350f; color: #fcd34d; border-color: #92400e; }

/* Stats widgets */
body.dark-mode .dash-list-row__primary { color: var(--sr-text); }
body.dark-mode .dash-list-row__secondary { color: var(--sr-text-muted); }

/* Page title/subtitle */
body.dark-mode .dash-page-title  { color: var(--sr-text); }
body.dark-mode .dash-page-subtitle { color: var(--sr-text-muted); }

/* Dark mode toggle button in topbar */
body.dark-mode .dark-toggle-btn {
  background: #1c2230;
  border-color: var(--sr-border);
  color: var(--sr-text);
}

/* Session warning modal */
body.dark-mode .session-modal__box {
  background: var(--sr-surface);
  color: var(--sr-text);
  border: 1px solid var(--sr-border);
}
body.dark-mode .session-modal__overlay { background: rgba(0,0,0,.65); }

/* Links */
body.dark-mode a:not(.btn):not(.dash-nav__link):not(.dash-sidebar__brand):not(.dash-sidebar__signout) {
  color: #60a5fa;
}

/* Auth/login pages (platform/login.php etc) */
body.dark-mode .auth-box {
  background: var(--sr-surface);
  border-color: var(--sr-border);
  color: var(--sr-text);
}
body.dark-mode .auth-box h1,
body.dark-mode .auth-box label { color: var(--sr-text); }
body.dark-mode .auth-footer { color: var(--sr-text-muted); }
