/* ============================================
   DASHBOARD EXTRACTED CSS FROM layout-v2.css
   Sections: Header (438-810), Tooltips (1461-1565), Dashboard widgets (1850-3700)
   ============================================ */

/* === HEADER === */.header-row1 {
    height: var(--header-row-height);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 24px;
    background: var(--bg-secondary);
}

.screen-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.header-separator {
    width: 1px;
    height: 24px;
    background: rgba(255,255,255,0.1);
}

.metric {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: fit-content;
}

.metric-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.metric-value.positive {
    color: var(--accent-green);
}

.metric-value.negative {
    color: var(--accent-red);
}

.metric-value.warning {
    color: var(--accent-yellow);
}

.metrics-toggle {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 6px 12px;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.metrics-toggle:hover {
    background: rgba(255,255,255,0.08);
    color: var(--text-primary);
}

.header-icons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon-btn {
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 18px;
    position: relative;
    color: var(--text-primary);
}

.icon-btn:hover {
    background: rgba(255,255,255,0.1);
    transform: translateY(-1px);
    z-index: 10001; /* Ensure tooltip appears above everything when hovering */
}

.connection-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-yellow);
    animation: pulse 2s ease-in-out infinite;
}

.connection-dot.connected {
    background: var(--accent-green);
}

.connection-dot.error {
    background: var(--accent-red);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.user-avatar {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
}

/* === DASHBOARD WIDGETS === */
    color: var(--text-secondary);
    line-height: 1.3;
}
.shield-ai-tooltip .tooltip-shortcut {
    font-size: 10px;
    color: var(--text-muted);
    text-align: center;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}
.shield-ai-tooltip .shortcut-key {
    display: inline-block;
    padding: 2px 6px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
}

/* User Account Tooltip */
.user-tooltip {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 200px;
    padding: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    z-index: var(--z-tooltip);
    pointer-events: none;
}
.user-tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    right: 12px;
    border: 6px solid transparent;
    border-bottom-color: var(--border-color);
}
/* Invisible bridge to keep tooltip visible while moving cursor */
.user-tooltip::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    height: 12px;  /* Same as gap */
    background: transparent;
}
#btn-user:hover .user-tooltip,
.user-tooltip:hover {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
.user-tooltip .tooltip-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 12px;
}
.user-tooltip .tooltip-label {
    color: var(--text-muted);
}
.user-tooltip .tooltip-value {
    font-weight: 600;
    color: var(--text-primary);
}
.user-tooltip .tooltip-divider {
    height: 1px;
    background: var(--border-color);
    margin: 6px 0;
}
.user-tooltip .tooltip-action {
    margin-top: 8px;
    padding: 6px;
    text-align: center;
    font-size: 11px;
    color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.05);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
}
.user-tooltip .tooltip-action:hover {
    background: rgba(59, 130, 246, 0.1);
}

/* Scores Row: Health + Income + Quadrant */
.scores-row {
    display: grid;
    grid-template-columns: 3fr 3fr 4fr;
    gap: 16px;
    margin-bottom: 16px;
    position: relative;
    z-index: 2;
}

/* Health Score Card */
.health-score-card {
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(74, 108, 247, 0.1) 100%);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}
.health-score-body {
    display: flex;
    align-items: center;
    gap: 16px;
}
.health-score-card:hover {
    border-color: var(--accent-blue);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(74, 108, 247, 0.2);
    z-index: 50;
}
.health-score-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
}
.health-score-circle::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 4px solid var(--bg-secondary);
}
.health-score-circle.excellent { background: rgba(16, 185, 129, 0.15); border-color: var(--accent-green); }
.health-score-circle.excellent::before { border-color: var(--accent-green); }
.health-score-circle.good { background: rgba(6, 182, 212, 0.15); border-color: var(--accent-cyan); }
.health-score-circle.good::before { border-color: var(--accent-cyan); }
.health-score-circle.fair { background: rgba(245, 158, 11, 0.15); border-color: var(--accent-yellow); }
.health-score-circle.fair::before { border-color: var(--accent-yellow); }
.health-score-circle.poor { background: rgba(249, 115, 22, 0.15); border-color: var(--accent-orange); }
.health-score-circle.poor::before { border-color: var(--accent-orange); }
.health-score-circle.critical { background: rgba(239, 68, 68, 0.15); border-color: var(--accent-red); }
.health-score-circle.critical::before { border-color: var(--accent-red); }
.health-score-number { font-size: 2.5rem; font-weight: 700; line-height: 1; }
.health-score-grade { font-size: 0.9rem; font-weight: 600; margin-top: 2px; }
.health-score-details { flex: 1; }
.health-score-title { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.health-info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid var(--text-muted);
    font-size: 0.6rem;
    font-style: italic;
    color: var(--text-muted);
    cursor: help;
    flex-shrink: 0;
    position: relative;
}
.health-info-icon:hover { border-color: var(--accent-blue); color: var(--accent-blue); }
.health-info-tooltip {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    padding: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.75rem;
    line-height: 1.6;
    color: var(--text-secondary);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    z-index: 200;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    pointer-events: none;
    font-style: normal;
    text-transform: none;
    letter-spacing: normal;
}
.health-info-tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-bottom-color: var(--border-color);
}
.health-info-icon:hover .health-info-tooltip { opacity: 1; visibility: visible; }
.health-score-state { font-size: 1.1rem; font-weight: 600; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.health-score-state.excellent { color: var(--accent-green); }
.health-score-state.good { color: var(--accent-cyan); }
.health-score-state.fair { color: var(--accent-yellow); }
.health-score-state.poor { color: var(--accent-orange); }
.health-score-state.critical { color: var(--accent-red); }
.health-score-risks { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.health-risk-badge {
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}
.health-risk-badge.warning { background: rgba(245, 158, 11, 0.15); color: var(--accent-yellow); }
.health-score-summary { font-size: 0.8rem; color: var(--text-muted); }
.health-score-link { color: var(--accent-blue); margin-left: 8px; font-size: 0.75rem; }
.health-sparkline-container {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.health-sparkline-container svg { display: block; }
.health-sparkline-label { font-size: 0.6rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

/* Top Section: NLV + Theta Efficiency + Directional Bias */
.top-kpi-section {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.nlv-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border-color);
}
.nlv-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.nlv-value { font-size: 2.2rem; font-weight: 700; margin-bottom: 4px; }
.nlv-change { font-size: 0.85rem; }
.nlv-change.positive { color: var(--accent-green); }
.nlv-change.negative { color: var(--accent-red); }

.ratio-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 24px;
}
.ratio-main { flex-shrink: 0; }
.ratio-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.ratio-value-large { font-size: 3rem; font-weight: 700; line-height: 1; }
.ratio-value-large.excellent { color: var(--accent-green); }
.ratio-value-large.good { color: var(--accent-cyan); }
.ratio-value-large.warning { color: var(--accent-yellow); }
.ratio-value-large.critical { color: var(--accent-red); }

.ratio-details { flex: 1; }
.ratio-bar-container { margin-bottom: 12px; }
.ratio-bar { height: 8px; background: var(--bg-secondary); border-radius: 4px; overflow: hidden; margin-bottom: 6px; }
.ratio-bar-fill { height: 100%; border-radius: 4px; transition: width 0.5s ease; }
.ratio-bar-fill.excellent { background: linear-gradient(90deg, var(--accent-green), var(--accent-cyan)); }
.ratio-bar-fill.good { background: linear-gradient(90deg, var(--accent-cyan), var(--accent-green)); }
.ratio-bar-fill.warning { background: linear-gradient(90deg, var(--accent-yellow), var(--accent-orange)); }
.ratio-bar-fill.critical { background: linear-gradient(90deg, var(--accent-red), var(--accent-orange)); }
.ratio-scale { display: flex; justify-content: space-between; font-size: 0.65rem; color: var(--text-muted); }

.ratio-status { display: flex; align-items: center; gap: 12px; }
.ratio-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
}
.ratio-badge.excellent { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); }
.ratio-badge.good { background: rgba(6, 182, 212, 0.15); color: var(--accent-cyan); }
.ratio-badge.warning { background: rgba(245, 158, 11, 0.15); color: var(--accent-yellow); }
.ratio-badge.critical { background: rgba(239, 68, 68, 0.15); color: var(--accent-red); }
.ratio-note { font-size: 0.75rem; color: var(--text-muted); margin-top: 8px; }

