feat(portal): M10.2 design system foundations — tokens, shell, Dashboard

Brings in the handoff design system from `Breakpilot Platform.zip`
(`breakpilot/design_handoff_customer_portal/`) as the base for restyling
every customer-area surface.

What's in:

* **Design tokens & layout primitives** — `src/app/globals.css` is the
  handoff `styles.css` in full (OKLCH paper + ink + brand-violet,
  --rule-* hairlines, --sev-* severity ramp, corner-tick bracket
  treatment, ledger table, 32–36px row density, dark mode via
  `[data-theme="dark"]`). Tailwind v4 layered on top via PostCSS for
  utility helpers; the design system itself stays in plain CSS.
* **Geist + Geist Mono** wired through `next/font/google` so the
  monospaced metadata/figures everywhere render at the intended weight.
* **Shell chrome** under `src/components/portal/`:
  `Brand` (Breakpilot. wordmark with the violet trailing dot),
  `Lifeline` (top full-width tenant rail — active / trial / frozen /
  demo variants; archived swaps in `ArchivedLockout`),
  `NavRail` (232px left rail with tenant switcher + workspace/admin/
  settings groups + user chip; locked routes show a lock icon and a
  "Requires X" tooltip rather than vanishing),
  `Topbar` (breadcrumb + ⌘K button placeholder + theme toggle),
  `ThemeToggle` (Sun/Moon, persists to `localStorage["bp.theme"]`,
  no-flash via a head script in the root layout).
* **Dashboard** at `/[slug]/dashboard` rebuilt per handoff §1:
  page-head with Export + Run scan (the latter wrapped in the frozen
  write-guard hovercard surfacing `HTTP 402 · payment required`),
  5-cell bracketed KPI rail (open findings + 14-day sparkbars + 7-day
  delta, critical with severity stack, controls passing with violet
  ring gauge + n/240, evidence area sparkline, last-scan cadence),
  12-col grid: 30-day findings flow + severity stack legend +
  top-5 open findings table on the left, product posture rows +
  scan-activity heatmap (5x7) + recent-activity feed on the right.
  Plain USER role drops the KPI rail and the org-wide panels per spec.
* **Charts** — minimal SVG primitives in `components/portal/charts/`:
  Sparkbars, Sparkline (area + line), Ring, StackBar, Heatmap +
  HeatLegend. All token-driven (`var(--sev-*)`, `var(--accent)`).
* **Fixtures** — `src/lib/fixtures.ts` is a TS port of the handoff's
  `data.js`. Deterministic mulberry32 generators give the same
  realistic DACH/EU compliance data every reload (~5 tenants × 30+ days
  activity / 4–13 findings per product / 9 months invoices / hash-
  chained audit). Source of truth for the design until tenant-registry
  is enriched to carry these fields end-to-end. RBAC table (`canAccess`,
  `landingFor`) ported alongside.
* **Dev session bypass** — `src/lib/get-session.ts` returns a synthetic
  `SessionWithExtras` from one of the 6 fixtures when
  `BP_DEV_FIXTURE=<id>` is set. Lets the portal render the design
  without Keycloak + tenant-registry up. Real Auth.js wiring untouched.

What's NOT in yet (next commits):

* Products / Product launch / Org / Team / Billing / Audit / SSO pages
* Workflows editor (palette + canvas + inspector + drag-wiring)
* Command palette + toast system
* MSW handlers for the tenant data shapes (today the page reads the
  fixture module directly server-side; MSW is for client-side calls)

