/**
 * overview-redesign.css — Phase 3.1 v6.3 final match
 *
 * Page-scoped redesign per the v6.3 reference HTML. ALL CSS variables and
 * classes live under .overview-page (light) or [data-theme='dark']
 * .overview-page (dark) so we never touch index.html global tokens
 * (SE-37 risk gate).
 *
 * Dark-mode rules ported verbatim from the reference's [data-mode='dark']
 * (selector renamed to [data-theme='dark'] to match production convention).
 */

/* ===== Page-scoped CSS variables ===== *
 *
 * IMPORTANT — palette + theme leak fix (Phase 3.1 follow-up, 2026-04-30):
 *
 * The original v6.3 port redefined --accent, --positive, --info, --surface-*,
 * --text-*, --border-*, --shadow-* etc. inside this scope. That shadowed the
 * global [data-palette="..."] overrides in index.html, so Overview ignored
 * the palette switcher entirely. SE-37 risk gate kept us from putting the
 * tokens in index.html — but the FIX is to inherit from globals, not to
 * redefine locally.
 *
 * The ONLY tokens defined here now are:
 *   1. --pipeline-discover* — purple Discover-stage hue. Not a palette token,
 *      not in any global block, intentionally scoped to this page.
 *   2. --inset-light / --inset-dark — page-local box-shadow chain helpers.
 *      Used as the trailing layer in `box-shadow: ..., var(--inset-light),
 *      var(--inset-dark)` rules. If undefined, the entire chained shadow
 *      becomes invalid and disappears. Local definition is required.
 *   3. --hero-glow — palette-AWARE re-definition (uses var(--accent-border)
 *      so the hero band's glow tint follows whichever palette is active).
 *      Light = palette accent. Dark = neutral black shadow (intentional —
 *      reference v6.3 doesn't tint hero glow in dark mode).
 *
 * Everything else inherits from index.html globals — :root for light,
 * [data-theme='dark'] :root for dark, [data-palette='X']{[data-theme='dark']}
 * for palette + theme combos.
 */
.overview-page {
  --pipeline-discover: #7c5cff;
  --pipeline-discover-subtle: #f3effa;
  --pipeline-discover-border: #cbb8ff;
  --inset-light: inset 0 1px 0 rgba(255,255,255,0.8);
  --inset-dark:  none;
  --hero-glow:   0 12px 32px var(--accent-border);
  font-family: 'DM Sans', system-ui, sans-serif;
}

[data-theme='dark'] .overview-page {
  --pipeline-discover: #9a82ff;
  --pipeline-discover-subtle: rgba(154,130,255,0.12);
  --pipeline-discover-border: rgba(154,130,255,0.32);
  --inset-light: none;
  --inset-dark:  inset 0 1px 0 rgba(255,255,255,0.05);
  --hero-glow:   0 12px 32px rgba(0,0,0,0.5);
}

/* ===== Keyframes ===== */
@keyframes ovx-pulse  { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(0.9); opacity: 0.65; } }
@keyframes ovx-shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes ovx-breathe { 0%,100% { opacity: 0.4; } 50% { opacity: 0.8; } }

/* ===== Utility classes ===== */
.overview-page .lbl        { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-tertiary); }
.overview-page .lbl-strong { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-secondary); }
/* Phase 6.1.B3.B — Issue #4: section H2 typography (20px/700) per locked spec.
   Hierarchy: page H1 30px → section H2 20px → card H3 14px. */
.overview-page .section-title  { font-family: 'Inter', system-ui, sans-serif; font-size: 20px; font-weight: 700; letter-spacing: -0.012em; line-height: 1.3; color: var(--text-primary); margin: 0; }
/* Decisions section gets +2px H2 per Issue #5 urgency lock — applied via .section-title-decisions */
.overview-page .section-title-decisions { font-size: 22px; }
.overview-page .row        { display: flex; align-items: center; gap: 10px; }
.overview-page .mono       { font-family: ui-monospace, 'SF Mono', Menlo, monospace; }
[data-theme='dark'] .overview-page .mono { color: rgba(245,240,232,0.78); }

/* ===== Dots ===== */
.overview-page .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.overview-page .dot-positive { background: var(--positive); box-shadow: 0 0 0 4px var(--positive-subtle); animation: ovx-pulse 2.4s ease-in-out infinite; }
[data-theme='dark'] .overview-page .dot-positive { box-shadow: 0 0 0 5px var(--positive-subtle), 0 0 12px var(--positive-border); }
.overview-page .dot-warning { background: var(--warning); box-shadow: 0 0 0 4px var(--warning-subtle); animation: ovx-pulse 2.4s ease-in-out infinite; }
[data-theme='dark'] .overview-page .dot-warning { box-shadow: 0 0 0 5px var(--warning-subtle), 0 0 12px var(--warning-border); }
.overview-page .dot-accent  { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-subtle); animation: ovx-pulse 2.4s ease-in-out infinite; }
[data-theme='dark'] .overview-page .dot-accent { box-shadow: 0 0 0 5px var(--accent-subtle), 0 0 12px var(--accent-border); }
.overview-page .dot-idle    { background: var(--text-disabled); }

/* ===== Phase 6.1.B3.A — Page header (replaces hero band) =====
   H1 + subtitle on canvas, no card/banner per locked design v1.0.
   Section sits directly on --bg-canvas (inherited from body). */
.overview-page .page-header {
  margin-bottom: 16px;
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px; flex-wrap: wrap;
}
.overview-page .page-header h1 {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 30px; font-weight: 700; line-height: 1.2;
  letter-spacing: -0.02em; color: var(--text-primary);
  margin: 0 0 6px;
}
.overview-page .page-header-subtitle {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px; font-weight: 400; line-height: 1.5;
  color: var(--text-secondary); margin: 0;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.overview-page .page-header-actions {
  display: flex; gap: 12px; flex-shrink: 0;
}

/* ===== Live activity strip ===== */
.overview-page .live-strip {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; margin-bottom: 14px;
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: 10px; box-shadow: var(--shadow-xs), var(--inset-light), var(--inset-dark);
  font-size: 12px; color: var(--text-secondary);
  position: relative; overflow: hidden;
}
.overview-page .live-strip::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  background-size: 200% 100%; animation: ovx-shimmer 5s linear infinite; opacity: 0.5;
}

/* ===== Upgrade button ===== */
.overview-page .btn-upgrade { padding: 9px 18px; border-radius: 8px; background: var(--accent); color: #fff; border: none; font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; transition: all 0.15s; box-shadow: var(--shadow-xs); white-space: nowrap; }
.overview-page .btn-upgrade:hover { background: var(--accent-hover); transform: translateY(-1px); }

/* ===== Grids ===== */
.overview-page .grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.overview-page .grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.overview-page .grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.overview-page .grid-2-asym { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; }
.overview-page .grid-pipeline { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; position: relative; }

/* ===== Card (generic) — Phase 6.1.B3.B Issue #6 micro polish:
   padding 18px → 24px per locked design v1.0 (8-point grid, card padding
   24px desktop). Mobile breakpoints preserve responsive scaling. ===== */
.overview-page .card {
  padding: 24px; border-radius: 12px;
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm), var(--inset-light), var(--inset-dark);
  position: relative; overflow: hidden;
  transition: all 0.25s cubic-bezier(0.34,1.2,0.64,1);
}
.overview-page .card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md), var(--inset-light), var(--inset-dark); border-color: var(--border-default); }

/* ===== Metric tile — Phase 6.1.B3.B padding 18px → 24px ===== */
.overview-page .metric {
  padding: 24px; border-radius: 12px;
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm), var(--inset-light), var(--inset-dark);
  position: relative; overflow: hidden; cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34,1.2,0.64,1);
}
.overview-page .metric:hover { transform: translateY(-3px); box-shadow: var(--shadow-md), var(--inset-light), var(--inset-dark); }
/* Phase 6.1.B3.A — KPI metric tabs neutralized per locked accent restraint:
   all 4 tabs now use --border-default (no per-card colored gradients).
   Active Agents card's progress bar segments still use --positive
   (semantic green for healthy activity) — see .active-agents-segment. */
.overview-page .metric-tab { position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--border-default); }
.overview-page .metric-tab-accent   { background: var(--border-default); }
.overview-page .metric-tab-positive { background: var(--border-default); }
.overview-page .metric-tab-info     { background: var(--border-default); }
/* Phase 6.1.B3.B — Issue #4 typography weight bump for billboard effect.
   KPI value 32→36px / 700→800 weight. Heavier numbers read as data points. */
.overview-page .metric-num { font-size: 36px; font-weight: 800; line-height: 1.05; letter-spacing: -0.025em; color: var(--text-primary); font-feature-settings: "tnum" on; }
.overview-page .metric-delta { font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; background: var(--positive-subtle); color: var(--positive); border: 1px solid var(--positive-border); }
.overview-page .spark-svg { width: 100%; height: 38px; margin-top: 14px; display: block; }

/* Phase 6.1.B3.A — icon-sq 38px → 32px per locked spec dimensions.
   Per Q3 lock: per-agent semantic tinting preserved (iconBgMap in TSX
   keeps --positive-subtle / --info-subtle / --ai equivalents per agent). */
.overview-page .icon-sq { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: transform 0.2s; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.6), 0 1px 2px rgba(0,0,0,0.04); }
.overview-page .icon-sq svg { width: 16px; height: 16px; }
[data-theme='dark'] .overview-page .icon-sq { box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04), 0 1px 2px rgba(0,0,0,0.3); }

/* ===== Link ===== */
.overview-page .link-accent { color: var(--accent-text); font-size: 12px; font-weight: 600; text-decoration: none; transition: all 0.15s; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; background: none; border: none; padding: 0; font-family: inherit; }
.overview-page .link-accent:hover { gap: 7px; }

/* ===== Agent card =====
 * Border 1.5px + accent-tint on active (matches Templates page card pattern
 * — same chrome the Aggressive Growth selected card uses). Inactive cards
 * sit on a soft surface-raised gradient so they read as a tray, while
 * active cards lift onto pure white-base + soft accent halo.
 */
/* Phase 6.1.B3.B.fix Issue #1 — agent card bg --surface-base → --bg-elevated
   for 2-tier surface layering symmetric with B3.B pipeline-card pattern.
   Hierarchy: canvas → outer section --bg-surface → cards --bg-elevated.
   Padding 16 → 20px (audit-driven compromise — denser than .card 24px,
   roomier than the 16px starting point per Issue #4 partial bump). */
