/* GENERATED FILE — DO NOT EDIT.
 * Source: tokens.json  ->  python build.py
 * Direction: Console (approved 2026-08-13)
 */

:root {
    --bg:           #0b0c11;
    --surface:      #14161d;
    --surface-2:    #1b1e27;
    --border:       #252936;
    --border-lit:   #39405a;
    --text:         #e6e8ee;
    --text-dim:     #848da0;
    --text-faint:   #4d5568;
    --accent:       #7c8cff;
    --accent-2:     #a855f7;
    --on-accent:    #ffffff;
    --green:        #2ee6a8;
    --red:          #ff5470;
    --yellow:       #ffc14d;
    --orange:       #fd7e14;
    --pnl-positive: #4caf50;
    --pnl-negative: #f44336;
    --radius:       13px;
    --radius-sm:    7px;
    --rail-w:       60px;
    --tap-target:   44px;
    --shadow-tile:  0 10px 30px -10px rgba(0,0,0,.7);
    --shadow-logo:  0 4px 16px rgba(124,140,255,.4);
    --shadow-mark:  0 2px 8px rgba(0,0,0,.45);
    --shadow-menu:  0 8px 24px rgba(0,0,0,.4);
    --scrim:        rgba(0,0,0,.5);
    --font-family:  -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto, sans-serif;
    --font-mono:    ui-monospace, 'SF Mono', Menlo, monospace;
    --nav-collapse: 768px;
}

/* Paper / sandbox: repaint the neutrals amber so a paper dashboard is
   never mistaken for a live one at a glance. */
[data-vva-env="paper"], body.env-paper {
    --bg:        #14100a;
    --surface:   #1e1810;
    --surface-2: #272016;
    --border:    #3d3220;
}
[data-vva-env="paper"] .vva-env-banner, body.env-paper .vva-env-banner {
    background: #4a2e0f;
    color: #ff9800;
    border-bottom: 2px solid #e65100;
}

/* ══ BASE ═══════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }
body {
    margin: 0;
    font-family: var(--font-family);
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

/* ══ APP SHELL ══════════════════════════════════════════════════════════ */
.vva-shell { display: flex; min-height: 100vh; }
/* Ambient glow keeps the dark from reading flat. Fixed + non-interactive. */
.vva-shell::before {
    content: ''; position: fixed; top: -30%; left: 12%;
    width: 60%; height: 60%; pointer-events: none; filter: blur(40px); z-index: 0;
    background: radial-gradient(circle, rgba(124,140,255,.10), transparent 62%);
}
.vva-main { flex: 1; position: relative; z-index: 1; padding: 26px 34px 60px; max-width: 1180px; }

/* ══ LEFT RAIL ══════════════════════════════════════════════════════════ */
.vva-rail {
    width: var(--rail-w); flex: none; background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column; align-items: center;
    padding: 14px 0; gap: 6px; position: sticky; top: 0; height: 100vh; z-index: 5;
}
.vva-logo {
    width: 32px; height: 32px; border-radius: 9px; margin-bottom: 14px; flex: none;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: var(--shadow-logo);
}
/* The portal's logo (vva_theme.brand_mark_html(size=32)) inside the mark. The
   gradient above is the fallback: dropped while the image is there, back when
   the image removes itself because it could not load. */
.vva-logo:has(> img) { background: none; box-shadow: var(--shadow-mark); overflow: hidden; }
.vva-logo > img { display: block; width: 100%; height: 100%; border-radius: inherit; }
.vva-ic {
    width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
    color: var(--text-dim); font-size: 16px; cursor: pointer; position: relative;
    text-decoration: none; transition: background .16s, color .16s;
}
.vva-ic:hover { background: var(--surface-2); color: var(--text); }
.vva-ic.is-active { background: var(--surface-2); color: var(--accent); }
.vva-ic.is-active::before {
    content: ''; position: absolute; left: -14px; width: 3px; height: 18px;
    background: var(--accent); border-radius: 0 3px 3px 0;
}
.vva-rail__spacer { flex: 1; }
.vva-avatar {
    width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
    background: var(--surface-2); border: 1px solid var(--border);
    font-size: 11px; font-weight: 700; color: var(--accent);
    text-decoration: none; cursor: pointer;
}

/* ══ PAGE HEAD ══════════════════════════════════════════════════════════ */
.vva-top { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; flex-wrap: wrap; }
.vva-top h1 { font-size: 21px; font-weight: 650; letter-spacing: -.3px; margin: 0; }
.vva-top .vva-sub { color: var(--text-dim); font-size: 13px; }
.vva-status-pill {
    margin-left: auto; display: flex; align-items: center; gap: 7px; font-size: 12px;
    color: var(--text-dim); background: var(--surface); border: 1px solid var(--border);
    padding: 6px 12px; border-radius: 999px;
}
.vva-status-pill i {
    width: 6px; height: 6px; border-radius: 50%; background: var(--green);
    box-shadow: 0 0 8px var(--green); font-style: normal;
}