/* Directional Bias Card */
.bias-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.bias-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px; }
.bias-track-wrapper { margin-bottom: 10px; }
.bias-track {
    position: relative;
    height: 10px;
    border-radius: 5px;
    background: linear-gradient(90deg,
        var(--accent-red) 0%,
        rgba(239, 68, 68, 0.4) 20%,
        rgba(6, 182, 212, 0.3) 40%,
        rgba(6, 182, 212, 0.5) 50%,
        rgba(6, 182, 212, 0.3) 60%,
        rgba(16, 185, 129, 0.4) 80%,
        var(--accent-green) 100%
    );
}
.bias-dot {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 3px solid var(--bg-card);
    box-shadow: 0 0 6px rgba(0,0,0,0.4);
    transition: left 0.5s ease, background-color 0.3s ease;
}
.bias-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.6rem;
    color: var(--text-muted);
    margin-top: 4px;
}
.bias-current {
    text-align: center;
    margin-top: 10px;
    font-size: 0.9rem;
    font-weight: 600;
}
.bias-current .bias-value { font-size: 0.8rem; font-weight: 400; color: var(--text-muted); margin-left: 4px; }
.bias-current.strong-bearish { color: var(--accent-red); }
.bias-current.bearish { color: #f87171; }
.bias-current.neutral { color: var(--accent-cyan); }
.bias-current.bullish { color: #34d399; }
.bias-current.strong-bullish { color: var(--accent-green); }

/* Health Cards Grid */
.health-cards-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.health-card {
    background: var(--bg-card);
    border-radius: 10px;
    padding: 14px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}
.health-card:hover { border-color: var(--accent-blue); transform: translateY(-2px); z-index: 5; }
.health-card.active { border-color: var(--accent-blue); background: rgba(74, 108, 247, 0.05); }
.health-card.has-action::after {
    content: '!';
    position: absolute;
    top: -4px;
    right: -4px;
    width: 16px;
    height: 16px;
    background: var(--accent-orange);
    border-radius: 50%;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.health-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.health-card-title { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; }
.health-indicator { width: 8px; height: 8px; border-radius: 50%; }
.health-indicator.green { background: var(--accent-green); }
.health-indicator.yellow { background: var(--accent-yellow); }
.health-indicator.orange { background: var(--accent-orange); }
.health-indicator.red { background: var(--accent-red); }
/* No-data state — surfaces a missing severity instead of falsely
   defaulting to green. Used by gamma alignment, hedge severity, etc. */
.health-indicator.muted { background: var(--text-muted); opacity: 0.5; }

.health-card-value { font-size: 1.3rem; font-weight: 700; margin-bottom: 2px; }
.health-card-value.positive { color: var(--accent-green); }
.health-card-value.warning { color: var(--accent-yellow); }
.health-card-value.orange { color: var(--accent-orange); }
.health-card-value.negative { color: var(--accent-red); }
.health-card-value.neutral { color: var(--text-primary); }
/* Missing data — gray italic so a "--" rendering is visually distinct
   from a real numeric value. */
.health-card-value.muted { color: var(--text-muted); font-style: italic; }

.health-card-sub { font-size: 0.7rem; color: var(--text-muted); }

/* Income Engine widget */
.ie-value-row { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.ie-badge {
    font-size: 0.6rem; padding: 2px 6px; border-radius: 4px;
    font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
    white-space: nowrap;
}
.ie-badge.running  { background: rgba(34,197,94,0.15);  color: var(--accent-green); }
.ie-badge.idle     { background: rgba(234,179,8,0.15);  color: var(--accent-yellow); }
.ie-badge.stalled  { background: rgba(249,115,22,0.15); color: #f97316; }
.ie-status-icon { font-size: 0.85rem; line-height: 1; }
.ie-action { font-size: 0.65rem; color: var(--text-muted); margin-top: 2px; }
.ie-action a { color: var(--accent-blue); text-decoration: underline; cursor: pointer; }
.ie-tooltip { width: 300px; right: auto; left: 0; transform: none; background: var(--bg-card); z-index: 200; }

.ae-action-hint {
    font-size: 0.6rem;
    color: var(--accent-orange);
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    line-height: 1.2;
}
.ae-action-hint:hover { color: var(--accent-blue); }

.position-badge {
    font-size: 0.6rem;
    padding: 1px 5px;
    border-radius: 3px;
    font-weight: 500;
    margin-left: 6px;
}
.position-badge.bearish { background: rgba(239, 68, 68, 0.15); color: var(--accent-red); }
.position-badge.bullish { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); }

/* Dashboard Risk Row - 2 column layout */
.dashboard-risk-row {
    display: grid;
    grid-template-columns: 40% 1fr;
    gap: 12px;
    margin-bottom: 16px;
}
.risk-left-col { display: flex; flex-direction: column; gap: 12px; }

/* Stress Compact Card */
.stress-compact {
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    padding: 12px 14px;
    cursor: pointer;
    transition: border-color 0.2s;
}
.stress-compact:hover { border-color: var(--accent-blue); }
.stress-compact.ok { border-color: rgba(16, 185, 129, 0.3); }
.stress-compact.warning { border-color: rgba(245, 158, 11, 0.3); background: rgba(245, 158, 11, 0.04); }
.stress-compact.critical { border-color: rgba(239, 68, 68, 0.3); background: rgba(239, 68, 68, 0.04); }
.stress-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.stress-header-icon { font-size: 0.9rem; }
.stress-header-title { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; }
.stress-status { font-size: 0.8rem; font-weight: 600; }
.stress-status.ok { color: var(--accent-green); }
.stress-status.warning { color: var(--accent-yellow); }
.stress-status.critical { color: var(--accent-red); }
.stress-link { font-size: 0.7rem; color: var(--accent-blue); margin-top: 4px; display: inline-block; }
.stress-link:hover { text-decoration: underline; }
/* Survival Score row (replaces stress-status) */
.stress-score-row { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.stress-score-number { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.stress-score-number.ok { color: var(--accent-green); }
.stress-score-number.warning { color: var(--accent-yellow); }
.stress-score-number.critical { color: var(--accent-red); }
.stress-score-meta { display: flex; flex-direction: column; gap: 2px; }
.stress-grade { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.stress-grade.ok { color: var(--accent-green); }
.stress-grade.warning { color: var(--accent-yellow); }
.stress-grade.critical { color: var(--accent-red); }
.stress-sub { font-size: 0.68rem; color: var(--text-muted); }

/* Greeks Compact Card */
.greeks-compact {
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    padding: 12px 14px;
    flex: 1;
}
.greeks-compact.ok { border-color: rgba(16, 185, 129, 0.3); }
.greeks-compact.warning { border-color: rgba(245, 158, 11, 0.3); background: rgba(245, 158, 11, 0.04); }
.greeks-compact.danger { border-color: rgba(239, 68, 68, 0.3); background: rgba(239, 68, 68, 0.04); }
.greeks-compact.critical { border-color: rgba(220, 38, 38, 0.4); background: rgba(220, 38, 38, 0.04); }
.greeks-compact-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.greeks-compact-title { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; }
.greeks-compact-badge {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 3px;
}
.greeks-compact-badge.ok { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); }
.greeks-compact-badge.warning { background: rgba(245, 158, 11, 0.15); color: var(--accent-yellow); }
.greeks-compact-badge.danger { background: rgba(239, 68, 68, 0.15); color: var(--accent-red); }
.greeks-compact-badge.critical { background: rgba(220, 38, 38, 0.2); color: #dc2626; }
.greek-row {
    display: flex;
    align-items: center;
    padding: 2px 0;
    font-size: 0.75rem;
}
.greek-row-name { color: var(--text-muted); width: 48px; }
.greek-row-value { color: var(--text-primary); font-family: var(--font-mono, monospace); flex: 1; }
.greek-row-icon { width: 16px; text-align: center; font-size: 0.7rem; }
.greek-row-icon.ok { color: var(--accent-green); }
.greek-row-icon.warning { color: var(--accent-yellow); }
.greek-row-icon.danger { color: var(--accent-red); }
.greek-row-icon.critical { color: #dc2626; }
.greeks-compact-link {
    font-size: 0.7rem;
    color: var(--accent-blue);
    margin-top: 6px;
    display: inline-block;
    cursor: pointer;
}
.greeks-compact-link:hover { text-decoration: underline; }

/* Correlation Risk Expanded Card */
.corr-expanded {
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    padding: 14px 16px;
    cursor: pointer;
    transition: border-color 0.2s;
    display: flex;
    flex-direction: column;
}
.corr-expanded:hover { border-color: var(--accent-blue); }
.corr-expanded.ok { border-color: rgba(16, 185, 129, 0.3); }
.corr-expanded.warning { border-color: rgba(245, 158, 11, 0.3); }
.corr-expanded.danger { border-color: rgba(239, 68, 68, 0.3); }
/* No-data fallback — muted gray border so a missing severity shows as
   "no info" instead of falsely defaulting to the green "ok" border. */
.corr-expanded.muted { border-color: rgba(148, 163, 184, 0.3); }
.corr-exp-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}
.corr-exp-icon { font-size: 0.9rem; }
.corr-exp-title { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; flex: 1; }
.corr-exp-grade {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 0.3px;
}
.corr-exp-grade.grade-a { background: rgba(16, 185, 129, 0.2); color: var(--accent-green); }
.corr-exp-grade.grade-b { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); }
.corr-exp-grade.grade-c { background: rgba(245, 158, 11, 0.2); color: var(--accent-yellow); }
.corr-exp-grade.grade-f { background: rgba(239, 68, 68, 0.2); color: var(--accent-red); }
.corr-exp-metrics {
    display: flex;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 6px;
}
.corr-exp-metric-label { font-size: 0.68rem; color: var(--text-muted); margin-right: 3px; }
.corr-exp-metric-value { font-size: 0.85rem; font-weight: 700; color: var(--text-primary); }
.corr-di-bar {
    height: 4px;
    background: rgba(255,255,255,0.08);
    border-radius: 2px;
    margin-bottom: 12px;
    overflow: hidden;
}
.corr-di-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.5s ease, background 0.5s ease;
    width: 0%;
}
.corr-exp-divider {
    border-top: 1px solid var(--border-color);
    margin: 8px 0;
}
.corr-pair-row {
    display: flex;
    align-items: center;
    padding: 3px 0;
    font-size: 0.75rem;
}
.corr-pair-name { color: var(--text-secondary); flex: 1; }
.corr-pair-val { font-weight: 600; min-width: 36px; text-align: right; }
.corr-pair-val.high { color: var(--accent-red); }
.corr-pair-val.medium { color: var(--accent-yellow); }
.corr-pair-val.low { color: var(--accent-green); }
.corr-pair-src { font-size: 0.6rem; color: var(--text-muted); margin-left: 6px; min-width: 56px; }
.corr-pair-warn { font-size: 0.65rem; color: var(--accent-red); margin-left: 6px; font-weight: 500; }
.corr-exp-stats {
    display: flex;
    gap: 16px;
    font-size: 0.73rem;
    color: var(--text-secondary);
    margin-top: 2px;
}
.corr-exp-stats span { white-space: nowrap; }
.corr-exp-stats .increase { color: var(--accent-red); font-weight: 500; }
.corr-exp-message {
    font-size: 0.72rem;
    margin-top: 8px;
    padding: 6px 8px;
    border-radius: 4px;
    line-height: 1.4;
}
.corr-exp-message.warn { background: rgba(245, 158, 11, 0.08); color: var(--accent-yellow); }
.corr-exp-message.rec { background: rgba(74, 108, 247, 0.08); color: var(--accent-blue); font-style: italic; }
.corr-pairs-footer {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid var(--border-color);
}
.corr-pairs-footer a {
    color: var(--accent-blue);
    text-decoration: none;
}
.corr-pairs-footer a:hover { text-decoration: underline; }

@media (max-width: 1200px) {
    .dashboard-risk-row { grid-template-columns: 1fr; }
}

/* Score Trio Row: Survival Score | Discipline | Friction Tax */
.score-trio-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}

/* Survival Score card in trio — match health-card big style */
.score-trio-row .stress-compact {
    padding: 20px 22px;
    min-height: unset;
    transition: border-color 0.2s, transform 0.2s;
}
.score-trio-row .stress-compact:hover {
    border-color: var(--accent-blue);
    transform: translateY(-2px);
    z-index: 5;
}
.score-trio-row .stress-header-title {
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.score-trio-row .stress-score-number {
    font-size: 2rem;
    margin-top: 8px;
    display: block;
}
.score-trio-row .stress-score-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 4px;
}
.score-trio-row .stress-score-meta {
    display: flex;
    flex-direction: column;
}
.score-trio-row .stress-grade {
    font-size: 0.75rem;
    font-weight: 600;
}
.score-trio-row .stress-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}
.score-trio-row .stress-link {
    font-size: 0.72rem;
    margin-top: 10px;
    display: block;
}

/* CBDS cards in trio */
.score-trio-row .health-card {
    padding: 20px 22px;
}
.score-trio-row .health-card-title {
    font-size: 0.8rem;
    letter-spacing: 0.04em;
}
.score-trio-row .health-card-value {
    font-size: 2rem;
    margin-top: 8px;
}
.score-trio-row .health-card-sub {
    margin-top: 4px;
    font-size: 0.75rem;
}

/* Greeks fills left column height when alone */
.dashboard-risk-row > .greeks-compact {
    height: 100%;
    box-sizing: border-box;
}

/* Actions Center */
.actions-center {
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.actions-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.actions-title { font-weight: 600; font-size: 0.95rem; display: flex; align-items: center; gap: 8px; }
.actions-count {
    background: var(--accent-orange);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
}
.actions-count.zero { background: var(--accent-green); }

.actions-filters { display: flex; gap: 8px; }
.filter-btn {
    padding: 5px 12px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s;
}
.filter-btn:hover { border-color: var(--accent-blue); color: var(--text-primary); }
.filter-btn.active { background: var(--accent-blue); border-color: var(--accent-blue); color: white; }

.actions-body { padding: 8px 12px; max-height: 160px; overflow-y: auto; }

/* Compact Action Item — single line */
.action-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    margin-bottom: 4px;
    border-left: 3px solid transparent;
    border-radius: 6px;
    transition: background 0.15s;
}
.action-item:last-child { margin-bottom: 0; }
.action-item:hover { background: var(--bg-hover); }
.action-item.priority-red { border-left-color: var(--accent-red); }
.action-item.priority-orange { border-left-color: var(--accent-orange); }
.action-item.priority-yellow { border-left-color: var(--accent-yellow); }
.action-item.priority-green { border-left-color: var(--accent-green); }

.action-item-text {
    flex: 1;
    font-size: 0.78rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.action-item-priority {
    font-size: 0.6rem;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}
.action-item-priority.red { background: rgba(239, 68, 68, 0.15); color: var(--accent-red); }
.action-item-priority.orange { background: rgba(249, 115, 22, 0.15); color: var(--accent-orange); }
.action-item-priority.yellow { background: rgba(245, 158, 11, 0.15); color: var(--accent-yellow); }

.btn-action-go {
    padding: 3px 10px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-muted);
    font-size: 0.68rem;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.15s;
}
.btn-action-go:hover { border-color: var(--accent-blue); color: var(--text-primary); }

.actions-expand {
    text-align: center;
    padding: 4px 0;
    font-size: 0.7rem;
    color: var(--accent-blue);
    cursor: pointer;
    user-select: none;
}
.actions-expand:hover { text-decoration: underline; }
.btn-execute {
    padding: 8px 14px;
    background: var(--accent-blue);
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s;
}
.btn-execute:hover { background: var(--accent-purple); }

/* All Good Message */
.all-good {
    text-align: center;
    padding: 40px 20px;
}
.all-good-icon { font-size: 3rem; margin-bottom: 12px; }
.all-good-title { font-size: 1.1rem; font-weight: 600; color: var(--accent-green); margin-bottom: 6px; }
.all-good-sub { font-size: 0.85rem; color: var(--text-muted); }

/* Income Score Card (Compact) */
.income-score-card {
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(124, 58, 237, 0.1) 100%);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 12px;
    cursor: default;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}
.is-body {
    display: flex;
    align-items: center;
    gap: 16px;
}
.income-score-card:hover {
    border-color: var(--accent-purple);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.15);
    z-index: 50;
}
.is-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
}
.is-circle::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 4px solid var(--bg-secondary);
}
.is-circle.excellent { background: rgba(16, 185, 129, 0.15); border-color: var(--accent-green); }
.is-circle.excellent::before { border-color: var(--accent-green); }
.is-circle.good { background: rgba(6, 182, 212, 0.15); border-color: var(--accent-cyan); }
.is-circle.good::before { border-color: var(--accent-cyan); }
.is-circle.fair { background: rgba(245, 158, 11, 0.15); border-color: var(--accent-yellow); }
.is-circle.fair::before { border-color: var(--accent-yellow); }
.is-circle.poor { background: rgba(249, 115, 22, 0.15); border-color: var(--accent-orange); }
.is-circle.poor::before { border-color: var(--accent-orange); }
.is-circle.critical { background: rgba(239, 68, 68, 0.15); border-color: var(--accent-red); }
.is-circle.critical::before { border-color: var(--accent-red); }
.is-number { font-size: 2.5rem; font-weight: 700; line-height: 1; }
.is-grade { font-size: 0.9rem; font-weight: 600; margin-top: 2px; }
.is-details { flex: 1; min-width: 0; }
.is-title { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.is-state { font-size: 1.1rem; font-weight: 600; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.is-summary { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; line-height: 1.4; }
.is-state.excellent { color: var(--accent-green); }
.is-state.good { color: var(--accent-cyan); }
.is-state.fair { color: var(--accent-yellow); }
.is-state.poor { color: var(--accent-orange); }
.is-state.critical { color: var(--accent-red); }
.is-engine-badge {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 10px;
    text-transform: uppercase;
}
.is-engine-badge.running { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); }
.is-engine-badge.idle { background: rgba(245, 158, 11, 0.15); color: var(--accent-yellow); }
.is-engine-badge.stalled { background: rgba(239, 68, 68, 0.15); color: var(--accent-red); }
/* Tooltip factor bars (inside health-info-tooltip) */
.is-tt-factor { display: flex; align-items: center; gap: 6px; margin: 3px 0; }
.is-tt-factor-label { font-size: 0.7rem; color: var(--text-muted); width: 85px; flex-shrink: 0; }
.is-tt-factor-bar { flex: 1; height: 5px; background: var(--bg-secondary); border-radius: 3px; overflow: hidden; }
.is-tt-factor-fill { height: 100%; border-radius: 3px; }
.is-tt-factor-pct { font-size: 0.65rem; color: var(--text-secondary); width: 30px; text-align: right; flex-shrink: 0; }

/* Portfolio Quadrant Card */
.pq-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}
.pq-title { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px; }
.pq-grid-wrapper { position: relative; flex: 1; min-height: 120px; }
.pq-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    width: 100%;
    height: 100%;
    min-height: 120px;
    border-radius: 8px;
    overflow: hidden;
}
.pq-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px;
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--text-muted);
    transition: all 0.3s;
    gap: 2px;
}
.pq-cell .pq-icon { font-size: 1.2rem; }
.pq-cell.gambler { background: rgba(249, 115, 22, 0.06); }
.pq-cell.architect { background: rgba(16, 185, 129, 0.06); }
.pq-cell.bleeder { background: rgba(239, 68, 68, 0.06); }
.pq-cell.saver { background: rgba(59, 130, 246, 0.06); }
/* Inactive cells: dimmed when a quadrant is active */
.pq-cell.dimmed { opacity: 0.4; }
/* Active cells: brighter background + glow */
.pq-cell.active.gambler { background: rgba(249, 115, 22, 0.25); color: var(--accent-orange); box-shadow: inset 0 0 20px rgba(249, 115, 22, 0.15); border: 1px solid rgba(249, 115, 22, 0.4); }
.pq-cell.active.architect { background: rgba(16, 185, 129, 0.25); color: var(--accent-green); box-shadow: inset 0 0 20px rgba(16, 185, 129, 0.15); border: 1px solid rgba(16, 185, 129, 0.4); }
.pq-cell.active.bleeder { background: rgba(239, 68, 68, 0.25); color: var(--accent-red); box-shadow: inset 0 0 20px rgba(239, 68, 68, 0.15); border: 1px solid rgba(239, 68, 68, 0.4); }
.pq-cell.active.saver { background: rgba(59, 130, 246, 0.25); color: #3b82f6; box-shadow: inset 0 0 20px rgba(59, 130, 246, 0.15); border: 1px solid rgba(59, 130, 246, 0.4); }
.pq-dot {
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--accent-cyan);
    box-shadow: 0 0 8px rgba(255,255,255,0.4);
    transform: translate(-50%, -50%);
    z-index: 10;
    transition: left 0.6s ease, top 0.6s ease, border-color 0.3s;
    pointer-events: none;
}
.pq-dot.architect { border-color: var(--accent-green); box-shadow: 0 0 8px rgba(16,185,129,0.5); }
.pq-dot.gambler { border-color: var(--accent-orange); box-shadow: 0 0 8px rgba(249,115,22,0.5); }
.pq-dot.saver { border-color: #3b82f6; box-shadow: 0 0 8px rgba(59,130,246,0.5); }
.pq-dot.bleeder { border-color: var(--accent-red); box-shadow: 0 0 8px rgba(239,68,68,0.5); }
.pq-axes-x { display: flex; justify-content: space-between; font-size: 0.55rem; color: var(--text-muted); margin-top: 4px; padding: 0 2px; }
.pq-axes-y { position: absolute; left: 0; top: 0; bottom: 0; width: 14px; pointer-events: none; }
.pq-axes-y span { position: absolute; left: 0; font-size: 0.45rem; color: var(--text-muted); writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; }
.pq-axes-y .pq-ay-high { top: 2px; }
.pq-axes-y .pq-ay-low { bottom: 2px; }
.pq-result { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.pq-result-icon { font-size: 1.1rem; }
.pq-result-text { display: flex; flex-direction: column; }
.pq-result-name { font-size: 0.8rem; font-weight: 600; }
.pq-result-name.architect { color: var(--accent-green); }
.pq-result-name.gambler { color: var(--accent-orange); }
.pq-result-name.saver { color: #3b82f6; }
.pq-result-name.bleeder { color: var(--accent-red); }
.pq-result-msg { font-size: 0.7rem; color: var(--text-muted); }

/* Loading States */
.loading-skeleton {
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-hover) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
}
@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Responsive */
@media (max-width: 1400px) {
    .scores-row { grid-template-columns: 1fr 1fr; }
    .scores-row .pq-card { grid-column: 1 / -1; }
    .health-cards-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1200px) {
    .scores-row { grid-template-columns: 1fr; }
    .top-kpi-section { grid-template-columns: 1fr; }
    .health-cards-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Re-link Banner */
.relink-banner {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: linear-gradient(135deg, rgba(74, 108, 247, 0.1) 0%, rgba(124, 58, 237, 0.1) 100%);
    border: 1px solid rgba(74, 108, 247, 0.3);
    border-radius: 10px;
    margin-bottom: 16px;
}
.relink-banner.show { display: flex; }
.relink-banner-left { display: flex; align-items: center; gap: 12px; }
.relink-banner-icon { font-size: 20px; }
.relink-banner-text { font-size: 13px; color: var(--text-primary); }
.relink-banner-text strong { color: var(--accent-blue); }
.relink-banner-actions { display: flex; gap: 8px; }
.relink-banner-btn {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}
.relink-banner-btn.primary {
    background: var(--accent-blue);
    color: white;
}
.relink-banner-btn.primary:hover { background: #3a5ce7; }
.relink-banner-btn.secondary {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}
.relink-banner-btn.secondary:hover { background: var(--bg-hover); }

/* Manual Mode Freshness Badge (in header) */
.mode-badge {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
}
.mode-badge.show { display: inline-flex; }
.mode-badge.manual {
    background: rgba(124, 58, 237, 0.15);
    color: var(--accent-purple);
}
.mode-badge.fresh { background: rgba(16, 185, 129, 0.12); color: var(--accent-green); }
.mode-badge.recent { background: rgba(245, 158, 11, 0.12); color: var(--accent-yellow); }
.mode-badge.stale { background: rgba(249, 115, 22, 0.12); color: var(--accent-orange); }
.mode-badge.critical { background: rgba(239, 68, 68, 0.12); color: var(--accent-red); }



/* ========================================
   DASHBOARD-SPECIFIC STYLES
   Moved from inline style block
   ======================================== */

/* CSS Variables (needed for dashboard-specific styles) */
:root {
    --accent-cyan: #06b6d4;
    --accent-purple: #7c3aed;
    --accent-green: #10b981;
    --accent-orange: #f97316;
    --accent-red: #ef4444;
}

/* Sidebar */
a.menu-item { text-decoration: none; color: var(--text-secondary); }
a.menu-item.active { color: #3b82f6; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-yellow); }
.status-dot.connected { background: var(--accent-green); }
.status-dot.error { background: var(--accent-red); }
@media (max-height: 700px) {
}

/* Main Content */

/* Page Header */

/* Crisis Mode Indicator */
.crisis-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
}
.crisis-indicator.off {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}
.crisis-indicator.on {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
    border: 1px solid rgba(239, 68, 68, 0.3);
    animation: pulse-border 2s infinite;
}
@keyframes pulse-border {
    0%, 100% { border-color: rgba(239, 68, 68, 0.3); }
    50% { border-color: rgba(239, 68, 68, 0.6); }
}
.crisis-dot { width: 8px; height: 8px; border-radius: 50%; }
.crisis-dot.off { background: var(--accent-green); }
.crisis-dot.on { background: var(--accent-red); animation: pulse 1.5s infinite; }

/* Refresh Button */
.refresh-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}
.refresh-btn:hover { background: var(--bg-hover); border-color: var(--accent-blue); }
.refresh-btn.loading .refresh-icon { animation: spin 1s linear infinite; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* Context Bar (consistent with trade_advisor) */
.context-bar {
    display: flex;
    gap: 16px;
    padding: 14px 20px;
    background: var(--bg-card);
    border-radius: 10px;
    margin-bottom: 16px;
    border: 1px solid var(--border-color);
    flex-wrap: wrap;
    align-items: center;
}
.context-item { display: flex; flex-direction: column; gap: 2px; }
.context-label { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.context-value { font-size: 0.9rem; font-weight: 600; display: flex; align-items: center; gap: 4px; }
.context-value.positive { color: var(--accent-green); }
.context-value.positive-light { color: #22C55E; }
.context-value.negative { color: var(--accent-red); }
.context-value.warning { color: var(--accent-yellow); }
.context-value.warning-light { color: #F97316; }
.context-value.neutral { color: var(--text-primary); }
.context-sub { font-size: 0.6rem; color: var(--text-muted); }
.context-divider { width: 1px; background: var(--border-color); margin: 0 4px; align-self: stretch; min-height: 30px; }
.market-dot {
    width: 6px; height: 6px; border-radius: 50%;
    display: inline-block;
    background: var(--accent-green);
    animation: pulse 2s infinite;
}
.market-dot.closed { background: var(--accent-red); animation: none; }

/* Context Tooltips → moved to context-tooltips.css */

/* Connection Button - Two dots */
.connection-btn {
    position: relative;
}
.connection-dots {
    display: flex;
    gap: 3px;
    align-items: center;
}
.dot-small {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: all 0.3s ease;
}
.dot-small.connected {
    background: var(--accent-green);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}
.dot-small.error {
    background: var(--accent-red);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}
.dot-small.closed {
    background: var(--accent-red);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}

/* ============================================================
   POSITIONS SCREEN STYLES (migrated from positions.html)
   ============================================================ */

/* Content layout — .content inherited from 2-layout.css */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
}

.page-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Buttons */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-primary {
    background: var(--accent-blue);
    color: white;
}

.btn-primary:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-hover);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--bg-hover);
}

.btn-small {
    padding: 4px 8px;
    font-size: 0.75rem;
}

/* Dropdown */
.dropdown {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dropdown span {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.dropdown select {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
}

.dropdown select:hover {
    border-color: var(--accent-blue);
}

/* Summary bar - MOVED TO 3-components.css (global component) */

.summary-item[title] {
    cursor: help;
}

.summary-item-clickable {
    cursor: pointer;
    padding: 4px 8px;
    margin: -4px -8px;
    border-radius: 6px;
    transition: background 0.2s;
}

.summary-item-clickable:hover {
    background: var(--bg-hover);
}

.summary-item-clickable.active {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid var(--accent-yellow);
    margin: -5px -9px;
}

.summary-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.summary-value {
    font-size: 0.95rem;
    font-weight: 600;
}

.summary-value.positive {
    color: var(--accent-green);
}

.summary-value.negative {
    color: var(--accent-red);
}

.summary-value.warning {
    color: var(--accent-yellow);
}

.summary-sublabel {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* Day P&L with breakdown */
.summary-item-group {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    flex-wrap: nowrap;
}

.summary-item-group[title] {
    cursor: help;
}

/* PnL breakdown - CORRECTED FROM ORIGINAL */
.pnl-breakdown {
    display: flex;
    flex-direction: column;
    gap: 0;
    cursor: help;
    padding-bottom: 1px;
}

.pnl-breakdown-row {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 0.6rem;
    line-height: 1.2;
    color: var(--text-muted);
}

.pnl-breakdown-label {
    min-width: 26px;
    text-transform: uppercase;
    font-size: 0.55rem;
}

.pnl-breakdown-value {
    font-weight: 500;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
}

.pnl-breakdown-value.positive {
    color: var(--accent-green);
}

.pnl-breakdown-value.negative {
    color: var(--accent-red);
}

/* Health Score Widget - Compact (FROM ORIGINAL) */
.health-score-widget {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.05));
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: auto;
}

.health-score-widget:hover {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.08));
    border-color: rgba(16, 185, 129, 0.5);
}

.health-score-widget.grade-A {
    border-color: rgba(16, 185, 129, 0.4);
}

.health-score-widget.grade-B {
    border-color: rgba(134, 239, 172, 0.4);
}

.health-score-widget.grade-C {
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.1), rgba(234, 179, 8, 0.05));
    border-color: rgba(234, 179, 8, 0.4);
}

