@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:ital,wght@0,300..700;1,300..700&display=swap');

/* ── VARIABLE SYSTEM (WARM SLATE & SOLAR AMBER) ── */
:root {
    --bg-main: #07080b;
    --bg-sidebar: #030406;
    --card-bg: rgba(13, 14, 21, 0.85);
    --card-border: rgba(255, 255, 255, 0.04);
    --card-hover-border: rgba(255, 158, 0, 0.35);
    
    --text-primary: #ffffff;
    --text-secondary: #cbd5e1; /* Higher brightness slate-300 */
    --text-muted: #8a99ad;     /* Highly readable slate-400 */
    
    --accent-amber: #ff9e00;
    --accent-amber-glow: rgba(255, 158, 0, 0.15);
    
    --gain-color: #00ff88;     /* Bright neon emerald green */
    --gain-glow: rgba(0, 255, 136, 0.08);
    
    --loss-color: #ff3366;     /* Saturated desaturated cherry pink */
    --loss-glow: rgba(255, 51, 102, 0.08);
    
    --transition-speed: 0.3s;
    --font-sans: 'Plus Jakarta Sans', -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

/* ── RESET & BASE ── */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    overflow: hidden;
    position: relative;
    line-height: 1.5;
}

/* Geometric Dot Grid Overlay */
.grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: radial-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 0);
    background-size: 24px 24px;
    pointer-events: none;
    z-index: -1;
}

/* Disable old decorative background circles */
.background-decorations {
    display: none;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 158, 0, 0.15);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 158, 0, 0.4);
}

/* ── LAYOUT WRAPPER (ASYNCHRONOUS WINDOWS) ── */
.dashboard-wrapper {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* ── SIDEBAR DECK (LEFT COLUMN) ── */
.sidebar-deck {
    width: 320px;
    height: 100vh;
    background-color: var(--bg-sidebar);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    padding: 32px 20px;
    display: flex;
    flex-direction: column;
    gap: 28px;
    flex-shrink: 0;
    overflow-y: auto;
}

.sidebar-deck .logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-deck .logo-icon {
    color: var(--accent-amber);
    width: 24px;
    height: 24px;
    filter: drop-shadow(0 0 6px var(--accent-amber-glow));
}

.sidebar-deck .logo h1 {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: #ffffff;
}

.sidebar-deck .logo h1 span {
    color: var(--accent-amber);
    font-weight: 800;
}

/* Badges Statuses Stack */
.sidebar-deck .status-badges {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-deck .badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
}

.indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.badge.market-open {
    color: var(--gain-color);
    border-color: rgba(16, 185, 129, 0.2);
    background: rgba(16, 185, 129, 0.02);
}

.badge.market-open .indicator {
    background-color: var(--gain-color);
    box-shadow: 0 0 8px var(--gain-color);
}

.badge.market-closed {
    color: var(--text-muted);
}

.badge.market-closed .indicator {
    background-color: var(--text-muted);
}

.broker-badge {
    color: var(--accent-amber);
    border-color: rgba(255, 158, 0, 0.2);
}

.broker-badge i {
    width: 12px;
    height: 12px;
    color: var(--accent-amber);
}

.badge.vix-ok {
    color: var(--gain-color);
    border-color: rgba(16, 185, 129, 0.2);
}

.badge.vix-blocked {
    color: var(--loss-color);
    border-color: rgba(244, 63, 94, 0.35);
    background: rgba(244, 63, 94, 0.03);
}

/* Vertically Stacked Sidebar Cards */
.sidebar-kpis {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1;
}

.sidebar-deck .kpi-card {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 14px 16px;
    height: auto;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: none;
    transition: all var(--transition-speed);
}

.sidebar-deck .kpi-card:hover {
    border-color: rgba(255, 158, 0, 0.25);
    background: rgba(255, 158, 0, 0.01);
}

.sidebar-deck .kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.sidebar-deck .kpi-title {
    font-size: 0.72rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-deck .kpi-icon {
    width: 13px;
    height: 13px;
    color: var(--text-muted);
}

.sidebar-deck .kpi-value {
    font-family: var(--font-mono);
    font-size: 1.35rem;
    font-weight: 700;
    color: #ffffff;
}

.sidebar-deck .sparkline-container {
    position: relative;
    height: 14px;
    margin: 4px 0;
    opacity: 0.45;
    left: 0; right: 0; bottom: 0;
}

.sidebar-deck .kpi-footer {
    font-size: 0.68rem;
    font-weight: 600;
}

.sidebar-system-telemetry {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-muted);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 16px;
}

.sidebar-system-telemetry .telemetry-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--accent-amber);
    box-shadow: 0 0 6px var(--accent-amber);
}

