/* ─────────────────────────────────────────────────────────────
   SAGELINK — UNIFIED DASHBOARD DESIGN SYSTEM
   Used by every client dashboard inside portal/clients/.
   Replace --brand with the official SageLink hex when confirmed.
   ───────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700;800&family=Geist+Mono:wght@400;500;600&display=swap');

:root {
  /* Brand — single accent. Change this one variable to re-skin. */
  --brand: #7CC4FF;
  --brand-soft: rgba(124, 196, 255, 0.12);
  --brand-edge: rgba(124, 196, 255, 0.32);
  --brand-deep: #4D9BD9;

  /* Surfaces (cool-tinted, single gray family) */
  --bg: #0B0D11;
  --surface: #13161D;
  --surface-2: #181C25;
  --surface-3: #1F2430;
  --border: #232838;
  --border-soft: #1B2030;

  /* Text */
  --fg: #E7EBF2;
  --fg-2: #A6AEBF;
  --fg-3: #6B7387;
  --fg-4: #4A5163;

  /* Signal colors — desaturated, single hue per state */
  --ok: #4ADE80;
  --ok-bg: rgba(74, 222, 128, 0.10);
  --warn: #F5C16C;
  --warn-bg: rgba(245, 193, 108, 0.10);
  --bad: #F87171;
  --bad-bg: rgba(248, 113, 113, 0.10);

  /* Shadow — tinted to brand */
  --shadow-soft: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-edge: 0 0 0 1px rgba(255, 255, 255, 0.04) inset;

  /* Radii */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;

  /* Type scale */
  --t-display: 30px;
  --t-h1: 19px;
  --t-h2: 15px;
  --t-body: 13.5px;
  --t-small: 12px;
  --t-micro: 10.5px;

  /* Layout */
  --max-w: 1100px;
  --drawer-w: 360px;
  --topbar-h: 64px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: var(--t-body);
  font-weight: 400;
  line-height: 1.55;
  color: var(--fg);
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 1200px 800px at 50% -200px, rgba(124, 196, 255, 0.06), transparent 60%),
    radial-gradient(ellipse 800px 600px at 100% 100%, rgba(124, 196, 255, 0.03), transparent 70%);
  background-attachment: fixed;
  min-height: 100vh;
  font-feature-settings: 'ss01', 'cv11';
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* Subtle grain overlay to break digital flatness */
body::before {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: var(--brand-soft); color: var(--fg); }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--border); }

/* ─────────────────────────────────────────────────────────────
   TOP BAR
   ───────────────────────────────────────────────────────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 13, 17, 0.78);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border-bottom: 1px solid var(--border-soft);
}

.topbar-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  height: var(--topbar-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-glyph {
  width: 34px; height: 34px;
  border-radius: var(--r-sm);
  display: grid; place-items: center;
  flex-shrink: 0;
  background: transparent;
}
.brand-glyph img,
.brand-glyph svg { width: 100%; height: 100%; display: block; }

/* Back to portal button (dashboard pages) */
.back-btn {
  display: inline-grid;
  place-items: center;
  width: 32px; height: 32px;
  color: var(--fg-3);
  border-radius: var(--r-sm);
  text-decoration: none;
  transition: all 0.18s;
  flex-shrink: 0;
  border: 1px solid transparent;
  margin-right: 4px;
}
.back-btn:hover { color: var(--fg); background: var(--surface-2); border-color: var(--border-soft); }
.back-btn:active { transform: scale(0.96); }
.back-btn svg { width: 16px; height: 16px; }

.brand-meta { min-width: 0; }
.brand-name {
  font-size: var(--t-h2);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-sub {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: var(--t-micro);
  color: var(--fg-3);
  font-weight: 400;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.status-center {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: var(--t-micro);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-2);
  font-family: 'Geist Mono', ui-monospace, monospace;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.status-pill:hover { border-color: var(--border); background: var(--surface-3); }
.status-pill[data-state="ready"] { color: var(--warn); border-color: rgba(245, 193, 108, 0.3); background: var(--warn-bg); }
.status-pill[data-state="live"] { color: var(--ok); border-color: rgba(74, 222, 128, 0.3); background: var(--ok-bg); }

.status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.status-pill[data-state="ready"] .status-dot { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-bg); }
.status-pill[data-state="live"] .status-dot { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); }

.right-cluster {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
}

