/* ============================================================
   RCTP Design System — Color tokens (v2)
   Regenerated to match DESIGN-SPEC.md §1. Dark is the DEFAULT
   theme; light mode is a pure token flip via
   html[data-theme="light"] (persisted in localStorage
   "platform-theme"). Components reference tokens only.
   ============================================================ */

:root {
  color-scheme: dark;

  /* --- Brand marks (fixed, do not theme-flip) --- */
  --brand-navy: #1A2133;        /* THEME_COLOR / favicon field */
  --brand-navy-panel: #1E2B42;  /* favicon inner panel */
  --brand-orange: #E8722A;      /* favicon accent bar */

  /* --- Surfaces --- */
  --bg: #111318;
  --bg-elevated: #171a21;       /* header, sidebar */
  --panel: #171a21;             /* cards */
  --panel-strong: #1d212a;      /* inputs, active segments, chip tracks */
  --hover: #202530;

  /* --- Text --- */
  --text: #f6f7f9;
  --muted: #a8b0bf;

  /* --- Borders --- */
  --line: #333a46;
  --line-strong: #4b5565;

  /* --- Accents (always applied as color-mix tints, never flat fills) --- */
  --amber: #f0b44c;
  --green: #34d399;
  --blue: #60a5fa;
  --red: #fb7185;

  /* --- Solid CTA ("ink") --- */
  --ink: #f6f7f9;
  --ink-contrast: #14171d;

  /* --- Elevation --- */
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.28);

  /* --- Semantic aliases --- */
  --surface-page: var(--bg);
  --surface-card: var(--panel);
  --surface-raised: var(--panel-strong);
  --text-body: var(--text);
  --text-muted: var(--muted);
  --border-default: var(--line);
  --border-hover: var(--line-strong);

  /* Module accent assignments */
  --accent-platform: var(--blue);   /* Platform tools (User Management) */
  --accent-catalog: var(--amber);   /* CSS — Core Solution Services */
  --accent-lms: var(--green);       /* River City LMS */
  --accent-danger: var(--red);      /* Danger / HR Confidential */

  /* Status system (DESIGN-SPEC §3) */
  --status-completed: var(--green);
  --status-progress: var(--blue);
  --status-notstarted: var(--muted);
  --status-expiring: var(--amber);
  --status-overdue: var(--red);
  --status-expired: var(--red);     /* rendered OUTLINED, not filled */
}

html[data-theme="light"] {
  color-scheme: light;

  --bg: #f3f5f8;
  --bg-elevated: #ffffff;
  --panel: #ffffff;
  --panel-strong: #f7f8fa;
  --hover: #f7f8fa;

  --text: #17181c;
  --muted: #626977;

  --line: #dfe3ea;
  --line-strong: #b8c0cc;

  --amber: #b7791f;
  --green: #047857;
  --blue: #2563eb;
  --red: #be123c;

  --ink: #252a32;
  --ink-contrast: #ffffff;

  --shadow: 0 18px 45px rgba(31, 35, 42, 0.08);
}

/* Light mode: the white wordmark gets the documented black filter.
   (v2 retires the dark logo well — the wordmark is free-standing.) */
html[data-theme="light"] .rc-brand img { filter: brightness(0) saturate(100%); }
/* ============================================================
   RCTP Design System — Typography tokens
   Platform/LMS shells: Inter (weights ride the variable axis —
   the codebase uses 700/750/800/850/900, not just 400/700).
   Marketing (Tailwind @theme): Instrument Sans.
   ============================================================ */

:root {
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-marketing: "Instrument Sans", ui-sans-serif, system-ui, sans-serif;

  /* Sizes (exact from platform/LMS shells) */
  --text-h1: clamp(29px, 4vw, 42px);      /* LMS page hero        */
  --text-h1-hub: clamp(28px, 4vw, 40px);  /* Platform Hub heading */
  --text-h2: 21px;                        /* panel section title  */
  --text-h2-module: 24px;                 /* module card title    */
  --text-h3: 16px;
  --text-metric: 24px;                    /* metric-card value    */
  --text-body: 16px;
  --text-sm: 14px;                        /* buttons, nav, menus  */
  --text-meta: 13px;                      /* labels, eyebrows     */
  --text-badge: 12px;                     /* badges, table th     */

  /* Line heights */
  --leading-h1: 1.06;
  --leading-h1-hub: 1.08;
  --leading-h2: 1.2;
  --leading-body: 1.55;
  --leading-nav-meta: 1.45;

  /* Weights (Inter variable axis) */
  --weight-regular: 400;
  --weight-meta: 700;      /* metric labels, check rows      */
  --weight-bold: 750;      /* buttons, nav links, brand name */
  --weight-mark: 800;      /* module marks, avatar initial   */
  --weight-eyebrow: 850;   /* eyebrows, badges               */
  --weight-black: 900;     /* confidential label             */

  /* Letter spacing: the product sets 0 explicitly, everywhere. */
  --tracking: 0;
}
/* ============================================================
   RCTP Design System — Radius, spacing, layout, motion (v2)
   Regenerated to match DESIGN-SPEC.md. Retired v1 values:
   72px topbar, 220px sidebar, 38px nav rows, 26px badges,
   42px logo well.
   ============================================================ */