/* ── MAIN CONTENT PANE (RIGHT VIEWPORT) ── */
.main-content-pane {
    flex: 1;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* TOPBAR DECK (Horizontal secondary deck) ── */
.topbar-deck {
    height: 75px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 0 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(7, 8, 11, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 10;
    flex-shrink: 0;
}

.secondary-kpis {
    display: flex;
    gap: 32px;
}

.mini-kpi-card {
    display: flex;
    flex-direction: column;
}

.mini-kpi-title {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mini-kpi-content {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.mini-kpi-value {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
}

.mini-kpi-sub {
    font-size: 0.68rem;
    color: var(--text-secondary);
}

/* Stark buttons */
.btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.25s ease;
    border: none;
}

.btn-primary {
    background: var(--accent-amber);
    color: #030406;
}

.btn-primary:hover {
    background: #ffa81a;
    box-shadow: 0 4px 15px rgba(255, 158, 0, 0.25);
    transform: translateY(-1px);
}

/* ── CONTENT SCROLLER ── */
.content-scroller {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* ── CARDS (GLASS BLUR) ── */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    transition: border-color var(--transition-speed),
                box-shadow var(--transition-speed),
                transform var(--transition-speed);
}

.card:hover {
    border-color: var(--card-hover-border);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 158, 0, 0.03);
    transform: translateY(-2px);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 12px;
}

.section-header h2 {
    font-size: 0.95rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ffffff;
}

.section-header h2 i {
    color: var(--accent-amber);
    width: 15px;
    height: 15px;
}

/* Chart tabs / controls */
.chart-controls {
    display: flex;
    gap: 12px;
    align-items: center;
}

.chart-tabs {
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.02);
    padding: 2px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.chart-tab {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 4px 10px;
    font-size: 0.72rem;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.chart-tab:hover {
    color: #ffffff;
}

.chart-tab.active {
    background: rgba(255, 158, 0, 0.1);
    color: var(--accent-amber);
    border: 1px solid rgba(255, 158, 0, 0.2);
}

.chart-tab.active-pnl {
    background: rgba(16, 185, 129, 0.1);
    color: var(--gain-color);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.chart-tab.active-pnl-loss {
    background: rgba(244, 63, 94, 0.1);
    color: var(--loss-color);
    border: 1px solid rgba(244, 63, 94, 0.2);
}

.period-filters {
    display: flex;
    gap: 2px;
}

.period-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 4px 8px;
    font-size: 0.7rem;
    font-family: var(--font-mono);
    font-weight: 600;
    cursor: pointer;
    border-radius: 4px;
    transition: color 0.2s;
}

.period-btn:hover {
    color: var(--text-secondary);
}

.period-btn.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* ── ASYMMETRIC GRID Layout ── */
.asymmetric-grid {
    display: grid;
    grid-template-columns: 1.8fr 1fr;
    gap: 24px;
}

@media (max-width: 1100px) {
    .asymmetric-grid {
        grid-template-columns: 1fr;
    }
}

.telemetry-column {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Apprentissage de l'IA (Leçons) */
.learnings-section {
    border-left: 2px solid var(--accent-amber);
}

.learnings-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    max-height: 160px;
}

.learning-card {
    background: rgba(255, 158, 0, 0.01);
    border: 1px solid rgba(255, 158, 0, 0.05);
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 0.76rem;
    line-height: 1.45;
}

.learning-card strong {
    color: #ffd280;
    font-weight: 600;
    display: block;
    margin-bottom: 2px;
}

/* Watchlist Mid-Caps */
.watchlist-section {
    border-left: 2px solid var(--accent-amber);
}

.watchlist-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    max-height: 160px;
}

.watchlist-card {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.76rem;
    transition: all var(--transition-speed);
}

.watchlist-card:hover {
    border-color: rgba(255, 158, 0, 0.2);
    background: rgba(255, 158, 0, 0.02);
    transform: translateX(2px);
}

.watchlist-ticker {
    font-family: var(--font-mono);
    font-weight: 700;
    color: #ffffff;
}

.watchlist-name {
    font-size: 0.68rem;
    color: var(--text-secondary);
}

.watchlist-score {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--accent-amber);
}

.watchlist-reason {
    font-size: 0.68rem;
    color: var(--text-muted);
}

/* ── POSITIONS ACTIVE ── */
.positions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.position-card {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: all var(--transition-speed);
}

.position-card:hover {
    border-color: rgba(255, 255, 255, 0.1);
}

.position-card.positive {
    border-left: 3px solid var(--gain-color);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.02);
}
.position-card.negative {
    border-left: 3px solid var(--loss-color);
    box-shadow: 0 4px 15px rgba(244, 63, 94, 0.02);
}

