/* ==========================================================================
   BookFlow — Million Dollar Author Internal Tool Design System
   Calm, type-driven, navy chrome + GitHub blue + sparing brand gold.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Fonts (Google Fonts CDN)
   -------------------------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* --------------------------------------------------------------------------
   2. Design Tokens
   -------------------------------------------------------------------------- */
:root {
  /* Neutral surfaces */
  --bg: #ffffff;
  --bg-subtle: #f6f8fa;
  --bg-muted: #fafafa;
  --bg-inverse: #1d2d35;        /* navy chrome — MDA brand */
  --bg-inverse-2: #2a404b;      /* lifted navy surface */
  --bg-inverse-deep: #14212a;   /* deepest navy */

  /* Foreground */
  --fg: #1f2328;
  --fg-secondary: #59636e;
  --fg-muted: #848d97;
  --fg-on-inverse: #fafafa;
  --fg-on-inverse-muted: #9ca7b8;

  /* Borders */
  --border: #d1d9e0;
  --border-subtle: #e2e8f0;
  --border-divider: #eaeef2;
  --border-strong: #9ca3af;
  --border-inverse: #2a364d;

  /* Primary accent — MDA brand blue */
  --accent: #0668d9;
  --accent-hover: #0559bd;
  --accent-press: #04479c;
  --accent-fg: #ffffff;
  --accent-tint: #e2f0ff;
  --accent-tint-soft: #f4f9ff;
  --accent-ring: rgba(6, 104, 217, 0.35);

  /* Brand gold — sparing third accent */
  --gold: #eec345;
  --gold-hover: #e0b12f;
  --gold-press: #c99820;
  --gold-fg: #3d2f00;
  --gold-tint: #fff8d4;
  --gold-tint-soft: #fffdf2;

  /* Success */
  --success: #1a7f37;
  --success-hover: #156d2f;
  --success-tint: #dcfce7;
  --success-fg: #0f5226;

  /* Danger */
  --danger: #cf222e;
  --danger-hover: #a40e26;
  --danger-tint: #ffebe9;
  --danger-fg: #82071e;

  /* Warning (amber on cream) */
  --warning: #9a6700;
  --warning-bg: #fff8c5;
  --warning-border: #d4a72c;
  --warning-fg: #9a6700;

  /* Info banner */
  --info-bg: #ddf4ff;
  --info-border: #54aeff;
  --info-fg: #0969da;

  /* Link + merged — links are near-black, not blue (blue is reserved for program) */
  --link: #16242b;
  --link-hover: #16242b;
  --merged: #8250df;

  /* Create/primary-action accent — distinct from program blue + gold */
  --create: #5b53d6;
  --create-hover: #4a42c4;

  /* Progress / status semantics — never program colors */
  --progress-done: #16a34a;
  --progress-wip: #f59e0b;
  --progress-wip-ring: #fdecc8;

  /* Type families */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-display: 'Poppins', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
  --font-family: var(--font-sans);

  /* Type scale */
  --text-xs: 12px;   --leading-xs: 16px;
  --text-sm: 13px;   --leading-sm: 20px;
  --text-base: 14px; --leading-base: 20px;
  --text-md: 16px;   --leading-md: 24px;
  --text-lg: 20px;   --leading-lg: 28px;
  --text-xl: 24px;   --leading-xl: 32px;
  --text-2xl: 32px;  --leading-2xl: 40px;

  /* Weights */
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  /* Spacing — 4/8 base */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* Radii */
  --radius-sm: 5px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --radius-xl: 14px;
  --radius-pill: 999px;
  --card-radius: 12px;

  /* Shadows — soft, layered depth */
  --shadow-none: none;
  --shadow-xs: 0 1px 2px rgba(16,24,40,0.05);
  --shadow-card: 0 1px 3px rgba(16,24,40,0.07), 0 1px 2px rgba(16,24,40,0.04);
  --shadow-card-hover: 0 8px 24px rgba(16,24,40,0.10), 0 2px 6px rgba(16,24,40,0.06);
  --shadow-popover: 0 1px 2px rgba(0,0,0,0.04), 0 8px 24px rgba(16,24,40,0.10);
  --shadow-modal: 0 12px 40px rgba(16,24,40,0.18);

  /* Layout */
  --sidebar-width: 240px;
  --sidebar-collapsed: 56px;
  --topbar-height: 48px;
  --content-max: 1200px;

  /* Transitions */
  --transition-fast: 100ms ease-out;
  --transition-base: 150ms ease-out;

  /* Legacy compat — map old slate vars to new tokens so any stray uses still resolve */
  --color-primary: var(--accent);
  --color-primary-dark: var(--accent-press);
  --color-primary-light: var(--accent-tint);
  --color-slate-50: var(--bg-subtle);
  --color-slate-100: var(--bg-subtle);
  --color-slate-200: var(--border-subtle);
  --color-slate-300: var(--border);
  --color-slate-400: var(--fg-muted);
  --color-slate-500: var(--fg-secondary);
  --color-slate-600: var(--fg-secondary);
  --color-slate-700: var(--fg);
  --color-slate-800: var(--fg);
  --color-slate-900: var(--fg);
  --color-success: var(--success);
  --color-success-light: var(--success-tint);
  --color-warning: var(--warning);
  --color-warning-light: var(--warning-bg);
  --color-danger: var(--danger);
  --color-danger-light: var(--danger-tint);
  --color-info: var(--accent);
  --color-info-light: var(--accent-tint);
  /* Program color coding: Elite = gold, Accelerator = blue */
  --badge-elite: var(--gold-fg);
  --badge-elite-bg: var(--gold-tint);
  --badge-accelerator: var(--accent);
  --badge-accelerator-bg: var(--accent-tint);
  --stage-in-progress: var(--accent);
  --stage-in-progress-bg: var(--accent-tint);
  --stage-on-deck: var(--fg-secondary);
  --stage-on-deck-bg: var(--bg-subtle);
  --stage-waiting-feedback: var(--warning);
  --stage-waiting-feedback-bg: var(--warning-bg);
  --stage-on-hold: var(--warning);
  --stage-on-hold-bg: var(--warning-bg);
  --stage-stuck: var(--danger);
  --stage-stuck-bg: var(--danger-tint);
  --card-shadow: none;
  --card-shadow-hover: none;
}

/* --------------------------------------------------------------------------
   3. Reset / Base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-base);
  color: var(--fg);
  background: var(--bg-subtle);
  font-feature-settings: 'cv11', 'ss01', 'ss03';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  display: block;
}

ul, ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--fg);
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
  line-height: 1.3;
  letter-spacing: -0.01em;
}

h1 {
  font-size: var(--text-xl);
  line-height: var(--leading-xl);
  letter-spacing: -0.02em;
}
h2 {
  font-size: var(--text-lg);
  line-height: var(--leading-lg);
}
h3 {
  font-size: var(--text-md);
  line-height: var(--leading-md);
}
h4 {
  font-size: var(--text-base);
  line-height: var(--leading-base);
}

p { margin: 0; }

small {
  font-size: var(--text-xs);
  line-height: var(--leading-xs);
  color: var(--fg-muted);
}

code, kbd, pre, .mono, .font-mono {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

code:not(pre code) {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 1px 4px;
  color: var(--fg);
}

hr {
  border: 0;
  border-top: 1px solid var(--border-divider);
  margin: var(--space-6) 0;
}

::selection { background: var(--accent-tint); color: var(--fg); }

:focus-visible {
  outline: 2px solid var(--accent-ring);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* --------------------------------------------------------------------------
   4. Layout: Sidebar + Main Content
   -------------------------------------------------------------------------- */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.main-wrapper {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
}

