/* ================================================================
   TARGETED OUTREACH — M8trx Command-Console Design System
   ================================================================ */

/* ── Design tokens ─────────────────────────────────────────── */
:root {
  --canvas:#0E1010; --canvas-2:#121514;
  --surface:#181B1A; --surface-hi:#20231F; --surface-2:#131615;
  --border:rgba(246,247,235,.08); --border-hi:rgba(246,247,235,.15);
  --text:#F6F7EB; --text-2:#9DA39B; --text-3:#5C6562;
  --accent:#06D6A0; --accent-hi:#1FE9B5; --accent-dim:rgba(6,214,160,.13); --accent-glow:rgba(6,214,160,.32);
  --gold:#E4B95B; --gold-dim:rgba(228,185,91,.14);
  --critical:#D2724E; --critical-dim:rgba(210,114,78,.14);
  --sky:#6FA8C9; --sky-dim:rgba(111,168,201,.14);
  --display:'Orbitron',sans-serif; --sans:'Exo 2',sans-serif; --mono:'Fira Code',monospace;

  --rail-w:    220px;
  --topbar-h:  56px;
  --r:         9px;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--canvas);
}

/* ── Boot spinner ──────────────────────────────────────────── */
.boot-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-3);
}

/* ── Blueprint grid (removed — dark canvas only) ───────────── */
.blueprint-bg {
  background-color: var(--canvas);
}

/* ================================================================
   LOGIN SCREEN
   ================================================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--canvas);
  background-image:
    radial-gradient(ellipse 60% 40% at 50% 0%, rgba(6,214,160,.06), transparent);
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border-hi);
  border-radius: var(--r);
  padding: 40px;
  width: 100%;
  max-width: 360px;
}

.login-wordmark {
  font-family: var(--display);
  font-size: 44px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text);
  line-height: 1;
  text-shadow: 0 0 28px var(--accent-glow);
  margin-bottom: 6px;
  text-align: center;
}
.login-by {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-bottom: 30px;
  opacity: 0.82;
}
.login-by span { font-family: var(--mono); font-size: 9px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-3); }
.login-by img { width: 80px; height: auto; display: block; }

/* "Sign in with Google" button + divider on the login card */
.btn-google {
  background: #fff;
  color: #1f1f1f;
  border: 1px solid var(--border, #dadce0);
  font-weight: 500;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 4px;
}
.btn-google:hover { background: #f7f8f8; }
.login-divider {
  display: flex; align-items: center; gap: 10px;
  margin: 16px 0; color: var(--text-3);
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.16em; text-transform: uppercase;
}
.login-divider::before, .login-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border, #e3e3e3);
}
.login-hint {
  text-align: center; color: var(--text-2, #555);
  font-size: 13px; line-height: 1.5; margin-bottom: 18px;
}

/* ================================================================
   APP SHELL
   ================================================================ */
#shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Rail ──────────────────────────────────────────────────── */
#rail {
  width: var(--rail-w);
  flex-shrink: 0;
  background: var(--canvas-2);
  color: var(--text);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  border-right: 1px solid var(--border);
}

/* ── Rail brand (logo + subtitle) ────────────────────────── */
.rail-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 26px 16px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

/* VANTAGE product wordmark — the M8trx display face, large + a soft mint glow */
.brandmark {
  font-family: var(--display);
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text);
  line-height: 1;
  text-align: center;
  text-shadow: 0 0 24px var(--accent-glow);
}

.brandby {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  opacity: 0.82;
}
.brandby span {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
}
.brandby img {
  width: 74px;
  height: auto;
  display: block;
}

.rail-config-badge {
  padding: 9px 20px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--gold);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 0;
}

.rail-nav {
  list-style: none;
  padding: 10px 0;
  flex: 1;
}

.rail-nav li a {
  display: block;
  padding: 9px 20px;
  color: var(--text-3);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
  transition: color 0.12s, background 0.12s;
  border-left: 2px solid transparent;
}

.rail-nav li a:hover {
  color: var(--text-2);
  background: var(--surface);
}

.rail-nav li a.active {
  color: var(--accent-hi);
  background: var(--accent-dim);
  border-left-color: var(--accent);
  padding-left: 18px;
}

