/* ==========================================================================
   CHARTS — Plotly chart containers, graph overrides, chart legends,
   DataTable styling, dropdowns, comparison tables, drill-down navigation
   Split from custom.css
   ========================================================================== */

/* Chart container */
.chart-container {
    background: var(--bg-card, #1e1e2e);
    border: 1px solid var(--border-color, #2a2a3a);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.chart-container h3 {
    color: #e2e8f0;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

/* Table styles */
.table {
    color: var(--text-secondary) !important;
}

.table thead th {
    background: var(--bg-secondary) !important;
    color: var(--text-muted) !important;
    border-color: var(--border-color) !important;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.table td {
    border-color: var(--border-color) !important;
    background: var(--bg-card) !important;
}

/* Dark dropdown styling for news filters */
.dash-dropdown-dark .Select-control {
    background-color: #16161f !important;
    border-color: #2a2a3a !important;
}
.dash-dropdown-dark .Select-menu-outer {
    background-color: #16161f !important;
    border-color: #2a2a3a !important;
}
.dash-dropdown-dark .Select-option {
    background-color: #16161f !important;
    color: #e2e8f0 !important;
}
.dash-dropdown-dark .Select-option:hover {
    background-color: #2a2a3a !important;
}
.dash-dropdown-dark .Select-value-label {
    color: #e2e8f0 !important;
}
.dash-dropdown-dark .Select-placeholder {
    color: #64748b !important;
}

/* DataTable styling */
.dash-table-container {
    border-radius: 8px;
    overflow: hidden;
}

.dash-spreadsheet-container .dash-spreadsheet-inner th {
    background: #1e1e2e !important;
    color: #e2e8f0 !important;
    border-color: #2a2a3a !important;
}

.dash-spreadsheet-container .dash-spreadsheet-inner td {
    background: #16161e !important;
    color: #e2e8f0 !important;
    border-color: #2a2a3a !important;
}

.dash-spreadsheet-container .dash-spreadsheet-inner tr:nth-child(odd) td {
    background: #1a1a28 !important;
}

.dash-filter--case {
    color: #e2e8f0 !important;
}

/* DataTable filter row -- Dash 4.0 compatible */
/* Force filter row to display horizontally (fixes vertical stacking) */
.dash-spreadsheet .dash-filter {
    display: table-row !important;
    visibility: visible !important;
}

/* Filter cells -- use flex layout so Aa toggle + input sit side by side */
.dash-spreadsheet .dash-filter > th,
.dash-spreadsheet .dash-filter > td,
.dash-spreadsheet .dash-filter .dash-cell {
    display: flex !important;
    align-items: center !important;
    gap: 2px !important;
    background-color: #252532 !important;
    padding: 4px 6px !important;
    border-bottom: 1px solid #3b3b4f !important;
}

/* Filter text input -- takes remaining space (exclude Aa toggle via :not) */
.dash-spreadsheet .dash-filter input:not([class*="dash-filter--case"]),
.dash-filter input:not([class*="dash-filter--case"]) {
    flex: 1 1 auto !important;
    width: auto !important;
    min-width: 40px !important;
    min-height: 26px !important;
    box-sizing: border-box !important;
    background-color: #1e1e2e !important;
    color: #e2e8f0 !important;
    border: 1px solid #3b3b4f !important;
    border-radius: 4px !important;
    padding: 3px 6px !important;
    font-size: 0.8rem !important;
    font-family: inherit !important;
}

/* Case-sensitivity toggle (Aa button) -- inactive (case-insensitive) state */
input[class*="dash-filter--case"] {
    flex: 0 0 26px !important;
    width: 26px !important;
    min-width: 26px !important;
    max-width: 26px !important;
    height: 26px !important;
    min-height: 26px !important;
    max-height: 26px !important;
    padding: 0 !important;
    font-size: 0.65rem !important;
    line-height: 26px !important;
    text-align: center !important;
    border: 1px solid #475569 !important;
    border-radius: 2px !important;
    background-color: #1e1e2e !important;
    color: #94a3b8 !important;
    cursor: pointer !important;
    margin: 0 !important;
    display: block !important;
    order: 1 !important;
}

/* Active (case-sensitive) state -- highlighted to show it is ON */
input.dash-filter--case--sensitive {
    border-color: #3b82f6 !important;
    background-color: rgba(59, 130, 246, 0.3) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.5) !important;
}

input[class*="dash-filter--case"]:hover {
    border-color: #60a5fa !important;
    background-color: rgba(96, 165, 250, 0.15) !important;
    color: #e2e8f0 !important;
}

.dash-spreadsheet .dash-filter input::placeholder,
.dash-filter input::placeholder {
    color: #94a3b8 !important;
    font-style: italic !important;
    opacity: 1 !important;
}

.dash-spreadsheet .dash-filter input:focus,
.dash-filter input:focus {
    border-color: #60a5fa !important;
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.2) !important;
}

/* Prevent Bootstrap from overriding DataTable layout */
.dash-spreadsheet-container table {
    table-layout: fixed !important;
}

.dash-spreadsheet-container .dash-spreadsheet-inner tr {
    display: table-row !important;
}

.dash-spreadsheet-container .dash-spreadsheet-inner td,
.dash-spreadsheet-container .dash-spreadsheet-inner th {
    display: table-cell !important;
}

/* Sortable header -- sort icon spacing */
.dash-header.sortable {
    cursor: pointer;
}

.dash-header.sortable:hover {
    background-color: rgba(96, 165, 250, 0.1) !important;
}

/* Add gap between sort arrows and header text */
.dash-spreadsheet .dash-header .sort,
.dash-spreadsheet .column-header--sort,
.dash-header .column-header-sort-icon,
.dash-spreadsheet-inner .dash-header span[class*="sort"] {
    margin-right: 6px !important;
}

/* Also handle sort icon after text */
.dash-spreadsheet .dash-header .sort-icon,
.dash-spreadsheet .dash-header svg {
    margin-left: 6px !important;
}

/* Active sorted column -- highlight header and color the sort arrow */
.dash-header.sort--asc,
.dash-header.sort--desc {
    background-color: rgba(96, 165, 250, 0.08) !important;
}

.dash-header.sort--asc .column-header--sort,
.dash-header.sort--desc .column-header--sort,
.dash-header.sort--asc svg,
.dash-header.sort--desc svg,
.dash-header.sort--asc span[class*="sort"],
.dash-header.sort--desc span[class*="sort"] {
    color: #60a5fa !important;
    fill: #60a5fa !important;
}

/* Light mode sorted column */
body.theme-light .dash-header.sort--asc,
body.theme-light .dash-header.sort--desc,
body:not(.dark-mode) .dash-header.sort--asc,
body:not(.dark-mode) .dash-header.sort--desc {
    background-color: rgba(37, 99, 235, 0.08) !important;
}

body.theme-light .dash-header.sort--asc .column-header--sort,
body.theme-light .dash-header.sort--desc .column-header--sort,
body.theme-light .dash-header.sort--asc svg,
body.theme-light .dash-header.sort--desc svg,
body:not(.dark-mode) .dash-header.sort--asc svg,
body:not(.dark-mode) .dash-header.sort--desc svg {
    color: #1d4ed8 !important;
    fill: #1d4ed8 !important;
}

/* Strategy comparison table */
.comparison-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.comparison-table th,
.comparison-table td {
    padding: 0.875rem 1rem;
    text-align: right;
    border-bottom: 1px solid #2a2a3a;
}

.comparison-table th:first-child,
.comparison-table td:first-child {
    text-align: left;
    position: sticky;
    left: 0;
    background: var(--bg-card);
    z-index: 1;
}

.comparison-table th {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.comparison-table tr:hover {
    background: rgba(59, 130, 246, 0.05);
}

.comparison-table .best-value {
    color: #22c55e;
    font-weight: 600;
}

.comparison-table .strategy-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.strategy-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

/* ============================================
   DRILL-DOWN CHART NAVIGATION
   ============================================ */
.clickable-chart {
    cursor: pointer;
}

.clickable-chart .js-plotly-plot:hover {
    opacity: 0.95;
}

.drill-down-hint {
    font-size: 0.7rem;
    color: #64748b;
    text-align: center;
    margin-top: 0.5rem;
    opacity: 0.7;
}

.drill-down-hint::before {
    content: '\1F446 ';
}

/* ============================================
   DARK MODE DROPDOWN -- COMPREHENSIVE OVERRIDES
   Applies globally to all dcc.Dropdown components
   ============================================ */

/* Dropdown control (the visible box) */
.Select-control {
    background-color: #1e1e2e !important;
    border: 1px solid #3b3b4f !important;
    border-radius: 6px !important;
    color: #e2e8f0 !important;
    min-height: 36px !important;
}

.Select-control:hover {
    border-color: #60a5fa !important;
    box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.25) !important;
}

.Select.is-open > .Select-control {
    border-color: #60a5fa !important;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    background-color: #1e1e2e !important;
}

/* Single-select: the currently selected value label */
.Select-value-label {
    color: #e2e8f0 !important;
}

/* Single-select value container */
.Select--single > .Select-control .Select-value {
    color: #e2e8f0 !important;
    line-height: 34px !important;
}

/* Placeholder text */
.Select-placeholder,
.Select--single > .Select-control .Select-placeholder {
    color: #64748b !important;
    line-height: 34px !important;
}

/* Arrow indicator */
.Select-arrow-zone {
    color: #64748b !important;
}

.Select-arrow {
    border-color: #64748b transparent transparent !important;
}

.Select.is-open .Select-arrow {
    border-color: transparent transparent #60a5fa !important;
}

/* Search input inside the dropdown control */
.Select-input > input {
    background-color: transparent !important;
    color: #e2e8f0 !important;
    caret-color: #e2e8f0 !important;
    padding: 0 !important;
    font-family: inherit !important;
}

/* Multi-select: tag for each selected item */
.Select-multi-value-wrapper .Select-value {
    background-color: rgba(59, 130, 246, 0.2) !important;
    border: 1px solid rgba(59, 130, 246, 0.4) !important;
    color: #93c5fd !important;
    border-radius: 4px !important;
}

.Select-multi-value-wrapper .Select-value-label {
    color: #93c5fd !important;
}

.Select-multi-value-wrapper .Select-value-icon {
    border-right: 1px solid rgba(59, 130, 246, 0.4) !important;
    color: #93c5fd !important;
    padding: 1px 5px !important;
}

.Select-multi-value-wrapper .Select-value-icon:hover {
    background-color: rgba(239, 68, 68, 0.2) !important;
    color: #f87171 !important;
}

/* Dropdown menu (the open list) */
.Select-menu-outer {
    background-color: #252532 !important;
    border: 1px solid #3b3b4f !important;
    border-top: none !important;
    border-bottom-left-radius: 6px !important;
    border-bottom-right-radius: 6px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5) !important;
    z-index: 9999 !important;
}

.Select-menu {
    background-color: #252532 !important;
    max-height: 260px !important;
}

/* Individual option in the dropdown list */
.Select-option {
    background-color: #252532 !important;
    color: #cbd5e1 !important;
    padding: 8px 12px !important;
    font-size: 0.875rem !important;
    cursor: pointer !important;
    transition: background-color 0.1s ease !important;
}

/* Hovered option */
.Select-option.is-focused {
    background-color: rgba(59, 130, 246, 0.2) !important;
    color: #e2e8f0 !important;
}

/* Currently selected option (shown in open list) */
.Select-option.is-selected {
    background-color: rgba(59, 130, 246, 0.35) !important;
    color: #93c5fd !important;
    font-weight: 500 !important;
}

/* Hovered AND selected */
.Select-option.is-selected.is-focused {
    background-color: rgba(59, 130, 246, 0.45) !important;
    color: #bfdbfe !important;
}

/* Disabled option */
.Select-option.is-disabled {
    color: #475569 !important;
    cursor: not-allowed !important;
}

/* "No results found" text */
.Select-noresults {
    background-color: #252532 !important;
    color: #64748b !important;
    padding: 8px 12px !important;
}

/* Clear button */
.Select-clear-zone {
    color: #64748b !important;
}

.Select-clear-zone:hover {
    color: #f87171 !important;
}

/* Existing .dash-dropdown-dark helper class -- extend with missing states */
.dash-dropdown-dark .Select-value-label {
    color: #e2e8f0 !important;
}

.dash-dropdown-dark .Select--single > .Select-control .Select-value {
    color: #e2e8f0 !important;
}

.dash-dropdown-dark .Select-option.is-focused {
    background-color: rgba(59, 130, 246, 0.2) !important;
    color: #e2e8f0 !important;
}

.dash-dropdown-dark .Select-option.is-selected {
    background-color: rgba(59, 130, 246, 0.35) !important;
    color: #93c5fd !important;
    font-weight: 500 !important;
}

.dash-dropdown-dark .Select-input > input {
    background-color: transparent !important;
    color: #e2e8f0 !important;
}

.dash-dropdown-dark .Select-noresults {
    background-color: #16161f !important;
    color: #64748b !important;
}

/* ============================================
   DROPDOWN LEGIBILITY -- UNIVERSAL HIGH-SPECIFICITY OVERRIDES
   ============================================ */

body .Select-value-label,
body .Select--single > .Select-control .Select-value,
body .Select--single > .Select-control .Select-value .Select-value-label {
    color: #e2e8f0 !important;
}

.dash-dropdown-dark .Select--single > .Select-control .Select-value {
    color: #e2e8f0 !important;
    line-height: 34px !important;
}

.dash-dropdown-dark .Select--single > .Select-control .Select-value .Select-value-label {
    color: #e2e8f0 !important;
}

/* Circuit analysis page -- explicit overrides by component ID */
#circuit-target-ticker .Select-value-label,
#circuit-target-ticker .Select--single > .Select-control .Select-value,
#circuit-layer .Select-value-label,
#circuit-layer .Select--single > .Select-control .Select-value,
#patch-source-ticker .Select-value-label,
#patch-source-ticker .Select--single > .Select-control .Select-value,
#patch-target-ticker .Select-value-label,
#patch-target-ticker .Select--single > .Select-control .Select-value,
#patch-corruption-type .Select-value-label,
#patch-corruption-type .Select--single > .Select-control .Select-value {
    color: #e2e8f0 !important;
}

