/* ==========================================================================
   YIELD · Savings & Productivity Hub — demo design system
   Dark Executive + glass. ONE accent (emerald); champagne only marks targets.
   ========================================================================== */
:root {
    --page: #070b0a;
    --page-2: #0b1210;
    --glass: rgba(255, 255, 255, .045);
    --glass-2: rgba(255, 255, 255, .07);
    --glass-hover: rgba(255, 255, 255, .085);
    --glass-strong: rgba(18, 26, 24, .72);
    --line: rgba(255, 255, 255, .08);
    --line-2: rgba(255, 255, 255, .14);

    --text: #e9efec;
    --text-2: #a4b2ad;
    --text-muted: #6f7d78;

    --brand: #10b981;
    --brand-bright: #34d399;
    --brand-glow: rgba(52, 211, 153, .35);
    --brand-soft: rgba(52, 211, 153, .12);
    --champagne: #e6cc9a;

    --ok: #34d399;
    --warn: #f0b44c;
    --bad: #f47272;
    --info: #7cb6f5;

    --radius: 18px;
    --radius-sm: 12px;
    --blur: 22px;
    --shadow: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 20px 40px -24px rgba(0, 0, 0, .6);

    --font-display: "Sora", "Segoe UI", system-ui, sans-serif;
    --font-body: "Inter", "Segoe UI", system-ui, sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
    background: var(--page);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    font-feature-settings: "cv11", "ss01";
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
::selection { background: var(--brand-soft); }
:focus-visible { outline: 3px solid var(--brand-glow); outline-offset: 2px; border-radius: 8px; }
h1:focus, h1:focus-visible { outline: none; }

/* ---------- ambient layer (rendered once, behind everything) ---------- */
.ambient { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.ambient::before {
    content: ""; position: absolute; inset: 0;
    background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size: 64px 64px; opacity: .22;
    mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 70%);
}
.blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .5; }
.blob.b1 { width: 620px; height: 620px; left: -160px; top: -200px; background: radial-gradient(circle, rgba(16, 185, 129, .55), transparent 65%); animation: drift1 80s ease-in-out infinite alternate; }
.blob.b2 { width: 540px; height: 540px; right: -120px; top: 20%; background: radial-gradient(circle, rgba(20, 110, 120, .5), transparent 65%); animation: drift2 90s ease-in-out infinite alternate; }
.blob.b3 { width: 480px; height: 480px; left: 35%; bottom: -260px; background: radial-gradient(circle, rgba(230, 204, 154, .22), transparent 65%); animation: drift1 70s ease-in-out infinite alternate-reverse; }
@keyframes drift1 { to { transform: translate(120px, 80px) scale(1.1); } }
@keyframes drift2 { to { transform: translate(-100px, 60px) scale(.92); } }

