/* ── Page background ─────────────────────────────────────────── */
body {
    background-color: #f0f2f5;
}

/* Fix 1: Add margins so gray body shows around the content card */
.container-fluid {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    padding-top: 16px;
    padding-bottom: 16px;
    margin: 12px 16px;
    width: calc(100% - 32px);
}

/* ── Fix 2: Dropdown polish ──────────────────────────────────── */
.Select-control {
    border-radius: 8px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.10) !important;
    border: 1px solid #dee2e6 !important;
}

.Select-menu-outer {
    border-radius: 0 0 8px 8px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12) !important;
}

/* ── Fix 3: Pill-style tabs ──────────────────────────────────── */
.nav-tabs {
    border-bottom: none;
    gap: 4px;
}

.nav-tabs .nav-link {
    border-radius: 20px !important;
    border: 1px solid #dee2e6 !important;
    color: #495057;
    padding: 4px 16px;
}

.nav-tabs .nav-link.active {
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
    color: white !important;
    box-shadow: 0 2px 6px rgba(13, 110, 253, 0.35);
}

/* ── Fix 4: Navbar accent ────────────────────────────────────── */
.navbar {
    border-bottom: 3px solid #198754;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* ── Fix 5: Graph card styling ───────────────────────────────── */
.dash-graph {
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    background: white;
    padding: 8px;
}

/* ── Fix 6: Equal-height graphs within a row ─────────────────── */

/* Stretch all columns in a row to the same height */
.row {
    align-items: stretch;
}

/* Make each column a vertical flex container */
[class*="col-"] {
    display: flex;
    flex-direction: column;
}

/* Graphs and their spinner wrappers grow to fill available column height */
[class*="col-"] .dash-graph {
    flex-grow: 1;
    min-height: 300px;
}

/* ── Fix 7: Vertical breathing room ─────────────────────────── */

/* Space between each row of content */
.container-fluid > .row {
    margin-bottom: 20px;
}

/* Gap between the pill tabs and the graph beneath them */
.nav-tabs {
    margin-bottom: 12px;
}

/* Lift graphs away from whatever is directly above */
.dash-graph {
    margin-top: 8px;
}

/* Give dropdowns a little bottom clearance too */
.Select-control {
    margin-bottom: 4px;
}

/* Spinner wrapper (wraps graphs in tabbed columns) must also stretch */
[class*="col-"] .spinner-border-sm ~ div,
[class*="col-"] > div:not(.dash-graph) {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}
[class*="col-"] > div:not(.dash-graph) .dash-graph {
    flex-grow: 1;
}

/* ── Tab pane visibility fix (original) ─────────────────────── */
/* Force all dbc.Tab content to be measurable */
.tab-content > .tab-pane,
.dash-bootstrap .tab-content > .tab-pane {
    display: block !important;
    position: absolute;
    visibility: hidden;
    width: 100%;
}

.tab-content > .tab-pane.active,
.dash-bootstrap .tab-content > .tab-pane.active {
    position: relative;
    visibility: visible;
}