.rail-bottom {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-3);
  flex-shrink: 0;
}

.rail-bottom .operator {
  display: block;
  margin-bottom: 8px;
  font-family: var(--mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Main column ───────────────────────────────────────────── */
#main-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* ── Topbar ────────────────────────────────────────────────── */
#topbar {
  height: var(--topbar-h);
  flex-shrink: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
}

#screen-title {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-context {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-3);
}

#topbar-action { flex-shrink: 0; }

/* ── Canvas ────────────────────────────────────────────────── */
#canvas {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: var(--canvas);
}

/* ================================================================
   BUTTONS
   ================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid transparent;
  border-radius: var(--r);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s, opacity 0.12s, box-shadow 0.12s;
  text-decoration: none;
  letter-spacing: 0.04em;
}

.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn:disabled      { opacity: 0.45; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  color: #04130E;
  border-color: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent-hi);
  border-color: var(--accent-hi);
  box-shadow: 0 0 18px var(--accent-glow);
}

.btn-brass {
  background: var(--gold);
  color: #1a1000;
  border-color: var(--gold);
}
.btn-brass:hover:not(:disabled) {
  background: #f0cc74;
  border-color: #f0cc74;
}

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border-color: var(--border-hi);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--surface-hi);
  color: var(--text);
}

.btn-sm { padding: 4px 10px; font-size: 12px; }

/* ================================================================
   FORM FIELDS
   ================================================================ */
.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 16px;
}

.field label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
}

.field input,
.field textarea,
.field select {
  font-family: var(--sans);
  font-size: 14px;
  padding: 8px 10px;
  border: 1px solid var(--border-hi);
  border-radius: var(--r);
  background: var(--surface-2);
  color: var(--text);
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-dim);
}

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

.field-error {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--critical);
  min-height: 16px;
}

/* ================================================================
   CONFIDENCE GAUGE  (signature component)
   ================================================================ */
.gauge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.gauge-segs {
  display: flex;
  gap: 2px;
}

.seg {
  width: 8px;
  height: 12px;
  border-radius: 1px;
  background: var(--border-hi);
}

.seg.on {
  background: var(--accent);
  box-shadow: 0 0 4px var(--accent-glow);
  animation: seg-fill 0.2s ease-out both;
  transform-origin: left center;
}

@keyframes seg-fill {
  from { transform: scaleX(0.1); opacity: 0.3; }
  to   { transform: scaleX(1);   opacity: 1;   }
}

@media (prefers-reduced-motion: reduce) {
  .seg.on { animation: none; }
  *        { transition: none !important; }
}

.gauge-val {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-3);
}

/* ================================================================
   CHIPS & STATUS INDICATORS
   ================================================================ */
.type-chip {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: 1px solid var(--border-hi);
  color: var(--accent);
  background: var(--accent-dim);
  padding: 2px 6px;
  border-radius: 4px;
}

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
}

.status-dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.classified::before  { background: var(--accent); box-shadow: 0 0 4px var(--accent-glow); }
.status-dot.classified           { color: var(--accent); }
.status-dot.unknown::before      { background: var(--text-3); }
.status-dot.unknown              { color: var(--text-3); }
.status-dot.error::before        { background: var(--critical); }
.status-dot.error                { color: var(--critical); }
.status-dot.pending::before,
.status-dot.stale::before        { background: var(--gold); }
.status-dot.pending,
.status-dot.stale                { color: var(--gold); }

.active-badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--accent);
  color: #04130E;
  padding: 2px 5px;
  border-radius: 4px;
}

/* ================================================================
   CARDS & SURFACES
   ================================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 20px;
  margin-bottom: 16px;
}

.card-title {
  font-family: var(--display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 14px;
}

/* ================================================================
   TABLES
   ================================================================ */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th {
  text-align: left;
  padding: 9px 14px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-3);
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  white-space: nowrap;
}

td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

tr:last-child td { border-bottom: none; }

tbody tr { cursor: pointer; transition: background 0.1s; }
tbody tr:hover { background: var(--surface-hi); }

.mono { font-family: var(--mono); font-size: 12px; }
.dim  { color: var(--text-3); }

