/* ═══════════════════════════════════════════════════════
   Overview Dashboard Styles
   ═══════════════════════════════════════════════════════ */

   :root {
    --ov-page-bg: #050910;
    --ov-blue: #7283B1;
    --ov-red: #DC322F;
    --ov-bg: #060b14;
    --ov-card: #0d1525;
    --ov-border: #1e2a3d;
    --ov-text: #e8f1f5;
    --ov-text-muted: #94a3b8;
    --ov-text-dim: #64748b;
    --ov-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --ov-font-mono: 'JetBrains Mono', monospace;
}

body {
    background-color: var(--ov-bg);
    font-family: var(--ov-font);
    color: var(--ov-text);
}

/* ── Header ── */
.ov-head {
    background: linear-gradient(135deg, #141c2b 0%, #0f1520 100%);
    border-bottom: 1px solid var(--ov-border);
}

.ov-head .main-bar {
    padding: 10px 16px;
}

.ov-header-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.mi-header-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 6px;
    background: var(--ov-blue);
    flex-shrink: 0;
}

.ov-nav-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255,255,255,0.06);
    border-radius: 8px;
    padding: 3px;
}

.ov-nav-btn {
    font-family: var(--ov-font);
    font-size: 13px;
    font-weight: 500;
    padding: 5px 14px;
    border-radius: 6px;
    color: var(--ov-text-muted);
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    background: transparent;
    white-space: nowrap;
}

.ov-nav-btn:hover {
    color: var(--ov-text);
    background: rgba(255,255,255,0.08);
    text-decoration: none;
}

.ov-nav-btn.active {
    background: var(--ov-blue);
    color: #060b14;
    font-weight: 700;
    cursor: default;
}

.ov-clock {
    margin-left: auto;
    font-family: var(--ov-font-mono);
    font-size: 13px;
    color: var(--ov-text-muted);
    white-space: nowrap;
}

/* ── Container ── */
.overview-container {
    width: 100%;
    max-width: none;
    margin: 0;
    box-sizing: border-box;
    min-width: 0;
    padding: 10px clamp(12px, 2.5vw, 15px) 20px;
}

/* ── Risk Section ── */
.ov-risk-section {
    background: var(--ov-card);
    border: 1px solid var(--ov-border);
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 12px;
}

.ov-risk-header {
    margin-bottom: 12px;
}

.ov-risk-status {
    font-family: var(--ov-font);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    padding-bottom: 6px;
    display: inline-block;
    border-bottom: 2px solid;
}

.ov-risk-status.risk-on {
    color: #22c55e;
    border-color: #22c55e;
}

.ov-risk-status.risk-off {
    color: var(--ov-red);
    border-color: var(--ov-red);
}

/* ── Sectors Grid ── */
.ov-sectors-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.ov-sector-column {
    flex: 1 1 calc(50% - 6px);
    min-width: 300px;
}

.ov-sector-heading {
    font-family: var(--ov-font);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 2px solid currentColor;
}

/* ── Instrument Cards ── */
.ov-instrument-cards-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.ov-instrument-card {
    flex: 1 1 calc(50% - 4px);
    min-width: 160px;
    background: var(--ov-bg);
    border: 1px solid var(--ov-border);
    border-radius: 6px;
    border-top: 3px solid var(--ov-blue);
    padding: 10px 12px;
}

.ov-card-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
}

.ov-card-symbol {
    font-family: var(--ov-font);
    font-size: 14px;
    font-weight: 700;
    color: var(--ov-text);
}

.ov-card-name {
    font-family: var(--ov-font);
    font-size: 11px;
    color: var(--ov-text-muted);
}

/* ── Gauges ── */
.ov-card-gauges {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 6px;
}

.ov-gauge {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 80px;
}

.ov-gauge-svg {
    width: 100%;
    height: auto;
}

.ov-gauge-label {
    font-size: 9px;
    color: var(--ov-text-muted);
    text-align: center;
    margin-top: 1px;
    font-weight: 500;
}

/* ── Mini Timeline ── */
.ov-card-timeline {
    padding-top: 4px;
}

.ov-tl-track {
    position: relative;
    height: 8px;
    background: rgba(30,42,61,0.6);
    border-radius: 4px;
    overflow: visible;
}

.ov-tl-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, rgba(34,211,238,0.15), rgba(34,211,238,0.05));
    border-radius: 4px 0 0 4px;
}