.progress-readout {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 6px 14px;
  border-radius: var(--r-sm);
  background: linear-gradient(135deg, var(--brand-soft), rgba(124, 196, 255, 0.04));
  border: 1px solid var(--brand-edge);
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
  transition: border-color 0.3s, background 0.3s, box-shadow 0.3s;
  box-shadow: 0 0 0 1px rgba(124, 196, 255, 0.08) inset, 0 4px 14px rgba(124, 196, 255, 0.12);
}
.progress-readout.complete {
  background: linear-gradient(135deg, var(--ok-bg), rgba(74, 222, 128, 0.04));
  border-color: rgba(74, 222, 128, 0.4);
  box-shadow: 0 0 0 1px rgba(74, 222, 128, 0.08) inset, 0 4px 18px rgba(74, 222, 128, 0.25);
}
.progress-readout .num {
  font-size: 26px;
  font-weight: 700;
  color: var(--brand);
  letter-spacing: -0.025em;
  line-height: 1;
  transition: color 0.3s;
}
.progress-readout.complete .num { color: var(--ok); }
.progress-readout .label {
  font-size: var(--t-micro);
  color: var(--fg-3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
}
.progress-readout.complete .label { color: var(--ok); }

.icon-btn {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--fg-2);
  cursor: pointer;
  transition: all 0.18s;
  font-family: inherit;
}
.icon-btn:hover { color: var(--fg); border-color: var(--brand-edge); background: var(--surface-3); }
.icon-btn:active { transform: scale(0.96); }
.icon-btn svg { width: 16px; height: 16px; }

/* Progress rail under topbar — chunky, glowing, with a fat traveling streak */
.progress-rail {
  position: relative;
  height: 8px;
  background: var(--surface-2);
  overflow: hidden;
  border-bottom: 1px solid var(--border-soft);
}
.progress-rail-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background:
    linear-gradient(90deg, var(--brand-deep) 0%, var(--brand) 55%, #CFE9FF 100%);
  box-shadow:
    0 0 18px rgba(124, 196, 255, 0.85),
    0 0 36px rgba(124, 196, 255, 0.45),
    0 0 60px rgba(124, 196, 255, 0.20);
  transition: width 0.6s cubic-bezier(0.22, 0.61, 0.36, 1), background 0.4s, box-shadow 0.4s;
  border-radius: 0 4px 4px 0;
}
.progress-rail-fill::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.45), transparent 60%);
  border-radius: inherit;
}
.progress-rail-fill::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  left: -30%;
  width: 30%;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.0) 20%,
    rgba(255, 255, 255, 0.85) 50%,
    rgba(255, 255, 255, 0.0) 80%,
    transparent 100%);
  filter: blur(2px);
  animation: rail-streak 2.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
@keyframes rail-streak {
  0%   { left: -30%; opacity: 0; }
  15%  { opacity: 1; }
  85%  { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}
.progress-rail.complete .progress-rail-fill {
  background: linear-gradient(90deg, #16A34A, var(--ok), #86EFAC);
  box-shadow:
    0 0 18px rgba(74, 222, 128, 0.85),
    0 0 36px rgba(74, 222, 128, 0.45),
    0 0 60px rgba(74, 222, 128, 0.20);
}

/* ─────────────────────────────────────────────────────────────
   LAYOUT
   ───────────────────────────────────────────────────────────── */

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 36px 24px 96px;
  position: relative;
  z-index: 2;
}

.page-head {
  margin-bottom: 32px;
}
.page-title {
  font-size: var(--t-display);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: var(--fg);
  text-wrap: balance;
}
.page-title .accent { color: var(--brand); }
.page-desc {
  margin-top: 10px;
  color: var(--fg-2);
  font-size: 14px;
  max-width: 60ch;
}

/* Stats strip */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin-bottom: 28px;
  background: var(--border-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.stat-cell {
  background: var(--surface);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-cell .stat-label {
  font-size: var(--t-micro);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-3);
}
.stat-cell .stat-value {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
  font-size: 22px;
  font-weight: 600;
  color: var(--fg);
  letter-spacing: -0.02em;
}
.stat-cell .stat-value .denom {
  color: var(--fg-3);
  font-weight: 400;
  font-size: 14px;
  margin-left: 4px;
}

/* Phase nav (horizontal scroll pills) — with edge fade + scroll-snap */
.phase-nav-wrap {
  position: relative;
  margin-bottom: 26px;
}
.phase-nav-wrap::before,
.phase-nav-wrap::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 40px;
  pointer-events: none;
  z-index: 2;
  transition: opacity 0.25s;
}
.phase-nav-wrap::before {
  left: 0;
  background: linear-gradient(90deg, var(--bg), transparent);
  opacity: 0;
}
.phase-nav-wrap::after {
  right: 0;
  background: linear-gradient(-90deg, var(--bg), transparent);
}
.phase-nav-wrap.scrolled-start::before { opacity: 1; }
.phase-nav-wrap.scrolled-end::after { opacity: 0; }

.phase-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 4px 10px;
  scrollbar-width: none;
  scroll-behavior: smooth;
  scroll-snap-type: x proximity;
}
.phase-nav::-webkit-scrollbar { display: none; }

