/* ==========================================================================
   YIELD · Savings & Productivity Hub — demo design system
   Light "frosted glass" on the Envista family palette (same tokens as VALORA / MANIFEST):
   deep navy · blue · bright blue · aqua on white. Gold only marks targets.
   ========================================================================== */
:root {
    --brand-deep: #08243B;
    --brand: #0D75CD;
    --brand-bright: #2E8FE0;
    --brand-glow: #4FC3DF;
    --brand-soft: rgba(13, 117, 205, .09);
    --brand-ring: rgba(46, 143, 224, .28);
    --grad-accent: linear-gradient(135deg, #0D75CD 0%, #2E8FE0 45%, #4FC3DF 100%);
    --grad-brand: linear-gradient(140deg, #08243B 0%, #0B3C63 50%, #0D75CD 100%);

    --page: #F2F5F9;
    --page-2: #E8EDF4;
    --glass: rgba(255, 255, 255, .62);
    --glass-2: rgba(8, 36, 59, .045);
    --glass-hover: rgba(8, 36, 59, .07);
    --line: rgba(22, 35, 46, .09);
    --line-2: rgba(22, 35, 46, .16);

    --text: #16232E;
    --text-2: #55677A;
    --text-muted: #8595A5;
    --on-brand: #FFFFFF;

    --champagne: #B98A3E;
    --ok: #2E9E6B;
    --warn: #C2871B;
    --bad: #C6504D;
    --info: #0D75CD;

    --radius: 18px;
    --radius-sm: 12px;
    --blur: 20px;
    --shadow: 0 1px 2px rgba(8, 36, 59, .05), 0 8px 24px -12px rgba(8, 36, 59, .12);
    --shadow-hover: 0 14px 34px -14px rgba(8, 36, 59, .22);

    --font-display: "Sora", "Segoe UI Semibold", "Segoe UI", system-ui, sans-serif;
    --font-body: "Public Sans", "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;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
::selection { background: rgba(79, 195, 223, .3); }
:focus-visible { outline: 3px solid var(--brand-ring); 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;
    background: radial-gradient(1200px 600px at 100% -10%, #e3f1fb 0%, transparent 60%), linear-gradient(180deg, #f6f9fc 0%, var(--page) 100%); }
.ambient::before {
    content: ""; position: absolute; inset: 0;
    background-image: linear-gradient(rgba(13,117,205,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(13,117,205,.07) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 72%);
}
.blob { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .55; }
.blob.b1 { width: 640px; height: 640px; left: -180px; top: -220px; background: radial-gradient(circle, rgba(79, 195, 223, .55), transparent 65%); animation: drift1 80s ease-in-out infinite alternate; }
.blob.b2 { width: 560px; height: 560px; right: -140px; top: 18%; background: radial-gradient(circle, rgba(46, 143, 224, .38), transparent 65%); animation: drift2 90s ease-in-out infinite alternate; }
.blob.b3 { width: 520px; height: 520px; left: 32%; bottom: -280px; background: radial-gradient(circle, rgba(13, 117, 205, .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: 4px;
    background: rgba(255, 255, 255, .7); border-right: 1px solid var(--line);
    backdrop-filter: blur(var(--blur)) saturate(150%); -webkit-backdrop-filter: blur(var(--blur)) saturate(150%);
}
.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 210deg, #08243B, #0D75CD, #4FC3DF, #0D75CD, #08243B);
    box-shadow: 0 0 0 1px rgba(255,255,255,.4) inset, 0 10px 24px -8px rgba(13,117,205,.6);
    color: #fff; 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; color: var(--brand-deep); }
.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; font-weight: 600; }
.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; font-weight: 500;
}
.nav-item:hover { background: var(--glass-2); color: var(--text); }
.nav-item.active { background: linear-gradient(90deg, rgba(13,117,205,.12), rgba(79,195,223,.06)); color: var(--brand-deep); }
.nav-item.active::before { content: ""; position: absolute; left: -14px; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--grad-accent); }
.nav-item.active .ico { color: var(--brand); }
.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); color: #fff; }
.sidebar-foot { margin-top: auto; }
.tenant { padding: 14px; border-radius: 14px; background: var(--grad-brand); color: rgba(255,255,255,.75); font-size: 12px; position: relative; overflow: hidden; }
.tenant::after { content: ""; position: absolute; right: -40px; top: -40px; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle, rgba(79,195,223,.55), transparent 70%); }
.tenant b { display: block; color: #fff; 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(246, 249, 252, .72); backdrop-filter: blur(var(--blur)) saturate(150%); -webkit-backdrop-filter: blur(var(--blur)) saturate(150%);
    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: #fff; border: 1px solid var(--line); color: var(--text-muted); cursor: pointer; transition: border-color .12s, box-shadow .12s;
    box-shadow: 0 1px 2px rgba(8,36,59,.04);
}
.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); background: var(--page); }
.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: #fff; border: 1px solid var(--line); color: var(--text-2); cursor: pointer; transition: all .12s;
}
.icon-btn:hover { color: var(--brand); border-color: var(--brand-ring); }
.icon-btn .ping { position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand-glow); box-shadow: 0 0 0 3px #fff; }
.me { display: flex; align-items: center; gap: 10px; padding: 4px 12px 4px 4px; border-radius: 99px; background: #fff; 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); font-weight: 700; 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; color: var(--brand-deep); }
.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,.88), rgba(255,255,255,.62));
    border: 1px solid rgba(255,255,255,.9); border-radius: var(--radius);
    backdrop-filter: blur(var(--blur)) saturate(160%); -webkit-backdrop-filter: blur(var(--blur)) saturate(160%);
    box-shadow: var(--shadow), 0 0 0 1px var(--line);
}
.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; color: var(--brand-deep); }
.card-title .ico { color: var(--brand-bright); }
.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(520px 200px at 12% -20%, rgba(79,195,223,.22), transparent 60%);
}
.window-bar { display: flex; align-items: center; gap: 7px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: rgba(8,36,59,.025); }
.window-bar i { width: 10px; height: 10px; border-radius: 50%; background: rgba(8,36,59,.14); }
.window-bar i:nth-child(1) { background: #4FC3DF; } .window-bar i:nth-child(2) { background: #2E8FE0; } .window-bar i:nth-child(3) { background: #0D75CD; }
.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: 600; }
.kpi-icon { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.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; color: var(--brand-deep); }
.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; }
/* the ONE showpiece tile per page: deep navy → blue, white type */
.kpi.accent { background: var(--grad-brand); border-color: transparent; color: #fff; box-shadow: 0 18px 40px -18px rgba(8,36,59,.55); }
.kpi.accent::after { background: radial-gradient(420px 180px at 90% -10%, rgba(79,195,223,.5), transparent 60%); }
.kpi.accent .kpi-label, .kpi.accent .kpi-foot { color: rgba(255,255,255,.72); }
.kpi.accent .kpi-value, .kpi.accent .kpi-value .unit { color: #fff; }
.kpi.accent .kpi-icon { background: rgba(255,255,255,.14); color: #fff; }
.kpi.accent .bar { background: rgba(255,255,255,.18); }
.kpi.accent .bar > span { background: linear-gradient(90deg, #4FC3DF, #a7ecf7); box-shadow: 0 0 14px rgba(79,195,223,.7); }
.kpi.accent .pos, .kpi.accent a.pos { color: #a7ecf7; }
.kpi.accent .delta.up { color: #a7ecf7; background: rgba(255,255,255,.12); }
.kpi.accent .delta.down { color: #ffd0cc; background: rgba(255,255,255,.12); }
.kpi.accent .muted, .kpi.accent .text-2 { color: rgba(255,255,255,.72); }
.kpi.accent .ring span { color: #fff; }
.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(46,158,107,.1); }
.delta.down { color: var(--bad); background: rgba(198,80,77,.1); }
.delta.flat { color: var(--text-2); background: var(--glass-2); }

/* ---------- progress ---------- */
.bar { height: 8px; border-radius: 99px; background: rgba(8,36,59,.07); overflow: hidden; position: relative; }
.bar > span { display: block; height: 100%; border-radius: inherit; background: var(--grad-accent); }
.bar.muted > span { background: rgba(8,36,59,.22); }
.bar .marker { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--champagne); border-radius: 2px; }
.kpi.accent .bar .marker { background: #f3d9a4; }

/* ---------- 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: #fff; color: var(--text); font-weight: 600; font-size: 13.5px; transition: all .12s ease;
}
.btn:hover { border-color: var(--brand-ring); color: var(--brand); box-shadow: 0 4px 14px -8px rgba(13,117,205,.4); }
.btn.primary { background: var(--grad-accent); color: #fff; border-color: transparent; box-shadow: 0 10px 24px -10px rgba(13,117,205,.65); }
.btn.primary:hover { color: #fff; filter: brightness(1.06); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); box-shadow: none; }
.btn.ghost:hover { color: var(--brand); background: var(--brand-soft); }
.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; font-weight: 500;
    background: #fff; border: 1px solid var(--line); color: var(--text-2); transition: all .12s; user-select: none;
}
.chip:hover { color: var(--brand); border-color: var(--brand-ring); }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 6px 16px -8px rgba(13,117,205,.7); }
.chip .n { font-size: 11px; color: var(--text-muted); }
.chip.on .n { color: rgba(255,255,255,.75); }

.status { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent); }
.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; font-weight: 500;
    background: #fff; 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(8,36,59,.07); color: var(--brand-deep);
}
.stage-pill.s-Implemented b { background: var(--grad-accent); color: #fff; }
.stage-pill.s-Planning b { background: #2E8FE0; color: #fff; }
.stage-pill.s-Approved b { background: rgba(46,143,224,.4); color: var(--brand-deep); }
.stage-pill.s-Advanced b { background: rgba(79,195,223,.28); color: var(--brand-deep); }
.stage-pill.s-Rejected b { background: rgba(198,80,77,.14); color: var(--bad); }

.tag { font-size: 11px; padding: 2px 8px; border-radius: 6px; background: #fff; color: var(--text-2); border: 1px solid var(--line); font-weight: 500; }
.tag.ai { color: #fff; border-color: transparent; background: var(--grad-accent); }

.avatar {
    --h: 200; width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
    font-size: 11.5px; font-weight: 700; color: #fff; letter-spacing: .02em;
    background: linear-gradient(135deg, hsl(var(--h) 55% 50%), hsl(calc(var(--h) + 35) 55% 38%));
    box-shadow: 0 0 0 2px #fff;
}
.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: 600; 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: 600; 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(22,35,46,.06); 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(13,117,205,.04); }
.t .num, .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.t .title-cell b { font-weight: 600; display: block; color: var(--brand-deep); }
.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); }
a.pos { color: var(--brand); font-weight: 600; }

/* ---------- 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(22,35,46,.06); }
.list-item:last-child { border-bottom: 0; }
a.list-item:hover b { color: var(--brand); }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .grow b { font-weight: 600; 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(194,135,27,.12); }
.bullet-ico.bad { color: var(--bad); background: rgba(198,80,77,.1); }
.bullet-ico.ok { color: var(--ok); background: rgba(46,158,107,.1); }
.bullet-ico.info { color: var(--brand); background: var(--brand-soft); }

.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ""; position: absolute; left: 10px; top: 6px; bottom: 6px; width: 2px; border-radius: 2px; background: linear-gradient(180deg, var(--brand-glow), rgba(8,36,59,.08)); }
.tl-item { position: relative; padding-bottom: 18px; }
.tl-item::before { content: ""; position: absolute; left: -21px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid var(--text-muted); }
.tl-item.ok::before { border-color: var(--brand); background: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.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: 1.5px; pointer-events: none;
    background: linear-gradient(135deg, #0D75CD, #4FC3DF 45%, transparent 75%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.copilot::after { content: ""; position: absolute; right: -80px; top: -80px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, rgba(79,195,223,.22), transparent 70%); pointer-events: none; }
.insight { display: flex; gap: 12px; padding: 12px; border-radius: 14px; background: rgba(255,255,255,.75); border: 1px solid var(--line); position: relative; z-index: 1; transition: border-color .12s, box-shadow .12s; }
a.insight:hover { border-color: var(--brand-ring); box-shadow: 0 8px 20px -14px rgba(13,117,205,.6); }
.insight + .insight { margin-top: 10px; }
.insight b { display: block; font-weight: 700; font-size: 13.5px; margin-bottom: 2px; color: var(--brand-deep); }
.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: #fff; border: 1px solid var(--line-2); align-items: center; color: var(--text-muted); position: relative; z-index: 1; cursor: text; }

/* ---------- stage stepper ---------- */
.stepper { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.step { padding: 14px; border-radius: 14px; background: #fff; 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(8,36,59,.07); color: var(--text-2); margin-bottom: 10px; }
.step b { display: block; font-size: 13px; font-weight: 700; color: var(--brand-deep); }
.step small { color: var(--text-muted); font-size: 11.5px; }
.step.done { border-color: rgba(13,117,205,.2); background: linear-gradient(160deg, rgba(79,195,223,.12), rgba(255,255,255,.9)); }
.step.done .l { background: var(--brand); color: #fff; }
.step.current { border-color: var(--brand-bright); box-shadow: 0 0 0 3px var(--brand-soft), 0 14px 30px -18px rgba(13,117,205,.7); }
.step.current .l { background: var(--grad-accent); color: #fff; box-shadow: 0 6px 14px -4px rgba(13,117,205,.6); }
.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(8,36,59,.05); 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: 600; transition: all .12s; border: 0; background: transparent; display: inline-flex; align-items: center; gap: 6px; }
.tab:hover { color: var(--brand); }
.tab.on { background: #fff; color: var(--brand-deep); box-shadow: 0 2px 8px -2px rgba(8,36,59,.15); }

/* ---------- 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,.45); border: 1px solid var(--line); min-height: 400px; backdrop-filter: blur(12px); }
.col-head { display: flex; align-items: center; gap: 10px; padding: 2px 2px 8px; }
.col-head b { font-family: var(--font-display); font-weight: 700; color: var(--brand-deep); }
.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: #fff; border: 1px solid var(--line); cursor: grab; transition: transform .15s ease, box-shadow .15s, border-color .15s; box-shadow: 0 1px 2px rgba(8,36,59,.05); }
.kcard:hover { transform: translateY(-2px); border-color: var(--brand-ring); box-shadow: var(--shadow-hover); }
.kcard b { font-weight: 600; font-size: 13px; display: block; margin-bottom: 8px; line-height: 1.35; color: var(--brand-deep); }
.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(13,117,205,.4); border-radius: var(--radius); padding: 40px; text-align: center; cursor: pointer;
    background: radial-gradient(420px 170px at 50% 0%, rgba(79,195,223,.16), transparent 70%), rgba(255,255,255,.6);
}
.drop:hover { border-color: var(--brand); }
.drop .big { width: 60px; height: 60px; margin: 0 auto 14px; border-radius: 18px; display: grid; place-items: center; background: var(--grad-accent); color: #fff; box-shadow: 0 12px 26px -12px rgba(13,117,205,.8); }

/* ---------- charts ---------- */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid-line { stroke: rgba(8,36,59,.08); 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: 190px; padding: 10px 12px; border-radius: 12px; font-size: 12px;
    background: rgba(8, 36, 59, .94); color: #fff; border: 1px solid rgba(255,255,255,.1); backdrop-filter: blur(12px); box-shadow: 0 16px 32px -14px rgba(8,36,59,.6);
}
.tooltip .tt-title { font-weight: 700; margin-bottom: 6px; }
.tooltip .tt-row { display: flex; justify-content: space-between; gap: 18px; color: rgba(255,255,255,.7); }
.tooltip .tt-row b { color: #fff; font-variant-numeric: tabular-nums; font-weight: 600; }
.tooltip .pos { color: #7fe0c0; } .tooltip .neg { color: #ffb3ad; }
.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(8,36,59,.06); overflow: hidden; }
.hbar .fill { display: block; height: 100%; border-radius: 99px; background: var(--grad-accent); }
.hbar .fill.muted { background: rgba(8,36,59,.2); }
.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(79,195,223,.12); color: var(--brand-deep); font-weight: 600; }
.savings-grid td.f { color: var(--text-2); }
.savings-grid td.z { color: var(--text-muted); }
.savings-grid tr.total td { font-weight: 700; 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; color: var(--brand-deep); }

/* ---------- command palette / drawer ---------- */
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(8, 36, 59, .28); 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; background: rgba(255,255,255,.96); }
.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; font-family: var(--font-body); }
.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(--brand-soft); color: var(--brand-deep); }
.palette .grp { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); padding: 10px 12px 4px; font-weight: 600; }
.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(255,255,255,.96); }
@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; font-weight: 600; color: var(--brand); border: 1px solid rgba(13,117,205,.25); padding: 3px 10px; border-radius: 99px; background: rgba(79,195,223,.12); 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; max-width: 460px;
    border-radius: 14px; background: #fff; color: var(--text); border: 1px solid var(--line); border-left: 4px solid var(--brand-glow);
    box-shadow: 0 22px 44px -18px rgba(8,36,59,.45); animation: rise .25s ease-out;
}

/* ---------- 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: 600; }
.field label .req { color: var(--brand); margin-left: 2px; }
.input {
    width: 100%; padding: 11px 14px; border-radius: 12px; background: #fff; border: 1px solid var(--line-2);
    color: var(--text); font: inherit; transition: border-color .12s, box-shadow .12s;
}
.input:focus { outline: none; border-color: var(--brand-bright); box-shadow: 0 0 0 3px var(--brand-soft); }
select.input option { background: #fff; }
.input.invalid { border-color: rgba(198,80,77,.7); box-shadow: 0 0 0 3px rgba(198,80,77,.1); }
.input.modified.valid { border-color: rgba(46,158,107,.55); }
.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(198,80,77,.14); flex: none; }
.validation-errors { margin: 0; padding: 12px 14px 12px 32px; border-radius: 12px; background: rgba(198,80,77,.07); border: 1px solid rgba(198,80,77,.25); color: var(--bad); font-size: 12.5px; }
.hint { font-size: 11.5px; color: var(--text-muted); }
textarea, input { font-family: var(--font-body); }

@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: #fdecea; color: #7a1f1a; border-top: 1px solid rgba(198,80,77,.3); }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 16px; top: 10px; }
.blazor-error-boundary { padding: 16px; border-radius: 12px; background: #fdecea; color: #7a1f1a; }
.blazor-error-boundary::after { content: "Something went wrong."; }