/* Catch any dropdown inside a dbc.Card or dbc.Col */
.card .Select-value-label,
.card .Select--single > .Select-control .Select-value,
.card-body .Select-value-label,
.card-body .Select--single > .Select-control .Select-value {
    color: #e2e8f0 !important;
}

body .Select--single > .Select-control .Select-value {
    color: #e2e8f0 !important;
}

body .Select-multi-value-wrapper .Select-value .Select-value-label {
    color: #93c5fd !important;
}

.modal .Select-value-label,
.modal .Select--single > .Select-control .Select-value,
.sidebar .Select-value-label,
.sidebar .Select--single > .Select-control .Select-value {
    color: #e2e8f0 !important;
}

/* ============================================
   DASH 4.0 DROPDOWN -- NEW CLASS NAMES
   ============================================ */

.dash-dropdown {
    font-family: inherit !important;
}

.dash-dropdown .dash-dropdown-trigger {
    background-color: #1e1e2e !important;
    border: 1px solid #3b3b4f !important;
    border-radius: 6px !important;
    min-height: 36px !important;
    cursor: pointer !important;
}

.dash-dropdown .dash-dropdown-trigger:hover {
    border-color: #60a5fa !important;
}

.dash-dropdown .dash-dropdown-value {
    color: #e2e8f0 !important;
    font-size: 0.875rem !important;
}

