/* Dark trading terminal theme */
:root {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-panel: #1c2128;
    --border: #30363d;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    --accent: #58a6ff;
    --positive: #3fb950;
    --negative: #f85149;
    --warning: #d29922;
    --pending: #8b949e;
    --header-bg: #010409;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

/* Header */
.header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 20px;
    background: var(--header-bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-left { display: flex; align-items: center; gap: 24px; }
.logo { font-size: 16px; font-weight: 700; color: var(--accent); font-family: var(--font-mono); }
.nav-links { display: flex; gap: 16px; }
.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    padding: 4px 8px;
    border-radius: 4px;
}
.nav-links a:hover { color: var(--text-primary); background: var(--bg-secondary); }
.nav-links a.active { color: var(--accent); }
.header-right { display: flex; align-items: center; gap: 16px; }

/* Header vitals — compact inline telemetry */
.header-vitals {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-left: 16px;
    padding-left: 16px;
    border-left: 1px solid var(--border);
}
.vital {
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: var(--font-mono);
    font-size: 11px;
}
.vital-label {
    color: var(--text-muted);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    width: 24px;
}
.vital-bar {
    width: 36px;
    height: 5px;
    background: #21262d;
    border-radius: 3px;
    overflow: hidden;
    flex-shrink: 0;
}
.vital-fill {
    height: 100%;
    background: var(--positive);
    border-radius: 3px;
    transition: width 0.5s ease;
    width: 0%;
}
.vital-fill.warn { background: var(--warning); }
.vital-fill.critical { background: var(--negative); }
.vital-pct {
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    min-width: 32px;
}
.vital-pct.warn { color: var(--warning); }
.vital-pct.critical { color: var(--negative); }
.header-stat { color: var(--text-secondary); font-family: var(--font-mono); font-size: 13px; }
.status-badge {
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    font-family: var(--font-mono);
}
.status-badge.running { background: #0d3320; color: var(--positive); border: 1px solid var(--positive); }
.status-badge.stopped { background: #3d1318; color: var(--negative); border: 1px solid var(--negative); }

/* Content grid */
.content { padding: 16px; }
.grid-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.grid-container.single-column { grid-template-columns: 1fr; }
.grid-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.panel {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    min-height: 200px;
    overflow: hidden;
}
.panel-wide { grid-column: span 2; }
.panel-full { grid-column: span 1; }
.panel-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.panel-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 16px;
    margin-bottom: 8px;
}

/* Positions */
.positions-list { display: flex; flex-direction: column; gap: 8px; }
.position-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.position-symbol { font-weight: 700; font-family: var(--font-mono); font-size: 15px; }
.position-side { font-size: 11px; text-transform: uppercase; font-weight: 600; }
.position-side.long { color: var(--positive); }
.position-side.short { color: var(--negative); }
.position-pnl { font-family: var(--font-mono); font-weight: 600; }
.positive { color: var(--positive); }
.negative { color: var(--negative); }

/* Sentiment heatmap */
.sentiment-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
}
.sentiment-tile {
    aspect-ratio: 1;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    cursor: default;
}
.sentiment-tile .symbol { font-size: 10px; opacity: 0.9; }
.sentiment-tile .score { font-size: 13px; }

/* Data tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    font-family: var(--font-mono);
}
.data-table th {
    text-align: left;
    padding: 8px 10px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border);
}
.data-table td {
    padding: 6px 10px;
    border-bottom: 1px solid #21262d;
}
.data-table tr:hover td { background: var(--bg-secondary); }

/* Metrics */
.metric-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 12px;
}
.metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 6px;
}
.metric-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; }
.metric-value { font-size: 20px; font-weight: 700; font-family: var(--font-mono); margin-top: 4px; }