.overview-page .agent-card {
  padding: 20px; border-radius: 12px;
  background: var(--bg-elevated); border: 1.5px solid var(--border-subtle);
  box-shadow: var(--shadow-sm), var(--inset-light), var(--inset-dark);
  display: flex; flex-direction: column; gap: 10px;
  min-height: 168px; position: relative; overflow: hidden;
  transition: all 0.25s cubic-bezier(0.34,1.2,0.64,1);
}
/* Phase 6.1.B3.A — agent card hover: no lift (accent restraint, content-first).
   Border darkens to --border-default. Icon micro-scale animation kept. */
.overview-page .agent-card:hover { border-color: var(--border-default); }
.overview-page .agent-card:hover .icon-sq { transform: scale(1.06) rotate(-3deg); }
/* Phase 6.1.B3.A — Agent card variants neutralized per accent restraint.
   Active cards drop accent halo + gradient + shimmer (decorative,
   not data-bearing). Action variant drops warning halo, keeps amber
   border accent. Locked uses dashed border + opacity 0.55 per spec. */
.overview-page .agent-card-active {
  border-color: var(--border-default);
}
.overview-page .agent-card-action {
  border-color: var(--warning-border);
}
/* Phase 6.1.B3.B.fix Issue #2 — locked agent surface differentiation.
   opacity 0.42 → 0.35 (stronger dim than B3.B).
   bg --bg-surface → --bg-inset (surface differentiation, not just dim).
   Active cards now sit on --bg-elevated (raised — STEP 2 above), locked
   cards sink to --bg-inset (inset). 2-step elevation contrast = clear
   "active vs locked" hierarchy at a glance. Hover state stable. */
.overview-page .agent-card-locked {
  background: var(--bg-inset); border-color: var(--border-subtle);
  border-style: dashed; opacity: 0.35;
  box-shadow: var(--shadow-xs);
  cursor: default;
}
.overview-page .agent-card-locked:hover { transform: none; box-shadow: var(--shadow-xs); border-color: var(--border-subtle); border-style: dashed; background: var(--bg-inset); }
.overview-page .agent-card-locked .icon-sq { transform: none !important; }
.overview-page .agent-ring { position: absolute; top: 14px; right: 14px; width: 8px; height: 8px; border-radius: 50%; }
/* UPGRADE badge — stronger contrast per Issue #3 lock */
.overview-page .agent-upgrade-badge {
  position: absolute; top: 12px; right: 30px;
  background: var(--bg-elevated); color: var(--text-secondary);
  border: 1px solid var(--border-default);
  font-size: 10px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; padding: 3px 8px; border-radius: 5px;
  font-family: 'Inter', system-ui, sans-serif;
}
/* Lock icon prefix on locked agent name */
.overview-page .agent-name-lock-icon {
  width: 12px; height: 12px;
  margin-right: 4px;
  color: var(--text-tertiary);
  display: inline-block;
  vertical-align: -1px;
  flex-shrink: 0;
}

/* ===== Pills ===== */
.overview-page .pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.overview-page .pill-accent   { background: var(--accent-subtle);   color: var(--accent-text); border: 1px solid var(--accent-border); }
.overview-page .pill-positive { background: var(--positive-subtle); color: var(--positive);    border: 1px solid var(--positive-border); }
.overview-page .pill-warning  { background: var(--warning-subtle);  color: var(--warning);     border: 1px solid var(--warning-border); }
.overview-page .pill-info     { background: var(--info-subtle);     color: var(--info);        border: 1px solid var(--info-border); }

/* ===== Decisions panel — Phase 6.1.B3.B Issue #5 urgency via visual weight =====
   Per Issue #5 lock: NO position move, NO accent left-border. Urgency comes
   from section H2 22px (vs other sections' 20px), --bg-elevated panel bg
   (slight elevation from canvas), --border-default border (heavier than
   --border-subtle), thicker icon containers (36px), more padding. */
.overview-page .decisions-panel {
  margin-bottom: 16px;
  padding: 24px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  position: relative;
}
.overview-page .decisions-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 18px; background: var(--bg-surface);
  border-radius: 10px; border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm), var(--inset-light), var(--inset-dark);
  cursor: pointer; transition: all 0.15s;
}
.overview-page .decisions-row:hover { transform: translateX(2px); box-shadow: var(--shadow-md), var(--inset-light), var(--inset-dark); border-color: var(--border-default); }
/* Decisions section icon containers: 32→36px per urgency lock */
.overview-page .decisions-row .icon-sq { width: 36px; height: 36px; border-radius: 9px; }
.overview-page .decisions-row .icon-sq svg { width: 16px; height: 16px; }

/* ===== Impact panel — Phase 6.1.B3.A redesign =====
   Removed gradient bg. Now solid --bg-surface card. Title uses --positive
   semantic green. Numbers neutral --text-primary per accent restraint
   (zeros are legit data state — don't fake or hide). */
.overview-page .impact-panel {
  padding: 24px; border-radius: 12px;
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  margin-bottom: 14px; position: relative; overflow: hidden;
  box-shadow: var(--shadow-sm), var(--inset-light), var(--inset-dark);
}
/* Phase 6.1.B3.B — Issue #4: impact billboard nums 28→30px / 700→800.
   Slightly smaller than KPI row (less room with 4-col grid inside card). */
.overview-page .impact-stat-num { font-size: 30px; font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; color: var(--text-primary); font-feature-settings: "tnum" on; }
.overview-page .impact-stat-lbl { font-size: 12px; color: var(--text-secondary); margin-top: 6px; font-weight: 400; }

/* ===== Pipeline ===== */
/* Phase 6.1.B3.B.fix Issue #4 — pipeline-section padding 22px → 24px
   (8-point grid). Token --surface-base preserved (B1 alias: same value as
   --bg-surface; renaming deferred to B3.C consistency sweep). */
.overview-page .pipeline-section {
  padding: 24px; border-radius: 14px;
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm), var(--inset-light), var(--inset-dark);
  position: relative; overflow: hidden;
}
/* Phase 6.1.B3.B — pipeline cards now --bg-elevated sub-surface
   (Issue #2 dark-mode depth via 2-tier bg layering: canvas → section
   --bg-surface → content --bg-elevated). Was --bg-inset in B3.A.
   Hover removes lift; just border darkens. */
.overview-page .pipeline-card {
  background: var(--bg-elevated); border: 1px solid var(--border-subtle);
  border-radius: 10px; padding: 14px; padding-top: 16px;
  min-height: 220px; display: flex; flex-direction: column;
  position: relative; overflow: hidden;
  transition: border-color 0.15s ease;
  box-shadow: var(--shadow-xs), var(--inset-light), var(--inset-dark);
}
.overview-page .pipeline-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md), var(--inset-light), var(--inset-dark); }
.overview-page .pipeline-card:hover .icon-sq { transform: scale(1.06) rotate(-3deg); }
/* Phase 6.1.B3.B — pipeline accent restraint (Issue #1).
   All 4 stages share unified neutral 1px top accent (was per-stage
   purple/orange/green/cyan). Per locked design v1.0 accent restraint:
   --accent reserved for primary CTAs. Visual differentiation comes
   from icon + name + content, NOT color.
   Per Q2 lock from B3.A: --pipeline-discover token PRESERVED in :root
   (orphan after this PR; B3.C cleanup if confirmed unused). */
.overview-page .pipeline-tab { position: absolute; top: 0; left: 14px; right: 14px; height: 1px; border-radius: 1px; background: var(--border-default); }
.overview-page .pipeline-tab-discover,
.overview-page .pipeline-tab-create,
.overview-page .pipeline-tab-score,
.overview-page .pipeline-tab-protect  { background: var(--border-default); }
.overview-page .pipeline-arrow {
  position: absolute; right: -16px; top: 50%; transform: translateY(-50%);
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  display: flex; align-items: center; justify-content: center;
  z-index: 2; box-shadow: var(--shadow-xs);
}
.overview-page .pipeline-arrow svg { width: 11px; height: 11px; color: var(--text-tertiary); }
.overview-page .pipeline-step-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-tertiary); text-align: center;
  padding-top: 10px; border-top: 1px dashed var(--border-base); margin-top: auto;
}
/* Phase 6.1.B3.A — pipeline snippets neutral on --bg-surface (sub-surface
   distinct from --bg-inset card bg). No accent tint per restraint rules. */