.dash-dropdown .dash-dropdown-value-item {
    background-color: rgba(59, 130, 246, 0.2) !important;
    color: #93c5fd !important;
    border: 1px solid rgba(59, 130, 246, 0.3) !important;
    border-radius: 4px !important;
}

.dash-dropdown .dash-dropdown-value.dash-dropdown-placeholder,
.dash-dropdown .dash-dropdown-placeholder {
    color: #64748b !important;
}

.dash-dropdown .dash-dropdown-trigger-icon {
    color: #64748b !important;
}

.dash-dropdown .dash-dropdown-trigger-icon:hover {
    color: #e2e8f0 !important;
}

.dash-dropdown .dash-dropdown-search {
    background-color: transparent !important;
    color: #e2e8f0 !important;
    caret-color: #60a5fa !important;
    border: none !important;
}

.dash-dropdown .dash-dropdown-search-icon {
    color: #64748b !important;
}

.dash-dropdown .dash-dropdown-content {
    background-color: #252532 !important;
    border: 1px solid #3b3b4f !important;
    border-top: none !important;
    border-radius: 0 0 6px 6px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4) !important;
    z-index: 9999 !important;
}

.dash-dropdown .dash-dropdown-options {
    background-color: #252532 !important;
}

.dash-dropdown .dash-dropdown-option {
    background-color: #252532 !important;
    color: #cbd5e1 !important;
    padding: 8px 12px !important;
    cursor: pointer !important;
    transition: background-color 0.15s !important;
}