.main-content {
  flex: 1;
  padding: var(--space-6) var(--space-8);
  margin-top: var(--topbar-height);
  background: var(--bg-subtle);
}

/* --------------------------------------------------------------------------
   5. Top Bar — navy chrome
   -------------------------------------------------------------------------- */
.topbar,
.top-bar {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  height: var(--topbar-height);
  background: var(--bg-inverse);
  border-bottom: 1px solid var(--bg-inverse-deep);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 var(--space-5);
  z-index: 100;
}

.topbar-user,
.user-info {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.topbar-avatar,
.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-hover) 100%);
  color: var(--gold-fg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  font-size: var(--text-xs);
  letter-spacing: 0.02em;
}

.topbar-name,
.user-name {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--fg-on-inverse);
}

.topbar-logout {
  margin-left: var(--space-3);
  font-size: var(--text-xs);
  color: var(--fg-on-inverse-muted);
  padding: 4px 10px;
  border: 1px solid var(--border-inverse);
  border-radius: var(--radius-md);
  background: transparent;
  cursor: pointer;
  transition: background var(--transition-base), color var(--transition-base);
}

.topbar-logout:hover {
  background: var(--bg-inverse-2);
  color: var(--fg-on-inverse);
  text-decoration: none;
}

/* The top bar's Logout button uses .btn .btn-small — override for navy */
.top-bar .btn-small,
.top-bar .btn-sm {
  background: transparent;
  color: var(--fg-on-inverse-muted);
  border: 1px solid var(--border-inverse);
}
.top-bar .btn-small:hover,
.top-bar .btn-sm:hover {
  background: var(--bg-inverse-2);
  color: var(--fg-on-inverse);
}

/* --------------------------------------------------------------------------
   6. Sidebar Navigation — navy chrome
   -------------------------------------------------------------------------- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: linear-gradient(180deg, #213640 0%, var(--bg-inverse) 45%, var(--bg-inverse-deep) 100%);
  color: var(--fg-on-inverse);
  display: flex;
  flex-direction: column;
  z-index: 200;
  overflow-y: auto;
  border-right: 1px solid rgba(0,0,0,0.2);
}
/* The sidebar is a flex column at 100vh; without this, a tall expanded section makes flexbox
   SHRINK the other children (squashing the collapsed service blocks) instead of scrolling.
   Pinning each child's height forces the overflow-y scroll to do its job. */
.sidebar > * { flex-shrink: 0; }

.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--bg-inverse-2); border-radius: 3px; }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  height: var(--topbar-height);
  border-bottom: 1px solid var(--border-inverse);
  background: var(--bg-inverse-deep);
}

.sidebar-brand-logo {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  display: block;
}

.sidebar-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.sidebar-brand h2,
.sidebar-brand-name {
  font-family: var(--font-display);
  font-size: var(--text-md);
  font-weight: var(--weight-bold);
  color: var(--fg-on-inverse);
  letter-spacing: -0.01em;
  margin: 0;
}

.sidebar-brand .text-muted,
.sidebar-brand .text-sm,
.sidebar-brand-sub {
  font-size: var(--text-xs);
  color: var(--fg-on-inverse-muted);
}

.sidebar-section {
  padding: var(--space-3) 0 var(--space-1);
}

.sidebar-section-title {
  font-size: 11px;
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-on-inverse-muted);
  padding: 0 var(--space-4) 6px;
}
/* Collapsible nav sections (long nav for admins). Click the title to fold. */
.sidebar-section-title.is-toggle { cursor: pointer; user-select: none; display: flex;
  align-items: center; justify-content: space-between; }
.sidebar-section-title.is-toggle::after { content: "▾"; font-size: 9px; opacity: .55;
  transition: transform .15s; }
.sidebar-section.collapsed .sidebar-section-title.is-toggle::after { transform: rotate(-90deg); }
.sidebar-section.collapsed .sidebar-link { display: none; }

.sidebar-nav a,
.sidebar-link {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px var(--space-4);
  font-size: var(--text-sm);
  color: #c8d0dc;
  transition: background var(--transition-base), color var(--transition-base);
  text-decoration: none;
  border-left: 2px solid transparent;
}

.sidebar-nav a:hover,
.sidebar-link:hover {
  background: var(--bg-inverse-2);
  color: var(--fg-on-inverse);
  text-decoration: none;
}

.sidebar-nav a.active,
.sidebar-link.active {
  background: linear-gradient(90deg, rgba(238,195,69,0.14), rgba(238,195,69,0.02));
  color: #ffffff;
  font-weight: var(--weight-semibold);
  border-left-color: var(--gold);
}

.sidebar-nav a .nav-count {
  margin-left: auto;
  font-size: 11px;
  background: var(--bg-inverse-deep);
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  color: var(--fg-on-inverse-muted);
  font-family: var(--font-mono);
}

/* --------------------------------------------------------------------------
   7. Page Header
   -------------------------------------------------------------------------- */
.page-header {
  margin-bottom: var(--space-5);
}

.page-header h1 {
  margin-bottom: var(--space-1);
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  line-height: var(--leading-2xl);
  font-weight: var(--weight-bold);
  letter-spacing: -0.025em;
}

.page-header .text-muted,
.page-header p {
  font-size: var(--text-sm);
  color: var(--fg-secondary);
}

/* --------------------------------------------------------------------------
   8. Dashboard / Stat Cards (dense metric tiles, 1px border, no shadow)
   -------------------------------------------------------------------------- */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.stat-card {
  background: var(--bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-card);
  padding: var(--space-5);
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}

.stat-card-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--fg-secondary);
  margin-bottom: var(--space-1);
  text-transform: none;
  letter-spacing: 0;
}

.stat-card-value {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: var(--weight-bold);
  line-height: 1.1;
  color: var(--fg);
  letter-spacing: -0.02em;
  font-feature-settings: 'tnum';
}

.stat-card-sub {
  font-size: var(--text-xs);
  color: var(--fg-muted);
  margin-top: var(--space-1);
}

.stat-card--danger .stat-card-value { color: var(--danger); }
.stat-card--warning .stat-card-value { color: var(--warning); }
.stat-card--success .stat-card-value { color: var(--success); }

.stat-card--clickable {
  display: block;
  cursor: pointer;
  transition: border-color var(--transition-base), background var(--transition-base);
  text-decoration: none;
  color: inherit;
}

.stat-card--clickable:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
  text-decoration: none;
}

.close-form {
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-subtle);
  padding: var(--space-3) var(--space-4);
}

/* --------------------------------------------------------------------------
   9. Kanban Board
   -------------------------------------------------------------------------- */
.kanban-board {
  display: flex;
  gap: var(--space-3);
  overflow-x: auto;
  padding-bottom: var(--space-3);
  min-height: 500px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.kanban-board::-webkit-scrollbar { height: 8px; }
.kanban-board::-webkit-scrollbar-track { background: var(--border-subtle); border-radius: 4px; }
.kanban-board::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
.kanban-board::-webkit-scrollbar-thumb:hover { background: var(--fg-muted); }

.kanban-column {
  flex: 0 0 320px;
  background: var(--bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--card-radius);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - var(--topbar-height) - 8rem);
  box-shadow: var(--shadow-card);
}