/* ---------- shell ---------- */
.shell { position: relative; z-index: 1; display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.sidebar {
    position: sticky; top: 0; height: 100vh; padding: 20px 14px; display: flex; flex-direction: column; gap: 6px;
    background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02));
    border-right: 1px solid var(--line); backdrop-filter: blur(var(--blur)); -webkit-backdrop-filter: blur(var(--blur));
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 10px 18px; }
.brand-mark {
    width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
    background: conic-gradient(from 200deg, #10b981, #0ea5a4, #e6cc9a, #10b981);
    box-shadow: 0 0 0 1px rgba(255,255,255,.15) inset, 0 10px 30px -8px var(--brand-glow);
    color: #04201a; font-family: var(--font-display); font-weight: 800; font-size: 18px;
}
.brand-name { font-family: var(--font-display); font-weight: 700; letter-spacing: .12em; font-size: 16px; }
.brand-sub { font-size: 11px; color: var(--text-muted); letter-spacing: .04em; }
.nav-label { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); padding: 14px 12px 6px; }
.nav-item {
    display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--text-2);
    transition: background .12s ease, color .12s ease; position: relative; min-height: 42px;
}
.nav-item:hover { background: var(--glass-2); color: var(--text); }
.nav-item.active { background: linear-gradient(90deg, var(--brand-soft), rgba(52,211,153,.03)); color: var(--text); }
.nav-item.active::before { content: ""; position: absolute; left: -14px; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--brand-bright); box-shadow: 0 0 12px var(--brand-glow); }
.nav-item.active .ico { color: var(--brand-bright); }
.nav-count { margin-left: auto; font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 99px; background: var(--glass-2); color: var(--text-2); }
.nav-item.active .nav-count { background: var(--brand-soft); color: var(--brand-bright); }
.sidebar-foot { margin-top: auto; }
.tenant { padding: 14px; border-radius: 14px; background: var(--glass); border: 1px solid var(--line); font-size: 12px; color: var(--text-2); }
.tenant b { display: block; color: var(--text); font-size: 13px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
    position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; padding: 14px 32px;
    background: rgba(7, 11, 10, .55); backdrop-filter: blur(var(--blur)); -webkit-backdrop-filter: blur(var(--blur));
    border-bottom: 1px solid var(--line);
}
.search {
    flex: 1; max-width: 520px; display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-radius: 12px;
    background: var(--glass); border: 1px solid var(--line); color: var(--text-muted); cursor: pointer; transition: border-color .12s;
}
.search:hover { border-color: var(--line-2); }
.kbd { margin-left: auto; font-family: var(--font-mono); font-size: 11px; padding: 2px 7px; border-radius: 6px; border: 1px solid var(--line-2); color: var(--text-2); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.icon-btn {
    width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; position: relative;
    background: var(--glass); border: 1px solid var(--line); color: var(--text-2); cursor: pointer; transition: all .12s;
}
.icon-btn:hover { color: var(--text); background: var(--glass-hover); }
.icon-btn .ping { position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand-bright); box-shadow: 0 0 0 3px rgba(7,11,10,.9); }
.me { display: flex; align-items: center; gap: 10px; padding: 4px 12px 4px 4px; border-radius: 99px; background: var(--glass); border: 1px solid var(--line); }
.me small { display: block; color: var(--text-muted); font-size: 11px; line-height: 1.1; }
.content { padding: 28px 32px 48px; display: flex; flex-direction: column; gap: 24px; max-width: 1680px; width: 100%; }

/* ---------- page header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.eyebrow { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--brand-bright); font-weight: 600; margin-bottom: 8px; display: flex; gap: 8px; align-items: center; }
.page-title { font-family: var(--font-display); font-size: 34px; line-height: 1.08; font-weight: 700; letter-spacing: -.02em; margin: 0; }
.page-sub { color: var(--text-2); margin: 8px 0 0; font-size: 15px; max-width: 720px; }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- glass surfaces ---------- */
.glass {
    background: linear-gradient(160deg, rgba(255,255,255,.065), rgba(255,255,255,.025));
    border: 1px solid var(--line); border-radius: var(--radius);
    backdrop-filter: blur(var(--blur)) saturate(140%); -webkit-backdrop-filter: blur(var(--blur)) saturate(140%);
    box-shadow: var(--shadow);
}
.card { padding: 24px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.card-title { font-family: var(--font-display); font-size: 16px; font-weight: 600; letter-spacing: -.01em; margin: 0; display: flex; align-items: center; gap: 10px; }
.card-title .ico { color: var(--text-muted); }
.card-sub { color: var(--text-muted); font-size: 12.5px; margin-top: 2px; }
.hero-card { position: relative; overflow: hidden; }
.hero-card::after {
    content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none;
    background: radial-gradient(600px 220px at 12% -20%, rgba(52,211,153,.18), transparent 60%);
}
.window-bar { display: flex; align-items: center; gap: 7px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.window-bar i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.14); }
.window-bar span { margin-left: 8px; font-size: 12px; color: var(--text-muted); font-family: var(--font-mono); }