.evidence-cell {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-3);
  font-size: 12px;
}

/* ================================================================
   TOOLBAR
   ================================================================ */
.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.toolbar select {
  font-family: var(--sans);
  font-size: 13px;
  padding: 6px 10px;
  border: 1px solid var(--border-hi);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.toolbar select:focus { outline: 2px solid var(--accent); }

.count-badge {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-3);
}

/* ================================================================
   ALERTS / RESULT PANELS
   ================================================================ */
.alert {
  padding: 11px 16px;
  border-radius: var(--r);
  border: 1px solid;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 14px;
}

.alert-ok    { background: var(--accent-dim);   border-color: var(--accent);    color: var(--accent); }
.alert-error { background: var(--critical-dim); border-color: var(--critical);  color: var(--critical); }
.alert-info  { background: var(--sky-dim);      border-color: var(--sky);       color: var(--sky); }

/* ================================================================
   COUNTS GRID (ingest result)
   ================================================================ */
.counts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.count-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 10px 14px;
}

.count-val {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 500;
  color: var(--text);
}

.count-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--text-3);
  margin-top: 2px;
  text-transform: uppercase;
}

/* ================================================================
   TOGGLE GROUP (ingest kind)
   ================================================================ */
.toggle-group {
  display: flex;
  border: 1px solid var(--border-hi);
  border-radius: var(--r);
  overflow: hidden;
  width: fit-content;
  margin-bottom: 16px;
}

.toggle-btn {
  padding: 7px 18px;
  border: none;
  background: var(--surface);
  color: var(--text-3);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}

.toggle-btn:not(:last-child) { border-right: 1px solid var(--border-hi); }
.toggle-btn:focus-visible    { outline: 2px solid var(--accent); outline-offset: -2px; }

.toggle-btn.active {
  background: var(--accent);
  color: #04130E;
}

/* ================================================================
   SECTIONS
   ================================================================ */
.section {
  margin-bottom: 24px;
}

.section-title {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-3);
  margin-bottom: 10px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--border);
}

/* ================================================================
   ACCOUNT DETAIL
   ================================================================ */
.acct-header {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 22px 24px;
  margin-bottom: 20px;
}

.acct-name {
  font-family: var(--display);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text);
  margin-bottom: 3px;
}

.acct-domain {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 12px;
}

.acct-meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

/* ================================================================
   CONTACTS
   ================================================================ */
.contact-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

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

.contact-star       { font-size: 14px; color: var(--gold); }
.contact-star.empty { color: var(--border-hi); }

/* ── Enriched tag on contacts ───────────────────────────────── */
.enriched-tag {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sky);
  border: 1px solid var(--sky);
  background: var(--sky-dim);
  padding: 1px 5px;
  border-radius: 3px;
}

/* ── Firmographics grid ─────────────────────────────────────── */
.firmo-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.firmo-grid-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.firmo-grid-row:last-child { border-bottom: none; }
.firmo-key {
  width: 90px;
  flex-shrink: 0;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  padding-top: 2px;
}
.firmo-val {
  flex: 1;
  color: var(--text);
}
.firmo-services .firmo-val { display: flex; flex-wrap: wrap; gap: 4px; }

/* ── Signals list ───────────────────────────────────────────── */
.signal-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.signal-item {
  font-size: 13px;
  padding: 7px 10px 7px 14px;
  border-radius: 5px;
  border-left: 3px solid transparent;
  line-height: 1.45;
}
.signal-buying {
  border-left-color: var(--gold);
  background: var(--gold-dim);
  color: var(--text);
}
.signal-growth {
  border-left-color: var(--accent);
  background: var(--accent-dim);
  color: var(--text);
}

/* ================================================================
   ONBOARD — config versions / draft preview
   ================================================================ */
.version-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.version-row:last-child { border-bottom: none; }
.version-name { flex: 1; font-weight: 500; }
.version-meta { font-family: var(--mono); font-size: 11px; color: var(--text-3); }

.draft-preview {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 14px 16px;
  margin: 12px 0;
}

.draft-preview pre {
  font-family: var(--mono);
  font-size: 11px;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text-2);
  max-height: 320px;
  overflow-y: auto;
}

/* ================================================================
   REVIEW QUEUE
   ================================================================ */