.kanban-column-header {
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--fg);
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  border-radius: var(--card-radius) var(--card-radius) 0 0;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  letter-spacing: -0.01em;
}

.kanban-column-header .badge-gate {
  background: var(--bg);
  color: var(--fg-secondary);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: var(--weight-semibold);
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

.kanban-column-header .text-sm {
  font-size: 11px;
  font-weight: var(--weight-medium);
  color: var(--fg-muted);
}

.kanban-column-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-2);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  background: var(--bg-subtle);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.kanban-column-body::-webkit-scrollbar { width: 6px; }
.kanban-column-body::-webkit-scrollbar-track { background: transparent; }
.kanban-column-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* Muted columns — handed back to the CSM ("With CSM") + On-Hold. Visible for the
   specialist's closure, but clearly parked off the active queue. */
.kanban-column--muted { opacity: .8; }
.kanban-column--muted .kanban-column-header { color: var(--fg-muted); background: var(--bg-subtle); }
/* The specialist's "I'm done, it's with the CSM now" footer note on a card. */
.card-handback {
  margin-top: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px dashed var(--border-divider);
  font-size: var(--text-xs, 12px);
  color: var(--fg-muted);
  line-height: 1.3;
}

/* Red alert banner — clients gone quiet 7+ days, top of the CSM/strategist inbox. */
.red-alert-banner {
  display: block; margin-bottom: var(--space-3);
  padding: 10px 16px; border-radius: var(--radius-md, 8px);
  background: color-mix(in srgb, var(--danger) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent);
  border-left: 4px solid var(--danger);
  color: var(--fg); text-decoration: none; font-size: var(--text-sm, 14px);
}
.red-alert-banner:hover { background: color-mix(in srgb, var(--danger) 16%, transparent); text-decoration: none; }
.red-alert-banner strong { color: var(--danger); }

/* Cover sub-gate strip: 3A Front · 3B Back · 3C Full · 3D Mock-ups. The current
   sub-gate = how far from published (3C/3D = publish-ready). Green = approved
   (matches the "green = done" language); ink outline = the piece in flight. */
.cover-strip { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin: 6px 0 2px; }
.cover-strip .cvr {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px; font-weight: 700; letter-spacing: .02em;
  padding: 1px 6px; border-radius: 5px; border: 1px solid transparent; line-height: 1.5;
}
.cover-strip .cvr.done    { background: var(--progress-done); color: #fff; }
.cover-strip .cvr.current { border-color: var(--fg); color: var(--fg); background: var(--bg); }
.cover-strip .cvr.todo    { background: var(--bg-subtle); color: var(--fg-muted); }
.cover-strip .cvr-hint    { font-size: 10px; font-weight: 700; color: var(--progress-done);
                            text-transform: uppercase; letter-spacing: .04em; }

/* Stage sub-headers within columns */
.stage-header {
  font-size: 11.5px;
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-secondary);
  padding: var(--space-2) var(--space-2) var(--space-1);
  margin-top: var(--space-2);
  border-top: 2px solid var(--border);
}

.stage-header:first-child {
  margin-top: 0;
  border-top: none;
  padding-top: var(--space-1);
}

.stage-header-empty {
  color: var(--fg-muted);
  font-weight: var(--weight-semibold);
  border-top-color: var(--border-subtle);
  opacity: 0.7;
}

.stage-count {
  font-size: 10px;
  font-weight: var(--weight-semibold);
  color: var(--fg-muted);
  background: var(--border-subtle);
  padding: 1px 5px;
  border-radius: var(--radius-pill);
  margin-left: var(--space-1);
  font-family: var(--font-mono);
}

.stage-list-toggle {
  margin-top: var(--space-2);
  padding: 0 var(--space-1);
}

.stage-list-toggle summary {
  cursor: pointer;
  font-size: var(--text-xs);
  color: var(--fg-muted);
}

.stage-list { margin-top: 6px; }

.stage-list-item {
  font-size: 11px;
  color: var(--fg-muted);
  padding: 3px 6px;
  border-left: 2px solid var(--border-subtle);
  margin-bottom: 2px;
}

/* --------------------------------------------------------------------------
   10. Project Cards (kanban + inbox card body)
   -------------------------------------------------------------------------- */
.project-card {
  background: var(--bg);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4);
  transition: box-shadow var(--transition-base), transform var(--transition-fast), border-color var(--transition-base);
  cursor: pointer;
  box-shadow: var(--shadow-card);
  /* Keep all content inside the card — a long name/title or a row of chips must never
     spill outside the card border. */
  overflow: hidden;
  min-width: 0;
  /* overflow:hidden removes a flex item's automatic min-height, so in a column with many
     cards the flex parent would SQUISH them to fit (collapsed/overlapping cards, seen on
     the cover board's busy "In Review" column). flex-shrink:0 keeps each card its natural
     height and lets the column scroll instead. */
  flex-shrink: 0;
}

.project-card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}

/* Program color coding on cards: Elite = gold, Accelerator = blue left rail */
.project-card--elite {
  border-left-color: var(--gold-hover);
}

.project-card--accelerator {
  border-left-color: var(--accent);
}

/* Stuck state wins over program color (declared after, so it overrides) */
.project-card-stuck,
.project-card--stuck {
  border-left-color: var(--danger);
  background: var(--bg);
}

.project-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-1);
  flex-wrap: wrap;   /* chips/badges wrap under the name instead of overflowing the card */
}

.project-card-header strong {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--fg);
  line-height: 1.3;
  min-width: 0;            /* let a long client name shrink instead of pushing chips out */
  overflow-wrap: anywhere;
}

.project-card-client {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--fg);
  margin-bottom: 2px;
  letter-spacing: -0.005em;
}

.project-card-title {
  font-size: var(--text-sm);
  color: var(--fg-secondary);
  margin-bottom: var(--space-2);
  line-height: 1.4;
  overflow-wrap: anywhere;   /* long/unbroken titles wrap inside the card */
}

.project-card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.project-card-days {
  font-size: 11px;
  font-weight: var(--weight-medium);
  color: var(--fg-secondary);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
}

.project-card-days-overdue,
.project-card-days--overdue {
  color: var(--danger-fg);
  background: var(--danger-tint);
  border-color: var(--danger-tint);
}

/* The "stuck" reason chip inside a stuck card */
.project-card-stuck.project-card-stuck-reason,
.project-card .project-card-stuck-reason {
  font-size: 11px;
  font-weight: var(--weight-medium);
  color: var(--danger-fg);
  margin-top: var(--space-2);
  padding: 6px var(--space-2);
  background: var(--danger-tint);
  border-radius: var(--radius-sm);
  line-height: 1.3;
}

/* --------------------------------------------------------------------------
   11. Badges
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: var(--weight-medium);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  text-transform: none;
  letter-spacing: 0;
  white-space: nowrap;
  line-height: 1.4;
  border: 1px solid transparent;
}

/* Program color coding: Elite = gold, Accelerator = blue */
.badge-elite,
.badge--elite {
  background: var(--gold-tint);
  color: var(--gold-fg);
  border-color: var(--gold-border, var(--gold-hover));
}

.badge-accelerator,
.badge--accelerator {
  background: var(--accent-tint);
  color: var(--accent);
  border-color: var(--accent-ring);
}

/* Book Marketing Mastery = teal, distinct from the two book programs */
.badge-bmm {
  background: rgba(13, 148, 136, 0.12);
  color: #0f766e;
  border-color: rgba(13, 148, 136, 0.35);
}