.overview-page .pipeline-snippet {
  padding: 8px 10px; border-radius: 6px;
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  font-size: 11px; line-height: 1.45; color: var(--text-secondary);
  margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.overview-page .pipeline-snippet-discover {
  background: var(--pipeline-discover-subtle);
  border-color: var(--pipeline-discover-border);
  color: var(--pipeline-discover); font-weight: 600;
}

/* ===== Usage card ===== */
.overview-page .usage-card {
  padding: 20px 22px; border-radius: 12px;
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm), var(--inset-light), var(--inset-dark);
  margin-bottom: 14px;
}
.overview-page .usage-header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; flex-wrap: wrap; gap: 12px; }
.overview-page .usage-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-bottom: 14px; }
.overview-page .usage-row { display: flex; flex-direction: column; gap: 7px; }
.overview-page .usage-row-header { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.overview-page .usage-label { font-size: 12px; color: var(--text-secondary); font-weight: 500; }
.overview-page .usage-value { font-size: 12px; color: var(--text-primary); font-weight: 700; font-feature-settings: "tnum" on; font-family: ui-monospace, monospace; white-space: nowrap; }
.overview-page .usage-value-over { color: var(--accent-text); }
/* Phase 6.1.B3.A — usage bars neutralized per accent restraint.
   Normal fill: --text-primary at 0.7 opacity. At-limit fill: --warning
   semantic amber (replaces orange --accent gradient — was conflating
   brand action with at-limit warning state). */
.overview-page .usage-bar { height: 6px; background: var(--bg-inset); border-radius: 3px; overflow: hidden; }
.overview-page .usage-bar-fill-positive { height: 100%; background: var(--text-primary); opacity: 0.7; border-radius: 3px; transition: width 320ms cubic-bezier(0.34,1.2,0.64,1); }
.overview-page .usage-bar-fill-accent { height: 100%; background: var(--warning); border-radius: 3px; transition: width 320ms cubic-bezier(0.34,1.2,0.64,1); }
.overview-page .usage-bar-fill-low { height: 100%; background: var(--text-primary); opacity: 0.35; border-radius: 3px; transition: width 320ms cubic-bezier(0.34,1.2,0.64,1); }
/* Phase 6.1.B3.A — usage-warning now uses semantic --warning-* tokens
   (was --accent-subtle/--accent-text which conflated brand-action with
   warning state per locked accent restraint). */
.overview-page .usage-warning {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: 8px;
  background: var(--warning-subtle); border: 1px solid var(--warning-border);
  font-size: 12px; color: var(--warning); font-weight: 500;
}

/* ===== Activity feed ===== */
.overview-page .activity-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 0; border-bottom: 1px solid var(--border-subtle);
  transition: all 0.15s; cursor: pointer;
}
.overview-page .activity-item:last-child { border-bottom: none; }
.overview-page .activity-item:hover { background: var(--surface-raised); margin: 0 -8px; padding-left: 8px; padding-right: 8px; border-radius: 6px; }
.overview-page .activity-icon { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--surface-overlay); }
.overview-page .activity-icon svg { width: 14px; height: 14px; }
.overview-page .activity-icon-shield { background: var(--info-subtle); }
.overview-page .activity-icon-shield svg { color: var(--info); }
.overview-page .activity-icon-mind { background: var(--pipeline-discover-subtle); }
.overview-page .activity-icon-mind svg { color: var(--pipeline-discover); }
.overview-page .activity-icon-spark { background: var(--accent-subtle); }
.overview-page .activity-icon-spark svg { color: var(--accent); }
.overview-page .activity-icon-positive { background: var(--positive-subtle); }
.overview-page .activity-icon-positive svg { color: var(--positive); }
.overview-page .activity-icon-pulse { background: var(--surface-overlay); }
.overview-page .activity-icon-pulse svg { color: var(--text-tertiary); }
.overview-page .activity-text { flex: 1; min-width: 0; font-size: 12px; color: var(--text-primary); line-height: 1.5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.overview-page .activity-text strong { font-weight: 600; }
.overview-page .activity-time { font-size: 11px; color: var(--text-tertiary); flex-shrink: 0; font-feature-settings: "tnum" on; font-family: ui-monospace, monospace; }
.overview-page .activity-pill { display: inline-block; margin-left: 6px; padding: 1px 7px; font-size: 10px; font-weight: 600; background: var(--surface-overlay); color: var(--text-tertiary); border-radius: 4px; font-family: ui-monospace, monospace; }

/* ===== Phase 3.3 #5 — Recent Activity event-type pills =====
   Three categories: SCAN (read-only monitoring) / ACTION (mutations)
   / SYSTEM (heartbeats). Tabular numerals so multi-digit pills stay
   aligned. Light + dark mode use palette-aware tokens. */
.overview-page .event-pill {
  flex-shrink: 0;
  padding: 2px 7px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  font-feature-settings: "tnum" on;
}
.overview-page .event-pill-scan   { background: var(--info-subtle);              color: var(--info); }
.overview-page .event-pill-action { background: var(--pipeline-discover-subtle); color: var(--pipeline-discover); }
.overview-page .event-pill-system { background: var(--surface-overlay);          color: var(--text-secondary); }
[data-theme='dark'] .overview-page .event-pill-scan   { background: rgba(90,168,240,0.18); color: #5aa8f0; }
[data-theme='dark'] .overview-page .event-pill-action { background: rgba(154,130,255,0.18); color: #9a82ff; }
/* event-pill-system inherits from light via tokens — no dark override needed */

/* ===== Phase 3.3 #1 — Active Agents segments dim in dark mode =====
   Light mode: keep current full-saturation var(--positive). Dark mode:
   render as 5px tall pips with rgba 0.55 so they read as indicators,
   not a frozen progress bar. */
[data-theme='dark'] .overview-page .active-agents-segment {
  background: rgba(52, 210, 122, 0.55) !important;
  height: 5px !important;
}

/* ===== Recent Posts — restyled per dispatch ===== */
.overview-page .post-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--border-subtle);
  cursor: pointer; transition: all 0.15s;
}
.overview-page .post-row:last-child { border-bottom: none; }
.overview-page .post-row:hover { background: var(--surface-raised); margin: 0 -8px; padding: 12px 8px; border-radius: 6px; }
.overview-page .post-text {
  flex: 1; min-width: 0; font-size: 13px; color: var(--text-primary);
  line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; text-overflow: ellipsis;
}
/* Phase 6.1.B3.B.fix Issue #3 — Recent Posts pill geometry uniformity.
   Matches canonical Recent Activity .event-pill (lines 432-440) exactly:
   2px 7px padding, fully-rounded 99px radius, 10px / 600 / +0.04em + tnum.
   Per dispatch's primary goal "match Recent Activity pill spec exactly"
   — values pulled from audited .event-pill CSS, not dispatch's prescribed
   inline values (SE-47 surface — dispatch CSS had padding 3x8 + radius 4
   which differed from actual .event-pill).
   Preserved: text-transform uppercase (post labels are CAPS), per-status
   color rules below (semantic --positive-subtle/--negative-subtle/etc.). */
.overview-page .post-status-pill {
  display: inline-flex; align-items: center;
  flex-shrink: 0;
  padding: 2px 7px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-feature-settings: "tnum" on;
}
.overview-page .post-status-pill-draft     { background: var(--surface-overlay); color: var(--text-tertiary); border: 1px solid var(--border-subtle); }
.overview-page .post-status-pill-published { background: var(--positive-subtle); color: var(--positive); border: 1px solid var(--positive-border); }
.overview-page .post-status-pill-failed    { background: var(--negative-subtle); color: var(--negative); border: 1px solid var(--negative-border); }
.overview-page .post-status-pill-pending   { background: var(--warning-subtle); color: var(--warning-text); border: 1px solid var(--warning-border); }
.overview-page .post-status-pill-scheduled { background: var(--info-subtle); color: var(--info); border: 1px solid var(--info-border); }

/* ===== Bar chart (CSS-based, replaces recharts in v6.3 layout) ===== */
.overview-page .bar-day { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: 1; position: relative; }
.overview-page .bar-track { width: 100%; height: 100px; display: flex; align-items: flex-end; justify-content: center; position: relative; }
/* Phase 6.1.B3.A — Posting bars neutralized per accent restraint.
   Default bars: solid --text-primary at 0.7 opacity (was orange gradient).
   Peak day: solid --positive (was multi-stop green gradient with shadow).
   Dark-mode peak glow PRESERVED for B3.A per Q4 lock (B3.B sweeps the
   49 box-shadow declarations including this one). */
.overview-page .bar-fill { width: 60%; border-radius: 6px 6px 0 0; min-height: 3px; background: var(--text-primary); opacity: 0.7; box-shadow: var(--shadow-xs); transition: all 0.3s cubic-bezier(0.34,1.5,0.64,1); }
.overview-page .bar-day:hover .bar-fill { transform: scaleY(1.05); transform-origin: bottom; filter: brightness(1.1); }
.overview-page .bar-fill-low { opacity: 0.25; box-shadow: none; background: var(--bg-inset); }
[data-theme='dark'] .overview-page .bar-fill-low { opacity: 0.4; }
.overview-page .bar-fill-peak { background: var(--positive); opacity: 1; box-shadow: 0 -3px 12px rgba(26,122,74,0.20); }
[data-theme='dark'] .overview-page .bar-fill-peak { box-shadow: 0 -4px 16px rgba(52,210,122,0.45); }

/* Phase 6.1.B3.A — Engagement bars neutralized per accent restraint.
   All 3 fill classes now solid --text-primary (was per-metric orange/blue/green
   gradients). Track stays --bg-inset. */
.overview-page .eng-track { position: relative; flex: 1; height: 6px; background: var(--bg-inset); border-radius: 3px; overflow: hidden; }
.overview-page .eng-fill-likes    { height: 100%; border-radius: 3px; background: var(--text-primary); transition: width 0.5s ease; }
.overview-page .eng-fill-info     { height: 100%; border-radius: 3px; background: var(--text-primary); transition: width 0.5s ease; }
.overview-page .eng-fill-positive { height: 100%; border-radius: 3px; background: var(--text-primary); transition: width 0.5s ease; }

/* Phase 6.1.B3.A — Platforms + best times rows: removed per-row borders
   in favor of bottom dividers per locked spec (cleaner list pattern).
   Hover removed accent-border tint per restraint. */
.overview-page .platform-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--border-subtle);
  transition: all 0.15s;
}
.overview-page .platform-row:last-child { border-bottom: none; }
.overview-page .platform-row:hover { background: var(--bg-inset); margin: 0 -8px; padding: 10px 8px; border-radius: 6px; }
.overview-page .time-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; border-bottom: 1px solid var(--border-subtle);
}
.overview-page .time-row:last-child { border-bottom: none; }
.overview-page .time-row-peak { /* no special bg per restraint — pill carries the semantic */ }

/* Phase 6.1.B3.A — Upcoming cards: removed accent left-border per restraint.
   Now uniform --bg-surface card with subtle border. */
.overview-page .upcoming-card {
  padding: 12px 14px; border-radius: 10px;
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  cursor: pointer; transition: all 0.15s;
  display: flex; flex-direction: column; gap: 4px;
}
.overview-page .upcoming-card:hover { transform: translateX(2px); box-shadow: var(--shadow-sm); border-color: var(--border-default); }

/* ===== Misc ===== */
.overview-page .divider-soft { height: 1px; background: var(--border-subtle); margin: 14px 0; }