.health-score-widget.grade-D {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.1), rgba(249, 115, 22, 0.05));
    border-color: rgba(249, 115, 22, 0.4);
}

.health-score-widget.grade-F {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.05));
    border-color: rgba(239, 68, 68, 0.4);
}

.health-score-gauge {
    width: 28px;
    height: 28px;
    position: relative;
}

.health-score-gauge svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.health-score-gauge circle {
    fill: none;
    stroke-width: 3;
}

.health-score-gauge .bg {
    stroke: rgba(255,255,255,0.1);
}

.health-score-gauge .progress {
    stroke: var(--accent-green);
    stroke-linecap: round;
    transition: stroke-dashoffset 0.5s ease;
}

.health-score-gauge .progress.grade-A {
    stroke: var(--accent-green);
}

.health-score-gauge .progress.grade-B {
    stroke: #86efac;
}

.health-score-gauge .progress.grade-C {
    stroke: var(--accent-yellow);
}

.health-score-gauge .progress.grade-D {
    stroke: var(--accent-orange);
}

.health-score-gauge .progress.grade-F {
    stroke: var(--accent-red);
}

/* Compact widget: scope styles to .health-score-widget to avoid conflicts with dashboard */
.health-score-widget .health-score-number {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 9px;
    font-weight: 700;
}