.ticker-badge {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1rem;
}

.qty-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.pos-pnl {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    font-weight: 700;
}
.pos-pnl.positive { color: var(--gain-color); }
.pos-pnl.negative { color: var(--loss-color); }

.position-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    font-size: 0.72rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 8px 10px;
    border-radius: 4px;
}

.detail-row span:first-child {
    color: var(--text-muted);
    font-size: 0.62rem;
    text-transform: uppercase;
}

.detail-row span:last-child {
    font-weight: 600;
    color: #ffffff;
    font-family: var(--font-mono);
}

/* Stop Loss & Take Profit Visual Bar */
.safety-bar-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.62rem;
}

.safety-labels {
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.safety-bar-bg {
    height: 4px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    position: relative;
}

.safety-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--loss-color) 0%, rgba(255, 158, 0, 0.4) 50%, var(--gain-color) 100%);
    border-radius: 2px;
    width: 100%;
}

.safety-dot {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    background-color: #ffffff;
    border-radius: 50%;
    border: 1px solid #000;
    box-shadow: 0 0 4px #ffffff;
}

/* ── OFF-MARKET REPORTS ── */
.report-header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.report-tabs {
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.015);
    padding: 2px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

/* Download icons buttons */
.btn-pdf, .btn-html, .btn-md {
    padding: 6px 12px;
    font-size: 0.72rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.015);
    color: var(--text-secondary);
}

.btn-pdf:hover { color: var(--loss-color); border-color: rgba(244, 63, 94, 0.3); }
.btn-html:hover { color: var(--accent-amber); border-color: rgba(255, 158, 0, 0.3); }
.btn-md:hover { color: var(--gain-color); border-color: rgba(16, 185, 129, 0.3); }

.report-content-container {
    margin-top: 16px;
}

.report-panel {
    display: none;
}

.report-panel.active {
    display: block;
    animation: fade-in 0.25s ease-out;
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Reports elements */
.markdown-body {
    font-size: 0.825rem;
    line-height: 1.6;
    color: #e2e8f0;
}

.markdown-body h1, .markdown-body h2, .markdown-body h3 {
    color: #ffffff;
    margin-top: 18px;
    margin-bottom: 8px;
}

.markdown-body h1 { font-size: 1.25rem; border-bottom: 1px solid rgba(255,255,255,0.08); padding-bottom: 6px; }
.markdown-body h2 { font-size: 1.1rem; }
.markdown-body h3 { font-size: 0.92rem; }

.markdown-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 14px 0;
}

.markdown-body th, .markdown-body td {
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    text-align: left;
}

.markdown-body th {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-secondary);
}

.markdown-body blockquote {
    border-left: 3px solid var(--accent-amber);
    background: rgba(255, 158, 0, 0.01);
    padding: 8px 12px;
    margin: 12px 0;
    font-style: italic;
    color: var(--text-secondary);
}

/* Tables general */
.correlation-table-wrapper {
    overflow-x: auto;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.correlation-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.76rem;
    font-family: var(--font-mono);
}

.correlation-table th, .correlation-table td {
    padding: 10px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.correlation-table th {
    background: rgba(255, 255, 255, 0.015);
    color: var(--text-secondary);
}

.correlation-table td:first-child, .correlation-table th:first-child {
    text-align: left;
    font-weight: 600;
    color: #ffffff;
}

/* Taxes Belgian */
.tax-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.tax-kpi {
    padding: 16px;
    background: rgba(255, 255, 255, 0.01);
}

.tax-kpi-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-muted);
}

.tax-kpi-value {
    font-family: var(--font-mono);
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
}

.tax-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
}

.tax-table th, .tax-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.tax-table th {
    background: rgba(255, 255, 255, 0.015);
    color: var(--text-secondary);
}

/* Rebalance */
.rebalance-container-layout {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 24px;
}

.rebalance-chart-wrapper {
    height: 200px;
    position: relative;
}

.rebalance-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 200px;
    overflow-y: auto;
}

.rebalance-item {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.76rem;
}

.rebalance-action.buy { color: var(--gain-color); font-weight: 600; }
.rebalance-action.sell { color: var(--loss-color); font-weight: 600; }

/* Walk-Forward */
.wf-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.wf-card {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    padding: 12px;
    font-size: 0.74rem;
}