.phase-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-sm);
  font-family: inherit;
  font-size: var(--t-small);
  font-weight: 500;
  color: var(--fg-2);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.22, 0.61, 0.36, 1);
  flex-shrink: 0;
  scroll-snap-align: start;
  position: relative;
}
.phase-nav-btn::before {
  content: '';
  position: absolute;
  left: 14px; right: 14px;
  bottom: -3px;
  height: 2px;
  background: var(--brand);
  border-radius: 999px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.phase-nav-btn:hover {
  color: var(--fg);
  border-color: var(--border);
  background: var(--surface-2);
  transform: translateY(-1px);
}
.phase-nav-btn.active {
  background: var(--brand-soft);
  border-color: var(--brand-edge);
  color: var(--fg);
}
.phase-nav-btn.active::before { transform: scaleX(1); }
.phase-nav-btn.complete { color: var(--ok); border-color: rgba(74, 222, 128, 0.22); background: var(--ok-bg); }
.phase-nav-btn.complete .nav-idx { color: var(--ok); }

.phase-nav-btn .nav-idx {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: var(--t-micro);
  color: var(--fg-4);
  font-weight: 600;
  letter-spacing: 0.04em;
  transition: color 0.2s;
}
.phase-nav-btn.active .nav-idx { color: var(--brand); }
.phase-nav-btn:hover .nav-idx { color: var(--fg-2); }

/* Filter bar (Heritage) */
.filter-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.filter-btn {
  padding: 7px 14px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-sm);
  color: var(--fg-2);
  font-family: inherit;
  font-size: var(--t-small);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s;
}
.filter-btn:hover { color: var(--fg); border-color: var(--border); }
.filter-btn.active { background: var(--fg); color: var(--bg); border-color: var(--fg); }

/* ─────────────────────────────────────────────────────────────
   SECTION CARD
   ───────────────────────────────────────────────────────────── */

.section {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  margin-bottom: 14px;
  overflow: hidden;
  transition: border-color 0.2s;
}
.section:hover { border-color: var(--border); }

.section-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  cursor: pointer;
  user-select: none;
  position: relative;
}

.section-mark {
  width: 4px;
  height: 24px;
  border-radius: 2px;
  background: var(--brand);
  flex-shrink: 0;
  transition: height 0.2s;
}
.section.complete .section-mark { background: var(--ok); }

.section-info { flex: 1; min-width: 0; }
.section-eyebrow {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: var(--t-micro);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-4);
  margin-bottom: 3px;
}
.section-title {
  font-size: var(--t-h1);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--fg);
  line-height: 1.3;
}

.section-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.section-progress {
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-bar {
  width: 150px;
  height: 12px;
  background: var(--surface-3);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 2px 6px rgba(0, 0, 0, 0.25) inset;
  border: 1px solid var(--border-soft);
}
.section-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-deep) 0%, var(--brand) 50%, #CFE9FF 100%);
  border-radius: 999px;
  transition: width 0.55s cubic-bezier(0.22, 0.61, 0.36, 1), background 0.3s, box-shadow 0.3s;
  position: relative;
  box-shadow:
    0 0 14px rgba(124, 196, 255, 0.75),
    0 0 28px rgba(124, 196, 255, 0.35);
  overflow: hidden;
}
.section-bar-fill::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.4), transparent 55%);
  border-radius: inherit;
}
.section-bar-fill::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  left: -30%;
  width: 30%;
  background: linear-gradient(90deg,
    transparent,
    rgba(255, 255, 255, 0.85) 50%,
    transparent);
  filter: blur(1.5px);
  animation: rail-streak 3.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