.health-score-widget .health-score-info {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.health-score-widget .health-score-label {
    font-size: 0.55rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.health-score-widget .health-score-grade {
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1.1;
}

.health-score-widget .health-score-grade.grade-A {
    color: var(--accent-green);
}

.health-score-widget .health-score-grade.grade-B {
    color: #86efac;
}

.health-score-widget .health-score-grade.grade-C {
    color: var(--accent-yellow);
}

.health-score-widget .health-score-grade.grade-D {
    color: var(--accent-orange);
}

.health-score-widget .health-score-grade.grade-F {
    color: var(--accent-red);
}

.health-score-widget .health-score-risks {
    font-size: 0.5rem;
    color: var(--text-muted);
    line-height: 1.1;
}

.health-score-risks .critical {
    color: var(--accent-red);
    font-weight: 600;
}

/* Quick filters */
.quick-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 6px;
}

.filter-chip {
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.filter-chip:hover {
    border-color: var(--accent-blue);
    background: var(--bg-hover);
}

.filter-chip.active {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

/* Table container */
.table-container {
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

/* Tab content display */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Page header title wrapper */
.page-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Tabs + Actions wrapper */
.tabs-actions-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

/* Equity container spacing */
.equity-container {
    margin-top: 20px;
}

/* Closed filters row */
.closed-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

/* Closed summary bar */
.closed-summary {
    display: flex;
    gap: 24px;
    padding: 12px 16px;
    background: var(--bg-card);
    border-radius: 8px;
    margin-bottom: 16px;
}

/* ============================================================
   LAYOUT V2 CSS LIBRARY - UPDATED 2026-02-09
   Centralized styles for all screens (Dashboard, Positions, etc.)
   Cache version: v1.1
   ============================================================ */

/* ============================================================
   POSITIONS SCREEN - COMPLETE STYLES (FROM ORIGINAL)
   Added: 2026-02-09 - Full audit
   ============================================================ */

/* Controls Bar */
.controls-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    gap: 16px;
    flex-wrap: wrap;
}

.controls-left {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.controls-right {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Search Box */
.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    width: 200px;
}

.search-box input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.85rem;
    width: 100%;
    outline: none;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.section-title {
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title .icon {
    font-size: 1.2rem;
}

.section-summary {
    display: flex;
    gap: 20px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.section-summary span {
}

.connection-tooltip {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 180px;
    padding: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    z-index: 1000;
    pointer-events: none;
}
.connection-tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    right: 12px;
    border: 6px solid transparent;
    border-bottom-color: var(--border-color);
}
.connection-btn:hover .connection-tooltip {
    opacity: 1;
    visibility: visible;
}
.connection-tooltip .tooltip-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 12px;
}
.connection-tooltip .tooltip-label {
    color: var(--text-muted);
}
.connection-tooltip .tooltip-value {
    font-weight: 600;
    color: var(--text-primary);
}
.connection-tooltip .tooltip-value.positive {
    color: var(--accent-green);
}
.connection-tooltip .tooltip-value.negative {
    color: var(--accent-red);
}

/* Refresh button tooltip - SAME PATTERN as connection-tooltip */
.refresh-tooltip {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 180px;
    padding: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    z-index: var(--z-tooltip);
    pointer-events: none;
}
.refresh-tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    right: 12px;
    border: 6px solid transparent;
    border-bottom-color: var(--border-color);
}
#btn-refresh:hover .refresh-tooltip {
    opacity: 1;
    visibility: visible;
}
.refresh-tooltip .tooltip-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 12px;
}
.refresh-tooltip .tooltip-label {
    color: var(--text-muted);
}
.refresh-tooltip .tooltip-value {
    font-weight: 600;
    color: var(--text-primary);
}

/* Account Selector Tooltip - Interactive */
.account-selector-tooltip {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 260px;
    padding: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    z-index: var(--z-tooltip);
    pointer-events: none;
}
.account-selector-tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    right: 12px;
    border: 6px solid transparent;
    border-bottom-color: var(--border-color);
}
/* Invisible bridge to keep tooltip visible while moving cursor */
.account-selector-tooltip::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    height: 12px;  /* Same as gap (calc(100% + 12px)) */
    background: transparent;
}
#btn-portfolio:hover .account-selector-tooltip,
.account-selector-tooltip:hover {
    opacity: 1;
    visibility: visible;
    pointer-events: auto; /* Allow interaction */
}
.account-selector-tooltip .tooltip-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.account-selector-tooltip .tooltip-desc {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    line-height: 1.4;
}
.account-selector-tooltip .account-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.account-selector-tooltip .account-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    border-radius: 6px;
    background: rgba(255,255,255,0.02);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
}
.account-selector-tooltip .account-item:hover {
    background: rgba(255,255,255,0.05);
    border-color: var(--accent-blue);
}
.account-selector-tooltip .account-item.active {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--accent-blue);
}
.account-selector-tooltip .account-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
}
.account-selector-tooltip .account-badge {
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--accent-blue);
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Shield AI Tooltip */
.shield-ai-tooltip {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 300px;
    padding: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    z-index: var(--z-tooltip);
    pointer-events: none;
}
.shield-ai-tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    right: 12px;
    border: 6px solid transparent;
    border-bottom-color: var(--border-color);
}
/* Invisible bridge to keep tooltip visible while moving cursor */
.shield-ai-tooltip::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    height: 12px;  /* Same as gap */
    background: transparent;
}
#btn-ai:hover .shield-ai-tooltip,
.shield-ai-tooltip:hover {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
.shield-ai-tooltip .tooltip-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}
.shield-ai-tooltip .tooltip-desc {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    line-height: 1.4;
}
.shield-ai-tooltip .capability-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
}
.shield-ai-tooltip .capability-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 11px;
}
.shield-ai-tooltip .capability-icon {
    font-size: 14px;
    flex-shrink: 0;
}
.shield-ai-tooltip .capability-text {
    color: var(--text-secondary);
    line-height: 1.3;
}
.shield-ai-tooltip .tooltip-shortcut {
    font-size: 10px;
    color: var(--text-muted);
    text-align: center;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}
