/* ==========================================================================
   SynchroQuant UI stylesheet (Glassmorphism & Dark Cyberpunk Aesthetic)
   ========================================================================== */

:root {
    --bg-color: #07090e;
    --card-bg: rgba(18, 22, 30, 0.7);
    --card-bg-solid: #12161e;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(0, 242, 254, 0.25);
    
    /* Neon Colors */
    --color-primary: #00f2fe;     /* Electric Cyan */
    --color-secondary: #4facfe;   /* Blue */
    --color-green: #0ecb81;       /* Binance Green */
    --color-red: #f6465d;         /* Binance Red */
    --color-orange: #ff9f43;      /* Warm Orange */
    --color-purple: #d500f9;      /* Neon Purple */
    
    /* Text colors */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* Layout */
    --sidebar-width: 280px;
    --header-height: 48px;
    --border-radius-lg: 10px;
    --border-radius-md: 6px;
    --border-radius-sm: 4px;
    
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body.light-theme {
    --bg-color: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.85);
    --card-bg-solid: #ffffff;
    --border-color: rgba(0, 0, 0, 0.08);
    --border-hover: rgba(0, 242, 254, 0.45);
    
    /* Text colors */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    
    /* High contrast color definitions for Light mode */
    --color-primary: #0284c7;     /* Ocean Blue / Legible Cyan */
    --color-secondary: #0369a1;   /* Deeper Blue */
    --color-orange: #d97706;      /* Darker Gold/Orange */
    --color-green: #15803d;       /* Darker Binance Green */
    --color-red: #b91c1c;         /* Darker Binance Red */
}

body.light-theme .panel-section {
    background: rgba(0, 0, 0, 0.015);
    border: 1px solid rgba(0, 0, 0, 0.05);
}
body.light-theme .weight-engine-section {
    background: rgba(0, 242, 254, 0.03);
    border: 1px solid rgba(0, 242, 254, 0.25);
}
body.light-theme .slider-group {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.05);
}
body.light-theme .slider-breakdown {
    background: transparent !important;
}
body.light-theme .score-calculation-formula {
    background: rgba(0, 0, 0, 0.02);
}
body.light-theme .sim-speed-wrapper label,
body.light-theme .sim-progress-indicator span {
    color: var(--text-secondary);
}
body.light-theme .progress-track {
    background-color: rgba(0, 0, 0, 0.06);
}
body.light-theme .chart-container-wrapper {
    background: #12161e !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}
body.light-theme .sub-chart-wrapper {
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
}
body.light-theme .sub-chart-label {
    color: #94a3b8 !important;
}
body.light-theme .signal-hud {
    background: rgba(255, 255, 255, 0.9);
}
body.light-theme .rep-kpi-item {
    background: rgba(0, 0, 0, 0.02);
}
body.light-theme .modal-content {
    background: var(--card-bg-solid);
}
body.light-theme input[type="text"],
body.light-theme input[type="number"],
body.light-theme select {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.12);
}
body.light-theme input[type="range"] {
    background: rgba(0, 0, 0, 0.08) !important;
}
body.light-theme .slider-breakdown .stat-bar-container {
    background: rgba(0, 0, 0, 0.08) !important;
}
body.light-theme .logo-text h1 {
    background: linear-gradient(to right, #0284c7, #0369a1) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

/* Reset & Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 11.5px;
    overflow-x: hidden;
    min-height: 100vh;
    line-height: 1.4;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Background Glow Elements - HIDDEN for Minimalist look */
.bg-glow {
    display: none;
}

/* Glassmorphism Common Styles */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    box-shadow: none;
    transition: border-color var(--transition-normal);
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

/* Layout Container */
.terminal-container {
    width: 100%;
    max-width: 100%;
    padding: 8px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* HEADER */
.terminal-header {
    height: var(--header-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 4px;
}

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

.logo-icon {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    border-radius: var(--border-radius-md);
    position: relative;
    box-shadow: none;
}
.logo-icon::before {
    content: '';
    position: absolute;
    top: 25%;
    left: 25%;
    width: 50%;
    height: 50%;
    background-color: var(--bg-color);
    border-radius: 3px;
    clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
}

.logo-text h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.1;
    background: linear-gradient(to right, #ffffff, #c7d2fe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.logo-text span {
    font-size: 9px;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.03);
    padding: 4px 10px;
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    font-size: 11px;
}
.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}
.status-connected {
    background-color: var(--color-green);
    box-shadow: none;
    animation: pulse 2s infinite;
}
.status-disconnected {
    background-color: var(--color-red);
    box-shadow: none;
}

@keyframes pulse {
    0% { transform: scale(0.95); }
    50% { transform: scale(1.1); }
    100% { transform: scale(0.95); }
}

/* MAIN GRID LAYOUT */
.terminal-grid {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    gap: 6px;
    align-items: start;
}

/* SIDEBAR CONTROL PANEL */
.control-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px;
    height: calc(100vh - var(--header-height) - 20px);
    overflow-y: auto;
    position: sticky;
    top: 10px;
}

.panel-section {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: var(--border-radius-sm);
    padding: 8px;
    margin-bottom: 2px;
}

.weight-engine-section {
    background: rgba(0, 242, 254, 0.02);
    border: 1px solid rgba(0, 242, 254, 0.15);
}

.weight-engine-section.smart-active .slider-group,
.weight-engine-section.smart-active .divider,
.weight-engine-section.smart-active .score-calculation-formula {
    display: none !important;
}

.section-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}
.section-title svg {
    width: 14px;
    height: 14px;
    color: var(--color-primary);
}

.divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 4px 0;
}

/* INPUTS & CONTROLS */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.input-group label {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
}

.ticker-input-wrapper {
    display: flex;
    gap: 4px;
}
.ticker-input-wrapper input {
    flex: 1;
}

input[type="text"],
input[type="number"],
select {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border-color);
    padding: 6px 8px;
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-size: 12px;
    outline: none;
    transition: border-color var(--transition-fast), background var(--transition-fast);
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
    border-color: var(--color-primary);
    background: rgba(0, 0, 0, 0.5);
}

.row-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    border: none;
    transition: all var(--transition-fast);
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    color: #07090e;
    box-shadow: none;
}
.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: none;
}
.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(0, 242, 254, 0.08);
    color: var(--color-primary);
    border: 1px solid rgba(0, 242, 254, 0.2);
}
.btn-secondary:hover {
    background: rgba(0, 242, 254, 0.15);
    border-color: var(--color-primary);
}

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

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
}
.btn-xs {
    padding: 5px 10px;
    font-size: 11px;
}

.w-full {
    width: 100%;
}

/* Quick Ticker Tags */
.quick-tickers {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 2px;
}
.quick-ticker-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-secondary);
    padding: 3px 6px;
    font-size: 10px;
    cursor: pointer;
    font-weight: 500;
    transition: all var(--transition-fast);
}
.quick-ticker-btn:hover,
.quick-ticker-btn.active {
    background: rgba(0, 242, 254, 0.1);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

/* SLIDERS */
.slider-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: var(--border-radius-sm);
    padding: 6px;
    margin-bottom: 5px;
}

/* Inline breakdown gauges under sliders */
.slider-breakdown {
    display: none !important;
}
.breakdown-raw {
    display: none !important;
}
.breakdown-scaled {
    display: none !important;
}
.slider-breakdown .stat-bar-container {
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    position: relative;
    overflow: hidden;
}
.slider-label {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 500;
}
.slider-val {
    font-family: monospace;
    font-weight: 700;
    color: var(--color-primary);
}

input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    outline: none;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--color-primary);
    cursor: pointer;
    box-shadow: none;
    transition: transform 0.1s;
}
input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* Specific threshold styling */
.signal-buy-text {
    color: var(--color-green);
}
#buyThreshSlider::-webkit-slider-thumb {
    background: var(--color-green);
    box-shadow: none;
}
.signal-sell-text {
    color: var(--color-red);
}
#sellThreshSlider::-webkit-slider-thumb {
    background: var(--color-red);
    box-shadow: none;
}