/* ===== Mobile breakpoints ===== */
@media (max-width: 1024px) {
  .overview-page .grid-4         { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-page .grid-3         { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-page .grid-pipeline  { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-page .grid-pipeline .pipeline-arrow { display: none; }
  .overview-page .usage-grid     { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-page .grid-2-asym    { grid-template-columns: 1fr; }
}

@media (max-width: 767px) {
  .overview-page .grid-4,
  .overview-page .grid-3,
  .overview-page .grid-2,
  .overview-page .grid-2-asym,
  .overview-page .grid-pipeline,
  .overview-page .usage-grid { grid-template-columns: 1fr !important; }

  .overview-page .hero-band     { padding: 20px 18px; }
  .overview-page .hero-content h1 { font-size: 22px !important; }
  .overview-page .hero-content > div:last-child { width: 100%; margin-top: 8px; }
  .overview-page .btn-hero-primary,
  .overview-page .btn-hero-ghost { flex: 1; padding: 9px 12px; font-size: 12px; }

  .overview-page .pipeline-arrow { display: none !important; }
  .overview-page .agent-card { min-height: 140px; }
  .overview-page .live-strip { font-size: 11px; }
  .overview-page .live-strip .mono { display: none; }
}
/* Phase 6.1.B2 — Locked design v1.0 Button primitive
   Used by Overview hero (B2) and cascading to all pages (B3+).
   Variants: primary | secondary | ghost | destructive
   Sizes: md (default) | sm

   Token consumption (all defined post-B1):
     --bg-surface, --bg-inset, --border-default (B1 aliases)
     --accent, --accent-hover, --accent-active (per-palette tuned, pre-existing)
     --text-primary, --text-secondary, --text-tertiary (pre-existing)
     --negative (pre-existing)
*/

.cc-btn {
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
  white-space: nowrap;
  user-select: none;
}

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

.cc-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* === Size variant: small === */
.cc-btn--sm {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 6px;
}

/* === Variant: primary (ONE per view) === */
.cc-btn--primary {
  background: var(--accent);
  color: #FFFFFF;
  border-color: var(--accent);
}
.cc-btn--primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
.cc-btn--primary:active:not(:disabled) {
  background: var(--accent-active);
  border-color: var(--accent-active);
}

/* === Variant: secondary (workhorse) === */
.cc-btn--secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-default);
}
.cc-btn--secondary:hover:not(:disabled) {
  background: var(--bg-inset);
}
.cc-btn--secondary:active:not(:disabled) {
  background: var(--bg-inset);
  border-color: var(--text-tertiary);
}

/* === Variant: ghost (tertiary) === */
.cc-btn--ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}
.cc-btn--ghost:hover:not(:disabled) {
  background: var(--bg-inset);
  color: var(--text-primary);
}

/* === Variant: destructive === */
.cc-btn--destructive {
  background: transparent;
  color: var(--negative);
  border-color: transparent;
}
.cc-btn--destructive:hover:not(:disabled) {
  background: rgba(196, 41, 28, 0.08);
  border-color: rgba(196, 41, 28, 0.30);
}
/**
 * ContentCaster UI/UX Audit — CSS Patch File
 * Applied: March 17, 2026
 */

/* C-1: Mobile sidebar collapse */
@media (max-width: 767px) {
  .sidebar {
    position: fixed !important;
    top: 0; left: -270px; height: 100vh; width: 256px;
    z-index: 200; transition: left 0.25s ease;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
  }
  .sidebar.open { left: 0; }
  .main-content { margin-left: 0 !important; width: 100% !important; }
  .mobile-nav-toggle {
    display: flex !important; align-items: center; justify-content: center;
    width: 44px; height: 44px; border: none; background: none; cursor: pointer;
    color: var(--text-primary);
  }
  .sidebar-overlay {
    display: block !important; position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.4); z-index: 199;
  }
}
.mobile-nav-toggle { display: none; }
.sidebar-overlay { display: none; }

/* ══════════════════════════════════════════════════════════════
   Mobile Foundations — Phase A (April 21, 2026)
   ══════════════════════════════════════════════════════════════ */

/* Prevent horizontal scroll on small screens */
html, body, #root {
  max-width: 100vw;
}
body { overflow-x: hidden; }

@media (max-width: 767px) {
  /* Prevent iOS auto-zoom on focus of inputs (requires >= 16px) */
  input:not([type="checkbox"]):not([type="radio"]),
  textarea,
  select {
    font-size: 16px !important;
  }

  /* Shrink main content padding — desktop uses 28px 32px which is too wide */
  #main-content {
    padding: 16px 12px 64px !important;
  }

  /* Reduce top bar horizontal padding on mobile */
  .top-bar, [data-topbar] {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  /* Hide scrollbars on horizontal carousel containers */
  .hide-scrollbar {
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .hide-scrollbar::-webkit-scrollbar { display: none; }

  /* Catch-all: any grid with 4 equal columns collapses to 2 on mobile
     (covers both 'repeat(4, 1fr)' with space and 'repeat(4,1fr)' no-space) */
  [style*="repeat(4,1fr)"],
  [style*="repeat(4, 1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Any 3-equal-col grid → 1 col on mobile */
  [style*="repeat(3,1fr)"],
  [style*="repeat(3, 1fr)"] {
    grid-template-columns: 1fr !important;
  }

  /* 5-col grid → 2 cols on mobile (Analytics heatmap-like grids) */
  [style*="repeat(5,1fr)"],
  [style*="repeat(5, 1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* 2fr 1fr → stack (Analytics chart + sidebar pattern) */
  [style*="grid-template-columns: 2fr 1fr"],
  [style*="grid-template-columns:2fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Two-column dashboard layout (content + right rail) → stack vertically */
  [style*="grid-template-columns: 1fr 380px"],
  [style*="grid-template-columns:1fr 380px"] {
    grid-template-columns: 1fr !important;
  }

  /* 1fr 1fr (2-col half/half) stays 2-col on mobile but shrinks gap — readable */
  /* leave as-is; CSS grid auto-handles narrow screens */
}

/* Desktop-only / mobile-only visibility helpers */
@media (max-width: 767px) { .desktop-only { display: none !important; } }
@media (min-width: 768px) { .mobile-only  { display: none !important; } }

/* People page — row stacks on mobile so the fixed-width columns
   (segment 100px, score bars 80px each, time 70px, count 40px = 370px)
   don't force horizontal scroll at 375px viewport */
@media (max-width: 767px) {
  .people-row {
    flex-wrap: wrap !important;
    gap: 6px !important;
    padding: 12px !important;
    min-height: 60px;
  }
  /* First block (avatar + name + platform icons) takes full first row */
  .people-row > div:first-child { flex: 1 1 100% !important; }
  /* Remaining metric columns flow as a second wrapped row */
  .people-row > div:nth-child(n+2) { width: auto !important; font-size: 11px; }
  .people-row > div:nth-child(3),
  .people-row > div:nth-child(4) { min-width: 70px; flex: 1 1 auto; }
}

/* ══════════════════════════════════════════════════════════════
   Task 6 (Phase B P3) — Tab horizontal scroll on mobile
   Settings + Automation: vertical left sidebar → top horizontal scroll
   Agent Settings modal: full-screen + sidebar → top scroll bar
   Post Detail platform tabs: flex-wrap → horizontal scroll
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 767px) {
  /* Settings + Automation: flip parent flex-row → column so tab bar
     stacks above content */
  .side-tabs-layout { flex-direction: column !important; }

  /* Turn the vertical tab sidebar into a horizontal scrollable bar */
  .side-tabs-nav {
    width: 100% !important;
    height: auto !important;
    position: sticky !important;
    top: 52px !important;
    border-right: none !important;
    border-bottom: 1px solid var(--border-subtle) !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
    padding: 0 8px !important;
    gap: 0 !important;
    scrollbar-width: none;
    z-index: 10;
  }
  .side-tabs-nav::-webkit-scrollbar { display: none; }

  /* Settings sidebar has an <h2>Settings</h2> heading — hide on mobile */
  .side-tabs-nav > h2 { display: none !important; }

  /* Flatten Settings group wrappers so their buttons flow into the
     horizontal scroll as direct flex children */
  .side-tabs-nav > div { display: contents !important; }
  /* Hide the "WORKSPACE" / "ORGANIZATION" group label divs */
  .side-tabs-nav > div > div:first-child { display: none !important; }

  /* Every tab button in the bar: compact, no-wrap, 44px touch target */
  .side-tabs-nav button {
    white-space: nowrap !important;
    width: auto !important;
    padding: 10px 14px !important;
    border-radius: 0 !important;
    border-bottom: 2px solid transparent !important;
    font-size: 13px !important;
    flex-shrink: 0 !important;
    min-height: 44px;
    background: transparent !important;
    margin-bottom: 0 !important;
  }
  /* Active tab: orange underline */
  .side-tabs-nav button[style*="accent-subtle"],
  .side-tabs-nav button[style*="var(--accent)"] {
    border-bottom: 2px solid var(--accent) !important;
  }

  /* Post Detail platform tabs: flex-wrap:wrap → horizontal scroll */
  .post-detail-platform-tabs {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .post-detail-platform-tabs::-webkit-scrollbar { display: none; }
  .post-detail-platform-tabs > button {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }

  /* Agent Settings modal: full-screen (no padding/rounded),
     sidebar → top horizontal scroll bar */
  .agent-settings-modal { padding: 0 !important; }
  .agent-settings-modal-inner {
    max-width: 100% !important;
    width: 100% !important;
    height: 100vh !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    flex-direction: column !important;
  }
  .agent-settings-modal-sidebar {
    width: 100% !important;
    height: auto !important;
    border-right: none !important;
    border-bottom: 1px solid #e2e8f0 !important;
    padding: 10px 12px !important;
    flex-direction: row !important;
    align-items: center;
  }
  /* Hide agent name header on mobile (keep the tabs visible + compact) */
  .agent-settings-modal-sidebar > div:first-child { display: none !important; }
  /* Sidebar <nav> becomes horizontal flex with scroll */
  .agent-settings-modal-sidebar > nav {
    display: flex !important;
    flex-direction: row !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin: 0 !important;
    gap: 0 !important;
    width: 100%;
  }
  .agent-settings-modal-sidebar > nav::-webkit-scrollbar { display: none; }
  .agent-settings-modal-sidebar > nav > button {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    padding: 8px 12px !important;
    font-size: 12px !important;
    border-radius: 0 !important;
    min-height: 44px;
    border-bottom: 2px solid transparent !important;
  }
}

/* H-2: Disabled buttons — neutral grey */
button:disabled, button[disabled] {
  cursor: not-allowed !important;
  opacity: 0.55 !important;
}

/* H-7: Calendar/filter chips wrap */
[class*="platform-chips"], [class*="filter-chips"] {
  flex-wrap: wrap !important; gap: 6px !important;
}

/* M-2: Creator Studio textarea focus */
textarea:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08) !important;
  outline: none;
}

/* Accessibility: focus rings */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent) !important;
  outline-offset: 2px !important;
}
a:focus:not(:focus-visible), button:focus:not(:focus-visible) { outline: none; }

/* Accessibility: skip to content */
.skip-to-content {
  position: absolute; top: -100px; left: 16px; z-index: 9999;
  padding: 8px 16px; background: var(--accent); color: #fff;
  border-radius: 6px; font-weight: 600; text-decoration: none; transition: top 0.2s;
}
.skip-to-content:focus { top: 16px; }

/* Monospace for technical labels */
code, .code, [class*="monospace"] {
  font-family: 'DM Mono', 'Fira Code', 'Consolas', monospace !important;
}

/* ============================================================
   [FIX] C-3: AI Captions + Competitors orange regression
   Redirect orange-600 Tailwind classes to theme-aware --accent
   ============================================================ */