.ov-tl-now {
    position: absolute;
    top: -2px;
    width: 4px;
    height: 12px;
    background: #22d3ee;
    border-radius: 2px;
    transform: translateX(-50%);
    z-index: 5;
}

.ov-tl-dot {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #f59e0b;
    border: 1.5px solid var(--ov-bg);
    z-index: 3;
}

.ov-tl-labels {
    position: relative;
    height: 14px;
    margin-top: 2px;
}

.ov-tl-label {
    position: absolute;
    transform: translateX(-50%);
    font-size: 7px;
    color: var(--ov-text-dim);
    white-space: nowrap;
}

.ov-tl-hours {
    position: relative;
    height: 12px;
    margin-top: 1px;
}

.ov-tl-hour {
    position: absolute;
    transform: translateX(-50%);
    font-size: 8px;
    color: var(--ov-text-dim);
    font-family: var(--ov-font-mono);
}

/* ── Geopolitical Risk Section ── */
.ov-geo-risk-section {
    padding: 12px 16px;
}

.ov-geo-heading {
    margin-bottom: 10px;
}

.ov-geo-heading span {
    font-family: var(--ov-font);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--ov-red);
    padding-bottom: 4px;
    border-bottom: 2px solid var(--ov-red);
    display: inline-block;
}

.ov-geo-bar-row {
    margin-bottom: 8px;
}
.ov-geo-bar-row:last-child { margin-bottom: 0; }

.ov-geo-labels {
    display: flex;
    gap: 6px;
    margin-bottom: 3px;
    flex-wrap: wrap;
}

.ov-geo-driver {
    font-size: 10px;
    font-weight: 500;
    color: var(--ov-text);
    background: rgba(30,42,61,0.8);
    padding: 2px 8px;
    border-radius: 3px;
    border: 1px solid var(--ov-border);
}

.ov-geo-bar {
    height: 6px;
    background: rgba(30,42,61,0.6);
    border-radius: 3px;
    overflow: hidden;
}

.ov-geo-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s ease;
}

/* ── Responsive ── */
@media (max-width: 2100px) {
    .overview-container {
        padding: 8px clamp(10px, 4vw, 16px);
    }
}

/* Dashboard shell (reference layout â€” gauges/timeline/geo markup unchanged) */
:root {
    --ov-page-bg: #050910;
    --ov-panel-bg: rgba(12, 18, 30, 0.65);
    --ov-card-surface: #0f1624;
}

body {
    background-color: var(--ov-page-bg);
}


.overview-page-clock {
    margin-left: auto;
    font-family: var(--ov-font-mono);
    font-size: 13px;
    color: #94a3b8;
    white-space: nowrap;
}

