/* ═══════════════════════════════════════════════════════════════════════════
   theme.css — Mission Control Bloomberg HUD
   Dark glassmorphism theme with neon accents
   ═══════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

/* ── Design Tokens ─────────────────────────────────────────────────────── */
:root {
    --bg-dark: #0a0e27;
    --bg-surface: #0f1332;
    --panel-bg: #111636;
    --panel-glass: rgba(17, 22, 51, 0.85);
    --border: rgba(59, 130, 246, 0.12);
    --border-hover: rgba(59, 130, 246, 0.3);

    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --text-muted: #666;

    --neon-cyan: #00f3ff;
    --neon-green: #39ff14;
    --neon-red: #ff2a2a;
    --neon-purple: #b900ff;
    --neon-orange: #ff9100;
    --neon-yellow: #ffe600;

    --accent: var(--neon-cyan);

    --font-sans: 'Inter', -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;

    --shadow-glow: 0 0 20px rgba(0, 243, 255, 0.08);
    --shadow-panel: 0 2px 12px rgba(0, 0, 0, 0.5);

    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset ─────────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
    background: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 13px;
    line-height: 1.5;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ── App Layout ────────────────────────────────────────────────────────── */
.app-layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* ── Top Bar ───────────────────────────────────────────────────────────── */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    height: 48px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    z-index: 100;
}

.topbar-brand {
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.logo-accent {
    color: var(--neon-cyan);
    font-weight: 800;
    text-shadow: 0 0 8px rgba(0, 243, 255, 0.4);
}

.topbar-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--neon-green);
    box-shadow: 0 0 6px var(--neon-green);
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

.topbar-input {
    width: 80px;
    padding: 5px 10px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--neon-cyan);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
    outline: none;
    transition: var(--transition);
}

.topbar-input:focus {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 8px rgba(0, 243, 255, 0.2);
}

.topbar-btn {
    padding: 5px 14px;
    background: var(--neon-cyan);
    color: #000;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: var(--transition);
}

.topbar-btn:hover {
    filter: brightness(1.2);
    box-shadow: 0 0 12px rgba(0, 243, 255, 0.3);
}

.topbar-btn:active {
    transform: scale(0.97);
}

.topbar-btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.topbar-btn-outline:hover {
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
    box-shadow: none;
}

/* ── Status Ticker ─────────────────────────────────────────────────────── */
.status-ticker {
    height: 26px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.status-ticker-inner {
    display: flex;
    gap: 16px;
    white-space: nowrap;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    animation: scroll-ticker 40s linear infinite;
}

.ticker-sep {
    color: var(--border);
}

@keyframes scroll-ticker {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* ── Market Ribbon ─────────────────────────────────────────────────────── */
.market-ribbon {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 0 16px;
    height: 32px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    overflow-x: auto;
}

.market-ribbon::-webkit-scrollbar {
    display: none;
}

.ribbon-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 11px;
    white-space: nowrap;
}

.ribbon-symbol {
    color: var(--text-secondary);
    font-weight: 600;
}

.ribbon-price {
    color: var(--text-primary);
}

.ribbon-change {
    font-weight: 600;
    font-size: 10px;
}

.ribbon-change.up {
    color: var(--neon-green);
}

.ribbon-change.down {
    color: var(--neon-red);
}

.ribbon-sep {
    width: 1px;
    height: 12px;
    background: var(--border);
}

/* ── Dashboard Body (GridStack container) ──────────────────────────────── */
.dashboard-body {
    flex: 1;
    padding: 8px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* ── GridStack Overrides ───────────────────────────────────────────────── */
.grid-stack {
    min-height: 100%;
}

.grid-stack-item-content {
    background: var(--panel-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-panel);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: border-color 0.2s ease;
}

.grid-stack-item-content:hover {
    border-color: var(--border-hover);
}

.grid-stack>.grid-stack-item>.grid-stack-item-content {
    inset: 4px;
}

/* Resize handle */
.grid-stack>.grid-stack-item>.ui-resizable-se {
    width: 16px;
    height: 16px;
    right: 6px;
    bottom: 6px;
    background: transparent;
}

.grid-stack>.grid-stack-item>.ui-resizable-se::after {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--border-hover);
    border-bottom: 2px solid var(--border-hover);
    position: absolute;
    right: 2px;
    bottom: 2px;
}

/* ── Panel Chrome (header + body) ──────────────────────────────────────── */
.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
    cursor: grab;
}