.wf-card:hover {
    border-color: rgba(255, 158, 0, 0.2);
}

.wf-card-title {
    font-weight: 600;
    color: #ffffff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    padding-bottom: 4px;
    margin-bottom: 6px;
}

.wf-metric {
    display: flex;
    justify-content: space-between;
}

.wf-metric-label { color: var(--text-muted); }
.wf-metric-val { font-family: var(--font-mono); }
.wf-metric-val.positive { color: var(--gain-color); }
.wf-metric-val.negative { color: var(--loss-color); }

/* Reports History */
.reports-history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.report-history-card {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    padding: 14px;
    height: 95px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all var(--transition-speed);
}

.report-history-card:hover {
    border-color: var(--accent-amber);
    background: rgba(255, 158, 0, 0.015);
}

.rh-title { font-size: 0.8rem; font-weight: 600; color: #ffffff; }
.rh-date { font-size: 0.68rem; color: var(--text-muted); font-family: var(--font-mono); }
.rh-click-indicator { color: var(--accent-amber); font-size: 0.68rem; font-weight: 600; }

/* ── JOURNAL DE TRADING TABLE ── */
.journal-table-wrapper {
    overflow-x: auto;
    max-height: 350px;
}

.journal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.journal-table th, .journal-table td {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.journal-table th {
    font-weight: 600;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.015);
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
}

.journal-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.01);
}