:root {
  /* Radius — 8px is THE platform radius; pills for badges/avatars. */
  --radius: 8px;
  --radius-chip: 6px;           /* small type/version chips */
  --radius-pill: 999px;

  /* Layout */
  --container: 1180px;
  --container-inset: 48px;      /* width: min(1180px, calc(100% - 48px)) */
  --topbar-height: 64px;        /* module screens */
  --topbar-height-hub: 68px;    /* Platform Hub */
  --sidebar-width: 236px;
  --sidebar-drawer-width: 280px; /* off-canvas below 1024px */

  /* Brand */
  --wordmark-height: 36px;      /* 38px on the Hub; free-standing, no well */
  --wordmark-height-hub: 38px;

  /* Control metrics */
  --control-height: 36px;       /* default buttons, filters, search */
  --control-height-lg: 40px;    /* hero/primary CTAs, composer fields */
  --control-height-sm: 32px;    /* in-card / in-row actions */
  --input-height: 38px;
  --nav-row-height: 36px;
  --status-pill-height: 24px;
  --chip-height: 30px;          /* filter chips with counts */
  --row-menu-size: 28px;        /* "⋯" row action button */
  --module-mark-size: 44px;     /* icon tile in cards */
  --module-mark-size-lg: 52px;  /* Hub switchboard rows */
  --avatar-size: 25px;          /* account chip */
  --avatar-size-row: 32px;      /* table identity rows */

  /* Padding */
  --pad-panel: 18px;            /* card/panel body */
  --pad-panel-head: 15px 18px;  /* card header rows */
  --pad-card: 17px;
  --pad-empty: 26px;
  --pad-input-y: 9px;
  --pad-input-x: 12px;

  /* Gaps */
  --gap-hairline: 2px;          /* sidebar nav rows */
  --gap-tight: 10px;            /* inline actions, topbar chrome */
  --gap: 12px;
  --gap-grid: 14px;             /* card grids */
  --gap-grid-hub: 16px;         /* hub rows, admin two-pane grids */
  --gap-content: 16px;          /* content column stacks */
  --gap-page: 26px;             /* page top padding rhythm */

  /* Motion — one speed, one easing. No bounces, no springs. */
  --transition: 160ms ease; /* @kind other */
  --lift: translateY(-2px); /* @kind other */ /* card hover */
}
/* ============================================================
   RCTP Design System — Platform component classes (.rc-*) v2
   Regenerated to match DESIGN-SPEC.md (the v2 redesign).
   Retired v1 patterns removed: logo well, letter module marks,
   hero panels, 72px topbar, 26px badges, green-tint primary.
   The reference for composition is design-reference.html #2a–#2k.
   ============================================================ */

/* ---------- Page scope ---------- */
.rc-page {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  letter-spacing: var(--tracking);
}
.rc-page *,
.rc-page *::before,
.rc-page *::after { box-sizing: border-box; }
.rc-page a { color: inherit; text-decoration: none; }
.rc-page a:hover { color: inherit; }
.rc-page button,
.rc-page input,
.rc-page select,
.rc-page textarea { font: inherit; }
.rc-page h1, .rc-page h2, .rc-page h3, .rc-page p { margin: 0; letter-spacing: var(--tracking); }
.rc-page h1 { font-size: 24px; font-weight: 800; line-height: 1.15; } /* page titles (25–26px on Hub) */
.rc-page h2 { font-size: 17px; font-weight: 750; }
.rc-page h3 { font-size: 15px; font-weight: 750; }
.rc-page p { color: var(--muted); line-height: 1.55; }