/* MAIN DASHBOARD CONTENT AREA */
.main-dashboard {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* KPI Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr;
    gap: 6px;
}

/* Outcomes Card Styling */
.outcomes-grid {
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
    gap: 4px;
    margin-top: 4px;
}
.outcome-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.outcome-label {
    font-size: 10.5px;
    color: var(--text-secondary);
    font-weight: 500;
}
.outcome-val {
    font-family: monospace;
    font-weight: 700;
    font-size: 11.5px;
}

/* Streamlined Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 12px;
    margin-top: 4px;
}
.metric-item {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.metric-label {
    font-size: 10px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 2px;
}
.metric-val {
    font-family: monospace;
    font-weight: 700;
    font-size: 11px;
}
.ratio-progress-bar-mini {
    width: 100%;
    height: 2.5px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 1px;
    display: flex;
    overflow: hidden;
    margin-top: 2px;
}

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

.kpi-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    position: relative;
    overflow: hidden;
}

.main-kpi-card {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 10px;
}

.health-kpi-card {
    padding: 6px 10px;
}

.main-kpi-value-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.kpi-profit-loss {
    font-size: 11px;
    font-weight: 600;
    font-family: monospace;
}

.kpi-profit-loss.positive-text {
    color: var(--color-green);
}

.kpi-profit-loss.negative-text {
    color: var(--color-red);
}

.kpi-sub-details {
    font-size: 9.5px;
    color: var(--text-muted);
    margin-top: 1px;
}

.compact-health-metrics {
    display: flex;
    flex-direction: column;
    margin-top: 2px;
}

.health-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 10.5px;
    line-height: 1.3;
}

.health-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.health-value {
    font-family: monospace;
    font-weight: 700;
}

.health-sub {
    font-size: 9px;
    color: var(--text-muted);
    text-align: right;
    margin-top: -1px;
    margin-bottom: 2px;
}

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

.kpi-icon {
    width: 28px;
    height: 28px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
}
.kpi-icon svg {
    width: 15px;
    height: 15px;
}

.icon-cyan svg { color: var(--color-primary); }
.icon-orange svg { color: var(--color-orange); }
.icon-green svg { color: var(--color-green); }
.icon-red svg { color: var(--color-red); }

.kpi-details {
    display: flex;
    flex-direction: column;
    flex: 1;
}
.kpi-details h3 {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    font-weight: 500;
}
.kpi-value {
    font-family: 'Outfit', sans-serif;
    font-size: 16px;
    font-weight: 700;
    margin-top: 1px;
}
.kpi-change {
    font-size: 11px;
    font-weight: 600;
    margin-top: 1px;
    display: flex;
    align-items: center;
}
.kpi-change.positive { color: var(--color-green); }
.kpi-change.negative { color: var(--color-red); }
.kpi-sub {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 1px;
}

/* Cash vs Stock progress bar inside KPI */
.ratio-progress-bar {
    width: 100%;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    margin-top: 8px;
    display: flex;
    overflow: hidden;
}
.ratio-bar-cash {
    background-color: var(--color-orange);
    transition: width var(--transition-normal);
}
.ratio-bar-stock {
    background-color: var(--color-primary);
    transition: width var(--transition-normal);
}

.hover-glow:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

/* SIMULATION CONTROL HEADER */
.sim-controls-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 8px;
    gap: 8px;
    flex-wrap: wrap;
}

.sim-speed-wrapper {
    display: flex;
    flex-direction: column;
    gap: 3px;
    width: 150px;
}
.sim-speed-wrapper label {
    font-size: 10px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}
.sim-speed-wrapper label svg {
    width: 12px;
    height: 12px;
}
.sim-speed-wrapper input {
    height: 3px;
}

.sim-btn-group {
    display: flex;
    gap: 6px;
    align-items: center;
}
.btn-play {
    min-width: 120px;
}