.journal-date { font-family: var(--font-mono); color: var(--text-secondary); }
.journal-ticker { font-family: var(--font-mono); font-weight: 700; color: #ffffff; }
.journal-pnl.positive { color: var(--gain-color); font-weight: 600; }
.journal-pnl.negative { color: var(--loss-color); font-weight: 600; }

.btn-details {
    background: rgba(255, 158, 0, 0.05);
    border: 1px solid rgba(255, 158, 0, 0.2);
    color: var(--accent-amber);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-details:hover {
    background: var(--accent-amber);
    color: #030406;
}

/* ── CONSOLE TERMINAL DIRECT (WIDESCREEN ACCENT AMBER) ── */
.terminal-actions-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.log-filters {
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.01);
    padding: 2px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.log-filter-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 3px 8px;
    font-size: 0.68rem;
    font-weight: 600;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
}

.log-filter-btn:hover { color: #ffffff; }
.log-filter-btn.active { background: rgba(255, 158, 0, 0.15); color: var(--accent-amber); }

.terminal-status-dot {
    width: 6px;
    height: 6px;
    background-color: var(--gain-color);
    box-shadow: 0 0 6px var(--gain-color);
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

.terminal-status-text {
    font-size: 0.68rem;
    font-family: var(--font-mono);
    color: var(--text-secondary);
}

.terminal-container {
    background: #020304;
    border: 1px solid rgba(255, 158, 0, 0.1);
    border-radius: 6px;
    padding: 16px;
    height: 250px;
    overflow-y: auto;
    font-family: var(--font-mono);
    font-size: 0.74rem;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: inset 0 4px 20px rgba(0,0,0,0.8);
}

.terminal-row {
    white-space: pre-wrap;
    word-break: break-all;
}

.terminal-row.debug { color: var(--text-muted); }
.terminal-row.info { color: #e2e8f0; }
.terminal-row.warning { color: #ffd280; }
.terminal-row.error { color: var(--loss-color); font-weight: 600; }

/* ── MODALS OVERLAYS ── */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(3, 4, 6, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal.active { display: flex; }

.modal-content {
    width: 100%;
    max-width: 600px;
    background: #08090d;
    border: 1px solid rgba(255, 158, 0, 0.2);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9), 0 0 30px rgba(255, 158, 0, 0.05);
    border-radius: 8px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.modal-header h3 { font-size: 1rem; font-weight: 600; color: #ffffff; }
.modal-header h3 span { font-family: var(--font-mono); color: var(--accent-amber); }
.close-modal { font-size: 1.4rem; color: var(--text-secondary); cursor: pointer; line-height: 1; }
.close-modal:hover { color: #ffffff; }

.modal-body {
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    background: rgba(0, 0, 0, 0.25);
    padding: 12px;
    border-radius: 6px;
}

.info-item { display: flex; flex-direction: column; }
.info-label { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; }
.info-value { font-weight: 600; font-size: 0.825rem; color: #ffffff; font-family: var(--font-mono); }

.info-value.badge.buy { color: var(--gain-color); }
.info-value.badge.sell { color: var(--loss-color); }

.modal-text-block h4 {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}
.modal-text-block h4 i { color: var(--accent-amber); width: 13px; height: 13px; }
.text-content {
    font-size: 0.8rem;
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.01);
    padding: 10px;
    border-radius: 4px;
    border-left: 2px solid var(--accent-amber);
}

.metrics-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-family: var(--font-mono); font-size: 0.68rem; padding: 3px 6px; border-radius: 4px; background: rgba(255, 255, 255, 0.015); border: 1px solid rgba(255,255,255,0.04); color: var(--text-secondary); }
.tag strong { color: #ffffff; }

.modal-report-history { max-width: 750px; }

/* Spinner */
.loading-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--text-secondary); font-size: 0.76rem; padding: 24px; }
.spinner { animation: spin 1s linear infinite; color: var(--accent-amber); width: 18px; height: 18px; }

/* FTMO Challenge Panel Styles */
.ftmo-description {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    padding-bottom: 10px;
}

.ftmo-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.ftmo-status-card {
    padding: 16px;
    background: rgba(14, 16, 22, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ftmo-status-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-muted);
}

.ftmo-status-value {
    font-family: var(--font-mono);
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
}

.ftmo-status-value.positive {
    color: var(--gain-color) !important;
}

.ftmo-status-value.negative {
    color: var(--loss-color) !important;
}

.ftmo-status-sub {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.ftmo-tables-container h3 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-amber);
    margin-bottom: 12px;
}

.badge-buy {
    background: rgba(16, 185, 129, 0.1);
    color: var(--gain-color) !important;
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

.badge-sell {
    background: rgba(244, 63, 94, 0.1);
    color: var(--loss-color) !important;
    border: 1px solid rgba(244, 63, 94, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

/* ── RESPONSIVE MOBILE VIEW ── */
@media (max-width: 900px) {
    .dashboard-wrapper {
        flex-direction: column;
    }
    .sidebar-deck {
        width: 100vw;
        height: auto;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        padding: 20px;
    }
    .sidebar-kpis {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 12px;
    }
    .main-content-pane {
        margin-left: 0;
        width: 100vw;
        height: auto;
    }
    .topbar-deck {
        padding: 0 20px;
    }
}

/* ── NAVIGATION SWITCH BETWEEN DASHBOARDS ── */
.nav-switch-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-speed) ease;
}

.nav-switch-btn:hover {
    color: var(--accent-amber);
    border-color: rgba(255, 158, 0, 0.3);
    background: rgba(255, 158, 0, 0.03);
}

.nav-switch-btn i {
    width: 14px;
    height: 14px;
    transition: transform var(--transition-speed);
}

.nav-switch-btn:hover i {
    transform: scale(1.1);
}


/* ── System Status Panel ─────────────────────────────────────────────── */
.status-section { margin-bottom: 1.25rem; }
.status-summary {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-left: 0.6rem;
    letter-spacing: 0.02em;
}
.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.6rem;
    margin-top: 0.4rem;
}
.status-item {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.65rem 0.8rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    border-left: 3px solid var(--text-muted);
    border-radius: 10px;
    transition: border-color var(--transition-speed), background var(--transition-speed);
}
.status-item:hover { background: rgba(255, 255, 255, 0.04); }
.status-item.ok   { border-left-color: var(--gain-color); }
.status-item.warn { border-left-color: var(--accent-amber); }
.status-item.down { border-left-color: var(--loss-color); }
.status-dot {
    width: 9px; height: 9px;
    border-radius: 50%;
    margin-top: 5px;
    flex-shrink: 0;
}
.status-item.ok   .status-dot { background: var(--gain-color);   box-shadow: 0 0 7px var(--gain-color); }
.status-item.warn .status-dot { background: var(--accent-amber); box-shadow: 0 0 7px var(--accent-amber); animation: status-pulse 1.8s infinite; }
.status-item.down .status-dot { background: var(--loss-color);   box-shadow: 0 0 7px var(--loss-color); animation: status-pulse 1.1s infinite; }
@keyframes status-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }
.status-text { display: flex; flex-direction: column; min-width: 0; }
.status-name { font-size: 0.82rem; font-weight: 600; color: var(--text-primary); }
.status-detail {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    margin-top: 1px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.status-pill {
    display: inline-block;
    padding: 0.05rem 0.45rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    margin-left: 0.3rem;
}
.status-pill.ok   { background: var(--gain-glow); color: var(--gain-color); }
.status-pill.warn { background: var(--accent-amber-glow); color: var(--accent-amber); }
.status-pill.down { background: var(--loss-glow); color: var(--loss-color); }