.shield-ai-tooltip .shortcut-key {
    display: inline-block;
    padding: 2px 6px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
}

/* User Account Tooltip */
.user-tooltip {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 200px;
    padding: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    z-index: var(--z-tooltip);
    pointer-events: none;
}
.user-tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    right: 12px;
    border: 6px solid transparent;
    border-bottom-color: var(--border-color);
}
/* Invisible bridge to keep tooltip visible while moving cursor */
.user-tooltip::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    height: 12px;  /* Same as gap */
    background: transparent;
}
#btn-user:hover .user-tooltip,
.user-tooltip:hover {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
.user-tooltip .tooltip-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 12px;
}
.user-tooltip .tooltip-label {
    color: var(--text-muted);
}
.user-tooltip .tooltip-value {
    font-weight: 600;
    color: var(--text-primary);
}
.user-tooltip .tooltip-divider {
    height: 1px;
    background: var(--border-color);
    margin: 6px 0;
}
.user-tooltip .tooltip-action {
    margin-top: 8px;
    padding: 6px;
    text-align: center;
    font-size: 11px;
    color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.05);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
}
.user-tooltip .tooltip-action:hover {
    background: rgba(59, 130, 246, 0.1);
}

/* Scores Row: Health + Income + Quadrant */
.scores-row {
    /* Properties moved to layout-v2.css or will be defined here */
}