.review-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px 20px;
  margin-bottom: 12px;
}

.review-name   { font-family: var(--display); font-size: 14px; font-weight: 600; letter-spacing: 0.06em; margin-bottom: 3px; }
.review-reason { font-family: var(--mono); font-size: 12px; color: var(--text-3); margin-bottom: 10px; }

.review-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

.candidate-select {
  font-family: var(--mono);
  font-size: 12px;
  padding: 6px 8px;
  border: 1px solid var(--border-hi);
  border-radius: var(--r);
  background: var(--surface-2);
  color: var(--text);
  min-width: 220px;
}

/* ================================================================
   EMPTY STATES
   ================================================================ */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-3);
}

.empty-state p            { font-size: 14px; margin-bottom: 6px; }
.empty-state a            { color: var(--accent); text-decoration: none; }
.empty-state a:hover      { text-decoration: underline; }

/* ================================================================
   FOCUS RINGS (keyboard accessibility)
   ================================================================ */
a:focus-visible,
button:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ================================================================
   OVERVIEW — KPI CARDS
   ================================================================ */
.overview-wrap {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 1200px;
}

.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 18px 20px 16px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.kpi-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: var(--accent);
  opacity: 0.6;
}

.kpi-card--gold::before  { background: var(--gold); }
.kpi-card--critical::before { background: var(--critical); }

.kpi-card:hover {
  border-color: var(--border-hi);
  box-shadow: 0 0 16px rgba(6,214,160,.06);
}

.kpi-value {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text);
  line-height: 1.1;
  margin-bottom: 4px;
}

.kpi-card--gold   .kpi-value { color: var(--gold); }
.kpi-card--critical .kpi-value { color: var(--critical); }

.kpi-label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-2);
  margin-bottom: 2px;
}

.kpi-sub {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-3);
}

/* ================================================================
   OVERVIEW — CHART CARDS
   ================================================================ */
.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 20px;
}

.overview-charts-row,
.overview-bottom-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ================================================================
   OVERVIEW — DONUT CHART
   ================================================================ */
.donut-container {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.donut-svg {
  width: 160px;
  height: 160px;
  flex-shrink: 0;
}

.donut-legend {
  flex: 1;
  min-width: 120px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.donut-legend-row {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
}

.donut-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

.donut-legend-name {
  flex: 1;
  color: var(--text-2);
  font-family: var(--sans);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.donut-legend-count {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text);
  min-width: 24px;
  text-align: right;
}

.donut-legend-pct {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-3);
  min-width: 32px;
  text-align: right;
}

/* ================================================================
   OVERVIEW — BAR CHART
   ================================================================ */
.barchart {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 4px;
}

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

.barchart-lbl {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-3);
  width: 68px;
  flex-shrink: 0;
}

.barchart-track {
  flex: 1;
  height: 10px;
  background: var(--surface-2);
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.barchart-fill {
  height: 100%;
  border-radius: 5px;
  transition: width 0.4s cubic-bezier(.22,.68,0,1.2);
}

.barchart-num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-2);
  width: 24px;
  text-align: right;
  flex-shrink: 0;
}

/* ================================================================
   OVERVIEW — TOP COMPANIES
   ================================================================ */
.top-co-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.top-co-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
  border-radius: 4px;
  padding-left: 4px;
  margin-left: -4px;
}

.top-co-row:last-child { border-bottom: none; }

.top-co-row:hover { background: var(--surface-hi); }

.top-co-name {
  font-weight: 500;
  font-size: 13px;
  color: var(--text);
}

.top-co-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.top-co-pipe {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-2);
  margin-left: auto;
}

/* ================================================================
   SEGMENT CHIP (taxonomy-aware)
   ================================================================ */
.segment-chip {
  display: inline-block;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid;
  color: var(--chip-col, var(--accent));
  border-color: var(--chip-col, var(--accent));
  background: color-mix(in srgb, var(--chip-col, var(--accent)) 13%, transparent);
  white-space: nowrap;
}

/* ================================================================
   PRIORITY PROGRESS BAR
   ================================================================ */
.priority-wrap {
  width: 60px;
  height: 5px;
  background: var(--border-hi);
  border-radius: 3px;
  overflow: hidden;
}