/* Blade Heroicons do not include intrinsic dimensions. Keep every platform icon
   safely bounded even on pages that do not load Tailwind utility classes. */
:where(.rc-page) :where(svg[data-slot="icon"]) {
  display: block;
  width: 1em;
  height: 1em;
  flex: 0 0 auto;
  vertical-align: middle;
}

/* ---------- Layout ---------- */
.rc-container { width: min(var(--container), calc(100% - var(--container-inset))); margin: 0 auto; }
.rc-stack { display: grid; gap: var(--gap); }
.rc-inline-actions { display: flex; flex-wrap: wrap; gap: var(--gap-tight); }
.rc-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.rc-page-head p { font-size: 14px; }

/* ---------- Topbar (v2: 64px, free-standing wordmark, no well) ---------- */
.rc-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-elevated) 92%, transparent);
  backdrop-filter: blur(14px);
}
.rc-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--topbar-height);
  padding: 0 22px;
}
.rc-brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.rc-brand img { height: var(--wordmark-height); width: auto; display: block; }
.rc-brand-divider { width: 1px; height: 24px; background: var(--line-strong); }
.rc-brand-module { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 14px; font-weight: 750; white-space: nowrap; }
.rc-brand-module svg { width: 16px; height: 16px; }
.rc-topbar-actions { display: flex; align-items: center; gap: var(--gap-tight); }
.rc-account-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: var(--control-height);
  padding: 0 11px 0 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  font-size: 13px;
  font-weight: 750;
}

/* ---------- Buttons ---------- */
.rc-button,
.rc-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: var(--control-height);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  font-weight: 750;
  font-size: 13px;
  white-space: nowrap;
  transition: background var(--transition), border-color var(--transition);
}
.rc-button { padding: 0 14px; }
.rc-button:hover,
.rc-icon-button:hover { border-color: var(--line-strong); background: var(--hover); }
/* Primary = "ink". One per view region. (v1 green-tint primary retired.)
   CONTRAST GUARDRAIL: in dark mode the ink bg is near-WHITE and the text
   near-BLACK (inverts in light mode). Utility classes (Tailwind `text-white`,
   Filament button colors) painting white text on this surface make labels
   invisible — the `!important` + child-inherit rules below exist to defeat
   exactly that. Never apply text-color utilities to .rc-* controls. */
.rc-button--primary,
.rc-button--ink,
a.rc-button--primary,
button.rc-button--primary,
a.rc-button--ink,
button.rc-button--ink {
  border: 0;
  padding: 0 15px;
  background: var(--ink);
  color: var(--ink-contrast) !important;
}
.rc-button--primary *,
.rc-button--ink * { color: inherit !important; fill: currentColor; }
.rc-button--primary:hover,
.rc-button--ink:hover { background: var(--ink); border-color: transparent; }
.rc-button--primary:focus-visible,
.rc-button--ink:focus-visible { outline: 2px solid var(--line-strong); outline-offset: 2px; }
.rc-button--danger { border-color: color-mix(in srgb, var(--red) 45%, var(--line)); color: var(--red); }
.rc-button--sm { min-height: var(--control-height-sm); padding: 0 13px; }
.rc-icon-button { min-width: var(--control-height); width: var(--control-height); padding: 0; }
.rc-icon-button svg { width: 17px; height: 17px; }
.rc-row-menu {
  display: inline-grid;
  place-items: center;
  width: var(--row-menu-size);
  height: var(--row-menu-size);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.rc-row-menu:hover { border-color: var(--line-strong); background: var(--hover); }
.rc-row-menu svg { width: 14px; height: 14px; }

/* ---------- Status pills (DESIGN-SPEC §3 — one system everywhere) ---------- */
.rc-status-pill {
  --status: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: var(--status-pill-height);
  padding: 0 10px;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--status) 14%, var(--panel));
  color: var(--status);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}
.rc-status-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: var(--radius-pill);
  background: currentColor;
}
.rc-status-pill--completed { --status: var(--status-completed); }
.rc-status-pill--progress  { --status: var(--status-progress); }
.rc-status-pill--notstarted{ --status: var(--status-notstarted); }
.rc-status-pill--expiring  { --status: var(--status-expiring); }
.rc-status-pill--overdue   { --status: var(--status-overdue); }
/* Expired = history, not alarm: outlined, transparent fill */
.rc-status-pill--expired {
  --status: var(--status-expired);
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--status) 45%, var(--line));
}

