/* Invictus Learning Lab — Invictus Performance Lab LIGHT theme.
   THE SCIENCE OF PERFORMANCE. Warm-paper surfaces, near-black text, fire-red
   accent used sparingly. Same class structure — only the visual layer changed.
   (Dark variant preserved in styles-dark.css.) */

/* ── Brand fonts ──────────────────────────────────────────────────── */
@font-face {
  font-family: 'FX Ambasans';
  src: url('fonts/FXAmbasans-Bold.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'FX Ambasans';
  src: url('fonts/FXAmbasans-SemiBold.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'FX Ambasans';
  src: url('fonts/FXAmbasans-Medium.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Zalando Sans SemiExpanded';
  src: url('fonts/ZalandoSansSemiExpanded-Regular.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Zalando Sans SemiExpanded';
  src: url('fonts/ZalandoSansSemiExpanded-Medium.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Zalando Sans SemiExpanded';
  src: url('fonts/ZalandoSansSemiExpanded-SemiBold.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Zalando Sans SemiExpanded';
  src: url('fonts/ZalandoSansSemiExpanded-Bold.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}

:root {
  /* Backgrounds — warm light paper */
  --bg: #F4F1EA;            /* warm paper page */
  --surface: #FFFFFF;       /* cards/panels */
  --surface-2: #EDE9E0;     /* hover / elevated */

  /* Accent (fire — used sparingly) */
  --primary: #FF331B;
  --primary-dark: #E52E15;
  --fire-mid: #C6461F;      /* darker fire, legible as text on light */
  --cream: #6B5A2A;         /* warm accent for headings on light */

  /* Functional tints */
  --accent-edit: #FAF8F3;   /* editable input field bg */
  --reference: #F0ECE3;     /* quiet reference panel bg */
  --calc-tint: rgba(255,51,27,.07); /* fire-tinted highlight (mentor replies / derived) */

  /* Text */
  --text: #231F20;
  --text-muted: #6E6A64;

  /* Lines */
  --border: rgba(35,31,32,.12);
  --border-strong: rgba(35,31,32,.22);

  /* Status */
  --danger: #C7392B;
  --ok: #1F8A5B;
  --amber: #C25A28;
  --info: #2F6DA8;

  --radius: 2px;
  --radius-md: 4px;
  --radius-lg: 6px;
  --shadow: 0 1px 2px rgba(35,31,32,.06), 0 8px 24px rgba(35,31,32,.07);
  --shadow-fire: 0 4px 18px rgba(255,51,27,.25);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Zalando Sans SemiExpanded', system-ui, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2 { font-family: 'FX Ambasans', system-ui, sans-serif; letter-spacing: -0.01em; }

/* #app carries the full-height column for the loading / auth states; the shell
   mounts its own single .app-root inside it (no nested duplicate — that broke
   the collapse toggle, which targets the one .app-root). */
#app, .app-root { min-height: 100vh; display: flex; flex-direction: column; }
.centered { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px; }

/* ── Authenticated shell: fixed left sidebar + sticky topbar ──────────
   Scoped with :has(> .topbar) so the login / loading state (no topbar)
   keeps the plain centered column. No markup changes — pure re-layout. */
.app-root:has(> .topbar) {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  grid-template-rows: 66px minmax(0, 1fr);
  grid-template-areas:
    "sidebar topbar"
    "sidebar content";
  height: 100vh;
  min-height: 0;
}
.app-root:has(> .topbar) > .topbar  { grid-area: topbar; }
.app-root:has(> .topbar) > .nav     { grid-area: sidebar; }
.app-root:has(> .topbar) > .content { grid-area: content; overflow-y: auto; }

/* spinner */
.spinner {
  width: 32px; height: 32px; border-radius: 50%;
  border: 3px solid var(--border-strong); border-top-color: var(--primary);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* top bar — brand title (left) + account/context strip (right) */
.topbar {
  background: var(--surface); color: var(--text);
  padding: 0 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  border-bottom: 1px solid var(--border);
}
/* Brand title shown on the top panel. */
.topbar .title {
  display: block; font-family: 'FX Ambasans', system-ui, sans-serif;
  font-size: 18px; font-weight: 700; letter-spacing: .01em; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar .who { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--text-muted); white-space: nowrap; }
.topbar .who .role-pill {
  background: var(--surface-2); color: var(--text); padding: 3px 11px; border-radius: var(--radius);
  text-transform: uppercase; font-weight: 600; font-size: 12px; letter-spacing: .06em;
  border: 1px solid var(--border);
}
.linkbtn { background: none; border: 1px solid var(--border-strong); color: var(--text);
  padding: 7px 13px; border-radius: var(--radius); cursor: pointer; font-size: 14px; white-space: nowrap;
  transition: all .2s cubic-bezier(0.25,0.1,0.25,1); }
.linkbtn:hover { background: rgba(35,31,32,.05); border-color: var(--primary); }

/* Sidebar collapse toggle — a nav-style row pinned to the BOTTOM of the rail.
   It matches `.nav button`, so it inherits the row layout + icon slot; here we
   just give it its glyph (--icon), a divider above, and push it down with auto
   margin. When the rail is collapsed the label hides like any other nav item. */
.nav .nav-toggle {
  margin-top: auto; border-top: 1px solid var(--border);
  color: var(--text-muted); font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .08em;
  --icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'black'%20stroke-width%3D'2'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Crect%20width%3D'18'%20height%3D'18'%20x%3D'3'%20y%3D'3'%20rx%3D'2'%2F%3E%3Cpath%20d%3D'M9%203v18'%2F%3E%3Cpath%20d%3D'M15%209l-3%203%203%203'%2F%3E%3C%2Fsvg%3E");
}
.nav .nav-toggle:hover { color: var(--text); background: rgba(35,31,32,.05); }

/* ── Profile menu (top-right): avatar + name with a Settings / Sign out dropdown ── */
.profile { position: relative; }
.profile-btn {
  display: flex; align-items: center; gap: 10px; background: transparent;
  border: 1px solid transparent; border-radius: var(--radius-md); padding: 5px 8px; cursor: pointer;
  font-family: inherit; color: var(--text); transition: background .15s ease, border-color .15s ease;
}
.profile-btn:hover, .profile.open .profile-btn { background: rgba(35,31,32,.05); border-color: var(--border); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center; background: var(--primary); color: #fff;
  font-weight: 700; font-size: 13px; letter-spacing: .02em;
}
.profile-meta { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; min-width: 0; }
.profile-name { font-size: 13.5px; font-weight: 600; color: var(--text); white-space: nowrap; }
.profile-role { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.profile-caret {
  width: 16px; height: 16px; flex: 0 0 auto; background: currentColor; color: var(--text-muted);
  -webkit-mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'black'%20stroke-width%3D'2'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Cpath%20d%3D'M6%209l6%206%206-6'%2F%3E%3C%2Fsvg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'black'%20stroke-width%3D'2'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Cpath%20d%3D'M6%209l6%206%206-6'%2F%3E%3C%2Fsvg%3E") center / contain no-repeat;
  transition: transform .18s ease;
}
.profile.open .profile-caret { transform: rotate(180deg); }
.profile-menu-list {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 196px; z-index: 60;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: 0 12px 32px rgba(35,31,32,.16); padding: 6px;
  opacity: 0; transform: translateY(-6px); pointer-events: none;
  transition: opacity .14s ease, transform .14s ease;
}
.profile.open .profile-menu-list { opacity: 1; transform: none; pointer-events: auto; }
.profile-menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: transparent; border: none; border-radius: var(--radius); cursor: pointer;
  padding: 9px 12px; font: 500 14px/1 inherit; font-family: inherit; color: var(--text);
  transition: background .12s ease;
}
.profile-menu-item:hover { background: var(--surface-2); }
.profile-menu-item.danger { color: var(--danger); }

/* topbar right cluster + course switcher */
.topbar-right { display: flex; align-items: center; gap: 16px; }
.course-switch { display: flex; align-items: center; gap: 8px; }
.course-switch .switch-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .12em; }
.course-switch-sel {
  background: var(--surface); color: var(--text); border: 1px solid var(--border-strong);
  border-radius: var(--radius); padding: 6px 10px; font-size: 14px; max-width: 220px;
}
.course-switch-sel option { color: #222; }

/* segmented control (course manage tabs) */
.seg { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.seg-btn {
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  padding: 7px 15px; border-radius: var(--radius); cursor: pointer; font-size: 14px;
  transition: all .2s cubic-bezier(0.25,0.1,0.25,1);
}
.seg-btn:hover { border-color: var(--border-strong); }
.seg-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 600; }
.course-card h3 { margin: 0; }
.enrol-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.mentor-acc-row { padding: 8px 0; border-bottom: 1px solid var(--border); gap: 12px; }
.mentor-acc-row:last-child { border-bottom: none; }

/* quiz authoring + taking */
.pts-input { max-width: 90px; }
.q-card { border-left: 3px solid var(--primary); }
/* Section (page break) + heading/text blocks — editor cards and take/review views. */
.q-section-card { border-left-color: var(--primary); }
.q-heading-card { border-left-color: var(--muted-fg, #94a3b8); }
.quiz-section { margin: 4px 0 12px; padding-bottom: 6px; border-bottom: 2px solid var(--primary); }
.quiz-section h3 { margin: 0; }
.quiz-block { margin: 12px 0; }
.quiz-heading { margin: 0 0 4px; }
.quiz-text { white-space: pre-line; }
.quiz-nav { align-items: center; }
.quiz-page-indicator { margin-left: auto; }
.q-type-body { margin: 8px 0; }
.opt-row { display: flex; align-items: center; gap: 8px; margin: 4px 0; }
.opt-row input[type="text"] { flex: 1; }
.quiz-opt { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.grade-opt { padding: 3px 0; }
.opt-correct { color: var(--ok); font-weight: 600; }
.opt-wrong { color: var(--danger); }
.answer-text { margin-top: 6px; }

/* ── Sidebar navigation ─────────────────────────────────────────────── */
.nav {
  display: flex; flex-direction: column; align-items: stretch; gap: 2px;
  padding: 0 12px 20px;
  background: var(--surface); border-right: 1px solid var(--border);
  overflow-y: auto;
}
/* Invictus horizontal lockup pinned to the top of the rail */
.nav::before {
  content: ""; display: block; height: 30px; margin: 22px 8px 20px;
  background: url('logos/Logo-horizontal.png') left center / contain no-repeat;
}
.nav button {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: transparent; border: none; color: var(--text-muted);
  padding: 0 12px; min-height: 42px; border-radius: var(--radius);
  cursor: pointer; font-family: inherit; font-size: 14.5px; font-weight: 500;
  letter-spacing: .01em; position: relative;
  transition: background .16s cubic-bezier(0.25,0.1,0.25,1), color .16s;
}
/* icon slot — per-item glyph set on [data-key] below (currentColor mask) */
.nav button::before {
  content: ""; flex: 0 0 19px; width: 19px; height: 19px; background: currentColor;
  -webkit-mask: var(--icon, none) center / contain no-repeat;
  mask: var(--icon, none) center / contain no-repeat;
  opacity: .9;
}
.nav button:hover { background: rgba(35,31,32,.05); color: var(--text); }
.nav button.active {
  background: var(--calc-tint); color: var(--text); font-weight: 600;
  box-shadow: inset 2px 0 0 var(--primary);
}
.nav button.active::before { opacity: 1; }

/* ── Collapsed sidebar (desktop): icon-only rail ────────────────────────
   Toggled by the .nav-toggle button, which adds .nav-collapsed to .app-root.
   Labels are hidden with font-size:0 (the icon is a fixed-size ::before, so it
   stays); the brand lockup is dropped since a wordmark is unreadable at rail
   width. Scoped to ≥861px so the mobile horizontal rail is unaffected. */
@media (min-width: 861px) {
  .app-root:has(> .topbar).nav-collapsed { grid-template-columns: 68px minmax(0, 1fr); }
  .nav-collapsed > .nav { padding: 16px 10px 20px; }
  /* Keep the eagle when collapsed: the wide wordmark lockup won't fit the rail,
     so swap it for the eagle MARK only. logo-mark-white.png is a transparent
     white eagle, used here as a mask so it paints in the theme text colour. */
  .nav-collapsed > .nav::before {
    display: block; height: 30px; margin: 6px 0 20px;
    background: var(--text);
    -webkit-mask: url('logos/logo-mark-white.png') center / contain no-repeat;
    mask: url('logos/logo-mark-white.png') center / contain no-repeat;
  }
  .nav-collapsed > .nav button {
    justify-content: center; gap: 0; padding: 0; font-size: 0; letter-spacing: 0;
  }
  .nav-collapsed > .nav button::before { flex-basis: 20px; width: 20px; height: 20px; }
}

/* content area */
.content { padding: 32px 40px; width: 100%; }
.content > * { max-width: 1000px; margin-left: auto; margin-right: auto; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--shadow); padding: 24px; margin-bottom: 16px;
}
.card h2 { margin: 0 0 4px; font-size: 22px; }
.muted { color: var(--text-muted); }
.tint-calc { background: var(--calc-tint); }
.tint-ref { background: var(--reference); }

/* auth screens */
.auth-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { width: 100%; max-width: 380px; border-top: 2px solid var(--primary); }
.auth-card { text-align: center; }
/* Invictus vertical lockup atop the sign-in card */
.auth-card::before {
  content: ""; display: block; width: 150px; height: 76px; margin: 0 auto 18px;
  background: url('logos/Logo-vertical.png') center / contain no-repeat;
}
.auth-card h1 { font-size: 26px; margin: 0 0 4px; color: var(--text); text-transform: uppercase; letter-spacing: .02em; }
.auth-card label { text-align: left; }
.auth-card .sub { color: var(--text-muted); margin: 0 0 20px; font-size: 14px; }

/* ── Split-screen sign-in: dark brand panel + light form panel ──────────── */
.login-split { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; }
.login-brand {
  position: relative; overflow: hidden; color: #fff;
  background: linear-gradient(155deg, #2B2723 0%, #1A1613 58%, #211D1E 100%);
  padding: 56px 60px; display: flex; flex-direction: column; justify-content: center;
}
/* faint vertical hairlines, echoing the brand grid */
.login-brand::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: repeating-linear-gradient(90deg, rgba(255,255,255,.035) 0 1px, transparent 1px 104px);
}
.login-brand-inner { position: relative; max-width: 470px; }
.login-mark { width: 62px; height: 44px; margin-bottom: 46px; background: url('logos/logo-mark-white.png') left center / contain no-repeat; }
.login-eyebrow { color: var(--primary); font-weight: 700; font-size: 13px; letter-spacing: .22em; text-transform: uppercase; margin-bottom: 18px; }
.login-brand-title {
  font-family: 'FX Ambasans', system-ui, sans-serif; color: #fff; margin: 0 0 20px;
  font-size: clamp(34px, 4vw, 54px); line-height: 1.02; text-transform: uppercase; letter-spacing: .01em;
}
.login-brand-sub { color: rgba(255,255,255,.62); font-size: 16px; line-height: 1.6; max-width: 42ch; margin: 0; }

.login-form-pane { background: var(--bg); display: flex; align-items: center; justify-content: center; padding: 48px 40px; }
.login-form { width: 100%; max-width: 384px; }
.login-form h1 { font-size: 34px; margin: 0 0 6px; color: var(--text); }
.login-form .sub { color: var(--text-muted); margin: 0 0 24px; font-size: 15px; }

/* password field with an inline show/hide control */
.pw-field { position: relative; display: flex; align-items: center; }
.pw-field input { padding-right: 70px; }
.pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  font: 600 12px/1 inherit; font-family: inherit; text-transform: uppercase; letter-spacing: .06em;
  padding: 8px 10px; border-radius: var(--radius); transition: color .15s ease;
}
.pw-toggle:hover { color: var(--primary); }

@media (max-width: 820px) {
  .login-split { grid-template-columns: 1fr; }
  .login-brand { padding: 40px 30px; }
  .login-mark { margin-bottom: 22px; }
  .login-brand-sub { display: none; }
  .login-form-pane { padding: 40px 26px 56px; }
}

label { display: block; font-size: 13px; font-weight: 600; margin: 14px 0 6px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .06em; }
input[type="text"], input[type="password"], input[type="date"], input[type="time"] {
  width: 100%; padding: 12px 14px; font-size: 16px; min-height: 44px;
  border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--accent-edit);
  font-family: inherit; color: var(--text);
}
input::placeholder { color: #6B6A68; }
input:focus { outline: 2px solid var(--primary); outline-offset: 0; border-color: var(--primary); }

.btn-primary {
  width: 100%; margin-top: 20px; padding: 12px 16px; min-height: 48px;
  background: var(--primary); color: #fff; border: none; border-radius: var(--radius);
  font-size: 15px; font-weight: 600; cursor: pointer; font-family: inherit;
  text-transform: uppercase; letter-spacing: .04em;
  transition: all .2s cubic-bezier(0.25,0.1,0.25,1);
}
.btn-primary:hover { background: var(--primary-dark); box-shadow: var(--shadow-fire); }
.btn-primary:active { transform: scale(.98); }
.btn-primary:disabled { opacity: .5; cursor: default; box-shadow: none; }

.field-error { color: var(--danger); font-size: 14px; margin-top: 12px; min-height: 18px; }
.hint { color: var(--text-muted); font-size: 13px; margin-top: 6px; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
  background: #231F20; color: #fff; padding: 12px 18px; border-radius: var(--radius);
  box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: all .2s ease; max-width: 90%;
  border: 1px solid rgba(255,255,255,.14);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.danger { background: var(--danger); color: #fff; border-color: transparent; }

.badge-ok { color: var(--ok); font-weight: 600; }

.card h3 { margin: 0 0 4px; font-size: 16px; font-weight: 600; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.btn-primary.inline { width: auto; display: inline-block; }
.actions { margin-top: 20px; }

/* progress bars */
.progress-block { margin: 14px 0; }
.progress { height: 10px; background: rgba(35,31,32,.10); border-radius: 999px; overflow: hidden; margin-top: 6px; }
.progress-fill { height: 100%; background: linear-gradient(135deg, #FF331B 0%, #F2703F 100%); border-radius: 999px; transition: width .3s ease; }

/* mentor: per-domain module progress breakdown (trainee detail) */
.tp-domain { margin-top: 18px; }
.tp-domain:first-of-type { margin-top: 10px; }
.tp-module-list { margin-top: 8px; display: flex; flex-direction: column; gap: 3px; }
.tp-module { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 11px; background: var(--surface-2); border-radius: var(--radius); }
.tp-module-name { font-size: 14px; }
.tp-module-meta { display: flex; align-items: center; gap: 8px; white-space: nowrap; flex-shrink: 0; }

/* pills */
.pill { display: inline-block; padding: 3px 10px; border-radius: var(--radius); font-size: 12px; font-weight: 600;
  white-space: nowrap; text-transform: uppercase; letter-spacing: .04em; }
.pill-ok { background: rgba(31,138,91,.12); color: var(--ok); }
.pill-amber { background: rgba(194,90,40,.12); color: var(--amber); }
.pill-muted { background: rgba(35,31,32,.06); color: var(--text-muted); }
.pill-calc { background: var(--calc-tint); color: var(--fire-mid); }
.pill-danger { background: rgba(199,57,43,.12); color: var(--danger); }
.pill-info { background: rgba(47,109,168,.12); color: var(--info); }

/* in-section sub-tabs (Assign Task: New task | Task history) — sits inside the header card */
.subtabs { margin-top: 14px; }
.seg-badge { display: inline-block; margin-left: 7px; min-width: 18px; padding: 0 6px; border-radius: 999px;
  font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
  background: var(--primary); color: #fff; vertical-align: middle; }
.seg-btn.active .seg-badge { background: rgba(255,255,255,.28); }

/* search box for list views */
.search-wrap { margin: 0 0 12px; }
.search-input { width: 100%; padding: 9px 13px; font-size: 14px; border: 1px solid var(--border-strong);
  border-radius: var(--radius); background: var(--surface); color: var(--text); }
.search-input:focus { outline: 2px solid var(--primary); outline-offset: 1px; border-color: var(--primary); }

/* relative-period group headers + progressive reveal */
.group-head { margin: 18px 0 8px; font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-muted); }
.group-head:first-child { margin-top: 4px; }
.show-earlier { display: block; margin: 14px auto 2px; }

/* collapsible Learning domains */
.dom-head { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: none; border: none; padding: 0; cursor: pointer; color: inherit; text-align: left; }
.dom-head-main { display: flex; align-items: center; gap: 10px; }
.dom-head h3 { margin: 0; }
.dom-caret { color: var(--text-muted); font-size: 12px; width: 12px; flex-shrink: 0; }
.dom-count { white-space: nowrap; }
.dom-body { margin-top: 8px; }

/* prev/next lesson navigation */
/* R13 · sticky lesson action bar (‹ Prev · Mark complete · Next ›) — pinned to
   the bottom of the scroll container while the lesson is in view. */
.lesson-actions { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; gap: 10px;
  background: var(--surface); border-top: 1px solid var(--border); padding: 12px 24px; margin: 24px -24px -24px; }
.lesson-actions .spacer { flex: 1; }
.lesson-side { display: inline-flex; min-width: 0; }
.lesson-nav-btn { display: inline-flex; align-items: center; gap: 2px; max-width: 190px; }
.lesson-nav-btn .nav-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lesson-nav-btn .nav-arrow { flex-shrink: 0; }
@media (max-width: 560px) { .lesson-nav-btn { max-width: 96px; } .lesson-nav-btn .nav-name { display: none; } }

/* cohort / list filter controls */
.cohort-controls { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 4px; }
.cohort-control { display: flex; align-items: center; gap: 8px; }
.cohort-control .select { min-width: 150px; }
.cohort-count { margin: 10px 0 4px; }


/* sub-heading inside a panel/card that separates a list from an action form below it */
.panel-subhead { margin: 20px 0 8px; padding-top: 14px; border-top: 1px solid var(--border);
  font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); }

/* a note-card rendered as a <button> (e.g. a clickable calendar task) */
.clickable-card { width: 100%; text-align: left; cursor: pointer; font: inherit; color: inherit;
  display: block; transition: border-color .15s ease, box-shadow .15s ease; }
.clickable-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.clickable-card:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Assign-tab task history: recipient chips with a per-trainee status dot */
.assign-recipients { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 2px; }
.recipient-tag { display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px;
  border: 1px solid var(--border); border-radius: 999px; font-size: 13px; background: var(--surface); }
.recipient-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); flex-shrink: 0; }
.dot-complete { background: var(--ok); }
.dot-submitted { background: var(--info); }
.dot-in-progress { background: var(--amber); }
.dot-overdue { background: var(--danger); }
.edit-history { margin-top: 8px; display: flex; flex-direction: column; gap: 2px; }

/* module list */
.module-list { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.module-row {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; min-height: 48px; cursor: pointer; font-size: 15px; color: var(--text);
  transition: all .2s cubic-bezier(0.25,0.1,0.25,1);
}
.module-row:hover { background: var(--surface-2); border-color: var(--border-strong); transform: translateY(-1px); }
.m-icon { width: 24px; height: 24px; flex: 0 0 24px; box-sizing: border-box; display: flex;
  align-items: center; justify-content: center; border-radius: 50%; font-size: 14px; font-weight: 700; line-height: 1; }
/* Complete: solid green with a white tick. In progress: pale amber with a half-
   circle glyph. Not started: a hollow outline circle. Three distinct states. */
.ic-ok { background: var(--ok); color: #fff; }
.ic-amber { background: rgba(194,90,40,.16); color: var(--amber); }
.ic-muted { background: transparent; border: 2px solid var(--border-strong); color: transparent; }
.m-name { flex: 1; }
.m-go { color: var(--primary); font-weight: 600; font-size: 14px; }

/* module view */
.btn-link { background: none; border: none; color: var(--primary); cursor: pointer; padding: 0 0 10px; font-size: 14px; }
.breadcrumb { font-size: 13px; margin-bottom: 2px; }
.btn-secondary {
  display: inline-block; padding: 10px 16px; min-height: 44px; border-radius: var(--radius);
  background: transparent; border: 1px solid var(--primary); color: var(--primary);
  font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; font-family: inherit;
  text-transform: uppercase; letter-spacing: .04em;
  transition: all .2s cubic-bezier(0.25,0.1,0.25,1);
}
.btn-secondary:hover { background: var(--primary); color: #fff; }
.open-ext { margin-top: 4px; }

/* resources / embeds */
.resource { margin: 14px 0; }
.resource-label { font-weight: 600; margin-bottom: 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.embed { width: 100%; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: #000; }
.embed iframe { width: 100%; border: 0; display: block; }
.embed-video { position: relative; padding-top: 56.25%; height: 0; }
.embed-video iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.embed-doc { background: var(--reference); }
.embed-doc iframe { height: 480px; }

/* Classroom-style file attachment (docs/PDFs/slides/sheets) — icon + name, no preview */
.resource-file {
  display: flex; align-items: center; gap: 14px; text-decoration: none;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text); transition: border-color .12s, background .12s;
}
.resource-file:hover { border-color: var(--border-strong); background: var(--surface-2); }
.resource-file .file-icon {
  flex: 0 0 auto; width: 42px; height: 42px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center; color: #fff; background: var(--text-muted);
}
.resource-file .file-icon svg { width: 22px; height: 22px; }
.resource-file.file-doc    .file-icon { background: #4285F4; }  /* Docs blue   */
.resource-file.file-pdf    .file-icon { background: #EA4335; }  /* PDF red     */
.resource-file.file-slides .file-icon { background: #F4B400; }  /* Slides yellow */
.resource-file.file-sheet  .file-icon { background: #0F9D58; }  /* Sheets green */
.resource-file .file-meta { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.resource-file .file-name { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.resource-file .file-type { font-size: 12px; color: var(--text-muted); }
.resource-file .file-open { flex: 0 0 auto; font-size: 13px; font-weight: 600; color: var(--primary); }

/* journal / log forms */
textarea.note-input {
  width: 100%; padding: 12px 14px; font-size: 16px; min-height: 96px; resize: vertical;
  border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--accent-edit);
  font-family: inherit; line-height: 1.5; color: var(--text);
}
textarea.note-input:focus { outline: 2px solid var(--primary); border-color: var(--primary); }
select.select {
  width: 100%; padding: 12px 14px; font-size: 16px; min-height: 44px;
  border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--accent-edit); color: var(--text);
}
.composer-actions { display: flex; align-items: center; gap: 14px; margin-top: 16px; flex-wrap: wrap; }
.save-status { font-size: 13px; }

.note-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-top: 12px; background: var(--reference); }
.note-card p { margin: 6px 0; }
.note-actions { display: flex; gap: 10px; }
.btn-link.small { font-size: 13px; padding: 0; }
.danger-link { color: var(--danger); }
.meta-row { display: flex; gap: 8px; margin: 6px 0; flex-wrap: wrap; }
.focus-line { font-weight: 600; margin-top: 4px; }

.mentor-reply { margin-top: 12px; padding: 10px 14px; background: var(--calc-tint); border-left: 3px solid var(--primary); border-radius: var(--radius); }
.mentor-reply p { margin: 4px 0; }
.reply-compose { margin-top: 12px; }
.reply-head { font-size: 12px; font-weight: 700; color: var(--fire-mid); text-transform: uppercase; letter-spacing: .08em; }
.small { font-size: 13px; }

/* tables (cohort + admin users/roster) */
.table-wrap { overflow-x: auto; margin-top: 12px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th, .data-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table th { color: var(--text-muted); font-weight: 600; font-size: 12px; white-space: nowrap; text-transform: uppercase; letter-spacing: .06em; }
.click-row { cursor: pointer; }
.click-row:hover td { background: var(--surface-2); }
.cell-stack { display: flex; flex-direction: column; gap: 4px; min-width: 90px; }
.progress.mini { height: 6px; margin-top: 0; }

/* task forms */
.task-form { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.inline-label { font-size: 13px; color: var(--text-muted); align-self: center; }
.label-line { font-weight: 600; margin-top: 6px; color: var(--text-muted); }

/* course authoring */
.res-row { display: grid; grid-template-columns: 120px 1fr 1fr auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.aud-modes { display: flex; gap: 18px; margin: 6px 0; }
.aud-list { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 4px; }
.aud-item { display: flex; align-items: center; gap: 6px; font-weight: 400; margin: 0; text-transform: none; letter-spacing: 0; }
.aud-item input { width: auto; min-height: 0; }
/* task recipient multi-select (whole-cohort master + per-trainee checkboxes) */
.recipient-list { display: flex; flex-direction: column; gap: 5px; max-height: 220px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: var(--radius); padding: 9px 12px; background: var(--surface); }
.recipient-list .recipient-all { border-bottom: 1px solid var(--border); padding-bottom: 7px; margin-bottom: 3px; font-weight: 600; }
.recipient-list .recipient-cohort { margin-top: 4px; font-size: 12.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.recipient-list .aud-indent { padding-left: 18px; }
/* inline per-view course selector (replaces the old topbar course dropdown) */
.course-tabs { margin: 0 auto 10px; }

/* ── Mentor cohort + course cards (redesign, matches the light-theme prototype) ── */
.overline { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; color: var(--fire-mid); }
/* per-person avatar circle (colour set inline) */
.avatar.avatar-sm { width: 34px; height: 34px; font-size: 12px; }
.cohort-card { display: block; width: 100%; text-align: left; cursor: pointer; font-family: inherit; color: var(--text);
  transition: transform .12s ease, border-color .15s ease, box-shadow .15s ease; }
.cohort-card:hover { border-color: var(--border-strong); transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(35,31,32,.07), 0 12px 30px rgba(35,31,32,.09); }
.cohort-card + .cohort-card { margin-top: 12px; }
/* used by the trainee-detail header (avatar + name row) */
.cohort-card-top { display: flex; align-items: center; gap: 14px; }
.cohort-card-id { flex: 1; min-width: 0; }

/* redesigned cohort card */
.cc { padding: 18px 20px; }
.cc-head { display: flex; align-items: center; gap: 14px; }
.cc-id { flex: 1; min-width: 0; }
.cc-name { font-family: 'FX Ambasans', system-ui, sans-serif; font-weight: 700; font-size: 17px; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-sub { display: flex; align-items: center; gap: 8px; margin-top: 3px; flex-wrap: wrap; }
.cc-pending { text-transform: none; letter-spacing: 0; font-size: 11px; }
.cc-score { flex: 0 0 auto; text-align: right; padding-left: 6px; }
.cc-score-num { font-family: 'FX Ambasans', system-ui, sans-serif; font-weight: 700; font-size: 22px; line-height: 1;
  color: var(--fire-mid); font-variant-numeric: tabular-nums; }
.cc-chev { flex: 0 0 auto; color: #b6b1a9; font-size: 22px; line-height: 1; }
.cc-prog { margin-top: 14px; }
.cc-prog-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.cc-prog-top .muted { letter-spacing: .08em; font-weight: 700; }
.cc-prog-val { font-weight: 600; font-size: 13px; color: var(--text); font-variant-numeric: tabular-nums; }
.cc-quiz { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.stat-num { font-family: 'FX Ambasans', system-ui, sans-serif; font-weight: 700; font-size: 18px; line-height: 1.1; color: var(--text); font-variant-numeric: tabular-nums; }
/* course cards */
.course-card-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.course-card-main { flex: 1; min-width: 200px; }
.course-card-title { font-family: 'FX Ambasans', system-ui, sans-serif; font-weight: 700; font-size: 18px; color: var(--text); }
.course-card-pills { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
@media (max-width: 560px) { .res-row { grid-template-columns: 1fr 1fr; } }

/* planner / agenda */
.agenda-date { display: flex; align-items: center; gap: 10px; margin: 16px 0 6px; font-weight: 700; color: var(--cream); border-bottom: 1px solid var(--border); padding-bottom: 4px; }
.note-card.done { opacity: .55; }
.note-card.done strong { text-decoration: line-through; }
.note-card.task-ref { background: var(--reference); }

.tiny { font-size: 12px; }

/* activity feed ("What's new") */
.activity-item {
  display: flex; gap: 12px; width: 100%; text-align: left; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; margin-top: 8px; cursor: pointer; color: var(--text);
  transition: all .2s cubic-bezier(0.25,0.1,0.25,1);
}
.activity-item:hover { background: var(--surface-2); border-color: var(--border-strong); }
.activity-item.is-new { border-left: 3px solid var(--primary); }
.activity-icon { flex: 0 0 28px; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--calc-tint); font-size: 15px; }
.activity-main { flex: 1; min-width: 0; }
.activity-title { font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.activity-when { color: var(--text-muted); font-size: 12px; margin-top: 2px; }
.new-pill { font-size: 11px; padding: 1px 8px; }

/* task comment thread */
.task-comments { margin-top: 12px; border-top: 1px dashed var(--border); padding-top: 10px; }
.comment { padding: 8px 12px; border-radius: var(--radius); margin: 6px 0; max-width: 92%; }
.comment p { margin: 2px 0; }
.comment-head { display: flex; align-items: baseline; gap: 8px; font-size: 13px; margin-bottom: 2px; }
.comment-mentor { background: var(--calc-tint); border: 1px solid rgba(255,51,27,.24); }
.comment-trainee { background: var(--reference); border: 1px solid var(--border-strong); margin-left: auto; }
.comment-compose { display: flex; gap: 8px; margin-top: 8px; }
.comment-compose .comment-input { flex: 1; min-height: 40px; padding: 8px 12px; }
.comment-compose .btn-secondary { white-space: nowrap; }

/* planner calendar */
.cal-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cal-nav { padding: 4px 12px; min-height: 36px; font-size: 18px; line-height: 1; }
.cal-month { min-width: 150px; text-align: center; }
.cal-card { padding: 12px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow { text-align: center; font-size: 12px; font-weight: 700; color: var(--text-muted); padding: 4px 0; text-transform: uppercase; letter-spacing: .06em; }
.cal-cell {
  min-height: 84px; border: 1px solid var(--border); border-radius: var(--radius); padding: 4px;
  background: var(--reference); cursor: pointer; overflow: hidden; display: flex; flex-direction: column; gap: 2px;
  transition: background .15s ease;
}
.cal-cell:hover { background: var(--surface-2); }
.cal-cell.other-month { background: transparent; border: none; cursor: default; }
.cal-cell.today { border-color: var(--primary); }
.cal-cell.selected { outline: 2px solid var(--primary); background: var(--calc-tint); }
.cal-daynum { font-size: 13px; font-weight: 600; color: var(--text); }
.cal-cell.today .cal-daynum { color: var(--primary); }
.cal-chip { font-size: 11px; line-height: 1.3; padding: 1px 5px; border-radius: var(--radius); background: var(--calc-tint); color: var(--fire-mid);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-chip.chip-task { background: rgba(35,31,32,.06); color: var(--text-muted); }
.cal-chip.chip-mentor { background: rgba(47,109,168,.12); color: var(--info); }
.cal-chip.chip-done { opacity: .5; text-decoration: line-through; }
.cal-more { font-size: 11px; color: var(--text-muted); padding: 0 5px; }
.planner-add { margin-top: 14px; border-top: 1px dashed var(--border); padding-top: 12px; }

/* ── Mobile (≤860px): fixed BOTTOM TAB BAR + compact topbar ───────────────
   The app already renders every nav item as a <button data-key> inside .nav.
   Here we re-lay-out that same DOM into a thumb-friendly bottom tab bar
   (icon over label), and pin the brand into the topbar since the sidebar
   lockup is hidden. Pure CSS — no app.js/views.js changes required. */
@media (max-width: 860px) {
  .nav .nav-toggle { display: none; }   /* collapse is a desktop-only affordance */
  .app-root:has(> .topbar) {
    display: flex; flex-direction: column; height: 100vh; min-height: 100vh;
  }
  .app-root:has(> .topbar) > .content {
    overflow-y: auto; flex: 1;
    /* leave room so content never hides behind the fixed tab bar */
    padding-bottom: calc(74px + env(safe-area-inset-bottom));
  }

  /* .nav → fixed bottom tab bar */
  .nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    flex-direction: row; align-items: stretch; gap: 2px;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: var(--surface);
    border-right: none; border-top: 1px solid var(--border);
    box-shadow: 0 -4px 20px rgba(35,31,32,.07);
    overflow: visible;
  }
  .nav::before { display: none; }        /* brand lockup lives in the topbar on mobile */
  .nav button {
    flex: 1 1 0; min-width: 0; width: auto; min-height: 0;
    flex-direction: column; justify-content: center; gap: 3px;
    padding: 7px 2px; font-size: 10.5px; font-weight: 600; letter-spacing: 0;
    border-radius: 8px; color: var(--text-muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .nav button::before { flex: 0 0 22px; width: 22px; height: 22px; opacity: .9; }
  .nav button.active {
    background: transparent; color: var(--primary); box-shadow: none; font-weight: 700;
  }
  .nav button.active::before { opacity: 1; }

  /* Brand + compact account cluster in the topbar */
  .topbar { justify-content: space-between; }
  .topbar .title {
    display: block; font-family: 'FX Ambasans', system-ui, sans-serif;
    font-size: 16px; font-weight: 700; letter-spacing: .01em; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
}

@media (max-width: 560px) {
  .topbar { padding: 0 12px; gap: 8px; }
  .content { padding: 16px 14px calc(78px + env(safe-area-inset-bottom)); }
  .card { padding: 18px; }
  .embed-doc iframe { height: 360px; }
  .cal-cell { min-height: 56px; }
  .cal-chip, .cal-more { display: none; }
  .cal-cell.has-items .cal-daynum::after { content: ''; color: var(--primary); }

  /* Compact topbar — fixes oversized Settings / Sign out buttons on phones.
     The full name + role pill are dropped; the buttons shrink to fit. */
  .topbar .title { font-size: 15px; }
  .topbar-right { gap: 8px; }
  .topbar .who { gap: 8px; }
  .topbar .who > span:first-child { display: none; }   /* long user name */
  .topbar .who .role-pill { display: none; }
  .linkbtn { padding: 7px 10px; font-size: 12px; }
  .course-switch .switch-label { display: none; }
  .course-switch-sel { max-width: 128px; font-size: 13px; padding: 6px 8px; }
  .profile-meta { display: none; }   /* compact profile: avatar + caret only */
}

/* ── Sidebar nav icons (Lucide-style, currentColor masks) ───────────── */
.nav button[data-key="home"] { --icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'black'%20stroke-width%3D'2'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Cpath%20d%3D'M3%209l9-7%209%207v11a2%202%200%200%201-2%202H5a2%202%200%200%201-2-2z'%2F%3E%3Cpath%20d%3D'M9%2022V12h6v10'%2F%3E%3C%2Fsvg%3E"); }
.nav button[data-key="learning"] { --icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'black'%20stroke-width%3D'2'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Cpath%20d%3D'M22%2010%2012%205%202%2010l10%205%2010-5z'%2F%3E%3Cpath%20d%3D'M6%2012v5c0%201%202.5%203%206%203s6-2%206-3v-5'%2F%3E%3C%2Fsvg%3E"); }
.nav button[data-key="quizzes"] { --icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'black'%20stroke-width%3D'2'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Cpath%20d%3D'M9%2011l3%203L22%204'%2F%3E%3Cpath%20d%3D'M21%2012v7a2%202%200%200%201-2%202H5a2%202%200%200%201-2-2V5a2%202%200%200%201%202-2h11'%2F%3E%3C%2Fsvg%3E"); }
.nav button[data-key="daily"] { --icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'black'%20stroke-width%3D'2'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Cpath%20d%3D'M12%2020h9'%2F%3E%3Cpath%20d%3D'M16.5%203.5a2.12%202.12%200%200%201%203%203L7%2019l-4%201%201-4z'%2F%3E%3C%2Fsvg%3E"); }
.nav button[data-key="practical"] { --icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'black'%20stroke-width%3D'2'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Cpath%20d%3D'M22%2012h-4l-3%209L9%203l-3%209H2'%2F%3E%3C%2Fsvg%3E"); }
.nav button[data-key="tasks"] { --icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'black'%20stroke-width%3D'2'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Cpath%20d%3D'M11%2012H3'%2F%3E%3Cpath%20d%3D'M16%206H3'%2F%3E%3Cpath%20d%3D'M16%2018H3'%2F%3E%3Cpath%20d%3D'M18%209l3%203-3%203'%2F%3E%3C%2Fsvg%3E"); }
.nav button[data-key="planner"] { --icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'black'%20stroke-width%3D'2'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Cpath%20d%3D'M8%202v4'%2F%3E%3Cpath%20d%3D'M16%202v4'%2F%3E%3Cpath%20d%3D'M3%2010h18'%2F%3E%3Cpath%20d%3D'M5%204h14a2%202%200%200%201%202%202v13a2%202%200%200%201-2%202H5a2%202%200%200%201-2-2V6a2%202%200%200%201%202-2z'%2F%3E%3C%2Fsvg%3E"); }
.nav button[data-key="calendar"] { --icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'black'%20stroke-width%3D'2'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Cpath%20d%3D'M8%202v4'%2F%3E%3Cpath%20d%3D'M16%202v4'%2F%3E%3Cpath%20d%3D'M3%2010h18'%2F%3E%3Cpath%20d%3D'M5%204h14a2%202%200%200%201%202%202v13a2%202%200%200%201-2%202H5a2%202%200%200%201-2-2V6a2%202%200%200%201%202-2z'%2F%3E%3Ccircle%20cx%3D'8'%20cy%3D'14'%20r%3D'1'%2F%3E%3Ccircle%20cx%3D'12'%20cy%3D'14'%20r%3D'1'%2F%3E%3Ccircle%20cx%3D'16'%20cy%3D'14'%20r%3D'1'%2F%3E%3C%2Fsvg%3E"); }
.nav button[data-key="assign"] { --icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'black'%20stroke-width%3D'2'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Crect%20width%3D'8'%20height%3D'4'%20x%3D'8'%20y%3D'2'%20rx%3D'1'%2F%3E%3Cpath%20d%3D'M16%204h2a2%202%200%200%201%202%202v14a2%202%200%200%201-2%202H6a2%202%200%200%201-2-2V6a2%202%200%200%201%202-2h2'%2F%3E%3Cpath%20d%3D'm9%2014%202%202%204-4'%2F%3E%3C%2Fsvg%3E"); }
.nav button[data-key="cohort"] { --icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'black'%20stroke-width%3D'2'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Cpath%20d%3D'M16%2021v-2a4%204%200%200%200-4-4H6a4%204%200%200%200-4%204v2'%2F%3E%3Cpath%20d%3D'M22%2021v-2a4%204%200%200%200-3-3.87'%2F%3E%3Cpath%20d%3D'M16%203.13a4%204%200%200%201%200%207.75'%2F%3E%3C%2Fsvg%3E"); }
.nav button[data-key="trainees"] { --icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'black'%20stroke-width%3D'2'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Cpath%20d%3D'M16%2021v-2a4%204%200%200%200-4-4H6a4%204%200%200%200-4%204v2'%2F%3E%3Cpath%20d%3D'M22%2021v-2a4%204%200%200%200-3-3.87'%2F%3E%3Cpath%20d%3D'M16%203.13a4%204%200%200%201%200%207.75'%2F%3E%3C%2Fsvg%3E"); }
.nav button[data-key="review"] { --icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'black'%20stroke-width%3D'2'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Cpath%20d%3D'M21%2015a2%202%200%200%201-2%202H7l-4%204V5a2%202%200%200%201%202-2h14a2%202%200%200%201%202%202z'%2F%3E%3C%2Fsvg%3E"); }
.nav button[data-key="course"] { --icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'black'%20stroke-width%3D'2'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Cpath%20d%3D'M12%202%202%207l10%205%2010-5-10-5z'%2F%3E%3Cpath%20d%3D'M2%2017l10%205%2010-5'%2F%3E%3Cpath%20d%3D'M2%2012l10%205%2010-5'%2F%3E%3C%2Fsvg%3E"); }
.nav button[data-key="users"] { --icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'black'%20stroke-width%3D'2'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Cpath%20d%3D'M12%2022s8-4%208-10V5l-8-3-8%203v7c0%206%208%2010%208%2010z'%2F%3E%3Cpath%20d%3D'M9%2012l2%202%204-4'%2F%3E%3C%2Fsvg%3E"); }
.nav button[data-key="settings"] { --icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'black'%20stroke-width%3D'2'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Cpath%20d%3D'M12%2015a3%203%200%201%200%200-6%203%203%200%200%200%200%206z'%2F%3E%3Cpath%20d%3D'M19.4%2015a1.65%201.65%200%200%200%20.33%201.82l.06.06a2%202%200%201%201-2.83%202.83l-.06-.06a1.65%201.65%200%200%200-1.82-.33%201.65%201.65%200%200%200-1%201.51V21a2%202%200%200%201-4%200v-.09A1.65%201.65%200%200%200%209%2019.4a1.65%201.65%200%200%200-1.82.33l-.06.06a2%202%200%201%201-2.83-2.83l.06-.06a1.65%201.65%200%200%200%20.33-1.82%201.65%201.65%200%200%200-1.51-1H3a2%202%200%200%201%200-4h.09A1.65%201.65%200%200%200%204.6%209a1.65%201.65%200%200%200-.33-1.82l-.06-.06a2%202%200%201%201%202.83-2.83l.06.06a1.65%201.65%200%200%200%201.82.33H9a1.65%201.65%200%200%200%201-1.51V3a2%202%200%200%201%204%200v.09a1.65%201.65%200%200%200%201%201.51%201.65%201.65%200%200%200%201.82-.33l.06-.06a2%202%200%201%201%202.83%202.83l-.06.06a1.65%201.65%200%200%200-.33%201.82V9a1.65%201.65%200%200%200%201.51%201H21a2%202%200%200%201%200%204h-.09a1.65%201.65%200%200%200-1.51%201z'%2F%3E%3C%2Fsvg%3E"); }

/* ═══════════════════════════════════════════════════════════════════════
   UI/UX polish pass — modals, drag-to-reorder, empty states, focus + motion.
   Appended last so these win in the cascade where they overlap.
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Keyboard focus rings (accessibility) — shown on keyboard nav, not on
   mouse click, so the mouse experience stays clean ─────────────────────── */
button:focus-visible, a:focus-visible, .seg-btn:focus-visible,
.nav button:focus-visible, .drag-handle:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--primary); outline-offset: 2px;
}
button:focus:not(:focus-visible) { outline: none; }

/* consistent press feedback on the secondary/link buttons too */
.btn-secondary:active { transform: scale(.98); }
.btn-link { transition: color .15s ease, opacity .15s ease; }
.btn-link:hover { color: var(--primary-dark); }
.btn-secondary.small { padding: 6px 12px; min-height: 32px; font-size: 12px; }

/* subtle hover feedback on interactive note cards (not static ones) */
.note-card { transition: border-color .15s ease, box-shadow .15s ease, background .15s ease, transform .12s ease; }

/* ── Danger button (destructive modal confirms) ────────────────────────── */
.btn-danger {
  display: inline-block; padding: 12px 16px; min-height: 44px;
  background: var(--danger); color: #fff; border: none; border-radius: var(--radius);
  font-size: 15px; font-weight: 600; cursor: pointer; font-family: inherit;
  text-transform: uppercase; letter-spacing: .04em;
  transition: all .2s cubic-bezier(0.25,0.1,0.25,1);
}
.btn-danger:hover { background: #a72e22; box-shadow: 0 4px 18px rgba(199,57,43,.28); }
.btn-danger:active { transform: scale(.98); }

/* ── Modal dialogs (replace native confirm/prompt) ─────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 1000; display: flex;
  align-items: center; justify-content: center; padding: 24px;
  background: rgba(35,31,32,.44); opacity: 0; transition: opacity .16s ease;
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.modal-backdrop.show { opacity: 1; }
.modal {
  background: var(--surface); border-radius: var(--radius-lg); width: 100%; max-width: 440px;
  padding: 24px 24px 22px; border-top: 3px solid var(--primary);
  box-shadow: 0 16px 52px rgba(35,31,32,.30);
  transform: translateY(10px) scale(.985);
  transition: transform .18s cubic-bezier(0.25,0.1,0.25,1);
}
.modal-backdrop.show .modal { transform: none; }
.modal-title { margin: 0 0 10px; font-size: 18px; font-weight: 700; color: var(--text); }
.modal-text { margin: 0; color: var(--text-muted); line-height: 1.55; }
.modal-form { margin-top: 2px; }
.modal-label {
  display: block; font-size: 13px; font-weight: 600; margin: 0 0 6px;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em;
}
.modal-input { width: 100%; }
.modal-actions { display: flex; justify-content: flex-end; align-items: center; gap: 14px; margin-top: 22px; }
.modal-actions .btn-primary, .modal-actions .btn-danger { width: auto; margin-top: 0; }
.modal-actions .btn-link { padding-bottom: 0; }
@media (max-width: 480px) {
  .modal { max-width: none; }
  .modal-actions { flex-direction: column-reverse; align-items: stretch; gap: 10px; }
  .modal-actions .btn-primary, .modal-actions .btn-danger, .modal-actions .btn-link { width: 100%; text-align: center; }
}

/* ── Drag-to-reorder (course builder: domains + modules) ───────────────── */
.reorder-hint { margin: 0 0 14px; }
.domain-head { align-items: flex-start; }
.domain-head-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.domain-title { margin: 0; }
.module-row-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cm-module-list { margin-top: 8px; }
.cm-module-list .empty-line { margin: 8px 0 2px; }

.drag-handle {
  flex: 0 0 auto; cursor: grab; color: var(--text-muted); user-select: none;
  font-size: 15px; line-height: 1; letter-spacing: -2px; padding: 4px 5px; border-radius: var(--radius);
  transition: color .12s ease, background .12s ease;
}
.drag-handle:hover { color: var(--primary); background: rgba(255,51,27,.08); }
.drag-handle:active { cursor: grabbing; }
/* while a row/card is being dragged */
.dragging { opacity: .45; }
.cm-module-row.dragging { outline: 2px dashed var(--primary); outline-offset: -1px; }
.domain-card.dragging { box-shadow: var(--shadow-fire); outline: 2px dashed var(--primary); }
/* the whole armed item shows the grab cursor is live */
.domain-card[draggable="true"], .cm-module-row[draggable="true"] { cursor: grabbing; }
@media (max-width: 560px) { .reorder-hint { display: none; } }

/* ── Empty states (friendlier than a bare muted line) ──────────────────── */
.empty-state { text-align: center; padding: 30px 18px; color: var(--text-muted); }
.empty-state .empty-emoji { font-size: 30px; line-height: 1; display: block; margin: 0 auto 10px; opacity: .8; }
.empty-state .empty-title { font-weight: 600; color: var(--text); margin: 0 0 4px; font-size: 15px; }
.empty-state .empty-msg { margin: 0 auto; max-width: 40ch; font-size: 14px; line-height: 1.5; }

/* ── Spinner: a touch smoother ─────────────────────────────────────────── */
.spinner { transition: opacity .2s ease; }

/* ═══════════════════════════════════════════════════════════════════════
   Practical-log file attachments — picker, chips, and the preview modal.
   ═══════════════════════════════════════════════════════════════════════ */

/* file picker in the add-entry form */
.att-file-input { display: none; }
.att-picker { margin: 2px 0 4px; }
.att-picked { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.att-picked-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--reference);
}
.att-picked-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 14px; }

/* clickable chips under a saved entry */
.att-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.att-chip {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%;
  padding: 6px 12px; border: 1px solid var(--border-strong); border-radius: 999px;
  background: var(--surface); color: var(--text); cursor: pointer; font-family: inherit;
  font-size: 13px; transition: border-color .15s ease, background .15s ease, transform .1s ease;
}
.att-chip:hover { border-color: var(--primary); background: var(--surface-2); }
.att-chip:active { transform: scale(.98); }
.att-ico { flex: 0 0 auto; font-size: 15px; line-height: 1; }
.att-chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px; font-weight: 600; }
.att-size { flex: 0 0 auto; font-size: 12px; }

/* file preview modal — wider than the default confirm/prompt modal */
.att-modal { max-width: 100%; }
.modal-body .att-modal .att-preview { display: block; max-width: 100%; max-height: 62vh; margin: 0 auto; border-radius: var(--radius); }
.modal-body .att-modal .att-pdf { width: 100%; height: 62vh; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
.att-modal-foot { display: flex; justify-content: flex-end; margin-top: 14px; }
.att-modal-foot .btn-secondary { width: auto; text-decoration: none; }
/* let the file-preview modal grow wider than the default 440px */
.modal-backdrop:has(.att-modal) .modal { max-width: 760px; }
@media (max-width: 560px) { .att-chip-name { max-width: 150px; } }

/* ═══════════════════════════════════════════════════════════════════════
   Desktop dashboard upgrade — hero progress ring, KPI stat tiles, domain
   grid. Additive: all-new classes, so every other screen is untouched.
   Uses the desktop's horizontal space, then reflows to one column on phones.
   ═══════════════════════════════════════════════════════════════════════ */

/* Hero: greeting + resume CTA on the left, a circular progress ring on the right */
.dash-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 32px; align-items: center; }
.dash-hero-main { min-width: 0; }
.dash-hero-main .btn-primary.inline { margin-top: 18px; }

.progress-ring {
  --pct: 0; --ring-size: 152px; --ring-thick: 13px;
  flex: 0 0 auto; width: var(--ring-size); height: var(--ring-size); border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  position: relative;
  background: conic-gradient(var(--primary) calc(var(--pct) * 1%), var(--surface-2) 0);
}
.progress-ring::before {
  content: ""; position: absolute; inset: var(--ring-thick); border-radius: 50%;
  background: var(--surface); box-shadow: inset 0 1px 3px rgba(35,31,32,.08);
}
.progress-ring .ring-val {
  position: relative; font-family: 'FX Ambasans', system-ui, sans-serif;
  font-size: 34px; font-weight: 700; line-height: 1; letter-spacing: -.02em; color: var(--text);
}
.progress-ring .ring-lbl {
  position: relative; margin-top: 5px; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted);
}

/* KPI stat tiles — a scannable metrics row that fills the desktop width */
.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px; margin-bottom: 16px;
}
.stat-tile {
  background: var(--surface); border: 1px solid var(--border); border-top: 2px solid var(--primary);
  border-radius: var(--radius-md); box-shadow: var(--shadow); padding: 18px 20px;
  display: flex; flex-direction: column; gap: 4px;
  transition: transform .12s ease, box-shadow .15s ease;
}
.stat-tile:hover { transform: translateY(-1px); box-shadow: 0 2px 4px rgba(35,31,32,.08), 0 12px 28px rgba(35,31,32,.08); }
.stat-value { font-family: 'FX Ambasans', system-ui, sans-serif; font-size: 26px; font-weight: 700; line-height: 1.1; color: var(--text); }
.stat-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }

/* By-domain progress as a responsive multi-column grid (was a tall stack) */
.domain-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px 28px; margin-top: 12px; }
.domain-prog { padding: 5px 0; }
.domain-prog-name { font-weight: 600; }

@media (max-width: 560px) {
  .dash-hero { grid-template-columns: 1fr; gap: 20px; justify-items: start; }
  .progress-ring { --ring-size: 118px; --ring-thick: 11px; margin: 2px auto 0; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-tile { padding: 14px 16px; }
  .stat-value { font-size: 22px; }
}

/* ═══════════════════════════════════════════════════════════════════════
   UI/UX handoff v2 refinements. Additive layer applied on top of the base
   theme (later rules win at equal specificity). Adapted to this app's real
   class names; every value resolves to an existing :root token.
   ═══════════════════════════════════════════════════════════════════════ */

/* R32 · a11y: a darker muted for small/caption text (AA on paper), + 44px
   minimum hit target for icon-only controls. Focus rings already exist. */
:root { --text-muted-strong: #56524B; }
.tiny, .activity-when, .stat-label, .empty-state .empty-msg,
.cc-quiz, .group-head, .muted.small, small { color: var(--text-muted-strong); }
.icon-btn { min-width: 44px; min-height: 44px; display: grid; place-items: center; }

/* R34 · button hierarchy — pull fire back to accent. Secondary hover is a
   neutral wash (was a full fire fill), so the one fire primary per view leads. */
.btn-secondary:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); box-shadow: none; }

/* R12 · module rows: taller target + the "Open/Review" verb goes fire on hover. */
.module-row { min-height: 52px; }
.module-row:hover .m-go { color: var(--primary); }

/* R17 · period-group headers stick while scrolling; "Show earlier" is a clear
   ghost button rather than a bare link. */
.group-head { position: sticky; top: 0; z-index: 2; background: var(--bg); padding: 10px 2px 6px; }
.show-earlier { display: inline-flex; align-items: center; gap: 6px; margin: 14px auto 2px;
  background: transparent; border: 1px solid var(--border-strong); color: var(--text);
  font-weight: 600; font-size: 13px; padding: 8px 14px; border-radius: var(--radius); cursor: pointer; }
.show-earlier:hover { background: var(--surface-2); }

/* R30 · one empty-state pattern: a quiet dashed frame so "nothing here" reads
   as intentional, not broken. */
.empty-state { border: 1px dashed var(--border-strong); border-radius: var(--radius-md); padding: 30px 18px; }

/* R29 · admin/data tables: sticky header while scrolling + a row-hover wash. */
.table-wrap { max-height: 66vh; overflow: auto; }
.data-table thead th { position: sticky; top: 0; background: var(--surface); z-index: 1; box-shadow: 0 1px 0 var(--border); }
.data-table tbody tr { transition: background .12s ease; }
.data-table tbody tr:hover { background: var(--surface-2); }

/* R27 · course builder drag: grab cursor + clearer grabbing state. */
.drag-handle { cursor: grab; }
.drag-handle:active, .dragging .drag-handle { cursor: grabbing; }

/* R16 · reply/comment threads: indent under the parent with a connecting rule
   so long exchanges don't read as a flat wall. */
.reply-thread { padding-left: 14px; border-left: 2px solid var(--border); }

/* R01 · quiet labelled groups in the sidebar (hidden in the collapsed rail). */
.nav-group { font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-muted); opacity: .72; padding: 15px 16px 4px; }
.nav-group:first-of-type { padding-top: 4px; }
.nav-collapsed > .nav .nav-group { display: none; }

/* R03 · collapsed rail: an instant CSS tooltip from each button's data-label
   (labels are font-size:0 there), so icons stay identifiable. */
@media (min-width: 861px) {
  .nav-collapsed > .nav button[data-key]:hover::after {
    content: attr(data-label); position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%);
    background: var(--text); color: #fff; font-size: 12px; font-weight: 500; letter-spacing: normal;
    padding: 5px 9px; border-radius: var(--radius); white-space: nowrap; z-index: 60;
    box-shadow: var(--shadow); pointer-events: none;
  }
}

/* R10 · "What's new" feed — a colour chip + category overline per item type
   (no emoji; the type comes from getActivityFeed). */
.activity-chip { flex: 0 0 22px; width: 22px; height: 22px; border-radius: var(--radius);
  align-self: center; background: var(--text-muted); }
.activity-chip[data-type="reply"] { background: var(--info); }
.activity-chip[data-type="task"]  { background: var(--amber); }
.activity-chip[data-type="quiz"]  { background: var(--cream); }
.activity-chip[data-type="grade"] { background: var(--ok); }
.activity-chip[data-type="note"]  { background: var(--fire-mid); }
.activity-cat { font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-muted-strong); margin-bottom: 1px; }
.activity-chev { margin-left: auto; align-self: center; color: var(--text-muted); font-size: 18px; line-height: 1; }

/* R21 · planner: a one-line legend for the chip colours + a stronger "today". */
.cal-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--text-muted-strong); margin: 0 0 12px; }
.cal-legend span { display: inline-flex; align-items: center; }
.cal-legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; margin-right: 6px; }
.cal-legend .lg-personal i { background: var(--fire-mid); }
.cal-legend .lg-mentor i { background: var(--info); }
.cal-legend .lg-task i { background: var(--amber); }
.cal-legend .lg-done i { background: var(--ok); }
.cal-cell.today { outline: 2px solid var(--primary); outline-offset: -2px; border-color: var(--primary); }

/* R23 · cohort: a fire "needs attention" flag on trainees with items to grade. */
.cc.attention { border-color: rgba(255,51,27,.35); }
.cc-flag { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: #fff; background: var(--primary); padding: 3px 7px; border-radius: var(--radius); }

/* R18 · due-date urgency colour (class stamped in views.js from due vs today). */
.due-soon { color: var(--amber); font-weight: 600; }
.due-past { color: var(--danger); font-weight: 600; }
