/* Adherence — layout + sidebar styles.
   Auto-served by Dash from /assets/. Mirrors scale_summary.css. */

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

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

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

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

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

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

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

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

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

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

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

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

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

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

.adh-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;
}

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

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

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

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

/* Lowest-completion breakdown: scales / sites / raters side by side, wrapping
   to one column on narrow viewports so rater labels stay legible. */
.adh-breakdown-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}
.adh-breakdown-cell {
    min-width: 0;
}
@media (max-width: 1199.98px) {
    .adh-breakdown-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

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

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