.priority-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  opacity: 0.8;
}

/* ================================================================
   PILLS — relationship / status
   ================================================================ */
.pill {
  display: inline-block;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 7px;
  border-radius: 20px;
  border: 1px solid var(--border-hi);
  color: var(--text-3);
  white-space: nowrap;
}

.pill--prospect, .pill--new   { color: var(--sky);      border-color: var(--sky);      background: var(--sky-dim); }
.pill--engaged                 { color: var(--accent);   border-color: var(--accent);   background: var(--accent-dim); }
.pill--won, .pill--approved    { color: #4DB69A;         border-color: #4DB69A;         background: rgba(77,182,154,.13); }
.pill--lost, .pill--rejected   { color: var(--critical); border-color: var(--critical); background: var(--critical-dim); }
.pill--open, .pill--qualified, .pill--pursuing { color: var(--gold); border-color: var(--gold); background: var(--gold-dim); }

/* ================================================================
   OVERVIEW — RECENT ACTIVITY
   ================================================================ */
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}

.activity-item:last-child { border-bottom: none; }

.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--text-3);
}

.activity-dot--open   { background: var(--accent); box-shadow: 0 0 4px var(--accent-glow); }
.activity-dot--won    { background: #4DB69A; }
.activity-dot--lost   { background: var(--critical); }

.activity-body {
  flex: 1;
  min-width: 0;
}

.activity-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.activity-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.activity-val {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--gold);
}

/* ================================================================
   RESPONSIVE — collapse rail to top strip under 720 px
   ================================================================ */
@media (max-width: 720px) {
  #shell { flex-direction: column; }

  #rail {
    width: 100%;
    height: 48px;
    flex-direction: row;
    align-items: center;
    overflow-y: hidden;
    overflow-x: auto;
    padding: 0 12px;
    gap: 4px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .rail-brand {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 0 12px 0 0;
    border-bottom: none;
    border-right: 1px solid var(--border);
    margin-right: 4px;
    flex-shrink: 0;
  }

  .brandlogo {
    width: 80px;
    height: auto;
  }

  .brandsub { display: none; }

  .rail-config-badge { display: none; }

  .rail-nav {
    display: flex;
    flex-direction: row;
    padding: 0;
    gap: 0;
  }

  .rail-nav li a {
    height: 48px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    white-space: nowrap;
    border-left: none;
  }

  .rail-nav li a.active {
    border-left: none;
    border-bottom: 2px solid var(--accent);
    padding-left: 12px;
  }

  .rail-bottom { display: none; }
  #canvas      { padding: 16px; }

  /* Overview grid collapses to single column */
  .overview-charts-row,
  .overview-bottom-row {
    grid-template-columns: 1fr;
  }

  .kpi-row {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }
}

/* ================================================================
   WIZARD — first-run onboarding
   ================================================================ */
.wizard-page {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background-color: var(--canvas);
  background-image:
    radial-gradient(ellipse 60% 40% at 50% 0%, rgba(6,214,160,.06), transparent);
  padding: 40px 24px;
}

.wizard-card {
  background: var(--surface);
  border: 1px solid var(--border-hi);
  border-radius: var(--r);
  padding: 40px;
  width: 100%;
  max-width: 560px;
}

/* ── Step indicator ─────────────────────────────────────────── */
.wizard-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 32px;
}

.wizard-step-dot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border-hi);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  background: var(--surface-2);
  flex-shrink: 0;
  transition: border-color 0.15s, background 0.15s, color 0.15s, box-shadow 0.15s;
}

.wizard-step-dot.active {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}

.wizard-step-dot.done {
  border-color: var(--accent);
  background: var(--accent);
  color: #04130E;
}

.wizard-step-line {
  flex: 0 0 40px;
  height: 2px;
  background: var(--border-hi);
}

/* ── Typography ─────────────────────────────────────────────── */
.wizard-heading {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text);
  margin-bottom: 8px;
}

.wizard-sub {
  font-size: 13px;
  color: var(--text-3);
  line-height: 1.55;
  margin-bottom: 20px;
}

.wizard-section-label {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-3);
  margin-bottom: 8px;
}

