/* ===========================================================================
   NextGen Innovation Accelerator — Bespoke Stylesheet
   ---------------------------------------------------------------------------
   A premium, hand-crafted design system. Dark glassmorphic surfaces,
   aurora-drift background, tabular display figures, hairline highlights,
   gradient edge-lights and glow-on-hover cards.
   Type: "Inter" for UI, "Space Grotesk" for display headings, "JetBrains Mono"
   for tabular figures (preconnected from Google Fonts in header.php).
   =========================================================================== */

:root {
  /* Brand */
  --c-primary:      #D4A017;
  --c-primary-2:    #B8860B;
  --c-accent:       #556B2F;
  --c-accent-2:     #9BAA52;
  --c-fuchsia:      #D4A017;
  --c-success:      #6B8A2A;
  --c-warning:      #D4A017;
  --c-danger:       #EF4444;
  --c-info:         #556B2F;

  /* Surfaces (deepening from 0 → 3) */
  --bg-0: #000000;
  --bg-1: #0a0a0a;
  --bg-2: #111111;
  --bg-3: #141414;
  --bg-elev:       rgba(14, 14, 14, 0.66);
  --bg-elev-strong:rgba(20, 20, 20, 0.84);
  --bg-glass:      rgba(255, 255, 255, 0.025);

  /* Text */
  --t-primary:    #f5f6fb;
  --t-secondary:  rgba(245, 246, 251, 0.78);
  --t-tertiary:   rgba(245, 246, 251, 0.55);
  --t-quaternary: rgba(245, 246, 251, 0.38);

  /* Borders & lights */
  --border-soft:    rgba(255, 255, 255, 0.06);
  --border-medium:  rgba(255, 255, 255, 0.10);
  --border-strong:  rgba(255, 255, 255, 0.16);
  --border-brand:   rgba(212, 160, 23, 0.30);
  --hairline-top:   inset 0 1px 0 rgba(255, 255, 255, 0.07);
  --hairline-soft:  inset 0 1px 0 rgba(255, 255, 255, 0.05);

  /* Spacing & radius */
  --space-xs: 4px; --space-sm: 8px; --space-md: 16px;
  --space-lg: 24px; --space-xl: 32px; --space-2xl: 48px;
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 22px; --r-2xl: 28px;

  /* Shadows */
  --shadow-1:      0 6px 18px rgba(0, 0, 0, .35);
  --shadow-2:      0 18px 44px rgba(0, 0, 0, .55);
  --shadow-3:      0 32px 80px rgba(0, 0, 0, .65);
  --shadow-brand:  0 14px 36px rgba(212, 160, 23, .42);
  --shadow-cyan:   0 14px 36px rgba(85, 107, 47, .32);
  --glow-brand:    0 0 0 1px rgba(212, 160, 23,.35), 0 18px 56px rgba(212, 160, 23,.32);

  /* Gradients */
  --grad-brand:    linear-gradient(135deg, #D4A017 0%, #B8860B 55%, #556B2F 100%);
  --grad-brand-2:  linear-gradient(135deg, #D4A017 0%, #C8A415 50%, #7A8B3A 100%);
  --grad-text:     linear-gradient(90deg, #fff 0%, #F0D86E 60%, #9BAA52 100%);
  --grad-edge:     linear-gradient(180deg, rgba(212, 160, 23,1), rgba(85, 107, 47,1));

  /* Type */
  --ff-sans:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --ff-display: 'Space Grotesk', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --ff-mono:    'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  background: #000000;
  color: var(--t-primary);
  font-family: var(--ff-sans);
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv11','ss01','ss03','ss07';
  text-rendering: optimizeLegibility;
}
a { color: #F0D86E; text-decoration: none; transition: color .15s ease; }
a:hover { color: #FBE89A; }
img, svg { max-width: 100%; display: block; }
::selection { background: rgba(212, 160, 23, 0.35); color: #fff; }

/* ── Aurora background (premium ambient layer) ──────────────────────────── */
body::before, body::after {
  content: '';
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
}
body::before {
  background:
    radial-gradient(60vw 60vw at 12% 10%, rgba(212, 160, 23, .14), transparent 60%),
    radial-gradient(50vw 55vw at 92% 8%, rgba(85, 107, 47, .12), transparent 62%),
    radial-gradient(60vw 60vw at 78% 96%, rgba(122, 139, 58, .10), transparent 60%),
    radial-gradient(45vw 50vw at 8% 100%, rgba(212, 160, 23, .08), transparent 60%),
    #000000;
  animation: auroraDrift 28s ease-in-out infinite alternate;
}
body::after {
  /* Faint film grain to kill banding & feel filmic */
  background-image:
    radial-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    radial-gradient(rgba(255,255,255,.012) 1px, transparent 1px);
  background-size: 3px 3px, 7px 7px;
  background-position: 0 0, 1px 2px;
  opacity: .55;
  mix-blend-mode: overlay;
}
@keyframes auroraDrift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(-1.5%, 0.8%, 0) scale(1.04); }
  100% { transform: translate3d(1.5%, -0.6%, 0) scale(1.02); }
}
@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
}

/* ── Brand mark ─────────────────────────────────────────────────────────── */
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px; color: #fff;
  background: var(--grad-brand);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1rem;
  box-shadow: var(--shadow-brand), var(--hairline-top);
  position: relative;
}
.brand-mark::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,.18), transparent 35%);
  pointer-events: none;
}
.brand-mark.large { width: 80px; height: 80px; border-radius: 24px; font-size: 2rem; }

/* ── Auth (login / register / installer) ───────────────────────────────── */
/* ══════════════════════════════════════════════════════════════════════════
   AUTH PAGE — Bespoke full-bleed redesign
   ══════════════════════════════════════════════════════════════════════════ */
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
  padding: 0;
  overflow: auto;
}
@media (min-width: 960px) {
  .auth-page { grid-template-columns: 1fr 1fr; }
}

/* ── Hero panel (left / top) ─────────────────────────────────────────────── */
.auth-shell {
  display: contents; /* let children be direct grid items */
}

.auth-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(28px, 5vw, 60px) clamp(24px, 5vw, 56px);
  min-height: 420px;
  overflow: hidden;
  background: #000;
}

/* ── Mobile hero: compact horizontal header strip ────────────────────────── */
@media (max-width: 959px) {
  .auth-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
  }

  .auth-hero {
    min-height: 0 !important;
    height: auto;
    justify-content: flex-start;
    padding: 28px 22px 24px;
    flex-shrink: 0;
  }

  /* Horizontal grid: icon left, title right */
  .auth-hero-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 14px;
  }

  .auth-hero-icon {
    width: 48px; height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, #D4A017, #B8860B);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; color: #000;
    box-shadow: 0 6px 20px rgba(212,160,23,.4);
    flex-shrink: 0;
  }

  .auth-hero-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
  }

  /* Hide decorative elements on mobile — keep it clean */
  .auth-tagline      { display: none; }
  .auth-stats        { display: none; }
  .auth-pitch-pill   { display: none; }
  .auth-host         { display: none; }

  .auth-brand-title {
    font-size: 1.2rem;
    line-height: 1.15;
    margin: 0;
    white-space: normal;
  }

  .auth-brand-subtitle {
    font-size: .72rem;
    color: rgba(255,255,255,.38);
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    letter-spacing: .02em;
  }

  /* Shrink orb */
  .auth-hero::after {
    width: 220px; height: 220px;
    top: -60px; right: -60px;
  }

  /* Form panel fills remaining height */
  .auth-form-wrap {
    flex: 1;
    padding: 28px 22px 40px;
    background: #080806;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
  }

  .auth-form-card { max-width: 100%; }
  .auth-form-heading { font-size: 1.3rem; }
}

/* Hide <br> tags that only apply on desktop */
@media (max-width: 959px) { .desktop-br { display: none; } }

/* Tiny phones */
@media (max-width: 400px) {
  .auth-hero { padding: 22px 18px 20px; }
  .auth-brand-title { font-size: 1.0rem; }
  .auth-hero-icon { width: 42px; height: 42px; font-size: 1rem; border-radius: 12px; }
}

/* Layered atmospheric background */
.auth-hero::before {
  content: '';
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% -10%, rgba(212,160,23,.32) 0%, transparent 55%),
    radial-gradient(ellipse 60% 50% at 100% 100%, rgba(85,107,47,.22) 0%, transparent 55%),
    radial-gradient(ellipse 100% 80% at 50% 50%, rgba(10,8,0,.7) 0%, transparent 100%),
    linear-gradient(160deg, #0d0a00 0%, #050503 60%, #000 100%);
}

/* Animated gold orb */
.auth-hero::after {
  content: '';
  position: absolute;
  width: 520px; height: 520px;
  top: -140px; right: -140px; z-index: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212,160,23,.18) 0%, rgba(184,134,11,.06) 40%, transparent 70%);
  animation: heroOrb 8s ease-in-out infinite alternate;
}
@keyframes heroOrb {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(-30px, 30px) scale(1.08); }
}