.dash-dropdown .dash-dropdown-option:hover,
.dash-dropdown .dash-dropdown-option[data-focused="true"] {
    background-color: rgba(59, 130, 246, 0.2) !important;
    color: #e2e8f0 !important;
}

.dash-dropdown .dash-dropdown-option[data-selected="true"] {
    background-color: rgba(59, 130, 246, 0.35) !important;
    color: #93c5fd !important;
    font-weight: 600 !important;
}

.dash-dropdown .dash-dropdown-option[data-selected="true"]:hover {
    background-color: rgba(59, 130, 246, 0.45) !important;
}

.dash-dropdown .dash-dropdown-clear {
    color: #64748b !important;
}

.dash-dropdown .dash-dropdown-clear:hover {
    color: #ef4444 !important;
}

.dash-dropdown .dash-dropdown-value-count {
    background-color: rgba(59, 130, 246, 0.25) !important;
    color: #93c5fd !important;
    border-radius: 4px !important;
}

.dash-dropdown .dash-dropdown-actions {
    background-color: #1e1e2e !important;
    border-top: 1px solid #3b3b4f !important;
}

.dash-dropdown .dash-dropdown-action-button {
    color: #60a5fa !important;
}

.dash-dropdown .dash-dropdown-action-button:hover {
    background-color: rgba(59, 130, 246, 0.15) !important;
}