/* ── Template grid ──────────────────────────────────────────── */
.tmpl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  margin-bottom: 4px;
}

.tmpl-card {
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-radius: var(--r);
  padding: 14px 16px;
  cursor: pointer;
  text-align: left;
  outline: none;
  transition: border-color 0.12s, background 0.12s, box-shadow 0.12s;
}

.tmpl-card:hover {
  border-color: var(--border-hi);
  background: var(--surface-hi);
}

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

.tmpl-card.selected {
  border-color: var(--accent);
  background: var(--accent-dim);
  box-shadow: 0 0 0 1px var(--accent), 0 0 14px var(--accent-glow);
}

.tmpl-card-name {
  font-family: var(--display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 6px;
}

.tmpl-card-desc {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.45;
  margin-bottom: 8px;
}

.tmpl-card-caps {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 6px;
}

.tmpl-card-meta {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--text-3);
}

/* ── Capability badge ───────────────────────────────────────── */
.cap-badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
  white-space: nowrap;
}

.cap-badge.off {
  color: var(--text-3);
  border-color: var(--border);
  background: transparent;
}

/* ── Success step ───────────────────────────────────────────── */
.wizard-success {
  text-align: center;
  padding: 8px 0;
}

.wizard-success-icon {
  font-size: 40px;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 14px;
  text-shadow: 0 0 24px var(--accent-glow);
}

.wizard-activated-name {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent);
}

/* ================================================================
   MODAL OVERLAY  (reusable — contacts, leads, tasks, clients)
   ================================================================ */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.modal-card {
  background: var(--surface);
  border: 1px solid var(--border-hi);
  border-radius: var(--r);
  padding: 28px 32px;
  width: 520px;
  max-width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-card h2 {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 20px;
}

/* ── Reusable form layout (modal + panels) ─────────────────── */
.form-row {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  min-width: 0;
}

.field-label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
}

.form-field input,
.form-field select,
.form-field textarea {
  font-family: var(--sans);
  font-size: 13px;
  padding: 8px 10px;
  border: 1px solid var(--border-hi);
  border-radius: var(--r);
  background: var(--surface-2);
  color: var(--text);
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
  width: 100%;
}

.form-field textarea {
  resize: vertical;
  min-height: 60px;
  font-family: inherit;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-dim);
}

.form-field input::placeholder,
.form-field textarea::placeholder { color: var(--text-3); }

/* ── Lead board chips ──────────────────────────────────────── */
.lead-source-chip { font-family: var(--mono, 'Fira Code', monospace); font-size: 10px; color: var(--text-3); border: 1px solid var(--border); border-radius: 4px; padding: 1px 6px; }
.lead-next-step { font-size: 11px; color: var(--text-2); margin-top: 6px; line-height: 1.35; }

/* ── Document vault ────────────────────────────────────────── */
.doc-row { display:flex; align-items:center; gap:12px; padding:8px 0; border-bottom:1px solid var(--border); font-size:13px; }
.doc-row:last-child { border-bottom:none; }
.doc-name { color:var(--accent); text-decoration:none; flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.doc-name:hover { text-decoration:underline; }
.doc-drive-link { font-family:'Fira Code',monospace; font-size:10px; color:var(--sky); text-decoration:none; white-space:nowrap; }
.doc-drive-link:hover { text-decoration:underline; }
.doc-cat-chip { font-family:'Fira Code',monospace; font-size:10px; text-transform:uppercase; color:var(--gold); border:1px solid var(--gold); border-radius:4px; padding:1px 6px; }
.doc-size, .doc-date { color:var(--text-3); font-size:11px; font-family:'Fira Code',monospace; }
.doc-vault-toolbar { display:flex; align-items:center; gap:10px; margin-bottom:12px; }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ── Danger button ─────────────────────────────────────────── */
.btn-danger {
  background: transparent;
  border: 1px solid var(--critical);
  color: var(--critical);
  border-radius: var(--r);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  padding: 5px 12px;
  cursor: pointer;
  transition: background 0.12s;
  margin-right: auto;
}
.btn-danger:hover:not(:disabled) {
  background: var(--critical-dim);
}

/* ================================================================
   TASK BOARD (Kanban)
   ================================================================ */
.kanban {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  align-items: flex-start;
  padding-bottom: 20px;
  min-height: 0;
}

.kanban-col {
  flex: 0 0 240px;
  min-width: 200px;
  max-width: 280px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  display: flex;
  flex-direction: column;
  transition: border-color 0.12s, box-shadow 0.12s;
}

.kanban-col.drop-target {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-dim);
}