.panel-header:active {
    cursor: grabbing;
}

.panel-title {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--neon-cyan);
}

.panel-badge {
    font-family: var(--font-mono);
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(0, 243, 255, 0.1);
    color: var(--neon-cyan);
    border: 1px solid rgba(0, 243, 255, 0.15);
}

.panel-body {
    flex: 1;
    padding: 10px 12px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Custom scrollbar */
.panel-body::-webkit-scrollbar {
    width: 4px;
}

.panel-body::-webkit-scrollbar-track {
    background: transparent;
}

.panel-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

/* ── Portfolio Card ────────────────────────────────────────────────────── */
.portfolio-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
}

.portfolio-metric {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
}

.portfolio-metric-label {
    font-size: 9px;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.portfolio-metric-value {
    font-size: 16px;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text-primary);
}

.portfolio-metric-value.accent {
    color: var(--neon-cyan);
}

/* Position table */
.positions-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-mono);
    font-size: 11px;
}

.positions-table th {
    padding: 4px 6px;
    text-align: left;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    font-weight: 600;
}

.positions-table td {
    padding: 4px 6px;
    border-bottom: 1px solid rgba(30, 30, 30, 0.5);
    white-space: nowrap;
}

.positions-table tr:hover td {
    background: rgba(0, 243, 255, 0.03);
}

.text-right {
    text-align: right;
}

.pl-positive {
    color: var(--neon-green);
    font-weight: 600;
}

.pl-negative {
    color: var(--neon-red);
    font-weight: 600;
}

/* ── Scanner Table ─────────────────────────────────────────────────────── */
.scan-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-mono);
    font-size: 11px;
}

.scan-table th {
    padding: 5px 8px;
    text-align: left;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    position: sticky;
    top: 0;
    background: var(--panel-bg);
    z-index: 2;
}

.scan-table td {
    padding: 5px 8px;
    border-bottom: 1px solid rgba(30, 30, 30, 0.5);
}

.scan-table tr:hover td {
    background: rgba(0, 243, 255, 0.03);
}

.scan-table .ticker-cell {
    color: var(--neon-cyan);
    font-weight: 700;
    cursor: pointer;
}

.scan-table .ticker-cell:hover {
    text-decoration: underline;
    text-shadow: 0 0 6px rgba(0, 243, 255, 0.3);
}

/* ── News Feed ─────────────────────────────────────────────────────────── */
.news-item {
    padding: 8px 0;
    border-bottom: 1px solid rgba(30, 30, 30, 0.5);
    transition: var(--transition);
}

.news-item:hover {
    background: rgba(0, 243, 255, 0.02);
}

.news-item:last-child {
    border-bottom: none;
}

.news-source {
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--neon-purple);
    margin-bottom: 2px;
}

.news-title {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.3;
}

.news-title a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

.news-title a:hover {
    color: var(--neon-cyan);
}

.news-time {
    font-family: var(--font-mono);
    font-size: 9px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ── Copilot / Chat ────────────────────────────────────────────────────── */
.copilot-messages {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 8px;
}

.copilot-msg {
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    line-height: 1.4;
    max-width: 85%;
}

.copilot-msg.user {
    align-self: flex-end;
    background: rgba(0, 243, 255, 0.1);
    border: 1px solid rgba(0, 243, 255, 0.15);
    color: var(--neon-cyan);
}

.copilot-msg.assistant {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
}

.copilot-input-row {
    display: flex;
    gap: 6px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.copilot-input {
    flex: 1;
    padding: 6px 10px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 12px;
    outline: none;
    transition: var(--transition);
}

.copilot-input:focus {
    border-color: var(--neon-cyan);
}

/* ── Chart Container ───────────────────────────────────────────────────── */
.chart-container {
    width: 100%;
    height: 100%;
    min-height: 200px;
}

.chart-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* ── Loading / Empty States ────────────────────────────────────────────── */
.loading-state,
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 8px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--neon-cyan);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ── Utility ───────────────────────────────────────────────────────────── */
.mono {
    font-family: var(--font-mono);
}

.text-cyan {
    color: var(--neon-cyan);
}

.text-up {
    color: var(--neon-green);
}

.text-down {
    color: var(--neon-red);
}

.fw-700 {
    font-weight: 700;
}

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .topbar {
        padding: 0 10px;
    }

    .topbar-controls {
        gap: 6px;
    }

    .topbar-btn {
        padding: 4px 8px;
        font-size: 10px;
    }

    .dashboard-body {
        padding: 4px;
    }
}