.section.complete .section-bar-fill {
  background: linear-gradient(90deg, #16A34A 0%, var(--ok) 50%, #BBF7D0 100%);
  box-shadow:
    0 0 14px rgba(74, 222, 128, 0.75),
    0 0 28px rgba(74, 222, 128, 0.35);
}
.section-count {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
  font-size: var(--t-body);
  color: var(--fg);
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: -0.01em;
  min-width: 48px;
  text-align: right;
}
.section.complete .section-count { color: var(--ok); }
.section.complete { box-shadow: 0 0 0 1px rgba(74, 222, 128, 0.22), 0 8px 32px rgba(74, 222, 128, 0.08); }
.section.complete .section-mark { box-shadow: 0 0 16px rgba(74, 222, 128, 0.6); }

.section-chev {
  color: var(--fg-3);
  transition: transform 0.25s cubic-bezier(0.22, 0.61, 0.36, 1);
  flex-shrink: 0;
}
.section.collapsed .section-chev { transform: rotate(-90deg); }

.section-body {
  padding: 4px 8px 12px;
  border-top: 1px solid var(--border-soft);
}
.section.collapsed .section-body { display: none; }

/* ─────────────────────────────────────────────────────────────
   TASK ROW
   ───────────────────────────────────────────────────────────── */

.task {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--r-md);
  transition: background 0.15s;
  position: relative;
}
.task:hover { background: var(--surface-2); }
.task + .task { margin-top: 1px; }

.checkbox {
  appearance: none;
  width: 18px; height: 18px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-xs);
  background: var(--surface-2);
  cursor: pointer;
  display: grid; place-items: center;
  transition: all 0.18s;
  margin-top: 2px;
  flex-shrink: 0;
  position: relative;
}
.checkbox:hover { border-color: var(--brand-edge); }
.checkbox:checked {
  background: var(--brand);
  border-color: var(--brand);
}
.checkbox:checked::after {
  content: '';
  width: 5px; height: 9px;
  border: solid #0B0D11;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-1px, -1px);
}

.task-body { min-width: 0; }
.task-title {
  font-size: var(--t-body);
  font-weight: 500;
  color: var(--fg);
  line-height: 1.5;
  letter-spacing: -0.005em;
}
.task.done .task-title { color: var(--fg-3); text-decoration: line-through; text-decoration-color: var(--fg-4); }
.task-sub {
  margin-top: 4px;
  font-size: var(--t-small);
  color: var(--fg-3);
  line-height: 1.5;
}
.task.done .task-sub { color: var(--fg-4); }