.kanban-col-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px 10px;
  border-bottom: 2px solid var(--border-hi);
}

.kanban-col-label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  flex: 1;
}

.kanban-col-count {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-3);
}

.kanban-col-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  flex: 1;
  min-height: 60px;
}

.kanban-empty {
  font-size: 12px;
  color: var(--text-3);
  text-align: center;
  padding: 12px 0;
}

.task-card {
  background: var(--surface-hi);
  border: 1px solid var(--border);
  border-radius: calc(var(--r) - 2px);
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
  position: relative;
}

.task-card:hover {
  border-color: var(--border-hi);
  background: var(--surface-2);
}

.task-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.task-card.dragging {
  opacity: 0.45;
  cursor: grabbing;
}

.task-card-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 7px;
}

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

.task-prio-chip {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
  padding: 1px 6px;
  border: 1px solid currentColor;
  border-radius: 3px;
}

.task-due {
  font-size: 10px;
}

.task-assignee {
  font-size: 10px;
  margin-left: auto;
}

.task-card-footer {
  margin-bottom: 4px;
}

.task-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  opacity: 0;
  transition: opacity 0.12s;
}

.task-card:hover .task-card-actions,
.task-card:focus-within .task-card-actions {
  opacity: 1;
}

.task-status-sel {
  font-family: var(--mono);
  font-size: 10px;
  padding: 3px 6px;
  border: 1px solid var(--border-hi);
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--text-2);
  cursor: pointer;
  flex: 1;
  min-width: 0;
}

.task-status-sel:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

/* ================================================================
   TASKS GANTT TIMELINE
   ================================================================ */
.gantt {
  --gantt-label-w: 220px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
}

.gantt-scroll {
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

.gantt-inner { min-width: 100%; }

.gantt-header {
  display: flex;
  border-bottom: 1px solid var(--border-hi);
  background: var(--surface-2);
}

.gantt-header-label {
  display: flex;
  align-items: center;
  background: var(--surface-2);
  z-index: 3;
}

.gantt-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  padding: 8px 12px;
}

.gantt-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}

.gantt-legend-swatch {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex: none;
}

.gantt-header-track {
  position: relative;
  flex: none;
  height: 34px;
}

.gantt-tick-label {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-3);
  white-space: nowrap;
}

.gantt-body {
  position: relative;
}

.gantt-grid {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  pointer-events: none;
}

.gantt-grid-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border);
}

.gantt-today-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--accent);
  opacity: 0.65;
}

.gantt-group {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.gantt-group-label {
  position: sticky;
  left: 0;
  z-index: 2;
  flex: 0 0 var(--gantt-label-w);
  padding: 5px 12px 4px;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--surface-2);
  border-right: 1px solid var(--border-hi);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gantt-group-count {
  margin-left: 8px;
  color: var(--text-3);
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: none;
}

.gantt-group-track {
  position: relative;
  flex: none;
}

.gantt-group-bar {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 4px;
  border-radius: 2px;
  background: var(--accent);
  opacity: 0.55;
}

.gantt-row {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--border);
}

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

.gantt-row:hover .gantt-row-label { background: var(--surface-hi); }

.gantt-row-label {
  position: sticky;
  left: 0;
  z-index: 2;
  flex: 0 0 var(--gantt-label-w);
  min-width: 0;
  padding: 8px 10px 8px 12px;
  background: var(--surface);
  border-right: 1px solid var(--border-hi);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: background 0.12s;
}

.gantt-row-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gantt-status-sel {
  flex: none;
  max-width: 92px;
  font-family: var(--mono);
  font-size: 9px;
  padding: 2px 3px;
  border: 1px solid var(--border-hi);
  border-radius: 4px;
  background: var(--surface-2);
  cursor: pointer;
}