/* ── VoPR Scanner Styles ──────────────────────────────────────────────── */
.vrp-badge {
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.vrp-badge.sell-edge {
    background: rgba(57, 255, 20, 0.12);
    color: var(--neon-green);
    border: 1px solid rgba(57, 255, 20, 0.2);
}

.vrp-badge.buy-zone {
    background: rgba(255, 42, 42, 0.12);
    color: var(--neon-red);
    border: 1px solid rgba(255, 42, 42, 0.2);
}

.vrp-badge.neutral {
    background: rgba(128, 128, 128, 0.08);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

/* Coil state badges */
.coil-spring {
    background: rgba(57, 255, 20, 0.12);
    color: var(--neon-green);
}

.coil-coiling {
    background: rgba(255, 145, 0, 0.12);
    color: var(--neon-orange);
}

.coil-relaxed {
    background: rgba(128, 128, 128, 0.08);
    color: var(--text-muted);
}

/* Regime badges */
.regime-low {
    color: var(--neon-green);
}

.regime-normal {
    color: var(--neon-cyan);
}

.regime-high {
    color: var(--neon-orange);
}

.regime-extreme {
    color: var(--neon-red);
}

/* ── Action Buttons ───────────────────────────────────────────────────── */
.action-cell {
    white-space: nowrap;
    text-align: right;
}

.action-icon {
    cursor: pointer;
    font-size: 12px;
    padding: 2px 3px;
    text-decoration: none;
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

.action-icon:hover {
    opacity: 1;
    filter: brightness(1.3);
}

/* ── VoPR Bloomberg Terminal Styles ───────────────────────────────────── */

/* Controls bar */
.vopr-controls {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-bottom: 8px;
    flex-shrink: 0;
}

.vopr-input {
    width: 60px;
    font-family: var(--font-mono);
    font-weight: 700;
    text-transform: uppercase;
}

.vopr-scan-btn {
    font-size: 10px;
    padding: 4px 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.vopr-tv-btn {
    font-size: 10px;
    padding: 4px 10px;
    text-decoration: none;
}

/* Volatility strip — horizontal terminal data bar */
.vopr-terminal-strip {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    margin-bottom: 6px;
    font-family: var(--font-mono);
}

.vopr-strip-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 10px;
    line-height: 1.6;
}

.vopr-strip-row-secondary {
    font-size: 9px;
    margin-top: 2px;
    opacity: 0.85;
}

.vopr-strip-label {
    color: var(--text-muted);
    font-size: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.vopr-strip-val {
    color: var(--text-primary);
    font-weight: 500;
}

.vopr-strip-val.accent {
    color: var(--neon-cyan);
    font-weight: 700;
}

.vopr-strip-sep {
    color: rgba(255, 255, 255, 0.1);
    font-size: 10px;
}

.vopr-strip-ts {
    color: var(--text-muted);
    font-size: 8px;
    margin-left: auto;
}

/* Signal badges */
.vopr-signal-hot {
    background: rgba(57, 255, 20, 0.15);
    color: var(--neon-green);
    font-size: 9px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 3px;
    border: 1px solid rgba(57, 255, 20, 0.3);
    animation: voprPulse 2s ease-in-out infinite;
}

.vopr-signal-edge {
    background: rgba(0, 243, 255, 0.1);
    color: var(--neon-cyan);
    font-size: 9px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 3px;
    border: 1px solid rgba(0, 243, 255, 0.2);
}

.vopr-signal-buy {
    background: rgba(255, 42, 42, 0.1);
    color: var(--neon-red);
    font-size: 9px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 3px;
    border: 1px solid rgba(255, 42, 42, 0.2);
}

@keyframes voprPulse {

    0%,
    100% {
        box-shadow: 0 0 4px rgba(57, 255, 20, 0.2);
    }

    50% {
        box-shadow: 0 0 12px rgba(57, 255, 20, 0.5);
    }
}

/* Expected Move bar */
.vopr-em-section {
    margin-bottom: 6px;
    padding: 5px 10px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.vopr-em-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.vopr-em-range {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    color: var(--neon-cyan);
}

.vopr-em-bar-container {
    position: relative;
}

.vopr-em-bar {
    height: 6px;
    background: linear-gradient(90deg,
            rgba(255, 42, 42, 0.3) 0%,
            rgba(0, 243, 255, 0.15) 50%,
            rgba(57, 255, 20, 0.3) 100%);
    border-radius: 3px;
    position: relative;
}

.vopr-em-marker {
    position: absolute;
    top: -12px;
    transform: translateX(-50%);
    color: var(--neon-cyan);
    font-size: 10px;
    font-weight: 700;
    text-shadow: 0 0 6px rgba(0, 243, 255, 0.5);
}

.vopr-em-labels {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 8px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Technicals strip */
.vopr-tech-strip {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    padding: 4px 10px;
    margin-bottom: 6px;
    font-family: var(--font-mono);
    font-size: 9px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.03);
}

/* Chain table header */
.vopr-chain-header {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 9px;
    color: var(--text-muted);
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}

.vopr-qualified-count {
    color: var(--neon-green);
    font-weight: 600;
}

/* Chain table scroll container */
.vopr-chain-scroll {
    overflow-y: auto;
    overflow-x: auto;
    max-height: 280px;
}

.vopr-chain-scroll::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

.vopr-chain-scroll::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

/* Chain table */
.vopr-chain-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-mono);
    font-size: 10px;
}

.vopr-chain-table th {
    padding: 3px 5px;
    text-align: right;
    font-size: 8px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    position: sticky;
    top: 0;
    background: var(--panel-bg);
    z-index: 2;
}

.vopr-chain-table th:first-child,
.vopr-chain-table th:nth-child(2) {
    text-align: left;
}

.vopr-chain-table td {
    padding: 3px 5px;
    text-align: right;
    border-bottom: 1px solid rgba(30, 30, 30, 0.4);
    white-space: nowrap;
}

.vopr-chain-table tr:hover td {
    background: rgba(0, 243, 255, 0.04);
}

/* Strike cell */
.vopr-strike-cell {
    text-align: left !important;
    font-weight: 700;
    color: var(--text-primary);
}

/* Type cells */
.vopr-type-call {
    text-align: left !important;
    color: var(--neon-green);
    font-weight: 600;
    font-size: 9px;
}

.vopr-type-put {
    text-align: left !important;
    color: var(--neon-red);
    font-weight: 600;
    font-size: 9px;
}

/* Direction badges */
.vopr-dir-sell {
    color: var(--neon-orange);
    font-weight: 700;
}

.vopr-dir-buy {
    color: var(--neon-cyan);
    font-weight: 700;
}

/* Mid price highlight */
.vopr-mid {
    color: var(--neon-cyan);
    font-weight: 600;
}

/* OI subtle */
.vopr-oi {
    color: var(--text-secondary);
}

/* Qualifying strike row */
.vopr-row-qualified {
    background: rgba(57, 255, 20, 0.06) !important;
    border-left: 2px solid var(--neon-green);
}

.vopr-row-qualified .vopr-strike-cell {
    color: var(--neon-green);
}

/* Selected strike row (clicked) */
.vopr-row-selected {
    background: rgba(0, 243, 255, 0.1) !important;
    border-left: 2px solid var(--neon-cyan);
    box-shadow: 0 0 8px rgba(0, 243, 255, 0.15);
}

/* Spot price divider */
.vopr-spot-divider {
    background: rgba(0, 243, 255, 0.05) !important;
}

.vopr-spot-divider td {
    text-align: center !important;
    color: var(--neon-cyan);
    font-weight: 700;
    font-size: 9px;
    letter-spacing: 1px;
    padding: 4px 0;
    border-top: 1px solid rgba(0, 243, 255, 0.15);
    border-bottom: 1px solid rgba(0, 243, 255, 0.15);
}

/* Legacy compat — keep old class names working */
.chain-row-qualified {
    background: rgba(57, 255, 20, 0.06) !important;
    border-left: 2px solid var(--neon-green);
}

.chain-type-call {
    color: var(--neon-green);
    font-weight: 600;
}

.chain-type-put {
    color: var(--neon-red);
    font-weight: 600;
}

.chain-spot-row td {
    color: var(--neon-cyan);
    font-weight: 700;
}

/* ── Ticker cells: cyan clickable ─────────────────────────────────────── */
.ticker-cell {
    color: var(--neon-cyan);
    font-weight: 600;
    font-family: var(--font-mono);
}

tr:hover .ticker-cell {
    text-decoration: underline;
}

/* ── Scanner Panel Group — Warm border + subtle bg ───────────────────── */
.scanner-panel {
    border-bottom-color: rgba(255, 145, 0, 0.2) !important;
}

.scanner-item {
    border-color: rgba(255, 145, 0, 0.15) !important;
    background: linear-gradient(135deg,
            rgba(255, 145, 0, 0.02) 0%,
            rgba(10, 14, 23, 0.95) 40%) !important;
}

.scanner-item .panel-badge {
    background: rgba(255, 145, 0, 0.15);
    color: var(--neon-orange);
}

/* ── Collapsible Portfolio Header ─────────────────────────────────────── */
.portfolio-collapse-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    margin-bottom: 6px;
    gap: 8px;
}

.portfolio-collapse-header:hover {
    border-bottom-color: rgba(0, 243, 255, 0.15);
}

.portfolio-positions-table {
    animation: fadeIn 0.15s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Toast Notifications ──────────────────────────────────────────────── */
.toast-container {
    position: fixed;
    bottom: 16px;
    right: 16px;
    z-index: 10000;
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--panel-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-primary);
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.3s ease;
    pointer-events: auto;
    max-width: 360px;
}

.toast-visible {
    transform: translateX(0);
    opacity: 1;
}

.toast-exit {
    transform: translateX(120%);
    opacity: 0;
}

.toast-icon {
    font-size: 14px;
    flex-shrink: 0;
}

.toast-msg {
    flex: 1;
    line-height: 1.3;
}

.toast-success {
    border-left: 3px solid var(--neon-green);
}

.toast-success .toast-icon {
    color: var(--neon-green);
}

.toast-error {
    border-left: 3px solid var(--neon-red);
}

.toast-error .toast-icon {
    color: var(--neon-red);
}

.toast-warning {
    border-left: 3px solid var(--neon-orange);
}

.toast-warning .toast-icon {
    color: var(--neon-orange);
}

.toast-info {
    border-left: 3px solid var(--neon-cyan);
}

.toast-info .toast-icon {
    color: var(--neon-cyan);
}

/* ── Stale Data Indicator ─────────────────────────────────────────────── */
.stale-badge {
    font-family: var(--font-mono);
    font-size: 8px;
    padding: 1px 5px;
    border-radius: 3px;
    background: rgba(255, 145, 0, 0.12);
    color: var(--neon-orange);
    border: 1px solid rgba(255, 145, 0, 0.2);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* ── Signals & Picks Widget ───────────────────────────────────────────── */
.signals-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    margin-bottom: 6px;
}

.signals-date {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--neon-cyan);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.signals-count {
    font-family: var(--font-mono);
    font-size: 9px;
    color: var(--text-muted);
}

.signals-table {
    width: 100%;
    font-family: var(--font-mono);
    font-size: 10px;
    border-collapse: collapse;
}

.signals-table th {
    font-size: 8px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
    padding: 2px 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.signals-table td {
    padding: 4px;
}

.signals-table tr:hover {
    background: rgba(0, 243, 255, 0.04);
}

.signal-grade-a {
    color: var(--neon-green);
    font-weight: 700;
}

.signal-grade-b {
    color: var(--neon-orange);
    font-weight: 600;
}

.signal-grade-c {
    color: var(--text-muted);
}

.signal-ema-cell {
    font-size: 8px;
    color: var(--neon-cyan);
}

.signal-company {
    font-size: 8px;
    color: var(--text-muted);
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.signal-pullback {
    font-size: 8px;
    padding: 1px 4px;
    border-radius: 3px;
    background: rgba(0, 255, 65, 0.1);
    color: var(--neon-green);
    border: 1px solid rgba(0, 255, 65, 0.2);
    font-weight: 600;
}

/* Signal alerts */
.signal-alert {
    padding: 8px 10px;
    margin-bottom: 6px;
    border-radius: var(--radius-sm);
    background: var(--panel-glass);
    border: 1px solid var(--border);
    animation: slideInLeft 0.3s ease;
}

.signal-buy {
    border-left: 3px solid var(--neon-green);
}

.signal-sell {
    border-left: 3px solid var(--neon-red);
}

.signal-alert-header {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 3px;
}

.signal-alert-price {
    color: var(--neon-cyan);
}

.signal-alert-time {
    color: var(--text-muted);
    font-size: 9px;
}

.signal-alert-reasons {
    font-family: var(--font-mono);
    font-size: 9px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.signal-alert-score {
    font-family: var(--font-mono);
    font-size: 8px;
    color: var(--text-muted);
    margin-top: 2px;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-12px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Live technicals state rows */
.signals-states-label {
    font-family: var(--font-mono);
    font-size: 8px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 6px 0 3px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    margin-top: 6px;
}

.signal-state-row {
    display: flex;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 9px;
    padding: 3px 4px;
    border-radius: 3px;
    color: var(--text-secondary);
}

.signal-state-row:hover {
    background: rgba(0, 243, 255, 0.04);
}

/* ── Buy Signal Flash + Watchlist ─────────────────────────────────────── */
.signal-row-flash {
    animation: buyFlash 1.5s ease-in-out infinite;
}

@keyframes buyFlash {

    0%,
    100% {
        background: transparent;
    }

    50% {
        background: rgba(57, 255, 20, 0.12);
    }
}

.signal-price {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 10px;
    color: var(--neon-cyan);
}

.signal-price-flash {
    animation: priceFlash 0.6s ease;
}

@keyframes priceFlash {
    0% {
        color: var(--neon-yellow);
        text-shadow: 0 0 8px rgba(255, 230, 0, 0.5);
    }

    100% {
        color: var(--neon-cyan);
        text-shadow: none;
    }
}

.signal-chg {
    font-family: var(--font-mono);
    font-size: 9px;
}

.watchlist-star {
    cursor: pointer;
    font-size: 12px;
    opacity: 0.25;
    transition: opacity 0.2s, color 0.2s, transform 0.2s;
    color: var(--text-muted);
    user-select: none;
}

.watchlist-star:hover {
    opacity: 0.7;
    transform: scale(1.2);
}

.watchlist-star.active {
    opacity: 1;
    color: var(--neon-yellow);
    text-shadow: 0 0 8px rgba(255, 230, 0, 0.4);
}

/* ── Ghost Grade V2 Panel ─────────────────────────────────────────────── */
.ghost-grade-panel {
    margin-bottom: 8px;
}

.grade-hero {
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid var(--neon-cyan);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    margin-bottom: 6px;
    position: relative;
    overflow: hidden;
}

.grade-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 255, 204, 0.03), transparent);
    pointer-events: none;
}

.grade-trade-now {
    text-align: center;
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #000;
    background: linear-gradient(90deg, #00FFCC, #00FFFF, #00FFCC);
    padding: 4px 0;
    margin: -10px -12px 8px;
    animation: tradeFlash 0.8s ease-in-out infinite;
}

@keyframes tradeFlash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; background: linear-gradient(90deg, #FFD740, #FF9100, #FFD740); }
}

.grade-hot {
    border-color: #00FFCC;
    box-shadow: 0 0 20px rgba(0, 255, 204, 0.15), inset 0 0 20px rgba(0, 255, 204, 0.05);
    animation: gradeGlow 2s ease-in-out infinite;
}

@keyframes gradeGlow {
    0%, 100% { box-shadow: 0 0 20px rgba(0, 255, 204, 0.15); }
    50% { box-shadow: 0 0 30px rgba(0, 255, 204, 0.3), 0 0 60px rgba(0, 255, 204, 0.1); }
}

.grade-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.grade-ticker {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 800;
    color: var(--neon-cyan);
    letter-spacing: 1px;
}

.grade-letter {
    font-family: var(--font-mono);
    font-size: 28px;
    font-weight: 900;
    line-height: 1;
    text-shadow: 0 0 15px currentColor;
}

.grade-score {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.grade-dir {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    margin-left: auto;
    letter-spacing: 1px;
}

.grade-axes {
    display: flex;
    gap: 4px;
    margin-bottom: 4px;
}

.axis-bar {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.axis-label {
    font-family: var(--font-mono);
    font-size: 8px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.axis-track {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    overflow: hidden;
}

.axis-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.5s ease;
}

.grade-meta {
    font-family: var(--font-mono);
    font-size: 8px;
    color: var(--text-muted);
    text-align: center;
    letter-spacing: 0.3px;
}

/* Grade alert in signal feed */
.signal-grade-alert {
    border-left: 3px solid #00FFCC;
    background: rgba(0, 255, 204, 0.06);
}