/* Small utility chips (type, version) */
.rc-chip-quiet {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--radius-chip);
  background: var(--panel-strong);
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}
.rc-chip-quiet--blue { background: color-mix(in srgb, var(--blue) 13%, var(--panel)); color: var(--blue); }

/* Filter chips with counts ("All · 8") */
.rc-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: var(--chip-height);
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--panel);
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
  white-space: nowrap;
}
.rc-chip[aria-pressed="true"],
.rc-chip--active {
  border-color: color-mix(in srgb, var(--green) 50%, var(--line));
  background: color-mix(in srgb, var(--green) 14%, var(--panel));
  color: var(--green);
}

/* Segmented control (2–3 states) */
.rc-segmented {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}
.rc-segmented > * {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: var(--radius-chip);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
  white-space: nowrap;
}
.rc-segmented > [aria-current="true"],
.rc-segmented > .is-active { background: var(--panel-strong); border-color: var(--line-strong); color: var(--text); }

/* ---------- Panels & cards ---------- */
.rc-panel,
.rc-metric-card,
.rc-item-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}
.rc-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: var(--pad-panel-head);
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  font-weight: 750;
}
.rc-panel-body { padding: var(--pad-panel); }
.rc-metric-card { padding: var(--pad-card); }
.rc-item-card { padding: var(--pad-card); display: grid; gap: 12px; }
.rc-eyebrow { color: var(--muted); font-size: 11px; font-weight: 850; text-transform: uppercase; }
.rc-meta { color: var(--muted); font-size: 13px; font-weight: 700; }
.rc-banner--attention {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border: 1px solid color-mix(in srgb, var(--amber) 45%, var(--line));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--amber) 9%, var(--panel));
  font-size: 13px;
  font-weight: 700;
}
.rc-banner--attention > svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  color: var(--amber);
}
.rc-banner--attention > p { margin: 0; }
.rc-banner--attention > :last-child { min-width: 0; }

/* ---------- Module marks (v2: Heroicon tiles — letter marks retired) ---------- */
.rc-module-mark {
  --accent: var(--blue);
  display: grid;
  place-items: center;
  width: var(--module-mark-size);
  height: var(--module-mark-size);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--accent) 15%, var(--panel));
  color: var(--accent);
  flex: none;
}
.rc-module-mark svg { width: 55%; height: 55%; }
.rc-module-mark--lg { width: var(--module-mark-size-lg); height: var(--module-mark-size-lg); }
.rc-module-mark[data-tone="amber"]   { --accent: var(--amber); }   /* CSS: wrench-screwdriver */
.rc-module-mark[data-tone="emerald"] { --accent: var(--green); }   /* LMS: academic-cap */
.rc-module-mark[data-tone="blue"]    { --accent: var(--blue); }    /* Users: user-group */

/* Hub switchboard row (2a) */
.rc-switch-row {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  transition: transform var(--transition), border-color var(--transition), background var(--transition);
}
.rc-switch-row:hover,
.rc-switch-row:focus-visible { transform: var(--lift); border-color: var(--line-strong); background: var(--hover); outline: none; }
.rc-switch-row[data-tone="amber"] { --accent: var(--amber); }
.rc-switch-row[data-tone="emerald"] { --accent: var(--green); }
.rc-switch-row[data-tone="blue"] { --accent: var(--blue); }