/* Scorecard */
.scorecard { display: flex; flex-direction: column; gap: 6px; }
.gate {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 13px;
}
.gate-label { color: var(--text-secondary); }
.gate-status {
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 700;
}
.gate-status.pass { background: #0d3320; color: var(--positive); }
.gate-status.fail { background: #3d1318; color: var(--negative); }
.gate-status.pending { background: #2a2000; color: var(--warning); }

/* Progress bar */
.progress-section {
    margin-top: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.progress-label { font-size: 12px; color: var(--text-secondary); white-space: nowrap; }
.progress-bar {
    flex: 1;
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}
.progress-text { font-family: var(--font-mono); font-size: 12px; color: var(--text-secondary); }

/* Edge sparklines */
.edge-sparklines { display: flex; flex-direction: column; gap: 4px; }
.edge-metric {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 12px;
}
.edge-metric .label { width: 100px; color: var(--text-secondary); }
.edge-metric .value { width: 60px; text-align: right; }

/* Empty state */
.empty-state {
    color: var(--text-muted);
    text-align: center;
    padding: 24px;
    font-style: italic;
}

/* Responsive */
@media (max-width: 1200px) {
    .grid-container { grid-template-columns: 1fr; }
    .panel-wide { grid-column: span 1; }
    .grid-row { grid-template-columns: 1fr; }
}

/* === INCUBATION HERO === */
.incubation-hero {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 16px 20px;
    margin: 16px 16px 0;
    background: linear-gradient(135deg, #1a1f2e 0%, #1c2128 100%);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: 8px;
}
.hero-left { flex-shrink: 0; }
.hero-label {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--accent);
    text-transform: uppercase;
}
.hero-phase {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 2px;
}
.hero-progress { flex: 1; min-width: 0; }
.hero-progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    font-family: var(--font-mono);
}
.hero-count { font-weight: 700; color: var(--text-primary); font-size: 14px; }
.hero-bar {
    height: 12px;
    background: var(--bg-secondary);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border);
}
.hero-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #1f6feb 0%, #58a6ff 100%);
    border-radius: 6px;
    transition: width 0.5s ease;
    width: 0%;
}
.hero-bar-fill.complete {
    background: linear-gradient(90deg, #238636 0%, #3fb950 100%);
}
.hero-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}
.hero-verdict {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    color: var(--warning);
    margin-top: 4px;
}
.hero-verdict.ready { color: var(--positive); }
.hero-right {
    display: flex;
    gap: 20px;
    flex-shrink: 0;
}
.hero-stat { text-align: center; }
.hero-stat-value {
    display: block;
    font-family: var(--font-mono);
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}
.hero-stat-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* === DECISIONS TABLE === */
.decisions-scroll {
    max-height: 380px;
    overflow-y: auto;
}
.decisions-scroll::-webkit-scrollbar { width: 6px; }
.decisions-scroll::-webkit-scrollbar-track { background: var(--bg-secondary); }
.decisions-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
#decisions-table .td-time { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
#decisions-table {
    table-layout: fixed;
}
#decisions-table .td-reasoning {
    font-size: 11px;
    color: var(--text-muted);
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.action-trade { color: var(--positive); font-weight: 700; }
.action-pass { color: var(--positive); font-weight: 700; }
.action-skip { color: var(--warning); }
.action-reject { color: var(--negative); }
.eval-tab { background: none; border: 1px solid var(--border); color: var(--text-muted); padding: 2px 8px; border-radius: 4px; cursor: pointer; font-size: 11px; font-family: var(--font-mono); margin-left: 4px; }
.eval-tab.active { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.eval-tab:hover { border-color: var(--accent); }
.score-pass { color: var(--positive); font-weight: 700; }
.score-near { color: var(--warning); }
.score-low { color: var(--text-muted); }
.regime-uptrend { color: var(--positive); }
.regime-downtrend { color: var(--negative); }
.regime-ranging { color: var(--warning); }
.regime-choppy { color: #f0883e; }

/* === GHOST ENGINE CONSOLE === */
#panel-ghost { min-height: 240px; position: relative; }
.console-badge {
    float: right;
    font-size: 9px;
    font-weight: 700;
    font-family: var(--font-mono);
    padding: 1px 6px;
    border-radius: 3px;
    background: #0d3320;
    color: var(--positive);
    letter-spacing: 1px;
    animation: pulse-badge 2s infinite;
}
@keyframes pulse-badge {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
.ghost-console {
    background: #0d1117;
    border: 1px solid #21262d;
    border-radius: 4px;
    padding: 8px 12px;
    max-height: 320px;
    overflow-y: auto;
    font-family: var(--font-mono);
    font-size: 11px;
    line-height: 1.6;
}
.ghost-console::-webkit-scrollbar { width: 6px; }
.ghost-console::-webkit-scrollbar-track { background: #0d1117; }
.ghost-console::-webkit-scrollbar-thumb { background: #30363d; border-radius: 3px; }
.console-line { white-space: pre-wrap; word-break: break-all; }
.console-line.muted { color: var(--text-muted); }
.console-line.ghost { color: #bc8cff; }
.console-line.skip { color: #f0883e; }
.console-line.signal { color: var(--accent); }
.console-line.trade { color: var(--positive); font-weight: 600; }
.console-line.market { color: var(--text-secondary); }
.console-line.stream { color: #3d444d; }
.console-line.init { color: #388bfd; }

/* === SHADOW TRADES FEED === */
.shadow-badge {
    float: right;
    font-size: 10px;
    font-weight: 600;
    font-family: var(--font-mono);
    padding: 2px 8px;
    border-radius: 3px;
    background: #1a1f35;
    color: var(--accent);
    letter-spacing: 0.5px;
}
.shadow-section { margin-bottom: 8px; }
.shadow-section-label {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 6px;
    padding-left: 2px;
}
.shadow-scroll {
    max-height: 300px;
    overflow-y: auto;
}
.shadow-scroll::-webkit-scrollbar { width: 6px; }
.shadow-scroll::-webkit-scrollbar-track { background: var(--bg-secondary); }
.shadow-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.shadow-table td { font-size: 12px; }
.shadow-table th { font-size: 10px; }

/* Challenger ID badges */
.challenger-tag {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 700;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.challenger-tag.alpha { background: #1a2744; color: #58a6ff; }
.challenger-tag.beta { background: #2a2000; color: #d29922; }
.challenger-tag.gamma { background: #0d3320; color: #3fb950; }
.challenger-tag.champ { background: #2a1530; color: #bc8cff; }

/* Direction badges */
.dir-long { color: var(--positive); font-weight: 600; }
.dir-short { color: var(--negative); font-weight: 600; }

/* Result badges */
.result-tag {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 700;
    font-family: var(--font-mono);
}
.result-tag.tp { background: #0d3320; color: var(--positive); }
.result-tag.sl { background: #3d1318; color: var(--negative); }
.result-tag.timeout { background: #2a2000; color: var(--warning); }

/* Open order pulse */
.shadow-open-row td:first-child { position: relative; }
.shadow-open-row td:first-child::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    margin-right: 6px;
    animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* === MODE BADGE === */
.mode-badge {
    padding: 2px 10px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 1px;
    transition: all 0.15s;
    text-transform: uppercase;
}
.mode-badge.paper {
    background: #0d3320;
    color: var(--positive);
    border: 1px solid var(--positive);
}
.mode-badge.live {
    background: #3d2600;
    color: var(--warning);
    border: 1px solid var(--warning);
    animation: live-pulse 2s ease-in-out infinite;
}
@keyframes live-pulse {
    0%, 100% { box-shadow: 0 0 0 rgba(210, 153, 34, 0); }
    50% { box-shadow: 0 0 8px rgba(210, 153, 34, 0.4); }
}
.mode-badge:hover { opacity: 0.8; }
.mode-confirm-btn {
    padding: 8px 20px;
    border: none;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.5px;
}
.mode-confirm-btn.live {
    background: var(--warning);
    color: #000;
}
.mode-confirm-btn.paper {
    background: var(--positive);
    color: #000;
}
.mode-confirm-btn:hover { opacity: 0.9; }
.mode-modal-box { max-width: 440px; }

/* === KILL SWITCH === */
.kill-switch-btn {
    background: transparent;
    color: var(--negative);
    border: 1px solid var(--negative);
    padding: 2px 10px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 1px;
    transition: all 0.15s;
}
.kill-switch-btn:hover {
    background: var(--negative);
    color: #fff;
    box-shadow: 0 0 12px rgba(248, 81, 73, 0.4);
}

/* Kill Switch Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-box {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 24px;
    max-width: 480px;
    width: 90%;
}
.kill-modal-box {
    border-color: var(--negative);
    border-width: 2px;
}
.kill-confirm-btn {
    background: var(--negative);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.5px;
}
.kill-confirm-btn:hover { filter: brightness(1.2); }
.kill-cancel-btn {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    padding: 10px 20px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 13px;
    cursor: pointer;
}
.kill-cancel-btn:hover { color: var(--text-primary); border-color: var(--text-secondary); }

/* === WebSocket Indicator === */
.ws-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
}
.ws-indicator.connected {
    background: var(--positive);
    box-shadow: 0 0 6px var(--positive);
}
.ws-indicator.disconnected {
    background: var(--negative);
    animation: pulse-dot 1.5s infinite;
}

/* === OFI VACUUM TELEMETRY === */
.ofi-badge {
    background: #1a1535 !important;
    color: #a371f7 !important;
}
.ofi-badge.flash {
    background: #a371f7 !important;
    color: #fff !important;
    transition: all 0.2s;
}
.ofi-console {
    max-height: 240px;
}
.console-line.ofi-line { color: #a371f7; }

/* === SLIPPAGE PANEL === */
.slippage-grid { grid-template-columns: repeat(3, 1fr); }
#slippage-table { font-size: 12px; }
#slippage-table th { font-size: 10px; }

/* === CHALLENGER TAGS (extended) === */
.challenger-tag.delta { background: #1a2744; color: #58a6ff; }
.challenger-tag.epsilon { background: #2a1530; color: #bc8cff; }
.challenger-tag.zeta { background: #0d3320; color: #3fb950; }
.challenger-tag.eta { background: #2a2000; color: #d29922; }
.challenger-tag.theta { background: #1a3320; color: #56d364; }
.challenger-tag.ofi_vacuum { background: #1a1535; color: #a371f7; }

/* === PROTECTION BADGE === */
.prot-badge {
    font-size: 9px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 8px;
    margin-left: 6px;
    text-transform: uppercase;
    font-family: var(--font-mono);
    letter-spacing: 0.5px;
}
.prot-badge.protected {
    background: #0d3320;
    color: #3fb950;
    border: 1px solid #3fb950;
}
.prot-badge.unprotected {
    background: #3d1318;
    color: #f85149;
    border: 1px solid #f85149;
    animation: blink-prot 1s infinite;
}
@keyframes blink-prot {
    50% { opacity: 0.3; }
}

/* === SERVER HEALTH TELEMETRY === */
.health-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
.health-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px;
}
.health-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.health-label {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-muted);
    text-transform: uppercase;
}
.health-value {
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}
.health-value.ok { color: var(--positive); }
.health-value.warning { color: var(--warning); }
.health-value.critical { color: var(--negative); }
.health-bar-track {
    height: 6px;
    background: #21262d;
    border-radius: 3px;
    overflow: hidden;
}
.health-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease, background 0.3s ease;
    width: 0%;
}
.health-bar-fill.ok { background: var(--positive); }
.health-bar-fill.warning { background: var(--warning); }
.health-bar-fill.critical {
    background: var(--negative);
    animation: pulse-bar 1.5s infinite;
}
@keyframes pulse-bar {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}
.health-detail {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 6px;
}
.latency-bar { background: var(--accent); }

/* === SCANNER STATUS (empty state) === */
.scanner-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    text-align: center;
}
.scanner-reason {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 700;
    color: var(--warning);
    margin-bottom: 8px;
}
.scanner-detail {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    max-width: 300px;
}

/* === RISK PLACEHOLDER === */
.risk-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
    text-align: center;
}
.placeholder-icon {
    font-size: 36px;
    margin-bottom: 12px;
    opacity: 0.5;
}
.placeholder-text {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 700;
    color: var(--warning);
    margin-bottom: 6px;
}
.placeholder-detail {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
}

/* === INTELLIGENCE VAULT === */
.vault-badge { background: #1a1a2e !important; color: #6e7681 !important; }
.vault-active-badge { background: #0d2818 !important; color: #3fb950 !important; animation: pulse-dot 1.5s infinite; }
.vault-golden-badge { background: #2a2000 !important; color: #f0c000 !important; box-shadow: 0 0 8px rgba(240, 192, 0, 0.4); }

.vault-coverage {
    margin-bottom: 16px;
    padding: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
}
.vault-coverage-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.vault-label {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-muted);
}
.vault-pct {
    font-family: var(--font-mono);
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
}
.vault-bar-track {
    height: 8px;
    background: #21262d;
    border-radius: 4px;
    overflow: hidden;
}
.vault-bar-fill {
    height: 100%;
    border-radius: 4px;
    background: var(--accent);
    transition: width 1s ease;
}
.vault-bar-fill.halfway { background: var(--warning); }
.vault-bar-fill.complete {
    background: linear-gradient(90deg, var(--positive), #f0c000);
    animation: shimmer 2s infinite;
}
@keyframes shimmer {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}
.vault-coverage-detail {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 6px;
}

.vault-stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}
.vault-stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px;
}
.vault-stat-header {
    margin-bottom: 8px;
}
.vault-stat-label {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.vault-regime-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}
.vault-regime {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}
.vault-regime span:last-child {
    font-weight: 700;
    margin-left: auto;
}
.regime-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.regime-dot.bull { background: var(--positive); }
.regime-dot.bear { background: var(--negative); }
.regime-dot.chop { background: var(--warning); }
.regime-dot.mixed { background: var(--text-muted); }
.vault-regime.bull { color: var(--positive); }
.vault-regime.bear { color: var(--negative); }
.vault-regime.chop { color: var(--warning); }
.vault-regime.mixed { color: var(--text-muted); }

.golden-status {
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}
.golden-status.not-found { color: var(--text-muted); }
.golden-status.found {
    color: #f0c000;
    text-shadow: 0 0 8px rgba(240, 192, 0, 0.4);
}
.golden-detail {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
}

.run-phase {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    word-break: break-all;
}
.run-phase.active { color: var(--positive); }
.run-phase.idle { color: var(--text-muted); }
.run-elapsed {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 4px;
}

.vault-entries-section { margin-top: 4px; }
.vault-entries-header {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.vault-entries-scroll {
    max-height: 200px;
    overflow-y: auto;
}
.vault-table { font-size: 12px; }
.vault-table th { font-size: 10px; }
.regime-tag {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 8px;
    letter-spacing: 0.5px;
}
.regime-tag.bull { background: #0d3320; color: #3fb950; }
.regime-tag.bear { background: #3d1318; color: #f85149; }
.regime-tag.chop { background: #2a2000; color: #d29922; }
.regime-tag.mixed { background: #1a1a2e; color: #8b949e; }
.regime-tag.unknown { background: #1a1a2e; color: #6e7681; }

@media (max-width: 900px) {
    .vault-stats-row { grid-template-columns: 1fr; }
}

/* === TRADE PERFORMANCE PANEL === */
.trade-perf-badge { background: #1a1a2e !important; color: #6e7681 !important; }
.trade-perf-badge.trade-perf-active { background: #0d2818 !important; color: #3fb950 !important; }
.tp-source-tag {
    float: right;
    font-size: 9px;
    font-weight: 700;
    font-family: var(--font-mono);
    padding: 1px 6px;
    border-radius: 3px;
    background: #1a2744;
    color: #58a6ff;
    letter-spacing: 0.5px;
    margin-right: 8px;
}

.trade-perf-hero {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.tp-stat { text-align: center; min-width: 80px; }
.tp-label {
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 4px;
}
.tp-value {
    font-family: var(--font-mono);
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}
.tp-value.positive { color: var(--positive); }
.tp-value.negative { color: var(--negative); }
.tp-best-worst { font-size: 14px; }
.tp-divider {
    width: 1px;
    height: 40px;
    background: var(--border);
    flex-shrink: 0;
}

.tp-section-label {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 6px;
    padding-left: 2px;
}
.tp-daily-section { margin-bottom: 16px; }
.tp-recent-section { }
.tp-table td { font-size: 12px; }
.tp-table th { font-size: 10px; }

@media (max-width: 900px) {
    .trade-perf-hero { gap: 12px; }
    .tp-value { font-size: 16px; }
    .tp-divider { display: none; }
}

/* Plotly overrides for dark theme */
.js-plotly-plot .plotly .modebar { background: transparent !important; }
.js-plotly-plot .plotly .modebar-btn path { fill: var(--text-secondary) !important; }

@media (max-width: 900px) {
    .health-grid { grid-template-columns: repeat(2, 1fr); }
}

/* === REPORTS HUB === */

/* Hero bar */
.rpt-hero {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 12px 20px;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #1a1f2e 0%, #1c2128 100%);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: 8px;
}
.rpt-hero-item { display: flex; flex-direction: column; align-items: center; min-width: 80px; }
.rpt-hero-label {
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 4px;
}
.rpt-hero-value {
    font-family: var(--font-mono);
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}
.rpt-hero-divider {
    width: 1px;
    height: 36px;
    background: var(--border);
    flex-shrink: 0;
}

/* Tab navigation */
.rpt-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0;
}
.rpt-tab {
    background: none;
    border: 1px solid transparent;
    border-bottom: none;
    color: var(--text-secondary);
    padding: 8px 16px;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 6px 6px 0 0;
    transition: all 0.15s;
}
.rpt-tab:hover { color: var(--text-primary); background: var(--bg-secondary); }
.rpt-tab.active {
    color: var(--accent);
    background: var(--bg-panel);
    border-color: var(--border);
    border-bottom: 1px solid var(--bg-panel);
    margin-bottom: -1px;
}

/* Tab panes */
.rpt-pane { display: none; }
.rpt-pane.active { display: block; }

/* Date selector */
.rpt-date-select {
    float: right;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 8px;
    font-family: var(--font-mono);
    font-size: 11px;
    cursor: pointer;
}

/* Active matrix row highlight */
.rpt-matrix-active td {
    background: rgba(88, 166, 255, 0.08) !important;
    border-left: 2px solid var(--accent);
}

/* Attribution bars */
.rpt-attr-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-family: var(--font-mono);
    font-size: 11px;
}
.rpt-attr-name {
    width: 80px;
    color: var(--text-secondary);
    flex-shrink: 0;
}
.rpt-attr-bar-track {
    flex: 1;
    height: 8px;
    background: #21262d;
    border-radius: 4px;
    overflow: hidden;
}
.rpt-attr-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}
.rpt-attr-val {
    width: 32px;
    text-align: right;
    color: var(--text-primary);
    font-weight: 600;
}
.rpt-attr-delta {
    width: 36px;
    text-align: right;
    font-weight: 600;
}
.rpt-attr-util {
    width: 32px;
    text-align: right;
    color: var(--text-muted);
}
.rpt-attr-label {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 4px;
}

/* Near-miss heatmap */
.rpt-heatmap-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    margin-top: 8px;
}
.rpt-heatmap-tile {
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 8px;
    font-family: var(--font-mono);
    font-weight: 600;
    border: 1px solid var(--border);
    cursor: default;
}
.rpt-heatmap-tile .symbol { font-size: 10px; color: var(--text-secondary); }
.rpt-heatmap-tile .score { font-size: 18px; color: var(--text-primary); margin: 2px 0; }

/* Restart timeline */
.rpt-timeline {
    position: relative;
    padding-left: 24px;
}
.rpt-timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}
.rpt-tl-entry {
    position: relative;
    margin-bottom: 16px;
    padding-left: 20px;
}
.rpt-tl-dot {
    position: absolute;
    left: -20px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--bg-primary);
}
.rpt-tl-dot-success { background: var(--positive); border-color: var(--positive); }
.rpt-tl-dot-refused { background: var(--negative); border-color: var(--negative); }
.rpt-tl-dot-unknown { background: var(--warning); border-color: var(--warning); }
.rpt-tl-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px 14px;
}
.rpt-tl-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}
.rpt-tl-time {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
}
.rpt-tl-reason {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-primary);
}
.rpt-tl-detail {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 4px;
}
.rpt-tl-badge {
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 3px;
    letter-spacing: 0.5px;
}
.rpt-tl-badge-force { background: #2a2000; color: var(--warning); }
.rpt-tl-badge-override { background: #3d1318; color: var(--negative); }

@media (max-width: 900px) {
    .rpt-hero { flex-wrap: wrap; gap: 12px; }
    .rpt-hero-divider { display: none; }
    .rpt-tabs { flex-wrap: wrap; }
    .rpt-heatmap-grid { grid-template-columns: repeat(3, 1fr); }
}