.bg-orange-600, [class~="bg-orange-600"] {
  background-color: var(--accent) !important;
}
.hover\:bg-orange-700:hover {
  background-color: var(--accent) !important;
  filter: brightness(0.88);
}
.text-orange-600, [class~="text-orange-600"] {
  color: var(--accent) !important;
}
.text-orange-700, [class~="text-orange-700"] {
  color: var(--accent) !important;
}
.text-orange-400, [class~="text-orange-400"] {
  color: var(--accent) !important;
  opacity: 0.7;
}
.text-orange-500, [class~="text-orange-500"] {
  color: var(--accent) !important;
}
.bg-orange-100, [class~="bg-orange-100"] {
  background-color: var(--accent-subtle) !important;
}
.bg-orange-50, [class~="bg-orange-50"] {
  background-color: var(--accent-subtle) !important;
}
.hover\:bg-orange-50:hover {
  background-color: var(--accent-subtle) !important;
}
.accent-orange-600, [class~="accent-orange-600"] {
  accent-color: var(--accent) !important;
}
.focus\:ring-blue-400:focus {
  --tw-ring-color: var(--accent) !important;
}

/* ============================================================
   QA AUDIT FIXES — March 17, 2026
   ============================================================ */

/* S1-1: Dark mode bg-white → surface-raised */
[data-theme="dark"] .bg-white,
[data-palette="midnight"] .bg-white,
[data-palette="obsidian"] .bg-white {
  background-color: var(--surface-raised) !important;
}
[data-theme="dark"] .border-slate-100,
[data-theme="dark"] .border-slate-200,
[data-palette="midnight"] .border-slate-100,
[data-palette="midnight"] .border-slate-200,
[data-palette="obsidian"] .border-slate-100,
[data-palette="obsidian"] .border-slate-200 {
  border-color: var(--border-subtle) !important;
}
[data-theme="dark"] .text-slate-900,
[data-palette="midnight"] .text-slate-900,
[data-palette="obsidian"] .text-slate-900 {
  color: var(--text-primary) !important;
}
[data-theme="dark"] .text-slate-700,
[data-palette="midnight"] .text-slate-700,
[data-palette="obsidian"] .text-slate-700 {
  color: var(--text-secondary) !important;
}
[data-theme="dark"] .text-slate-500,
[data-theme="dark"] .text-slate-400,
[data-palette="midnight"] .text-slate-500,
[data-palette="midnight"] .text-slate-400,
[data-palette="obsidian"] .text-slate-500,
[data-palette="obsidian"] .text-slate-400 {
  color: var(--text-tertiary) !important;
}
[data-theme="dark"] .bg-slate-50,
[data-theme="dark"] .bg-slate-100,
[data-palette="midnight"] .bg-slate-50,
[data-palette="midnight"] .bg-slate-100,
[data-palette="obsidian"] .bg-slate-50,
[data-palette="obsidian"] .bg-slate-100 {
  background-color: var(--surface-overlay) !important;
}

/* S1-3: Campaigns blue → accent */
.bg-blue-600 { background-color: var(--accent) !important; }
.hover\:bg-blue-700:hover { background-color: var(--accent) !important; filter: brightness(0.88); }
.text-blue-600 { color: var(--accent) !important; }
.bg-blue-100 { background-color: var(--accent-subtle) !important; }

/* === S1-4: Violet → --ai (Phase 6.0c PR4.5 — architect Q2 decision)
   Originally mapped to --accent (Signal warm orange), now mapped to --ai
   (warm violet) to preserve AI semantic distinction from brand action color.
   Phase 6.0c PR1 introduced --ai family; this brings violet utilities in line. */
.bg-violet-600 { background-color: var(--ai) !important; }
.hover\:bg-violet-700:hover { background-color: var(--ai-hover) !important; }
.text-violet-600 { color: var(--ai) !important; }
.text-violet-700 { color: var(--ai-active) !important; }
.text-violet-800 { color: var(--ai-active) !important; }
.text-violet-900 { color: var(--ai-active) !important; }
.bg-violet-50 { background-color: var(--ai-subtle) !important; }
.bg-violet-100 { background-color: var(--ai-subtle) !important; }
.border-violet-200 { border-color: var(--ai-border) !important; }
.hover\:border-violet-200:hover { border-color: var(--ai-border) !important; }

/* === S2: Green/Emerald → --positive (Phase 6.0c PR4.5)
   Tailwind green/emerald utilities map onto warm-positive token family. */
.bg-green-500 { background-color: var(--positive) !important; }
.bg-green-600 { background-color: var(--positive) !important; }
.bg-green-700 { background-color: var(--positive) !important; }
.text-green-600 { color: var(--positive) !important; }
.text-green-700 { color: var(--positive) !important; }
.text-green-800 { color: var(--positive) !important; }
.text-green-900 { color: var(--positive) !important; }
.bg-green-50 { background-color: var(--positive-subtle) !important; }
.bg-green-100 { background-color: var(--positive-subtle) !important; }
.border-green-200 { border-color: var(--positive-border) !important; }
.border-green-300 { border-color: var(--positive-border) !important; }
.bg-emerald-500 { background-color: var(--positive) !important; }
.bg-emerald-600 { background-color: var(--positive) !important; }
.text-emerald-600 { color: var(--positive) !important; }
.text-emerald-700 { color: var(--positive) !important; }
.bg-emerald-50 { background-color: var(--positive-subtle) !important; }
.bg-emerald-100 { background-color: var(--positive-subtle) !important; }
.border-emerald-200 { border-color: var(--positive-border) !important; }

/* === S3: Red → --negative (Phase 6.0c PR4.5) */
.bg-red-500 { background-color: var(--negative) !important; }
.bg-red-600 { background-color: var(--negative) !important; }
.bg-red-700 { background-color: var(--negative) !important; }
.text-red-500 { color: var(--negative) !important; }
.text-red-600 { color: var(--negative) !important; }
.text-red-700 { color: var(--negative) !important; }
.text-red-800 { color: var(--negative) !important; }
.bg-red-50 { background-color: var(--negative-subtle) !important; }
.bg-red-100 { background-color: var(--negative-subtle) !important; }
.border-red-200 { border-color: var(--negative-border) !important; }
.border-red-300 { border-color: var(--negative-border) !important; }

/* === S4: Amber/Yellow/Orange → --warning (Phase 6.0c PR4.5)
   Per architect Q2: orange-500 used for governance FLAGGED state maps to
   --warning, NOT --accent — those are different semantic surfaces. */
.bg-amber-500 { background-color: var(--warning) !important; }
.bg-amber-600 { background-color: var(--warning) !important; }
.text-amber-500 { color: var(--warning) !important; }
.text-amber-600 { color: var(--warning) !important; }
.text-amber-700 { color: var(--warning) !important; }
.text-amber-800 { color: var(--warning) !important; }
.bg-amber-50 { background-color: var(--warning-subtle) !important; }
.bg-amber-100 { background-color: var(--warning-subtle) !important; }
.border-amber-200 { border-color: var(--warning-border) !important; }
.border-amber-300 { border-color: var(--warning-border) !important; }
.bg-yellow-400 { background-color: var(--warning) !important; }
.bg-yellow-500 { background-color: var(--warning) !important; }
.text-yellow-600 { color: var(--warning) !important; }
.text-yellow-700 { color: var(--warning) !important; }
.bg-yellow-50 { background-color: var(--warning-subtle) !important; }
.bg-yellow-100 { background-color: var(--warning-subtle) !important; }
.border-yellow-200 { border-color: var(--warning-border) !important; }
.bg-orange-500 { background-color: var(--warning) !important; }
.bg-orange-600 { background-color: var(--warning) !important; }
.text-orange-600 { color: var(--warning) !important; }
.text-orange-700 { color: var(--warning) !important; }
.bg-orange-50 { background-color: var(--warning-subtle) !important; }
.bg-orange-100 { background-color: var(--warning-subtle) !important; }
.border-orange-200 { border-color: var(--warning-border) !important; }

/* S1-5: Amber metrics → primary text */
[class~="text-amber-500"] { color: var(--text-primary) !important; }

/* S2-10: Native select dark mode */
[data-theme="dark"] select,
[data-palette="midnight"] select,
[data-palette="obsidian"] select {
  background-color: var(--surface-raised) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-subtle) !important;
}

/* === Indigo → --ai (Phase 6.0c PR4.5 — sibling to violet, AI semantic) */
.bg-indigo-600 { background-color: var(--ai) !important; }
.bg-indigo-50 { background-color: var(--ai-subtle) !important; }
.bg-indigo-100 { background-color: var(--ai-subtle) !important; }
.text-indigo-600 { color: var(--ai) !important; }
.text-indigo-700 { color: var(--ai) !important; }
.border-indigo-200 { border-color: var(--ai-border) !important; }
.hover\:bg-indigo-700:hover { background-color: var(--ai-hover) !important; }

/* Emerald status badges — keep green semantic but fix dark bg */
[data-theme="dark"] .bg-emerald-100,
[data-palette="midnight"] .bg-emerald-100 {
  background-color: rgba(16, 185, 129, 0.15) !important;
}
[data-theme="dark"] .bg-emerald-50,
[data-palette="midnight"] .bg-emerald-50 {
  background-color: rgba(16, 185, 129, 0.1) !important;
}
[data-theme="dark"] .bg-red-50,
[data-palette="midnight"] .bg-red-50 {
  background-color: rgba(239, 68, 68, 0.1) !important;
}
[data-theme="dark"] .bg-amber-50,
[data-palette="midnight"] .bg-amber-50 {
  background-color: rgba(245, 158, 11, 0.1) !important;
}

/* Dark mode — Phase 6.0c PR4.5 family extensions
   Token system handles light↔dark switching at the variable level; these
   overrides ensure the Tailwind utility maps to the correct token in dark mode. */
[data-theme="dark"] .bg-violet-50 { background-color: var(--ai-subtle) !important; }
[data-theme="dark"] .bg-violet-100 { background-color: var(--ai-subtle) !important; }
[data-theme="dark"] .text-violet-600 { color: var(--ai) !important; }
[data-theme="dark"] .text-violet-700 { color: var(--ai) !important; }
[data-theme="dark"] .bg-green-100 { background-color: var(--positive-subtle) !important; }
[data-theme="dark"] .bg-red-100 { background-color: var(--negative-subtle) !important; }
[data-theme="dark"] .bg-amber-100 { background-color: var(--warning-subtle) !important; }
[data-theme="dark"] .bg-orange-100 { background-color: var(--warning-subtle) !important; }
[data-theme="dark"] .bg-yellow-100 { background-color: var(--warning-subtle) !important; }