/* ══ COMMAND PALETTE ════════════════════════════════════════════════════ */
.vva-palette {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 13px 16px; display: flex; align-items: center; gap: 12px;
    margin-bottom: 28px; cursor: text; width: 100%; text-align: left;
    font-family: var(--font-family); transition: border-color .16s, background .16s;
}
.vva-palette:hover { border-color: var(--border-lit); background: var(--surface-2); }
.vva-palette span { color: var(--text-dim); flex: 1; font-size: 13.5px; }
.vva-kbd {
    font: 11px var(--font-mono); border: 1px solid var(--border); background: var(--bg);
    padding: 3px 7px; border-radius: 6px; color: var(--text-dim);
}

/* ══ GROUP HEADING ══════════════════════════════════════════════════════ */
.vva-group { display: flex; align-items: center; gap: 10px; margin: 0 0 13px; }
.vva-group h2 {
    font-size: 11.5px; letter-spacing: 1.4px; text-transform: uppercase;
    color: var(--text-dim); font-weight: 600; margin: 0;
}
.vva-group .vva-line { flex: 1; height: 1px; background: var(--border); }
.vva-group .vva-count { font: 11px var(--font-mono); color: var(--text-faint); }

/* ══ TILE GRID ══════════════════════════════════════════════════════════ */
.vva-grid {
    display: grid; gap: 13px;
    grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
    margin-bottom: 30px;
}
.vva-tile {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 16px 17px 14px; text-decoration: none; color: inherit; display: block;
    position: relative; overflow: hidden;
    transition: transform .18s cubic-bezier(.2,.7,.3,1), border-color .18s, box-shadow .18s;
}
.vva-tile::after {
    content: ''; position: absolute; inset: 0; border-radius: var(--radius); opacity: 0;
    background: linear-gradient(135deg, rgba(124,140,255,.07), transparent 55%);
    transition: opacity .18s; pointer-events: none;
}
.vva-tile:hover { transform: translateY(-2px); border-color: var(--border-lit); box-shadow: var(--shadow-tile); }
.vva-tile:hover::after { opacity: 1; }
.vva-tile__head { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.vva-tile__icon {
    width: 32px; height: 32px; border-radius: 9px; background: var(--surface-2);
    display: grid; place-items: center; font-size: 15px; border: 1px solid var(--border); flex: none;
}
.vva-tile__name { font-weight: 600; font-size: 14.5px; letter-spacing: -.1px; }
.vva-tile__desc { color: var(--text-dim); font-size: 12.5px; line-height: 1.5; margin-bottom: 13px; min-height: 38px; }
.vva-tile__foot { display: flex; align-items: center; gap: 10px; padding-top: 11px; border-top: 1px solid var(--border); }
.vva-tile__meta { font: 11px var(--font-mono); color: var(--text-faint); margin-left: auto; }

/* ══ STATUS + ROLE CHIPS ════════════════════════════════════════════════ */
.vva-chip {
    margin-left: auto; font-size: 10.5px; font-weight: 600; letter-spacing: .4px;
    padding: 3px 8px; border-radius: 999px; white-space: nowrap;
}
.vva-chip--ok   { color: var(--green);  background: rgba(46,230,168,.10); }
.vva-chip--warn { color: var(--yellow); background: rgba(255,193,77,.10); }
.vva-chip--bad  { color: var(--red);    background: rgba(255,84,112,.10); }
.vva-chip--idle { color: var(--text-dim); background: var(--surface-2); }

.vva-role {
    font-size: 10px; letter-spacing: .8px; text-transform: uppercase; color: var(--text-dim);
    border: 1px solid var(--border); padding: 2px 7px; border-radius: 5px; white-space: nowrap;
}
.vva-role--admin {
    color: var(--accent); border-color: rgba(124,140,255,.35); background: rgba(124,140,255,.08);
}

/* ══ SPARKLINE (pure CSS — no chart library) ════════════════════════════ */
.vva-spark { display: flex; align-items: flex-end; gap: 2px; height: 16px; }
.vva-spark i {
    width: 3px; border-radius: 1px; display: block;
    background: linear-gradient(180deg, var(--accent), rgba(124,140,255,.25));
}

/* ══ BANNERS ════════════════════════════════════════════════════════════ */
.vva-banner {
    display: flex; gap: 12px; align-items: flex-start; border-radius: var(--radius);
    padding: 13px 16px; margin-bottom: 26px; font-size: 13px;
}
.vva-banner p { margin: 2px 0 0; font-size: 12.5px; color: var(--text-dim); }
.vva-banner--warn { background: rgba(255,193,77,.07); border: 1px solid rgba(255,193,77,.25); }
.vva-banner--warn b { color: var(--yellow); }
.vva-banner--bad  { background: rgba(255,84,112,.07); border: 1px solid rgba(255,84,112,.25); }
.vva-banner--bad b { color: var(--red); }

.vva-env-banner {
    padding: 6px 16px; text-align: center; font-weight: 700; font-size: .8rem;
    letter-spacing: 1px; text-transform: uppercase;
}

/* ══ HEADER (tools that don't use the rail — Streamlit, Dash) ═══════════ */
.vva-header {
    display: flex; align-items: center; gap: 12px; padding: 10px 16px;
    background: var(--surface); border-bottom: 1px solid var(--border);
    font-family: var(--font-family);
}
.vva-header__brand {
    display: flex; align-items: center; gap: 8px; font-weight: 700;
    color: var(--text); text-decoration: none; letter-spacing: .3px;
}
.vva-header__mark {
    width: 22px; height: 22px; border-radius: 6px; flex: none;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: var(--shadow-logo);
}
/* The portal's logo, <portal origin>/_vva/brand/mark.png (header_html() puts
   it here). The gradient square above is the fallback: dropped while the
   image is there, back when the image removes itself because it could not
   load (an offline demo, the portal down). */
.vva-header__mark:has(> img) { background: none; box-shadow: var(--shadow-mark); overflow: hidden; }
.vva-header__mark > img { display: block; width: 100%; height: 100%; border-radius: inherit; }
.vva-header__tool { color: var(--text-dim); font-weight: 500; }
.vva-header__tool::before { content: '/'; margin-right: 8px; opacity: .5; }
.vva-header__spacer { flex: 1; }
.vva-header__user { color: var(--text-dim); font-size: .85rem; }
.vva-header__role {
    margin-left: 6px; padding: 2px 7px; border-radius: 999px;
    border: 1px solid var(--border); background: var(--surface-2);
    font-size: .7rem; text-transform: uppercase; letter-spacing: .5px;
}
.vva-header__link { color: var(--accent); text-decoration: none; font-size: .85rem; }
.vva-header__link:hover { text-decoration: underline; }

/* ══ TRAINING VIDEO BUTTON (vva-training.js) ════════════════════════════ */
/* The script puts it first inside an app's data-training="<tool>/<tab>"
   element. The play glyph is a border triangle in currentColor, so it is
   the token's white in every font (a text B6 can render as an emoji).
   The min sizes and margin are set because a tool's global button rule (one
   sets min-height: 44px) would otherwise reach through and bend the circle. */
.vva-training {
    display: inline-flex; align-items: center; justify-content: center; flex: none;
    width: 32px; height: 32px; min-width: 32px; min-height: 32px; margin: 0;
    padding: 0; border: 0; border-radius: 50%;
    background: var(--accent); color: var(--on-accent); cursor: pointer;
    vertical-align: middle; transition: background .15s;
}
.vva-training:hover { background: var(--accent-2); }
.vva-training:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.vva-training::before {
    content: ''; margin-left: 3px; border-style: solid;
    border-width: 6px 0 6px 10px; border-color: transparent transparent transparent currentColor;
}

/* ══ BUSY STATE (vva-busy.js) ═══════════════════════════════════════════ */
/* A press that started work: the script sets aria-busy and swaps the label.
   Opacity is limited to controls so a container another library marks busy
   is not dimmed. */
[aria-busy="true"] { cursor: progress; }
button[aria-busy="true"], input[aria-busy="true"], a[aria-busy="true"], [role="button"][aria-busy="true"] {
    opacity: .75; color: var(--text-dim);
}
.vva-btn[aria-busy="true"], .vva-btn[aria-busy="true"]:hover { background: var(--surface-2); color: var(--text-dim); }

/* ══ PRIMITIVES ═════════════════════════════════════════════════════════ */
.vva-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.vva-muted { color: var(--text-dim); }
.vva-pnl-positive { color: var(--pnl-positive); }
.vva-pnl-negative { color: var(--pnl-negative); }
.vva-ok { color: var(--green); } .vva-warn { color: var(--yellow); } .vva-error { color: var(--red); }

.vva-btn {
    background: var(--accent); color: #fff; border: 0; border-radius: var(--radius-sm);
    padding: 8px 14px; font-weight: 600; font-size: 13px; cursor: pointer;
    font-family: var(--font-family); transition: background .15s;
}
.vva-btn:hover { background: var(--accent-2); }
.vva-btn--ghost { background: transparent; border: 1px solid var(--border); color: var(--text-dim); }
.vva-btn--ghost:hover { background: transparent; border-color: var(--red); color: var(--red); }

/* ══ TAB NAV (vva_nav macro / nav_html) ════════════════════════════════ */
/* Above the nav-collapse width: a normal tab row. At or below it: one compact
   row (the current tab + a Menu button) that opens a full-width dropdown.
   vva-nav.js opens and closes it, and the fold applies only once it has run
   (html.vva-nav-js); the width is tokens.json's
   breakpoint.nav-collapse, compiled into the media query below. */
.vva-nav { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1 1 auto;
           font-family: var(--font-family); }
.vva-nav__current, .vva-nav__toggle, .vva-nav__scrim { display: none; }
.vva-nav__list { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-width: 0; }
.vva-nav__tab {
    display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px;
    border-radius: var(--radius-sm); color: var(--text-dim); font-size: 13px;
    text-decoration: none; white-space: nowrap; transition: background .16s, color .16s;
}
.vva-nav__tab:hover { background: var(--surface-2); color: var(--text); }
.vva-nav__tab.is-active { background: var(--accent); color: var(--text); }
.vva-nav__tab:focus-visible, .vva-nav__toggle:focus-visible {
    outline: 2px solid var(--accent); outline-offset: 2px;
}
.vva-nav__badge {
    min-width: 18px; padding: 0 6px; border-radius: 999px; text-align: center;
    background: var(--red); color: var(--bg); font-size: 11px; font-weight: 700; line-height: 18px;
}
.vva-nav__dot {
    position: absolute; top: 7px; right: 7px; width: 8px; height: 8px;
    border-radius: 50%; background: var(--red);
}
.vva-nav__bars::before { content: '\2630'; }
.vva-nav.is-open .vva-nav__bars::before { content: '\2715'; }

@media (max-width: 768px) {
    /* vva-nav: the tabs fold behind the Menu button - only once vva-nav.js
       has run and marked <html class="vva-nav-js">. Without the script (a
       portal not yet serving it, a blocked request) the tabs stay the
       wrapped row above, so no tab is ever behind a button that cannot open. */
    .vva-nav-js .vva-nav { position: relative; }
    .vva-nav-js .vva-nav.is-open { z-index: 1000; }
    .vva-nav-js .vva-nav__current {
        display: block; flex: 1 1 auto; min-width: 0; overflow: hidden;
        text-overflow: ellipsis; white-space: nowrap;
        color: var(--text); font-size: 15px; font-weight: 600;
    }
    .vva-nav-js .vva-nav__toggle {
        display: inline-flex; align-items: center; justify-content: center; position: relative;
        flex: none; width: var(--tap-target); height: var(--tap-target); margin: 0; padding: 0;
        background: none; border: 1px solid var(--border); border-radius: var(--radius-sm);
        color: var(--text); font: 20px/1 var(--font-family); cursor: pointer;
    }
    .vva-nav-js .vva-nav__toggle:hover { background: var(--surface-2); }
    .vva-nav-js .vva-nav__list { display: none; }
    .vva-nav-js .vva-nav.is-open .vva-nav__list, .vva-nav-js .vva-nav.is-open .vva-nav__scrim {
        display: flex; position: absolute; top: 100%;
        left: var(--vva-nav-x, 0); width: var(--vva-nav-w, 100%);
    }
    .vva-nav-js .vva-nav.is-open .vva-nav__scrim { height: 100vh; background: var(--scrim); }
    .vva-nav-js .vva-nav.is-open .vva-nav__list {
        z-index: 1; flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 0;
        max-height: 75vh; overflow-y: auto; padding: 8px 0;
        background: var(--surface); border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-menu);
    }
    .vva-nav-js .vva-nav__tab {
        min-height: var(--tap-target); padding: 10px 24px; border-radius: 0; font-size: 15px;
    }
    .vva-nav-js .vva-nav__tab.is-active {
        background: var(--surface-2); color: var(--text);
        border-left: 3px solid var(--accent); padding-left: 21px;
    }
}

@media (max-width: 720px) {
    .vva-rail { position: fixed; bottom: 0; top: auto; width: 100%; height: 56px;
                flex-direction: row; border-right: 0; border-top: 1px solid var(--border); }
    .vva-logo, .vva-rail__spacer { display: none; }
    .vva-main { padding: 18px 16px 80px; }
    .vva-ic.is-active::before { left: 50%; top: -14px; transform: translateX(-50%);
                                width: 18px; height: 3px; border-radius: 0 0 3px 3px; }
}