/* Sales Accelerator = warm orange */
.badge-sa {
  background: rgba(224, 138, 91, 0.14);
  color: #b45309;
  border-color: rgba(224, 138, 91, 0.4);
}

.badge-stage-progress,
.badge-stage-in-progress,
.badge--in-progress {
  background: var(--accent-tint);
  color: var(--accent);
}

.badge-stage-deck,
.badge-stage-on-deck,
.badge--on-deck {
  background: var(--bg-subtle);
  color: var(--fg-secondary);
  border-color: var(--border-subtle);
}

.badge-stage-feedback,
.badge-stage-waiting-feedback,
.badge--waiting-feedback {
  background: var(--warning-bg);
  color: var(--warning-fg);
}

.badge-stage-hold,
.badge-stage-on-hold,
.badge--on-hold {
  background: var(--warning-bg);
  color: var(--warning-fg);
}

.badge-stage-stuck,
.badge--stuck {
  background: var(--danger-tint);
  color: var(--danger-fg);
}

.badge-stage-default {
  background: var(--bg-subtle);
  color: var(--fg-secondary);
  border-color: var(--border-subtle);
}

.badge-stage-complete,
.badge-stage-completed {
  background: var(--success-tint);
  color: var(--success-fg);
}

.badge-gate,
.badge--gate {
  background: var(--bg-subtle);
  color: var(--fg-secondary);
  border: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: var(--weight-medium);
  border-radius: var(--radius-sm);
  letter-spacing: 0;
}

.badge-success {
  background: var(--success-tint);
  color: var(--success-fg);
}

.badge-secondary {
  background: var(--bg-subtle);
  color: var(--fg-secondary);
  border-color: var(--border-subtle);
}

.badge-warning {
  background: var(--warning-bg);
  color: var(--warning-fg);
}

.badge-paused {
  background: var(--warning-bg);
  color: var(--warning-fg);
}

.badge-paused-prominent {
  font-size: 0.875rem;
  font-weight: var(--weight-semibold);
  padding: 0.25rem 0.625rem;
  letter-spacing: 0.02em;
}

.alert-paused {
  background: var(--warning-bg);
  color: var(--warning-fg);
  border: 1px solid var(--warning-fg);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  font-size: 0.9375rem;
}

.btn-warning {
  background: var(--warning-bg);
  color: var(--warning-fg);
  border: 1px solid var(--warning-fg);
}
.btn-warning:hover {
  filter: brightness(0.92);
}

.badge-danger {
  background: var(--danger-tint);
  color: var(--danger-fg);
}

.badge-info {
  background: var(--accent-tint);
  color: var(--accent);
}

/* Gold "featured" badge — sparing brand accent */
.badge-featured,
.badge--featured {
  background: var(--gold-tint);
  color: var(--gold-fg);
  border: 1px solid var(--gold);
}

/* --------------------------------------------------------------------------
   12. Inbox
   -------------------------------------------------------------------------- */
.inbox-section {
  margin-bottom: var(--space-6);
}

.inbox-section-header {
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  color: var(--fg);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: var(--space-3);
}

.inbox-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.inbox-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: none;
  transition: border-color var(--transition-base), background var(--transition-base);
}

.inbox-item:hover {
  background: var(--bg-subtle);
  border-color: var(--border-strong);
  box-shadow: none;
}

.inbox-item--high { border-left: 3px solid var(--danger); }
.inbox-item--medium { border-left: 3px solid var(--warning-border); }
.inbox-item--low { border-left: 3px solid var(--border); }

.inbox-item-content { flex: 1; min-width: 0; }

.inbox-item-title {
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--fg);
}

.inbox-item-sub {
  font-size: var(--text-xs);
  color: var(--fg-muted);
}

.inbox-item-date {
  font-size: var(--text-xs);
  color: var(--fg-muted);
  white-space: nowrap;
  font-family: var(--font-mono);
}

/* --------------------------------------------------------------------------
   13. Checklist + Progress Bar
   -------------------------------------------------------------------------- */
.checklist {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-base);
  color: var(--fg);
}

.checklist-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

.checklist-item--done {
  color: var(--fg-muted);
  text-decoration: line-through;
}

.progress-bar-wrapper {
  margin-top: var(--space-3);
}

.progress-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--fg-secondary);
  margin-bottom: var(--space-1);
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--border-subtle);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: var(--radius-pill);
  transition: width 250ms ease-out;
}

.progress-bar-fill--success { background: var(--success); }

.progress-pct {
  font-weight: var(--weight-semibold);
  font-family: var(--font-mono);
}

.progress-bar-track {
  width: 100%;
  height: 6px;
  background: var(--border-subtle);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.progress-bar-track .progress-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: var(--radius-pill);
  transition: width 250ms ease-out;
}

/* --------------------------------------------------------------------------
   14. Project Detail Page
   -------------------------------------------------------------------------- */
.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-5);
  gap: var(--space-4);
}

.detail-header h1 {
  margin-bottom: var(--space-1);
}

.detail-header-sub {
  font-size: var(--text-sm);
  color: var(--fg-secondary);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.info-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
}

.info-item-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--fg-secondary);
  margin-bottom: 2px;
  text-transform: none;
  letter-spacing: 0;
}

.info-item-value {
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--fg);
}

/* Activity log */
.activity-log {
  position: relative;
  padding-left: var(--space-5);
}

.activity-log::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--border-subtle);
}

.activity-entry {
  position: relative;
  padding-bottom: var(--space-4);
}

.activity-entry::before {
  content: "";
  position: absolute;
  left: calc(-1 * var(--space-5));
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 2px var(--border-subtle);
}

.activity-date {
  font-size: var(--text-xs);
  color: var(--fg-muted);
  margin-bottom: 2px;
  font-family: var(--font-mono);
}

.activity-text {
  font-size: var(--text-base);
  color: var(--fg);
}

.activity-group {
  position: relative;
  padding-bottom: var(--space-3);
  margin-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-divider);
}

.activity-group:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.activity-group::before {
  content: "";
  position: absolute;
  left: calc(-1 * var(--space-5));
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 2px var(--border-subtle);
}

.activity-group .activity-date { margin-bottom: var(--space-1); }
.activity-group .activity-text { margin-bottom: 2px; }

.activity-meta {
  font-size: var(--text-xs);
  color: var(--fg-muted);
  padding-left: var(--space-2);
  border-left: 2px solid var(--border-subtle);
  margin-top: var(--space-1);
}

.activity-text code {
  font-size: 0.92em;
  background: var(--bg-subtle);
  padding: 1px 4px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  color: var(--accent);
  border: 1px solid var(--border-subtle);
}

/* Detail page two-column */
.detail-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: var(--space-5);
  align-items: start;
}

@media (max-width: 900px) {
  .detail-layout { grid-template-columns: 1fr; }
  .detail-sidebar { position: static !important; }
}

.detail-main { min-width: 0; }

.detail-sidebar {
  position: sticky;
  top: var(--space-3);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}

.detail-section {
  background: var(--bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-card);
  padding: var(--space-5) var(--space-6);
  margin-bottom: var(--space-5);
}

.detail-section-title {
  font-family: var(--font-display);
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  letter-spacing: -0.01em;
  margin: 0 0 var(--space-3) 0;
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-divider);
  color: var(--fg);
}

.sidebar-info-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-divider);
  font-size: var(--text-sm);
}

