/* ============================================================================
   Outsight brand — the single design system shared across every surface
   (the /analytics app, the hub launcher, the ICP Dashboards funnel site).

   Source of truth: Brand Guidelines V2.1. Change a value here and it changes
   everywhere that links this file. Reuse the component classes below (.card,
   .btn, .pill, .kpi, .navlink, .sidebar, table…) instead of re-styling per page.

   Palette: Off-white #FAFAF7 · Outsight Black #101820 · Prussian #1E293B;
   red #BF0D0D is accent/emphasis only. Type: Inter (display + body),
   Noto Serif (italic red kickers). Weight rule: bigger size → lighter weight.
   Dark theme = neutral near-black, matching the Outsight product.
   ============================================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Noto+Serif:ital,wght@0,400;1,400;1,600&display=swap');

:root {
  color-scheme: light;
  /* Core Outsight tokens */
  --ink:#101820; --ink-soft:#54596A; --paper:#faf9f7; --panel:#101820; --panel-2:#1E293B;
  --card:#ece8e1; --line:#cfcac2; --line-dark:#2a3441; --muted:#999CA8; --muted-dark:#999CA8;
  --accent:#BF0D0D; --accent-soft:#f7dada;
  --blue:#3b6fd4; --green:#3a9e6b; --amber:#cf9a16; --red:#BF0D0D; --purple:#7a3ab8;
  /* Outsight Design System base (artifact 8BwJ6W4TVbFeuHxRWZDMju) — linen surfaces, warm neutrals */
  --outsight-black:#101820; --prussian-blue:#1e293b; --linen:#ece8e1; --off-white:#faf9f7;
  --stone:#5f5a53; --sand:#b3ada3; --surface-2:#dbd6ce;
  --ok:#16a34a; --warn:#f59e0b; --crit:#bf0d0d; --info:#2563eb;
  --shadow-xs:0px 1px 2px 0px rgba(16,24,32,.05);
  --shadow-float:0px 1px 2px 0px rgba(16,24,32,.06), 0px 8px 24px 0px rgba(16,24,32,.10);
  --serif:"Noto Serif", Georgia, "Times New Roman", serif;
  --sans:"Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --r:6px; --radius:6px; --radius-card:6px; --radius-panel:10px; --r-md:10px; --r-sm:4px;
  --sidebar-w:256px;   /* canonical left-rail width — identical across app / launcher / funnel (design-system) */
  /* shadcn-style aliases (launcher + funnel reference these) → mapped to Outsight */
  --background:var(--paper); --foreground:var(--ink);
  --card-foreground:var(--ink);
  --muted-bg:#e3ded6; --muted-foreground:#5f646f;
  --secondary:#e3ded6; --secondary-foreground:var(--ink);
  --border:var(--line); --ring:#c5ccd6;
  --sidebar:#101820; --sidebar-accent:#1b2029; --sidebar-border:#2a3441;
  --brand:var(--accent); --brand-foreground:#fff; --red-readable:var(--accent); --accent-highlight:#33497f;
  /* funnel-site aliases */
  --bg:var(--paper); --surface:var(--card); --surface-alt:#e3ded6;
  --text:var(--ink); --text-muted:#5f646f; --text-subtle:var(--muted); --text-faint:#b5bac4;
  --border-soft:#ddd8d0; --hover:#dbd6ce;
  --code-bg:#e3ded6; --chip-bg:#e3ded6; --chip-text:#5f646f;
  --error-bg:var(--accent-soft); --error-text:var(--accent);
  --tier1:var(--green); --tier2:var(--amber); --tier3:var(--blue); --tierU:var(--muted);
  --easter-text:rgba(16,24,32,.06); --easter-text-hover:rgba(16,24,32,.2);
  --shadow:rgba(20,24,31,.08);
}

/* Dark = neutral near-black (matches the Outsight product). Works with either the
   `.dark` class (launcher + funnel toggle) or `[data-theme="dark"]` (the app). */