/* ---------- Sidebar nav (v2: grouped, 236px, in-shell) ---------- */
.rc-sidebar {
  width: var(--sidebar-width);
  flex: none;
  border-right: 1px solid var(--line);
  background: var(--bg-elevated);
  padding: 14px 12px 22px;
  display: flex;
  flex-direction: column;
}
.rc-nav-group { display: grid; gap: var(--gap-hairline); }
.rc-nav-group-label { padding: 18px 10px 7px; color: var(--muted); font-size: 11px; font-weight: 850; text-transform: uppercase; }
.rc-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--nav-row-height);
  padding: 0 10px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
  text-align: left;
  width: 100%;
}
.rc-nav-link svg { width: 17px; height: 17px; flex: none; }
.rc-nav-link:hover { background: var(--hover); color: var(--text); }
.rc-nav-link[aria-current="page"] {
  background: color-mix(in srgb, var(--green) 13%, transparent);
  color: var(--green);
}
.rc-count-pill {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  margin-left: auto;
  border-radius: var(--radius-pill);
  background: var(--panel-strong);
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

/* ---------- Forms ---------- */
.rc-field { display: grid; gap: 6px; }
.rc-field--full { grid-column: 1 / -1; }
.rc-field > label { color: var(--muted); font-size: 12px; font-weight: 750; }
.rc-field input:not([type="checkbox"]):not([type="radio"]),
.rc-field select,
.rc-field textarea,
.rc-input {
  width: 100%;
  min-height: var(--input-height);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-strong);
  color: var(--text);
  padding: var(--pad-input-y) var(--pad-input-x);
  font-size: 13px;
}
.rc-field textarea { min-height: 104px; resize: vertical; }
.rc-search { display: inline-flex; align-items: center; gap: 8px; }
.rc-search svg { width: 14px; height: 14px; color: var(--muted); flex: none; }
.rc-choice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-strong);
  cursor: pointer;
}
.rc-choice > input:is([type="checkbox"], [type="radio"]) {
  width: 16px;
  min-width: 16px;
  height: 16px;
  min-height: 16px;
  flex: 0 0 16px;
  margin: 2px 0 0;
  padding: 0;
  accent-color: var(--green);
}
.rc-error { color: var(--red); font-size: 13px; font-weight: 700; }
/* Chip-input for people/department multiselect (2g) */
.rc-chip-input {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-strong);
}
.rc-person-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 8px 0 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--panel);
  font-size: 12px;
  font-weight: 750;
}

/* ---------- Tables ---------- */
.rc-table-wrap { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); overflow: hidden; }
.rc-table-wrap table { width: 100%; border-collapse: collapse; font-size: 14px; }
.rc-table-wrap th,
.rc-table-wrap td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.rc-table-wrap th { color: var(--muted); font-size: 12px; font-weight: 850; text-transform: uppercase; }
.rc-table-wrap tr:last-child td { border-bottom: 0; }
.rc-td-date { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 13px; }
.rc-date-sub { display: block; color: var(--muted); font-size: 11px; font-weight: 750; white-space: nowrap; }
.rc-identity { display: flex; align-items: center; gap: 11px; min-width: 0; }
.rc-identity-text { display: grid; gap: 1px; min-width: 0; }
.rc-identity-text > :first-child { font-weight: 750; white-space: nowrap; }
.rc-identity-text > :last-child { color: var(--muted); font-size: 13px; white-space: nowrap; }

/* ---------- Progress ---------- */
.rc-progress { display: block; height: 6px; border-radius: var(--radius-pill); background: color-mix(in srgb, var(--line) 55%, transparent); overflow: hidden; }
.rc-progress > span { display: block; height: 100%; border-radius: var(--radius-pill); background: var(--green); }

/* ---------- Avatar & account menu ---------- */
.rc-avatar {
  display: grid;
  place-items: center;
  width: var(--avatar-size);
  height: var(--avatar-size);
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--blue) 22%, var(--panel));
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
  flex: none;
}
.rc-avatar--row { width: var(--avatar-size-row); height: var(--avatar-size-row); font-size: 12px; }
.rc-account { position: relative; }
.rc-account-menu {
  position: absolute;
  right: 0;
  top: 44px;
  width: min(280px, calc(100vw - 32px));
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  z-index: 20;
}
.rc-menu-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: var(--control-height);
  padding: 0 10px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
  text-align: left;
}
.rc-menu-link:hover { background: var(--hover); }
.rc-menu-link svg { width: 17px; height: 17px; color: var(--muted); flex: none; }
.rc-word-mark {
  display: inline-grid;
  width: 18px;
  height: 18px;
  flex: none;
  place-items: center;
  border-radius: 3px;
  background: #185abd;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
}

/* ---------- Confidential / empty / media (unchanged patterns) ---------- */
.rc-confidential-notice {
  display: grid;
  gap: 6px;
  width: min(100%, 640px);
  padding: 13px 15px;
  border: 1px solid color-mix(in srgb, var(--red) 52%, var(--line));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--red) 13%, var(--panel));
  color: var(--text);
}
.rc-confidential-notice > span { color: var(--red); font-size: 12px; font-weight: 900; text-transform: uppercase; }
.rc-empty {
  padding: var(--pad-empty);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--panel) 74%, transparent);
  color: var(--muted);
}
.rc-video-frame {
  width: min(100%, 760px);
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #000;
  overflow: hidden;
}