.sidebar-info-row:last-child { border-bottom: none; }

.sidebar-info-label {
  color: var(--fg-secondary);
  font-weight: var(--weight-medium);
}

.sidebar-info-value {
  color: var(--fg);
  font-weight: var(--weight-medium);
  text-align: right;
  max-width: 60%;
  word-break: break-word;
}

.actions-group {
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-divider);
}
.actions-group:first-child { padding-top: 0; }
.actions-group:last-child { border-bottom: none; padding-bottom: 0; }

.actions-group-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fg-muted);
  margin-bottom: var(--space-2);
}

.actions-group-row {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  align-items: center;
}

.team-lead {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-divider);
}

.team-lead-role {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fg-muted);
}

.team-lead-name {
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  color: var(--fg);
}

.resource-grid-compact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.resource-chip {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 6px var(--space-2);
  font-size: var(--text-xs);
}

.resource-chip-role {
  color: var(--fg-muted);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 10px;
  display: block;
  margin-bottom: 2px;
}

.resource-chip-name {
  color: var(--fg);
  font-weight: var(--weight-medium);
}

/* --------------------------------------------------------------------------
   15. Forms
   -------------------------------------------------------------------------- */
.form-group {
  margin-bottom: var(--space-4);
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--fg);
  margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea,
.form-control {
  width: 100%;
  padding: 6px 10px;
  font-size: var(--text-base);
  line-height: var(--leading-base);
  font-family: var(--font-sans);
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus,
.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--fg-muted);
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23848d97' d='M6 8.825L.35 3.175l.7-.7L6 7.425l4.95-4.95.7.7z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-3) center;
  padding-right: var(--space-8);
}

/* --------------------------------------------------------------------------
   16. Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px var(--space-4);
  font-size: var(--text-base);
  line-height: var(--leading-base);
  font-weight: var(--weight-semibold);
  font-family: var(--font-display);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--transition-base), border-color var(--transition-base),
              color var(--transition-base), box-shadow var(--transition-base), transform var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}

.btn:active { transform: translateY(1px); }

.btn:hover { text-decoration: none; }

.btn:focus-visible {
  outline: 2px solid var(--accent-ring);
  outline-offset: 2px;
}

.btn--primary,
.btn-primary {
  background: var(--bg-inverse);
  color: #fff;
  border-color: var(--bg-inverse);
  box-shadow: var(--shadow-xs);
}

.btn--primary:hover,
.btn-primary:hover {
  background: var(--bg-inverse-2);
  border-color: var(--bg-inverse-2);
  color: #fff;
  box-shadow: var(--shadow-card);
}

.btn--primary:active,
.btn-primary:active {
  background: var(--accent-press);
  border-color: var(--accent-press);
}

.btn--secondary,
.btn-secondary {
  background: var(--bg);
  color: var(--fg);
  border-color: var(--border);
}

.btn--secondary:hover,
.btn-secondary:hover {
  background: var(--bg-subtle);
  border-color: var(--border-strong);
}

.btn--danger,
.btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

.btn--danger:hover,
.btn-danger:hover {
  background: var(--danger-hover);
  border-color: var(--danger-hover);
}

.btn--sm,
.btn-sm,
.btn-small {
  padding: 4px var(--space-2);
  font-size: var(--text-sm);
  line-height: 1.4;
}

.btn-success {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}

.btn-success:hover {
  background: var(--success-hover);
  border-color: var(--success-hover);
  color: #fff;
}

.btn-slack {
  background: var(--bg);
  color: var(--fg);
  border-color: var(--border);
}
.btn-slack:hover {
  background: var(--bg-subtle);
  border-color: var(--border-strong);
  color: var(--fg);
}

.btn-drive {
  background: var(--bg);
  color: var(--fg);
  border-color: var(--border);
}
.btn-drive:hover {
  background: var(--bg-subtle);
  border-color: var(--border-strong);
  color: var(--fg);
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* --------------------------------------------------------------------------
   17. Alerts / Banners
   -------------------------------------------------------------------------- */
.alert {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  margin-bottom: var(--space-4);
  border: 1px solid transparent;
}

.alert--danger,
.alert-danger {
  background: var(--danger-tint);
  color: var(--danger-fg);
  border-color: var(--danger);
}

.alert--warning,
.alert-warning {
  background: var(--warning-bg);
  color: var(--warning-fg);
  border-color: var(--warning-border);
}

.alert--success,
.alert-success {
  background: var(--success-tint);
  color: var(--success-fg);
  border-color: var(--success);
}

.alert--info,
.alert-info {
  background: var(--info-bg);
  color: var(--info-fg);
  border-color: var(--info-border);
}

.alert-title {
  font-weight: var(--weight-semibold);
  margin-bottom: 2px;
}

/* --------------------------------------------------------------------------
   18. Login Page
   -------------------------------------------------------------------------- */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg-subtle);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-popover);
  padding: var(--space-8);
}

.login-card h1 {
  text-align: center;
  margin-bottom: var(--space-1);
}

.login-card-sub,
.login-subtitle {
  text-align: center;
  color: var(--fg-secondary);
  font-size: var(--text-base);
  margin-bottom: var(--space-5);
}

.login-card .btn--primary,
.login-card .btn-primary {
  width: 100%;
  justify-content: center;
  margin-top: var(--space-2);
}

/* --------------------------------------------------------------------------
   19. Utilities
   -------------------------------------------------------------------------- */
.text-muted { color: var(--fg-muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-sm { font-size: var(--text-sm); line-height: var(--leading-sm); }
.text-xs { font-size: var(--text-xs); line-height: var(--leading-xs); }
.text-center { text-align: center; }
.font-mono { font-family: var(--font-mono); }
.mt-1 { margin-top: var(--space-2); }
.mt-2 { margin-top: var(--space-4); }
.mb-1 { margin-bottom: var(--space-2); }
.mb-2 { margin-bottom: var(--space-4); }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Empty state — single muted line-icon centered above headline + 1-line copy + 1 CTA */
.empty-state {
  text-align: center;
  padding: var(--space-10) var(--space-4);
  color: var(--fg-muted);
  font-size: var(--text-base);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.empty-state-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-3);
  color: var(--fg-muted);
}

.empty-state-icon i,
.empty-state-icon svg {
  width: 24px;
  height: 24px;
  stroke-width: 1.5;
}

.empty-state-headline {
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  color: var(--fg);
  margin-bottom: var(--space-1);
}

.empty-state-body {
  font-size: var(--text-sm);
  color: var(--fg-secondary);
  margin-bottom: var(--space-4);
}

/* Info card */
.info-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
}

.info-card .info-label,
.info-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--fg-secondary);
  margin-bottom: 6px;
  text-transform: none;
  letter-spacing: 0;
}

.info-card .info-value,
.info-value {
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--fg);
}

/* Project header on detail pages */
.project-header { margin-bottom: var(--space-5); }
.project-header h1 { margin-bottom: var(--space-1); }
.project-subtitle {
  font-size: var(--text-base);
  color: var(--fg-secondary);
}

/* --------------------------------------------------------------------------
   20. Data Tables — dense, sticky header, 1px row dividers
   -------------------------------------------------------------------------- */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--card-radius);
  overflow: hidden;
  margin-bottom: var(--space-5);
  box-shadow: var(--shadow-card);
  font-size: var(--text-sm);
}

.data-table thead {
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
}

