feat(board): v2 glass design system css

This commit is contained in:
chahinebrini 2026-07-20 17:23:54 +02:00
parent a34d0ea870
commit 4c46e361a9
2 changed files with 507 additions and 0 deletions

491
src/server/board/styles.ts Normal file
View File

@ -0,0 +1,491 @@
/**
* Board v2 design system: glass dashboard on a deep gradient.
* Everything is emitted by boardV2Css() and inlined into the page <style>.
*
* Naming: `b2-` prefix for new v2 components (header, kpis, sidebar tabs,
* feed, splash, progress ring). Interaction-critical components ported from
* v1 (cards, columns, console, modals, toasts, budget internals) keep their
* v1 class names so the ported client JS keeps working unchanged they read
* the same CSS variables, which are redefined here with the v2 glass values.
*/
export function boardV2Css(): string {
return `
:root {
/* v2 tokens */
--b2-bg: #090c18;
--b2-surface: rgba(255,255,255,.045);
--b2-raised: rgba(255,255,255,.055);
--b2-border: rgba(255,255,255,.09);
--b2-text: #eef1f8;
--b2-muted: #8fa0c6;
--b2-dim: #5b6a8c;
--b2-accent: #38bdf8;
--b2-violet: #8b5cf6;
--b2-green: #34d399;
--b2-amber: #fbbf24;
--b2-open: #8b949e;
/* v1 aliases (ported components read these) */
--bg: var(--b2-bg);
--surface: var(--b2-surface);
--raised: var(--b2-raised);
--border: var(--b2-border);
--text: var(--b2-text);
--muted: var(--b2-muted);
--accent: var(--b2-accent);
--green: var(--b2-green);
--open: #8B949E;
--in_progress: #38bdf8;
--review: #fbbf24;
--done: #34d399;
--cancelled: #6E7681;
--danger: #F85149;
--mono: ui-monospace, "JetBrains Mono", SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
--sans: system-ui, "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; height: 100%; scrollbar-gutter: stable; }
html { overflow: hidden; }
body {
background: radial-gradient(140% 120% at 15% -10%, #1c2547 0%, #0e1226 50%, #090c18 100%) fixed;
color: var(--text);
font: 15px/1.5 var(--sans);
height: 100vh;
overflow: hidden;
padding: 84px 22px 18px;
display: flex;
flex-direction: column;
}
button, a, .card { cursor: pointer; }
a { color: inherit; text-decoration: none; }
a:focus-visible, .card:focus-visible {
outline: 2px solid var(--accent);
outline-offset: 3px;
}
/* ── Keyframes (v2) ───────────────────────────────────────────────── */
@keyframes b2-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes b2-fill { from { width: 0; } }
@keyframes b2-ping { 0% { box-shadow: 0 0 0 0 rgba(52,211,179,.55); } 70% { box-shadow: 0 0 0 7px rgba(52,211,179,0); } 100% { box-shadow: 0 0 0 0 rgba(52,211,179,0); } }
@keyframes b2-blink { 50% { opacity: .3; } }
@keyframes b2-draw { to { stroke-dashoffset: 0; } }
/* ── Header ───────────────────────────────────────────────────────── */
.b2-hdr {
position: fixed; top: 0; left: 0; right: 0; z-index: 40;
display: flex; align-items: center; gap: 14px;
min-height: 66px; padding: 10px 22px;
border-bottom: 1px solid rgba(255,255,255,.06);
background: rgba(9, 12, 24, .82);
backdrop-filter: blur(12px);
}
.b2-brand { display: flex; align-items: center; gap: 10px; font-size: 16px; }
.b2-brand b { font-weight: 700; letter-spacing: .01em; }
.b2-logo-img { display: block; }
.b2-proj {
display: flex; align-items: center; gap: 5px;
color: var(--b2-muted); font-size: 13px; font-family: var(--mono);
padding: 4px 10px; border-radius: 8px; border: 1px solid transparent;
max-width: 34vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.b2-proj:hover { background: rgba(255,255,255,.05); border-color: var(--b2-border); color: #c6d0e8; }
.b2-chev { font-size: 9px; opacity: .7; }
.b2-nav { display: flex; align-items: center; gap: 2px; margin-left: 8px;
border: 1px solid var(--b2-border); background: var(--b2-surface);
padding: 3px; border-radius: 9px; }
.b2-nav b, .b2-nav a {
min-height: 32px; display: inline-flex; align-items: center;
padding: 0 13px; border-radius: 7px; font-size: 13px; font-weight: 500;
color: var(--b2-muted); transition: color 160ms ease, background 160ms ease;
}
.b2-nav b { color: var(--b2-text); background: rgba(255,255,255,.08); font-weight: 600; }
.b2-nav a:hover { color: var(--b2-text); background: rgba(255,255,255,.05); }
.b2-hdr-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.b2-btn {
display: inline-flex; align-items: center; gap: 7px;
min-height: 36px; padding: 0 16px; border: 0; border-radius: 9px;
background: linear-gradient(135deg, #6366f1, #8b5cf6);
color: #fff; font: 600 13px/1 var(--sans);
box-shadow: 0 4px 18px rgba(99,102,241,.28);
transition: transform 120ms ease, box-shadow 160ms ease, filter 160ms ease;
}
.b2-btn:hover { filter: brightness(1.1); box-shadow: 0 6px 22px rgba(99,102,241,.38); }
.b2-btn:active { transform: translateY(1px); }
.b2-live-dot {
width: 9px; height: 9px; border-radius: 50%;
background: var(--b2-green); animation: b2-ping 2s infinite;
}
/* v1 JS toggles stale/down states on the wrapper — keep hooks compatible */
.sse-status { display: inline-flex; align-items: center; gap: 7px; color: var(--b2-muted); font: 12px/1 var(--mono); }
.sse-status.stale .b2-live-dot { background: var(--b2-amber); animation: none; }
.sse-status.down .b2-live-dot { background: var(--danger); animation: none; }
/* ── Layout ───────────────────────────────────────────────────────── */
.b2-body {
display: grid; grid-template-columns: minmax(0, 1fr) minmax(290px, 330px);
gap: 16px; min-height: 0; flex: 1 1 auto; align-items: start;
}
.b2-main { min-width: 0; display: flex; flex-direction: column; gap: 14px; min-height: 0; height: 100%; }
.b2-glass {
background: var(--b2-surface);
border: 1px solid var(--b2-border);
border-radius: 14px;
}
/* ── KPI row ──────────────────────────────────────────────────────── */
.b2-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; flex: 0 0 auto; }
.b2-kpi { padding: 12px 15px; position: relative; overflow: hidden; animation: b2-rise .6s both; }
.b2-kpi:nth-child(2) { animation-delay: .07s; }
.b2-kpi:nth-child(3) { animation-delay: .14s; }
.b2-kpi:nth-child(4) { animation-delay: .21s; }
.b2-lbl { color: var(--b2-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; }
.b2-val { font-size: 26px; font-weight: 700; margin-top: 3px; font-family: var(--mono); }
.b2-val small { font-size: 13px; color: var(--b2-muted); font-weight: 500; }
.b2-miniarea { margin-top: 8px; }
.b2-spark { stroke-dasharray: 400; stroke-dashoffset: 400; animation: b2-draw 1.6s .3s forwards ease-out; }
.b2-chips { display: flex; gap: 6px; margin-top: 10px; align-items: center; flex-wrap: wrap; min-height: 24px; }
.b2-achip {
display: inline-flex; align-items: center; gap: 5px;
font: 11px/1 var(--mono); padding: 3px 9px 3px 4px;
border-radius: 999px; border: 1px solid rgba(255,255,255,.12);
background: rgba(255,255,255,.05); color: var(--b2-text);
}
.b2-achip i {
width: 16px; height: 16px; border-radius: 50%;
display: inline-flex; align-items: center; justify-content: center;
font-style: normal; font-size: 9px; font-weight: 800; color: #0e1226;
}
.b2-achip.b2-more { padding: 3px 9px; color: var(--b2-muted); }
.b2-cdot { width: 6px; height: 6px; border-radius: 50%; background: var(--b2-green); animation: b2-blink 1.6s infinite; }
.b2-cap-r { text-align: right; font-size: 11px; color: var(--b2-muted); margin: 8px 0 3px; font-family: var(--mono); }
.b2-pbar { height: 5px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; }
.b2-pbar i { display: block; height: 100%; border-radius: 999px;
background: linear-gradient(90deg, #34d399, #10b981);
animation: b2-fill 1.3s .4s both; transition: width 600ms ease; }
/* value-change pulse (ported behaviour, new look) */
.b2-kpi.metric-flash { animation: metricFlash 900ms ease; }
@keyframes metricFlash {
0% { background: rgba(56,189,248,.14); box-shadow: 0 0 0 2px rgba(56,189,248,.35); }
100% { background: var(--b2-surface); box-shadow: 0 0 0 0 rgba(56,189,248,0); }
}
/* ── Board columns & task cards (ported v1, glass look) ───────────── */
.board {
display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 12px; align-items: stretch; min-width: 0; min-height: 0; height: 100%;
}
.column {
min-width: 0; background: var(--b2-surface); border: 1px solid var(--b2-border);
border-radius: 14px; padding: 12px; min-height: 0;
display: flex; flex-direction: column;
}
.col-head { display: flex; align-items: center; gap: 8px; padding: 0 2px 11px; }
.col-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.col-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; color: var(--b2-muted); }
.col-count { margin-left: auto; min-width: 26px; text-align: center; border-radius: 999px;
padding: 1px 9px; background: rgba(255,255,255,.08); color: var(--b2-muted); font: 12px/1.5 var(--mono); }
.column[data-column="open"] .col-dot { background: var(--open); }
.column[data-column="in_progress"] .col-dot { background: var(--in_progress); }
.column[data-column="review"] .col-dot { background: var(--review); }
.column[data-column="done"] .col-dot { background: var(--done); }
.column[data-column="cancelled"] .col-dot { background: var(--cancelled); }
.cards {
display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
gap: 10px; min-width: 0; min-height: 0; overflow-y: auto;
overscroll-behavior: contain; padding: 2px 4px 2px 2px;
align-items: start; scrollbar-gutter: stable;
}
.card {
min-width: 0; max-width: 100%; overflow: hidden;
background: var(--b2-raised); border: 1px solid var(--b2-border);
border-left: 3px solid var(--accent); border-radius: 11px;
padding: 10px 12px; min-height: 142px;
display: flex; flex-direction: column; user-select: none;
transition: border-color 180ms ease, background 180ms ease, transform 180ms ease, box-shadow 180ms ease, min-height 200ms ease;
}
.card:hover { border-color: rgba(56,189,248,.4); background: rgba(255,255,255,.075); transform: translateY(-1px); box-shadow: 0 12px 28px rgba(2,6,18,.3); }
.column[data-column="open"] .card { border-left-color: var(--open); }
.column[data-column="in_progress"] .card { border-left-color: var(--in_progress); }
.column[data-column="review"] .card { border-left-color: var(--review); }
.column[data-column="done"] .card { border-left-color: var(--done); }
.column[data-column="cancelled"] .card { border-left-color: var(--cancelled); }
.card.b2-working { border-color: rgba(56,189,248,.35); box-shadow: 0 0 22px rgba(56,189,248,.08); }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 5px; }
.id { color: var(--b2-accent); font: 11px/1.3 var(--mono); white-space: nowrap; opacity: .85; }
.title { margin: 0 0 8px; font-weight: 650; font-size: 13.5px; line-height: 1.35;
overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.meta-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.pill, .badge {
display: inline-flex; align-items: center; gap: 5px; min-height: 22px;
border-radius: 999px; padding: 2px 8px;
border: 1px solid rgba(148,163,184,.25); background: rgba(148,163,184,.08);
color: var(--b2-muted); font: 11px/1.2 var(--mono); white-space: nowrap;
}
.status-pill { color: var(--text); }
.status-open { border-color: rgba(139,148,158,.38); color: var(--open); }
.status-in_progress { border-color: rgba(56,189,248,.42); color: var(--in_progress); background: rgba(56,189,248,.10); }
.status-review { border-color: rgba(251,191,36,.42); color: var(--review); background: rgba(251,191,36,.10); }
.status-done { border-color: rgba(52,211,153,.40); color: var(--done); background: rgba(52,211,153,.10); }
.status-cancelled { border-color: rgba(110,118,129,.45); color: var(--cancelled); }
.project-tag { color: var(--accent); border-color: rgba(56,189,248,.30); background: rgba(56,189,248,.08); }
.timer-badge { color: var(--text); background: rgba(255,255,255,.05); }
.avatar {
display: inline-flex; align-items: center; gap: 6px; min-height: 24px; max-width: 100%;
padding: 2px 8px 2px 3px; border-radius: 999px;
border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.05);
color: var(--text); font: 11px/1.2 var(--mono);
}
.avatar-core { width: 18px; height: 18px; border-radius: 50%; display: inline-grid; place-items: center;
background: var(--agent-color); color: #0e1226; font-size: 9px; font-weight: 800; }
.avatar.architect { box-shadow: 0 0 0 2px rgba(217,119,87,.24); }
.avatar-label { overflow: hidden; text-overflow: ellipsis; max-width: 120px; }
.reviewer-wrap { display: inline-flex; align-items: center; gap: 5px; min-width: 0; max-width: 100%; }
.reviewer-label { color: var(--review); font: 10px/1.2 var(--mono); white-space: nowrap; }
.empty { color: var(--b2-muted); font-size: 12px; padding: 4px 2px; }
/* ── Progress ring (in-progress cards) ────────────────────────────── */
.b2-ring { display: inline-flex; align-items: center; gap: 7px; margin-top: 8px; }
.b2-ring svg { display: block; transform: rotate(-90deg); }
.b2-ring-track { fill: none; stroke: rgba(255,255,255,.09); }
.b2-ring-fill { fill: none; stroke: var(--in_progress); stroke-linecap: round;
transition: stroke-dashoffset 900ms cubic-bezier(.2,.7,.2,1), stroke 300ms ease; }
.b2-ring.b2-over .b2-ring-fill { stroke: var(--b2-amber); }
.b2-ring-time { font: 11px/1 var(--mono); color: var(--b2-muted); }
.b2-ring.b2-over .b2-ring-time { color: var(--b2-amber); }
/* ── Card delete affordance ───────────────────────────────────────── */
.card-top-right { display: flex; align-items: center; gap: 6px; }
.card-del { width: 24px; height: 24px; flex: 0 0 auto; display: inline-grid; place-items: center;
border-radius: 7px; border: 1px solid transparent; background: transparent; color: var(--b2-muted);
line-height: 1; cursor: pointer; opacity: 0; transition: opacity 140ms, color 140ms, border-color 140ms, background 140ms; }
.card:hover .card-del, .card:focus-within .card-del { opacity: 1; }
.card-del:hover { color: #fca5a5; border-color: rgba(239,68,68,.5); background: rgba(239,68,68,.12); }
/* ── In-card live console (ported) ────────────────────────────────── */
.card-console-wrap { margin-top: 9px; }
.card:has(.card-console:not([hidden])) { min-height: 230px; }
.card-console-toggle { display: inline-flex; align-items: center; gap: 6px;
background: transparent; border: 1px solid var(--b2-border); color: var(--b2-muted);
font: 700 10px/1 var(--mono); text-transform: uppercase; letter-spacing: .05em;
padding: 4px 9px; border-radius: 6px; cursor: pointer; transition: color 140ms, border-color 140ms; }
.card-console-toggle:hover { color: var(--text); border-color: var(--b2-muted); }
.card-console-toggle[aria-expanded="true"] { color: var(--in_progress); border-color: rgba(56,189,248,.4); }
.card-console-toggle .cc-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--in_progress);
box-shadow: 0 0 0 3px rgba(56,189,248,.16); animation: ccPulse 1.6s ease-in-out infinite; }
.card-console-toggle .cc-chevron { font-size: 9px; opacity: .75; }
@keyframes ccPulse { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }
.card-console { margin-top: 7px; }
.card-console[hidden] { display: none; }
.card-console-body { max-height: 180px; overflow-y: auto; background: rgba(0,0,0,.28);
border: 1px solid var(--b2-border); border-radius: 8px; padding: 8px 10px;
font: 11px/1.55 var(--mono); color: #cbd5e1; }
.cc-line { display: flex; gap: 8px; white-space: pre-wrap; overflow-wrap: anywhere; padding: 1px 0; }
.cc-line .cc-ts { color: var(--b2-muted); opacity: .8; flex: 0 0 auto; }
.cc-line .cc-agent { color: var(--accent); font-weight: 600; flex: 0 0 auto; }
.cc-line.level-error .cc-text { color: #fca5a5; }
.cc-line.level-warn .cc-text { color: #fcd34d; }
.cc-line.level-bridge .cc-text { color: #c4b5fd; }
.cc-empty { color: var(--b2-muted); font-style: italic; }
/* ── Drag & drop (ported) ─────────────────────────────────────────── */
.card { touch-action: none; }
.card.dragging { opacity: .5; cursor: grabbing; transform: scale(.98) rotate(-1deg); }
.card.flash { animation: cardFlash 900ms ease; }
@keyframes cardFlash {
0% { border-color: var(--green); box-shadow: 0 0 0 2px rgba(52,211,153,.4); }
100% { border-color: var(--b2-border); box-shadow: none; }
}
/* Enter animation only on genuinely new card nodes — NOT every rerender. */
.card-new { animation: cardEnter 240ms cubic-bezier(.2,.7,.2,1); }
@keyframes cardEnter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.column.drop-active { border-color: var(--accent); background: rgba(56,189,248,.07); box-shadow: 0 0 0 1px rgba(56,189,248,.4) inset; }
.column.drop-active .col-head { color: var(--accent); }
.column .cards.drop-hover { outline: 1px dashed rgba(56,189,248,.5); outline-offset: 3px; border-radius: 6px; }
.card.drop-active { border-color: var(--green); background: rgba(52,211,153,.09); box-shadow: 0 0 0 2px rgba(52,211,153,.45); transform: translateY(-1px); }
/* ── Sidebar ──────────────────────────────────────────────────────── */
.b2-side { display: flex; flex-direction: column; gap: 12px; min-width: 0;
position: sticky; top: 84px; max-height: calc(100vh - 102px); overflow-y: auto; }
.b2-panel { padding: 13px 15px; }
.b2-panel h6 { margin: 0; font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--b2-muted); }
.b2-tabhead { display: flex; align-items: center; gap: 8px; }
.b2-otabs, .b2-stabs { display: flex; gap: 4px; }
.b2-otabs { margin-left: auto; }
.b2-otabs button, .b2-stabs button {
min-height: 26px; padding: 0 10px; border-radius: 999px; cursor: pointer;
border: 1px solid transparent; background: transparent;
color: var(--b2-muted); font: 600 11px/1 var(--sans);
transition: color 140ms, background 140ms, border-color 140ms;
}
.b2-otabs button.active, .b2-stabs button.active {
color: var(--b2-text); background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.14);
}
.b2-subhead { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.b2-subhead .seg { margin-left: auto; }
[data-opane] { margin-top: 10px; }
[data-opane][hidden] { display: none; }
.b2-chart-tip { color: var(--b2-muted); font-size: 11px; text-align: right; margin-top: 5px; font-family: var(--mono); }
/* Budget internals (ported v1: seg, reset, donuts, legend, agent bars) */
.budget-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.budget-head .est-note { color: var(--b2-muted); font-size: 11px; }
.budget-head .total { margin-left: auto; font: 700 14px/1 var(--mono); color: var(--text); }
.budget-head .total small { color: var(--b2-muted); font-weight: 400; }
.seg { display: inline-flex; align-items: center; gap: 2px; padding: 3px;
border: 1px solid var(--b2-border); border-radius: 8px; background: rgba(0,0,0,.2); }
.seg button, .reset-btn { min-height: 26px; border: 0; border-radius: 6px; color: var(--b2-muted);
background: transparent; font: 700 11px/1 var(--mono); padding: 0 9px; cursor: pointer;
transition: color 160ms ease, background 160ms ease; }
.seg button.active { color: var(--text); background: rgba(255,255,255,.1); }
.reset-btn { border: 1px solid rgba(148,163,184,.22); }
.reset-btn:hover, .seg button:hover { color: var(--text); background: rgba(148,163,184,.12); }
.donut-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.donut-card { min-width: 0; padding: 10px; border: 1px solid var(--b2-border); border-radius: 10px; background: rgba(0,0,0,.18); }
.donut-title { margin: 0 0 6px; color: var(--b2-muted); font: 700 11px/1.2 var(--mono); text-transform: uppercase; letter-spacing: .05em; }
.donut-tabs { display: flex; justify-content: flex-end; gap: 3px; margin: -2px 0 4px; }
.donut-tabs button { min-height: 26px; border: 1px solid var(--b2-border); border-radius: 6px;
background: transparent; color: var(--b2-muted); font: 700 10.5px/1 var(--mono); padding: 0 8px; }
.donut-tabs button.active { background: rgba(255,255,255,.1); color: var(--text); }
.half-donut { position: relative; width: min(220px, 100%); aspect-ratio: 220 / 132; display: grid; place-items: center; margin: 0 auto; }
.half-donut svg { grid-area: 1 / 1; width: 100%; height: 100%; overflow: visible; }
.donut-segment { animation: donutDraw 1100ms cubic-bezier(.2,.7,.2,1) both; }
@keyframes donutDraw { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }
.donut-value { fill: var(--text); font: 800 28px var(--mono); }
.donut-label { fill: var(--b2-muted); font: 10px var(--mono); }
.legend { display: grid; gap: 6px; margin-top: 6px; }
.legend-row { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 7px; font: 11px/1.25 var(--mono); color: var(--b2-muted); }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 16%, transparent); }
.legend-name { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-bars { margin-top: 12px; }
.agent-bars h3 { margin: 0 0 8px; font: 700 11px/1.2 var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--b2-muted); }
.agent-bar-row { display: grid; grid-template-columns: minmax(96px, 1fr) 1.35fr; gap: 10px; align-items: center;
padding: 8px 0; border-top: 1px solid var(--b2-border); }
.agent-bar-row:first-of-type { border-top: 0; }
.budget-agent { display: flex; align-items: center; gap: 8px; min-width: 0; }
.budget-agent .ba-core { width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center;
background: var(--agent-color); color: #0e1226; font: 800 9px/1 var(--mono); flex: 0 0 auto; }
.budget-agent .ba-name { display: block; font-weight: 650; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.budget-agent .ba-model { display: block; color: var(--b2-muted); font: 10px/1.2 var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agent-bar-cell { min-width: 0; }
.agent-bar-track { height: 7px; border-radius: 999px; background: rgba(255,255,255,.07); overflow: hidden; }
.agent-bar-track > span { display: block; height: 100%;
background: linear-gradient(90deg, var(--bar-color), color-mix(in srgb, var(--bar-color) 62%, #fff));
width: 0; transition: width 900ms cubic-bezier(.2,.7,.2,1); }
.agent-bar-meta { display: flex; justify-content: space-between; gap: 8px; margin-top: 4px; color: var(--b2-muted); font: 10.5px/1.25 var(--mono); }
.agent-bar-meta .tok { color: var(--text); font-weight: 650; }
.budget-empty { color: var(--b2-muted); font-size: 12px; padding: 6px 0; }
/* ── Live feed ────────────────────────────────────────────────────── */
.b2-feed { margin-top: 8px; font-size: 12px; color: #aab6d4; font-family: var(--mono); }
.b2-feed > div { padding: 4px 0; border-bottom: 1px dashed rgba(255,255,255,.06); display: flex; gap: 7px; align-items: baseline; }
.b2-feed > div:last-child { border-bottom: 0; }
.b2-feed .pulse { color: var(--b2-green); animation: b2-blink 1.6s infinite; }
.b2-feed .f-time { color: var(--b2-dim); font-size: 10px; margin-left: auto; flex: 0 0 auto; }
/* ── Modals (ported v1) ───────────────────────────────────────────── */
.modal-backdrop { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-start;
justify-content: center; padding: 12vh 16px 16px; background: rgba(2,6,18,.62);
backdrop-filter: blur(3px); animation: modalFade 140ms ease; }
.modal-backdrop[hidden] { display: none; }
@keyframes modalFade { from { opacity: 0; } to { opacity: 1; } }
.modal { width: min(520px, 100%); background: #10142a; border: 1px solid var(--b2-border);
border-radius: 14px; box-shadow: 0 24px 64px rgba(0,0,0,.5); animation: modalRise 180ms cubic-bezier(.2,.7,.2,1); }
@keyframes modalRise { from { transform: translateY(12px); opacity: .4; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 8px; }
.modal-head h2 { margin: 0; font-size: 16px; font-weight: 700; }
.modal-x { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--b2-border);
background: var(--b2-raised); color: var(--b2-muted); font-size: 20px; line-height: 1; cursor: pointer;
transition: color 140ms, border-color 140ms; }
.modal-x:hover { color: var(--text); border-color: var(--b2-muted); }
#tmForm { padding: 6px 18px 18px; display: flex; flex-direction: column; gap: 12px; }
.modal-field { display: flex; flex-direction: column; gap: 5px; }
.modal-field-inline { flex-direction: row; align-items: center; gap: 12px; }
.modal-field-inline .modal-label { margin: 0; }
.modal-label { color: var(--b2-muted); font: 600 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .05em; }
.modal-field input, .modal-field textarea, .modal-field select {
background: rgba(0,0,0,.22); border: 1px solid var(--b2-border); border-radius: 8px;
color: var(--text); font: 14px/1.4 var(--sans); padding: 9px 11px; }
.modal-field textarea { resize: vertical; min-height: 84px; }
.modal-field input:focus, .modal-field textarea:focus, .modal-field select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.modal-note { margin: 0; color: var(--b2-muted); font-size: 11.5px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.modal-cancel, .modal-create { min-height: 38px; padding: 0 16px; border-radius: 8px;
font: 600 13px/1 var(--sans); cursor: pointer; transition: background 160ms ease, transform 120ms ease, border-color 160ms ease; }
.modal-cancel { border: 1px solid var(--b2-border); background: var(--b2-raised); color: var(--b2-muted); }
.modal-cancel:hover { color: var(--text); border-color: var(--b2-muted); }
.modal-create { border: 1px solid var(--green); background: rgba(52,211,153,.16); color: #d1fadf; }
.modal-create:hover { background: rgba(52,211,153,.26); }
.modal-create:active, .modal-cancel:active { transform: translateY(1px); }
.confirm-modal { width: min(420px, 100%); }
.confirm-body { padding: 2px 18px 2px; }
.confirm-body p { margin: 0; color: var(--b2-muted); font-size: 13.5px; line-height: 1.5; }
.confirm-body b { color: var(--text); }
.confirm-modal .modal-actions { padding: 14px 18px 18px; margin-top: 0; }
.modal-danger { min-height: 38px; padding: 0 16px; border-radius: 8px;
border: 1px solid var(--danger); background: rgba(248,81,73,.16); color: #ffd7d3;
font: 600 13px/1 var(--sans); cursor: pointer; transition: background 160ms ease, transform 120ms ease; }
.modal-danger:hover { background: rgba(248,81,73,.26); }
.modal-danger:active { transform: translateY(1px); }
.detail-modal { width: min(760px, 100%); max-height: min(78vh, 760px); display: flex; flex-direction: column; }
.detail-body { min-height: 0; overflow-y: auto; padding: 4px 18px 18px; display: grid; gap: 12px; }
.detail-topline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.detail-title { margin: 0; font-size: 19px; line-height: 1.25; overflow-wrap: anywhere; }
.detail-section { border-top: 1px solid var(--b2-border); padding-top: 12px; display: grid; gap: 8px; }
.detail-section h3 { margin: 0; color: var(--b2-muted); font: 700 11px/1.2 var(--mono); text-transform: uppercase; letter-spacing: .05em; }
.detail-description { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); font: 12.5px/1.55 var(--mono); }
.detail-activity { display: grid; gap: 0; }
.detail-activity-row { display: grid; grid-template-columns: 78px 82px minmax(0, 1fr) auto; gap: 8px; padding: 8px 0; border-top: 1px solid rgba(255,255,255,.06); align-items: start; }
.detail-activity-row:first-child { border-top: 0; padding-top: 0; }
.detail-when, .detail-actor { color: var(--b2-muted); font: 11px/1.45 var(--mono); }
.detail-kind { color: var(--accent); font: 11px/1.45 var(--mono); }
.detail-summary { min-width: 0; overflow-wrap: anywhere; }
.detail-error { color: #fca5a5; }
/* ── Toasts (ported v1) ───────────────────────────────────────────── */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 50; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 8px; background: #151a33; border: 1px solid var(--b2-border);
border-left: 3px solid var(--green); border-radius: 10px; padding: 9px 13px; color: var(--text);
font: 13px/1.3 var(--sans); box-shadow: 0 8px 28px rgba(0,0,0,.42);
animation: toastIn 220ms cubic-bezier(.2,.7,.2,1); max-width: 340px; }
.toast.out { animation: toastOut 240ms ease forwards; }
.toast .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(52,211,153,.18); flex: 0 0 auto; }
.toast.err { border-left-color: var(--danger); }
.toast.err .dot { background: var(--danger); box-shadow: 0 0 0 3px rgba(248,81,73,.18); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(6px); } }
/* ── Splash ───────────────────────────────────────────────────────── */
.b2-splash { position: fixed; inset: 0; z-index: 999; display: flex; align-items: center; justify-content: center;
background: radial-gradient(140% 120% at 15% -10%, #1c2547 0%, #0e1226 50%, #090c18 100%);
transition: opacity .4s ease; }
.b2-splash-hide { opacity: 0; pointer-events: none; }
.b2-splash-inner { text-align: center; animation: b2-rise .5s both; }
.b2-splash-logo { animation: b2-ping 1.6s ease-in-out infinite; border-radius: 18px; }
.b2-splash-word { margin-top: 14px; font-size: 22px; font-weight: 700; letter-spacing: .02em; color: #eef1f8; }
/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 1120px) {
.b2-body { grid-template-columns: 1fr; }
.b2-side { position: static; max-height: none; }
}
@media (max-width: 860px) {
body { padding-left: 14px; padding-right: 14px; }
.b2-hdr { padding-left: 14px; padding-right: 14px; }
.b2-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.board { grid-template-columns: repeat(2, 1fr); }
.b2-proj { max-width: 46vw; }
}
@media (max-width: 560px) {
.b2-hdr { align-items: flex-start; flex-wrap: wrap; }
.b2-kpis { grid-template-columns: 1fr; }
.board { grid-template-columns: 1fr; }
.b2-nav { flex: 1; }
.b2-nav b, .b2-nav a { flex: 1; justify-content: center; }
.detail-activity-row { grid-template-columns: 1fr; gap: 3px; }
.agent-bar-row { grid-template-columns: 1fr; gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
.b2, .b2 *, body, body * { animation: none !important; transition: none !important; }
}
`;
}

View File

@ -0,0 +1,16 @@
import { describe, it, expect } from 'vitest';
import { boardV2Css } from '../src/server/board/styles.js';
describe('boardV2Css', () => {
it('contains the glass surface tokens and keyframes', () => {
const css = boardV2Css();
expect(css).toContain('--b2-bg');
expect(css).toContain('rgba(255,255,255,.045)'); // glass surface
expect(css).toContain('@keyframes b2-rise');
expect(css).toContain('@keyframes b2-fill');
expect(css).toContain('@keyframes b2-ping');
});
it('respects prefers-reduced-motion', () => {
expect(boardV2Css()).toContain('@media (prefers-reduced-motion: reduce)');
});
});