.grid { display: grid; gap: 24px; }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
.g-main-r { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.span-2 { grid-column: span 2; }
@media (max-width: 1280px) { .g-4 { grid-template-columns: repeat(2, 1fr); } .g-main, .g-main-r, .g-3 { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
    .shell { grid-template-columns: 1fr; } .sidebar { display: none; }
    .g-4, .g-2 { grid-template-columns: 1fr; } .content, .topbar { padding-left: 16px; padding-right: 16px; }
}

/* ---------- KPI tiles ---------- */
.kpi { padding: 20px 22px; display: flex; flex-direction: column; gap: 10px; min-height: 148px; }
.kpi-label { display: flex; align-items: center; gap: 8px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-2); font-weight: 500; }
.kpi-icon { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--glass-2); color: var(--text-2); }
.kpi.accent .kpi-icon { background: var(--brand-soft); color: var(--brand-bright); }
.kpi-value { font-family: var(--font-display); font-size: 32px; font-weight: 700; letter-spacing: -.02em; line-height: 1; white-space: nowrap; font-variant-numeric: tabular-nums; }
.kpi-value .unit { font-size: 16px; font-weight: 600; color: var(--text-2); margin-left: 2px; }
.kpi-foot { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--text-muted); margin-top: auto; }
.delta { white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-size: 12px; padding: 2px 8px; border-radius: 99px; }
.delta.up { color: var(--ok); background: rgba(52,211,153,.1); }
.delta.down { color: var(--bad); background: rgba(244,114,114,.1); }
.delta.flat { color: var(--text-2); background: var(--glass-2); }

/* ---------- progress ---------- */
.bar { height: 8px; border-radius: 99px; background: rgba(255,255,255,.07); overflow: hidden; position: relative; }
.bar > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), var(--brand-bright)); box-shadow: 0 0 16px var(--brand-glow); }
.bar.muted > span { background: rgba(255,255,255,.28); box-shadow: none; }
.bar .marker { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--champagne); border-radius: 2px; }