.task-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border-radius: var(--r-xs);
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: var(--t-micro);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--surface-3);
  color: var(--fg-2);
  border: 1px solid var(--border-soft);
}
.chip[data-kind="setup"]     { color: #93C5FD; background: rgba(147, 197, 253, 0.08); border-color: rgba(147, 197, 253, 0.18); }
.chip[data-kind="workflow"]  { color: #C4B5FD; background: rgba(196, 181, 253, 0.08); border-color: rgba(196, 181, 253, 0.18); }
.chip[data-kind="visual"]    { color: #FBBF77; background: rgba(251, 191, 119, 0.08); border-color: rgba(251, 191, 119, 0.18); }
.chip[data-kind="data"]      { color: #6EE7B7; background: rgba(110, 231, 183, 0.08); border-color: rgba(110, 231, 183, 0.18); }
.chip[data-kind="testing"]   { color: #FCA5A5; background: rgba(252, 165, 165, 0.08); border-color: rgba(252, 165, 165, 0.18); }
.chip[data-kind="blocked"]   { color: var(--warn); background: var(--warn-bg); border-color: rgba(245, 193, 108, 0.22); }
.chip[data-kind="updated"]   { color: var(--warn); background: var(--warn-bg); border-color: rgba(245, 193, 108, 0.22); cursor: pointer; }

.task-actions {
  display: flex;
  gap: 2px;
  align-self: flex-start;
  margin-top: 2px;
  opacity: 0;
  transition: opacity 0.18s;
}
.task:hover .task-actions { opacity: 1; }
.task-actions .has-note { opacity: 1; }

.act-btn {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  color: var(--fg-3);
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}
.act-btn:hover { color: var(--fg); background: var(--surface-3); border-color: var(--border); }
.act-btn svg { width: 14px; height: 14px; }
.act-btn.has-note { color: var(--warn); }
.act-btn.has-note::after {
  content: ''; position: absolute;
  top: 5px; right: 5px;
  width: 5px; height: 5px;
  background: var(--warn); border-radius: 50%;
  box-shadow: 0 0 0 2px var(--surface);
}

/* Expandable detail panel */
.detail {
  display: none;
  margin: 6px 14px 12px 48px;
  padding: 16px 18px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  font-size: var(--t-small);
  line-height: 1.65;
  color: var(--fg-2);
}
.detail.open { display: block; }
.detail strong { color: var(--fg); font-weight: 600; }
.detail ul, .detail ol { margin: 8px 0 8px 20px; }
.detail li { margin: 3px 0; color: var(--fg-2); }
.detail li::marker { color: var(--fg-4); }
.detail code {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 11.5px;
  background: var(--surface-3);
  padding: 1px 5px;
  border-radius: var(--r-xs);
  color: var(--fg);
  border: 1px solid var(--border-soft);
}
.detail table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: var(--t-small); }
.detail th { text-align: left; padding: 6px 10px; background: var(--surface-3); color: var(--fg); font-weight: 600; border-bottom: 1px solid var(--border); }
.detail td { padding: 6px 10px; border-bottom: 1px solid var(--border-soft); color: var(--fg-2); vertical-align: top; }
.detail tr:last-child td { border-bottom: none; }
.detail-eyebrow {
  display: inline-block;
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: var(--t-micro);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
  background: var(--brand-soft);
  padding: 2px 8px;
  border-radius: var(--r-xs);
  margin-bottom: 10px;
}

/* Inline note panel */
.notes-panel {
  display: none;
  margin: 6px 14px 12px 48px;
  padding: 12px 14px;
  background: var(--warn-bg);
  border: 1px solid rgba(245, 193, 108, 0.18);
  border-radius: var(--r-md);
}
.notes-panel.open { display: block; }
.notes-label {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: var(--t-micro);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--warn);
  font-weight: 600;
  margin-bottom: 6px;
}
.notes-input {
  width: 100%;
  min-height: 56px;
  background: transparent;
  border: 1px solid rgba(245, 193, 108, 0.22);
  border-radius: var(--r-sm);
  padding: 8px 10px;
  font-family: inherit;
  font-size: var(--t-small);
  line-height: 1.55;
  color: var(--fg);
  resize: vertical;
  outline: none;
  transition: border-color 0.18s;
}
.notes-input::placeholder { color: var(--fg-4); }
.notes-input:focus { border-color: var(--warn); }
.notes-hint {
  margin-top: 4px;
  font-size: 10.5px;
  color: var(--fg-4);
}

/* Change panel (Heritage UPDATED) */
.change-panel { display: none; margin: 8px 14px 8px 48px; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--border-soft); }
.change-panel.open { display: block; }
.change-row { display: flex; gap: 0; font-size: var(--t-small); }
.change-label {
  font-family: 'Geist Mono', ui-monospace, monospace;
  min-width: 70px;
  font-size: var(--t-micro);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 9px 12px;
  font-weight: 600;
}
.change-text { padding: 9px 14px; flex: 1; line-height: 1.55; }
.change-before .change-label { background: rgba(248, 113, 113, 0.12); color: var(--bad); }
.change-before .change-text { background: rgba(248, 113, 113, 0.05); color: var(--fg-2); border-bottom: 1px solid var(--border-soft); }
.change-after .change-label { background: rgba(74, 222, 128, 0.12); color: var(--ok); }
.change-after .change-text { background: rgba(74, 222, 128, 0.05); color: var(--fg); }

/* Add task row */
.add-task-row { padding: 8px 14px; }
.add-task {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: var(--r-sm);
  padding: 6px 12px;
  font-family: inherit;
  font-size: var(--t-small);
  color: var(--fg-3);
  cursor: pointer;
  transition: all 0.18s;
}
.add-task:hover { border-color: var(--brand-edge); color: var(--brand); border-style: solid; background: var(--brand-soft); }

.add-inline {
  display: none;
  gap: 6px;
  align-items: center;
}
.add-inline.show { display: flex; }
.add-inline input {
  flex: 1;
  background: var(--surface-2);
  border: 1px solid var(--brand-edge);
  border-radius: var(--r-sm);
  padding: 7px 10px;
  font-family: inherit;
  font-size: var(--t-small);
  color: var(--fg);
  outline: none;
}
.add-inline input:focus { border-color: var(--brand); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-family: inherit;
  font-size: var(--t-small);
  font-weight: 500;
  color: var(--fg);
  cursor: pointer;
  transition: all 0.18s;
}
.btn:hover { background: var(--surface-3); border-color: var(--brand-edge); }
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: var(--brand);
  color: #0B0D11;
  border-color: var(--brand);
  font-weight: 600;
}
.btn-primary:hover { background: var(--brand-deep); border-color: var(--brand-deep); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--fg-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--fg); }
.btn-danger { color: var(--bad); border-color: rgba(248, 113, 113, 0.2); background: var(--bad-bg); }
.btn-danger:hover { background: var(--bad); color: #0B0D11; border-color: var(--bad); }

/* ─────────────────────────────────────────────────────────────
   DRAWER (right-side, slide-in)
   ───────────────────────────────────────────────────────────── */

.drawer-trigger {
  position: fixed;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  z-index: 40;
  background: var(--surface);
  border: 1px solid var(--border);
  border-right: none;
  border-radius: var(--r-md) 0 0 var(--r-md);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--fg-2);
  transition: all 0.2s;
  font-family: inherit;
}
.drawer-trigger:hover { background: var(--surface-2); color: var(--fg); padding-right: 14px; }
.drawer-trigger .vlabel {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: var(--t-micro);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
}

.drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(11, 13, 17, 0.6);
  backdrop-filter: blur(4px);
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: var(--drawer-w);
  max-width: calc(100vw - 40px);
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 70;
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.22, 0.61, 0.36, 1);
  display: flex;
  flex-direction: column;
  box-shadow: -24px 0 64px rgba(0, 0, 0, 0.4);
}
.drawer.open { transform: translateX(0); }

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-soft);
}
.drawer-title {
  font-size: var(--t-h2);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--fg);
}

.drawer-close {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  color: var(--fg-3);
  cursor: pointer;
  transition: all 0.15s;
}
.drawer-close:hover { color: var(--fg); background: var(--surface-2); border-color: var(--border); }

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.drawer-group {
  padding: 14px 22px 18px;
  border-bottom: 1px solid var(--border-soft);
}
.drawer-group:last-child { border-bottom: none; }
.drawer-group-label {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: var(--t-micro);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin-bottom: 12px;
}

.doc-card {
  display: block;
  background: var(--brand-soft);
  border: 1px solid var(--brand-edge);
  border-radius: var(--r-md);
  padding: 14px 16px;
  text-decoration: none;
  color: var(--fg);
  transition: all 0.2s;
}
.doc-card:hover { background: rgba(124, 196, 255, 0.18); transform: translateY(-1px); }
.doc-card-eyebrow {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: var(--t-micro);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.doc-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--fg);
  letter-spacing: -0.01em;
}
.doc-card-sub {
  margin-top: 4px;
  font-size: var(--t-small);
  color: var(--fg-2);
  line-height: 1.5;
}
.doc-card-arrow {
  display: inline-block;
  margin-left: 4px;
  transition: transform 0.2s;
}
.doc-card:hover .doc-card-arrow { transform: translateX(3px); }