/* Phase 2.5d.4-hotfix — amber text + border tokens for dark mode.
   The 2.5d.4 LinkedIn capability disclosure uses amber-700/900 text on
   amber-50 backgrounds, which renders correctly on light surfaces but
   muddy/washed-out on dark surfaces (text-amber-900 = #78350F is too
   close to black on a dark card). Mapping the dark-end of the scale
   to lighter amber values restores readable contrast without breaking
   the brand-warm intent. */
[data-theme="dark"] .text-amber-900,
[data-palette="midnight"] .text-amber-900,
[data-palette="obsidian"] .text-amber-900 { color: #FDE68A !important; }
[data-theme="dark"] .text-amber-800,
[data-palette="midnight"] .text-amber-800,
[data-palette="obsidian"] .text-amber-800 { color: #FCD34D !important; }
[data-theme="dark"] .text-amber-700,
[data-palette="midnight"] .text-amber-700,
[data-palette="obsidian"] .text-amber-700 { color: #FBBF24 !important; }
[data-theme="dark"] .text-amber-600,
[data-palette="midnight"] .text-amber-600,
[data-palette="obsidian"] .text-amber-600 { color: #F59E0B !important; }
[data-theme="dark"] .border-amber-200,
[data-palette="midnight"] .border-amber-200,
[data-palette="obsidian"] .border-amber-200 { border-color: rgba(180, 83, 9, 0.4) !important; }
[data-theme="dark"] .hover\:text-amber-700:hover,
[data-palette="midnight"] .hover\:text-amber-700:hover,
[data-palette="obsidian"] .hover\:text-amber-700:hover { color: #FCD34D !important; }
/* The callout uses an opacity-modifier class (bg-amber-50/60) which
   compiles to a separate selector — explicit override needed. */
[data-theme="dark"] .bg-amber-50\/60,
[data-palette="midnight"] .bg-amber-50\/60,
[data-palette="obsidian"] .bg-amber-50\/60 { background-color: rgba(245, 158, 11, 0.08) !important; }

/* ============================================================
   THEME-AWARE COLOR OVERRIDES
   Maps Tailwind hardcoded colors to CSS var equivalents
   so theme switching works correctly
   ============================================================ */

/* Slate → theme-aware greys (dark mode safe) */
[data-theme="dark"] .text-slate-900,
[data-palette="midnight"] .text-slate-900,
[data-palette="obsidian"] .text-slate-900 { color: var(--text-primary) !important; }
[data-theme="dark"] .text-slate-800,
[data-palette="midnight"] .text-slate-800,
[data-palette="obsidian"] .text-slate-800 { color: var(--text-primary) !important; }
[data-theme="dark"] .text-slate-700,
[data-palette="midnight"] .text-slate-700,
[data-palette="obsidian"] .text-slate-700 { color: var(--text-secondary) !important; }
[data-theme="dark"] .text-slate-600,
[data-palette="midnight"] .text-slate-600,
[data-palette="obsidian"] .text-slate-600 { color: var(--text-secondary) !important; }
[data-theme="dark"] .text-slate-500,
[data-palette="midnight"] .text-slate-500,
[data-palette="obsidian"] .text-slate-500 { color: var(--text-tertiary) !important; }
[data-theme="dark"] .text-slate-400,
[data-palette="midnight"] .text-slate-400,
[data-palette="obsidian"] .text-slate-400 { color: var(--text-tertiary) !important; }
[data-theme="dark"] .text-slate-300,
[data-palette="midnight"] .text-slate-300,
[data-palette="obsidian"] .text-slate-300 { color: var(--text-muted) !important; }
[data-theme="dark"] .text-gray-500,
[data-palette="midnight"] .text-gray-500,
[data-palette="obsidian"] .text-gray-500 { color: var(--text-tertiary) !important; }
[data-theme="dark"] .text-gray-400,
[data-palette="midnight"] .text-gray-400,
[data-palette="obsidian"] .text-gray-400 { color: var(--text-tertiary) !important; }

[data-theme="dark"] .bg-slate-50,
[data-palette="midnight"] .bg-slate-50,
[data-palette="obsidian"] .bg-slate-50 { background-color: var(--surface-raised) !important; }
[data-theme="dark"] .bg-slate-100,
[data-palette="midnight"] .bg-slate-100,
[data-palette="obsidian"] .bg-slate-100 { background-color: var(--surface-raised) !important; }
[data-theme="dark"] .bg-slate-200,
[data-palette="midnight"] .bg-slate-200,
[data-palette="obsidian"] .bg-slate-200 { background-color: var(--surface-overlay) !important; }

[data-theme="dark"] .border-slate-200,
[data-palette="midnight"] .border-slate-200,
[data-palette="obsidian"] .border-slate-200 { border-color: var(--border-subtle) !important; }
[data-theme="dark"] .border-slate-100,
[data-palette="midnight"] .border-slate-100,
[data-palette="obsidian"] .border-slate-100 { border-color: var(--border-subtle) !important; }
[data-theme="dark"] .border-slate-300,
[data-palette="midnight"] .border-slate-300,
[data-palette="obsidian"] .border-slate-300 { border-color: var(--border-base) !important; }

/* Semantic colors — dark mode overrides */
[data-theme="dark"] .bg-red-50,
[data-palette="midnight"] .bg-red-50 { background-color: rgba(239,68,68,0.1) !important; }
[data-theme="dark"] .bg-green-50,
[data-palette="midnight"] .bg-green-50,
[data-theme="dark"] .bg-emerald-50,
[data-palette="midnight"] .bg-emerald-50 { background-color: rgba(16,185,129,0.1) !important; }
[data-theme="dark"] .bg-blue-50,
[data-palette="midnight"] .bg-blue-50 { background-color: rgba(59,130,246,0.1) !important; }
[data-theme="dark"] .bg-amber-50,
[data-palette="midnight"] .bg-amber-50 { background-color: rgba(245,158,11,0.1) !important; }

[data-theme="dark"] .border-red-200,
[data-palette="midnight"] .border-red-200 { border-color: rgba(239,68,68,0.3) !important; }
[data-theme="dark"] .border-green-200,
[data-palette="midnight"] .border-green-200 { border-color: rgba(16,185,129,0.3) !important; }

/* Accent color overrides for theme switching
   Phase 6.0c PR4.5.fix — indigo removed from comma-lists so PR4.5's
   line-460 .bg-indigo-* → --ai mapping wins. Blue stays --accent. */
.bg-blue-600 { background-color: var(--accent) !important; }
.hover\:bg-blue-700:hover { background-color: var(--accent) !important; filter: brightness(0.88); }
.text-blue-600 { color: var(--accent) !important; }
.text-blue-700 { color: var(--accent) !important; }

/* Skeleton shimmer — improved dark mode contrast */
[data-theme="dark"] .skeleton,
[data-palette="midnight"] .skeleton,
[data-palette="obsidian"] .skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.05) 25%, rgba(255,255,255,0.10) 50%, rgba(255,255,255,0.05) 75%) !important;
  background-size: 1200px 100%;
}

/* ============================================================
   COMPREHENSIVE DARK MODE OVERRIDES
   Catches all remaining hardcoded Tailwind classes that don't
   respond to CSS custom properties
   ============================================================ */

/* Body & root backgrounds */
[data-theme="dark"] body { background: var(--surface-ground) !important; color: var(--text-primary) !important; }

/* All white/light backgrounds → dark surface */
[data-theme="dark"] .bg-white { background-color: var(--surface-base) !important; }
[data-theme="dark"] .bg-gray-50,
[data-theme="dark"] .bg-gray-100 { background-color: var(--surface-raised) !important; }
[data-theme="dark"] .bg-gray-200 { background-color: var(--surface-overlay) !important; }

/* All dark text → light text */
[data-theme="dark"] .text-gray-900,
[data-theme="dark"] .text-gray-800 { color: var(--text-primary) !important; }
[data-theme="dark"] .text-gray-700,
[data-theme="dark"] .text-gray-600 { color: var(--text-secondary) !important; }
[data-theme="dark"] .text-gray-500,
[data-theme="dark"] .text-gray-400,
[data-theme="dark"] .text-gray-300 { color: var(--text-tertiary) !important; }

/* Border colors */
[data-theme="dark"] .border-gray-100,
[data-theme="dark"] .border-gray-200 { border-color: var(--border-subtle) !important; }
[data-theme="dark"] .border-gray-300 { border-color: var(--border-base) !important; }

/* Divide colors */
[data-theme="dark"] .divide-slate-50 > :not([hidden]) ~ :not([hidden]),
[data-theme="dark"] .divide-slate-100 > :not([hidden]) ~ :not([hidden]),
[data-theme="dark"] .divide-gray-100 > :not([hidden]) ~ :not([hidden]) {
  border-color: var(--border-subtle) !important;
}

/* Input fields */
[data-theme="dark"] input,
[data-theme="dark"] textarea {
  background-color: var(--surface-inset) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-subtle) !important;
}
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
  color: var(--text-tertiary) !important;
}
[data-theme="dark"] input:focus,
[data-theme="dark"] textarea:focus {
  border-color: var(--accent) !important;
  box-shadow: var(--shadow-focus) !important;
}
/* Checkbox — keep native styling */
[data-theme="dark"] input[type="checkbox"] {
  background-color: transparent !important;
  accent-color: var(--accent);
}

/* Shadow overrides */
[data-theme="dark"] .shadow-sm { box-shadow: var(--shadow-sm) !important; }
[data-theme="dark"] .shadow-md { box-shadow: var(--shadow-md) !important; }
[data-theme="dark"] .shadow-lg { box-shadow: var(--shadow-lg) !important; }
[data-theme="dark"] .shadow-xl { box-shadow: var(--shadow-xl) !important; }
[data-theme="dark"] .shadow-2xl { box-shadow: var(--shadow-xl) !important; }

/* Ring/focus overrides */
[data-theme="dark"] .ring-blue-200,
[data-theme="dark"] .focus\:ring-blue-200:focus,
[data-theme="dark"] .focus\:ring-2:focus {
  --tw-ring-color: var(--accent-border) !important;
}