/* ---------- buttons, chips, badges ---------- */
.btn {
    display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; min-height: 40px; border-radius: 12px; cursor: pointer;
    border: 1px solid var(--line-2); background: var(--glass-2); color: var(--text); font-weight: 500; font-size: 13.5px; transition: all .12s ease;
}
.btn:hover { background: var(--glass-hover); border-color: rgba(255,255,255,.22); }
.btn.primary { background: linear-gradient(180deg, #2fd39a, #0fae79); color: #032017; border-color: transparent; font-weight: 600; box-shadow: 0 8px 24px -10px var(--brand-glow); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { color: var(--text); background: var(--glass); }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 6px 12px; min-height: 32px; font-size: 12.5px; border-radius: 10px; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
    display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; font-size: 12.5px; cursor: pointer;
    background: var(--glass); border: 1px solid var(--line); color: var(--text-2); transition: all .12s; user-select: none;
}
.chip:hover { color: var(--text); border-color: var(--line-2); }
.chip.on { background: var(--brand-soft); border-color: rgba(52,211,153,.35); color: var(--text); }
.chip .n { font-size: 11px; color: var(--text-muted); }

.status { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 500; color: var(--text-2); white-space: nowrap; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.status.ok { color: var(--ok); } .status.warn { color: var(--warn); } .status.bad { color: var(--bad); } .status.info { color: var(--info); } .status.muted { color: var(--text-muted); }
.status span { color: var(--text-2); }

.stage-pill {
    display: inline-flex; align-items: center; gap: 8px; padding: 3px 10px 3px 3px; border-radius: 99px; font-size: 12px;
    background: var(--glass-2); border: 1px solid var(--line); white-space: nowrap; color: var(--text-2);
}
.stage-pill b {
    width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-display);
    font-size: 11px; background: rgba(255,255,255,.1); color: var(--text);
}
.stage-pill.s-Implemented b { background: var(--brand); color: #032017; }
.stage-pill.s-Planning b { background: rgba(52,211,153,.55); color: #032017; }
.stage-pill.s-Approved b { background: rgba(52,211,153,.32); }
.stage-pill.s-Advanced b { background: rgba(52,211,153,.18); }
.stage-pill.s-Rejected b { background: rgba(244,114,114,.2); color: var(--bad); }

.tag { font-size: 11px; padding: 2px 8px; border-radius: 6px; background: var(--glass-2); color: var(--text-2); border: 1px solid var(--line); }
.tag.ai { color: var(--brand-bright); border-color: rgba(52,211,153,.3); background: var(--brand-soft); }

.avatar {
    --h: 160; width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
    font-size: 11.5px; font-weight: 600; color: #fff; letter-spacing: .02em;
    background: linear-gradient(135deg, hsl(var(--h) 45% 42%), hsl(calc(var(--h) + 40) 45% 30%));
    box-shadow: 0 0 0 2px rgba(7,11,10,.9);
}
.avatar.sm { width: 24px; height: 24px; font-size: 9.5px; }
.avatar.lg { width: 44px; height: 44px; font-size: 14px; }
.stack { display: flex; } .stack .avatar + .avatar { margin-left: -3px; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who b { font-weight: 500; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who small { color: var(--text-muted); font-size: 11.5px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.t th { text-align: left; font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.t td { padding: 12px 14px; border-bottom: 1px solid rgba(255,255,255,.045); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr { transition: background .1s; }
.t tbody tr.link { cursor: pointer; }
.t tbody tr:hover { background: rgba(255,255,255,.03); }
.t .num, .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.t .title-cell b { font-weight: 500; display: block; }
.t .title-cell small { color: var(--text-muted); font-size: 12px; }
.t.dense td { padding: 8px 10px; font-size: 12.5px; }
.t.dense th { padding: 8px 10px; }
.muted { color: var(--text-muted); } .text-2 { color: var(--text-2); }
.mono { font-family: var(--font-mono); font-size: 12px; }
.pos { color: var(--ok); } .neg { color: var(--bad); }

/* ---------- lists & feeds ---------- */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 14px; padding: 12px 4px; border-bottom: 1px solid rgba(255,255,255,.05); }
.list-item:last-child { border-bottom: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .grow b { font-weight: 500; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item .grow small { color: var(--text-muted); font-size: 12px; }
.bullet-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--glass-2); color: var(--text-2); }
.bullet-ico.warn { color: var(--warn); background: rgba(240,180,76,.1); }
.bullet-ico.bad { color: var(--bad); background: rgba(244,114,114,.1); }
.bullet-ico.ok { color: var(--ok); background: rgba(52,211,153,.1); }
.bullet-ico.info { color: var(--info); background: rgba(124,182,245,.1); }

.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ""; position: absolute; left: 10px; top: 6px; bottom: 6px; width: 1px; background: var(--line-2); }
.tl-item { position: relative; padding-bottom: 18px; }
.tl-item::before { content: ""; position: absolute; left: -20px; top: 5px; width: 9px; height: 9px; border-radius: 50%; background: var(--page-2); border: 2px solid var(--text-muted); }
.tl-item.ok::before { border-color: var(--ok); background: var(--ok); box-shadow: 0 0 10px var(--brand-glow); }
.tl-item.wait::before { border-color: var(--warn); }
.tl-item small { color: var(--text-muted); font-size: 12px; }

/* ---------- copilot ---------- */
.copilot { position: relative; overflow: hidden; }
.copilot::before {
    content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
    background: linear-gradient(135deg, rgba(52,211,153,.6), rgba(230,204,154,.25), transparent 60%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.insight { display: flex; gap: 12px; padding: 12px; border-radius: 14px; background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.05); }
.insight + .insight { margin-top: 10px; }
.insight b { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 2px; }
.insight p { margin: 0; color: var(--text-2); font-size: 12.5px; line-height: 1.5; }
.ask { display: flex; gap: 8px; margin-top: 16px; padding: 6px 6px 6px 14px; border-radius: 14px; background: rgba(0,0,0,.25); border: 1px solid var(--line); align-items: center; color: var(--text-muted); }

/* ---------- stage stepper ---------- */
.stepper { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.step { padding: 14px; border-radius: 14px; background: rgba(255,255,255,.03); border: 1px solid var(--line); position: relative; }
.step .l { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 13px; background: rgba(255,255,255,.08); color: var(--text-2); margin-bottom: 10px; }
.step b { display: block; font-size: 13px; font-weight: 600; }
.step small { color: var(--text-muted); font-size: 11.5px; }
.step.done { border-color: rgba(52,211,153,.25); background: linear-gradient(160deg, rgba(52,211,153,.1), rgba(52,211,153,.02)); }
.step.done .l { background: var(--brand); color: #032017; }
.step.current { border-color: rgba(52,211,153,.55); box-shadow: 0 0 0 1px rgba(52,211,153,.25), 0 12px 30px -16px var(--brand-glow); }
.step.current .l { background: var(--brand-bright); color: #032017; box-shadow: 0 0 16px var(--brand-glow); }
.step.pending .l { background: transparent; border: 1.5px dashed var(--warn); color: var(--warn); }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: rgba(0,0,0,.2); border: 1px solid var(--line); width: fit-content; flex-wrap: wrap; }
.tab { padding: 8px 16px; border-radius: 10px; cursor: pointer; color: var(--text-2); font-size: 13px; font-weight: 500; transition: all .12s; border: 0; background: transparent; }
.tab:hover { color: var(--text); }
.tab.on { background: var(--glass-hover); color: var(--text); box-shadow: 0 1px 0 rgba(255,255,255,.08) inset; }

/* ---------- kanban ---------- */
.board { display: grid; grid-template-columns: repeat(5, minmax(210px, 1fr)); gap: 16px; overflow-x: auto; padding-bottom: 8px; }
.col { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: var(--radius); background: rgba(255,255,255,.025); border: 1px solid var(--line); min-height: 400px; }
.col-head { display: flex; align-items: center; gap: 10px; padding: 2px 2px 8px; }
.col-head b { font-family: var(--font-display); font-weight: 600; }
.col-head .sum { margin-left: auto; font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.kcard { padding: 14px; border-radius: 14px; background: linear-gradient(160deg, rgba(255,255,255,.07), rgba(255,255,255,.03)); border: 1px solid var(--line); cursor: grab; transition: transform .15s ease, border-color .15s; }
.kcard:hover { transform: translateY(-2px); border-color: var(--line-2); }
.kcard b { font-weight: 500; font-size: 13px; display: block; margin-bottom: 8px; line-height: 1.35; }
.kcard .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--text-muted); }

/* ---------- drop zone ---------- */
.drop {
    border: 1.5px dashed rgba(52,211,153,.4); border-radius: var(--radius); padding: 40px; text-align: center;
    background: radial-gradient(400px 160px at 50% 0%, rgba(52,211,153,.08), transparent 70%);
}
.drop .big { width: 60px; height: 60px; margin: 0 auto 14px; border-radius: 18px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-bright); }

/* ---------- charts ---------- */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid-line { stroke: rgba(255,255,255,.06); stroke-width: 1; }
.chart .axis-label { fill: var(--text-muted); font-size: 11px; font-family: var(--font-body); }
.chart .hit { fill: transparent; cursor: crosshair; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend i.line { height: 2px; border-radius: 2px; vertical-align: 3px; width: 14px; }
.legend i.dash { height: 0; border-top: 2px dashed; background: none !important; vertical-align: 3px; width: 14px; border-radius: 0; }
.tooltip {
    position: absolute; pointer-events: none; z-index: 5; min-width: 180px; padding: 10px 12px; border-radius: 12px; font-size: 12px;
    background: rgba(12, 18, 16, .92); border: 1px solid var(--line-2); backdrop-filter: blur(12px); box-shadow: 0 14px 30px -12px rgba(0,0,0,.7);
}
.tooltip .tt-title { font-weight: 600; margin-bottom: 6px; }
.tooltip .tt-row { display: flex; justify-content: space-between; gap: 18px; color: var(--text-2); }
.tooltip .tt-row b { color: var(--text); font-variant-numeric: tabular-nums; font-weight: 600; }
.hbar { display: grid; grid-template-columns: 130px 1fr 90px; gap: 12px; align-items: center; padding: 7px 0; font-size: 13px; }
.hbar .track { height: 10px; border-radius: 99px; background: rgba(255,255,255,.06); overflow: hidden; }
.hbar .fill { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, rgba(16,185,129,.6), var(--brand-bright)); }
.hbar .fill.muted { background: rgba(255,255,255,.25); }
.heat td.h { text-align: right; font-variant-numeric: tabular-nums; border-radius: 6px; }

.savings-grid td, .savings-grid th { padding: 7px 9px !important; font-size: 12px !important; }
.savings-grid td.a { background: rgba(52,211,153,.07); }
.savings-grid td.f { color: var(--text-2); }
.savings-grid td.z { color: var(--text-muted); }
.savings-grid tr.total td { font-weight: 600; border-top: 1px solid var(--line-2); }

.ring { position: relative; display: inline-grid; place-items: center; }
.ring span { position: absolute; font-family: var(--font-display); font-weight: 700; font-size: 13px; }

/* ---------- command palette ---------- */
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(3, 6, 5, .55); backdrop-filter: blur(6px); display: grid; place-items: start center; padding-top: 12vh; animation: fade .15s ease-out; }
.palette { width: min(640px, 92vw); padding: 0; overflow: hidden; }
.palette input { width: 100%; padding: 18px 20px; font-size: 16px; background: transparent; border: 0; border-bottom: 1px solid var(--line); color: var(--text); outline: none; }
.palette .res { max-height: 360px; overflow: auto; padding: 8px; }
.palette .res a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--text-2); }
.palette .res a:hover, .palette .res a.sel { background: var(--glass-2); color: var(--text); }
.palette .grp { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); padding: 10px 12px 4px; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 94vw); z-index: 101; padding: 22px; overflow: auto; border-radius: 0; animation: slide .2s ease-out; background: rgba(12,18,16,.9); }
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }

/* ---------- entrance motion ---------- */
.rise { animation: rise .45s cubic-bezier(.2,.7,.2,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.d1 { animation-delay: .05s; } .d2 { animation-delay: .1s; } .d3 { animation-delay: .15s; } .d4 { animation-delay: .2s; } .d5 { animation-delay: .25s; }

.demo-ribbon { font-size: 11px; color: var(--champagne); border: 1px solid rgba(230,204,154,.3); padding: 3px 10px; border-radius: 99px; background: rgba(230,204,154,.06); white-space: nowrap; }
.toast {
    position: fixed; right: 24px; bottom: 24px; z-index: 120; display: flex; gap: 12px; align-items: center; padding: 14px 16px; min-width: 300px;
    border-radius: 14px; background: rgba(12,18,16,.92); border: 1px solid var(--line-2); border-left: 3px solid var(--brand-bright);
    box-shadow: 0 20px 40px -18px rgba(0,0,0,.8); animation: rise .25s ease-out;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Blazor plumbing */
#blazor-error-ui { display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000; padding: 12px 20px; background: #3b1414; color: #fff; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 16px; top: 10px; }
.blazor-error-boundary { padding: 16px; border-radius: 12px; background: #3b1414; color: #fff; }
.blazor-error-boundary::after { content: "Something went wrong."; }

/* ---------- forms + validation ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-2); font-weight: 500; }
.field label .req { color: var(--brand-bright); margin-left: 2px; }
.input {
    width: 100%; padding: 11px 14px; border-radius: 12px; background: rgba(0,0,0,.25); border: 1px solid var(--line);
    color: var(--text); font: inherit; transition: border-color .12s, box-shadow .12s;
}
.input:focus { outline: none; border-color: rgba(52,211,153,.55); box-shadow: 0 0 0 3px rgba(52,211,153,.15); }
select.input option { background: #0f1614; }
.input.invalid { border-color: rgba(244,114,114,.65); box-shadow: 0 0 0 3px rgba(244,114,114,.12); }
.input.modified.valid { border-color: rgba(52,211,153,.4); }
.validation-message { color: var(--bad); font-size: 12px; display: flex; gap: 6px; align-items: center; }
.validation-message::before { content: "!"; width: 16px; height: 16px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 10px; font-weight: 700; background: rgba(244,114,114,.18); }
.validation-errors { margin: 0; padding: 12px 14px 12px 32px; border-radius: 12px; background: rgba(244,114,114,.08); border: 1px solid rgba(244,114,114,.25); color: var(--bad); font-size: 12.5px; }
.hint { font-size: 11.5px; color: var(--text-muted); }