/* ============================================
   DASHBOARD UTILITY CLASSES - Refactored with semantic names
   ============================================ */

/* Text utilities */
.text-xs-secondary { font-size:10px;color:var(--text-secondary) }
.text-xs-muted-upper-mb8 { font-size:10px;color:var(--text-muted);text-transform:uppercase;letter-spacing:0.5px;margin-bottom:8px }
.text-sm-primary { font-size:12px;color:var(--text-primary);line-height:1.4 }
.text-sm-secondary { font-size:11px;color:var(--text-secondary);line-height:1.4 }
.text-xxs { font-weight:400;font-size:0.68rem }
.text-xs-muted { font-size:0.7rem;color:var(--text-muted);margin-bottom:4px }
.text-xs-muted-italic { font-size:0.7rem;color:var(--text-muted);font-style:italic }
.text-xs-muted-compact { font-size:0.72rem;color:var(--text-muted);padding:2px 0 }
.text-primary { color:var(--text-primary) }
.text-muted { color:var(--text-muted) }
.text-link { color:var(--accent-blue);text-decoration:none }
.fw-600 { font-weight:600 }
.text-xs-fade { font-size:10px;opacity:0.7 }

/* Tooltip widths */
.tooltip-standard { width:310px }
.tooltip-large { width:320px }