/* ============================================================
   Responsive (DESIGN-SPEC §7). Frames are authored at 1280;
   these rules are canonical below that. Structural swaps
   (sidebar drawer, rail→chips, table→cards) are markup-level —
   see §7 — the mechanical parts live here.
   ============================================================ */
@media (max-width: 1279px) {
  .rc-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .rc-composer-grid { grid-template-columns: 1fr 1fr !important; }
}
@media (max-width: 1023px) {
  .rc-sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-drawer-width); z-index: 30; transform: translateX(-100%); transition: transform var(--transition); }
  .rc-sidebar[data-open="true"] { transform: none; box-shadow: var(--shadow); }
  .rc-scrim { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 29; }
  .rc-grid-3, .rc-split { grid-template-columns: 1fr !important; }
  .rc-composer-grid { grid-template-columns: 1fr !important; }
  .rc-account-chip span { display: none; }        /* avatar only */
  .rc-account-chip { padding: 0 6px; }
}
@media (max-width: 767px) {
  .rc-brand img { height: 30px; }
  .rc-brand-module { display: none; }             /* context = page title */
  .rc-page-head { flex-direction: column; align-items: stretch; }
  .rc-button, .rc-nav-link, .rc-chip { min-height: 44px; } /* touch targets */
  .rc-topbar-inner { padding: 0 16px; }
}

/* ============================================================
   River City application composition and compatibility layer.
   The handoff supplies primitives; these rules compose them into
   the Blade shells and keep no-frame LMS workflows on v2 tokens.
   ============================================================ */

html,
body { min-height: 100%; }

[hidden] { display: none !important; }

.rc-page { overflow-x: hidden; }
.rc-page.rc-drawer-open { overflow: hidden; }
.rc-topbar--hub .rc-topbar-inner { min-height: var(--topbar-height-hub); padding: 0; }
.rc-topbar--hub .rc-brand img { height: var(--wordmark-height-hub); }
.rc-brand > a { display: flex; align-items: center; }
.rc-sidebar-trigger { display: none; }
.rc-theme-icon--light { display: none; }
html[data-theme="light"] .rc-theme-icon--dark { display: none; }
html[data-theme="light"] .rc-theme-icon--light { display: block; }
.rc-account summary { list-style: none; cursor: pointer; }
.rc-account summary::-webkit-details-marker { display: none; }
.rc-account-chevron { width: 14px; height: 14px; color: var(--muted); }
.rc-account-meta { padding: 9px 10px 12px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.rc-account-meta strong,
.rc-account-meta span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-account-meta strong { font-size: 13px; }
.rc-account-meta span { margin-top: 3px; color: var(--muted); font-size: 12px; }
.rc-global-dashboard-menu-link { display: none; }

.rc-lms-body { display: flex; min-height: calc(100vh - var(--topbar-height)); }
.rc-sidebar { position: sticky; top: var(--topbar-height); height: calc(100vh - var(--topbar-height)); overflow-y: auto; }
.rc-lms-content { flex: 1; min-width: 0; }
.rc-lms-main { width: min(1280px, 100%); margin: 0 auto; padding: var(--gap-page) 24px 48px; }
.rc-content-stack,
.content { display: grid; gap: var(--gap-content); }
.rc-scrim[hidden] { display: none; }
.rc-scrim { cursor: pointer; border: 0; }

.rc-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap-grid); }
.rc-split { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); gap: var(--gap-grid); align-items: start; }
.rc-list { display: grid; }
.rc-list > * + * { border-top: 1px solid var(--line); }
.rc-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rc-section-heading h2 { font-size: 16px; }
.rc-muted { color: var(--muted); }
.rc-text-red { color: var(--red); }
.rc-text-amber { color: var(--amber); }
.rc-text-green { color: var(--green); }
.rc-nowrap { white-space: nowrap; }
.rc-mobile-only { display: none; }