.dash-dropdown .dash-dropdown-grid-container {
    background-color: #1e1e2e !important;
}

/* Dark class variant -- same rules with higher specificity */
.dash-dropdown-dark.dash-dropdown .dash-dropdown-trigger {
    background-color: #16161f !important;
    border-color: #2a2a3a !important;
}

.dash-dropdown-dark.dash-dropdown .dash-dropdown-value {
    color: #e2e8f0 !important;
}

.dash-dropdown-dark.dash-dropdown .dash-dropdown-content {
    background-color: #16161f !important;
}

.dash-dropdown-dark.dash-dropdown .dash-dropdown-option {
    background-color: #16161f !important;
    color: #e2e8f0 !important;
}

.dash-dropdown-dark.dash-dropdown .dash-dropdown-option:hover {
    background-color: #2a2a3a !important;
}

/* --- Plotly chart containers (light mode) --- */
body.theme-light .main-content .js-plotly-plot .bg {
    fill: #f8fafc !important;
}
body.theme-light .main-content .js-plotly-plot .gridlayer line {
    stroke: #e2e8f0 !important;
}
body.theme-light .main-content .js-plotly-plot .zerolinelayer line {
    stroke: #cbd5e1 !important;
}
body.theme-light .main-content .js-plotly-plot text {
    fill: #334155 !important;
}
body.theme-light .main-content .js-plotly-plot .legendtext {
    fill: #334155 !important;
}
body.theme-light .main-content .js-plotly-plot .xtick text,
body.theme-light .main-content .js-plotly-plot .ytick text {
    fill: #475569 !important;
}
body.theme-light .main-content .js-plotly-plot .gtitle {
    fill: #0f172a !important;
}

/* --- Dash DataTable & misc components (light mode) --- */
body.theme-light .main-content .dash-table-container {
    color: #0f172a !important;
}
body.theme-light .main-content .dash-cell {
    background-color: #ffffff !important;
    color: #0f172a !important;
}
body.theme-light .main-content .dash-header {
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
}

/* Light mode DataTable */
body.theme-light .dash-spreadsheet-container .dash-spreadsheet-inner td,
body.theme-light .dash-spreadsheet-container .dash-spreadsheet-inner th {
    background-color: #f8fafc !important;
    color: #0f172a !important;
    border-color: #b0bec5 !important;
}

body.theme-light .dash-spreadsheet-container .dash-spreadsheet-inner th {
    background-color: #e2e8f0 !important;
}

body.theme-light .dash-filter input,
body.theme-light .dash-spreadsheet .dash-filter input:not([class*="dash-filter--case"]),
body.theme-light .dash-filter input:not([class*="dash-filter--case"]) {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid #b0bec5 !important;
}
body.theme-light input[class*="dash-filter--case"] {
    background-color: #e2e8f0 !important;
    color: #475569 !important;
    border: 1px solid #b0bec5 !important;
}
body.theme-light input.dash-filter--case--sensitive {
    border-color: #3b82f6 !important;
    background-color: rgba(59,130,246,0.1) !important;
    color: #2563eb !important;
}

/* 9. DataTable filter rows light mode */
body.theme-light .dash-spreadsheet .dash-filter > th,
body.theme-light .dash-spreadsheet .dash-filter > td,
body.theme-light .dash-spreadsheet .dash-filter .dash-cell {
    background-color: #e8edf3 !important;
    border-bottom: 1px solid #b0bec5 !important;
}

/* 10. Filter input case toggle (Aa button) light mode */
body.theme-light input[class*="dash-filter--case"] {
    background-color: #ffffff !important;
    color: #475569 !important;
    border-color: #b0bec5 !important;
}