.data-table th {
  padding: 12px var(--space-4);
  font-size: 11px;
  font-weight: var(--weight-semibold);
  color: var(--fg-muted);
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  position: sticky;
  top: 0;
  background: var(--bg-subtle);
  z-index: 1;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
  color: var(--fg);
  border-bottom: 1px solid var(--border-divider);
  vertical-align: middle;
  height: 40px;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr {
  transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
  background: var(--accent-tint-soft);
}

/* --------------------------------------------------------------------------
   Glanceable list components — program stripe · pipeline bar · status chip
   -------------------------------------------------------------------------- */
.cli { display: flex; align-items: center; gap: 11px; }
.cli-stripe { width: 4px; align-self: stretch; min-height: 34px; border-radius: 3px; flex-shrink: 0; }
.cli-stripe.elite { background: var(--gold); }
.cli-stripe.accelerator { background: var(--accent); }
.cli-name { font-weight: var(--weight-semibold); letter-spacing: -0.01em; }
.cli-sub { color: var(--fg-muted); font-size: 12px; }
/* The concrete next-step on an inbox card ("▸ QA the draft → send to client"). */
.cli-action { font-size: 12px; font-weight: var(--weight-semibold); color: var(--fg); margin-top: 3px; }
.mini-av {
  width: 24px; height: 24px; border-radius: var(--radius-pill); background: var(--bg-inverse);
  color: #fff; font-size: 10px; font-weight: var(--weight-bold);
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  font-family: var(--font-display);
}
.metric { font-variant-numeric: tabular-nums; font-weight: var(--weight-semibold); }
.metric-over { color: var(--danger); }
.metric-sub { font-size: 11px; color: var(--fg-muted); }

.pipe { display: flex; flex-direction: column; gap: 5px; min-width: 150px; }
.pipe-track { display: flex; gap: 3px; }
.pipe-seg { height: 6px; flex: 1; border-radius: 3px; background: #e4e9ef; }
.pipe-seg.done { background: var(--progress-done); }
.pipe-seg.current { background: var(--progress-wip); box-shadow: 0 0 0 2px var(--progress-wip-ring); }
.pipe-seg.stuck { background: var(--danger); box-shadow: 0 0 0 2px var(--danger-tint); }
.pipe-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 11px;
             font-weight: var(--weight-semibold); color: var(--fg-secondary); }
.pipe-meta .step { color: var(--fg-muted); font-variant-numeric: tabular-nums; }

.chip-status {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: var(--weight-bold);
  padding: 3px 9px; border-radius: var(--radius-pill); white-space: nowrap; border: 1px solid transparent;
}
.chip-status .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip-good { background: var(--success-tint); color: var(--success-fg); }
.chip-warn { background: var(--warning-bg); color: var(--warning-fg); }
.chip-bad { background: var(--danger-tint); color: var(--danger-fg); }
/* ===== Court = WHICH TEAM holds the ball (its own colors — NOT the program
   gold/blue). A card's color tells you who must act. See the how-to guide. ===== */
.court-manuscript { --court:#d97a34; --court-tint:#fbeee2; }   /* orange  · Manuscript */
.court-design     { --court:#8b5cf6; --court-tint:#efeafe; }   /* purple  · Design */
.court-interior   { --court:#2ba0d6; --court-tint:#e4f4fb; }   /* l.blue  · Interior Layout */
.court-csm        { --court:#df4f95; --court-tint:#fbe9f2; }   /* pink    · CSM (your turn) */
.court-client     { --court:#1f9c68; --court-tint:#e5f5ee; }   /* green   · Client */
.court-on_hold    { --court:#7c8894; --court-tint:#eef1f3; }   /* grey    · On hold */
.court-stuck      { --court:#d6394c; --court-tint:#fbe8ea; }   /* red     · Stuck */
.chip-court { background: var(--surface-2, #eef1f3); color: var(--fg-muted); }
.chip-status.court-manuscript, .chip-status.court-design, .chip-status.court-interior,
.chip-status.court-csm, .chip-status.court-client, .chip-status.court-on_hold,
.chip-status.court-stuck { background: var(--court-tint); color: var(--court); border: 1px solid var(--court); font-weight: 700; }
.cli-stripe.court-manuscript, .cli-stripe.court-design, .cli-stripe.court-interior,
.cli-stripe.court-csm, .cli-stripe.court-client, .cli-stripe.court-on_hold,
.cli-stripe.court-stuck { background: var(--court); }
/* Production-board column headers colored by team — the column IS the status, so
   its color tells you whose court at a glance (no per-card chip needed). */
.kanban-column-header.court-design, .kanban-column-header.court-csm,
.kanban-column-header.court-client, .kanban-column-header.court-on_hold,
.kanban-column-header.court-stuck {
  background: var(--court-tint); color: var(--court); box-shadow: inset 0 3px 0 var(--court);
}
.chip-published { background: #eef1f5; color: #33475a; border-color: #dbe2ea; }
.chip-neutral { background: var(--bg-subtle); color: var(--fg-secondary); }
.cli-name a { color: var(--fg); }
.cli-name a:hover { text-decoration: underline; }

.data-table .row-completed {
  background: var(--success-tint);
}
.data-table .row-completed:hover {
  background: var(--success-tint);
}
.data-table .row-completed td { color: var(--success-fg); }

.data-table .row-in-progress {
  background: var(--accent-tint-soft);
}
.data-table .row-in-progress:hover {
  background: var(--accent-tint);
}

/* --------------------------------------------------------------------------
   21. Versions
   -------------------------------------------------------------------------- */
.version-section { margin-bottom: var(--space-6); }

.version-timeline {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.version-entry {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
}

.draft-record {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 0.375rem;
  background: var(--bg);
}

.draft-record-summary {
  padding: var(--space-2) var(--space-3);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.125rem;
  font-size: 0.875rem;
}

.draft-record-summary::-webkit-details-marker { display: none; }

.draft-record[open] > .draft-record-summary {
  border-bottom: 1px solid var(--border-subtle);
}

.draft-record-body {
  padding: var(--space-3);
}

.version-entry.version-approved {
  border-left: 3px solid var(--success);
}

.version-entry.version-in-review {
  border-left: 3px solid var(--accent);
}

.version-entry.version-superseded {
  opacity: 0.55;
}

.version-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
}

.version-number {
  font-weight: var(--weight-semibold);
  font-size: var(--text-base);
  color: var(--fg);
  font-family: var(--font-mono);
}

.version-meta {
  font-size: var(--text-sm);
  color: var(--fg-secondary);
  margin-bottom: var(--space-2);
}

.version-meta span { margin-right: var(--space-2); }

.version-detail {
  font-size: var(--text-sm);
  margin-bottom: 6px;
}

.version-notes {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  margin-top: var(--space-2);
}

.version-actions {
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-divider);
}

/* --------------------------------------------------------------------------
   22. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  :root {
    --sidebar-width: 0px;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }

  .sidebar.open {
    transform: translateX(0);
    width: 240px;
  }

  .topbar, .top-bar {
    left: 0;
  }

  .main-wrapper { margin-left: 0; }
  .main-content { padding: var(--space-4); }

  .kanban-board { gap: var(--space-2); padding: 0 var(--space-2); }
  .kanban-column { flex: 0 0 280px; }
  .kanban-column-header { padding: var(--space-2) var(--space-3); }

  .dashboard-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }

  .info-grid { grid-template-columns: 1fr 1fr; }
  .detail-header { flex-direction: column; gap: var(--space-3); }
}

@media (max-width: 480px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: 1fr; }
  .kanban-column { flex: 0 0 85vw; max-height: none; }
  .kanban-board { min-height: auto; }
  .login-card { margin: var(--space-4); }
  .pipeline-stage-label { flex: 0 0 120px; font-size: var(--text-xs); }
  .action-toolbar { flex-direction: column; align-items: stretch; }
}

/* --------------------------------------------------------------------------
   23. Exception Queue
   -------------------------------------------------------------------------- */
.exception-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.exception-table th {
  text-align: left;
  padding: var(--space-2) var(--space-3);
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  font-weight: var(--weight-semibold);
  color: var(--fg-secondary);
  font-size: var(--text-xs);
  text-transform: none;
  letter-spacing: 0;
}

.exception-table td {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
}

.exception-table tr:last-child td { border-bottom: none; }
.exception-table tr:hover { background: var(--bg-subtle); }

.exception-row-critical { background: var(--danger-tint); }
.exception-row-critical:hover { background: var(--danger-tint); }
.exception-row-high { background: var(--warning-bg); }
.exception-row-high:hover { background: var(--warning-bg); }

.badge-severity-critical {
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: var(--weight-semibold);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.02em;
}

.badge-severity-high {
  background: var(--warning-border);
  color: var(--warning-fg);
  font-size: 10px;
  font-weight: var(--weight-semibold);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.badge-severity-medium {
  background: var(--warning-bg);
  color: var(--warning-fg);
  font-size: 10px;
  font-weight: var(--weight-semibold);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.badge-severity-low {
  background: var(--bg-subtle);
  color: var(--fg-secondary);
  font-size: 10px;
  font-weight: var(--weight-semibold);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

/* --------------------------------------------------------------------------
   24. Action Toolbar / Filter Bar / Sidebar Alerts
   -------------------------------------------------------------------------- */
.action-toolbar {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-5);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.sidebar-alerts {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.sidebar-alerts .alert {
  margin-bottom: 0;
  font-size: var(--text-sm);
  padding: var(--space-2) var(--space-3);
}

.sidebar-alerts .alert-title { font-size: var(--text-xs); }
.sidebar-alerts .alert p { margin: 2px 0 0; font-size: var(--text-sm); }

.filter-bar {
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-5);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

/* --------------------------------------------------------------------------
   25. Pipeline Visualization (Dashboard)
   -------------------------------------------------------------------------- */
.pipeline-viz { margin-bottom: var(--space-5); }

.pipeline-stage {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border-subtle);
}

.pipeline-stage:last-child { border-bottom: none; }

.pipeline-stage-label {
  flex: 0 0 200px;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pipeline-stage-bar-wrap {
  flex: 1;
  height: 24px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
}

.pipeline-bar {
  height: 100%;
  background: var(--accent);
  min-width: 2px;
  transition: width 0.4s ease;
}

.pipeline-bar--stuck { background: var(--danger); }

.pipeline-bar--partial {
  background: linear-gradient(
    90deg,
    var(--accent) 0%,
    var(--accent) var(--ok-pct),
    var(--danger) var(--ok-pct),
    var(--danger) 100%
  );
}

.pipeline-stage-count {
  flex: 0 0 60px;
  text-align: right;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--fg);
  font-family: var(--font-mono);
}

.pipeline-stage-count .stuck-count {
  color: var(--danger);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
}

/* --------------------------------------------------------------------------
   26. Danger Zone (Settings-style)
   -------------------------------------------------------------------------- */
.danger-zone {
  margin-top: var(--space-12);
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--danger);
  border-radius: var(--radius-md);
  background: var(--bg);
}

.danger-zone h2 {
  color: var(--danger);
  font-size: var(--text-md);
  margin-bottom: var(--space-1);
}

/* --------------------------------------------------------------------------
   27. Modal
   -------------------------------------------------------------------------- */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(15, 22, 32, 0.5);
  justify-content: center;
  align-items: flex-start;
  padding-top: 10vh;
}

.modal-backdrop.modal-open { display: flex; }

.modal-content {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  width: 90%;
  max-width: 640px;
  max-height: 80vh;
  overflow-y: auto;
  padding: var(--space-6);
  position: relative;
}

.modal-close {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--fg-muted);
  line-height: 1;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: background var(--transition-base), color var(--transition-base);
}

.modal-close:hover {
  color: var(--fg);
  background: var(--bg-subtle);
}

.row-stuck {
  background: var(--danger-tint);
}
.row-stuck:hover { background: var(--danger-tint); }

.row-paused {
  background: var(--warning-bg);
  opacity: 0.85;
}
.row-paused:hover { background: var(--warning-bg); }

/* --------------------------------------------------------------------------
   28. Strategist Inbox
   -------------------------------------------------------------------------- */
.strategist-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-2);
  box-shadow: none;
  transition: border-color var(--transition-base), background var(--transition-base);
}

.strategist-card:hover {
  background: var(--bg-subtle);
  border-color: var(--border-strong);
  border-left-color: var(--accent);
}

.strategist-card--stuck {
  border-left-color: var(--danger);
}
.strategist-card--stuck:hover { border-left-color: var(--danger); }

.strategist-card--needs-attention {
  border-left-color: var(--warning-border);
}

.strategist-card-row {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
}

.strategist-card-main {
  flex: 1;
  min-width: 0;
}

.strategist-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: 2px;
  flex-wrap: wrap;
}

.strategist-card-header strong {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--fg);
}

.strategist-card-actions {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
}

.strategist-card-actions .btn {
  font-size: var(--text-xs);
  padding: 4px 10px;
  white-space: nowrap;
  text-align: center;
  justify-content: center;
}

.strategist-card-meta {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  margin-top: var(--space-2);
}

.strategist-call-progress { margin-top: var(--space-2); }

.strategist-next-call {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  margin-top: var(--space-2);
  padding: 6px 10px;
  background: var(--accent-tint-soft);
  border: 1px solid var(--accent-tint);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
}

.strategist-next-call-label {
  font-weight: var(--weight-semibold);
  color: var(--accent);
}

.strategist-next-call-date {
  font-weight: var(--weight-medium);
  color: var(--fg);
  font-family: var(--font-mono);
}

.strategist-next-call-time {
  color: var(--fg-secondary);
  font-family: var(--font-mono);
}

.strategist-phase-indicator {
  margin-top: var(--space-2);
  padding: 6px 10px;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}

.strategist-phase-indicator--warning {
  background: var(--warning-bg);
  color: var(--warning-fg);
}

.strategist-phase-indicator--info {
  background: var(--accent-tint);
  color: var(--accent);
}

.strategist-phase-indicator--active {
  background: var(--accent-tint);
  color: var(--accent);
}

.strategist-phase-indicator--kickoff {
  background: var(--bg-subtle);
  color: var(--fg-secondary);
  border: 1px solid var(--border-subtle);
}

.strategist-phase-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: var(--weight-medium);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  text-transform: none;
  letter-spacing: 0;
  white-space: nowrap;
  line-height: 1.4;
}

.strategist-phase-badge--calls {
  background: var(--accent-tint);
  color: var(--accent);
}

.strategist-phase-badge--outline {
  background: var(--accent-tint);
  color: var(--accent);
}

.strategist-phase-badge--review {
  background: var(--warning-bg);
  color: var(--warning-fg);
}

.strategist-phase-badge--complete {
  background: var(--success-tint);
  color: var(--success-fg);
}

@media (max-width: 768px) {
  .strategist-card-row { flex-direction: column; }
  .strategist-card-actions { flex-direction: row; flex-wrap: wrap; }
  .strategist-card-actions .btn { flex: 1 1 auto; }
}

.strategist-wip-indicator {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px var(--space-3);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  margin-top: var(--space-2);
}

.strategist-wip-indicator--at {
  background: var(--warning-bg);
  color: var(--warning-fg);
  border-color: var(--warning-border);
}

.strategist-wip-indicator--over {
  background: var(--danger-tint);
  color: var(--danger-fg);
  border-color: var(--danger);
}

.strategist-card--downstream {
  border-left-color: var(--success);
  opacity: 0.85;
}

/* --------------------------------------------------------------------------
   29. Manuscript Kanban + Drag-and-Drop + Per-Person WIP
   -------------------------------------------------------------------------- */
.manuscript-kanban {
  display: flex;
  gap: var(--space-3);
  overflow-x: auto;
  padding: var(--space-2) 0 var(--space-3);
  min-height: 400px;
}

.manuscript-kanban .kanban-column {
  flex: 1 1 0;
  min-width: 200px;
  max-width: 300px;
}

.board-controls {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

.board-controls .form-control {
  padding: 4px 10px;
  font-size: var(--text-sm);
}

.project-card-person {
  display: inline-block;
  font-size: 11px;
  font-weight: var(--weight-medium);
  color: var(--fg-secondary);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.project-card-actions {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border-divider);
}

.btn-pull {
  background: var(--accent);
  color: var(--accent-fg);
  border: 1px solid var(--accent);
  font-size: 11px;
  padding: 3px 8px;
}
.btn-pull:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--accent-fg);
}

.sortable-ghost {
  opacity: 0.4;
  border: 2px dashed var(--accent);
  background: var(--accent-tint-soft);
}

.sortable-chosen {
  box-shadow: var(--shadow-popover);
  transform: rotate(0.5deg);
}

.manuscript-kanban .project-card.draggable-card { cursor: grab; }
.manuscript-kanban .project-card.draggable-card:active { cursor: grabbing; }

.badge-revision {
  font-size: 11px;
  font-weight: var(--weight-medium);
  color: var(--accent);
  background: var(--accent-tint);
  padding: 1px 5px;
  border-radius: var(--radius-sm);
  margin-left: var(--space-1);
}

.wip-warning-modal h3 {
  margin-bottom: var(--space-3);
  color: var(--fg);
}

/* --------------------------------------------------------------------------
   30. Collapsible Sections (details/summary)
   -------------------------------------------------------------------------- */
.detail-section-toggle {
  cursor: pointer;
  user-select: none;
  list-style: none;
}

.detail-section-toggle::-webkit-details-marker { display: none; }

.detail-section-toggle::before {
  content: "›";
  display: inline-block;
  font-size: var(--text-md);
  margin-right: var(--space-2);
  transition: transform var(--transition-base);
  color: var(--fg-muted);
}

details[open] > .detail-section-toggle::before {
  transform: rotate(90deg);
}

.enriched-section-body { padding-top: var(--space-3); }

.enriched-section-body .data-table td,
.enriched-section-body .data-table th {
  padding: 6px var(--space-2);
}

.enriched-section-body .version-entry {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px var(--space-3);
  margin-bottom: 6px;
  font-size: var(--text-sm);
}

.enriched-section-body .version-entry.version-approved {
  border-left: 3px solid var(--success);
}

.enriched-section-body .version-entry.version-in-review {
  border-left: 3px solid var(--accent);
}

.sidebar-info-value.font-mono {
  font-family: var(--font-mono);
}

/* --------------------------------------------------------------------------
   31. Capacity / Activity / Attention (Dashboard)
   -------------------------------------------------------------------------- */
.capacity-bar-wrap {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  height: 18px;
  overflow: hidden;
  position: relative;
}

.capacity-bar {
  height: 100%;
  border-radius: 0;
  transition: width 0.3s ease;
}

.capacity-bar--ok { background: var(--success); }
.capacity-bar--warn { background: var(--warning-border); }
.capacity-bar--danger { background: var(--danger); }

.capacity-label {
  font-size: var(--text-xs);
  color: var(--fg-secondary);
  margin-top: var(--space-1);
}

.capacity-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.capacity-row-name {
  min-width: 10rem;
  font-weight: var(--weight-medium);
  font-size: var(--text-sm);
}

.capacity-row-bar { flex: 1; }

.capacity-row-stats {
  min-width: 8rem;
  font-size: var(--text-sm);
  color: var(--fg-secondary);
  text-align: right;
  font-family: var(--font-mono);
}

.activity-feed { list-style: none; padding: 0; margin: 0; }

.activity-feed li {
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: var(--text-sm);
}
.activity-feed li:last-child { border-bottom: none; }

.activity-action {
  display: inline-block;
  font-weight: var(--weight-semibold);
  color: var(--accent);
  font-size: var(--text-xs);
  min-width: 5rem;
}

.activity-time {
  color: var(--fg-muted);
  font-size: var(--text-xs);
  float: right;
  font-family: var(--font-mono);
}

.attention-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 10px var(--space-3);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  background: var(--bg);
  margin-bottom: var(--space-2);
  border-radius: var(--radius-md);
}

.attention-item--warning { border-left-color: var(--warning-border); }
.attention-item--critical { border-left-color: var(--danger); }
.attention-detail { flex: 1; font-size: var(--text-sm); }

.dash-section { margin-bottom: var(--space-5); }
.dash-section h3 { margin-bottom: var(--space-3); }

/* --------------------------------------------------------------------------
   32. Sort headers + Pagination
   -------------------------------------------------------------------------- */
.sort-header {
  text-decoration: none;
  color: var(--fg-secondary);
  white-space: nowrap;
  cursor: pointer;
  font-weight: var(--weight-semibold);
}
.sort-header:hover { color: var(--accent); text-decoration: none; }

.pagination {
  display: flex;
  gap: var(--space-1);
  align-items: center;
  justify-content: center;
  margin: var(--space-5) 0;
}

.pagination .btn-sm,
.pagination .btn-small {
  min-width: 2rem;
  justify-content: center;
}

/* Inline row-action popover (used in Content Calls table) */
.row-actions {
  position: relative;
  display: inline-block;
}

.row-actions > summary {
  list-style: none;
  cursor: pointer;
}

.row-actions > summary::-webkit-details-marker {
  display: none;
}

.row-actions-popover {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 50;
  min-width: 240px;
  background: white;
  border: 1px solid var(--color-slate-200);
  border-radius: 6px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  padding: 0.75rem;
}

.row-action-form {
  margin: 0;
}

.form-input-sm {
  font-size: 0.8125rem;
  padding: 0.25rem 0.5rem;
}

/* Inline status/stage dropdown that replaces the stage badge on cards */
.card-status-move { display: inline; margin: 0; }
.card-status-select {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  padding: 2px 4px;
  border: 1px solid var(--accent-ring);
  border-radius: var(--radius-sm);
  color: var(--accent);
  background: var(--accent-tint);
  cursor: pointer;
  max-width: 190px;
}
.card-status-select:hover { border-color: var(--accent); }
.project-card-namelink { text-decoration: none; color: inherit; }
.project-card-namelink:hover strong { text-decoration: underline; }
a.project-card-title { text-decoration: none; color: var(--fg); display: block; }
a.project-card-title:hover { text-decoration: underline; }