/* Grid overlay texture */
.auth-hero-grid {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(212,160,23,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(212,160,23,.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 90% 90% at 50% 50%, black 20%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 90% 90% at 50% 50%, black 20%, transparent 100%);
}

/* Diagonal accent line */
.auth-hero-line {
  position: absolute; z-index: 0; pointer-events: none;
  top: 0; left: 0; width: 100%; height: 100%;
  overflow: hidden;
}
.auth-hero-line::before {
  content: '';
  position: absolute;
  width: 1px; height: 200%;
  top: -50%; left: 38%;
  background: linear-gradient(180deg, transparent 0%, rgba(212,160,23,.18) 40%, rgba(212,160,23,.06) 70%, transparent 100%);
  transform: rotate(-18deg);
  transform-origin: center;
}

/* All hero content above pseudo-elements */
.auth-hero-content {
  position: relative; z-index: 1;
}

/* Programme badge / eyebrow */
.auth-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 13px 5px 5px;
  background: rgba(212,160,23,.08);
  border: 1px solid rgba(212,160,23,.22);
  border-radius: 100px;
  font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: #E8C547;
  margin-bottom: 22px;
  animation: fadeUp .6s ease both;
}
/* Hide eyebrow pill on mobile — defined here (after base rule) to win cascade */
@media (max-width: 959px) {
  .auth-eyebrow { display: none; }
}
.auth-eyebrow-dot {
  width: 20px; height: 20px; border-radius: 50%;
  background: linear-gradient(135deg, #D4A017, #B8860B);
  display: flex; align-items: center; justify-content: center;
  font-size: .6rem; color: #000; flex-shrink: 0;
}

.auth-brand-title {
  font-family: 'Playfair Display', 'Georgia', serif;
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.0;
  margin: 0 0 14px;
  color: #fff;
  animation: fadeUp .6s .1s ease both;
}
/* Gold word highlight */
.auth-brand-title em {
  font-style: normal;
  background: linear-gradient(90deg, #F0D86E 0%, #D4A017 50%, #9BAA52 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.auth-tagline {
  font-size: clamp(.9rem, 1.8vw, 1.05rem);
  color: rgba(255,255,255,.45);
  line-height: 1.6;
  max-width: 38ch;
  margin-bottom: 32px;
  animation: fadeUp .6s .2s ease both;
}

/* Stats row */
.auth-stats {
  display: flex; gap: 0;
  margin-bottom: 34px;
  animation: fadeUp .6s .3s ease both;
}
.auth-stat {
  flex: 1;
  padding: 14px 0 14px;
  border-top: 1px solid rgba(255,255,255,.08);
  border-right: 1px solid rgba(255,255,255,.06);
}
.auth-stat:last-child { border-right: none; }
.auth-stat-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.6rem; font-weight: 700;
  color: #E8C547; letter-spacing: -.03em; line-height: 1;
  display: block;
}
.auth-stat-label {
  font-size: .68rem; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: rgba(255,255,255,.35);
  display: block; margin-top: 3px;
}

/* Pitch date pill */
.auth-pitch-pill {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 12px;
  font-size: .8rem; color: rgba(255,255,255,.55);
  animation: fadeUp .6s .4s ease both;
}
.auth-pitch-pill strong { color: #fff; font-weight: 600; }
.auth-pitch-date {
  background: linear-gradient(135deg, #D4A017, #B8860B);
  color: #000; font-weight: 800; font-size: .7rem;
  padding: 3px 9px; border-radius: 6px; letter-spacing: .04em;
}

/* Institution line */
.auth-host {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,.07);
  color: rgba(255,255,255,.3);
  font-size: .76rem;
  display: flex; align-items: center; gap: 8px;
  animation: fadeUp .6s .5s ease both;
}
.auth-host i { color: rgba(212,160,23,.5); }

/* Hide old bullet list */
.auth-bullets { display: none; }

/* ── Form panel (right / bottom) ─────────────────────────────────────────── */
.auth-form-wrap {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  padding: clamp(28px, 5vw, 56px) clamp(20px, 5vw, 52px);
  background: #080806;
  position: relative;
  overflow: visible;
}
.auth-form-wrap::before {
  content: '';
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 70% 50% at 100% 0%, rgba(212,160,23,.07), transparent 60%);
}

.auth-form-card {
  width: 100%; max-width: 420px;
  margin: 0 auto;
  position: relative; z-index: 1;
}

/* Form heading */
.auth-form-heading {
  font-family: 'Playfair Display', 'Georgia', serif;
  font-size: 1.55rem; font-weight: 800;
  color: #fff; letter-spacing: -.02em;
  margin-bottom: 4px;
}
.auth-form-sub {
  font-size: .82rem; color: rgba(255,255,255,.38);
  margin-bottom: 24px;
}

/* Pill tabs */
.auth-tabs {
  display: flex; gap: 0;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 26px;
}
.auth-tabs a {
  flex: 1; text-align: center;
  padding: 9px 12px; border-radius: 9px;
  color: rgba(255,255,255,.38); font-size: .84rem; font-weight: 600;
  transition: color .18s, background .18s, box-shadow .18s;
}
.auth-tabs a:hover { color: rgba(255,255,255,.7); }
.auth-tabs a.active {
  background: rgba(212,160,23,.12);
  color: #E8C547;
  box-shadow: inset 0 0 0 1px rgba(212,160,23,.25);
}

.auth-footer {
  text-align: center;
  color: rgba(255,255,255,.2);
  font-size: .72rem;
  margin-top: 28px;
}

/* Hide desktop icon on mobile (the auth-hero-icon is used instead) */
@media (min-width: 960px) {
  .auth-hero-icon   { display: none; }
  .auth-hero-text   { display: contents; } /* transparent wrapper on desktop */
  .auth-brand-subtitle { display: none; }
  .auth-brand-title {
    /* Restore desktop multi-line style */
    white-space: normal;
    font-size: clamp(2.4rem, 5vw, 3.6rem);
    margin: 0 0 14px;
  }
}

/* Shared entrance animation */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Forms ──────────────────────────────────────────────────────────────── */
.form-group { display: grid; gap: 6px; margin-bottom: 14px; }
.form-grid-2 { display: grid; gap: 14px; }
@media (min-width: 540px) { .form-grid-2 { grid-template-columns: 1fr 1fr; } }
.form-grid-3 { display: grid; gap: 14px; }
@media (min-width: 720px) { .form-grid-3 { grid-template-columns: 1fr 1fr 1fr; } }

.form-label {
  font-size: .76rem; color: var(--t-tertiary); font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase;
}
.form-input, .form-textarea, .form-select {
  width: 100%; padding: 12px 14px;
  background: rgba(0, 0, 0, .42);
  color: var(--t-primary);
  border: 1px solid var(--border-medium);
  border-radius: 12px;
  font-family: inherit; font-size: .94rem;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.form-input::placeholder, .form-textarea::placeholder { color: rgba(255,255,255,.32); }
.form-textarea { min-height: 124px; resize: vertical; }
.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none;
  border-color: rgba(212, 160, 23, .65);
  background: rgba(0,0,0,.52);
  box-shadow: 0 0 0 4px rgba(212, 160, 23, .18);
}
.form-input:hover:not(:focus), .form-textarea:hover:not(:focus), .form-select:hover:not(:focus) {
  border-color: var(--border-strong);
}
.form-check {
  display: flex; align-items: center; gap: 10px;
  font-size: .88rem; color: var(--t-secondary);
  margin: 6px 0 14px; cursor: pointer; user-select: none;
}
.form-check input { accent-color: var(--c-primary-2); width: 16px; height: 16px; }

.pw-wrap { position: relative; display: flex; align-items: center; }
.pw-wrap .form-input { padding-right: 46px; }
.pw-toggle {
  position: absolute; right: 8px; background: none; border: none;
  color: var(--t-tertiary); cursor: pointer; padding: 6px;
  width: 34px; height: 34px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  transition: color .15s ease, background .15s ease;
}
.pw-toggle:hover { color: #fff; background: rgba(255, 255, 255, .06); }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 12px; border: 1px solid transparent;
  font-family: inherit; font-size: .9rem; font-weight: 600;
  letter-spacing: -0.005em; cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, background .15s ease,
              border-color .15s ease, color .15s ease;
  text-decoration: none; line-height: 1; white-space: nowrap;
  position: relative; overflow: hidden;
}
.btn:focus-visible { outline: 2px solid var(--c-accent-2); outline-offset: 2px; }
.btn:active { transform: translateY(1px); }
.btn i { font-size: .92em; }

.btn-primary {
  background: var(--grad-brand);
  color: #fff;
  box-shadow: var(--shadow-brand), var(--hairline-top);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 18px 44px rgba(212, 160, 23, .55), var(--hairline-top); }

.btn-secondary {
  background: rgba(255, 255, 255, .06); color: #fff;
  border-color: var(--border-medium);
  backdrop-filter: blur(8px);
}
.btn-secondary:hover { background: rgba(255, 255, 255, .12); border-color: var(--border-strong); }

.btn-success { background: linear-gradient(135deg, #3E5519, #6B8A2A); color: #fff; box-shadow: 0 10px 24px rgba(85, 107, 47,.32); }
.btn-warning { background: linear-gradient(135deg, #B8860B, #D4A017); color: #1a1500; box-shadow: 0 10px 24px rgba(212, 160, 23,.30); }
.btn-danger  { background: linear-gradient(135deg, #dc2626, #EF4444); color: #fff; box-shadow: 0 10px 24px rgba(239,68,68,.32); }
.btn-ghost   { background: transparent; color: var(--t-secondary); border-color: var(--border-medium); }
.btn-ghost:hover { background: rgba(255, 255, 255, .06); color: #fff; border-color: var(--border-strong); }

.btn-block { width: 100%; }
.btn-lg { padding: 14px 20px; font-size: .98rem; border-radius: 13px; }
.btn-sm { padding: 7px 12px; font-size: .78rem; border-radius: 9px; }

/* ── Alerts ─────────────────────────────────────────────────────────────── */
.alert {
  padding: 13px 15px; border-radius: 12px; margin-bottom: 16px;
  font-size: .9rem; display: flex; gap: 12px; align-items: flex-start;
  background: rgba(255,255,255,.02);
  border: 1px solid var(--border-medium);
  box-shadow: var(--hairline-soft);
}
.alert i { margin-top: 2px; flex-shrink: 0; font-size: 1rem; }
.alert-info    { background: rgba(85, 107, 47, .10);  color: #9BAA52; border-color: rgba(85, 107, 47, .30); }
.alert-success { background: rgba(85, 107, 47, .10);  color: #7A8B3A; border-color: rgba(85, 107, 47, .30); }
.alert-warning { background: rgba(212, 160, 23, .10); color: #FACC15; border-color: rgba(212, 160, 23, .30); }
.alert-danger  { background: rgba(239, 68, 68, .10);  color: #f87171; border-color: rgba(239, 68, 68, .32); }

/* ── Page-level layout primitives ───────────────────────────────────────── */
.page-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 24px;
}
.page-title {
  font-family: var(--ff-display);
  font-size: clamp(1.5rem, 3vw, 1.85rem); font-weight: 700;
  letter-spacing: -0.025em; line-height: 1.1; margin: 0;
  background: var(--grad-text);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.page-subtitle { color: var(--t-tertiary); font-size: .92rem; margin-top: 6px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Card system (premium) ─────────────────────────────────────────────── */
.card {
  position: relative;
  background: var(--bg-elev);
  border: 1px solid var(--border-medium);
  border-radius: var(--r-lg);
  padding: 22px;
  min-width: 0; /* prevent intrinsic content (canvas, wide tables) from
                   forcing the card past its grid track on mobile */
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  box-shadow: var(--shadow-1), var(--hairline-top);
  transition: border-color .2s ease, transform .2s ease, box-shadow .25s ease;
}
.card:hover {
  border-color: var(--border-strong);
}
.card-title {
  font-family: var(--ff-display);
  font-size: 1.05rem; font-weight: 600;
  letter-spacing: -0.015em; margin: 0 0 12px; color: #fff;
  display: flex; align-items: center; gap: 8px;
}
.card-title i { color: #E8C547; }
.card-subtitle { color: var(--t-tertiary); font-size: .86rem; margin-top: -8px; margin-bottom: 14px; }
.card-glow { box-shadow: var(--shadow-2), var(--glow-brand); }

/* ── Hero / welcome strip ──────────────────────────────────────────────── */
.welcome-card {
  position: relative; overflow: hidden;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(232, 184, 50,.28), transparent 55%),
    radial-gradient(80% 100% at 100% 100%, rgba(122, 139, 58,.18), transparent 60%),
    linear-gradient(135deg, rgba(212, 160, 23, .14), rgba(15, 17, 32, .65));
  border: 1px solid var(--border-brand);
  border-radius: var(--r-2xl);
  padding: 28px;
  display: grid; gap: 18px; grid-template-columns: 1fr;
  margin-bottom: 24px;
  box-shadow: var(--shadow-2), var(--hairline-top);
}
@media (min-width: 720px) { .welcome-card { grid-template-columns: 1fr auto; align-items: center; padding: 32px; } }
.welcome-card::after {
  content: ''; position: absolute; top: -45%; right: -8%;
  width: 380px; height: 380px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(212, 160, 23, .42), transparent 70%);
  pointer-events: none; filter: blur(2px);
}
.welcome-card::before {
  content: ''; position: absolute; bottom: -50%; left: -10%;
  width: 320px; height: 320px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(85, 107, 47, .32), transparent 70%);
  pointer-events: none; filter: blur(4px);
}
.welcome-greeting {
  font-family: var(--ff-display);
  font-size: clamp(1.5rem, 3vw, 1.9rem); font-weight: 700;
  letter-spacing: -0.025em; margin: 0; line-height: 1.15;
  position: relative; z-index: 1;
}
.welcome-greeting span {
  background: linear-gradient(90deg, #F0D86E, #9BAA52);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.welcome-meta {
  color: var(--t-secondary); font-size: .92rem; margin-top: 6px;
  position: relative; z-index: 1;
}

/* ══════════════════════════════════════════════════════════════════════════
     Heroes — fixed 180px tall, sleek, single-block layout.
     Shared visual language for both:
       • Student   .hero-pro    (eyebrow + title + meta + countdown + buttons | gauge)
       • Admin     .cohort-hero (eyebrow+arc | title | meta | next+countdown | buttons)
     On mobile (≤620px) the gauge collapses into a small corner badge so the
     180px envelope is preserved without sacrificing readable content.
     ══════════════════════════════════════════════════════════════════════════ */

  /* ── Student hero (.hero-pro) ─────────────────────────────────────────── */
  .hero-pro {
    position: relative; overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 22px;
    height: 180px;
    padding: 14px 22px;
    margin-bottom: 18px;
    background:
      radial-gradient(120% 140% at 100% 0%, rgba(232,184,50,.20), transparent 55%),
      radial-gradient(80% 100% at 0% 100%, rgba(122,139,58,.14), transparent 60%),
      linear-gradient(160deg, rgba(212,160,23,.08), rgba(15,17,32,.78));
    border: 1px solid var(--border-brand);
    border-radius: var(--r-2xl);
    box-shadow: var(--shadow-2), var(--hairline-top);
  }
  .hero-pro-left  {
    min-width: 0; height: 100%;
    display: flex; flex-direction: column; justify-content: center;
    gap: 5px;
  }
  .hero-pro-left > * { margin: 0; }
  .hero-pro-right { display: flex; align-items: center; justify-content: center; }

  .hero-eyebrow {
    display: inline-flex; align-self: flex-start; align-items: center; gap: 6px;
    padding: 3px 9px; border-radius: 999px;
    background: rgba(232,184,50,.12);
    border: 1px solid rgba(232,184,50,.32);
    color: #F0D86E;
    font-size: .64rem; font-weight: 700; letter-spacing: .1em;
    text-transform: uppercase; line-height: 1;
  }
  .hero-eyebrow .dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: #E8C547;
    box-shadow: 0 0 0 0 rgba(232,197,71,.55);
    animation: heroPulseDot 1.6s ease-out infinite;
  }
  @keyframes heroPulseDot {
    0%   { box-shadow: 0 0 0 0 rgba(232,197,71,.55); }
    70%  { box-shadow: 0 0 0 7px rgba(232,197,71,0); }
    100% { box-shadow: 0 0 0 0 rgba(232,197,71,0); }
  }
  @media (prefers-reduced-motion: reduce) { .hero-eyebrow .dot { animation: none; } }

  .hero-title {
    font-family: var(--ff-display);
    font-size: clamp(1.05rem, 2.2vw, 1.45rem);
    font-weight: 800; line-height: 1.18;
    color: #fff; letter-spacing: -0.02em;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .hero-title span {
    background: linear-gradient(90deg, #F0D86E, #9BAA52);
    -webkit-background-clip: text; background-clip: text; color: transparent;
  }
  .hero-meta {
    color: var(--t-secondary);
    font-size: .76rem; line-height: 1.3;
    display: flex; align-items: center; gap: 4px; flex-wrap: nowrap;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    min-width: 0;
  }
  .hero-meta i { color: #E8C547; margin-right: 4px; font-size: .72rem; }
  .hero-meta strong { color: #fff; font-weight: 600; }

  /* Inline mono countdown — chips become tight inline numbers (00d 00h …) */
  .countdown-row {
    display: inline-flex; align-items: baseline; gap: 4px; flex-wrap: wrap;
    font-family: var(--ff-display);
    font-variant-numeric: tabular-nums;
    font-size: .92rem; color: #fff;
    min-width: 0;
  }
  .countdown-row .cd-chip {
    display: inline-flex; align-items: baseline; gap: 0;
    padding: 0; background: none; border: 0; box-shadow: none; min-width: 0;
  }
  .countdown-row .cd-chip b {
    font-weight: 800; letter-spacing: -0.02em; color: #fff; line-height: 1;
  }
  .countdown-row .cd-chip i {
    font-style: normal; font-weight: 700; color: #E8C547;
    font-size: .65em; margin-left: 1px; text-transform: lowercase;
  }
  .countdown-row .cd-sep {
    color: var(--t-quaternary); font-weight: 700;
    margin: 0 2px; line-height: 1;
  }
  .countdown-row .cd-target {
    display: inline-flex; align-items: center; gap: 5px;
    margin-left: 8px; padding-left: 10px;
    border-left: 1px solid var(--border-soft);
    font-family: var(--ff-body);
    color: var(--t-secondary); font-size: .76rem; font-weight: 500;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    min-width: 0; max-width: 100%;
  }
  .countdown-row .cd-target i { color: #E8C547; font-size: .72rem; }
  .countdown-row .cd-target strong { color: #fff; font-weight: 600; }

  .cd-finished {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 12px; border-radius: var(--r-lg);
    background: rgba(155,170,82,.12);
    border: 1px solid rgba(155,170,82,.35);
    color: #C5D480; font-weight: 600; font-size: .82rem;
    align-self: flex-start;
  }
  .cd-finished i { color: #E8C547; }

  /* Compact action buttons — scoped so we don't shrink global .btn */
  .hero-actions { display: inline-flex; gap: 8px; flex-wrap: wrap; align-items: center; }
  .hero-actions .btn { padding: 6px 12px; font-size: .8rem; }
  .hero-actions .btn i { font-size: .78rem; }

  /* Circular gauge (right column) */
  .gauge {
    position: relative;
    width: 140px; height: 140px;
    flex-shrink: 0;
  }
  .gauge svg { width: 100%; height: 100%; transform: rotate(-90deg); display: block; }
  .gauge .track { fill: none; stroke: rgba(255,255,255,.06); stroke-width: 11; }
  .gauge .fill {
    fill: none; stroke: url(#gaugeGrad); stroke-width: 11; stroke-linecap: round;
    filter: drop-shadow(0 0 8px rgba(232,197,71,.35));
    transition: stroke-dashoffset 1.1s cubic-bezier(.4,0,.2,1);
  }
  .gauge-center {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; padding: 6px;
  }
  .gauge-pct {
    font-family: var(--ff-display);
    font-variant-numeric: tabular-nums;
    font-size: 1.85rem; font-weight: 800; line-height: 1; letter-spacing: -0.03em;
    background: linear-gradient(180deg, #fff, #F0D86E);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  }
  .gauge-pct sup {
    font-size: .75rem; font-weight: 700; color: #E8C547;
    -webkit-text-fill-color: #E8C547; margin-left: 2px;
  }
  .gauge-lbl {
    margin-top: 4px;
    font-size: .58rem; font-weight: 700; letter-spacing: .14em;
    color: var(--t-tertiary); text-transform: uppercase;
  }
  .gauge-meta {
    margin-top: 2px;
    font-size: .68rem; color: var(--t-secondary);
    font-variant-numeric: tabular-nums;
  }

  /* Mobile: gauge slides into the corner; left column gets full width */
  @media (max-width: 620px) {
    .hero-pro {
      grid-template-columns: minmax(0, 1fr);
      padding: 12px 14px;
      gap: 0;
    }
    .hero-pro-right {
      position: absolute; top: 10px; right: 10px;
    }
    .gauge { width: 56px; height: 56px; }
    .gauge .track, .gauge .fill { stroke-width: 9; }
    .gauge-pct { font-size: .92rem; }
    .gauge-pct sup { font-size: .55rem; }
    .gauge-lbl, .gauge-meta { display: none; }
    .hero-pro-left { padding-right: 64px; }
    .hero-title { white-space: normal;
      display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
      font-size: 1rem; line-height: 1.2;
    }
    .hero-meta { font-size: .72rem; }
    .countdown-row { font-size: .82rem; }
    .countdown-row .cd-target {
      padding-left: 0; margin-left: 0; border-left: 0;
      flex-basis: 100%; min-width: 0;
    }
    .hero-actions .btn { padding: 5px 10px; font-size: .75rem; }
  }

  /* ── Admin hero (.cohort-hero) — same 180px envelope, BEM markup ──────── */
  .cohort-hero {
    position: relative; overflow: hidden;
    height: 180px;
    padding: 14px 22px;
    margin-bottom: 18px;
    display: flex; flex-direction: column; justify-content: center;
    gap: 6px;
    background:
      radial-gradient(120% 140% at 100% 0%, rgba(232,184,50,.20), transparent 55%),
      radial-gradient(80% 100% at 0% 100%, rgba(122,139,58,.14), transparent 60%),
      linear-gradient(160deg, rgba(212,160,23,.08), rgba(15,17,32,.78));
    border: 1px solid var(--border-brand);
    border-radius: var(--r-2xl);
    box-shadow: var(--shadow-2), var(--hairline-top);
  }
  .cohort-hero__bg { display: none; } /* decorative SVG curve removed in 180px design */
  .cohort-hero > * { position: relative; z-index: 1; margin: 0; }

  .cohort-hero__top {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    min-width: 0;
  }
  .cohort-hero__pulse {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 9px; border-radius: 999px;
    background: rgba(232,184,50,.12);
    border: 1px solid rgba(232,184,50,.32);
    color: #F0D86E;
    font-size: .64rem; font-weight: 700; letter-spacing: .1em;
    text-transform: uppercase; line-height: 1;
  }
  .cohort-hero__pulse .dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: #E8C547;
    box-shadow: 0 0 0 0 rgba(232,197,71,.55);
    animation: heroPulseDot 1.6s ease-out infinite;
  }
  @media (prefers-reduced-motion: reduce) { .cohort-hero__pulse .dot { animation: none; } }

  /* Compact arc-progress badge (top-right) */
  .cohort-hero__progress {
    position: relative;
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 10px 3px 6px;
    background: rgba(0,0,0,.32);
    border: 1px solid var(--border-soft);
    border-radius: 999px;
  }
  .cohort-hero__progress svg { width: 38px; height: 22px; overflow: visible; display: block; }
  .cohort-hero__progress .arc-track {
    fill: none; stroke: rgba(255,255,255,.08); stroke-width: 5; stroke-linecap: round;
  }
  .cohort-hero__progress .arc-fill {
    fill: none; stroke: url(#arcGrad); stroke-width: 5; stroke-linecap: round;
    filter: drop-shadow(0 0 4px rgba(232,197,71,.45));
    transition: stroke-dashoffset 1s cubic-bezier(.4,0,.2,1);
  }
  .cohort-hero__pct {
    font-family: var(--ff-display);
    font-variant-numeric: tabular-nums;
    font-size: .92rem; font-weight: 800; line-height: 1;
    background: linear-gradient(180deg, #fff, #F0D86E);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  }
  .cohort-hero__pct sup { font-size: .55rem; opacity: .85; margin-left: 1px; vertical-align: top; -webkit-text-fill-color: #E8C547; }

  .cohort-hero__title {
    font-family: var(--ff-display);
    font-size: clamp(1.1rem, 2.4vw, 1.55rem);
    font-weight: 800; line-height: 1.15; letter-spacing: -0.02em;
    color: #fff;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .cohort-hero__title span {
    background: linear-gradient(90deg, #F0D86E, #9BAA52);
    -webkit-background-clip: text; background-clip: text; color: transparent;
  }

  .cohort-hero__meta {
    list-style: none; padding: 0;
    display: flex; align-items: center; gap: 0; flex-wrap: nowrap;
    font-size: .74rem; color: var(--t-secondary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    min-width: 0;
  }
  .cohort-hero__meta li {
    display: inline-flex; align-items: center; gap: 5px;
    flex-shrink: 1; min-width: 0;
  }
  .cohort-hero__meta li:not(:last-child)::after {
    content: '·'; color: var(--t-tertiary); margin: 0 8px; font-weight: 700;
  }
  .cohort-hero__meta li i { color: #E8C547; font-size: .72rem; }
  .cohort-hero__meta li strong { color: #fff; font-weight: 600; }
  .cohort-hero__meta-records { color: #9BAA52 !important; }
  .cohort-hero__meta-records i { color: #9BAA52 !important; }

  /* Strip: next session line + inline mono countdown */
  .cohort-hero__strip {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    min-width: 0;
  }
  .cohort-hero__strip--done {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 5px 12px; border-radius: var(--r-lg);
    background: rgba(155,170,82,.12);
    border: 1px solid rgba(155,170,82,.35);
    color: #C5D480; font-weight: 600; font-size: .8rem;
    align-self: flex-start;
  }
  .cohort-hero__strip--done i { color: #9BAA52; margin-right: 4px; }

  .cohort-hero__next {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: .76rem; color: var(--t-secondary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
  }
  .cohort-hero__next-lbl {
    font-size: .6rem; font-weight: 700; letter-spacing: .12em;
    color: #E8C547; text-transform: uppercase;
    padding: 2px 6px; border-radius: 4px;
    background: rgba(232,184,50,.12);
  }
  .cohort-hero__next-name { color: #fff; font-weight: 600; }
  .cohort-hero__next-when { color: var(--t-tertiary); }

  .cohort-hero__cd {
    display: inline-flex; align-items: baseline; gap: 2px;
    font-family: var(--ff-display);
    font-variant-numeric: tabular-nums;
    font-size: .92rem; color: #fff;
    padding: 4px 10px; border-radius: 999px;
    background: rgba(0,0,0,.32); border: 1px solid var(--border-soft);
    margin-left: auto;
  }
  .cohort-hero__cd .cd-seg { display: inline-flex; align-items: baseline; }
  .cohort-hero__cd .cd-seg b {
    font-weight: 800; color: #fff; letter-spacing: -0.02em; line-height: 1;
  }
  .cohort-hero__cd .cd-seg i {
    font-style: normal; color: #E8C547; font-weight: 700;
    font-size: .6em; margin-left: 1px; text-transform: lowercase;
  }
  .cohort-hero__cd .cd-sep {
    color: var(--t-quaternary); margin: 0 2px; font-weight: 700; line-height: 1;
  }

  .cohort-hero__actions {
    display: inline-flex; gap: 8px; flex-wrap: wrap; align-items: center;
  }
  .cohort-hero__actions .btn { padding: 6px 12px; font-size: .8rem; }
  .cohort-hero__actions .btn i { font-size: .78rem; }

  @media (max-width: 620px) {
    .cohort-hero { padding: 12px 14px; gap: 5px; }
    .cohort-hero__title { white-space: normal;
      display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical;
      font-size: 1.05rem;
    }
    .cohort-hero__meta { font-size: .68rem; }
    .cohort-hero__meta li:not(:last-child)::after { margin: 0 5px; }
    .cohort-hero__strip { gap: 8px; }
    .cohort-hero__cd { margin-left: 0; padding: 3px 8px; font-size: .82rem; }
    .cohort-hero__next { font-size: .7rem; }
    .cohort-hero__actions .btn { padding: 5px 10px; font-size: .74rem; }
    .cohort-hero__progress { padding: 2px 8px 2px 4px; }
    .cohort-hero__progress svg { width: 30px; height: 18px; }
  }
  @media (max-width: 400px) {
    .cohort-hero__meta li:nth-child(n+3) { display: none; }
    .cohort-hero__next { max-width: 60%; }
  }

/* ══════════════════════════════════════════════════════════════════════════
   Cohort Leaderboard — bespoke podium + compact list.
   Top three are shown as a 2-1-3 podium (#1 raised, gold) with avatar,
   name, sessions/hours stats and a progress bar. Ranks 4+ render as a
   tight horizontal row with stats inline.
   ══════════════════════════════════════════════════════════════════════════ */
.lb-card { display: flex; flex-direction: column; min-width: 0; }
.lb-card .card-title { margin-bottom: 4px; }
.lb-card .card-subtitle { margin-bottom: 16px; }

.lb-empty {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 36px 18px; border-radius: var(--r-lg);
  border: 1px dashed var(--border-medium);
  color: var(--t-tertiary); font-size: .9rem;
  background: rgba(255,255,255,.015);
}
.lb-empty i { color: #E8C547; font-size: 1rem; }

/* ── Podium ────────────────────────────────────────────────────────────── */
.lb-podium {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px;
  align-items: end;
  margin-bottom: 14px;
  min-width: 0;
}
.lb-pod {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  padding: 36px 12px 14px;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.015)),
    rgba(0,0,0,.32);
  border: 1px solid var(--border-medium);
  box-shadow: var(--hairline-top);
  min-width: 0;
  transition: transform .2s ease, border-color .2s ease, box-shadow .25s ease;
}
.lb-pod:hover { transform: translateY(-2px); border-color: var(--border-brand); }
.lb-pod::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--rank-grad, linear-gradient(90deg, #6b7280, #9ca3af));
  opacity: .9;
}
.lb-pod--1 {
  --rank-grad: linear-gradient(90deg, #B8860B, #F0D86E, #B8860B);
  border-color: rgba(232, 184, 50,.45);
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(232, 184, 50,.20), transparent 60%),
    linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.015)),
    rgba(0,0,0,.36);
  transform: translateY(-12px);
  box-shadow: 0 14px 32px rgba(212, 160, 23,.22), var(--hairline-top);
}
.lb-pod--2 {
  --rank-grad: linear-gradient(90deg, #C0C0C0, #E8E8E8, #C0C0C0);
  border-color: rgba(220, 220, 230,.30);
}
.lb-pod--3 {
  --rank-grad: linear-gradient(90deg, #B87333, #E0A875, #B87333);
  border-color: rgba(184, 115, 51,.35);
}

.lb-pod-medal {
  position: absolute; top: 8px; left: 8px;
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--ff-display); font-weight: 800; font-size: .82rem; line-height: 1;
  background: rgba(0,0,0,.55);
  color: #E5E7EB;
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: var(--hairline-top);
}
.lb-pod--1 .lb-pod-medal {
  background: linear-gradient(135deg, #F0D86E, #B8860B);
  color: #1a1300; border-color: rgba(232, 184, 50,.7);
  box-shadow: 0 4px 10px rgba(212, 160, 23,.45);
}
.lb-pod--2 .lb-pod-medal {
  background: linear-gradient(135deg, #F2F3F5, #B9BDC4);
  color: #1f2328; border-color: rgba(255,255,255,.5);
}
.lb-pod--3 .lb-pod-medal {
  background: linear-gradient(135deg, #E0A875, #B87333);
  color: #1a0e00; border-color: rgba(224, 168, 117,.6);
}

.lb-pod-avatar { margin-bottom: 8px; }
.lb-pod-avatar .avatar {
  width: 46px; height: 46px; font-size: .95rem;
  border: 2px solid rgba(255,255,255,.10);
}
.lb-pod--1 .lb-pod-avatar .avatar {
  width: 54px; height: 54px; font-size: 1.05rem;
  border-color: rgba(232, 184, 50,.55);
  box-shadow: 0 6px 16px rgba(212, 160, 23,.35);
}

.lb-pod-name {
  font-weight: 700; font-size: .9rem; color: #fff;
  line-height: 1.2; margin-top: 2px;
  max-width: 100%;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.lb-pod-handle {
  color: var(--t-tertiary); font-size: .7rem; margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}

.lb-pod-stats {
  display: flex; align-items: stretch; gap: 8px;
  margin-top: 12px; width: 100%;
}
.lb-pod-stat {
  flex: 1 1 0; min-width: 0;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 4px; border-radius: 10px;
  background: rgba(0,0,0,.30);
  border: 1px solid var(--border-soft);
}
.lb-pod-stat b {
  font-family: var(--ff-display);
  font-variant-numeric: tabular-nums;
  font-weight: 700; font-size: .98rem; line-height: 1; color: #fff;
  letter-spacing: -0.01em;
}
.lb-pod-stat b span { color: var(--t-tertiary); font-weight: 600; font-size: .7rem; margin-left: 1px; }
.lb-pod-stat em {
  font-style: normal;
  font-size: .58rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--t-tertiary);
}
.lb-pod--1 .lb-pod-stat b {
  background: linear-gradient(90deg, #fff, #F0D86E);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.lb-pod-bar {
  margin-top: 10px; width: 100%;
  height: 4px; border-radius: 4px;
  background: rgba(255,255,255,.06);
  overflow: hidden;
}
.lb-pod-bar > span {
  display: block; height: 100%;
  background: linear-gradient(90deg, #B8860B, #E8C547, #9BAA52);
  border-radius: inherit;
  transition: width .9s cubic-bezier(.4, 0, .2, 1);
}
.lb-pod--2 .lb-pod-bar > span { background: linear-gradient(90deg, #B9BDC4, #F2F3F5); }
.lb-pod--3 .lb-pod-bar > span { background: linear-gradient(90deg, #B87333, #E0A875); }

/* ── List rows (rank 4+) ───────────────────────────────────────────────── */
.lb-list {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 8px;
}
.lb-row {
  position: relative; overflow: hidden;
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center; gap: 12px;
  padding: 10px 14px;
  background: rgba(255,255,255,.02);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  min-width: 0;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.lb-row:hover { background: rgba(212, 160, 23,.06); border-color: var(--border-brand); transform: translateX(2px); }
.lb-row-rank {
  font-family: var(--ff-display); font-weight: 700;
  font-size: .82rem; color: var(--t-tertiary);
  font-variant-numeric: tabular-nums;
  min-width: 26px;
}
.lb-row-avatar { width: 32px !important; height: 32px !important; font-size: .76rem !important; }
.lb-row-id { min-width: 0; }
.lb-row-name {
  font-weight: 600; font-size: .86rem; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lb-row-handle {
  color: var(--t-tertiary); font-size: .72rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lb-row-stats {
  display: inline-flex; gap: 8px; flex-shrink: 0;
}
.lb-row-stat {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .78rem; color: var(--t-secondary);
  font-variant-numeric: tabular-nums;
  padding: 4px 9px; border-radius: 999px;
  background: rgba(0,0,0,.32);
  border: 1px solid var(--border-soft);
}
.lb-row-stat i { color: #E8C547; font-size: .72rem; }
.lb-row-bar {
  position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: rgba(255,255,255,.04);
  pointer-events: none;
}
.lb-row-bar > span {
  display: block; height: 100%;
  background: linear-gradient(90deg, #B8860B, #9BAA52);
  transition: width .9s cubic-bezier(.4, 0, .2, 1);
}

.lb-footer { margin-top: auto; padding-top: 14px; text-align: right; }

/* Mobile: stack stats below name on narrow rows; tighten podium */
@media (max-width: 620px) {
  .lb-podium { gap: 7px; }
  .lb-pod { padding: 30px 8px 12px; border-radius: 14px; }
  .lb-pod--1 { transform: translateY(-8px); }
  .lb-pod-avatar .avatar { width: 40px; height: 40px; font-size: .82rem; }
  .lb-pod--1 .lb-pod-avatar .avatar { width: 46px; height: 46px; font-size: .9rem; }
  .lb-pod-name { font-size: .78rem; }
  .lb-pod-handle { font-size: .64rem; }
  .lb-pod-stats { gap: 5px; margin-top: 9px; }
  .lb-pod-stat { padding: 5px 3px; border-radius: 8px; }
  .lb-pod-stat b { font-size: .82rem; }
  .lb-pod-stat b span { font-size: .6rem; }
  .lb-pod-stat em { font-size: .5rem; letter-spacing: .06em; }
  .lb-pod-medal { width: 22px; height: 22px; font-size: .72rem; top: 6px; left: 6px; }

  .lb-row { grid-template-columns: auto auto 1fr; padding: 9px 12px; gap: 10px; }
  .lb-row-stats { grid-column: 1 / -1; justify-content: flex-end; }
  .lb-row-stat { font-size: .72rem; padding: 3px 8px; }
}

/* ══════════════════════════════════════════════════════════════════════════
   Programme Schedule — bespoke session-card grid.
   Replaces the dense table with a responsive grid of cards. Each card has
   a left date column, week + code chips, title, time, and mode badge.
   Past / today / upcoming sessions get distinct accents.
   ══════════════════════════════════════════════════════════════════════════ */
.sched-card { min-width: 0; }
.sched-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.sched-head .card-subtitle { margin: 4px 0 0; }
.sched-head-actions {
  display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.sched-tally {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px; border-radius: 999px;
  background: rgba(0,0,0,.32);
  border: 1px solid var(--border-soft);
  font-size: .76rem; color: var(--t-secondary);
  font-variant-numeric: tabular-nums;
}
.sched-tally i { color: #9BAA52; font-size: .72rem; }
.sched-tally b { font-family: var(--ff-display); font-weight: 700; color: #fff; }
.sched-tally em { font-style: normal; color: var(--t-tertiary); }
.sched-tally--live {
  background: linear-gradient(180deg, rgba(232,184,50,.12), rgba(232,184,50,.04));
  border-color: rgba(232,184,50,.4);
  color: #F0D86E;
}
.sched-tally--live b { color: #F0D86E; }
.sched-tally--live em { color: rgba(240, 216, 110, .75); }
.sched-tally--live .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #E8C547; box-shadow: 0 0 0 0 rgba(232, 197, 71, .55);
  animation: schedPulse 1.6s ease-out infinite;
}
@keyframes schedPulse {
  0%   { box-shadow: 0 0 0 0 rgba(232, 197, 71, .55); }
  70%  { box-shadow: 0 0 0 8px rgba(232, 197, 71, 0); }
  100% { box-shadow: 0 0 0 0 rgba(232, 197, 71, 0); }
}

.sched-empty {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 36px 18px; border-radius: var(--r-lg);
  border: 1px dashed var(--border-medium);
  color: var(--t-tertiary); font-size: .9rem;
  background: rgba(255,255,255,.015);
}
.sched-empty i { color: #E8C547; font-size: 1rem; }

.sched-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  min-width: 0;
}

.sched-item {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: 64px 1fr; gap: 14px;
  padding: 14px;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.025), rgba(255,255,255,.005)),
    rgba(0,0,0,.30);
  border: 1px solid var(--border-soft);
  box-shadow: var(--hairline-top);
  min-width: 0;
  transition: transform .18s ease, border-color .18s ease, box-shadow .25s ease, background .18s ease;
}
.sched-item::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--accent, linear-gradient(180deg, #6b7280, #4b5563));
  opacity: .9;
}
.sched-item:hover {
  transform: translateY(-2px);
  border-color: var(--border-brand);
  background:
    linear-gradient(180deg, rgba(232,184,50,.05), rgba(255,255,255,.005)),
    rgba(0,0,0,.36);
}
.sched-item--past     { --accent: linear-gradient(180deg, #9BAA52, #7A8B3A); opacity: .92; }
.sched-item--upcoming { --accent: linear-gradient(180deg, #B8860B, #E8C547); }
.sched-item--today {
  --accent: linear-gradient(180deg, #F0D86E, #B8860B);
  border-color: rgba(232,184,50,.45);
  background:
    radial-gradient(120% 100% at 0% 0%, rgba(232,184,50,.12), transparent 55%),
    linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.01)),
    rgba(0,0,0,.34);
  box-shadow: 0 8px 22px rgba(212, 160, 23,.18), var(--hairline-top);
}

/* Date column */
.sched-date {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px;
  padding: 8px 4px;
  border-radius: 10px;
  background: rgba(0,0,0,.45);
  border: 1px solid var(--border-soft);
  min-width: 0;
}
.sched-date-day {
  font-family: var(--ff-display); font-weight: 800;
  font-size: 1.5rem; line-height: 1; color: #fff;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.sched-date-mon {
  font-size: .62rem; font-weight: 700; letter-spacing: .14em;
  color: #E8C547;
  text-transform: uppercase;
  margin-top: 2px;
}
.sched-date-dow {
  font-size: .58rem; font-weight: 600; letter-spacing: .08em;
  color: var(--t-tertiary);
  text-transform: uppercase;
  margin-top: 1px;
}
.sched-item--today .sched-date {
  background: linear-gradient(180deg, rgba(232,184,50,.18), rgba(184,134,11,.10));
  border-color: rgba(232,184,50,.45);
}
.sched-item--today .sched-date-day {
  background: linear-gradient(180deg, #fff, #F0D86E);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.sched-item--past .sched-date-mon { color: #9BAA52; }

/* Body */
.sched-body { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.sched-meta-row {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.sched-week {
  display: inline-flex; align-items: center;
  font-family: var(--ff-display); font-weight: 700;
  font-size: .68rem; letter-spacing: .06em;
  padding: 3px 7px; border-radius: 6px;
  background: rgba(232,184,50,.12);
  color: #F0D86E;
  border: 1px solid rgba(232,184,50,.28);
}
.sched-code {
  font-family: var(--ff-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: .7rem; font-weight: 600;
  color: var(--t-secondary);
  padding: 3px 7px; border-radius: 6px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border-soft);
}
.sched-status {
  display: inline-flex; align-items: center; gap: 4px;
  margin-left: auto;
  font-size: .65rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px;
  background: rgba(0,0,0,.4);
  border: 1px solid var(--border-soft);
  color: var(--t-tertiary);
}
.sched-status i { font-size: .6rem; }
.sched-status--past     { color: #9BAA52; border-color: rgba(155,170,82,.3); }
.sched-status--upcoming { color: #E8C547; border-color: rgba(232,184,50,.3); }
.sched-status--today {
  color: #1a1300;
  background: linear-gradient(135deg, #F0D86E, #B8860B);
  border-color: rgba(232,184,50,.7);
  box-shadow: 0 2px 8px rgba(212, 160, 23,.35);
}

.sched-title {
  margin: 0;
  font-family: var(--ff-display);
  font-size: .98rem; font-weight: 700; line-height: 1.3;
  color: #fff;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}

.sched-foot {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 2px;
}
.sched-time {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .76rem; color: var(--t-secondary);
  font-variant-numeric: tabular-nums;
}
.sched-time i { color: var(--t-tertiary); font-size: .72rem; }

.sched-mode {
  display: inline-flex; align-items: center; gap: 5px;
  margin-left: auto;
  font-size: .72rem; font-weight: 600;
  padding: 3px 9px; border-radius: 999px;
  background: rgba(0,0,0,.32);
  border: 1px solid var(--border-soft);
  color: var(--t-secondary);
  white-space: nowrap;
}
.sched-mode i { font-size: .68rem; }
.sched-mode--inperson { color: #F0D86E; border-color: rgba(232,184,50,.3); background: rgba(232,184,50,.08); }
.sched-mode--inperson i { color: #E8C547; }
.sched-mode--online   { color: #9BAA52; border-color: rgba(155,170,82,.3); background: rgba(155,170,82,.08); }
.sched-mode--online   i { color: #9BAA52; }
.sched-mode--hybrid   { color: #E0A875; border-color: rgba(224,168,117,.28); background: rgba(224,168,117,.08); }
.sched-mode--hybrid   i { color: #E0A875; }

@media (max-width: 620px) {
  .sched-head { gap: 10px; }
  .sched-grid { gap: 10px; }
  .sched-item { padding: 12px; gap: 12px; grid-template-columns: 56px 1fr; }
  .sched-date-day { font-size: 1.3rem; }
  .sched-title { font-size: .92rem; }
  .sched-status { margin-left: 0; }
  .sched-mode { margin-left: 0; }
}

/* ── KPI tiles (premium with edge-light + tabular figures) ─────────────── */
.kpi-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
  margin-bottom: 24px;
}
.kpi {
  position: relative; overflow: hidden;
  background: var(--bg-elev);
  border: 1px solid var(--border-medium);
  border-radius: var(--r-lg);
  padding: 20px 20px 18px 26px;
  display: grid; gap: 4px;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  box-shadow: var(--shadow-1), var(--hairline-top);
  transition: transform .2s ease, border-color .2s ease, box-shadow .25s ease;
}
.kpi:hover { transform: translateY(-2px); border-color: var(--border-strong); box-shadow: var(--shadow-2), var(--hairline-top); }
.kpi::before {
  content: ''; position: absolute; left: 0; top: 12%; bottom: 12%; width: 3px;
  background: var(--grad-edge);
  border-radius: 0 4px 4px 0;
  box-shadow: 0 0 18px rgba(212, 160, 23, .55);
}
.kpi::after {
  content: ''; position: absolute; top: -40%; right: -25%;
  width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(212, 160, 23,.18), transparent 70%);
  pointer-events: none;
}
.kpi-icon {
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(135deg, rgba(232, 184, 50,.28), rgba(212, 160, 23,.22));
  border: 1px solid rgba(212, 160, 23,.28);
  color: #F0D86E;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 6px 14px rgba(212, 160, 23,.18);
  margin-bottom: 4px;
}
.kpi-value {
  font-family: var(--ff-display);
  font-size: 1.95rem; font-weight: 700;
  letter-spacing: -0.03em; line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.kpi-label {
  color: var(--t-tertiary);
  font-size: .72rem; text-transform: uppercase;
  letter-spacing: .08em; font-weight: 700;
}
.kpi-foot { color: var(--t-secondary); font-size: .82rem; margin-top: 4px; }

/* ── KPI sparkline (7-day mini-trend) ──────────────────────────────────────
   A compact inline-SVG line + soft gradient area, sat at the bottom of the
   tile. The endpoint dot marks "today". A trend chip on the right shows
   delta first→last and a 7-day sum. The line draws on tile mount via a
   stroke-dash animation; the area fades up underneath.
   ─────────────────────────────────────────────────────────────────────── */
.kpi--spark { display: flex; flex-direction: column; }
.kpi--spark .kpi-foot { margin-bottom: 10px; }
.kpi-spark-wrap {
  position: relative;
  margin-top: auto;
  display: flex; flex-direction: column; gap: 4px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-soft);
}
.kpi-spark {
  display: block;
  width: 100%;
  height: 30px;
  overflow: visible;
}
.kpi-spark__area { animation: kpiAreaIn .8s ease-out both; }
.kpi-spark__line {
  stroke-dasharray: 240;
  stroke-dashoffset: 240;
  animation: kpiLineIn 1.1s cubic-bezier(.4,0,.2,1) forwards;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.4));
}
.kpi-spark__line--up   { /* uses tone color */ }
.kpi-spark__line--down { opacity: .9; }
.kpi-spark__line--flat { opacity: .55; }
.kpi-spark__dot {
  animation: kpiDotIn .35s ease-out 1s both;
  filter: drop-shadow(0 0 4px currentColor);
}
@keyframes kpiLineIn { to { stroke-dashoffset: 0; } }
@keyframes kpiAreaIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes kpiDotIn  { from { transform: scale(0); transform-origin: center; opacity: 0; } to { transform: scale(1); opacity: 1; } }

.kpi-spark-meta {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  font-size: .7rem;
}
.kpi-trend {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 7px; border-radius: 999px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  border: 1px solid var(--border-soft);
  background: rgba(0,0,0,.32);
}
.kpi-trend i { font-size: .62rem; }
.kpi-trend--up   { color: #9BAA52; border-color: rgba(155,170,82,.32); background: rgba(155,170,82,.10); }
.kpi-trend--down { color: #E89A6A; border-color: rgba(232,154,106,.32); background: rgba(232,154,106,.10); }
.kpi-trend--flat { color: var(--t-tertiary); }
.kpi-spark-7d {
  color: var(--t-secondary);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.kpi-spark-7d em { font-style: normal; color: var(--t-tertiary); font-weight: 500; }

@media (max-width: 480px) {
  .kpi-spark { height: 26px; }
  .kpi-spark-meta { font-size: .65rem; }
}

/* ── Two-column layout ─────────────────────────────────────────────────── */
/* minmax(0,1fr) prevents grid tracks from being widened by intrinsic content
   (canvas elements, wide tables) which previously caused cards to bleed
   off-screen on mobile. */
.layout-2col { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.layout-2col > * { min-width: 0; }
@media (min-width: 980px) { .layout-2col { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; } }

/* Chart wrapper: gives Chart.js a fixed-height responsive container so
   responsive:true + maintainAspectRatio:false sizes correctly without
   the canvas pushing its parent grid track wider than the viewport. */
.chart-wrap {
  position: relative;
  width: 100%;
  height: 260px;
  min-width: 0;
}
.chart-wrap > canvas { width: 100% !important; height: 100% !important; display: block; }
@media (max-width: 620px) { .chart-wrap { height: 220px; } }

/* ── Session / module cards ────────────────────────────────────────────── */
.session-list { display: grid; gap: 14px; }
.session-card {
  position: relative; overflow: hidden;
  background: var(--bg-elev);
  border: 1px solid var(--border-medium);
  border-radius: var(--r-lg); padding: 18px 18px 18px 22px;
  display: grid; gap: 16px; grid-template-columns: auto 1fr auto;
  align-items: center;
  transition: border-color .2s ease, transform .2s ease, box-shadow .25s ease;
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-1), var(--hairline-top);
}
.session-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--grad-edge); opacity: .55;
  transition: opacity .25s ease, box-shadow .25s ease;
}
.session-card:hover {
  border-color: var(--border-brand); transform: translateY(-1px);
  box-shadow: var(--shadow-2), var(--hairline-top);
}
.session-card:hover::before { opacity: 1; box-shadow: 0 0 22px rgba(212, 160, 23,.5); }
.session-icon {
  width: 50px; height: 50px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(212, 160, 23, .28), rgba(85, 107, 47, .18));
  border: 1px solid var(--border-brand);
  color: #F0D86E;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.15rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 8px 18px rgba(212, 160, 23,.18);
}
.session-meta {
  color: var(--t-tertiary); font-size: .72rem;
  text-transform: uppercase; letter-spacing: .08em; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.session-title { font-family: var(--ff-display); font-size: 1.04rem; font-weight: 600; color: #fff; margin: 3px 0; letter-spacing: -0.015em; }
.session-desc  { color: var(--t-secondary); font-size: .88rem; line-height: 1.5; }
.session-actions { display: flex; gap: 6px; }
@media (max-width: 620px) {
  .session-card { grid-template-columns: auto 1fr; padding: 16px 16px 16px 20px; }
  .session-actions { grid-column: 1 / -1; }
}

/* ── Status badges (with subtle inner glow) ────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 999px;
  font-size: .68rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  box-shadow: var(--hairline-soft);
}
.badge-not_started { background: rgba(107, 114, 128, .14); color: #cbd5e1; border: 1px solid rgba(180, 180, 180, .28); }
.badge-in_progress { background: rgba(212, 160, 23, .14); color: #FDE047; border: 1px solid rgba(212, 160, 23, .35); }
.badge-completed   { background: rgba(85, 107, 47, .14);  color: #9BAA52; border: 1px solid rgba(85, 107, 47, .35); }
.badge-submitted   { background: rgba(85, 107, 47, .14);  color: #9BAA52; border: 1px solid rgba(85, 107, 47, .35); }
.badge-reviewed    { background: rgba(212, 160, 23, .18); color: #F0D86E; border: 1px solid var(--border-brand); }

/* ── Progress bars ─────────────────────────────────────────────────────── */
.progress {
  position: relative; height: 9px; border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  overflow: hidden; margin-top: 8px;
  box-shadow: inset 0 1px 0 rgba(0,0,0,.35);
}
.progress-bar {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--c-primary), var(--c-primary-2) 55%, var(--c-accent));
  background-size: 200% 100%;
  transition: width .5s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 0 14px rgba(212, 160, 23,.55);
  position: relative;
}
.progress-bar::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.22), transparent);
  background-size: 200% 100%;
  animation: progressShine 2.4s linear infinite;
}
@keyframes progressShine { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .progress-bar::after { animation: none; } }

/* ── Tables ────────────────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--r-lg);
  border: 1px solid var(--border-medium);
  background: var(--bg-elev);
  box-shadow: var(--shadow-1), var(--hairline-top);
  backdrop-filter: blur(12px);
}
.table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  min-width: 640px; font-size: .89rem;
}
.table th, .table td {
  padding: 13px 16px; text-align: left;
  border-bottom: 1px solid var(--border-soft);
}
.table th {
  background: rgba(212, 160, 23, .07);
  color: #F0D86E;
  font-size: .70rem; text-transform: uppercase;
  letter-spacing: .08em; font-weight: 700;
  position: sticky; top: 0; z-index: 1;
  backdrop-filter: blur(8px);
}
.table tr:nth-child(even) td { background: rgba(255,255,255,.012); }
.table tr:hover td { background: rgba(212, 160, 23, .07); }
.table td { font-variant-numeric: tabular-nums; }
.table tr:last-child td { border-bottom: none; }

/* ── Activity feed ─────────────────────────────────────────────────────── */
.activity-feed { display: grid; gap: 10px; }
.activity-item {
  display: grid; grid-template-columns: auto 1fr auto; gap: 14px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, .025);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  align-items: center;
  transition: background .15s ease, border-color .15s ease;
}
.activity-item:hover { background: rgba(212, 160, 23, .08); border-color: var(--border-brand); }
.activity-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, rgba(232, 184, 50,.25), rgba(212, 160, 23,.18));
  border: 1px solid rgba(212, 160, 23, .25);
  color: #F0D86E;
  display: inline-flex; align-items: center; justify-content: center; font-size: .9rem;
}
.activity-text { color: var(--t-secondary); font-size: .88rem; line-height: 1.4; }
.activity-time { color: var(--t-quaternary); font-size: .76rem; font-variant-numeric: tabular-nums; }

/* ── Avatars ───────────────────────────────────────────────────────────── */
.avatar {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: var(--grad-brand);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .82rem; letter-spacing: .04em;
  box-shadow: 0 6px 14px rgba(212, 160, 23,.32), var(--hairline-top);
  font-family: var(--ff-display);
}
.avatar.lg { width: 68px; height: 68px; font-size: 1.25rem; border-radius: 22px; }

/* ── Toast notifications ───────────────────────────────────────────────── */
.toast-container {
  position: fixed; top: 80px; right: 20px; z-index: 9999;
  display: flex; flex-direction: column; gap: 10px; pointer-events: none;
}
.toast {
  background: var(--bg-elev-strong);
  color: #fff;
  padding: 13px 16px; border-radius: 13px;
  border: 1px solid var(--border-medium);
  border-left: 4px solid var(--c-primary-2);
  box-shadow: var(--shadow-3), var(--hairline-top);
  backdrop-filter: blur(20px) saturate(140%);
  min-width: 240px; max-width: 380px;
  display: flex; align-items: center; gap: 10px; font-size: .9rem;
  pointer-events: auto;
  animation: toastIn .25s ease;
}
.toast.success { border-left-color: var(--c-success); }
.toast.error   { border-left-color: var(--c-danger); }
.toast.warning { border-left-color: var(--c-warning); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }

/* ── Code & inline mono ────────────────────────────────────────────────── */
code, pre {
  font-family: var(--ff-mono);
  font-size: .85em;
}
code {
  background: rgba(212, 160, 23, .15);
  border: 1px solid var(--border-brand);
  padding: 1px 7px; border-radius: 6px;
  color: #FBE89A;
}

/* ── Filter chips ─────────────────────────────────────────────────────── */
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chip {
  padding: 8px 14px; border-radius: 999px;
  font-size: .78rem; font-weight: 600;
  background: rgba(255, 255, 255, .04);
  color: var(--t-secondary);
  border: 1px solid var(--border-medium);
  cursor: pointer;
  transition: color .15s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.chip:hover { color: #fff; border-color: var(--border-strong); }
.chip.active {
  background: var(--grad-brand);
  color: #fff; border-color: transparent;
  box-shadow: 0 6px 16px rgba(212, 160, 23,.4), var(--hairline-top);
}

/* ── Hours-input row (assignments) ─────────────────────────────────────── */
.hours-row {
  display: grid; grid-template-columns: 1fr auto auto auto;
  gap: 10px; align-items: center;
}
@media (max-width: 620px) {
  .hours-row { grid-template-columns: 1fr 1fr; }
  .hours-row .full-mobile { grid-column: 1 / -1; }
}

/* ── Module detail layout ──────────────────────────────────────────────── */
.detail-hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(232, 184, 50,.28), transparent 55%),
    radial-gradient(60% 100% at 100% 100%, rgba(122, 139, 58,.20), transparent 60%),
    linear-gradient(135deg, rgba(15, 17, 32, .8), rgba(15, 17, 32, .55));
  border: 1px solid var(--border-brand);
  border-radius: var(--r-2xl); padding: 26px;
  margin-bottom: 24px;
  display: grid; gap: 16px; grid-template-columns: auto 1fr;
  box-shadow: var(--shadow-2), var(--hairline-top);
}
.detail-hero .session-icon { width: 64px; height: 64px; font-size: 1.5rem; border-radius: 18px; }
.detail-meta {
  color: var(--t-tertiary); font-size: .76rem; text-transform: uppercase;
  letter-spacing: .08em; font-weight: 700;
}
.detail-title {
  font-family: var(--ff-display);
  font-size: clamp(1.4rem, 3vw, 1.7rem);
  letter-spacing: -0.025em; margin: 6px 0; font-weight: 700;
}
.detail-quickfacts { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.detail-quickfacts span {
  display: inline-flex; gap: 7px; align-items: center;
  font-size: .82rem; color: var(--t-secondary);
  padding: 6px 12px; border-radius: 999px;
  background: rgba(0, 0, 0, .32); border: 1px solid var(--border-medium);
  box-shadow: var(--hairline-soft);
  font-variant-numeric: tabular-nums;
}

/* ── Section dividers / utilities ──────────────────────────────────────── */
.section-divider { height: 1px; background: var(--border-soft); margin: 24px 0; }
.center { text-align: center; }
.muted  { color: var(--t-tertiary); }
.mt-md  { margin-top: 16px; }
.mt-lg  { margin-top: 24px; }
.flex   { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.gap-sm { gap: 8px; } .gap-md { gap: 16px; }
.hidden { display: none; }
.tabular { font-variant-numeric: tabular-nums; }
.eyebrow {
  font-size: .72rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: #E8C547;
}

/* ── Auth helpers (forgot-password row + link) ────────────────────────── */
.auth-row-between {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin: 4px 0 12px;
}
.auth-forgot-link {
  font-size: .85rem; font-weight: 600; color: #D4A017;
  text-decoration: none; transition: color .15s ease;
}
.auth-forgot-link:hover { color: #FBE89A; text-decoration: underline; }

/* ── Settings: tab strip + panes ──────────────────────────────────────── */
.settings-tabs {
  display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 18px;
  border-bottom: 1px solid var(--border-soft);
  padding-bottom: 8px;
}
.settings-tab {
  background: transparent; border: 1px solid transparent;
  color: var(--t-secondary); font: inherit; font-weight: 600;
  padding: 9px 14px; border-radius: 10px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.settings-tab:hover { color: #fff; background: rgba(212,160,23,.08); }
.settings-tab.active {
  background: linear-gradient(135deg, rgba(212,160,23,.18), rgba(85,107,47,.14));
  color: #fff; border-color: rgba(212,160,23,.35);
  box-shadow: 0 8px 24px rgba(212,160,23,.18);
}
.settings-tab i { font-size: .85rem; }
.settings-pane { display: none; }
.settings-pane.active { display: block; animation: paneFade .25s ease; }
@keyframes paneFade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ── Settings: small UI atoms ─────────────────────────────────────────── */
.muted-tag {
  display: inline-block; font-size: .7rem; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase;
  color: var(--t-tertiary); margin-left: 6px;
  padding: 2px 6px; border-radius: 6px;
  background: rgba(255,255,255,.04); border: 1px solid var(--border-soft);
}
.radio-row { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.radio-row .form-check { align-items: flex-start; gap: 10px; }
.inline-form {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px;
}
.inline-form .form-input { flex: 1 1 260px; min-width: 220px; }
.hairline {
  border: 0; height: 1px; width: 100%;
  background: linear-gradient(90deg, transparent, var(--border-medium), transparent);
}
.info-box {
  background: rgba(212,160,23,.06);
  border: 1px solid rgba(212,160,23,.24);
  border-radius: 12px; padding: 14px 16px;
  font-size: .88rem; color: var(--t-secondary);
  line-height: 1.55;
}
.info-box code {
  font-family: var(--ff-mono); font-size: .82rem;
  background: rgba(255,255,255,.06); padding: 1px 6px; border-radius: 4px;
  color: #F0D86E;
}
.badge-danger {
  background: rgba(239, 68, 68, .14); color: #FCA5A5;
  border: 1px solid rgba(239, 68, 68, .35);
}

/* ── Print ─────────────────────────────────────────────────────────────── */
@media print {
  body::before, body::after { display: none !important; }
  .ngn-nav, .ngn-mobnav, .ngn-dropdown, .toast-container, .page-actions { display: none !important; }
  body { background: #fff; color: #000; }
  .card, .kpi, .session-card, .welcome-card, .detail-hero {
    background: #fff !important; color: #000 !important;
    border: 1px solid #ccc !important; box-shadow: none !important;
  }
  .page-title, .welcome-greeting, .detail-title, .kpi-value { color: #000 !important; -webkit-text-fill-color: #000 !important; }
}

/* ══════════════════════════════════════════════════════════════════════════
   MOBILE RESPONSIVENESS FIXES — all pages
   ══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 880px) {

  /* ── Cohort hero: tighter, inline strip stacks gracefully ────────────── */
  .cohort-hero { padding: 16px 16px 14px; }
  .cohort-hero__title { font-size: clamp(1.3rem, 5vw, 1.6rem); }
  .cohort-hero__progress { width: 92px; height: 52px; }
  .cohort-hero__pct { font-size: 1.15rem; }
  .cohort-hero__meta li { font-size: .76rem; padding: 4px 9px; }
  .cohort-hero__strip { padding: 9px 12px; gap: 8px; }
  .cohort-hero__cd .cd-seg b { font-size: .98rem; }
  .cohort-hero__cd .cd-sep { margin: 0 3px; font-size: .88rem; }
  .cohort-hero__next-name { font-size: .86rem; }
  .cohort-hero__next-when { font-size: .74rem; }
  .cohort-hero__actions .btn { flex: 1 1 auto; justify-content: center; }

  /* ── KPI grid: 2 columns on tablets, 1 on phones (handled by minmax) ── */
  .kpi { padding: 16px 16px 14px 20px; }
  .kpi-value { font-size: 1.6rem; }

  /* ── Page header: stack title + actions vertically ───────────────────── */
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .page-actions {
    width: 100%;
    flex-wrap: wrap;
  }
  .page-actions .btn {
    flex: 1 1 auto;
    justify-content: center;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* ── Admin assignment & module card rows: badge+button wrap below ─────── */
  .admin-card-row {
    flex-wrap: wrap;
  }
  .admin-card-row .session-icon { flex-shrink: 0; }
  .admin-card-row > div[style*="flex:1"] { min-width: 0; flex: 1 1 0; }
  .admin-card-row > div[style*="flex-shrink:0"] { margin-left: auto; }

  /* ── Session cards: prevent action overflow ──────────────────────────── */
  .session-card {
    grid-template-columns: auto 1fr;
    padding: 14px 14px 14px 18px;
    gap: 12px;
  }
  .session-actions {
    grid-column: 1 / -1;
    flex-wrap: wrap;
  }

  /* ── Tables: ensure they scroll horizontally, never bleed ───────────── */
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }
  .table th, .table td {
    white-space: nowrap;
    padding: 10px 10px;
    font-size: .82rem;
  }

  /* ── Activity feed: tighter ──────────────────────────────────────────── */
  .activity-item { padding: 10px 12px; font-size: .84rem; }
  .activity-time { font-size: .72rem; white-space: nowrap; }

  /* ── Layout 2-col stays single col on mobile (already is, reinforce) ── */
  .layout-2col { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {

  /* ── Assignment card inner row: wrap so badge+edit don't get cut off ── */
  .session-icon { width: 42px; height: 42px; font-size: 1rem; border-radius: 12px; flex-shrink: 0; }

  /* ── Session meta: prevent word-breaking mid-word ────────────────────── */
  .session-meta { word-break: keep-all; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  /* ── KPI: full width single column ──────────────────────────────────── */
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 14px 12px 12px 16px; }
  .kpi-value { font-size: 1.45rem; }
  .kpi-icon { width: 34px; height: 34px; font-size: .9rem; }

  /* ── Page actions: each button full-width on very small screens ──────── */
  .page-actions { gap: 8px; }

  /* ── Admin assignment/module card inner flex ─────────────────────────── */
  .card .session-meta { white-space: normal; }

  /* ── Table cells smaller ─────────────────────────────────────────────── */
  .table th, .table td { font-size: .78rem; padding: 9px 8px; }

  /* ── Cohort hero: even more compact, strip stacks vertically ─────────── */
  .cohort-hero { padding: 14px 14px 12px; }
  .cohort-hero__progress { width: 84px; height: 48px; }
  .cohort-hero__pct { font-size: 1.05rem; }
  .cohort-hero__strip { flex-direction: column; align-items: flex-start; }
  .cohort-hero__cd { align-self: flex-start; }
  .cohort-hero__meta li { font-size: .72rem; padding: 3px 8px; gap: 5px; }

  /* ── Card padding smaller ────────────────────────────────────────────── */
  .card { padding: 16px; min-width: 0; }

  /* ── flex-between: allow wrapping ───────────────────────────────────── */
  .flex-between { align-items: flex-start; }
}

@media (max-width: 400px) {
  /* ── Extreme small: go fully single column KPI ───────────────────────── */
  .kpi-grid { grid-template-columns: 1fr; }
  .page-actions .btn { font-size: .8rem; padding: 9px 12px; }
  .cohort-hero__title { font-size: 1.18rem; }
  .cohort-hero__meta li { font-size: .68rem; }
  .cohort-hero__progress { width: 76px; height: 44px; }
  .cohort-hero__pct { font-size: .98rem; }
}

/* ── Student page specific mobile fixes ─────────────────────────────────── */
@media (max-width: 620px) {
  /* Assignments card: collapse 3-col grid → icon+text stacked, badge below */
  .assign-card-row {
    grid-template-columns: auto 1fr !important;
  }
  .assign-card-row .badge {
    grid-column: 1 / -1;
    justify-self: start;
  }

  /* Module view: detail-hero icon shrinks on very small screens */
  .detail-hero {
    padding: 18px;
    gap: 12px;
  }
  .detail-hero .session-icon {
    width: 48px; height: 48px; font-size: 1.15rem; border-radius: 14px;
  }
  .detail-title { font-size: 1.25rem; }
  .detail-quickfacts { gap: 7px; }
  .detail-quickfacts span { font-size: .76rem; padding: 5px 10px; }

  /* Chip row on modules page: scroll horizontally instead of wrapping badly */
  .chip-row {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }
  .chip { white-space: nowrap; }
}

@media (max-width: 400px) {
  /* Detail hero: absolute minimum */
  .detail-hero { padding: 14px; }
  .detail-hero .session-icon { width: 40px; height: 40px; font-size: 1rem; }
  .detail-title { font-size: 1.1rem; }
}

/* ── Brand asset uploads (admin → settings → branding) ─────────────── */
.brand-uploads {
  display: grid; grid-template-columns: 1fr 1fr; gap: 18px;
  margin-top: 14px;
}
.brand-upload {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 14px; border-radius: var(--r-xl);
  background: rgba(255,255,255,.025);
  border: 1px solid var(--border-soft);
}
.brand-upload-body { flex: 1 1 0; min-width: 0; }
.brand-upload-body .form-label { margin-bottom: 4px; }

.brand-preview {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background:
    linear-gradient(45deg, rgba(255,255,255,.04) 25%, transparent 25%, transparent 75%, rgba(255,255,255,.04) 75%) 0 0/12px 12px,
    linear-gradient(45deg, rgba(255,255,255,.04) 25%, transparent 25%, transparent 75%, rgba(255,255,255,.04) 75%) 6px 6px/12px 12px,
    rgba(0,0,0,.35);
  border: 1px solid var(--border-soft);
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.brand-preview img { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand-preview-placeholder {
  color: var(--t-quaternary); font-size: 1.4rem;
}
.brand-preview--logo {
  width: 84px; height: 84px;
  border-radius: 18px;
}
.brand-preview--fav {
  width: 64px; height: 64px;
  border-radius: 12px;
}
.brand-preview--fav .brand-preview-placeholder { font-size: 1.05rem; }

/* Native file input — themed to match the rest of the form controls */
.form-file {
  display: block; width: 100%;
  font-size: .82rem; color: var(--t-secondary);
  background: transparent; border: 0; padding: 0;
}
.form-file::file-selector-button {
  margin-right: 12px;
  padding: 7px 14px; border-radius: 8px;
  background: linear-gradient(135deg, rgba(212,160,23,.22), rgba(85,107,47,.20));
  border: 1px solid rgba(212,160,23,.4);
  color: #F0D86E; font-weight: 600; font-size: .8rem;
  cursor: pointer; transition: all .15s ease;
}
.form-file::file-selector-button:hover {
  background: linear-gradient(135deg, rgba(212,160,23,.32), rgba(85,107,47,.28));
  border-color: rgba(212,160,23,.55);
}

/* Tiny "Remove" button variant used in the brand-asset cards */
.btn-ghost {
  background: transparent; color: var(--t-secondary);
  border: 1px solid var(--border-soft);
}
.btn-ghost:hover { color: #fff; border-color: rgba(255,255,255,.18); }
.btn-sm { padding: 4px 10px; font-size: .74rem; }
.btn-sm i { font-size: .72rem; margin-right: 4px; }

@media (max-width: 620px) {
  .brand-uploads { grid-template-columns: 1fr; gap: 12px; }
  .brand-preview--logo { width: 72px; height: 72px; }
  .brand-preview--fav  { width: 56px; height: 56px; }
}

/* ── Brand mark variant: render an uploaded image instead of the icon */
.ngn-brand-mark.has-image {
  background: rgba(0,0,0,.25);
  padding: 4px;
  overflow: hidden;
}
.ngn-brand-mark.has-image::after { display: none; }
.ngn-brand-mark.has-image img {
  width: 100%; height: 100%;
  object-fit: contain; display: block;
  border-radius: 7px;
}