.dark, :root[data-theme="dark"] {
  color-scheme: dark;
  --ink:#e9ebee; --ink-soft:#a1a5ad; --paper:#121418; --card:#1b1e23; --line:#2b2f36;
  --line-dark:#23262b; --muted:#8c9099; --muted-dark:#a1a5ad;
  --accent:#e24444; --accent-soft:rgba(226,68,68,.16);
  --blue:#6b9bff; --green:#4cc08a; --amber:#e0b64a; --red:#e24444; --purple:#a06bd8;
  --card-foreground:var(--ink);
  --muted-bg:#22262d; --muted-foreground:#9aa0ab; --secondary:#22262d; --secondary-foreground:var(--ink);
  --ring:#3a3f49; --sidebar:#0d0f12; --sidebar-accent:#1b1f26; --sidebar-border:#23262b;
  --brand:var(--accent); --red-readable:#ee5858; --accent-highlight:#d4a843;
  --surface:var(--card); --surface-alt:#22262d;
  --text:var(--ink); --text-muted:#9aa0ab; --text-subtle:var(--muted); --text-faint:#6b7280;
  --border-soft:#23262b; --hover:#22262d; --code-bg:#22262d; --chip-bg:#22262d; --chip-text:#c7ccd4;
  --error-bg:var(--accent-soft); --error-text:#ee5858;
  --easter-text:rgba(233,235,238,.06); --easter-text-hover:rgba(233,235,238,.2); --shadow:rgba(0,0,0,.35);
}

/* ---- Base ---- */
* { box-sizing:border-box; }
body { background:var(--paper); color:var(--ink); font:15px/1.5 var(--sans); -webkit-font-smoothing:antialiased; }
a { color:inherit; text-decoration:none; }
h1 { font-family:var(--sans); font-weight:750; font-size:33px; letter-spacing:-.035em; line-height:1.05; }
h1 .dot { color:var(--accent); background:none; width:auto; height:auto; border-radius:0; }
h2 { font-size:14px; font-weight:600; }
.sub { color:var(--muted); font-size:12.5px; }
.eyebrow { color:var(--accent); font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.1em; }
code { font-family:ui-monospace, SFMono-Regular, Menlo, monospace; font-size:12px; background:var(--code-bg); padding:1px 5px; border-radius:5px; }

/* ---- Dark sidebar (Outsight Black) — identical dimensions on every surface ----
   Width is --sidebar-w; mark 32px; nav 9/11 @13.5px; profile chip (.who) 30px avatar. */
