/* Orion — brand styles.
   Palette: Navy #0A1128 (primary/headings), Blue #2C5490 (CTA), Blossom #E8DCC0 (soft bg),
   Ochre #C9A24D (accent), Teal #2E7D5B, Berry #0F1B3D.
   Onest (headings), Work Sans (body).
   Design language: soft depth, gradient navies, tactile raised buttons, generous radii. */

:root {
  --pink:   #1B3B6F;
  --pink-l: #2C5490;
  --pink-d: #0F1B3D;
  --purple: #0A1128;
  --purple-l:#2C5490;
  --blossom:#E8DCC0;
  --blossom-2:#F5EEDD;
  --ochre:  #C9A24D;
  --teal:   #2E7D5B;
  --berry:  #0F1B3D;
  --blue:   #2C5490;
  --ink:    #14213F;
  --muted:  #6A7186;
  --line:   #E6E2D5;
  --white:  #ffffff;
  --bg:     #F7F5EF;
  /* semantic surfaces — overridden wholesale by [data-theme="dark"] below */
  --field:  #ffffff;    /* form-control fill */
  --chip-bg:#E9EDF6;    /* soft brand chip (e.g. In-app course tag) */

  --r-lg: 26px;
  --r-md: 18px;
  --r-sm: 12px;

  /* layered, Apple-soft shadows tinted with brand purple */
  --shadow-xs: 0 1px 2px rgba(10,17,40,.06), 0 2px 6px rgba(10,17,40,.05);
  --shadow-sm: 0 2px 6px rgba(10,17,40,.06), 0 8px 20px rgba(10,17,40,.07);
  --shadow:    0 4px 12px rgba(10,17,40,.08), 0 18px 44px rgba(10,17,40,.10);
  --shadow-lg: 0 8px 24px rgba(10,17,40,.12), 0 30px 70px rgba(10,17,40,.16);

  /* signature brand gradients */
  --grad-pink:   linear-gradient(135deg, #2C5490 0%, var(--pink) 55%, #0F1B3D 100%);
  --grad-purple: linear-gradient(135deg, var(--purple-l) 0%, var(--purple) 60%, var(--berry) 100%);
  --grad-hero:   linear-gradient(135deg, #FAF6EC 0%, var(--blossom) 45%, #EFE7D6 100%);
  --grad-fill:   linear-gradient(90deg, var(--pink), var(--ochre));

  --f-head: "Onest", system-ui, sans-serif;
  --f-body: "Work Sans", system-ui, sans-serif;
}

/* ============================================================================
   Dark mode — deep plum surfaces. Toggled by app.js
   setting <html data-theme="dark">. Brand accents (pink/ochre/teal) stay;
   the dark purple heading colour is lightened so it reads on dark surfaces.
   ========================================================================== */
[data-theme="dark"] {
  --purple:   #C9B283;   /* lightened so headings / brand text read on dark */
  --purple-l: #D8C290;
  --blossom:  #1B3B6F;
  --blossom-2:#0E1C3A;
  --ink:      #EEF2F8;
  --muted:    #9FB0CC;
  --line:     #22314F;
  --white:    #0F1D3B;
  --bg:       #070B18;
  --field:    #16264A;
  --chip-bg:  #1C2F52;

  --shadow-xs: 0 1px 2px rgba(0,0,0,.40);
  --shadow-sm: 0 2px 8px rgba(0,0,0,.42);
  --shadow:    0 6px 20px rgba(0,0,0,.48);
  --shadow-lg: 0 14px 44px rgba(0,0,0,.58);

  --grad-hero: linear-gradient(135deg, #122140 0%, #183055 55%, #0E1A34 100%);
}
[data-theme="dark"] body {
  background:
    radial-gradient(1100px 620px at 100% -8%, rgba(27,59,111,.30), transparent 60%),
    radial-gradient(900px 560px at -6% 8%, rgba(201,162,77,.10), transparent 55%),
    var(--bg);
}
/* surfaces that were hard-coded white in the light theme */
[data-theme="dark"] .card { background: linear-gradient(180deg, #10203F, #0C1A36); border-color: rgba(255,255,255,.06); }
[data-theme="dark"] .nav { background: rgba(23,12,28,.82); border-bottom-color: var(--line); }
[data-theme="dark"] .drawer__panel { background: #0E1C3A; }
[data-theme="dark"] .syncpill,
[data-theme="dark"] .table thead th { background: rgba(32,18,45,.92); }
[data-theme="dark"] .select,
[data-theme="dark"] .siteselect,
[data-theme="dark"] .pill--ghost,
[data-theme="dark"] .rowbook--ghost,
[data-theme="dark"] .rowbook--ghost:hover,
[data-theme="dark"] .cal-nav,
[data-theme="dark"] .day,
[data-theme="dark"] .segmented button.is-active { background: var(--field); }
[data-theme="dark"] input:not([type=checkbox]):not([type=radio]):not([type=range]),
[data-theme="dark"] select,
[data-theme="dark"] textarea { background: var(--field); color: var(--ink); }
[data-theme="dark"] .day { border-color: var(--line); }
[data-theme="dark"] .ring__track { stroke: #1C2F52; }
[data-theme="dark"] .avatar,
[data-theme="dark"] .person__av,
[data-theme="dark"] .rolechip__av { background: linear-gradient(140deg, #1B3B6F, #0F1D3B); color: var(--purple); }
[data-theme="dark"] .segmented { background: #0E1C3A; }
[data-theme="dark"] .stat,
[data-theme="dark"] .chip { background: linear-gradient(180deg, #10203F, #0C1A36); border-color: rgba(255,255,255,.06); }
[data-theme="dark"] .table thead th { color: var(--muted); border-bottom-color: var(--line); }
[data-theme="dark"] .myitem, [data-theme="dark"] .cert, [data-theme="dark"] .session { border-bottom-color: var(--line); }
[data-theme="dark"] .brand__word--alt { color: var(--purple); }
[data-theme="dark"] .offlinebar { filter: brightness(.85); }
/* calendar: booking chips + session cards were hard-coded light (title was invisible on dark) */
[data-theme="dark"] .evt { background: #182A4C; }              /* keep the course-coloured left border; light --ink text now reads */
[data-theme="dark"] .day.sel { background: #1A2C50; }
[data-theme="dark"] .sess { border-color: var(--line); }
[data-theme="dark"] .sess__capbar { background: #182A4C; }
[data-theme="dark"] .sess__result:hover { background: #182A4C; }
[data-theme="dark"] .day-detail, [data-theme="dark"] .indtpl li { border-color: var(--line); }
[data-theme="dark"] .attchip { background: rgba(111,148,212,.30); color: #B8CDEC; }
[data-theme="dark"] .attchip__x { color: #B8CDEC; }
/* admin Workroom: sidebar, tiles + banners were hard-coded light gradients */
[data-theme="dark"] .sidenav__nav,
[data-theme="dark"] .worktile { background: linear-gradient(180deg, #10203F, #0C1A36); border-color: rgba(255,255,255,.06); }
[data-theme="dark"] .sidenav__item:hover { background: #182A4C; }
[data-theme="dark"] .banner--admin { background: linear-gradient(180deg, #122140, #0E1A34); color: #DFE7F4; }
[data-theme="dark"] .banner--manager { background: linear-gradient(180deg, #3A2C12, #2A1F0B); color: #F0E0C4; }
/* top-right role chip — the manager/admin variants overrode the themed base with a light fill,
   hiding the (now light) name/role text */
[data-theme="dark"] .rolechip--manager { background: rgba(201,162,77,.26); }
[data-theme="dark"] .rolechip--admin { background: rgba(10,17,40,.40); }
/* hero copy was hard-coded warm-grey / berry — illegible on the dark hero gradient */
[data-theme="dark"] .hero__sub,
[data-theme="dark"] .hero__ident { color: #A9B8D4; }
[data-theme="dark"] .eyebrow { color: var(--ochre); }
/* the decorative corner light reads as a milky smudge on dark — keep it, barely */
[data-theme="dark"] .hero::after {
  background: radial-gradient(circle at center, rgba(255,255,255,.07), rgba(255,255,255,0) 70%);
}
/* the theme toggle itself */
.themebtn {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  display: grid; place-items: center; cursor: pointer; font-size: 17px;
  border: 1.5px solid var(--line); background: var(--field); color: var(--purple);
  box-shadow: var(--shadow-xs); transition: border-color .15s ease, transform .12s ease;
}
.themebtn:hover { border-color: var(--pink); transform: translateY(-1px); }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--f-body);
  color: var(--ink);
  background:
    radial-gradient(1100px 620px at 100% -8%, rgba(246,202,239,.5), transparent 60%),
    radial-gradient(900px 560px at -6% 8%, rgba(201,162,77,.05), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--f-head); font-weight: 800; letter-spacing: -.02em; margin: 0; }
a { color: inherit; text-decoration: none; }

.topbar { height: 6px; background: linear-gradient(90deg, var(--berry), var(--purple) 45%, var(--pink)); }

/* ---------- nav ---------- */
.nav {
  display: flex; align-items: center; gap: 28px;
  padding: 15px 40px;
  background: rgba(255,255,255,.72);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid rgba(10,17,40,.08);
  position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand__mark { display: inline-flex; color: var(--purple); }
.brand__word { font-family: var(--f-head); font-weight: 800; font-size: 25px; color: var(--purple); letter-spacing: -.03em; }
.brand__word--alt { color: var(--purple); }
.brand__dot { color: #C9A24D; }   /* the ratified gold full stop — same in every theme family */
[data-theme="dark"] .brand__dot { color: #E4C878; }
.nav__links { display: flex; gap: 22px; margin-left: 14px; }
.nav__links a { font-weight: 500; color: var(--muted); padding: 6px 2px; border-bottom: 2px solid transparent; transition: color .15s ease, border-color .15s ease; }
.nav__links a:hover { color: var(--ink); }
.nav__links a.is-active { color: var(--purple); border-bottom-color: var(--pink); }
.nav__right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(140deg, var(--blossom), #fff);
  color: var(--purple); font-weight: 700; font-family: var(--f-head);
  display: grid; place-items: center; font-size: 14px;
  box-shadow: var(--shadow-xs);
}

/* ---------- pills / buttons ---------- */
.pill {
  font-family: var(--f-body); font-weight: 600; font-size: 14px;
  border: 0; border-radius: 999px; padding: 10px 18px; cursor: pointer;
  transition: transform .12s cubic-bezier(.2,.8,.2,1), box-shadow .18s ease, background .15s ease, filter .15s ease;
}
.pill:active { transform: translateY(1px) scale(.99); }
.pill--primary {
  background: var(--grad-pink); color: #fff;
  box-shadow: 0 2px 6px rgba(27,59,111,.28), 0 8px 20px rgba(27,59,111,.24);
}
.pill--primary:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(27,59,111,.34), 0 14px 30px rgba(27,59,111,.30); filter: brightness(1.03); }
.pill--primary:active { box-shadow: 0 2px 6px rgba(27,59,111,.30); }
.pill--lg { padding: 13px 26px; font-size: 15px; }
.pill--ghost { background: rgba(255,255,255,.9); color: var(--purple); border: 1.5px solid var(--line); box-shadow: var(--shadow-xs); }
.pill--ghost:hover { border-color: var(--pink); color: var(--pink); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.pill--ghost:disabled { opacity: .45; cursor: default; box-shadow: none; transform: none; }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden;
  /* full window width (40px gutters) — .wrap shares the same gutters uncapped, so
     the content cards below always align with the hero card's edges */
  margin: 24px 40px 0;
  padding: 44px 48px 48px;
  background: var(--grad-hero);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
/* soft decorative light in the hero corner */
.hero::after {
  content: ""; position: absolute; top: -120px; right: -80px; width: 360px; height: 360px;
  background: radial-gradient(circle at center, rgba(255,255,255,.6), rgba(255,255,255,0) 70%);
  pointer-events: none;
}
.hero__inner { position: relative; max-width: 680px; z-index: 2; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-weight: 600; font-size: 12px; color: var(--berry); margin: 0 0 12px; }
.hero__title { font-size: 46px; color: var(--purple); line-height: 1.02; }
.hero__title .accent {
  background: linear-gradient(120deg, var(--pink), var(--ochre));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero__sub { font-size: 17px; color: #5c4a58; margin: 16px 0 26px; max-width: 560px; line-height: 1.5; }
.hero__ident { font-size: 15px; color: #5c4a58; margin: 14px 0 0; }
.hero__ident strong { color: var(--purple); }
.hero__id { color: var(--muted); }

.siteselect { background: rgba(255,255,255,.78); border: 1px solid rgba(255,255,255,.8); border-radius: var(--r-md); padding: 18px 20px; backdrop-filter: blur(6px); box-shadow: var(--shadow-sm); max-width: 620px; }
/* Dashboard hero: title on the left, site-select/report card on the right
   (was stacked — the title sat flush against the card). Collapses back to
   stacked below 980px. Only renderDashboard uses --split. */
.hero__inner--split { max-width: none; display: flex; align-items: center; justify-content: space-between; gap: 36px; }
.hero__inner--split .hero__lead { flex: 1 1 auto; min-width: 0; }
.hero__inner--split .siteselect { flex: 0 1 480px; width: 480px; max-width: 480px;
  /* leave the hero's right edge to the armillary watermark: nudge the card toward the
     middle as the viewport grows (0 below ~1150px wide; up to 280px on big screens) */
  margin-right: clamp(0px, calc((100vw - 1150px) * 0.6), 280px); }
@media (max-width: 980px) {
  .hero__inner--split { flex-direction: column; align-items: stretch; gap: 20px; }
  .hero__inner--split .siteselect { flex: none; width: auto; max-width: 620px; }
}
.siteselect label { display: block; font-weight: 600; font-size: 14px; color: var(--purple); margin-bottom: 8px; }
/* the select gets a full-width line of its own — squeezed beside the report
   buttons it went too narrow to read the site names */
.siteselect__row { display: flex; flex-wrap: wrap; gap: 12px; }
.siteselect__row .select { flex: 1 1 100%; min-width: 0; }
.siteselect__row .pill { flex: none; white-space: nowrap; }
.select {
  flex: 1; font-family: var(--f-body); font-size: 16px; font-weight: 500; color: var(--ink);
  padding: 13px 16px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff;
  appearance: none; cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23601664' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center;
}
.select:focus { outline: none; border-color: var(--pink); box-shadow: 0 0 0 3px rgba(27,59,111,.15); }
/* text <input>s reuse .select's shape (competency builder names, access-control role
   name, session fields) — but they are NOT dropdowns: no chevron eating into the text,
   and a text cursor instead of a pointer */
input.select { background-image: none; cursor: text; }
.siteselect__hint { margin: 12px 2px 0; font-size: 14px; color: var(--muted); }

/* ---------- layout ---------- */
.wrap { padding: 28px 40px 60px; }
/* (the old .wrap--full calendar-only variant is retired — EVERY view is full-window
   width with the same 40px gutters, matching the hero card above it) */

/* ---------- stat cards ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat {
  background: linear-gradient(180deg, #fff, #FFFEFB);
  border-radius: var(--r-md); padding: 22px 24px; box-shadow: var(--shadow-sm);
  border: 1px solid rgba(10,17,40,.05);
  position: relative; overflow: hidden;
  transition: transform .16s cubic-bezier(.2,.8,.2,1), box-shadow .2s ease;
}
/* gradient accent rail replaces the flat left border */
.stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--c); border-radius: 6px 0 0 6px; }
.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.stat__row { display: flex; align-items: baseline; justify-content: space-between; }
.stat__num { font-family: var(--f-head); font-weight: 800; font-size: 44px; color: var(--c); line-height: 1; }
.stat__badge { font-size: 12px; font-weight: 600; color: var(--c); background: var(--cbg); padding: 5px 11px; border-radius: 999px; }
.stat__label { font-family: var(--f-head); font-weight: 700; font-size: 18px; margin-top: 10px; color: var(--ink); }
.stat__cap { font-size: 14px; color: var(--muted); margin-top: 3px; }

/* ---------- panels ---------- */
.panels { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 20px; margin-bottom: 24px; }
.panels--even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.bars--scroll { max-height: 320px; overflow-y: auto; padding-right: 6px; }
.filtersel { font-family: var(--f-body); font-size: 14px; font-weight: 600; color: var(--purple);
  background: #EDEADF; border: 0; border-radius: 999px; padding: 8px 15px; cursor: pointer; max-width: 210px; transition: background .15s ease; }
.filtersel:hover { background: #efe0ea; }
.planwrap { max-height: 320px; overflow-y: auto; margin-top: 14px; }
.plantable th, .plantable td { font-size: 14px; padding: 8px 10px; white-space: nowrap; }
.plantable td:first-child { white-space: normal; }
.course-sub { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.card {
  background: linear-gradient(180deg, #fff, #fffdfe);
  border-radius: var(--r-md); padding: 22px 24px; box-shadow: var(--shadow-sm);
  border: 1px solid rgba(10,17,40,.05);
}
.card__title { font-size: 19px; color: var(--purple); }
.card__sub { font-size: 14px; color: var(--muted); margin: 4px 0 0; }

.ring-card { display: flex; flex-direction: column; align-items: center; text-align: center; }
.ring { position: relative; margin: 14px 0 6px; }
.ring svg { transform: rotate(-90deg); }
.ring__track { fill: none; stroke: #f2e6ef; stroke-width: 14; }
.ring__value { fill: none; stroke: var(--teal); stroke-width: 14; stroke-linecap: round;
  stroke-dasharray: 327; stroke-dashoffset: 327; transition: stroke-dashoffset .8s ease, stroke .3s; }
  /* no drop-shadow here — the teal-tinted halo rendered behind the arc read as
     artifacting (worst in dark mode / when the arc is red or amber) */
.ring__label { position: absolute; inset: 0; display: grid; place-content: center; }
.ring__pct { font-family: var(--f-head); font-weight: 800; font-size: 34px; color: var(--purple); }
/* small + wrappable: long caps ("by 16 Aug 2026") must sit clear of the donut arc */
.ring__cap { font-size: 10px; color: var(--muted); text-transform: uppercase;
  letter-spacing: .05em; max-width: 92px; margin: 2px auto 0; line-height: 1.35; text-align: center; }
.ring-card__note { font-size: 14px; color: var(--muted); margin: 8px 0 0; line-height: 1.4; }

/* bars */
.bars { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 13px; }
.bar__top { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 5px; }
.bar__name { color: var(--ink); font-weight: 500; }
.bar__val { color: var(--pink); font-weight: 700; font-family: var(--f-head); }
.bar__track { height: 9px; background: #ECE7DA; border-radius: 999px; overflow: hidden; box-shadow: inset 0 1px 2px rgba(10,17,40,.06); }
.bar__fill { height: 100%; background: var(--grad-fill); border-radius: 999px; box-shadow: 0 1px 3px rgba(27,59,111,.35); }

/* ---------- table ---------- */
.table-card { padding: 0; overflow: hidden; }
.table-card__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 22px 24px 16px; flex-wrap: wrap; }
.controls { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.segmented { display: inline-flex; background: #EDEADF; border-radius: 999px; padding: 4px; box-shadow: inset 0 1px 2px rgba(10,17,40,.06); }
.segmented button { border: 0; background: transparent; font-family: var(--f-body); font-weight: 600; font-size: 14px; color: var(--muted); padding: 7px 15px; border-radius: 999px; cursor: pointer; transition: color .15s ease; }
.segmented button.is-active { background: #fff; color: var(--purple); box-shadow: var(--shadow-xs); }
.search { font-family: var(--f-body); font-size: 14px; padding: 9px 15px; border-radius: 999px; border: 1.5px solid var(--line); min-width: 220px; transition: border-color .15s ease, box-shadow .15s ease; }
.search:focus { outline: none; border-color: var(--pink); box-shadow: 0 0 0 3px rgba(27,59,111,.13); }

.table__scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table thead th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: 10px 24px; background: #faf3f8; border-bottom: 1px solid var(--line); }
.table tbody td { padding: 13px 24px; border-bottom: 1px solid #f6eef4; font-size: 14px; vertical-align: middle; }
.table tbody tr { transition: background .12s ease; }
.table tbody tr:hover { background: #fdf6fb; }
.person { display: flex; align-items: center; gap: 11px; }
.person__av { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(140deg, var(--blossom), #fff); color: var(--purple); font-weight: 700; font-size: 12px; display: grid; place-items: center; flex: none; box-shadow: var(--shadow-xs); }
.person__name { font-weight: 600; }
.person__id { font-size: 12px; color: var(--muted); }
.course-cell { max-width: 320px; }
.due--late { color: var(--t-overdue); font-weight: 600; }

.badge { font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 999px; display: inline-block; white-space: nowrap; }
/* THE four states — status tokens only (orion-tokens.css); never reuse for decoration */
.badge--Overdue { background: var(--t-overdue-tint); color: var(--t-overdue); }
.badge--Open { background: var(--t-open-tint); color: var(--t-open); }
.badge--Scheduled { background: var(--t-scheduled-tint); color: var(--t-scheduled); }
.badge--Complete { background: var(--t-complete-tint); color: var(--t-complete); }

.rowbook { font-size: 14px; font-weight: 600; color: var(--purple); background: #EDEADF; border: 0; border-radius: 999px; padding: 7px 14px; cursor: pointer; transition: background .15s ease, color .15s ease, box-shadow .15s ease, transform .1s ease; }
.rowbook:hover { background: var(--grad-pink); color: #fff; box-shadow: 0 4px 12px rgba(27,59,111,.3); transform: translateY(-1px); }

.pager { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 18px; }
.pager__info { font-size: 14px; color: var(--muted); }

.footnote { text-align: center; font-size: 14px; color: var(--muted); margin-top: 26px; line-height: 1.5; }

/* ---------- drawer ---------- */
.drawer { position: fixed; inset: 0; background: rgba(43,20,48,.42); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); display: flex; justify-content: flex-end; z-index: 40; }
.drawer[hidden] { display: none; }
.drawer__panel { width: 420px; max-width: 92vw; background: #fff; height: 100%; padding: 32px 30px; box-shadow: -30px 0 70px rgba(43,20,48,.28); overflow-y: auto; animation: slide .28s cubic-bezier(.2,.8,.2,1); }
@keyframes slide { from { transform: translateX(40px); opacity: .3; } to { transform: none; opacity: 1; } }
.drawer__close { position: absolute; top: 18px; right: 22px; border: 0; background: #EDEADF; width: 34px; height: 34px; border-radius: 50%; font-size: 20px; color: var(--purple); cursor: pointer; transition: background .15s ease, transform .1s ease; }
.drawer__close:hover { background: #efe0ea; transform: rotate(90deg); }
.drawer h3 { font-size: 24px; color: var(--purple); margin: 6px 0 4px; }
.drawer__sub { color: var(--muted); font-size: 14px; margin: 0 0 20px; }
.slots { display: grid; gap: 10px; margin-bottom: 22px; }
.slot { border: 1.5px solid var(--line); border-radius: var(--r-sm); padding: 13px 16px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; font-size: 14px; transition: border-color .15s ease, background .15s ease, box-shadow .15s ease; }
.slot:hover { border-color: var(--pink); box-shadow: var(--shadow-xs); }
.slot.is-picked { border-color: var(--pink); background: #EEF2F9; box-shadow: 0 0 0 3px rgba(27,59,111,.12); }
.slot__cap { font-size: 12px; color: var(--muted); }
.drawer__mock { font-size: 12px; color: var(--muted); margin-top: 16px; line-height: 1.5; }

/* ---------- role chip + portal switching ---------- */
.pill--purple { background: var(--grad-purple); color: #fff; box-shadow: 0 2px 6px rgba(10,17,40,.28), 0 8px 20px rgba(10,17,40,.24); }
.pill--purple:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(10,17,40,.34), 0 14px 30px rgba(10,17,40,.30); filter: brightness(1.05); }
.rolechip { display: inline-flex; align-items: center; gap: 9px; padding: 5px 12px 5px 6px; background: var(--blossom-2); border-radius: 999px; box-shadow: var(--shadow-xs); }
.rolechip--manager { background: #ffe7d6; }
.rolechip--admin { background: #ece1f0; }
.rolechip__av { width: 32px; height: 32px; border-radius: 50%; background: #fff; color: var(--purple); font-family: var(--f-head); font-weight: 800; font-size: 12px; display: grid; place-items: center; }
.rolechip__txt { display: flex; flex-direction: column; line-height: 1.1; }
.rolechip__txt b { font-size: 14px; color: var(--ink); }
.rolechip__txt small { font-size: 11px; color: var(--muted); }

/* ---------- staff landing ---------- */
.hero--staff .hero__title { font-size: 42px; }
.hero--dash { padding-bottom: 40px; }
/* faint armillary watermark in the dashboard heroes — static line art, echoes the
   marketing sky without touching data. Gold reads on both the light (warm beige)
   and dark (navy) hero gradients; sits under .hero__inner (z-index 2). */
.hero--dash::before {
  content: ""; position: absolute; right: -70px; top: 50%; width: 400px; height: 400px;
  margin-top: -200px; pointer-events: none; z-index: 1; opacity: .16;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 400"><g stroke="%23C9A24D" fill="none"><circle cx="200" cy="200" r="150" stroke-width="1.5"/><circle cx="200" cy="200" r="128" stroke-width="0.6" stroke-dasharray="2 5"/><ellipse cx="200" cy="200" rx="150" ry="52" stroke-width="1.25"/><ellipse cx="200" cy="200" rx="150" ry="52" stroke-width="1" transform="rotate(60 200 200)"/><ellipse cx="200" cy="200" rx="150" ry="52" stroke-width="1" transform="rotate(120 200 200)"/><line x1="200" y1="50" x2="200" y2="350" stroke-width="1"/><line x1="142" y1="166" x2="200" y2="200" stroke="%23E4C878" stroke-width="1.5"/><line x1="200" y1="200" x2="258" y2="234" stroke="%23E4C878" stroke-width="1.5"/></g><g fill="%23C9A24D"><circle cx="142" cy="166" r="5.5"/><circle cx="200" cy="200" r="7"/><circle cx="258" cy="234" r="5.5"/></g></svg>') center / contain no-repeat;
}
[data-theme="dark"] .hero--dash::before { opacity: .13; }
/* Hero sitting INSIDE .wrap (calendar panels) — drop the outer margins/width cap so
   its edges line up exactly with the calendar + sidebar grid below it. */
.hero--flush { margin: 0 0 20px; width: auto; max-width: none; }

.chips { display: flex; gap: 16px; margin: -60px 0 24px; position: relative; z-index: 3; }
.chip { flex: 1; background: linear-gradient(180deg, #fff, #FFFEFB); border-radius: var(--r-md); padding: 18px 22px; box-shadow: var(--shadow); border: 1px solid rgba(10,17,40,.05); position: relative; overflow: hidden; display: flex; align-items: baseline; gap: 12px; transition: transform .16s cubic-bezier(.2,.8,.2,1), box-shadow .2s ease; }
.chip::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--c); }
.chip:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.chip__num { font-family: var(--f-head); font-weight: 800; font-size: 34px; color: var(--c); }
.chip__lbl { font-weight: 600; color: var(--ink); }

.panels--staff { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.mylist, .certs { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; }
/* "Your training" filter chips — toggle a status / training type in or out */
.fbar { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 14px 0 2px; }
.fchips { display: flex; flex-wrap: wrap; gap: 6px; }
.fchip {
  font-family: var(--f-body); font-size: 12px; font-weight: 600; cursor: pointer;
  border: 1.5px solid var(--line); border-radius: 999px; padding: 5px 12px;
  background: transparent; color: var(--muted); opacity: .55;
  transition: background .15s ease, color .15s ease, border-color .15s ease, opacity .15s ease;
}
.fchip.is-on { opacity: 1; background: var(--cbg, var(--chip-bg)); color: var(--c, var(--purple)); border-color: transparent; }
/* explicit in/out mark: ✓ = shown, ✕ = filtered out */
.fchip::before { content: "✕"; margin-right: 5px; font-size: 10px; opacity: .8; }
.fchip.is-on::before { content: "✓"; }
.fchip:hover { border-color: var(--pink); opacity: 1; }
[data-theme="dark"] .fchip.is-on { background: color-mix(in srgb, var(--c, #9FB0CC) 22%, transparent); }
.mylist__empty { padding: 16px 0; font-size: 14px; color: var(--muted); list-style: none; }

.myitem { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid #f4ecf2; }
.myitem:last-child { border-bottom: 0; }
.myitem__body { flex: 1; display: flex; flex-direction: column; }
.myitem__body b { font-size: 16px; }
.myitem__body small { font-size: 14px; color: var(--muted); margin-top: 2px; }
.myitem__ok { font-size: 14px; color: var(--teal); font-weight: 600; white-space: nowrap; }
.myitem__booked { color: var(--blue); }

/* rotating sync indicator */
.syncpill { position: fixed; bottom: 22px; right: 22px; z-index: 60; display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,.85); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(10,17,40,.08); box-shadow: var(--shadow); border-radius: 999px;
  padding: 10px 18px; font-size: 14px; font-weight: 600; color: var(--purple); }
.syncpill[hidden] { display: none; }   /* attribute must win over display:flex above */
/* mini armillary spinner (ring + Orion's belt) — inherits the pill's text colour */
.syncpill__spin { width: 16px; height: 16px; color: #C9A24D; animation: spin 1.4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Orion's-belt flourish on empty states — three quiet gold stars before the text */
.mylist__empty::before, .certs__empty::before, .sessions__empty::before,
.cal-empty::before, .reql__empty::before, .editcert__empty::before {
  content: ""; display: inline-block; width: 26px; height: 12px; margin-right: 8px;
  vertical-align: -1px; opacity: .75;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 44 20"><g fill="%23C9A24D"><circle cx="7" cy="14" r="3"/><circle cx="22" cy="10" r="3.6"/><circle cx="37" cy="6" r="3"/></g><line x1="7" y1="14" x2="22" y2="10" stroke="%23C9A24D" stroke-width="1" opacity=".5"/><line x1="22" y1="10" x2="37" y2="6" stroke="%23C9A24D" stroke-width="1" opacity=".5"/></svg>') center / contain no-repeat;
}
.cert { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid #f4ecf2; }
.cert:last-child { border-bottom: 0; }
.cert__body { flex: 1; display: flex; flex-direction: column; }
.cert__body b { font-size: 16px; }
.cert__body small { font-size: 14px; color: var(--muted); margin-top: 2px; }
.certs__empty { color: var(--muted); font-size: 14px; padding: 10px 0; }
.myitem__await { font-size: 14px; color: var(--muted); font-weight: 600; white-space: nowrap; }

/* staff — booked sessions */
.sessions-card { margin-top: 20px; }
.sessions { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; }
.session { display: flex; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid #f4ecf2; }
.session:last-child { border-bottom: 0; }
.session__cal { flex: 0 0 52px; height: 52px; border-radius: 14px; background: linear-gradient(160deg, #eef4fa, #dde9f3); color: var(--blue);
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; box-shadow: var(--shadow-xs); }
.session__cal b { font-family: var(--f-head); font-size: 20px; }
.session__cal small { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; margin-top: 2px; }
.session__body { flex: 1; display: flex; flex-direction: column; }
.session__body b { font-size: 16px; }
.session__body small { font-size: 14px; color: var(--muted); margin-top: 2px; }
.session__loc { color: var(--berry) !important; }
.sessions__empty { color: var(--muted); font-size: 14px; padding: 10px 0; }
.rowactions { display: flex; gap: 8px; justify-content: flex-end; }
.rowbook--ghost { background: #fff; border: 1.5px solid var(--line); color: var(--purple); }
.rowbook--ghost:hover { border-color: var(--pink); color: var(--pink); background: #fff; box-shadow: var(--shadow-xs); }
a.rowbook, a.rowbook--ghost { display: inline-block; text-decoration: none; }
.rowupload { font-size: 14px; font-weight: 600; color: #fff; background: linear-gradient(135deg, #D8B45F, var(--ochre)); border: 0; border-radius: 999px; padding: 7px 14px; cursor: pointer; white-space: nowrap; box-shadow: 0 3px 10px rgba(201,162,77,.28); transition: transform .1s ease, box-shadow .15s ease, filter .15s ease; }
.rowupload:hover { filter: brightness(1.05); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(201,162,77,.34); }

/* portal cards */
.portals { margin-top: 26px; }
.portals__h { font-size: 20px; color: var(--purple); }
.portals__sub { color: var(--muted); font-size: 14px; margin: 4px 0 16px; }
.portals__row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.portalcard { display: flex; align-items: center; gap: 16px; text-align: left; background: linear-gradient(180deg, #fff, #FFFEFB); border: 1px solid rgba(10,17,40,.06); border-radius: var(--r-md); padding: 20px 22px; cursor: pointer; transition: border-color .15s, box-shadow .2s, transform .16s cubic-bezier(.2,.8,.2,1); font-family: var(--f-body); box-shadow: var(--shadow-xs); }
.portalcard:hover { border-color: var(--pink); box-shadow: var(--shadow); transform: translateY(-3px); }
.portalcard__ic { width: 46px; height: 46px; border-radius: 14px; background: color-mix(in srgb, var(--pc) 16%, #fff); color: var(--pc); display: grid; place-items: center; font-size: 22px; flex: none; box-shadow: var(--shadow-xs); }
.portalcard b { font-family: var(--f-head); font-size: 16px; color: var(--ink); display: block; }
.portalcard small { font-size: 14px; color: var(--muted); }
.portalcard__go { margin-left: auto; font-weight: 600; color: var(--pink); font-size: 14px; white-space: nowrap; transition: transform .15s ease; }
.portalcard:hover .portalcard__go { transform: translateX(3px); }

/* course management panel */
.course-search { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.course-search__input { flex: 1 1 320px; min-width: 0; font-family: var(--f-body); font-size: 15px; padding: 12px 16px; border: 1.5px solid var(--line); border-radius: 12px; color: var(--ink); background: #fff; transition: border-color .15s ease, box-shadow .15s ease; }
.course-search__input:focus { outline: none; border-color: var(--pink); box-shadow: 0 0 0 3px rgba(27,59,111,.12); }
.course-search__count { font-size: 14px; font-weight: 600; color: var(--muted); white-space: nowrap; }
/* min(100%, 300px) floor keeps a tile from ever exceeding the viewport on narrow screens */
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 20px; }
/* flex column + margin-top:auto on the actions => Save / Assign always sit at the tile's
   bottom, aligned across a row regardless of how many lines the title wraps to */
.course-card { display: flex; flex-direction: column; min-width: 0; }
.course-card .card__title { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.course-tag { font-size: 11px; font-weight: 700; letter-spacing: .02em; padding: 4px 10px; border-radius: 999px; background: var(--chip-bg); color: var(--purple); white-space: nowrap; }
.course-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px; }
.course-fields label { font-size: 12px; font-weight: 600; color: var(--muted); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.course-fields input[type=number], .course-fields select { width: 100%; min-width: 0; max-width: 100%; font-family: var(--f-body); font-size: 14px; padding: 9px 12px; border: 1.5px solid var(--line); border-radius: 10px; color: var(--ink); background: var(--field); transition: border-color .15s ease; }
.course-fields input:focus, .course-fields select:focus { outline: none; border-color: var(--pink); box-shadow: 0 0 0 3px rgba(27,59,111,.12); }
.course-check { flex-direction: row !important; align-items: center; grid-column: span 2; color: var(--ink) !important; font-weight: 500 !important; }
.course-check input { width: 16px; height: 16px; }
.course-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: auto; }
.course-saved { font-size: 14px; color: var(--teal); font-weight: 600; }

/* compliance projection — trajectory cells (▲ becoming compliant / ▼ going overdue) */
.pcell { white-space: nowrap; }
.pcell__pct { display: block; font-family: var(--f-head); font-weight: 800; font-size: 16px; }
.pcell__delta { display: block; font-size: 11.5px; font-weight: 700; margin-top: 2px; }
.pcell__delta span { margin-right: 8px; }

/* ---------- Orion Horizon (projection console) ---------- */
.hconsole { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.panels--horizon { grid-template-columns: 320px minmax(0, 1fr); }
.hchart { width: 100%; height: auto; display: block; margin-top: 6px; }
.hchart__grid { stroke: var(--t-line); stroke-width: 1; }
.hchart__ylab { font: 600 11px var(--f-body); fill: var(--muted); text-anchor: end; }
.hchart__xlab { font: 700 12px var(--f-body); fill: var(--ink); text-anchor: middle; }
.hchart__xcap { font: 600 10.5px var(--f-body); fill: var(--muted); text-anchor: middle; }
.hchart__val { font: 800 13px var(--f-head); fill: var(--ink); text-anchor: middle; }
.hchart__pt[data-m] { cursor: pointer; }
.hchart__pt[data-m]:focus-visible { outline: 2px solid var(--t-focus); outline-offset: 2px; }
.hspark { width: 80px; height: 24px; display: block; }
.pdelta { font-weight: 700; font-size: 11.5px; padding: 1px 7px; border-radius: 999px; }
.pdelta--up { background: var(--t-complete-tint); color: var(--t-complete); }
.pdelta--down { background: var(--t-overdue-tint); color: var(--t-overdue); }
td.pcell--sel { background: rgba(201, 162, 77, .09); }
th.pcell--sel { box-shadow: inset 0 -2px 0 var(--t-focus); }
[data-theme="dark"] td.pcell--sel { background: rgba(201, 162, 77, .14); }
@media (max-width: 980px) { .panels--horizon { grid-template-columns: 1fr; } }

/* ---------- Debug: live activity feed ---------- */
.livedot { display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  background: var(--t-complete); margin-right: 6px; animation: livedot-pulse 2s infinite; }
.livedot--paused { background: var(--muted); animation: none; }
@keyframes livedot-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.debug-logline .tagchip { flex: none; }

/* ---------- admin Workroom: left sidebar + content ---------- */
.adminlayout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; }
.sidenav { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 14px; }
.sidenav__nav { display: flex; flex-direction: column; gap: 4px; background: linear-gradient(180deg, #fff, #FFFEFB);
  border: 1px solid rgba(10,17,40,.06); border-radius: var(--r-md); padding: 10px; box-shadow: var(--shadow-sm); }
.sidenav__item { display: flex; align-items: center; gap: 10px; text-align: left; font-family: var(--f-body);
  font-weight: 600; font-size: 14px; color: var(--muted); background: transparent; border: 0; border-radius: 12px;
  padding: 11px 13px; cursor: pointer; transition: background .15s ease, color .15s ease, transform .1s ease; }
.sidenav__item:hover { background: #EDEADF; color: var(--ink); }
.sidenav__item.is-active { background: var(--grad-purple); color: #fff; box-shadow: 0 3px 10px rgba(10,17,40,.26); }
.sidenav__ic { font-size: 16px; width: 20px; text-align: center; }
.sidenav__assign { width: 100%; }
.adminmain { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.worktiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.worktile { display: flex; flex-direction: column; gap: 4px; text-align: left; font-family: var(--f-body);
  background: linear-gradient(180deg, #fff, #FFFEFB); border: 1px solid rgba(10,17,40,.06); border-radius: var(--r-md);
  padding: 18px 20px; cursor: pointer; box-shadow: var(--shadow-xs);
  transition: transform .16s cubic-bezier(.2,.8,.2,1), box-shadow .2s ease, border-color .15s ease; }
.worktile:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--pink); }
.worktile b { font-family: var(--f-head); font-size: 15px; color: var(--ink); }
.worktile small { font-size: 14px; color: var(--muted); flex: 1; line-height: 1.4; }
.worktile__go { font-weight: 600; color: var(--pink); font-size: 14px; margin-top: 6px; }

/* offline / wrong-URL warning bar */
.offlinebar { position: sticky; top: 0; z-index: 100; background: #b3261e; color: #fff;
  font-size: 14px; text-align: center; padding: 11px 18px; line-height: 1.5; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.offlinebar a { color: #fff; font-weight: 700; text-decoration: underline; }

/* banners */
.banner { border-radius: var(--r-md); padding: 14px 18px; font-size: 14px; margin-bottom: 22px; line-height: 1.5; box-shadow: var(--shadow-xs); }
.banner--manager { background: linear-gradient(180deg, #fff0e4, #ffe7d6); color: #7a3a10; }
.banner--admin { background: linear-gradient(180deg, #f3ebf7, #ece1f0); color: #4c1150; }

/* admin edit affordances */
.rowedit { font-size: 14px; font-weight: 600; color: #fff; background: var(--grad-purple); border: 0; border-radius: 999px; padding: 7px 16px; cursor: pointer; box-shadow: 0 3px 10px rgba(10,17,40,.26); transition: transform .1s ease, box-shadow .15s ease, filter .15s ease; }
.rowedit:hover { filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(10,17,40,.32); }
.field { display: block; margin: 0 0 16px; }
.field span { display: block; font-size: 14px; font-weight: 600; color: var(--purple); margin-bottom: 6px; }
.select--sm { width: 100%; padding: 11px 14px; font-size: 15px; border-radius: 10px; }
.pill--sm { padding: 6px 13px; font-size: 14px; }
.card__headrow { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.editcert { margin: 16px 0 4px; padding-top: 14px; border-top: 1px solid var(--line); }
.editcert__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.editcert__row { display: flex; align-items: center; gap: 10px; }
.editcert__name { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.editcert__date { font-size: 14px; color: var(--muted); white-space: nowrap; }
.editcert__empty { color: var(--muted); font-size: 14px; }
.certupload { display: flex; gap: 8px; align-items: center; margin: 10px 0 2px; }
.certupload .select--sm { flex: 1; }
.certupload .pill { white-space: nowrap; }

/* ---------- calendar + bookings ---------- */
.calwrap { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; }
.calcard { padding: 20px 22px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.cal-head .card__title { margin: 0; }
.cal-nav { width: 34px; height: 34px; border-radius: 10px; border: 1.5px solid var(--line); background: #fff;
  font-size: 18px; color: var(--purple); cursor: pointer; line-height: 1; transition: border-color .15s ease, color .15s ease, box-shadow .15s ease, transform .1s ease; }
.cal-nav:hover { border-color: var(--pink); color: var(--pink); box-shadow: var(--shadow-xs); transform: translateY(-1px); }
.cal { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.cal .dow { text-align: center; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding-bottom: 4px; }
.day { min-width: 0; min-height: 104px; border: 1px solid #f0e6ee; border-radius: 12px; padding: 7px 9px; background: #fff; transition: border-color .15s ease, box-shadow .15s ease; }
.day.blank { border: 0; background: transparent; }
.day.has { cursor: pointer; }
.day.has:hover { border-color: var(--pink); box-shadow: var(--shadow-sm); }
.day.today { border-color: var(--pink); }
.day.sel { background: #EEF2F9; border-color: var(--pink); box-shadow: 0 0 0 2px rgba(27,59,111,.15); }
.cal-n { font-size: 14px; font-weight: 700; color: var(--ink); }
.evts { margin-top: 5px; display: flex; flex-direction: column; gap: 4px; }
.evt { font-size: 11px; font-weight: 600; color: var(--ink); background: #EDEADF; border-left: 3px solid var(--purple);
  border-radius: 5px; padding: 3px 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.evt.full { opacity: .55; text-decoration: line-through; }
.cal-more { font-size: 10px; color: var(--muted); font-weight: 600; }
.day-detail { margin-top: 18px; border-top: 1px solid #f0e6ee; padding-top: 16px; }
.cal-empty { color: var(--muted); font-size: 14px; font-style: italic; padding: 6px 0; }
.cal-muted { color: var(--muted); font-size: 14px; }
.sess { border: 1px solid #f0e6ee; border-left: 4px solid var(--purple); border-radius: 12px; padding: 13px 15px; margin-bottom: 12px; box-shadow: var(--shadow-xs); }
.sess__head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.sess__head b { font-size: 16px; }
.sess__head small { display: block; font-size: 14px; color: var(--muted); margin-top: 2px; }
.sess__seats { font-size: 12px; font-weight: 700; color: var(--teal); white-space: nowrap; }
.sess__desc { font-size: 14px; color: var(--muted); margin: 6px 0 2px; }
.sess__desc a { color: var(--blue); font-weight: 600; white-space: nowrap; }
.sess__seats.is-full { color: var(--pink); }
.sess__capbar { height: 7px; background: #ECE7DA; border-radius: 999px; overflow: hidden; margin: 8px 0 2px; box-shadow: inset 0 1px 2px rgba(10,17,40,.06); }
.sess__capbar > span { display: block; height: 100%; border-radius: 999px; transition: width .5s cubic-bezier(.2,.8,.2,1); box-shadow: 0 1px 3px rgba(10,17,40,.25); }
.sess__who { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.attchip { display: inline-flex; align-items: center; gap: 4px; background: #e6eef5; color: var(--blue);
  font-size: 12px; font-weight: 600; border-radius: 999px; padding: 4px 10px; }
.attchip__x { border: 0; background: transparent; color: var(--blue); cursor: pointer; font-size: 14px; line-height: 1; padding: 0; opacity: .6; }
.attchip__x:hover { opacity: 1; }
/* attendance state on booking chips: ✓ attended / ✗ absent / ? past-but-unrecorded */
.attchip--attended { background: #DCEFE6; color: var(--teal); }
.attchip--absent { background: #F7E4E1; color: #C0392B; }
.attchip__st { font-size: 11px; font-weight: 800; line-height: 1; }
.attchip__st--ok { color: var(--teal); }
.attchip__st--no { color: #C0392B; }
.attchip__st--nr { color: var(--muted); }
.attchip__set { border: 0; background: rgba(10,17,40,.07); border-radius: 999px; width: 17px; height: 17px;
  display: inline-grid; place-items: center; cursor: pointer; font-size: 10px; line-height: 1;
  color: var(--muted); padding: 0; opacity: .75; transition: opacity .12s ease, background .12s ease; }
.attchip__set:hover { opacity: 1; background: rgba(10,17,40,.14); }
.attchip__set--ok:hover { color: var(--teal); }
.attchip__set--no:hover { color: #C0392B; }
[data-theme="dark"] .attchip--attended { background: rgba(46,125,91,.30); color: #8FD4B4; }
[data-theme="dark"] .attchip--absent { background: rgba(192,57,43,.26); color: #F0A29A; }
[data-theme="dark"] .attchip__set { background: rgba(255,255,255,.10); color: #B8CDEC; }
[data-theme="dark"] .attchip__set:hover { background: rgba(255,255,255,.20); }
.badge--muted { background: var(--chip-bg); color: var(--muted); }
.sess__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.sess__book { margin-top: 10px; }
.sess__edit { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.sess__edit .field { margin-bottom: 10px; }
.sess__edit .field span { font-size: 12px; }
.sess__results { margin-top: 6px; display: flex; flex-direction: column; }
.sess__result { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; transition: background .12s ease; }
.sess__result:hover { background: #EEF2F9; }
.sess__add { color: var(--pink); font-weight: 700; font-size: 14px; white-space: nowrap; }
.calside { display: flex; flex-direction: column; gap: 20px; }
.indtpl { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; }
.indtpl li { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid #f4ecf2; }
.indtpl li:last-child { border-bottom: 0; }
.indtpl__day { flex: 0 0 66px; font-size: 11px; font-weight: 700; color: var(--purple); text-transform: uppercase; letter-spacing: .04em; }
.indtpl__body { display: flex; flex-direction: column; min-width: 0; }
.indtpl__body b { font-size: 14px; color: var(--ink); }
.indtpl__body small { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.ss-addcourse { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.ss-addcourse .select--sm { flex: 1; }
.ss-addcourse .pill { white-space: nowrap; }
.courselist { list-style: none; margin: 12px 0 0; padding: 0; max-height: 220px; overflow-y: auto; }
.courseitem { display: flex; justify-content: space-between; align-items: center; gap: 10px;
  font-size: 14px; padding: 7px 0; border-bottom: 1px solid #f4ecf2; }
.courseitem:last-child { border-bottom: 0; }
.courseitem__x { border: 0; background: transparent; color: var(--pink); cursor: pointer; font-size: 16px; line-height: 1; padding: 0 2px; }
.courseitem__x:hover { color: #b01f4c; }
.ss-row { display: grid; grid-template-columns: 1fr 90px; gap: 10px; }
.agenda { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; }
.agenda__item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid #f4ecf2; cursor: pointer; }
.agenda__item:last-child { border-bottom: 0; }
.agenda__item:hover .agenda__body b { color: var(--pink); }
.agenda__body { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.agenda__body b { font-size: 14px; transition: color .15s ease; }
.agenda__body small { font-size: 12px; color: var(--muted); margin-top: 1px; }

@media (max-width: 900px) {
  .chips { flex-direction: column; margin-top: 16px; }
  .panels--staff, .portals__row { grid-template-columns: 1fr; }

  .nav__links { display: none; }
  .hero { padding: 32px 24px; margin: 16px; }
  .hero__title { font-size: 34px; }
  .wrap { padding: 20px 16px 50px; }
  .stats { grid-template-columns: 1fr; }
  .panels { grid-template-columns: 1fr; }
  .calwrap { grid-template-columns: 1fr; }
  .adminlayout { grid-template-columns: 1fr; }
  .sidenav { position: static; }
  .col-site { display: none; }
  .course-search { flex-direction: column; align-items: stretch; }
}

/* phones / small tablets in portrait: single-column course fields so nothing crowds or clips */
@media (max-width: 560px) {
  .course-grid { grid-template-columns: 1fr; }
  .course-fields { grid-template-columns: 1fr; }
  .course-check { grid-column: auto; }
  .course-actions .pill { flex: 1 1 auto; text-align: center; }
}

/* ============================================================================
   Login screen (Stage 2.4 auth gate) — uses the themed palette; no layout impact
   on the rest of the app.
   ========================================================================== */
/* The sign-in screen is the brand moment: always the night sky (both themes) —
   void navy, drifting starfield, the armillary turning faintly behind the card.
   Matches website/coming-soon; the app's own light/dark theme takes over after login. */
.nav:empty { display: none; }   /* the emptied header must not paint a light strip over the sky */
.login { position: relative; overflow: hidden; min-height: calc(100vh - 6px);
  display: flex; align-items: center; justify-content: center; padding: 48px 20px;
  background: #0A1128;
  background-image:
    radial-gradient(1000px 520px at 50% -10%, rgba(201,162,77,.14), transparent 62%),
    radial-gradient(700px 460px at 88% 106%, rgba(27,59,111,.38), transparent 60%); }
.login::before, .login::after { content: ""; position: absolute; inset: -50vh 0 0 0;
  pointer-events: none; background-repeat: repeat; }
.login::before {
  background-image: radial-gradient(1.4px 1.4px at 22px 34px, rgba(247,245,239,.7), transparent 55%),
                    radial-gradient(1.2px 1.2px at 187px 121px, rgba(247,245,239,.5), transparent 55%),
                    radial-gradient(1px 1px at 96px 208px, rgba(228,200,120,.55), transparent 55%),
                    radial-gradient(1.3px 1.3px at 261px 66px, rgba(247,245,239,.4), transparent 55%);
  background-size: 320px 280px; animation: login-drift 240s linear infinite; }
.login::after {
  background-image: radial-gradient(1px 1px at 47px 152px, rgba(247,245,239,.35), transparent 55%),
                    radial-gradient(1.1px 1.1px at 224px 41px, rgba(228,200,120,.4), transparent 55%),
                    radial-gradient(.9px .9px at 141px 246px, rgba(247,245,239,.3), transparent 55%);
  background-size: 410px 360px; animation: login-drift 360s linear infinite reverse; }
@keyframes login-drift { to { transform: translateY(50vh); } }
/* the sky's own armillary: enormous, barely-there atmosphere behind everything */
.login__arm { position: absolute; width: 150vmin; height: 150vmin; left: 50%; top: 50%;
  transform: translate(-50%, -50%); opacity: .07; pointer-events: none; }
.login__arm .arm-spin  { animation: login-spin 90s linear infinite; transform-origin: 200px 200px; }
.login__arm .arm-spin2 { animation: login-spin 140s linear infinite reverse; transform-origin: 200px 200px; }
@keyframes login-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .login::before, .login::after,
  .login__arm .arm-spin, .login__arm .arm-spin2,
  .login__mark-arm .arm-spin, .login__mark-arm .arm-spin2 { animation: none; }
}
.login__card { position: relative; z-index: 2; width: 100%; max-width: 380px;
  background: rgba(13,21,48,.88); border: 1px solid rgba(201,162,77,.35);
  border-radius: var(--r-lg); box-shadow: 0 24px 64px rgba(0,0,0,.55), 0 0 42px rgba(201,162,77,.08);
  backdrop-filter: blur(6px); padding: 36px 32px; display: flex; flex-direction: column; }
/* the card's living mark: the armillary itself, slowly turning above the wordmark */
.login__mark-arm { display: block; width: 116px; height: 116px; margin: 2px auto 12px;
  filter: drop-shadow(0 0 22px rgba(201,162,77,.35)); }
.login__mark-arm .arm-spin  { animation: login-spin 60s linear infinite; transform-origin: 200px 200px; }
.login__mark-arm .arm-spin2 { animation: login-spin 96s linear infinite reverse; transform-origin: 200px 200px; }
.login__mark { display: flex; justify-content: center; margin-bottom: 14px; }
.login__mark .brand__mark { display: none; }   /* the big armillary above replaces the small berry */
.login__mark .brand__word { font-size: 30px; color: #F7F5EF; }
.login__mark .brand__dot { color: #C9A24D; }
.login__title { font-family: var(--f-head); font-weight: 800; font-size: 23px; color: #F7F5EF; text-align: center; }
.login__sub { font-family: var(--f-body); font-size: 12px; font-weight: 600; color: #C9A24D; text-align: center;
  margin: 6px 0 22px; text-transform: uppercase; letter-spacing: .24em; }
.login__lbl { font-size: 11px; font-weight: 700; color: #E4C878; margin: 10px 0 5px; text-transform: uppercase; letter-spacing: .05em; }
.login__in { padding: 12px 14px; border: 1px solid rgba(184,189,203,.28); border-radius: var(--r-sm);
  background: rgba(10,17,40,.7); color: #F7F5EF; font-family: var(--f-body); font-size: 15px; }
.login__in::placeholder { color: rgba(184,189,203,.55); }
.login__in:focus { outline: none; border-color: #C9A24D; box-shadow: 0 0 0 3px rgba(201,162,77,.2); }
.login__err { color: #E4938B; font-size: 14px; margin-top: 12px; text-align: center; }
.login__btn { margin-top: 22px; padding: 13px; border: 0; border-radius: 999px; background: #C9A24D;
  color: #0A1128; font-family: var(--f-head); font-weight: 700; font-size: 15px; cursor: pointer;
  box-shadow: 0 4px 18px rgba(201,162,77,.3); transition: background .15s ease, transform .12s ease; }
.login__btn:hover { background: #E4C878; transform: translateY(-1px); }
.login__btn:disabled { opacity: .7; cursor: default; transform: none; }
.login__demo { margin-top: 22px; padding: 12px 14px; border: 1px dashed rgba(201,162,77,.4);
  border-radius: var(--r-sm); font-size: 12px; color: rgba(184,189,203,.85); text-align: center; line-height: 1.9; }
.login__demo b { color: #F7F5EF; }
.login__demo-h { display: block; font-size: 10px; font-weight: 700; letter-spacing: .22em;
  text-transform: uppercase; color: #C9A24D; margin-bottom: 2px; }
.login__sso { display: flex; flex-direction: column; }
.login__sso[hidden] { display: none; }
.login__or { display: flex; align-items: center; gap: 10px; margin-top: 16px;
  color: rgba(184,189,203,.7); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.login__or::before, .login__or::after { content: ""; flex: 1; height: 1px; background: rgba(184,189,203,.22); }
.login__btn--sso { margin-top: 16px; background: transparent; color: #F7F5EF;
  border: 1.5px solid rgba(247,245,239,.4); box-shadow: none; }
.login__btn--sso:hover { background: transparent; border-color: #F7F5EF; }
.login__pw { position: relative; display: flex; }
.login__pw .login__in { flex: 1; padding-right: 62px; }
.login__eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: none; border: 0; color: rgba(184,189,203,.8); font-size: 11px; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase; cursor: pointer; padding: 6px 8px; }
.login__eye:hover { color: #E4C878; }

/* toast + Super Admin management console */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(12px);
  background: var(--purple); color: #fff; padding: 12px 20px; border-radius: 999px;
  font-family: var(--f-body); font-size: 14px; font-weight: 600; box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; z-index: 4000; }
.toast--show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast--warn { background: #C0392B; }
.mgmt__bar { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.mgmt__bar .search { flex: 1; min-width: 220px; }
.mgmt__bar .select { max-width: 220px; }
/* access control matrix (Workroom → Access Control) */
.acl th { white-space: nowrap; }
.acl__role small { display: block; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--muted); }
.acl__delrole { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 14px; padding: 0 2px; }
.acl__delrole:hover { color: #C0392B; }
.acl__cat td { background: var(--blossom-2); font-family: var(--f-head); font-weight: 800; font-size: 12px;
  text-transform: uppercase; letter-spacing: .06em; color: var(--purple); padding: 8px 24px; }
[data-theme="dark"] .acl__cat td { background: #0E1C3A; }
.acl__perm small { display: block; color: var(--muted); font-size: 11px; }
.acl__cell { padding: 7px 32px 7px 12px; font-size: 14px; border-radius: 10px; min-width: 118px; }
.acl__cell.is-yes { color: var(--teal); }
.acl__cell.is-no { color: #C0392B; }
.acl__cell.is-ov { border-color: var(--ochre); font-weight: 700; }
.acl__new { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px; }
.acl__new input { flex: 1 1 220px; }
.acl__newcard { margin-top: 20px; }

/* impersonation bar — shown while an admin is signed in as someone else */
.impbar { position: sticky; top: 0; z-index: 120; display: flex; align-items: center; justify-content: center;
  gap: 14px; flex-wrap: wrap; padding: 9px 18px; font-size: 14px; font-weight: 500;
  background: linear-gradient(90deg, #C9A24D, #A9843C); color: #fff; box-shadow: 0 2px 10px rgba(10,17,40,.25); }
.impbar__btn { border: 0; border-radius: 999px; padding: 6px 14px; font-family: var(--f-body);
  font-size: 14px; font-weight: 700; background: #fff; color: #7a5b16; cursor: pointer; }
.impbar__btn:hover { filter: brightness(.95); }
.mgmt-actions { white-space: nowrap; }
.mgmt-actions .pill + .pill { margin-left: 6px; }

/* inline site-scope editor (Management → Assigned sites) */
.mgmt-sitesrow td { background: var(--blossom-2); }
.siteedit { display: flex; flex-direction: column; gap: 10px; padding: 6px 2px; }
.siteedit__opts { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.siteedit__opt { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; color: var(--ink); cursor: pointer; }
.siteedit__actions { display: flex; gap: 8px; }
[data-theme="dark"] .mgmt-sitesrow td { background: #0E1C3A; }
.mgmt__foot { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; flex-wrap: wrap; gap: 10px; }
.mgmt__pager { display: flex; align-items: center; gap: 10px; }
.mgmt__pager .pill:disabled { opacity: .5; cursor: default; }

/* ============================================================================
   Competency assessment tool + My Competencies staff tab
   ========================================================================== */

/* Admin tool layout */
.comp-tool { display: flex; flex-direction: column; gap: 20px; }
.comp-step { }
.comp-selrow { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; margin-top: 14px; }
.comp-selrow .field { flex: 1 1 220px; margin: 0; }
.comp-selrow .pill { flex: none; align-self: flex-end; margin-bottom: 1px; }
.comp-err { font-size: 14px; color: var(--pink); margin: 8px 0 0; font-weight: 600; }

/* Checklist items */
.comp-items { display: flex; flex-direction: column; gap: 6px; margin-top: 16px; }
/* Read-only view (staff portal, admin history) */
.comp-item { display: flex; align-items: flex-start; gap: 10px; padding: 9px 12px;
  border-radius: 10px; background: var(--bg); border: 1px solid var(--line); font-size: 14px; }
.comp-item--pass { background: #e8f5ef; border-color: #b8dfc9; }
.comp-item--pass .comp-item__tick { color: var(--teal); font-weight: 700; }
.comp-item--pending { opacity: .7; }
.comp-item__tick { flex: none; font-size: 16px; width: 20px; color: var(--muted); }
.comp-item__name { flex: 1; line-height: 1.4; }
.comp-item__roles { font-size: 11px; color: var(--muted); white-space: nowrap; flex: none; }
/* Checkable items (admin assessment) */
.comp-item--check { cursor: pointer; gap: 12px; transition: background .12s ease, border-color .12s ease; }
.comp-item--check:hover { border-color: var(--pink); background: #f9f4fb; }
.comp-item--check input[type=checkbox] { width: 18px; height: 18px; flex: none; cursor: pointer;
  accent-color: var(--teal); margin: 0; }
.comp-item--check.comp-item--pass { background: #e8f5ef; border-color: #b8dfc9; }

/* Progress bar within the tool */
.comp-progress { display: flex; align-items: center; gap: 14px; margin-top: 14px; font-size: 14px; color: var(--muted); font-weight: 600; }
.comp-pbar { flex: 1; height: 8px; background: #ECE7DA; border-radius: 999px; overflow: hidden; }
.comp-pbar__fill { height: 100%; background: var(--grad-fill); border-radius: 999px; transition: width .4s cubic-bezier(.2,.8,.2,1); }

/* Confirm row */
.comp-confirm-row { display: flex; flex-direction: column; gap: 10px; }
.comp-confirm-row .pill { width: fit-content; }
.comp-confirm-row .field { margin: 0; max-width: 480px; }
.comp-done { font-size: 14px; color: var(--teal); font-weight: 600; margin: 0; }

/* Multi-staff picker (chips + live suggestions) */
.comp-staff-field { position: relative; }
.comp-staff-input { position: relative; }
.comp-suggest { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px);
  background: var(--card, #fff); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg);
  overflow: hidden; max-height: 280px; overflow-y: auto; }
.comp-suggest__item { display: block; width: 100%; text-align: left; border: 0; background: transparent;
  padding: 9px 12px; cursor: pointer; font-size: 14px; color: var(--ink); }
.comp-suggest__item:hover { background: var(--blossom-2, #f4eefb); }
.comp-suggest__item small { color: var(--muted); }
.comp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.comp-chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 6px 5px 12px; border-radius: 999px;
  background: var(--blossom-2, #f4eefb); color: var(--purple); font-size: 14px; font-weight: 600; }
.comp-chip small { color: var(--muted); font-weight: 500; }
.comp-chip__x { border: 0; background: rgba(0,0,0,.08); color: inherit; width: 20px; height: 20px; border-radius: 50%;
  cursor: pointer; font-size: 14px; line-height: 1; display: grid; place-items: center; }
.comp-chip__x:hover { background: var(--pink); color: #fff; }

/* Framework (full competency) sections in the checklist */
.comp-fwlist { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.comp-fw { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.comp-fw__head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--bg); }
.comp-fw__toggle { border: 0; background: transparent; cursor: pointer; font-size: 14px; color: var(--muted); width: 18px; }
.comp-fw__name { font-weight: 700; flex: 1; }
.comp-fw__count { font-size: 12px; color: var(--muted); font-weight: 600; }
.comp-fw__all { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.comp-fw__all input { accent-color: var(--teal); }
.comp-fw__items { padding: 0 14px 14px; }
[data-theme="dark"] .comp-fw__head { background: #10203F; }
[data-theme="dark"] .comp-suggest { background: #10203F; }
[data-theme="dark"] .comp-suggest__item { color: var(--ink); }
[data-theme="dark"] .comp-suggest__item:hover { background: #182A4C; }
[data-theme="dark"] .comp-chip { background: #182A4C; color: #cbb7ee; }

/* Staff portal: My Competencies cards */
.comp-history-card { margin-bottom: 20px; }
.comp-history-card .card__headrow { margin-bottom: 6px; }

/* Competency drill-down: Annual Refresher -> full competency -> sub-competency */
.comp-dl-actions { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.comp-chip__csv { text-decoration: none; color: var(--purple); font-size: 14px; padding: 0 2px; }
.comp-chip__csv:hover { color: var(--teal); }
.rowcomp { text-decoration: none; color: var(--purple); font-size: 14px; font-weight: 600; white-space: nowrap; }
.rowcomp:hover { text-decoration: underline; }
.comp-refreshers { display: flex; flex-direction: column; gap: 14px; }
.comp-ref { padding: 0; overflow: hidden; }
.comp-ref__head, .comp-full__head { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  border: 0; background: transparent; cursor: pointer; font-family: inherit; }
.comp-ref__head { padding: 18px 20px; font-size: 16px; }
.comp-ref__chev, .comp-full__chev { flex: none; width: 16px; color: var(--muted); font-size: 14px; }
.comp-ref__name { flex: 1; font-weight: 800; color: var(--ink); }
.comp-ref__body { padding: 0 20px 16px; display: flex; flex-direction: column; gap: 10px; }
.comp-full { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.comp-full.is-competent { border-color: #b8dfc9; }
.comp-full__head { padding: 12px 14px; font-size: 14px; }
.comp-full__name { flex: 1; font-weight: 700; }
.comp-full__body { padding: 0 14px 14px; }
.comp-full__meta { margin: 2px 0 8px; }
.comp-ref__body .comp-items { margin-top: 6px; }
[data-theme="dark"] .comp-full { border-color: var(--line); }
[data-theme="dark"] .comp-full.is-competent { border-color: #1f5c3a; }

/* Courses panel: delete button styling */
.course-delete { color: var(--pink); border-color: rgba(192,57,43,.3); }
.course-delete:hover { border-color: var(--pink); background: #fde4ec; }
.course-delerr { font-size: 12px; color: var(--pink); font-weight: 600; }

/* Dark mode overrides */
[data-theme="dark"] .comp-item { background: #10203F; border-color: var(--line); }
[data-theme="dark"] .comp-item--pass { background: #0d2a1f; border-color: #1f5c3a; }
[data-theme="dark"] .comp-item--check:hover { background: #182A4C; border-color: var(--pink); }
[data-theme="dark"] .comp-pbar { background: #1C2F52; }

/* ============================================================================
   SuperAdmin debug panel
   ========================================================================== */

.debug-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.debug-card { background: linear-gradient(180deg, #fff, #FFFEFB); border: 1px solid rgba(10,17,40,.05);
  border-radius: var(--r-sm); padding: 14px 16px; box-shadow: var(--shadow-xs);
  display: flex; flex-direction: column; gap: 6px; }
.debug-card__lbl { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.debug-card__val { width: fit-content; }

.debug-logbox { display: flex; flex-direction: column; gap: 2px; max-height: 480px; overflow-y: auto;
  font-family: "Courier New", monospace; font-size: 12px; margin-top: 10px;
  border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px; background: var(--bg); }
.debug-logline { display: flex; gap: 10px; padding: 3px 4px; border-radius: 4px; line-height: 1.4; }
.debug-logline:hover { background: rgba(10,17,40,.04); }
.debug-logline__ts { flex: none; color: var(--muted); font-size: 11px; white-space: nowrap; }
.debug-logline__lvl { flex: none; width: 64px; font-weight: 700; font-size: 11px; }
.debug-logline--error .debug-logline__lvl { color: var(--pink); }
.debug-logline--warning .debug-logline__lvl { color: var(--ochre); }
.debug-logline--info .debug-logline__lvl { color: var(--teal); }
.debug-logline__msg { flex: 1; overflow-wrap: break-word; min-width: 0; color: var(--ink); }
.debug-actions a.pill { display: inline-flex; align-items: center; text-decoration: none; }

[data-theme="dark"] .debug-card { background: linear-gradient(180deg, #10203F, #0C1A36); border-color: rgba(255,255,255,.06); }
[data-theme="dark"] .debug-logbox { background: #070B18; border-color: var(--line); }
[data-theme="dark"] .debug-logline:hover { background: rgba(255,255,255,.03); }

/* ── Booked toggle (roster) ─────────────────────────────────────────────── */
.rowbook--booked { background: #DCEFE6; color: #2E7D5B; }
.rowbook--booked:hover { background: #F7E4E1; color: #C0392B; box-shadow: none; transform: none; }
[data-theme="dark"] .rowbook--booked { background: rgba(46,125,91,.22); color: #7fd6ac; }
[data-theme="dark"] .rowbook--booked:hover { background: rgba(192,57,43,.22); color: #f0a29a; }

/* ── Assign-learning course details ─────────────────────────────────────── */
.assign-info { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin: -6px 0 14px;
  padding: 10px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: rgba(10,17,40,.03); }
.assign-info[hidden] { display: none; }
.assign-info__item { display: flex; flex-direction: column; gap: 1px; }
.assign-info__item small { color: var(--muted); font-size: 11px; }
.assign-info__item b { font-size: 14px; color: var(--ink); }
[data-theme="dark"] .assign-info { background: rgba(255,255,255,.04); }

/* ── Training plan management cards ─────────────────────────────────────── */
.plan-new__row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.plan-new__row input[type="text"], .plan-new__row .select { flex: 1; min-width: 200px; }
.plan-card { margin-bottom: 18px; }
.plan-card__head { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.plan-card__name { flex: 1; min-width: 220px; font-weight: 700; }
.plan-card__del { color: var(--pink); }
.plan-card__cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 12px; }
@media (max-width: 800px) { .plan-card__cols { grid-template-columns: 1fr; } }
.plan-card__courses { max-height: 240px; overflow: auto; }
.plan-card__roles { margin-top: 4px; }
.plan-card__addrow { margin-top: 8px; }
.plan-card__addrow .select { width: 100%; }

/* ── Competency builder ─────────────────────────────────────────────────── */
.cb-levels { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.cb-level { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border: 1.5px solid var(--line);
  border-radius: 12px; cursor: pointer; min-width: 180px; flex: 1; transition: border-color .15s ease, background .15s ease; }
.cb-level small { color: var(--muted); }
.cb-level input { position: absolute; opacity: 0; }
.cb-level.is-active { border-color: var(--purple); background: rgba(10,17,40,.05); }
[data-theme="dark"] .cb-level.is-active { background: rgba(255,255,255,.06); }
.cb-fwhead { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin: 20px 0 12px; }
.cb-fw { margin-bottom: 14px; }
.cb-fw__name { flex: 1; min-width: 200px; font-weight: 700; }
.cb-items { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
/* rows wrap rather than crushing the name box — text must never be squeezed illegible */
.cb-item { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cb-item__name { flex: 2 1 240px; min-width: 0; }
.cb-item__roles { flex: 1; min-width: 0; color: var(--muted); }
.cb-addrow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.cb-addrow .select { flex: 1; min-width: 180px; }
.cb-newref { margin-top: 12px; border-top: 1.5px dashed var(--line); padding-top: 12px; }
.comp-master { margin: 10px 0 4px; font-size: 15px; }

/* ── Manage induction + competency-builder polish (7 Jul) ───────────────── */
.cb-level { position: relative; }                 /* contain the hidden radio */
.induction-mgr { margin-top: 26px; }
.induction-mgr__list { margin-top: 12px; }
select.cb-item__roles { flex: 0 0 220px; }
@media (max-width: 800px) { select.cb-item__roles { flex: 1 1 100%; } }

/* roster date columns (Scheduled to open / Completed) */
.table td.date-cell { white-space: nowrap; color: var(--muted); }

/* -- Tier 2 entity routes: highlight the deep-linked card (plan / session) ---- */
.plan-card.is-linked, .sess.is-linked { outline: 2px solid var(--brand, #1B3B6F); outline-offset: 3px; border-radius: 10px; }

/* ============================================================================
   T1.7 — mobile nav sheet (burger replaces the hidden .nav__links <=900px)
   ========================================================================== */
.navburger { display: none; border: 1.5px solid var(--line); background: var(--field, #fff);
  color: var(--purple); width: 40px; height: 40px; border-radius: 10px; font-size: 18px;
  cursor: pointer; flex: none; }
@media (max-width: 900px) {
  .navburger { display: grid; place-items: center; order: 99; }
  .nav { gap: 12px; padding: 12px 16px; }
  .nav__right { gap: 8px; }
  .rolechip__txt { display: none; }   /* avatar only on small screens */
}
.navsheet { position: fixed; top: 64px; left: 0; right: 0; bottom: 0; z-index: 90;
  background: var(--bg); display: flex; flex-direction: column; gap: 4px;
  padding: 18px 20px; overflow-y: auto; }
.navsheet[hidden] { display: none; }
.navsheet__item { font-family: var(--f-head); font-weight: 700; font-size: 19px;
  color: var(--ink); padding: 14px 10px; border-bottom: 1px solid var(--line); }
.navsheet__item.is-active { color: var(--pink); }
.navsheet__foot { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

/* ============================================================================
   T1.1 — "Needs this course" compliance panel on session cards
   ========================================================================== */
.sess__needs { margin: 10px 0; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; background: var(--bg); }
.sess__needs-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 14px; margin-bottom: 8px; }
.needcount { font-weight: 700; font-size: 12px; white-space: nowrap; }
.needcount--overdue { color: var(--t-overdue); }
.needcount--open { color: var(--t-open); }
.needrows { display: flex; flex-direction: column; gap: 6px; }
.needrow { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.needrow__who { flex: 1; min-width: 0; }
[data-theme="dark"] .sess__needs { background: #10203F; }

/* T1.10 — screen-reader-only announcements */
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px;
  padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* T1.12 — the completion moment */
.cpdone { position: fixed; inset: 0; z-index: 210; display: grid; place-items: center;
  background: rgba(10,17,40,.55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.cpdone__card { background: var(--white); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  padding: 44px 48px; max-width: 460px; text-align: center; animation: cpdonein .35s var(--t-ease, ease); }
@keyframes cpdonein { from { transform: translateY(14px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.cpdone__star { font-size: 44px; color: var(--t-focus, #C9A24D); line-height: 1; margin-bottom: 10px; }
.cpdone__card h2 { font-size: 30px; color: var(--purple); margin-bottom: 6px; }
.cpdone__course { font-weight: 600; color: var(--ink); margin: 0 0 10px; }
.cpdone__note { font-size: 14px; color: var(--muted); line-height: 1.5; margin: 0 0 22px; }

/* T1.4b — sortable roster headers */
.table th[data-sortkey] { cursor: pointer; user-select: none; }
.table th[data-sortkey]:hover { color: var(--ink); }
.th-arrow { color: var(--t-focus); font-size: 10px; }

/* T1.3 — undo toast */
.toast__undo { border: 0; border-radius: 999px; padding: 4px 12px; margin-left: 10px;
  font-family: var(--f-body); font-size: 12px; font-weight: 700; cursor: pointer;
  background: var(--t-focus, #C9A24D); color: #0A1128; }

/* ============================================================================
   T2.2 — calendar day detail as a side panel at >=1200px (roll-marking without
   scrolling past the month grid); DOM order unchanged (head, grid, detail).
   ========================================================================== */
@media (min-width: 1200px) {
  .calcard { display: grid; grid-template-columns: minmax(0, 1fr) 380px;
    /* head row = content height. Without this, a tall sidebar (Induction Calendar)
       stretches the calcard and the auto rows share the extra height — pushing the
       month grid ~700px below its heading. */
    grid-template-rows: auto 1fr;
    grid-template-areas: "head head" "grid detail"; gap: 4px 20px; align-items: start;
    align-self: start; }
  .calcard .cal-head { grid-area: head; }
  .calcard .cal { grid-area: grid; }
  .calcard .day-detail { grid-area: detail; border-top: 0; margin-top: 0; padding-top: 2px;
    border-left: 1px solid #f0e6ee; padding-left: 18px; max-height: 78vh; overflow-y: auto; }
}

/* ============================================================================
   T2.3 — roster rows read as cards on phones (<=600px). Pure CSS over the same
   DOM: data-label on each cell becomes the card field label.
   ========================================================================== */
@media (max-width: 600px) {
  .table--roster thead { display: none; }
  .table--roster, .table--roster tbody, .table--roster tr, .table--roster td { display: block; width: 100%; }
  .table--roster tr { border: 1px solid var(--line); border-radius: 12px; margin: 10px 12px;
    padding: 8px 0; background: var(--white); width: auto; box-shadow: var(--shadow-xs); }
  .table--roster td { border-bottom: 0; padding: 6px 16px; }
  .table--roster td:empty { display: none; }
  .table--roster td[data-label]:not([data-label=""])::before { content: attr(data-label);
    display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
    color: var(--muted); font-weight: 700; margin-bottom: 2px; }
  .table--roster td[data-label="Staff Name"]::before { display: none; }
  .table--roster .rowactions { justify-content: flex-start; }
}

/* ============================================================================
   T2.4 — in-app confirm dialog (replaces native confirm())
   ========================================================================== */
.odialog { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center;
  background: rgba(10,17,40,.5); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.odialog__card { width: min(480px, 92vw); background: var(--white); border-radius: var(--r-md);
  box-shadow: var(--shadow-lg); padding: 26px 28px; animation: odin .18s var(--t-ease, ease); }
@keyframes odin { from { transform: translateY(8px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.odialog__card h3 { font-size: 20px; color: var(--purple); margin: 0 0 8px; }
.odialog__body { font-size: 14px; color: var(--ink); line-height: 1.55; margin: 0 0 14px; }
.odialog__body ul { margin: 8px 0 0 18px; padding: 0; }
.odialog__body li { margin-bottom: 3px; }
.odialog__ack { display: flex; gap: 8px; align-items: center; font-size: 14px;
  color: var(--t-overdue); font-weight: 600; margin: 0 0 14px; cursor: pointer; }
.odialog__ack input { width: 16px; height: 16px; accent-color: var(--t-overdue); }
.odialog__actions { display: flex; gap: 10px; justify-content: flex-end; }
.odialog__dangerbtn { background: var(--t-overdue); color: #fff; box-shadow: 0 3px 10px rgba(179,38,30,.3); }

/* Courses surface polish — compact cards. (The old --wide variant that flipped the
   workroom ribbon to a top tab row is retired: every Workroom tool keeps the side nav.) */
.course-sum { font-size: 14px; color: var(--muted); margin: -6px 0 12px; }
.course-sum__comp { color: var(--t-overdue); }
.course-editwrap { margin-bottom: 4px; }
.course-editwrap[hidden] { display: none; }

/* T3.4 — saved views chip row */
.viewchips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 0 24px 12px; }
.viewchips[hidden] { display: none; }

/* v1.2 — roster column picker (▦ Columns): visible columns first (with ‹ › reorder),
   hidden ones after; the same order drives the table and the CSV export. */
.colpicker { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 0 24px 12px; }
.colpicker[hidden] { display: none; }
.colpicker__lbl { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.colpicker__lbl small { font-weight: 500; text-transform: none; letter-spacing: 0; }
.colchip { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line);
  border-radius: 999px; padding: 3px 10px; font-size: 12.5px; background: var(--white); color: var(--muted); }
.colchip label { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.colchip input { accent-color: var(--t-navy, #1B2A52); }
.colchip--on { color: var(--ink); border-color: var(--t-navy, #1B2A52); }
.colchip__move { border: 0; background: none; cursor: pointer; font-size: 14px; line-height: 1;
  padding: 0 2px; color: var(--muted); border-radius: 4px; }
.colchip__move:hover:not(:disabled) { color: var(--ink); background: var(--line); }
.colchip__move:disabled { opacity: .3; cursor: default; }
.colpicker__reset { margin-left: auto; font-size: 12px; padding: 4px 12px; }
.viewchips__lbl { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.viewchip { cursor: pointer; }
.viewchip:hover { box-shadow: var(--shadow-xs); }
.odialog__input { margin: 0 0 14px; }

/* T3.5 — waitlist affordances */
.rowbook--waitlisted { background: #F3E9D2; color: #7A5B16; }
.rowbook--waitlisted:hover { background: var(--t-overdue); color: #fff; }
.attchip--waitlisted { background: #F3E9D2; color: #7A5B16; border: 1px dashed #C9A24D; }
[data-theme="dark"] .attchip--waitlisted { background: rgba(201,162,77,.18); color: #E4C878; }
[data-theme="dark"] .rowbook--waitlisted { background: rgba(201,162,77,.22); color: #E4C878; }

/* Flow A — staff booking requests (18 Jul 2026) */
.reqhint { margin: 0 0 10px; font-size: 13px; color: var(--muted); }
.reqopt { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 10px; margin: 6px 0; cursor: pointer; }
.reqopt:hover { box-shadow: var(--shadow-xs); }
.reqopt input { margin-top: 3px; accent-color: var(--t-action); }
.reqopt span { display: flex; flex-direction: column; gap: 1px; }
.reqopt small { color: var(--muted); }
.req-decl { display: inline-flex; gap: 8px; align-items: center; }
.req-reason { display: block; color: var(--t-overdue); margin-top: 2px; }

/* Flow A — booking-request queue (manager/admin) */
.reql { list-style: none; margin: 0; padding: 0; }
.reql__empty { color: var(--muted); font-style: italic; padding: 8px 0; }
.reqrow { display: flex; align-items: center; gap: 12px; padding: 10px 4px;
  border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.reqrow:last-child { border-bottom: 0; }
.reqrow__body { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 220px; }
.reqrow__body small { color: var(--muted); }
.reqrow__actions { display: flex; gap: 8px; }
.demand { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 10px 0; }
.demand__head { margin-bottom: 6px; }
.demand ul { list-style: none; margin: 0 0 10px; padding: 0; }
.demand li { display: flex; align-items: center; gap: 8px; padding: 4px 0; flex-wrap: wrap; }
.demand li small { color: var(--muted); }
.demand__when { margin-left: auto; }
.demand__act { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.demand__none { color: var(--muted); font-style: italic; }
.reqfield { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; font-size: 13px; font-weight: 600; }
.reqfield input { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: transparent; color: inherit; font: inherit; font-weight: 400; }

/* Flow C — attendance notes, lock, amend, sheet */
.attchip__note.has-note, .attchip__notemark { color: #7A5B16; }
/* double class beats the T0.7 hit-target rule in orion-tokens.css (.attchip__set
   { width:24px }) which loads later and otherwise crushes this TEXT button back
   to a 24px circle — the text overflowed and the × hit-box sat on top of it.
   Height stays 24px so the a11y hit-target intent is preserved. */
.attchip__set.attchip__amend { width: auto; min-width: 24px; padding: 0 10px;
  font-size: 11px; font-weight: 700; }
.notearea { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: transparent; color: inherit; font: inherit; resize: vertical; margin: 6px 0; }
.amend__states { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.reqopt--inline { flex-direction: row; align-items: center; gap: 6px; margin: 0; padding: 6px 10px; }
.amend__reason { width: 100%; margin: 6px 0 12px; }
.sess__lock { font-size: 12px; color: var(--muted); background: var(--t-scheduled-tint);
  border-radius: 8px; padding: 6px 10px; margin: 8px 0; }
.sess__sheet { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.cal-dot { color: #C9A24D; font-size: 10px; margin-left: 3px; vertical-align: middle; }

/* Flow B — Learning-Team notification bell + panel */
.notifbell { position: relative; background: none; border: 0; font-size: 18px; cursor: pointer;
  padding: 6px; border-radius: 10px; }
.notifbell:hover { background: var(--t-scheduled-tint); }
.notifbell__n { position: absolute; top: 0; right: -2px; background: var(--t-overdue); color: #fff;
  font-size: 10px; font-weight: 700; border-radius: 999px; padding: 1px 5px; line-height: 1.4; }
.notifpanel { position: fixed; top: 64px; right: 16px; width: min(440px, calc(100vw - 24px));
  max-height: min(70vh, 640px); overflow: auto; background: var(--card, #fff);
  border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 40px rgba(10,17,40,.18);
  z-index: 900; }
[data-theme="dark"] .notifpanel { background: #101A30; }
.notifpanel__head { display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 12px 14px; border-bottom: 1px solid var(--line); position: sticky; top: 0;
  background: inherit; flex-wrap: wrap; }
.notifpanel__pref { display: flex; gap: 6px; }
.notifpanel__list { padding: 8px 14px 14px; }
.notifcard { border-bottom: 1px solid var(--line); padding: 10px 0; }
.notifcard:last-child { border-bottom: 0; }
.notifcard.is-handled { opacity: .55; }
.notifcard__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.notifcard > small { color: var(--muted); display: block; margin: 3px 0 6px; }
.notifcard__act { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.notifcard__h { margin-left: auto; font-size: 12px; color: var(--muted); display: flex;
  align-items: center; gap: 5px; }
.notifday { margin-bottom: 6px; }
.notifday__head { display: flex; align-items: center; gap: 10px; padding: 8px 0 4px;
  flex-wrap: wrap; }
.sess--flash { outline: 3px solid #C9A24D; outline-offset: 2px;
  animation: sessflash 2.4s ease-out 1; }
@keyframes sessflash { 0% { background: #F3E9D2; } 100% { background: transparent; } }