.kv-list { display: flex; flex-direction: column; gap: 10px; }
.kv-row {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 12px;
  font-size: var(--t-small);
  align-items: baseline;
}
.kv-key {
  color: var(--fg-3);
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: var(--t-micro);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.kv-val { color: var(--fg); }
.kv-val a { color: var(--brand); text-decoration: none; }
.kv-val a:hover { text-decoration: underline; }

.qa-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.qa-item {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items: flex-start;
  font-size: var(--t-small);
  color: var(--fg-2);
  line-height: 1.5;
  padding: 6px 0;
}
.qa-item .checkbox { width: 16px; height: 16px; margin-top: 1px; }
.qa-item.done span { text-decoration: line-through; color: var(--fg-4); }

/* ─────────────────────────────────────────────────────────────
   WORKFLOW DIAGRAM
   ───────────────────────────────────────────────────────────── */

.wf-wrap {
  margin: 12px 0 4px;
  padding: 14px;
  background: var(--bg);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
}
.wf-title {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: var(--t-micro);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin-bottom: 12px;
}
.flow { display: flex; flex-direction: column; align-items: center; gap: 0; }
.fnode {
  border-radius: var(--r-md);
  padding: 9px 14px;
  font-size: var(--t-small);
  font-weight: 500;
  text-align: center;
  min-width: 220px;
  max-width: 340px;
  line-height: 1.4;
  border: 1px solid;
}
.fnode small {
  display: block;
  font-weight: 400;
  font-size: 11px;
  margin-top: 2px;
  opacity: 0.75;
}
/* GHL-matched palette: trigger/send = green, action = blue, wait = purple, condition = amber, end = grey */
.fn-trig { background: rgba(52, 211, 153, 0.08); border-color: rgba(52, 211, 153, 0.4); color: #4ADE80; font-weight: 600; }
.fn-send { background: rgba(52, 211, 153, 0.08); border-color: rgba(52, 211, 153, 0.35); color: #4ADE80; }
.fn-act  { background: rgba(96, 165, 250, 0.08); border-color: rgba(96, 165, 250, 0.32); color: #93C5FD; }
.fn-wait {
  background: rgba(167, 139, 250, 0.08);
  border-color: rgba(167, 139, 250, 0.35);
  color: #C4B5FD;
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 11.5px;
  letter-spacing: 0.02em;
}
.fn-cond {
  background: rgba(251, 191, 36, 0.07);
  border-color: rgba(251, 191, 36, 0.32);
  color: #FCD34D;
  border-style: dashed;
}
.fn-end { background: var(--surface-3); border-color: var(--border-soft); color: var(--fg-3); border-radius: 999px; min-width: 140px; }
.farr {
  width: 1.5px; height: 18px;
  background: var(--border);
  position: relative;
}
.farr::after {
  content: ''; position: absolute;
  bottom: -1px; left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: var(--border);
}
.cond-branches {
  display: flex;
  gap: 18px;
  width: 100%;
  justify-content: center;
  align-items: flex-start;
  margin-top: 2px;
  flex-wrap: wrap;
}
.cond-branch {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  max-width: 320px;
  min-width: 220px;
}
.cond-label {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: var(--t-micro);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: var(--r-xs);
  margin-bottom: 6px;
  font-weight: 600;
}
.cond-yes { background: var(--ok-bg); color: var(--ok); }
.cond-no { background: var(--bad-bg); color: var(--bad); }

/* ─────────────────────────────────────────────────────────────
   MODAL
   ───────────────────────────────────────────────────────────── */

.modal-bg {
  position: fixed; inset: 0;
  background: rgba(11, 13, 17, 0.75);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 80;
  padding: 20px;
}
.modal-bg.show { display: flex; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  width: 100%;
  max-width: 520px;
  padding: 26px 28px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  animation: modalIn 0.22s cubic-bezier(0.22, 0.61, 0.36, 1);
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal h3 {
  font-size: var(--t-h2);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 18px;
}
.modal label {
  display: block;
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: var(--t-micro);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin-bottom: 6px;
  margin-top: 12px;
}
.modal input, .modal textarea, .modal select {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 9px 12px;
  font-family: inherit;
  font-size: var(--t-body);
  color: var(--fg);
  outline: none;
  transition: border-color 0.18s;
}
.modal input:focus, .modal textarea:focus, .modal select:focus { border-color: var(--brand-edge); }
.modal textarea { resize: vertical; min-height: 80px; }
.modal-foot {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 22px;
}

/* ─────────────────────────────────────────────────────────────
   FOOTER
   ───────────────────────────────────────────────────────────── */

.footer {
  max-width: var(--max-w);
  margin: 32px auto 0;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: var(--t-small);
  color: var(--fg-3);
  border-top: 1px solid var(--border-soft);
}
.footer-meta {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: var(--t-micro);
  letter-spacing: 0.04em;
}

/* ─────────────────────────────────────────────────────────────
   TOAST
   ───────────────────────────────────────────────────────────── */

.toast {
  position: fixed;
  bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 11px 18px;
  font-size: var(--t-small);
  color: var(--fg);
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px var(--ok-bg);
}

/* ─────────────────────────────────────────────────────────────
   RESPONSIVE
   ───────────────────────────────────────────────────────────── */

/* ─────────────────────────────────────────────────────────────
   HOME PAGE — Portal index
   ───────────────────────────────────────────────────────────── */

.home-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  align-items: flex-end;
  margin-bottom: 40px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border-soft);
}
.home-eyebrow {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: var(--t-micro);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 10px;
}
.home-title {
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--fg);
  text-wrap: balance;
}
.home-title .accent { color: var(--brand); }
.home-desc {
  margin-top: 12px;
  color: var(--fg-2);
  font-size: 14px;
  max-width: 56ch;
}

.hero-totals {
  display: flex;
  gap: 20px;
  align-items: flex-end;
}
.hero-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: right;
}
.hero-stat-num {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
  font-size: 38px;
  font-weight: 600;
  color: var(--fg);
  letter-spacing: -0.025em;
  line-height: 1;
}
.hero-stat-num .denom { color: var(--fg-3); font-weight: 400; font-size: 22px; }
.hero-stat-label {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: var(--t-micro);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-3);
}

.home-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 32px;
  margin-bottom: 18px;
  gap: 12px;
}
.home-section-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: var(--t-h1);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--fg);
}
.home-section-title .home-section-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  position: relative;
  top: -2px;
}
.home-section-dot.dot-active   { background: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.home-section-dot.dot-maint    { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-bg); }
.home-section-dot.dot-archive  { background: var(--fg-4); box-shadow: 0 0 0 4px rgba(74, 81, 99, 0.18); }

.home-section-count {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: var(--t-small);
  color: var(--fg-3);
  font-variant-numeric: tabular-nums;
}

.client-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.client-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: border-color 0.22s, transform 0.22s, background 0.22s;
  position: relative;
  overflow: hidden;
}
.client-card:hover {
  border-color: var(--brand-edge);
  background: var(--surface-2);
  transform: translateY(-2px);
}
.client-card::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: var(--r-lg);
  opacity: 0;
  background: radial-gradient(ellipse 400px 200px at var(--mx, 50%) var(--my, 0%), rgba(124, 196, 255, 0.08), transparent 60%);
  transition: opacity 0.25s;
}
.client-card:hover::after { opacity: 1; }