/* --- Dash 4.0 dropdown light mode --- */
body.theme-light .dash-dropdown .dash-dropdown-trigger:hover {
    border-color: #3b82f6 !important;
}
body.theme-light .dash-dropdown .dash-dropdown-option[data-selected="true"] {
    background-color: rgba(59, 130, 246, 0.1) !important;
    color: #1d4ed8 !important;
}
body.theme-light .dash-dropdown .dash-dropdown-search {
    color: #0f172a !important;
}
body.theme-light .dash-dropdown .dash-dropdown-value-item {
    background-color: rgba(59, 130, 246, 0.1) !important;
    color: #1d4ed8 !important;
}

/* Light mode - dropdowns */
body.theme-light .dash-dropdown .dash-dropdown-trigger {
    background-color: #ffffff !important;
    border-color: #b0bec5 !important;
}
body.theme-light .dash-dropdown .dash-dropdown-value {
    color: #0f172a !important;
}
body.theme-light .dash-dropdown .dash-dropdown-content {
    background-color: #ffffff !important;
    border-color: #b0bec5 !important;
}
body.theme-light .dash-dropdown .dash-dropdown-option {
    color: #0f172a !important;
}
body.theme-light .dash-dropdown .dash-dropdown-option:hover {
    background-color: #f1f5f9 !important;
}

/* 21. React-Select v1 dropdowns in light mode */
body.theme-light .Select-control {
    background-color: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

body.theme-light .Select-control:hover {
    border-color: #3b82f6 !important;
}

body.theme-light .Select-menu-outer,
body.theme-light .Select-menu {
    background-color: #ffffff !important;
    border-color: #cbd5e1 !important;
}

body.theme-light .Select-option {
    background-color: #ffffff !important;
    color: #0f172a !important;
}

body.theme-light .Select-option.is-focused {
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
}

body.theme-light .Select-option.is-selected {
    background-color: rgba(59, 130, 246, 0.1) !important;
    color: #1d4ed8 !important;
}

body.theme-light .Select-value-label {
    color: #0f172a !important;
}

body.theme-light .Select--single > .Select-control .Select-value {
    color: #0f172a !important;
}

body.theme-light .Select--single > .Select-control .Select-value .Select-value-label {
    color: #0f172a !important;
}

body.theme-light .Select-noresults {
    background-color: #ffffff !important;
    color: #64748b !important;
}

/* 22. Comparison table borders light mode */
body.theme-light .comparison-table th,
body.theme-light .comparison-table td {
    border-color: #cbd5e1 !important;
}

/* ============================================================
   PLOTLY LIGHT-MODE OVERRIDES
   These CSS rules override the plotly_dark template's white/light
   text and element colors so they are readable on a white background.
   ============================================================ */

/* All SVG text: axis tick labels, titles, legends */
body.theme-light .js-plotly-plot text {
    fill: #334155 !important;
}

/* Axis lines and tick marks */
body.theme-light .js-plotly-plot .xlines-above path,
body.theme-light .js-plotly-plot .xlines-below path,
body.theme-light .js-plotly-plot .ylines-above path,
body.theme-light .js-plotly-plot .ylines-below path,
body.theme-light .js-plotly-plot .xtick > line,
body.theme-light .js-plotly-plot .ytick > line {
    stroke: rgba(0,0,0,0.2) !important;
}

/* Grid lines */
body.theme-light .js-plotly-plot .gridlayer path {
    stroke: rgba(0,0,0,0.07) !important;
}

/* Zero lines */
body.theme-light .js-plotly-plot .zerolinelayer path {
    stroke: rgba(0,0,0,0.15) !important;
}

/* Chart plot area and paper background */
body.theme-light .js-plotly-plot .bg {
    fill: rgba(248, 250, 252, 0.95) !important;
}
body.theme-light .js-plotly-plot .paper-bgcolor {
    fill: rgba(255, 255, 255, 0.95) !important;
}

/* Legend background */
body.theme-light .js-plotly-plot .legend .bg {
    fill: rgba(255, 255, 255, 0.9) !important;
    stroke: rgba(0,0,0,0.1) !important;
}

/* Colorbar text */
body.theme-light .js-plotly-plot .colorbar text {
    fill: #334155 !important;
}

/* Hover labels */
body.theme-light .js-plotly-plot .hoverlayer .hovertext rect {
    fill: rgba(255,255,255,0.95) !important;
    stroke: rgba(0,0,0,0.15) !important;
}
body.theme-light .js-plotly-plot .hoverlayer .hovertext text {
    fill: #1e293b !important;
}
