:root {
    --pro-navy: #0000A0;
    --pro-orange: #FF6400;
    --pro-bg: #FFFFFF;
    --pro-text: #1E293B;
    --pro-subtext: #64748B;
    --pro-border: #E2E8F0;
    --pro-glass: rgba(248, 250, 252, 0.85);
}

/* Page header */
.page-header h1 {
    font-size: 22px;
    font-weight: 600;
}
.page-header p {
    font-size: 13px;
    color: var(--pro-subtext);
}

/* Control bar */
.control-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    background: var(--pro-glass);
    border: 1px solid var(--pro-border);
    border-radius: 14px;
}
.control-group {
    display: flex;
    gap: 10px;
}
.control-bar select {
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid var(--pro-border);
}
.control-separator {
    width: 1px;
    height: 28px;
    background: var(--pro-border);
}

/* Context */
.context-strip {
    font-size: 11px;
    color: var(--pro-subtext);
    margin: 8px 0 16px;
}

/* KPI grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}
.kpi-card {
    background: var(--pro-bg);
    border-radius: 16px;
    padding: 14px 16px;
    border: 1px solid var(--pro-border);
}
.kpi-card.primary { border-left: 4px solid var(--pro-navy); }
.kpi-card.secondary { border-left: 4px solid var(--pro-orange); }

.kpi-label {
    font-size: 12px;
    color: var(--pro-subtext);
}
.kpi-value {
    font-size: 22px;
    font-weight: 600;
}
.kpi-trend {
    display: flex;
    gap: 4px;
    margin-top: 6px;
}
.positive { color: #16a34a; }
.negative { color: #dc2626; }

/* Charts */
.chart-card {
    background: var(--pro-bg);
    border: 1px solid var(--pro-border);
    border-radius: 16px;
    padding: 16px;
    margin-top: 16px;
}

/* Grid for side-by-side charts */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ================= INSIGHT SUMMARY (RICH VERSION) ================= */
.insight-summary {
    margin-top: 24px;
    padding: 18px 22px;
    background: linear-gradient(145deg, #ffffff, #f9fafb); /* Rich subtle depth */
    border: 1px solid var(--pro-border);
    border-left: 4px solid var(--pro-navy); /* Matches the Analysis Bar anchor */
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.insight-summary h3 {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--pro-subtext); /* Muted slate for a professional feel */
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Optional: Add a lightbulb icon before "Key Insights" */
.insight-summary h3::before {
   
    font-family: 'Material Icons Outlined';
    font-size: 16px;
    color: var(--pro-navy);
}

.insight-summary ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.insight-summary li {
    position: relative;
    padding-left: 20px; /* More room for the rich indicator */
    margin-bottom: 10px;
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--pro-text-dark); /* Darker text for better legibility */
}

.insight-summary li:last-child {
    margin-bottom: 0;
}

/* Richer Indicator Dot */
.insight-summary li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #cbd5e1; /* Default soft grey */
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 1px var(--pro-border);
}

/* Emphasis for CFO callouts */
.insight-summary strong {
    font-weight: 700;
    color: var(--pro-navy); /* Brand color for the 'meat' of the insight */
    background: rgba(0, 0, 160, 0.04);
    padding: 0 4px;
    border-radius: 4px;
}

/* Responsive */
@media (max-width: 1024px) {
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .grid-2 {
        grid-template-columns: 1fr;
    }
}






/* ================= CONTEXT BAR ================= */
.ncfo-context-bar {
    display: flex;
    gap: 16px;
    align-items: center;
    padding: 10px 14px;
    background: var(--pro-glass);
    border-bottom: 1px solid var(--pro-border);
}

.context-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.context-item.wide select {
    min-width: 250px;
}

.context-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--pro-subtext);
    letter-spacing: 0.04em;
}

.context-item select {
    padding: 6px 10px;
    font-size: 13px;
    border-radius: 10px;
    border: 1px solid var(--pro-border);
    background: #fff;
}


/* ================= ANALYSIS BAR (Reporting Line Filter) ================= */
:root {
    --pro-navy: #0000a0;
    --pro-border: #e2e8f0;
    --pro-text: #64748b;
    --pro-text-dark: #1e293b;
    --bg-surface: #ffffff;
}
.analysis-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px; /* Compact vertical padding */
    margin: 16px 0;
    background: var(--bg-surface);
    border: 1px solid var(--pro-border);
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.analysis-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.group-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--pro-text);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