.client-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
}
.client-card-glyph {
  width: 38px; height: 38px;
  border-radius: var(--r-sm);
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  color: #0B0D11;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}
.client-card.maint .client-card-glyph { background: linear-gradient(135deg, #4ADE80, #16A34A); }
.client-card.archive .client-card-glyph { background: linear-gradient(135deg, var(--fg-3), var(--fg-4)); }

.client-card-name {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--fg);
  line-height: 1.2;
}
.client-card-sub {
  margin-top: 3px;
  font-size: var(--t-small);
  color: var(--fg-3);
  line-height: 1.4;
}

.client-card-status {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: var(--r-sm);
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: var(--t-micro);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  background: var(--surface-3);
  border: 1px solid var(--border);
  color: var(--fg-2);
  flex-shrink: 0;
}
.client-card-status[data-state="progress"] { color: var(--brand); border-color: var(--brand-edge); background: var(--brand-soft); }
.client-card-status[data-state="ready"]    { color: var(--warn); border-color: rgba(245, 193, 108, 0.3); background: var(--warn-bg); }
.client-card-status[data-state="live"]     { color: var(--ok); border-color: rgba(74, 222, 128, 0.3); background: var(--ok-bg); }
.client-card-status[data-state="archive"]  { color: var(--fg-3); }

.client-card-progress {
  display: flex;
  align-items: center;
  gap: 12px;
}
.client-card-bar {
  flex: 1;
  height: 5px;
  background: var(--surface-3);
  border-radius: 999px;
  overflow: hidden;
}
.client-card-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-deep), var(--brand));
  border-radius: 999px;
  transition: width 0.55s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.client-card.complete .client-card-bar-fill { background: linear-gradient(90deg, #16A34A, var(--ok)); }
.client-card-pct {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
  font-size: var(--t-small);
  color: var(--fg);
  font-weight: 600;
  letter-spacing: -0.01em;
  min-width: 38px;
  text-align: right;
}

.client-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  margin-top: auto;
  border-top: 1px solid var(--border-soft);
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: var(--t-micro);
  color: var(--fg-3);
  letter-spacing: 0.04em;
}
.client-card-footer .seen { color: var(--fg-3); }
.client-card-footer .arrow {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--brand);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.client-card:hover .arrow { color: var(--fg); }
.client-card .arrow-glyph { transition: transform 0.22s; }
.client-card:hover .arrow-glyph { transform: translateX(3px); }

/* Empty state for sections with no clients */
.empty {
  padding: 36px 24px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--r-lg);
  text-align: center;
  color: var(--fg-3);
  font-size: var(--t-small);
}
.empty .empty-title {
  color: var(--fg-2);
  font-size: var(--t-body);
  font-weight: 500;
  margin-bottom: 4px;
}
.empty code {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: var(--t-small);
  color: var(--brand);
  background: var(--brand-soft);
  padding: 1px 6px;
  border-radius: var(--r-xs);
}

/* Quick-action bar for home */
.home-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 24px 0 18px;
}
.home-toolbar .home-search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-sm);
  padding: 8px 12px;
  transition: border-color 0.18s;
}
.home-toolbar .home-search:focus-within { border-color: var(--brand-edge); background: var(--surface-2); }
.home-toolbar .home-search input {
  background: transparent;
  border: none;
  outline: none;
  flex: 1;
  font-family: inherit;
  font-size: var(--t-body);
  color: var(--fg);
}
.home-toolbar .home-search input::placeholder { color: var(--fg-3); }
.home-toolbar .home-search svg { color: var(--fg-3); flex-shrink: 0; }

@media (max-width: 880px) {
  .home-hero { grid-template-columns: 1fr; gap: 22px; align-items: flex-start; }
  .home-title { font-size: 28px; }
  .hero-totals { gap: 18px; }
  .hero-stat-num { font-size: 28px; }
  .client-grid { grid-template-columns: 1fr; }
}

@media (max-width: 880px) {
  .stats-strip { grid-template-columns: repeat(2, 1fr); }
  .topbar-inner { grid-template-columns: 1fr auto; gap: 12px; padding: 0 16px; }
  .status-center { display: none; }
  .container { padding: 24px 16px 80px; }
  :root { --t-display: 24px; --t-h1: 17px; }
  .cond-branches { flex-direction: column; }
  .cond-branch { max-width: 100%; }
  .detail, .notes-panel, .change-panel { margin-left: 14px; }
}