.gantt-status-sel:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.gantt-row-label:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.gantt-row-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gantt-row-sub {
  font-size: 10px;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gantt-row-track {
  position: relative;
  flex: none;
  min-height: 38px;
}

.gantt-row-track.empty {
  cursor: crosshair;
  touch-action: none;
}

.gantt-bar {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 16px;
  min-width: 4px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--bar-color) 32%, transparent);
  border: 1px solid var(--bar-color);
  cursor: grab;
  touch-action: none;
  z-index: 1;
}

.gantt-bar:hover {
  background: color-mix(in srgb, var(--bar-color) 48%, transparent);
}

.gantt-bar.dragging {
  cursor: grabbing;
  opacity: 0.85;
}

.gantt-bar.due-only {
  background: var(--bar-color);
}

/* 1-day bars stretch (not move) when dragged — show a resize cursor */
.gantt-bar.one-day { cursor: ew-resize; }

.gantt-bar.overdue {
  border-color: var(--critical);
  box-shadow: 0 0 0 1px var(--critical);
}

/* Resize grips sit fully OUTSIDE the bar so the whole bar body is always
   "move" — on short bars overlapping grips used to swallow the body and a
   drag-right collapsed the task to a single day. */
.gantt-handle {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 10px;
  cursor: ew-resize;
  opacity: 0;
  border-radius: 3px;
  background: var(--bar-color);
  transition: opacity 0.1s;
}

.gantt-handle.l { left: -12px; }
.gantt-handle.r { right: -12px; }

.gantt-bar:hover .gantt-handle,
.gantt-bar.dragging .gantt-handle { opacity: 1; }

.gantt-ghost {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 16px;
  min-width: 4px;
  border-radius: 8px;
  border: 1px dashed var(--text-3);
  background: rgba(246, 247, 235, 0.06);
  pointer-events: none;
  z-index: 1;
}

.gantt-ghost.drawing {
  border-style: solid;
  border-color: var(--accent);
  background: var(--accent-dim);
}

.gantt-tip {
  position: fixed;
  transform: translateX(-50%);
  background: var(--surface-2);
  border: 1px solid var(--border-hi);
  color: var(--text);
  font-family: var(--mono);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 1000;
}

.gantt-hint {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 8px;
}

.gantt-quickadd .gantt-row-label { cursor: text; }

.gantt-quickadd input {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: var(--sans);
  font-size: 12px;
  padding: 4px 0;
}

.gantt-quickadd input:focus { outline: none; }
.gantt-quickadd input::placeholder { color: var(--text-3); }
.gantt-quickadd:focus-within .gantt-row-label { background: var(--surface-hi); }

/* ================================================================
   TOAST (background save failures)
   ================================================================ */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 12px);
  background: var(--surface-2);
  border: 1px solid var(--critical);
  color: var(--text);
  font-size: 13px;
  padding: 10px 18px;
  border-radius: var(--r);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
  z-index: 1200;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ================================================================
   CLIENTS GRID + HEALTH PILL
   ================================================================ */
.client-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); gap:14px; margin-top:8px; }
.client-card { background:var(--surface); border:1px solid var(--border); border-radius:8px; padding:16px; cursor:pointer; transition:border-color .12s; }
.client-card:hover { border-color:var(--border-hi); }
.client-card:focus-visible { outline:2px solid var(--accent); outline-offset:1px; }
.client-card-name { font-family:var(--display); font-size:15px; font-weight:600; margin-bottom:8px; }
.client-meta-row { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-top:8px; font-size:12px; color:var(--text-3); }
.health-pill { font-family:'Fira Code',monospace; font-size:10px; text-transform:uppercase; letter-spacing:.06em; border-radius:4px; padding:1px 7px; }
.bill-pill   { font-family:'Fira Code',monospace; font-size:10px; text-transform:uppercase; letter-spacing:.06em; border-radius:4px; padding:1px 7px; }

/* ================================================================
   REDUCED MOTION
   ================================================================ */
@media (prefers-reduced-motion: reduce) {
  .seg.on          { animation: none; }
  .barchart-fill   { transition: none; }
  .wizard-step-dot { transition: none; }
  .tmpl-card       { transition: none; }
  *                { transition: none !important; }
}