/* VS Badge Styling */
.analysis-vs {
    font-size: 10px;
    font-weight: 800;
    color: #94a3b8;
    background: #f1f5f9;
    padding: 4px 8px;
    border-radius: 6px;
    text-transform: uppercase;
}

.analysis-divider {
    width: 1px;
    height: 32px;
    background: #f1f5f9;
    margin: 0 20px;
}

/* Dropdown refinements */
.analysis-group select {
    height: 38px;
    padding: 0 32px 0 12px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--pro-text-dark);
    border: 1px solid var(--pro-border);
    border-radius: 10px;
    background-color: #ffffff;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    transition: all 0.2s ease;
}

.analysis-group select:hover {
    border-color: #cbd5e1;
    background-color: #f8fafc;
}

/* Download Button Styling */
.download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    color: var(--pro-text);
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s;
}

.download-btn:hover {
    background: #f1f5f9;
    color: var(--pro-navy);
}

/* ================= NCFO GLOBAL NAV HEADER ================= */
.ncfo-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center; /* Shifted to center for a more balanced look */
    gap: 20px;
    padding: 12px 20px; /* Aligned with your analysis bar padding */
    background: #ffffff;
    border-bottom: 1px solid var(--pro-border);
}

/* ================= FILTER GROUP ================= */
.nav-filters {
    display: flex;
    gap: 16px;
    align-items: center;
}

.nav-filter {
    display: flex;
    flex-direction: column;
    gap: 2px; /* Tightened gap for a more compact vertical footprint */
}

/* Unified Select Style */
.nav-filter select {
    height: 36px; /* Reduced from 40px to match executive density */
    padding: 0 32px 0 10px;
    font-size: 13px;
    font-weight: 500;
    color: var(--pro-text-dark);
    border-radius: 10px;
    border: 1px solid var(--pro-border);
    background: #ffffff;
    
    /* Use the same custom chevron as your analysis bar for consistency */
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    cursor: pointer;
}

/* ================= SEGMENTED VIEW TOGGLE ================= */
.nav-view-toggle {
    display: flex;
    background: #f1f5f9; /* Soft track background */
    padding: 3px;
    border-radius: 999px;
    gap: 2px;
}

.nav-view-toggle button {
    height: 30px; /* Compact, pill-style height */
    padding: 0 14px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 999px;
    background: transparent;
    color: var(--pro-text);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Active Segment State */
.nav-view-toggle button.active {
    background: #ffffff;
    color: var(--pro-navy);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}


/* ===================================================== */
/* ================ MOBILE OPTIMIZATION ================= */
/* ===================================================== */

@media (max-width: 768px) {

    /* ---------- Page Header ---------- */
    .page-header h1 {
        font-size: 18px;
    }

    .page-header p {
        font-size: 12px;
        line-height: 1.4;
    }

    /* ---------- Context / Global Header ---------- */
    .ncfo-nav-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 12px;
    }

    .nav-filters {
        flex-wrap: wrap;
        gap: 10px;
    }

    .nav-filter {
        width: 100%;
    }

    .nav-filter select {
        width: 100%;
        height: 40px;
    }

    .nav-view-toggle {
        align-self: flex-start;
        width: 100%;
        justify-content: space-between;
    }

    .nav-view-toggle button {
        flex: 1;
        text-align: center;
        height: 34px;
        font-size: 11px;
    }

    /* ---------- Analysis Bar ---------- */
    .analysis-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 14px;
        border-left: none;
    }

    .analysis-group {
        width: 100%;
        justify-content: space-between;
    }

    .analysis-group select {
        width: 100%;
        height: 40px;
        font-size: 13px;
    }

    .analysis-vs {
        align-self: center;
        margin: 6px 0;
    }

    .analysis-divider {
        display: none;
    }

    /* ---------- KPI Grid ---------- */
    .kpi-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .kpi-card {
        padding: 14px;
    }

    .kpi-value {
        font-size: 20px;
    }

    /* ---------- Charts ---------- */
    .grid-2 {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .chart-card {
        padding: 12px;
    }

    /* ---------- Insight Summary ---------- */
    .insight-summary {
        padding: 14px;
        border-left: none;
    }

    .insight-summary h3 {
        font-size: 11px;
    }

    .insight-summary li {
        font-size: 12.5px;
        line-height: 1.5;
    }
}