/* Layout utilities */
.flex-between-xs { display:flex;justify-content:space-between;font-size:9px;color:var(--text-muted) }
.flex-between-xxs { display:flex;justify-content:space-between;font-size:8px;color:var(--text-tertiary);margin-top:2px }
.flex-between-muted { display:flex;justify-content:space-between;align-items:center;font-size:10px;color:var(--text-muted) }

/* Spacing utilities */
.m-0 { margin:0 }
.mb-10 { margin-bottom:10px }
.mt-6 { margin-top:6px }
.my-8 { margin:8px 0 }

/* Dividers */
.divider-vertical { width:1px;height:24px;background:var(--border-color) }
.divider-horizontal { border-top:1px solid var(--border-color);margin:6px 0 }

/* GEX gradient bar */
.gex-gradient-bar { position:relative;height:8px;background:linear-gradient(to right, #EF4444 0%, #EF4444 10%, #F97316 10%, #F97316 25%, #EAB308 25%, #EAB308 50%, #22C55E 50%, #22C55E 75%, #10B981 75%, #10B981 100%);border-radius:4px;margin-bottom:4px }
.gex-marker-triangle { position:absolute;top:-4px;width:0;height:0;border-left:6px solid transparent;border-right:6px solid transparent;border-top:8px solid white;transform:translateX(-6px);left:50% }

/* Width utilities for GEX labels */
.w-10-left { width:10%;text-align:left }
.w-15-center { width:15%;text-align:center }
.w-25-center { width:25%;text-align:center }
.w-25-right { width:25%;text-align:right }

/* Position utilities */
.pos-relative-pl { position:relative;padding-left:14px }
.pos-center { left:50%;top:50% }
.pos-center-cyan { left:50%;background-color:var(--accent-cyan) }

/* Progress bar */
.w-0 { width:0% }

/* Display utilities */
.hidden { display:none }
.d-block { display:block }
.d-inline-block-skeleton { display:inline-block;width:60px;height:1em }

/* Remaining inline-style classes */
.inline-style-29 { margin-left:12px }

/* ============================================
   CI WIDGET - Capital Efficiency
   ============================================ */
/* Capital Efficiency Widget — Role-Aware v1.0 */
.capital-efficiency-widget {
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(16, 185, 129, 0.06) 100%);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 16px 20px;
    margin-bottom: 16px;
    transition: border-color 0.2s ease;
}

.capital-efficiency-widget:hover {
    border-color: rgba(16, 185, 129, 0.5);
}

.ce-widget-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin-bottom: 12px;
    text-transform: uppercase;
}

.ce-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.ce-card {
    padding: 12px;
    border-radius: 8px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    position: relative;
}

.ce-card-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.ce-icon {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
    color: var(--text-muted);
}

.ce-allocation {
    margin-left: auto;
    font-size: 12px;
    color: var(--text-primary);
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
}

.ce-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 4px;
    margin-bottom: 10px;
}

.ce-metric {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.ce-metric-label {
    font-size: 9px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.ce-metric-value {
    font-size: 13px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-primary);
    white-space: nowrap;
}

.ce-metric-value.ce-green  { color: var(--accent-green); }
.ce-metric-value.ce-blue   { color: var(--accent-blue); }
.ce-metric-value.ce-yellow { color: var(--accent-yellow); }
.ce-metric-value.ce-red    { color: var(--accent-red); }
.ce-metric-value.ce-muted  { color: var(--text-muted); }

.ce-status {
    font-size: 11px;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.08);
    color: var(--text-muted);
    white-space: nowrap;
}

.ce-status.ce-status-green  { color: var(--accent-green); }
.ce-status.ce-status-yellow { color: var(--accent-yellow); }
.ce-status.ce-status-red    { color: var(--accent-red); }
.ce-status.ce-status-muted  { color: var(--text-muted); }

/* CE Card hover tooltips */
.ce-card:hover .ce-tooltip { display: block; }
.ce-tooltip {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #1a2332;
    color: #e2e8f0;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 0.65rem;
    min-width: 280px;
    max-width: 340px;
    z-index: 100;
    border: 1px solid rgba(255,255,255,0.12);
    line-height: 1.5;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    pointer-events: none;
}


/* ============================================================
   METRIC CTA BUTTONS — "Review X" links on WARNING/CRITICAL health cards
   ============================================================ */