Run locally:
  pnpm install
  BP_DEV_FIXTURE=admin-acme pnpm dev
  open http://acme.localhost:3000/acme/dashboard

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Sharang Parnerkar
2026-06-04 13:29:29 +02:00
parent e387b9a963
commit f3c95123fa
25 changed files with 3552 additions and 252 deletions
+693
View File
@@ -0,0 +1,693 @@
@import "tailwindcss";
/* ============================================================
BREAKPILOT — "The portal is a ledger"
Light paper-white ledger system. Hairlines, corner ticks,
monospace machine values, restrained functional status.
============================================================ */
:root {
/* paper + ink — brand lavender-white / purple-ink */
--paper: oklch(0.976 0.008 300);
--paper-2: oklch(0.958 0.012 300); /* recessed wells */
--surface: oklch(0.995 0.004 300); /* panels */
--ink: oklch(0.24 0.035 295); /* primary text */
--ink-2: oklch(0.45 0.026 295); /* secondary */
--ink-3: oklch(0.6 0.02 297); /* mono metadata / muted */
--ink-4: oklch(0.72 0.015 300); /* faintest */
/* hairlines (purple-tinted) */
--rule: oklch(0.905 0.011 300); /* default hairline */
--rule-2: oklch(0.85 0.014 300); /* stronger */
--rule-3: oklch(0.78 0.018 300); /* heaviest */
/* the single interactive accent — brand violet */
--accent: oklch(0.52 0.23 293);
--accent-2: oklch(0.52 0.23 293 / 0.10);
--accent-ring:oklch(0.52 0.23 293 / 0.32);
/* functional status — low chroma, muted */
--ok: oklch(0.55 0.085 155);
--ok-bg: oklch(0.55 0.085 155 / 0.10);
--warn: oklch(0.62 0.105 70);
--warn-bg:oklch(0.62 0.105 70 / 0.12);
--danger:oklch(0.53 0.15 27);
--danger-bg:oklch(0.53 0.15 27 / 0.10);
--info: oklch(0.5 0.07 240);
/* severity ramp (findings) */
--sev-critical: oklch(0.5 0.16 25);
--sev-high: oklch(0.6 0.13 45);
--sev-medium: oklch(0.64 0.1 75);
--sev-low: oklch(0.6 0.02 260);
--font-sans: var(--font-geist-sans), 'Geist', system-ui, -apple-system, sans-serif;
--font-mono: var(--font-geist-mono), 'Geist Mono', ui-monospace, 'SF Mono', monospace;
--font-serif: var(--font-geist-sans), 'Geist', system-ui, sans-serif;
--rail-w: 232px;
--topbar-h: 48px;
--lifeline-h: 30px;
--shadow-pop: 0 1px 2px oklch(0.2 0.02 260 / 0.04),
0 8px 24px -8px oklch(0.2 0.02 260 / 0.18),
0 2px 8px -4px oklch(0.2 0.02 260 / 0.10);
}
/* ============ DARK LEDGER ============ */
:root[data-theme="dark"] {
--paper: oklch(0.195 0.028 292);
--paper-2: oklch(0.232 0.032 292);
--surface: oklch(0.238 0.032 292);
--ink: oklch(0.94 0.012 300);
--ink-2: oklch(0.75 0.016 300);
--ink-3: oklch(0.6 0.02 300);
--ink-4: oklch(0.48 0.022 300);
--rule: oklch(0.31 0.028 295);
--rule-2: oklch(0.37 0.03 295);
--rule-3: oklch(0.45 0.032 295);
--accent: oklch(0.7 0.2 293);
--accent-2: oklch(0.7 0.2 293 / 0.18);
--accent-ring:oklch(0.7 0.2 293 / 0.42);
--ok: oklch(0.7 0.13 158);
--ok-bg: oklch(0.7 0.13 158 / 0.14);
--warn: oklch(0.76 0.13 75);
--warn-bg:oklch(0.76 0.13 75 / 0.16);
--danger:oklch(0.66 0.17 26);
--danger-bg:oklch(0.66 0.17 26 / 0.15);
--info: oklch(0.68 0.1 240);
--sev-critical: oklch(0.66 0.18 26);
--sev-high: oklch(0.72 0.15 48);
--sev-medium: oklch(0.78 0.12 78);
--sev-low: oklch(0.6 0.02 264);
--shadow-pop: 0 1px 2px oklch(0 0 0 / 0.3),
0 12px 32px -10px oklch(0 0 0 / 0.6),
0 2px 8px -4px oklch(0 0 0 / 0.5);
}
:root[data-theme="dark"] .toast,
:root[data-theme="dark"] .hovercard { background: oklch(0.28 0.01 264); color: var(--ink); border: 1px solid var(--rule-3); }
:root[data-theme="dark"] .hovercard::after { border-top-color: oklch(0.28 0.01 264); }
:root[data-theme="dark"] .hovercard .hc-link { color: var(--accent); }
:root[data-theme="dark"] .brand-mark,
:root[data-theme="dark"] .monogram { background: var(--accent); color: oklch(0.16 0.01 264); }
:root[data-theme="dark"] .btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
:root[data-theme="dark"] .btn-primary:hover { background: oklch(0.64 0.2 293); border-color: oklch(0.64 0.2 293); }
:root { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
html { transition: none; }
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
font-family: var(--font-sans);
background: var(--paper);
color: var(--ink);
font-size: 13px;
line-height: 1.45;
-webkit-font-smoothing: antialiased;
text-rendering: optimizeLegibility;
font-feature-settings: "cv05" 1, "ss01" 1;
}
#root { height: 100%; }
::selection { background: var(--accent-2); }
/* scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--rule-2); border: 3px solid var(--paper); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--rule-3); }
::-webkit-scrollbar-track { background: transparent; }
/* ---------- typographic primitives ---------- */
.mono { font-family: var(--font-mono); font-feature-settings: "zero" 1; }
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-feature-settings: "zero" 1; }
.eyebrow {
font-family: var(--font-mono);
font-size: 10px;
letter-spacing: 0.13em;
text-transform: uppercase;
color: var(--ink-3);
font-weight: 500;
}
.label-micro {
font-family: var(--font-mono);
font-size: 9.5px;
letter-spacing: 0.12em;
text-transform: uppercase;
color: var(--ink-3);
}
h1,h2,h3,h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); }
a { color: inherit; text-decoration: none; }
/* ---------- shell layout ---------- */
.app { display: flex; flex-direction: column; height: 100%; overflow: hidden; }
.app-body { display: flex; flex: 1; min-height: 0; }
/* lifecycle rail (top, full width) */
.lifeline {
height: var(--lifeline-h);
display: flex; align-items: center; gap: 12px;
padding: 0 16px;
border-bottom: 1px solid var(--rule);
background: var(--surface);
font-size: 12px;
flex-shrink: 0;
position: relative;
z-index: 30;
white-space: nowrap; overflow: hidden;
}
.lifeline > span { flex-shrink: 0; }
.lifeline > span.ll-spacer { flex-shrink: 1; }
.lifeline .ll-muted-detail { flex-shrink: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.lifeline .btn { flex-shrink: 0; }
.lifeline .ll-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.lifeline.is-active { }
.lifeline.is-trial { background: var(--warn-bg); border-bottom-color: color-mix(in oklch, var(--warn) 30%, var(--rule)); }
.lifeline.is-frozen { background: var(--danger-bg); border-bottom-color: color-mix(in oklch, var(--danger) 32%, var(--rule)); }
.lifeline.is-demo { background: var(--paper-2); }
.lifeline .ll-spacer { flex: 1; }
.lifeline .ll-strong { font-weight: 600; }
.ll-count { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
/* nav rail */
.rail {
width: var(--rail-w);
flex-shrink: 0;
background: var(--surface);
border-right: 1px solid var(--rule);
display: flex; flex-direction: column;
overflow-y: auto;
}
.rail-head { padding: 14px 14px 10px; }
.brand { display: flex; align-items: center; gap: 9px; }
.brand-mark {
width: 26px; height: 26px; flex-shrink: 0;
background: var(--ink); color: var(--paper);
display: grid; place-items: center;
font-family: var(--font-mono); font-weight: 600; font-size: 13px;
border-radius: 5px;
}
.brand-name { font-weight: 600; font-size: 14px; letter-spacing: -0.02em; }
.brand-sub { font-family: var(--font-mono); font-size: 9.5px; color: var(--ink-3); letter-spacing: 0.06em; }
/* tenant switcher */
.tenant-switch {
margin: 4px 10px 8px;
border: 1px solid var(--rule-2);
border-radius: 7px;
padding: 8px 10px;
display: flex; align-items: center; gap: 9px;
cursor: pointer; background: var(--paper);
position: relative;
}
.tenant-switch:hover { border-color: var(--rule-3); background: var(--surface); }
.tenant-mono {
width: 24px; height: 24px; border-radius: 5px; flex-shrink: 0;
display: grid; place-items: center;
font-family: var(--font-mono); font-size: 11px; font-weight: 600;
background: var(--paper-2); border: 1px solid var(--rule-2); color: var(--ink-2);
}
.tenant-meta { min-width: 0; flex: 1; }
.tenant-meta .tn { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tenant-meta .ts { font-family: var(--font-mono); font-size: 9.5px; color: var(--ink-3); display: flex; align-items: center; gap: 5px; }
/* nav groups */
.nav { padding: 6px 8px 16px; flex: 1; }
.nav-group { margin-top: 14px; }
.nav-group:first-child { margin-top: 4px; }
.nav-group-title { padding: 4px 8px 6px; }
.nav-item {
display: flex; align-items: center; gap: 9px;
padding: 6px 9px; margin: 1px 0;
border-radius: 6px; cursor: pointer;
color: var(--ink-2); font-size: 13px;
position: relative; user-select: none;
white-space: nowrap;
}
.nav-item:hover { background: var(--paper-2); color: var(--ink); }
.nav-item.active { background: var(--paper-2); color: var(--ink); font-weight: 600; }
.nav-item.active::before {
content: ""; position: absolute; left: -8px; top: 50%; transform: translateY(-50%);
width: 2px; height: 16px; background: var(--accent); border-radius: 2px;
}
.nav-item.disabled { color: var(--ink-4); cursor: not-allowed; }
.nav-item.disabled:hover { background: transparent; color: var(--ink-4); }
.nav-ico { width: 15px; display: grid; place-items: center; color: currentColor; opacity: 0.85; flex-shrink: 0; }
.nav-ico svg { width: 15px; height: 15px; display: block; }
.nav-tail { margin-left: auto; font-family: var(--font-mono); font-size: 10px; color: var(--ink-3); }
.nav-lock { margin-left: auto; opacity: 0.6; }
.rail-foot { border-top: 1px solid var(--rule); padding: 9px 12px; }
.user-chip { display: flex; align-items: center; gap: 9px; cursor: pointer; border-radius: 6px; padding: 4px; }
.user-chip:hover { background: var(--paper-2); }
.avatar {
width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
display: grid; place-items: center; font-family: var(--font-mono);
font-size: 10px; font-weight: 600; background: var(--accent-2); color: var(--accent);
border: 1px solid var(--accent-ring);
}
.user-meta { min-width: 0; }
.user-meta .un { font-size: 12px; font-weight: 600; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta .ue { font-family: var(--font-mono); font-size: 9.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* topbar */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.topbar {
height: var(--topbar-h); flex-shrink: 0;
border-bottom: 1px solid var(--rule);
display: flex; align-items: center; gap: 14px;
padding: 0 18px; background: var(--surface);
}
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; white-space: nowrap; }
.crumbs .c-sep { color: var(--ink-4); }
.crumbs .c-cur { font-weight: 600; }
.crumbs .c-prev { color: var(--ink-3); }
.topbar-spacer { flex: 1; }
.cmdk-btn {
display: flex; align-items: center; gap: 8px;
border: 1px solid var(--rule-2); border-radius: 7px;
padding: 5px 9px 5px 11px; color: var(--ink-3);
font-size: 12px; cursor: pointer; background: var(--paper);
}
.cmdk-btn:hover { border-color: var(--rule-3); color: var(--ink-2); }
.kbd {
font-family: var(--font-mono); font-size: 10px;
border: 1px solid var(--rule-2); border-bottom-width: 2px; border-radius: 4px;
padding: 1px 5px; color: var(--ink-3); background: var(--surface); line-height: 1.5;
}
/* content scroll area */
.content { flex: 1; overflow-y: auto; position: relative; }
.content-inner { max-width: 1240px; margin: 0 auto; padding: 22px 26px 64px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 18px; }
.page-title { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }
.page-sub { color: var(--ink-3); font-size: 12.5px; }
.page-head .ph-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
/* ---------- panel / corner-tick bracket ---------- */
.panel {
background: var(--surface);
border: 1px solid var(--rule);
border-radius: 8px;
position: relative;
}
.panel-pad { padding: 16px; }
.panel-head {
display: flex; align-items: center; gap: 10px;
padding: 11px 14px; border-bottom: 1px solid var(--rule);
}
.panel-head .ph-title { font-size: 12px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; }
.panel-head .ph-tail { margin-left: auto; }
/* the distinctive corner ticks — applied to .bracket panels */
.bracket::before, .bracket::after {
content: ""; position: absolute; width: 7px; height: 7px; pointer-events: none;
border-color: var(--ink-3); opacity: 0.55;
}
.bracket::before { top: -1px; left: -1px; border-top: 1.5px solid; border-left: 1.5px solid; border-top-left-radius: 2px; }
.bracket::after { bottom: -1px; right: -1px; border-bottom: 1.5px solid; border-right: 1.5px solid; border-bottom-right-radius: 2px; }
/* ---------- grids ---------- */
.grid { display: grid; gap: 12px; }
.g-12 { grid-template-columns: repeat(12, 1fr); }
.metric-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; background: var(--surface); }
.metric {
padding: 13px 15px 14px; border-right: 1px solid var(--rule);
position: relative;
}
.metric:last-child { border-right: none; }
.metric .m-label { display: flex; align-items: center; gap: 6px; margin-bottom: 9px; }
.metric .m-value { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 25px; font-weight: 500; letter-spacing: -0.02em; line-height: 1; }
.metric .m-value .m-unit { font-size: 13px; color: var(--ink-3); font-weight: 400; margin-left: 3px; }
.metric .m-foot { margin-top: 8px; font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-3); display: flex; align-items: center; gap: 5px; }
.delta-up { color: var(--danger); } /* more findings = bad */
.delta-down { color: var(--ok); }
/* ---------- status dot + pill ---------- */
.dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); }
.dot.danger { background: var(--danger); } .dot.neutral { background: var(--ink-4); }
.dot.accent { background: var(--accent); }
.tag {
display: inline-flex; align-items: center; gap: 5px;
font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.04em;
text-transform: uppercase; color: var(--ink-2);
padding: 1px 0; white-space: nowrap;
}
.sev { font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; letter-spacing: 0.02em; display: inline-flex; align-items: center; gap: 6px; }
.sev .bar { width: 3px; height: 11px; border-radius: 1px; display: inline-block; }
.sev.critical { color: var(--sev-critical); } .sev.critical .bar { background: var(--sev-critical); }
.sev.high { color: var(--sev-high); } .sev.high .bar { background: var(--sev-high); }
.sev.medium { color: var(--sev-medium); } .sev.medium .bar { background: var(--sev-medium); }
.sev.low { color: var(--sev-low); } .sev.low .bar { background: var(--sev-low); }
/* ---------- ledger table ---------- */
.ltable { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.ltable thead th {
text-align: left; font-family: var(--font-mono); font-weight: 500;
font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3);
padding: 8px 14px; border-bottom: 1px solid var(--rule-2); white-space: nowrap;
position: sticky; top: 0; background: var(--surface); z-index: 1;
}
.ltable tbody td { padding: 8px 14px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.ltable tbody tr:last-child td { border-bottom: none; }
.ltable tbody tr { cursor: default; }
.ltable tbody tr.clickable { cursor: pointer; }
.ltable tbody tr.clickable:hover { background: var(--paper-2); }
.ltable td.r, .ltable th.r { text-align: right; }
.ltable td.mono, .ltable .mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.ltable .t-id { font-family: var(--font-mono); color: var(--ink-3); font-size: 11.5px; }
.ltable .t-dim { color: var(--ink-3); }
/* ---------- buttons ---------- */
.btn {
display: inline-flex; align-items: center; gap: 7px;
font-family: var(--font-sans); font-size: 12.5px; font-weight: 500;
padding: 6px 12px; border-radius: 6px; cursor: pointer;
border: 1px solid var(--rule-2); background: var(--surface); color: var(--ink);
white-space: nowrap; transition: background .1s, border-color .1s; flex-shrink: 0;
}
.btn:hover { background: var(--paper-2); border-color: var(--rule-3); }
.btn .btn-ico svg { width: 14px; height: 14px; display: block; }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: oklch(0.46 0.23 293); border-color: oklch(0.46 0.23 293); }
.btn-accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-accent:hover { background: oklch(0.42 0.105 256); }
.btn-sm { padding: 4px 9px; font-size: 12px; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--paper-2); border-color: var(--rule); }
.btn[disabled], .btn.is-disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.btn-danger { color: var(--danger); border-color: color-mix(in oklch, var(--danger) 30%, var(--rule-2)); }
/* frozen write-guard wrapper */
.guard { position: relative; display: inline-flex; }
.guard .btn { opacity: 0.45; cursor: not-allowed; }
.guard .hovercard { display: none; }
.guard:hover .hovercard { display: block; }
.hovercard {
position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
width: 234px; background: var(--ink); color: var(--paper);
border-radius: 7px; padding: 10px 12px; font-size: 11.5px; line-height: 1.5;
box-shadow: var(--shadow-pop); z-index: 50;
}
.hovercard::after { content:""; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); border: 5px solid transparent; border-top-color: var(--ink); }
.hovercard .hc-code { font-family: var(--font-mono); font-size: 10px; color: var(--warn); letter-spacing: 0.04em; }
.hovercard .hc-link { color: #fff; text-decoration: underline; cursor: pointer; }
/* ---------- inputs ---------- */
.input {
font-family: var(--font-sans); font-size: 13px;
padding: 7px 10px; border: 1px solid var(--rule-2); border-radius: 6px;
background: var(--surface); color: var(--ink); width: 100%; outline: none;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.input::placeholder { color: var(--ink-4); }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > label { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
/* ---------- meters ---------- */
.meter { height: 6px; border-radius: 3px; background: var(--paper-2); overflow: hidden; border: 1px solid var(--rule); }
.meter > span { display: block; height: 100%; background: var(--ink-2); }
.meter.warn > span { background: var(--warn); }
.meter.danger > span { background: var(--danger); }
/* ---- control-plane: KPI rail + viz ---- */
.kpi-rail { display: grid; grid-template-columns: repeat(5, 1fr); border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; background: var(--surface); }
.kpi { padding: 12px 14px 13px; border-right: 1px solid var(--rule); display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.kpi:last-child { border-right: none; }
.kpi-top { display: flex; align-items: baseline; gap: 7px; }
.kpi-val { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 25px; font-weight: 500; letter-spacing: -0.02em; line-height: 1; }
.kpi-delta { font-family: var(--font-mono); font-size: 10.5px; white-space: nowrap; }
.kpi-viz { margin-top: auto; }
.kpi-ring { display: flex; align-items: center; gap: 11px; margin-top: auto; }
.posture { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--rule); cursor: pointer; }
.posture:last-child { border-bottom: none; }
.posture:hover { background: var(--paper-2); }
.posture .pname { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.posture .pslug { font-family: var(--font-mono); font-size: 9.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.posture .pspark { flex: 1; min-width: 0; }
.posture .pnum { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 17px; font-weight: 500; text-align: right; line-height: 1; }
.posture .pnl { font-family: var(--font-mono); font-size: 8.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); text-align: right; margin-top: 2px; }
.posture.frow { gap: 11px; }
.sevlegend { display: flex; gap: 13px; margin-top: 11px; flex-wrap: wrap; }
.sevlegend .sl { display: flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 10.5px; }
.sevlegend .sl .sw { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.sevlegend .sl .slc { font-variant-numeric: tabular-nums; font-weight: 600; }
.heatlegend { display: flex; align-items: center; gap: 4px; font-family: var(--font-mono); font-size: 9px; color: var(--ink-3); }
.heatlegend .hc { width: 11px; height: 11px; border-radius: 2.5px; }
/* ---- theme toggle ---- */
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 7px; border: 1px solid var(--rule-2); background: var(--paper); color: var(--ink-2); cursor: pointer; flex-shrink: 0; }
.theme-toggle:hover { border-color: var(--rule-3); color: var(--ink); background: var(--paper-2); }
.theme-toggle svg { width: 15px; height: 15px; }
/* ---------- product cards ---------- */
.product-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.pcard {
background: var(--surface); border: 1px solid var(--rule); border-radius: 8px;
padding: 15px; cursor: pointer; position: relative;
display: flex; flex-direction: column; gap: 13px; min-height: 148px;
transition: border-color .12s, box-shadow .12s, transform .12s;
}
.pcard:hover { border-color: var(--rule-3); box-shadow: var(--shadow-pop); }
.pcard.soon { cursor: default; background: var(--paper-2); border-style: dashed; }
.pcard.soon:hover { box-shadow: none; border-color: var(--rule-2); }
.pcard-top { display: flex; align-items: flex-start; gap: 11px; }
.monogram {
width: 36px; height: 36px; border-radius: 7px; flex-shrink: 0;
display: grid; place-items: center; font-family: var(--font-mono);
font-weight: 600; font-size: 13px; letter-spacing: -0.02em;
background: var(--ink); color: var(--paper);
}
.monogram.soon { background: var(--paper); color: var(--ink-4); border: 1px dashed var(--rule-3); }
.pcard-top .pc-titles { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.pcard-title { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard-slug { font-family: var(--font-mono); font-size: 10px; color: var(--ink-3); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard-stats { display: flex; gap: 18px; margin-top: auto; }
.pstat .ps-v { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 16px; font-weight: 500; }
.pstat .ps-l { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.pcard-cta { position: absolute; top: 15px; right: 15px; color: var(--ink-3); }
.pcard:hover .pcard-cta { color: var(--accent); }
/* activity feed */
.feed { display: flex; flex-direction: column; }
.feed-row { display: flex; gap: 11px; padding: 9px 14px; border-bottom: 1px solid var(--rule); align-items: baseline; }
.feed-row:last-child { border-bottom: none; }
.feed-time { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-3); width: 64px; flex-shrink: 0; }
.feed-body { font-size: 12.5px; flex: 1; }
.feed-body .fa { font-weight: 600; }
.feed-body .ft { color: var(--ink-2); }
.feed-prod { font-family: var(--font-mono); font-size: 9.5px; color: var(--ink-3); flex-shrink: 0; }
/* ---------- modal / palette ---------- */
.scrim { position: fixed; inset: 0; background: oklch(0.2 0.02 260 / 0.32); z-index: 100; display: grid; }
.scrim.center { place-items: center; }
.scrim.top { place-items: start center; padding-top: 12vh; }
.modal { background: var(--surface); border: 1px solid var(--rule-2); border-radius: 10px; box-shadow: var(--shadow-pop); width: 480px; max-width: calc(100vw - 32px); overflow: hidden; }
.modal-head { padding: 15px 18px; border-bottom: 1px solid var(--rule); display: flex; align-items: center; gap: 10px; }
.modal-title { font-size: 14px; font-weight: 600; white-space: nowrap; }
.modal-body { padding: 18px; }
.modal-foot { padding: 13px 18px; border-top: 1px solid var(--rule); display: flex; gap: 8px; justify-content: flex-end; background: var(--paper-2); }
/* command palette */
.cmdk { width: 560px; }
.cmdk-input-wrap { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--rule); }
.cmdk-input { border: none; outline: none; background: transparent; font-size: 15px; flex: 1; color: var(--ink); font-family: var(--font-sans); }
.cmdk-input::placeholder { color: var(--ink-4); }
.cmdk-list { max-height: 52vh; overflow-y: auto; padding: 6px; }
.cmdk-section { padding: 9px 10px 4px; }
.cmdk-item { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 7px; cursor: pointer; }
.cmdk-item.sel { background: var(--paper-2); }
.cmdk-item .ci-mono { width: 22px; height: 22px; border-radius: 5px; display: grid; place-items: center; font-family: var(--font-mono); font-size: 10px; font-weight: 600; background: var(--paper-2); border: 1px solid var(--rule-2); color: var(--ink-2); flex-shrink: 0; }
.cmdk-item .ci-title { font-size: 13px; flex: 1; }
.cmdk-item .ci-kind { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-4); }
.cmdk-item.sel .ci-kind { color: var(--ink-3); }
.cmdk-foot { display: flex; gap: 14px; padding: 9px 16px; border-top: 1px solid var(--rule); font-family: var(--font-mono); font-size: 10px; color: var(--ink-3); }
.cmdk-foot .cf { display: flex; align-items: center; gap: 5px; }
/* toast */
.toasts { position: fixed; bottom: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--ink); color: var(--paper); border-radius: 8px; padding: 11px 14px; font-size: 12.5px; box-shadow: var(--shadow-pop); max-width: 340px; display: flex; gap: 10px; align-items: flex-start; animation: toastin .18s ease; }
.toast .t-code { font-family: var(--font-mono); font-size: 10px; color: var(--warn); }
@keyframes toastin { from { opacity: 0; transform: translateY(8px); } }
/* ---------- login ---------- */
.login { height: 100%; display: grid; grid-template-columns: 1.05fr 1fr; background: var(--paper); }
.login-left { padding: 48px 56px; display: flex; flex-direction: column; border-right: none; color: #fff; background: linear-gradient(165deg, oklch(0.57 0.2 288), oklch(0.42 0.2 297) 94%); }
.login-left .brand-name { color: #fff; }
.login-left .brand-name::after { color: #fff; }
.login-left .brand-sub { color: rgba(255,255,255,0.6); }
.login-left .brand-mark { background: #fff; color: var(--accent); }
.login-left .login-hero h1 { color: #fff; }
.login-left .login-hero p { color: rgba(255,255,255,0.85); }
.login-left .login-meta .lm { color: rgba(255,255,255,0.74); }
.login-left .login-meta .lm .lk { color: rgba(255,255,255,0.5); }
.login-left .eyebrow { color: rgba(255,255,255,0.58); }
.brand-name::after { content: "."; color: var(--accent); }
.login-right { padding: 48px 56px; display: flex; flex-direction: column; justify-content: center; background: var(--surface); }
.login-brand { display: flex; align-items: center; gap: 11px; margin-bottom: auto; }
.login-hero h1 { font-size: 30px; letter-spacing: -0.03em; line-height: 1.1; max-width: 440px; }
.login-hero p { color: var(--ink-2); max-width: 400px; margin-top: 14px; font-size: 14px; }
.login-meta { margin-top: 28px; display: flex; flex-direction: column; gap: 7px; }
.login-meta .lm { display: flex; align-items: baseline; gap: 10px; font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); }
.login-meta .lm .lk { color: var(--ink-4); width: 92px; }
.fixture-list { display: flex; flex-direction: column; gap: 8px; max-width: 460px; width: 100%; }
.fixture {
border: 1px solid var(--rule-2); border-radius: 8px; padding: 12px 14px;
display: flex; align-items: center; gap: 13px; cursor: pointer; background: var(--surface);
transition: border-color .1s, background .1s; text-align: left; width: 100%;
}
.fixture:hover { border-color: var(--accent); background: var(--paper-2); }
.fixture-mono { width: 34px; height: 34px; border-radius: 6px; display: grid; place-items: center; font-family: var(--font-mono); font-size: 12px; font-weight: 600; flex-shrink: 0; background: var(--paper-2); border: 1px solid var(--rule-2); }
.fixture-main { flex: 1; min-width: 0; }
.fixture-email { font-family: var(--font-mono); font-size: 12.5px; font-weight: 500; }
.fixture-show { font-size: 11px; color: var(--ink-3); margin-top: 1px; }
.fixture-state { display: flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); flex-shrink: 0; }
.fixture-roles { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
.role-chip { font-family: var(--font-mono); font-size: 8.5px; letter-spacing: 0.06em; padding: 1px 5px; border: 1px solid var(--rule-2); border-radius: 3px; color: var(--ink-3); }
/* ---------- watermark (demo) ---------- */
.watermark { position: fixed; inset: 0; pointer-events: none; z-index: 80; overflow: hidden; opacity: 0.05; }
.watermark::before {
content: "SANDBOX · DEMO · SANDBOX · DEMO · SANDBOX · DEMO · SANDBOX · DEMO · ";
position: absolute; top: -20%; left: -20%; width: 160%; height: 160%;
font-family: var(--font-mono); font-size: 30px; font-weight: 700; letter-spacing: 0.1em;
line-height: 2.4; word-spacing: 6px; color: var(--ink);
transform: rotate(-24deg); white-space: pre-wrap;
}
/* ---------- archived lockout / error pages ---------- */
.lockout { height: 100%; display: grid; place-items: center; background: var(--paper); padding: 24px; }
.lockout-card { width: 560px; max-width: 100%; }
.lockout-rule { height: 1px; background: var(--rule-2); margin: 22px 0; }
.error-page { height: 100%; display: grid; place-items: center; }
.error-code { font-family: var(--font-mono); font-size: 84px; font-weight: 600; letter-spacing: -0.04em; line-height: 1; }
/* ---------- misc layout helpers ---------- */
.row { display: flex; align-items: center; gap: 10px; }
.col { display: flex; flex-direction: column; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--ink-3); }
.divider { height: 1px; background: var(--rule); }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; align-items: baseline; }
.dl dt { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.dl dd { margin: 0; font-size: 13px; }
.dl dd.mono { font-family: var(--font-mono); font-size: 12px; }
.kv-list { display: flex; flex-direction: column; }
.kv { display: flex; justify-content: space-between; align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--rule); }
.kv:last-child { border-bottom: none; }
.kv .kvk { color: var(--ink-2); font-size: 12.5px; }
.kv .kvv { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 12.5px; }
.span-7 { grid-column: span 7; } .span-5 { grid-column: span 5; }
.span-8 { grid-column: span 8; } .span-4 { grid-column: span 4; }
.span-6 { grid-column: span 6; } .span-12 { grid-column: span 12; }
@media (max-width: 920px) {
.login { grid-template-columns: 1fr; }
.login-left { display: none; }
.metric-row { grid-template-columns: repeat(2, 1fr); }
.metric:nth-child(2) { border-right: none; }
.kpi-rail { grid-template-columns: repeat(3, 1fr); }
.kpi:nth-child(3) { border-right: none; }
.product-grid { grid-template-columns: 1fr; }
}
/* ============ WORKFLOWS / FLOW EDITOR ============ */
.flow { height: 100%; display: flex; min-height: 0; background: var(--paper); overflow: hidden; }
/* palette */
.flow-palette { width: 234px; flex-shrink: 0; border-right: 1px solid var(--rule); background: var(--surface); display: flex; flex-direction: column; }
.flow-pal-head { padding: 12px 14px 10px; border-bottom: 1px solid var(--rule); display: flex; flex-direction: column; gap: 3px; }
.flow-pal-body { flex: 1; overflow-y: auto; padding: 8px 10px 20px; }
.ptree-group { margin-bottom: 5px; }
.ptree-title { display: flex; align-items: center; gap: 7px; padding: 6px; cursor: pointer; font-size: 11.5px; font-weight: 600; color: var(--ink-2); border-radius: 6px; user-select: none; white-space: nowrap; }
.ptree-title:hover { background: var(--paper-2); }
.ptree-title .dot { width: 6px; height: 6px; }
.ptree-count { margin-left: auto; font-family: var(--font-mono); font-size: 9.5px; color: var(--ink-3); }
.pitem { display: flex; align-items: center; gap: 9px; padding: 7px 9px; margin: 3px 0 3px 16px; border: 1px solid var(--rule-2); border-radius: 7px; cursor: grab; background: var(--paper); user-select: none; }
.pitem:hover { border-color: var(--accent); background: var(--paper-2); }
.pitem:active { cursor: grabbing; }
.pitem-mono { width: 18px; text-align: center; font-family: var(--font-mono); font-size: 12px; flex-shrink: 0; }
.pitem-name { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* canvas */
.flow-canvas-wrap { flex: 1; position: relative; overflow: hidden; cursor: grab; min-width: 0; }
.flow-canvas-wrap:active { cursor: grabbing; }
.flow-grid { position: absolute; inset: 0; background-image: radial-gradient(var(--rule-2) 1.1px, transparent 1.1px); pointer-events: none; opacity: 0.75; }
.flow-layer { position: absolute; top: 0; left: 0; transform-origin: 0 0; }
/* toolbar */
.flow-toolbar { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; z-index: 6; pointer-events: none; }
.flow-toolbar > * { pointer-events: auto; }
.ft-name { display: flex; align-items: center; gap: 9px; background: var(--surface); border: 1px solid var(--rule-2); border-radius: 8px; padding: 6px 12px; box-shadow: var(--shadow-pop); min-width: 0; }
.ft-name .dot { width: 7px; height: 7px; flex-shrink: 0; }
.ft-input { border: none; outline: none; background: transparent; font-family: var(--font-sans); font-size: 13px; font-weight: 600; color: var(--ink); width: 220px; min-width: 60px; }
.ft-meta { font-size: 10px; color: var(--ink-3); border-left: 1px solid var(--rule); padding-left: 9px; white-space: nowrap; flex-shrink: 0; }
.flow-toolbar .row { background: var(--surface); border: 1px solid var(--rule-2); border-radius: 8px; padding: 5px 6px; box-shadow: var(--shadow-pop); }
.flow-zoom { position: absolute; bottom: 14px; right: 14px; z-index: 6; display: flex; align-items: center; gap: 2px; background: var(--surface); border: 1px solid var(--rule-2); border-radius: 8px; padding: 3px; box-shadow: var(--shadow-pop); }
.flow-zoom button { width: 26px; height: 26px; border: none; background: transparent; color: var(--ink-2); border-radius: 6px; cursor: pointer; display: grid; place-items: center; font-family: var(--font-mono); font-size: 14px; }
.flow-zoom button:hover { background: var(--paper-2); color: var(--ink); }
.flow-zoom span { font-size: 10.5px; color: var(--ink-3); width: 40px; text-align: center; }
/* wires */
.flow-wires { z-index: 1; }
.wire { fill: none; stroke: var(--ink-3); stroke-width: 1.6; cursor: pointer; vector-effect: non-scaling-stroke; }
.wire:hover { stroke: var(--ink-2); stroke-width: 2.4; }
.wire.sel { stroke: var(--accent); stroke-width: 2.6; }
.wire.pending { stroke: var(--accent); stroke-dasharray: 4 3; pointer-events: none; }
.wire.run { stroke: var(--accent); stroke-width: 2.6; stroke-dasharray: 5 4; animation: wireflow 0.5s linear infinite; }
@keyframes wireflow { to { stroke-dashoffset: -18; } }
/* node */
.fnode { position: absolute; background: var(--surface); border: 1px solid var(--rule-2); border-radius: 9px; box-shadow: 0 1px 2px oklch(0.2 0.04 290 / 0.05), 0 6px 16px -10px oklch(0.2 0.04 290 / 0.32); cursor: grab; user-select: none; z-index: 2; }
.fnode:hover { border-color: var(--rule-3); }
.fnode.sel { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring), 0 10px 24px -10px oklch(0.2 0.04 290 / 0.42); z-index: 3; }
.fnode.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.fnode-head { display: flex; align-items: center; gap: 8px; padding: 9px 11px 7px; }
.fnode-mono { width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid var(--ink-3); display: grid; place-items: center; font-family: var(--font-mono); font-size: 11px; font-weight: 600; flex-shrink: 0; background: var(--paper); }
.fnode-title { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.fnode-body { font-family: var(--font-mono); font-size: 10px; color: var(--ink-3); padding: 0 11px 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* ports */
.fport { position: absolute; width: 11px; height: 11px; border-radius: 50%; background: var(--surface); border: 1.5px solid var(--ink-3); cursor: crosshair; z-index: 4; transition: transform .1s; }
.fport.in { left: -6px; }
.fport.out { right: -6px; border-color: var(--ink-2); }
.fport.out.neg { border-color: var(--danger); }
.fport:hover { border-color: var(--accent); background: var(--accent); transform: scale(1.25); }
.fport-lbl { position: absolute; top: 50%; transform: translateY(-50%); font-family: var(--font-mono); font-size: 7.5px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; pointer-events: none; }
.fport-lbl.in { left: 13px; }
.fport-lbl.out { right: 13px; }
/* inspector */
.flow-inspector { width: 286px; flex-shrink: 0; border-left: 1px solid var(--rule); background: var(--surface); display: flex; flex-direction: column; }
.flow-insp-head { display: flex; align-items: center; gap: 10px; padding: 13px 15px; border-bottom: 1px solid var(--rule); }
.flow-insp-head > div { flex: 1; min-width: 0; }
.fi-title { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flow-insp-body { flex: 1; overflow-y: auto; padding: 15px; }
.flow-insp-foot { padding: 12px 15px; border-top: 1px solid var(--rule); }
.flow-insp-empty { padding: 18px 16px; }
.flow-legend { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.flow-legend .fl { display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-2); }
.flow-legend .fl .dot { width: 7px; height: 7px; }
/* toggle switch */
.fswitch { width: 32px; height: 18px; border-radius: 10px; border: 1px solid var(--rule-2); background: var(--paper-2); position: relative; cursor: pointer; padding: 0; flex-shrink: 0; transition: background .12s; }
.fswitch span { position: absolute; top: 1.5px; left: 1.5px; width: 13px; height: 13px; border-radius: 50%; background: var(--ink-3); transition: transform .12s, background .12s; }
.fswitch.on { background: var(--accent); border-color: var(--accent); }
.fswitch.on span { transform: translateX(14px); background: #fff; }
/* palette-drag ghost */
.flow-ghost { position: fixed; z-index: 200; pointer-events: none; display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--accent); border-radius: 8px; padding: 7px 11px 7px 8px; font-size: 12.5px; font-weight: 600; box-shadow: var(--shadow-pop); transform: translate(-50%, -50%); opacity: 0.96; }
.flow-ghost .fnode-mono { width: 20px; height: 20px; }