.sim-progress-indicator {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 200px;
}
#simStepText {
    font-size: 11px;
    font-family: monospace;
    color: var(--text-secondary);
    text-align: right;
}
.progress-track {
    height: 5px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(to right, var(--color-secondary), var(--color-primary));
    width: 0%;
    transition: width 0.1s linear;
}

/* CHART SECTION */
.charts-card {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 6px;
}

.chart-title h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 600;
}
.chart-title span {
    font-size: 10px;
    color: var(--text-muted);
}

.signal-hud {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.25);
    padding: 4px 8px;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
}
.hud-label {
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
}
.hud-signal {
    font-weight: 800;
    font-size: 12px;
    letter-spacing: 0.05em;
    padding: 1px 6px;
    border-radius: 3px;
}
.signal-buy {
    color: var(--color-green);
    background: rgba(14, 203, 129, 0.15);
}
.signal-sell {
    color: var(--color-red);
    background: rgba(246, 70, 93, 0.15);
}
.signal-hold {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
}
.hud-score {
    font-family: monospace;
    font-size: 12px;
    font-weight: 700;
    color: var(--color-primary);
}

.chart-container-wrapper {
    width: 100%;
    position: relative;
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.chart-container {
    width: 100%;
    height: 250px;
}

.sub-chart-wrapper {
    border-top: 1px solid var(--border-color);
}
.sub-chart-wrapper .chart-container {
    height: 130px;
}
.sub-chart-label {
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
    position: absolute;
    top: 6px;
    left: 10px;
    z-index: 10;
    pointer-events: none;
    font-weight: 600;
}

/* BOTTOM LEDGER AND DETAILED METRICS GRID */
.bottom-panel-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
    margin-bottom: 12px;
}
.card-header h2 {
    font-size: 14px;
    color: var(--text-secondary);
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}
.card-header h2 svg {
    width: 16px;
    height: 16px;
    color: var(--color-primary);
}

/* Ledger Table */
.ledger-card {
    padding: 20px;
}
.table-container {
    max-height: 270px;
    overflow-y: auto;
}
.ledger-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    text-align: left;
}
.ledger-table th {
    color: var(--text-secondary);
    font-weight: 500;
    padding: 10px 8px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: var(--card-bg-solid);
    z-index: 5;
}
.ledger-table td {
    padding: 10px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    font-family: monospace;
}
.ledger-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.ledger-table tr.buy-row td:nth-child(2) {
    color: var(--color-green);
    font-weight: 700;
}
.ledger-table tr.sell-row td:nth-child(2) {
    color: var(--color-red);
    font-weight: 700;
}
.pnl-positive { color: var(--color-green); }
.pnl-negative { color: var(--color-red); }

.empty-row td {
    text-align: center;
    color: var(--text-muted);
    padding: 40px 0;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 6px;
    margin-bottom: 6px;
}
.card-header h2 {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}
.card-header h2 svg {
    width: 14px;
    height: 14px;
    color: var(--color-primary);
}

/* Ledger Table */
.ledger-card {
    padding: 8px;
}
.table-container {
    max-height: 240px;
    overflow-y: auto;
}
.ledger-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
    text-align: left;
}
.ledger-table th {
    color: var(--text-secondary);
    font-weight: 500;
    padding: 4px 3px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: var(--card-bg-solid);
    z-index: 5;
}
.ledger-table td {
    padding: 4px 3px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    font-family: monospace;
}
.ledger-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.ledger-table tr.buy-row td:nth-child(2) {
    color: var(--color-green);
    font-weight: 700;
}
.ledger-table tr.sell-row td:nth-child(2) {
    color: var(--color-red);
    font-weight: 700;
}
.pnl-positive { color: var(--color-green); }
.pnl-negative { color: var(--color-red); }

.empty-row td {
    text-align: center;
    color: var(--text-muted);
    padding: 30px 0;
}

/* Indicators Breakdown in Stats Card */
.stats-card {
    padding: 8px;
}
.indicator-stat-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.stat-meta {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
}
.stat-name {
    font-weight: 600;
}
.stat-raw-val {
    color: var(--text-secondary);
    font-family: monospace;
}

