/* Cross-Scale Consistency — layout + sidebar styles.
   Auto-served by Dash from /assets/. Mirrors adherence.css. */

/* === Height plumbing (desktop only; see scale_summary.css for rationale) === */
@media (min-width: 992px) {
    #page-content-wrapper:has(.cs-page) {
        display: flex;
        flex-direction: column;
    }
    #page-content-wrapper:has(.cs-page) > div {
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }
    #_pages_content:has(.cs-page) {
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }
    .cs-page {
        flex: 1;
        min-height: 0;
    }
    .cs-layout {
        flex: 1;
        min-height: 0;
    }
}

.cs-page {
    width: 100%;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
}

.cs-layout {
    display: flex;
    flex-direction: row;
    align-items: stretch;
}

/* === Sidebar =========================================================== */
.cs-sidebar {
    flex: 0 0 240px;
    width: 240px;
    background-color: #f8f9fa;
    border-right: 1px solid #dee2e6;
    padding: 1rem 1rem 1.5rem 1rem;
    overflow-y: auto;
}

.cs-sidebar-header {
    font-weight: 600;
    font-size: 0.85rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.4rem;
}

.cs-sidebar-hint {
    font-size: 0.75rem;
    color: #868e96;
    margin-bottom: 0.75rem;
}

/* Matrix + scatter side by side on wide viewports, stacked when narrow. */
.cs-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1rem;
}
.cs-grid-cell {
    min-width: 0;
}
@media (max-width: 1199.98px) {
    .cs-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.cs-label {
    display: block;
    font-weight: 500;
    font-size: 0.8rem;
    color: #495057;
    margin-bottom: 0.25rem;
    margin-top: 0.5rem;
}

.cs-sep {
    border-top: 1px solid #dee2e6;
    margin: 1rem 0 0.5rem 0;
}

.cs-check-list,
.cs-radio {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.cs-check-input,
.cs-radio-input {
    margin-right: 0.4rem;
}

.cs-check-label,
.cs-radio-label {
    font-size: 0.85rem;
    color: #212529;
    cursor: pointer;
}

.cs-dropdown {
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

/* === Content =========================================================== */
.cs-content {
    flex: 1 1 auto;
    min-width: 0;
    padding: 1rem 1.25rem 2rem 1.25rem;
    overflow-y: auto;
}

.cs-message {
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
    min-height: 1rem;
}

/* === KPI bar =========================================================== */
.cs-kpi-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.cs-kpi {
    flex: 1 1 0;
    min-width: 120px;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 0.7rem 0.9rem;
    text-align: center;
}

.cs-kpi-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: #212529;
    line-height: 1.1;
}

.cs-kpi-label {
    font-size: 0.72rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 0.25rem;
}

/* === Sections / graphs ================================================= */
.cs-section-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 1rem 0 0.4rem 0;
}

.cs-graph {
    border: 1px solid #e9ecef;
    border-radius: 4px;
    background-color: #ffffff;
    min-height: 240px;
}

/* === Mobile (< lg) ===================================================== */
@media (max-width: 991.98px) {
    .cs-layout {
        flex-direction: column;
    }
    .cs-sidebar {
        flex: 0 0 auto;
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #dee2e6;
        padding: 0.75rem 1rem;
        overflow-y: visible;
    }
    .cs-content {
        padding: 0.75rem 1rem 2rem 1rem;
        overflow-y: visible;
    }
    .cs-kpi {
        flex: 1 1 40%;
    }
}

@media (max-width: 575.98px) {
    .cs-sidebar {
        padding: 0.5rem 0.75rem;
    }
    .cs-content {
        padding: 0.5rem 0.75rem 1.5rem 0.75rem;
    }
}

/* === In-page subnav tabs (Overview | Pairwise) ========================= */
.cs-tabs {
    display: flex;
    gap: 0.4rem;
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 0.85rem;
}
.cs-tab {
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: #6c757d;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.12s ease, border-color 0.12s ease;
}
.cs-tab:hover {
    color: #343a40;
}
.cs-tab-active {
    color: #3B5BB8;
    border-bottom-color: #3B5BB8;
    font-weight: 600;
}

/* Slider breathing room in the sidebar. */
.cs-slider {
    margin: 0.25rem 0 0.5rem 0;
    padding: 0 0.2rem;
}