.metric-cta {
    display: block;
    margin-top: 6px;
    padding: 3px 8px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--accent-blue, #4a6cf7);
    background: rgba(74, 108, 247, 0.1);
    border: 1px solid rgba(74, 108, 247, 0.25);
    border-radius: 4px;
    text-align: center;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.metric-cta:hover {
    background: rgba(74, 108, 247, 0.2);
    border-color: rgba(74, 108, 247, 0.5);
    color: var(--accent-blue, #4a6cf7);
}

/* ==========================================================================
   Crisis Mode — activated when VIX >= 30 (extreme volatility regime)
   Applies a subtle red tint to the dashboard to signal elevated market risk.
   ========================================================================== */
/* Crisis mode visual styling removed — SGE header row handles VIX alerts */
}

/* Past Due billing banner */
.past-due-banner {
    display: none;
    align-items: center;
    gap: 8px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: 6px;
    padding: 8px 14px;
    margin-bottom: 12px;
    font-size: 12px;
    color: var(--accent-amber, #f59e0b);
    font-weight: 500;
}

.past-due-banner svg {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
}

.past-due-banner-link {
    margin-left: auto;
    color: var(--accent-amber, #f59e0b);
    text-decoration: underline;
    white-space: nowrap;
    font-weight: 600;
}

.past-due-banner-link:hover {
    color: #d97706;
}

/* ============================================
   MC PROJECTION WIDGET (Portfolio Monte Carlo)
   ============================================ */
.mc-projection-widget {
    margin: 12px 0;
}

.mc-projection-card {
    background: var(--bg-secondary);
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: 12px;
    padding: 14px 16px;
    position: relative;
}

/* Two-column layout */
.mc-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.mc-col-left {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mc-col-right {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-left: 1px solid rgba(255, 255, 255, 0.06);
    padding-left: 16px;
    font-size: 0.75rem;
    line-height: 1.5;
}

.mc-projection-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.mc-projection-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.mc-projection-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mc-proj-scenarios {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin-bottom: 0;
}

.mc-proj-scenario {
    text-align: center;
    padding: 8px 4px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
}

.mc-proj-scenario.bad {
    border-left: 3px solid #ef4444;
}

.mc-proj-scenario.likely {
    border-left: 3px solid #3b82f6;
}

.mc-proj-scenario.good {
    border-left: 3px solid #22c55e;
}

.mc-proj-scenario-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.mc-proj-scenario-value {
    font-size: 15px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-primary);
}

.mc-proj-scenario.bad .mc-proj-scenario-value { color: #ef4444; }
.mc-proj-scenario.likely .mc-proj-scenario-value { color: #3b82f6; }
.mc-proj-scenario.good .mc-proj-scenario-value { color: #22c55e; }

.mc-proj-scenario-sub {
    font-size: 10px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.mc-proj-metrics {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.mc-proj-metric-label {
    font-size: 9px;
}

.mc-proj-metric-value {
    font-size: 12px;
}

.mc-proj-metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.mc-proj-metric-label {
    color: var(--text-tertiary);
}

.mc-proj-metric-value {
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-primary);
}

.mc-proj-range-bar {
    margin: 0;
    padding: 6px 0;
}

.mc-proj-range-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 10px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.mc-proj-range-track {
    position: relative;
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    overflow: visible;
}

.mc-proj-range-fill {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: linear-gradient(90deg, #ef4444 0%, #f59e0b 30%, #22c55e 70%, #22c55e 100%);
    border-radius: 3px;
    opacity: 0.4;
}

.mc-proj-range-marker {
    position: absolute;
    top: -3px;
    width: 4px;
    height: 12px;
    background: #8b5cf6;
    border-radius: 2px;
    transform: translateX(-50%);
    left: 50%;
}

.mc-proj-closures {
    margin: 0;
    padding: 0;
}

.mc-closures-header {
    margin-bottom: 4px;
}

.mc-closures-title {
    font-size: 0.6rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.mc-closure-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 0.65rem;
    color: var(--text-secondary);
}

.mc-closure-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.mc-closure-sym {
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.mc-closure-strat {
    color: var(--text-tertiary);
    font-size: 0.6rem;
    white-space: nowrap;
}

.mc-closure-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    white-space: nowrap;
}

.mc-closure-day {
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6rem;
}

.mc-closure-prob {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6rem;
    color: var(--text-tertiary);
    min-width: 28px;
    text-align: right;
}

.mc-closure-income {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6rem;
    font-weight: 600;
    min-width: 50px;
    text-align: right;
}

.mc-proj-link {
    font-size: 10px;
    font-weight: 600;
    color: #8b5cf6;
    text-decoration: none;
    white-space: nowrap;
}

.mc-proj-link:hover {
    text-decoration: underline;
}

.mc-proj-footer {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.mc-proj-disclaimer {
    font-size: 9px;
    color: var(--text-tertiary);
    font-style: italic;
    max-width: 70%;
}

.mc-proj-age {
    font-size: 9px;
    color: var(--text-tertiary);
    font-family: 'JetBrains Mono', monospace;
}

/* ============================================================
   COGNITIVE BIAS DEFENSE SECTION (CBDS — dashboard)
   Always visible (tier-gated, not data-gated). Content varies
   between active-alert state and empty/healthy state.
   ============================================================ */
.dashboard-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 18px 0 8px 0;
    padding: 0 4px;
}
.dashboard-section-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
}
.dashboard-section-header .info-icon {
    color: var(--text-tertiary);
    font-size: 0.85rem;
    cursor: help;
}
.bias-awareness-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: var(--bg-secondary);
    border-left: 4px solid var(--accent-yellow);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 14px;
}

/* =========================================================================
   Decision Score (Shadow Savings) widget
   ========================================================================= */
.decision-score-card {
    background: var(--bg-secondary);
    border-left: 4px solid var(--accent-green, #22c55e);
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 14px;
}
.decision-score-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.decision-score-icon {
    color: var(--accent-green, #22c55e);
    display: inline-flex;
}
.decision-score-title-block {
    flex: 1;
    min-width: 0;
}
.decision-score-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
}
.decision-score-subtitle {
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin-top: 2px;
}
.decision-score-trend {
    font-size: 0.72rem;
    color: var(--text-secondary);
    white-space: nowrap;
}
.decision-score-trend.up { color: var(--accent-green, #22c55e); }
.decision-score-trend.down { color: var(--accent-red, #ef4444); }
.decision-score-body {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.decision-score-metric {
    min-width: 0;
}
.decision-score-metric-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}
.decision-score-metric-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.decision-score-metric-value.positive { color: var(--accent-green, #22c55e); }
.decision-score-metric-value.neutral  { color: var(--text-secondary); }
.decision-score-footer {
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin-top: 10px;
}
.decision-score-card.building .decision-score-body { display: none; }
.decision-score-card.building .decision-score-footer { margin-top: 4px; }
@media (max-width: 640px) {
    .decision-score-body { grid-template-columns: 1fr; }
}
/* Divergence-reason micro-feedback banner (Shadow Data Phase 3, Task 2) */
.divergence-feedback-banner {
    margin-top: 12px;
    padding: 10px 12px;
    border-top: 1px dashed var(--border-subtle, rgba(255,255,255,0.08));
}
.divergence-feedback-headline {
    font-size: 0.78rem;
    color: var(--text-primary, #e8eaed);
    margin-bottom: 8px;
}
.divergence-feedback-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.divergence-feedback-btn {
    font-size: 0.72rem;
    padding: 5px 10px;
    border-radius: 6px;
    border: 1px solid var(--border-subtle, rgba(255,255,255,0.12));
    background: var(--bg-elevated, rgba(255,255,255,0.04));
    color: var(--text-primary, #e8eaed);
    cursor: pointer;
    transition: background 0.15s ease;
}
.divergence-feedback-btn:hover  { background: var(--bg-hover, rgba(255,255,255,0.08)); }
.divergence-feedback-btn:disabled { opacity: 0.5; cursor: default; }
.bias-awareness-card.warning {
    border-left-color: var(--accent-yellow);
}
.bias-awareness-card.critical {
    border-left-color: var(--accent-red);
}
.bias-awareness-card.empty {
    border-left-color: var(--accent-green, #22c55e);
    background: var(--bg-secondary);
}
.bias-awareness-card.empty .bias-awareness-icon {
    color: var(--accent-green, #22c55e);
}
.bias-awareness-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}
.bias-awareness-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}
.bias-awareness-text {
    min-width: 0;
}
.bias-awareness-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bias-awareness-desc {
    font-size: 0.7rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bias-awareness-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}
.btn-bias-aware {
    padding: 5px 12px;
    background: var(--accent-yellow);
    border: none;
    border-radius: 6px;
    color: #000;
    font-size: 0.73rem;
    font-weight: 600;
    cursor: pointer;
}
.btn-bias-secondary {
    padding: 5px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.73rem;
    cursor: pointer;
}