/* Platform Hub */
.rc-hub-main { width: min(880px, calc(100% - 32px)); margin: 0 auto; padding: 42px 0 34px; display: grid; gap: 24px; }
.rc-hub-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; }
.rc-hub-heading h1 { font-size: 26px; }
.rc-hub-heading p { margin-top: 5px; font-size: 14px; }
.rc-hub-date { color: var(--muted); font-size: 13px; white-space: nowrap; }
.rc-switchboard { display: grid; gap: 12px; }
.rc-switchboard-label { padding: 0 2px; color: var(--muted); font-size: 11px; font-weight: 850; text-transform: uppercase; }
.rc-switch-copy { display: grid; gap: 3px; min-width: 0; }
.rc-switch-tag { color: var(--accent); font-size: 11px; font-weight: 850; text-transform: uppercase; }
.rc-switch-copy h2 { font-size: 19px; font-weight: 800; }
.rc-switch-copy p { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-switch-spacer { flex: 1; }
.rc-switch-meta { max-width: 250px; color: var(--muted); font-size: 13px; font-weight: 700; text-align: right; }
.rc-switch-meta strong { color: var(--red); }
.rc-switch-action { min-width: 74px; }
.rc-hub-footer { padding-top: 5px; color: var(--muted); font-size: 12px; text-align: center; }

/* Shared data rows, menus, cards and timeline */
.rc-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; min-width: 0; }
.rc-row-main { flex: 1; min-width: 0; }
.rc-row-title { display: flex; align-items: center; gap: 7px; min-width: 0; font-size: 14px; font-weight: 750; }
.rc-row-title > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-row-subtitle { margin-top: 3px; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-menu { position: relative; }
.rc-menu summary { list-style: none; }
.rc-menu summary::-webkit-details-marker { display: none; }
.rc-menu-popover { position: absolute; right: 0; top: 34px; z-index: 15; min-width: 170px; padding: 6px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); }
.rc-menu-popover .rc-menu-link { min-height: 34px; }
.rc-timeline { display: grid; gap: 20px; }
.rc-timeline-month { color: var(--muted); font-size: 11px; font-weight: 850; text-transform: uppercase; }
.rc-timeline-list { position: relative; display: grid; margin-top: 8px; padding-left: 22px; }
.rc-timeline-list::before { content: ""; position: absolute; left: 5px; top: 10px; bottom: 10px; width: 2px; background: var(--line); }
.rc-timeline-row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 18px; padding: 12px 0; }
.rc-timeline-row + .rc-timeline-row { border-top: 1px solid var(--line); }
.rc-timeline-dot { position: absolute; left: -22px; width: 10px; height: 10px; border-radius: var(--radius-pill); background: var(--muted); box-shadow: 0 0 0 3px var(--panel); }