.stat-progress-wrapper {
    background: rgba(0, 0, 0, 0.2);
    padding: 3px 6px;
    border-radius: var(--border-radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.02);
    display: grid;
    grid-template-columns: 60px 1fr 35px;
    align-items: center;
    gap: 4px;
}
.stat-weight-label {
    font-size: 10px;
    color: var(--text-muted);
}
.stat-bar-container {
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    position: relative;
    overflow: hidden;
}
.stat-bar-fill {
    height: 100%;
    width: 0%; /* JS fills this from 0 to 100% relative to [-1.0, 1.0] */
    border-radius: 3px;
    transition: width var(--transition-fast), background-color var(--transition-fast);
}
.momentum-bar {
    background-color: var(--color-primary);
}
.volume-bar {
    background-color: var(--color-orange);
}
.volatility-bar {
    background-color: var(--color-purple);
}
.macd-bar {
    background-color: var(--color-secondary);
}
.accumulation-bar {
    background-color: #ffd700;
}
.trend-bar {
    background-color: var(--color-green);
}

/* Loading Overlay screen rules */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(7, 9, 14, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}
.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
.loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
.loading-text {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.05em;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.stat-bar-mid {
    position: absolute;
    left: 50%;
    top: 0;
    width: 1px;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.3);
}

.stat-scaled-val {
    font-family: monospace;
    font-size: 12px;
    font-weight: 700;
    text-align: right;
}

/* Formula Presentation */
.score-calculation-formula {
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed var(--border-color);
    padding: 12px;
    border-radius: var(--border-radius-sm);
    margin-top: 10px;
}
.formula-title {
    font-size: 10px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 6px;
    letter-spacing: 0.05em;
}
.formula-content {
    font-family: monospace;
    font-size: 11px;
    color: var(--text-secondary);
    text-align: center;
    word-break: break-all;
}
.formula-result {
    font-weight: 700;
    color: var(--color-primary);
    font-size: 13px;
    border-bottom: 1px solid var(--color-primary);
    padding-bottom: 1px;
}

/* News Item Styles */
.news-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: background-color var(--transition-fast);
}
.news-item:hover {
    background: rgba(255, 255, 255, 0.02);
}
.news-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 10px;
}
.news-time {
    color: var(--text-muted);
    font-family: monospace;
}
.news-badge {
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: 700;
    font-size: 9px;
    font-family: monospace;
}
.news-badge-pos {
    background: rgba(14, 203, 129, 0.15);
    color: var(--color-green);
    border: 1px solid rgba(14, 203, 129, 0.3);
}
.news-badge-neg {
    background: rgba(246, 70, 93, 0.15);
    color: var(--color-red);
    border: 1px solid rgba(246, 70, 93, 0.3);
}
.news-badge-neu {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.15);
}
.news-headline-text {
    font-size: 11px;
    line-height: 1.4;
    color: var(--text-primary);
    font-weight: 500;
    transition: color var(--transition-fast);
}
.news-item a {
    text-decoration: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.news-item a:hover .news-headline-text {
    color: var(--color-primary);
    text-decoration: underline;
}
.news-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 40px 0;
    font-size: 11px;
    width: 100%;
}

/* TOAST NOTIFICATION STYLING */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
}
.toast {
    background: rgba(18, 22, 30, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    padding: 12px 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    min-width: 250px;
    transform: translateX(120%);
    animation: slideIn var(--transition-normal) forwards;
}
@keyframes slideIn {
    to { transform: translateX(0); }
}

.toast-success { border-left: 3px solid var(--color-green); }
.toast-error { border-left: 3px solid var(--color-red); }
.toast-info { border-left: 3px solid var(--color-primary); }

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1100;
    animation: fadeIn var(--transition-fast) forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    width: 90%;
    max-width: 760px;
    padding: 24px;
    border-radius: var(--border-radius-lg);
    animation: scaleUp var(--transition-normal) forwards;
}