.sidebar, aside.sidebar { background:var(--panel); color:#cdd4de; }
.sidebar a { color:#cdd4de; }
.brand { gap:11px; padding:4px 6px 16px; }
.brand .mark { width:32px; height:32px; border-radius:8px; background:var(--accent); display:grid; place-items:center; flex:none; }
.brand .mark svg { width:19px; height:19px; }
.brand .t { font-size:15px; font-weight:600; letter-spacing:-.01em; line-height:1.15; }
.brand .t, .brand .t strong { color:#fff; }
.brand .t small { color:var(--muted-dark); font-size:11.5px; font-weight:400; }
.navlabel { color:var(--muted-dark); font-size:11px; text-transform:uppercase; letter-spacing:.09em; margin:16px 8px 6px; }
.navlink, .sidebar nav a, aside nav a { display:flex; align-items:center; gap:11px; padding:9px 11px; border-radius:9px; color:#cdd4de; font-size:13.5px; border-left:3px solid transparent; }
.navlink:hover, .sidebar nav a:hover, aside nav a:hover { background:var(--sidebar-accent); color:#fff; }
.navlink.active, .sidebar nav a.active, aside nav a.active { background:rgba(191,13,13,.16); color:#fff; border-left-color:var(--accent); }
.who { margin-top:auto; display:flex; align-items:center; gap:10px; padding:12px 4px 2px; border-top:1px solid var(--sidebar-border); }
.who .av { width:30px; height:30px; border-radius:7px; background:var(--sidebar-accent); color:#fff; display:grid; place-items:center; font-weight:600; font-size:12px; flex:none; overflow:hidden; }
.who .who-t, .who .t { flex:1; min-width:0; line-height:1.25; font-size:12.5px; color:#e8ebf1; }
.who .em, .who .meta, .who .t small { color:#9aa3b2; font-size:11px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; display:block; }
.who .iconbtn { background:transparent; border:1px solid var(--sidebar-border); border-radius:7px; width:28px; height:28px; display:grid; place-items:center; color:#9aa3b2; flex:none; }
.who .iconbtn:hover { background:var(--sidebar-accent); color:#fff; }

/* ---- Cards / KPIs ---- */
.card { background:var(--card); border:1px solid var(--line); border-radius:var(--r); padding:16px 18px; transition:box-shadow .12s, border-color .12s; }
.card:hover { box-shadow:0 6px 22px var(--shadow); }
.card.span { grid-column:1/-1; }
.kpi .label { font-size:11px; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); }
.kpi .val { font-family:var(--sans); font-size:30px; font-weight:300; margin-top:6px; letter-spacing:-.02em; font-variant-numeric:tabular-nums; }
.up { color:var(--green); } .down { color:var(--red); } .na { color:var(--muted); }

/* ---- Pills / badges / dots ---- */
.pill { display:inline-block; font-size:10px; font-weight:600; padding:2px 8px; border-radius:99px; vertical-align:middle; }
.pill.live { background:color-mix(in srgb, var(--green) 16%, transparent); color:var(--green); }
.pill.seed { background:color-mix(in srgb, var(--amber) 18%, transparent); color:var(--amber); }
.pill.todo, .pill.muted { background:var(--chip-bg); color:var(--muted); }
.pill.err { background:var(--accent-soft); color:var(--accent); }
.badge { font-size:10.5px; color:var(--muted); display:inline-flex; align-items:center; gap:5px; }

/* ---- Tables ---- */
table { width:100%; border-collapse:collapse; font-size:13px; }
th { text-align:left; color:var(--muted); font-size:10.5px; text-transform:uppercase; letter-spacing:.05em; font-weight:600; padding:8px; border-bottom:1px solid var(--line); }
td { padding:8px; border-bottom:1px solid var(--border-soft); }
tbody tr:last-child td { border-bottom:none; }
tbody tr.clickable:hover { background:var(--hover); cursor:pointer; }
td.num, th.num { text-align:right; font-variant-numeric:tabular-nums; }

/* ---- Controls ---- */
.btn { background:var(--accent); color:#fff; border:none; border-radius:9px; padding:7px 14px; font:inherit; font-size:13px; font-weight:500; cursor:pointer; }
.btn.ghost { background:var(--card); color:var(--ink); border:1px solid var(--line); }
.btn:hover { filter:brightness(.96); }
input, select, textarea { border:1px solid var(--line); border-radius:9px; padding:7px 10px; font:inherit; font-size:13px; background:var(--card); color:var(--ink); }
input:focus, select:focus, textarea:focus { outline:none; border-color:var(--accent); }
.chip { border:1px solid var(--line); background:var(--card); border-radius:99px; padding:5px 13px; font-size:12.5px; cursor:pointer; color:var(--muted); }
.chip.active { background:var(--accent); border-color:var(--accent); color:#fff; }
.vtag, .vt { display:inline-block; font-size:10px; background:var(--chip-bg); color:var(--muted); border-radius:5px; padding:1px 6px; }

/* ---- States ---- */
.empty { text-align:center; color:var(--muted); padding:30px 12px; font-size:13px; }
.crumbs { font-size:12px; color:var(--muted); margin-bottom:10px; }
.tabs { display:flex; gap:6px; border-bottom:1px solid var(--line); margin-bottom:14px; }
.tab { padding:8px 13px; font-size:13.5px; color:var(--muted); border-bottom:2px solid transparent; }
.tab.active { color:var(--ink); border-bottom-color:var(--accent); font-weight:600; }
