/* Visit Intervals — layout + sidebar styles.
   Auto-served by Dash from /assets/. Mirrors adherence.css. */

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* Section header row: title on the left, anchor chip on the right. */
.vi-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

/* "Anchor visit: <name>" pill — subtle navy (Mira brand-blue family). It's
   reference context, not a status, so it stays muted; green is reserved for
   the on-window dots. */
.vi-anchor-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.2rem 0.6rem;
    background-color: #eef1f8;
    border: 1px solid #ccd5ec;
    border-radius: 999px;
    font-size: 0.78rem;
    color: #3a4a7a;
    margin: 1rem 0 0.4rem 0;
}
/* Collapse the chip entirely when it has no content (no anchor). */
.vi-anchor-chip:empty {
    display: none;
}

.vi-anchor-icon {
    font-size: 0.85rem;
    line-height: 1;
    color: #8b95c2;
}

.vi-anchor-label {
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.68rem;
    font-weight: 600;
    color: #6b78a8;
}

.vi-anchor-name {
    font-weight: 600;
    color: #2c3866;
}

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

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

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