/* Semantic colors — dark mode transparency */
[data-theme="dark"] .bg-orange-50 { background-color: rgba(249,115,22,0.1) !important; }
[data-theme="dark"] .bg-orange-100 { background-color: rgba(249,115,22,0.15) !important; }
[data-theme="dark"] .bg-yellow-50 { background-color: rgba(234,179,8,0.1) !important; }
[data-theme="dark"] .bg-yellow-100 { background-color: rgba(234,179,8,0.15) !important; }
[data-theme="dark"] .bg-green-100,
[data-theme="dark"] .bg-emerald-100 { background-color: rgba(16,185,129,0.15) !important; }
[data-theme="dark"] .bg-red-100 { background-color: rgba(239,68,68,0.15) !important; }
[data-theme="dark"] .bg-blue-100 { background-color: rgba(59,130,246,0.15) !important; }
[data-theme="dark"] .bg-indigo-50,
[data-theme="dark"] .bg-indigo-100 { background-color: rgba(99,102,241,0.15) !important; }

/* Notification bell dropdown */
[data-theme="dark"] .bg-blue-50\/50 { background-color: rgba(59,130,246,0.08) !important; }

/* Semantic text colors that should stay readable */
[data-theme="dark"] .text-emerald-900 { color: #6ee7b7 !important; }
[data-theme="dark"] .text-emerald-700 { color: #34d399 !important; }
[data-theme="dark"] .text-amber-900 { color: #fcd34d !important; }
[data-theme="dark"] .text-amber-700,
[data-theme="dark"] .text-amber-600 { color: #f59e0b !important; }
[data-theme="dark"] .text-red-700,
[data-theme="dark"] .text-red-600 { color: #f87171 !important; }
[data-theme="dark"] .text-red-900 { color: #fca5a5 !important; }
[data-theme="dark"] .text-blue-600,
[data-theme="dark"] .text-blue-700 { color: var(--accent) !important; }
[data-theme="dark"] .text-green-700,
[data-theme="dark"] .text-green-600 { color: #34d399 !important; }

/* Semantic border colors */
[data-theme="dark"] .border-emerald-100,
[data-theme="dark"] .border-emerald-200 { border-color: rgba(16,185,129,0.3) !important; }
[data-theme="dark"] .border-amber-100,
[data-theme="dark"] .border-amber-200 { border-color: rgba(245,158,11,0.3) !important; }
[data-theme="dark"] .border-red-100,
[data-theme="dark"] .border-red-200 { border-color: rgba(239,68,68,0.3) !important; }
[data-theme="dark"] .border-blue-100,
[data-theme="dark"] .border-blue-200 { border-color: rgba(59,130,246,0.3) !important; }
[data-theme="dark"] .border-orange-100 { border-color: rgba(249,115,22,0.3) !important; }
[data-theme="dark"] .border-yellow-200 { border-color: rgba(234,179,8,0.3) !important; }
[data-theme="dark"] .border-indigo-200 { border-color: rgba(99,102,241,0.3) !important; }

/* Hover states */
[data-theme="dark"] .hover\:bg-slate-50:hover,
[data-theme="dark"] .hover\:bg-gray-50:hover { background-color: var(--surface-overlay) !important; }
[data-theme="dark"] .hover\:bg-blue-50:hover { background-color: rgba(59,130,246,0.12) !important; }
[data-theme="dark"] .hover\:bg-red-50:hover { background-color: rgba(239,68,68,0.12) !important; }

/* Table styles */
[data-theme="dark"] th { color: var(--text-secondary) !important; border-color: var(--border-subtle) !important; }
[data-theme="dark"] td { color: var(--text-primary) !important; border-color: var(--border-subtle) !important; }
[data-theme="dark"] tr:hover td { background-color: var(--surface-overlay) !important; }

/* ══════════════════════════════════════════════════════════════
   PREMIUM UI — Typography, Hover States, Transitions, Polish
   ══════════════════════════════════════════════════════════════ */

/* ── Typography ── */
body, button, input, select, textarea {
  font-family: var(--font-ui) !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, .text-2xl, .text-3xl, .text-4xl, [class*="text-\[34px\]"], [class*="text-\[28px\]"] {
  font-family: var(--font-display) !important;
  font-weight: 400 !important;
  letter-spacing: -0.02em;
}

/* ── Global Font Consistency ── */
body { font-size: 13px; line-height: 1.6; }
h2 { font-size: 18px; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; }
table th { font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }
table td { font-size: 13px; }
input, select, textarea { font-size: 13px; }

/* ── Button Hover States ── */
button, [role="button"] {
  transition: all var(--duration-base) var(--ease-decelerate) !important;
  cursor: pointer;
}
button:hover {
  filter: brightness(0.95);
}
button:active {
  transform: scale(0.98);
}

/* ── Card Hover ── */
[class*="rounded-xl"]:hover, [class*="rounded-2xl"]:hover, [class*="rounded-\[32px\]"]:hover {
  box-shadow: var(--shadow-md) !important;
  transition: box-shadow var(--duration-base) var(--ease-decelerate) !important;
}

/* ── Page Transitions ── */
@keyframes cc-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
main, [class*="animate-in"] {
  animation: cc-fade-in 0.25s var(--ease-decelerate) !important;
}

/* ── Skeleton Loading ── */
.animate-pulse, [class*="animate-pulse"] {
  background: linear-gradient(90deg, var(--surface-raised) 25%, var(--surface-overlay) 50%, var(--surface-raised) 75%) !important;
  background-size: 200% 100% !important;
  animation: cc-skeleton 1.5s infinite !important;
}
@keyframes cc-skeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Focus Rings ── */
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none !important;
  box-shadow: var(--shadow-focus) !important;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-base); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }

/* ── Dark Mode: Agent Cards ── */
[data-theme="dark"] [class*="rounded-\[32px\]"] h2,
[data-theme="dark"] [class*="rounded-\[32px\]"] h3,
[data-theme="dark"] [class*="rounded-\[32px\]"] p {
  color: var(--text-primary) !important;
}

/* ── Dark Mode: Charts ── */
[data-theme="dark"] .recharts-cartesian-grid line { stroke: rgba(255,255,255,0.1) !important; }
[data-theme="dark"] .recharts-text { fill: var(--text-tertiary) !important; }
[data-theme="dark"] .recharts-tooltip-wrapper { border-radius: 8px !important; }

/* ── Dark Mode: Card Borders ── */
[data-theme="dark"] [class*="bg-white"], [data-theme="dark"] .bg-white {
  border: 1px solid rgba(255,255,255,0.08) !important;
}

/* ── Sidebar Hover ── */
[class*="sidebar"] button:hover, nav button:hover {
  background: var(--accent-subtle) !important;
}

/* ── Selection Color ── */
::selection { background: var(--accent-subtle); color: var(--text-primary); }

/* ── Dark Mode: Creator Studio Live Preview (Phone Mockup) ── */
[data-theme="dark"] .cc-phone-preview .bg-white {
  background-color: #15202b !important;
  color: #e7e9ea !important;
}
[data-theme="dark"] .cc-phone-preview .bg-white * {
  color: #e7e9ea !important;
  border-color: #38444d !important;
}
[data-theme="dark"] .cc-phone-preview .text-gray-900,
[data-theme="dark"] .cc-phone-preview .text-gray-800,
[data-theme="dark"] .cc-phone-preview .text-gray-700,
[data-theme="dark"] .cc-phone-preview .text-black {
  color: #e7e9ea !important;
}
[data-theme="dark"] .cc-phone-preview .text-gray-500,
[data-theme="dark"] .cc-phone-preview .text-gray-400 {
  color: #71767b !important;
}
[data-theme="dark"] .cc-phone-preview .border-gray-100,
[data-theme="dark"] .cc-phone-preview .border-gray-200 {
  border-color: #38444d !important;
}

/* ── Dark Mode: Calendar Grid ── */
[data-theme="dark"] [class*="calendar"] td,
[data-theme="dark"] [class*="Calendar"] td {
  border-color: var(--border-subtle) !important;
}

/* ── Dark Mode: Inbox Panels ── */
[data-theme="dark"] [class*="inbox"] [class*="border-r"],
[data-theme="dark"] [class*="Inbox"] [class*="border-r"] {
  border-color: var(--border-subtle) !important;
}

/* ── Dark Mode: Media Thumbnails ── */
[data-theme="dark"] [class*="media"] img,
[data-theme="dark"] [class*="Media"] img {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
}

/* ── Dark Mode: Dropdowns ── */
[data-theme="dark"] [class*="dropdown"],
[data-theme="dark"] [role="listbox"],
[data-theme="dark"] [role="menu"] {
  background: var(--surface-raised) !important;
  border-color: var(--border-subtle) !important;
}

/* ── Orange Button Gradient ── */
button[style*="background: var(--accent)"],
button[style*="background:var(--accent)"] {
  background: linear-gradient(135deg, #f97316, #ea580c) !important;
}

/* ── Calendar Day Hover ── */
[class*="calendar"] [class*="day"]:hover,
[class*="Calendar"] [class*="day"]:hover {
  background: rgba(249,115,22,0.04) !important;
}

/* ── Notification Badge ── */
[class*="badge"][class*="bg-red"],
[class*="notification"] [class*="badge"] {
  min-width: 20px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  line-height: 20px !important;
  text-align: center !important;
}

/* ── Timestamp "0m ago" fix ── */
/* Handled in JS — but ensure consistent time styling */
[class*="time-ago"], [class*="timestamp"] {
  font-variant-numeric: tabular-nums;
}

/* ── Smooth Image Loading ── */
img { transition: opacity 0.3s; }
img[src=""] { opacity: 0; }

/* ══════════════════════════════════════════════════════════════
   PHASE 2: 8.6 → 10/10 — Final Polish Layer
   ══════════════════════════════════════════════════════════════ */

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── Button Hover — Add translateY ── */
button:hover, [role="button"]:hover {
  transform: translateY(-1px);
}
button:active, [role="button"]:active {
  transform: translateY(0) scale(0.98);
}

/* ── Card Lift on Hover ── */
[class*="rounded-xl"], [class*="rounded-2xl"], [class*="rounded-\[32px\]"],
[class*="rounded-\[14px\]"], [class*="rounded-\[16px\]"], [class*="rounded-\[20px\]"] {
  transition: transform 200ms ease, box-shadow 200ms ease !important;
}
[class*="rounded-xl"]:hover, [class*="rounded-2xl"]:hover {
  transform: translateY(-2px) !important;
}

/* ── Link Hover Underline Animation ── */
a[class*="text-"], a[style*="color"] {
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px;
  background-repeat: no-repeat;
  background-position: left bottom;
  transition: background-size 200ms ease;
}
a[class*="text-"]:hover, a[style*="color"]:hover {
  background-size: 100% 1px;
}

/* ── Dark Mode Elevation System ── */
[data-theme="dark"] {
  --surface-ground: #1a1510;
  --surface-base: #211c15;
  --surface-raised: #2a2520;
  --surface-overlay: #332e28;
  --surface-inset: #3d3730;
}

/* ── Dark Mode: All Cards ── */
[data-theme="dark"] [class*="rounded-xl"],
[data-theme="dark"] [class*="rounded-2xl"],
[data-theme="dark"] [class*="rounded-\[32px\]"],
[data-theme="dark"] [class*="rounded-\[14px\]"],
[data-theme="dark"] [class*="rounded-\[16px\]"] {
  border: 1px solid rgba(255,255,255,0.06) !important;
}

/* ── Dark Mode: Card hover shadow ── */
[data-theme="dark"] [class*="rounded-xl"]:hover,
[data-theme="dark"] [class*="rounded-2xl"]:hover {
  box-shadow: 0 8px 25px rgba(0,0,0,0.3) !important;
}

/* ── Dark Mode: Chart dots glow ── */
[data-theme="dark"] .recharts-dot { filter: drop-shadow(0 0 3px var(--accent)); }
[data-theme="dark"] .recharts-active-dot { filter: drop-shadow(0 0 6px var(--accent)); }

/* ── Dark Mode: Inbox message hover ── */
[data-theme="dark"] [class*="inbox"] [class*="message"]:hover,
[data-theme="dark"] [class*="Inbox"] div[style*="cursor"]:hover {
  background: rgba(255,255,255,0.04) !important;
}

/* ── Dark Mode: Scrollbar ── */
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); }
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ── Tooltip Base (native title enhanced) ── */
[title] { position: relative; }

/* ── Post Title Truncation ── */
[class*="post-title"], [class*="PostTitle"] {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Sidebar Badge ── */
[class*="sidebar"] [class*="badge"] {
  min-width: 18px;
  height: 18px;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

/* ══════════════════════════════════════════════════════════════
   PHASE 3: 9.1 → 10/10 — Exact DOM-Verified Fixes
   ══════════════════════════════════════════════════════════════ */

/* ── FIX 1: Metric Card Hover Lift ── */
.metric-card-hover {
  transition: transform 200ms ease, box-shadow 200ms ease !important;
}
.metric-card-hover:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 25px rgba(0,0,0,0.08) !important;
}
[data-theme="dark"] .metric-card-hover:hover {
  box-shadow: 0 8px 25px rgba(0,0,0,0.25) !important;
}
div[class*="rounded-\[14px\]"][class*="border"] {
  transition: transform 200ms ease, box-shadow 200ms ease !important;
}
div[class*="rounded-\[14px\]"][class*="border"]:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 25px rgba(0,0,0,0.08) !important;
}

/* ── FIX 3: Button Size System ── */
.btn-sm { height: 32px !important; padding: 0 12px !important; font-size: 13px !important; }
.btn-md { height: 40px !important; padding: 0 16px !important; font-size: 14px !important; }
.btn-lg { height: 48px !important; padding: 0 24px !important; font-size: 15px !important; font-weight: 600 !important; }

/* ── FIX 4: Creator Studio Live Preview Dark Mode ── */
[data-theme="dark"] [style*="borderRadius: '24px'"][style*="background: '#fff'"],
[data-theme="dark"] [style*="borderRadius: '24px'"][style*="background: 'white'"],
[data-theme="dark"] [style*="background: '#fff'"][style*="borderRadius"],
[data-theme="dark"] [style*="background: white"][style*="borderRadius"],
[data-theme="dark"] [style*="border-radius: 24px"] {
  background-color: #15202b !important;
  color: #e7e9ea !important;
}
[data-theme="dark"] [style*="@find_positive"] {
  color: #e7e9ea !important;
}

/* ── FIX 6: Tab Content Crossfade ── */
@keyframes tabFadeIn {
  from { opacity: 0; transform: translateX(6px); }
  to { opacity: 1; transform: translateX(0); }
}
[role="tabpanel"], [class*="tab-panel"], [class*="tab-content"] {
  animation: tabFadeIn 180ms ease-out;
}

/* ── FIX 7: Modal Animations ── */
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
[class*="fixed"][class*="inset-0"][class*="z-"] > div:first-child {
  animation: scaleIn 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── FIX 10: Toggle Switch Hover ── */
[role="switch"]:hover, [class*="toggle"]:hover, [class*="Toggle"]:hover {
  transform: scale(1.05);
  transition: transform 150ms ease;
}

/* ── FIX 12: Design Tokens ── */
:root {
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
}

/* ── FIX 14: Dark Mode Dropdown Options ── */
[data-theme="dark"] option {
  background-color: #2a2520 !important;
  color: #e5e5e5 !important;
}

/* ── FIX 15: Sidebar Active Indicator ── */
[class*="sidebar"] [style*="borderLeft"],
[class*="sidebar"] [style*="border-left"] {
  transition: all 250ms cubic-bezier(0.16, 1, 0.3, 1) !important;
}

/* ── Notification Badge Pulse ── */
@keyframes badge-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}
[class*="notification"] [class*="badge"],
span[class*="absolute"][class*="rounded-full"][style*="background"] {
  animation: badge-pulse 2s ease-in-out 3;
}

/* ── Skip to Content ── */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.sr-only:focus {
  position: fixed; z-index: 99999; top: 16px; left: 16px;
  width: auto; height: auto; padding: 12px 24px; margin: 0;
  overflow: visible; clip: auto; white-space: normal;
  background: var(--accent); color: #fff; border-radius: 8px;
  font-size: 14px; font-weight: 600; box-shadow: var(--shadow-lg);
}

/* ── Button Height Standardization (9 sizes → 3) ── */

/* SMALL (32px): icon buttons, chips, filters, inline actions, dismiss */
button[style*="padding: 5px"],
button[style*="padding:5px"],
button[style*="padding: 4px"],
button[style*="padding: '5px"],
button[style*="padding: '4px"] {
  min-height: 32px !important;
}

/* MEDIUM (40px): DEFAULT — standard action buttons */
button[style*="padding: '8px"],
button[style*="padding: '10px"],
button[style*="padding: 8px"],
button[style*="padding: 10px"],
button[class*="px-4"],
button[class*="px-5"],
button[class*="px-6"]:not([class*="py-3"]),
button[class*="rounded-xl"][class*="px-"],
input[type="submit"],
button[type="submit"] {
  min-height: 40px !important;
}

/* LARGE (48px): hero CTAs, full-width, primary page actions */
button[class*="py-3"],
button[class*="w-full"][class*="py-"],
button[class*="text-base"][class*="py-3"] {
  min-height: 48px !important;
}

/* Exceptions: don't resize these */
button[role="switch"], [class*="toggle"], [class*="Toggle"],
[class*="sidebar"] button, [role="tab"],
button[style*="padding: 5px"], button[style*="padding: 4px"],
button[style*="padding:5px"], button[style*="padding:4px"] {
  /* These keep their original size */
}

/* Toggle hover scale */
button[role="switch"]:hover {
  transform: scale(1.05) !important;
  transition: transform 150ms ease !important;
}
button[role="switch"]:active {
  transform: scale(0.98) !important;
}

/* ── Dark Mode: Notification Panel ── */
[data-theme="dark"] .bg-white.rounded-2xl.shadow-2xl {
  background: var(--surface-raised) !important;
  border-color: var(--border-subtle) !important;
}
[data-theme="dark"] .bg-slate-50\/80 {
  background: var(--surface-overlay) !important;
}
[data-theme="dark"] .text-slate-900 {
  color: var(--text-primary) !important;
}
[data-theme="dark"] .text-slate-700 {
  color: var(--text-secondary) !important;
}
[data-theme="dark"] .text-slate-500,
[data-theme="dark"] .text-slate-400 {
  color: var(--text-tertiary) !important;
}
[data-theme="dark"] .divide-slate-50 > * + * {
  border-color: var(--border-subtle) !important;
}
[data-theme="dark"] .border-slate-100 {
  border-color: var(--border-subtle) !important;
}
[data-theme="dark"] .bg-blue-50\/50,
[data-theme="dark"] .bg-blue-50 {
  background: rgba(249,115,22,0.06) !important;
}
[data-theme="dark"] .hover\:bg-blue-50:hover {
  background: rgba(249,115,22,0.1) !important;
}

/* AI Approval Modal dark mode */
[data-theme="dark"] div[style*="surface-primary"] {
  background: #1a1510 !important;
  border-color: rgba(255,255,255,0.08) !important;
}


/* ── Dark Mode: AI Approval Modal ── */
[data-theme="dark"] div[style*="fixed"] > div[style*="borderRadius: 16px"],
[data-theme="dark"] div[style*="fixed"] > div[style*="border-radius: 16px"],
[data-theme="dark"] div[style*="fixed"] > div[style*="max-width: 560px"],
[data-theme="dark"] div[style*="fixed"] > div[style*="maxWidth: 560px"] {
  background: #1a1510 !important;
  color: #faf9f7 !important;
  border-color: rgba(255,255,255,0.08) !important;
}
[data-theme="dark"] div[style*="fixed"] > div[style*="borderRadius: 16px"] input[type="checkbox"] + span,
[data-theme="dark"] div[style*="fixed"] > div[style*="max-width: 560px"] span,
[data-theme="dark"] div[style*="fixed"] > div[style*="max-width: 560px"] p,
[data-theme="dark"] div[style*="fixed"] > div[style*="max-width: 560px"] h3,
[data-theme="dark"] div[style*="fixed"] > div[style*="max-width: 560px"] label {
  color: #faf9f7 !important;
}
[data-theme="dark"] div[style*="fixed"] > div[style*="max-width: 560px"] div[style*="surface-raised"],
[data-theme="dark"] div[style*="fixed"] > div[style*="max-width: 560px"] div[style*="border: 1px solid var"] {
  background: #221c15 !important;
  border-color: rgba(255,255,255,0.06) !important;
  color: #faf9f7 !important;
}
[data-theme="dark"] div[style*="fixed"] > div[style*="max-width: 560px"] textarea {
  background: #221c15 !important;
  color: #faf9f7 !important;
  border-color: var(--accent-border) !important;
}
[data-theme="dark"] div[style*="fixed"] > div[style*="max-width: 560px"] label[style*="border"] {
  background: rgba(255,255,255,0.02) !important;
  border-color: rgba(255,255,255,0.08) !important;
}

/* ── Agent Cards: Glassmorphism Glow Animation ── */
@keyframes pulse-glow {
  0%, 100% { opacity: 0.2; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.03); }
}
@keyframes slideUp {
  from { transform: translate(-50%, 20px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}