@keyframes scaleUp {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
    margin-bottom: 20px;
}
.modal-header h2 {
    font-size: 18px;
    font-family: 'Outfit', sans-serif;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}
.modal-header h2 svg {
    color: var(--color-primary);
    width: 20px;
    height: 20px;
}

.btn-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    transition: color var(--transition-fast);
}
.btn-close:hover {
    color: var(--color-red);
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.report-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 24px;
}

.report-section h3 {
    font-size: 13px;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-weight: 600;
    letter-spacing: 0.05em;
    border-left: 3px solid var(--color-primary);
    padding-left: 8px;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.report-table td {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}
.report-table td:first-child {
    color: var(--text-secondary);
}
.report-table td:last-child {
    text-align: right;
    font-weight: 700;
    font-family: monospace;
}

.report-kpi-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.rep-kpi-item {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.rep-kpi-lbl {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
}
.rep-kpi-val {
    font-size: 16px;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}

.report-diagnosis {
    background: rgba(0, 242, 254, 0.03);
    border: 1px solid rgba(0, 242, 254, 0.1);
    border-radius: var(--border-radius-md);
    padding: 16px;
}
.report-diagnosis h4 {
    font-size: 13px;
    color: var(--color-primary);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    font-weight: 600;
}
.report-diagnosis h4 svg {
    width: 15px;
    height: 15px;
}
.report-diagnosis p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
    margin-top: 20px;
}

/* Color Badges for Parameters */
.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    color: #07090e;
    margin: 0 2px;
    font-family: monospace;
}
.badge-cyan { background-color: var(--color-primary); }
.badge-orange { background-color: var(--color-orange); color: #07090e; }
.badge-purple { background-color: var(--color-purple); color: #fff; }
.badge-green { background-color: var(--color-green); color: #fff; }
.badge-red { background-color: var(--color-red); color: #fff; }

.rep-weights-container, .rep-thresholds-container {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: flex-end;
}

/* Help Trigger Styles */
.help-trigger {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color var(--transition-fast);
}
.help-trigger:hover {
    color: var(--color-primary);
    text-decoration: underline;
}
.help-trigger svg {
    width: 14px;
    height: 14px;
    opacity: 0.6;
    transition: opacity var(--transition-fast), color var(--transition-fast);
}
.help-trigger:hover svg {
    opacity: 1;
    color: var(--color-primary);
}

/* Responsive adjustments */
@media(max-width: 1024px) {
    .terminal-grid {
        grid-template-columns: 1fr;
    }
    .control-panel {
        height: auto;
        position: relative;
        top: 0;
    }
    .bottom-panel-grid {
        grid-template-columns: 1fr;
    }
}

/* Strict Font Size Unification (11px and 14px) */
body, input, select, button, textarea, table, td, th, span, p, li, a, .logo-text span, label, .breakdown-raw, .stat-weight-label {
    font-size: 11px !important;
}
h1, h2, h3, h4, h5, h6, 
.logo-text h1, 
.section-title, 
.card-header h2, 
.chart-title h2, 
.modal-header h2, 
.kpi-value, 
.rep-kpi-val, 
.report-section h3, 
.report-diagnosis h4,
#expTitle {
    font-size: 14px !important;
}
.toast, .toast span {
    font-size: 11px !important;
}

/* Market Type Segmented Control */
.market-toggle-group {
    display: flex;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 2px;
    margin-bottom: 8px;
    width: 100%;
}
.market-toggle-btn {
    flex: 1;
    background: transparent;
    border: none;
    border-radius: 3px;
    color: var(--text-secondary);
    padding: 5px;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    font-family: Inter, sans-serif;
    text-align: center;
    transition: all var(--transition-fast);
}
.market-toggle-btn:hover {
    color: var(--text-primary);
}
.market-toggle-btn.active {
    background: rgba(0, 242, 254, 0.15);
    color: var(--color-primary);
    border: 1px solid rgba(0, 242, 254, 0.25);
}