/* RISK ON/OFF: same section shell as Market Prep Overnight Summary */
.overview-risk-overview-row {
    margin-bottom: 14px;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.overview-risk-overview-row + .overview-risk-overview-row {
    margin-top: 22px;
}

.overview-risk-overview-row > .top-section-column {
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    border-top: 3px solid #22c55e !important;
}

.overview-risk-overview-row.overview-risk-is-off > .top-section-column {
    border-top-color: #3B82F6 !important;
}

.overview-risk-on-title {
    color: #22c55e !important;
}

.overview-risk-off-title {
    color: #3B82F6 !important;
}

.overview-risk-section-body.overnight-market-action-content {
    color: var(--ov-text);
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}
.overview-risk-section-body > .overview-geo-panel {
    margin-top: 22px;
}

/* ── Flat instrument cards grid ── */
.overview-sector-cards {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 5px;
    align-items: stretch;
}

/* ── Geo risk panel (only panel that still uses sector-panel style) ── */
.overview-geo-panel {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    --overview-sector-accent: #EF4444;
    border-top: 3px solid var(--overview-sector-accent);
    background: var(--ov-panel-bg);
    border-left: 1px solid var(--ov-border);
    border-right: 1px solid var(--ov-border);
    border-bottom: 1px solid var(--ov-border);
    border-radius: 0 0 6px 6px;
    padding: 5px;
    margin-top: 12px;
}

.overview-sector-header {
    margin: 0 0 14px 0;
    padding: 0;
    font-family: var(--ov-font);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.16em;
    color: var(--overview-sector-accent);
    text-transform: uppercase;
}

.overview-instrument-card {
    min-width: 0;
    width: 100%;
    height: 100%;
    background: var(--ov-card-surface);
    border: 1px solid var(--ov-border);
    border-radius: 4px;
    padding: 5px;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
}

.overview-instrument-card .ov-card-header {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-bottom: 8px;
    flex-wrap: nowrap;
    min-width: 0;
}

.overview-instrument-card .ov-card-sector {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    flex-shrink: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.overview-instrument-card .ov-card-pipe {
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
}

.overview-instrument-card .ov-card-symbol {
    font-size: 13px;
    font-weight: 100;
    color: var(--ov-text);
    letter-spacing: 0.02em;
    flex-shrink: 0;
}

.overview-instrument-card .ov-card-name {
    font-size: 11px;
    font-weight: 500;
    color: var(--ov-text-muted);
    text-align: right;
    margin-left: auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.overview-geo-inner {
    padding-top: 2px;
}

.overview-geo-panel .geo-risk-bars-container {
    margin-top: 0;
}

.overview-card-gauges {
    margin: 6px 0 6px;
}

.overview-card-gauges .sentiment-gauges-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0px;
    height: auto;
    border-bottom: none;
    padding: 0px;
}

.overview-card-gauges .sentiment-gauge {
    width: 170px;
    flex-shrink: 1;
    min-width: 70px;
}

.overview-card-gauges .gauge-svg {
    max-width: 180px;
    width: 100%;
    height: auto;
}

.overview-card-sparkline {
    margin: 4px 0 6px;
    min-height: 165px;
    flex-shrink: 0;
}

.overview-card-timeline {
    margin-top: 6px;
    min-height: 140px;
    flex-shrink: 0;
}

.overview-card-timeline .risk-timeline-container {
    max-width: 100%;
}

.overview-card-timeline .tl-label {
    font-size: 7px !important;
}

.overview-card-timeline .tl-dot {
    width: 8px !important;
    height: 8px !important;
}

/* Cluster main dot keeps its own size in overview */
.overview-card-timeline .tl-dot.tl-cluster-main {
    width: 10px !important;
    height: 10px !important;
}

/* Cluster expand panel must escape card overflow */
.overview-card-timeline {
    overflow: visible;
    position: relative;
}

.overview-card-timeline .tl-cluster-expand {
    z-index: 50;
    background: #0d1525;
    border: 1px solid #1e3a5f;
    border-radius: 4px;
    padding: 6px 8px;
}

.overview-card-timeline .tl-cluster-fan-dot {
    width: 8px;
    height: 8px;
}

.overview-card-timeline .tl-cluster-badge {
    min-width: 10px;
    height: 10px;
    font-size: 7px;
    top: -3px;
    right: -4px;
}

/* Card must allow expand to overflow */
.overview-instrument-card {
    overflow: visible;
}

/* Expanded cluster card gets highest z-index so panel shows above other cards.
 * Originally used :has(.tl-cluster-expanded). The JS in MarketAnalysisRenderer.js
 * (cluster click handler) now mirrors the expanded state up to the outer card
 * via the .overview-instrument-card--cluster-expanded class, so this rule
 * works in Chromium < 105 / CefSharp 84.
 */
.overview-instrument-card.overview-instrument-card--cluster-expanded {
    z-index: 20;
}

/* In-card Geo Risk (pushed to bottom for equal-height cards) */
.overview-card-geo {
    padding-top: 2px;
    overflow: visible;
    position: relative;
    margin-top: auto;
    flex-shrink: 0;
}

.overview-card-geo .geo-risk-bars-container {
    padding: 0px;
    height: auto;
    border-bottom: 0px;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: start;
    overflow: visible;
}

.ov-card-geo-label {
    font-family: var(--ov-font);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #e8f1f5;
    margin-bottom: 10px;
}

/* ── Responsive: 4 → 3 → 2 → 1 columns ── */
@media (max-width: 2550px) {
    .overview-sector-cards {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

@media (max-width: 2150px) {
    .overview-sector-cards {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 1730px) {
    .overview-sector-cards {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1380px) {
    .overview-sector-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


@media (max-width: 1020px) {
    .overview-sector-cards {
        grid-template-columns: 1fr;
    }
}


/* ── No Data placeholder ── */
.ov-no-data {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 16px 8px;
    color: #64748b;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.5px;
    flex: 1;
}