/* Legacy/no-frame LMS layouts restyled with v2 primitives. */
.panel,
.metric-card,
.item-card,
.question-card,
.nav-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); }
.panel { padding: var(--pad-panel); }
.hero { display: grid; gap: 10px; }
.hero h1 { font-size: 24px; font-weight: 800; }
.eyebrow { color: var(--muted); font-size: 11px; font-weight: 850; text-transform: uppercase; }
.meta { color: var(--muted); font-size: 13px; font-weight: 700; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--gap-grid); }
.stack { display: grid; gap: var(--gap); }
.inline-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--gap-tight); }
.metric-card,
.item-card,
.question-card { padding: var(--pad-card); }
.item-card,
.question-card { display: grid; gap: 12px; }
.item-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.button,
.icon-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: var(--control-height); padding: 0 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--text); cursor: pointer; font-size: 13px; font-weight: 750; text-decoration: none; }
.button:hover,
.icon-button:hover { border-color: var(--line-strong); background: var(--hover); }
.button.primary { border: 0; background: var(--ink); color: var(--ink-contrast); }
.button.danger { border-color: color-mix(in srgb, var(--red) 45%, var(--line)); color: var(--red); }
.badge { display: inline-flex; align-items: center; gap: 7px; min-height: var(--status-pill-height); padding: 0 10px; border-radius: var(--radius-pill); background: color-mix(in srgb, var(--green) 14%, var(--panel)); color: var(--green); font-size: 12px; font-weight: 850; white-space: nowrap; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: var(--radius-pill); background: currentColor; }
.badge.blue { background: color-mix(in srgb, var(--blue) 14%, var(--panel)); color: var(--blue); }
.badge.amber { background: color-mix(in srgb, var(--amber) 14%, var(--panel)); color: var(--amber); }
.badge.red { background: color-mix(in srgb, var(--red) 14%, var(--panel)); color: var(--red); }
.notice { border-color: color-mix(in srgb, var(--green) 45%, var(--line)); background: color-mix(in srgb, var(--green) 9%, var(--panel)); }
.confidential-hero { border-color: color-mix(in srgb, var(--red) 44%, var(--line)); background: linear-gradient(135deg, color-mix(in srgb, var(--red) 10%, var(--panel)) 0%, var(--panel) 54%); }
.confidential-notice { display: grid; gap: 6px; padding: 13px 15px; border: 1px solid color-mix(in srgb, var(--red) 52%, var(--line)); border-radius: var(--radius); background: color-mix(in srgb, var(--red) 13%, var(--panel)); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field { display: grid; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { color: var(--muted); font-size: 12px; font-weight: 750; }
.field input:not([type="checkbox"]):not([type="radio"]),
.field select,
.field textarea { width: 100%; min-height: var(--input-height); padding: var(--pad-input-y) var(--pad-input-x); border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-strong); color: var(--text); font-size: 13px; }
.field textarea { min-height: 104px; resize: vertical; }
.hint { display: block; color: var(--muted); font-size: 11px; font-weight: 600; line-height: 1.4; }
.choice,
.check-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-strong); font-size: 13px; line-height: 1.4; }
:is(.choice, .check-row) > input:is([type="checkbox"], [type="radio"]) { width: 16px; min-width: 16px; height: 16px; min-height: 16px; flex: 0 0 16px; margin: 2px 0 0; padding: 0; accent-color: var(--green); }
.rc-pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); }
.rc-pagination__summary { color: var(--muted); font-size: 12px; font-weight: 650; white-space: nowrap; }
.rc-pagination__summary strong { color: var(--text); font-weight: 800; }
.rc-pagination__links { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 4px; }
.rc-pagination__control,
.rc-pagination__page,
.rc-pagination__ellipsis { display: inline-flex; min-width: 32px; min-height: 32px; align-items: center; justify-content: center; gap: 5px; padding: 0 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel-strong); color: var(--text); font-size: 12px; font-weight: 750; line-height: 1; text-decoration: none; }
.rc-pagination__control:hover,
.rc-pagination__page:hover { border-color: var(--line-strong); background: var(--hover); }
.rc-pagination__page.is-current { border-color: color-mix(in srgb, var(--green) 55%, var(--line)); background: color-mix(in srgb, var(--green) 14%, var(--panel)); color: var(--green); }
.rc-pagination__control.is-disabled { color: var(--muted); cursor: not-allowed; opacity: 0.58; }
.rc-pagination__ellipsis { min-width: 22px; padding-inline: 3px; border-color: transparent; background: transparent; color: var(--muted); }
.rc-pagination__control svg { display: block; width: 14px; height: 14px; flex: 0 0 14px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table-wrap th,
.table-wrap td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table-wrap th { color: var(--muted); font-size: 12px; font-weight: 850; text-transform: uppercase; }
.table-wrap tr:last-child td { border-bottom: 0; }
.error { color: var(--red); font-size: 13px; font-weight: 700; }
.video-frame { width: min(100%, 760px); aspect-ratio: 16 / 9; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-strong); }
.video-player { display: block; width: 100%; height: 100%; border: 0; }

@media (max-width: 1023px) {
  .rc-sidebar-trigger { display: inline-flex; }
  .rc-sidebar { position: fixed; top: 0; height: 100vh; }
  .rc-scrim { display: block; }
  .rc-global-dashboard-action { display: none; }
  .rc-global-dashboard-menu-link { display: flex; }
  .rc-account-chip .rc-avatar { display: grid; }
  .rc-account-chip > span:not(.rc-avatar),
  .rc-account-chevron { display: none; }
  .rc-lms-main { padding-inline: 20px; }
  .rc-switch-meta { display: none; }
}

@media (max-width: 767px) {
  .rc-mobile-only { display: block; }
  .rc-hub-main { padding-top: 28px; }
  .rc-hub-heading { align-items: flex-start; flex-direction: column; }
  .rc-switch-row { align-items: flex-start; flex-wrap: wrap; padding: 16px; }
  .rc-switch-copy { flex: 1; }
  .rc-switch-copy p { white-space: normal; }
  .rc-switch-action { width: 100%; min-height: 44px; }
  .rc-brand-divider { display: none; }
  .rc-account-chevron { display: none; }
  .rc-timeline-row { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .rc-timeline-row .rc-status-pill { width: fit-content; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .button,
  .icon-button,
  .choice,
  .check-row { min-height: 44px; }
  .rc-pagination { align-items: flex-start; flex-direction: column; }
  .rc-pagination__links { width: 100%; justify-content: flex-start; }
}
