:root {
    --lac-blue: #003b5c;
    --lac-blue-2: #0b4f71;
    --lac-teal: #007a78;
    --lac-teal-dark: #006462;
    --lac-gold: #c99700;

    --card: #ffffff;
    --text: #17324d;
    --muted: #627889;
    --border: #d8e3ea;
    --border-light: #e2edf3;

    --shadow: 0 18px 45px rgba(16, 50, 74, 0.14);
}

/* =========================================================
   Base
========================================================= */

#main-content select {
    margin-bottom: 0 !important;
}

#clinicLineChart {
    cursor: pointer;
}

.dashboard-section {
    margin: 32px 0 42px;
}

.dashboard-shell {
    max-width: 100%;
    overflow: hidden;
    background: linear-gradient(180deg, #ffffff 0%, #f7fafb 100%);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow);
}

main .table-container {
    margin: 0;
}

/* =========================================================
   Hero
========================================================= */

.dashboard-hero {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    padding: 28px 32px;
    color: #ffffff;
    flex-wrap: wrap;
    background:
        radial-gradient(circle at top right, rgba(0, 122, 120, .35), transparent 35%),
        linear-gradient(135deg, var(--lac-blue) 0%, var(--lac-blue-2) 58%, var(--lac-teal) 100%);
}

.dashboard-agency-label {
    margin-bottom: 8px;
    color: #bfe7e4;
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.dashboard-hero h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    color: #ffffff;
    font-size: 2rem;
    font-weight: 800;
    flex-wrap: wrap;
    line-height: 1.2;
}

.dashboard-hero p {
    max-width: 960px;
    margin: 10px 0 0;
    color: rgba(255, 255, 255, .84);
    font-size: .98rem;
    line-height: 1.55;
}

.dashboard-title-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .28);
}

.dashboard-status-pill {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .25);
    font-size: .78rem;
    font-weight: 800;
    white-space: nowrap;
}

.dashboard-status-pill i {
    color: #7ee0b2;
    font-size: .55rem;
}

/* =========================================================
   Toolbar
========================================================= */
.dashboard-toolbar {
    display: block;
    padding: 20px 24px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbfc 100%);
    border-bottom: 1px solid var(--border);
}

.dashboard-control-row {
    display: grid;
    grid-template-columns:
        minmax(95px, 120px)
        /* Year */
        minmax(300px, 420px)
        /* Clinic Type */
        minmax(160px, 0.9fr)
        /* Service Type */
        minmax(180px, 1.1fr);
    /* Location */
    gap: 14px;
    width: 100%;
    min-width: 0;
    align-items: stretch;
}

.dashboard-range-pill {
    width: auto;
    min-width: 75px;
    height: auto;

    padding: 0 16px 0 0;

    border: none;
    background: transparent;
    box-shadow: none;

    color: var(--lac-blue);
    font-size: .8rem !important;
    font-weight: 800;

    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    cursor: pointer;
}

.dashboard-chart-range-control {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--border-light);
}

.dashboard-chart-range-control .dashboard-control-label {
    margin: 0 !important;
    white-space: nowrap;
    flex-shrink: 0;
}

.dashboard-chart-range-control .dashboard-range-select {
    min-width: 110px;
    width: auto;
    height: 36px;
    padding-right: 28px;
    border: none;
    background: transparent;
    color: var(--lac-blue);
    font-weight: 800;
    box-shadow: none;
}

.dashboard-control-block {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
    min-height: 72px;
    padding: 12px 14px;
    background: #ffffff;
    border: 1px solid #dbe7ee;
    border-radius: 14px;
    box-shadow: 0 8px 20px rgba(16, 50, 74, .06);
    transition: box-shadow .18s ease;
}

.dashboard-control-block:hover {
    box-shadow: 0 10px 26px rgba(16, 50, 74, .10);
}

.dashboard-control-label {
    display: block !important;
    align-items: center;
    text-align: center;
    gap: 7px;
    color: #007a78 !important;
    /*var(--muted) !important;*/
    font-size: 0.68rem;
    font-weight: 900 !important;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.dashboard-control-label i {
    color: var(--lac-teal);
}

/* hide dropdown by default */
.dashboard-metric-dropdown {
    display: none !important;
}

.dashboard-chart-select {
    font-size: .84rem;
}

.dashboard-chart-select.is-long {
    font-size: .72rem;
}

.dashboard-chart-actions {
    display: grid;
    grid-template-columns: auto auto auto;
    align-items: start;
    justify-content: end;
    gap: 10px;
}

.dashboard-chart-badge {
    grid-column: 1;
}

.dashboard-view-toggle {
    grid-column: 2;
}

.dashboard-range-stack {
    grid-column: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.dashboard-month-pager {
    display: inline-flex;
    justify-content: center;
    gap: 6px;
    min-height: 34px;
}

.dashboard-month-pager[hidden] {
    display: none !important;
}

/* =========================================================
   Segmented Control
========================================================= */

.dashboard-segmented-control {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: center;
    gap: 4px;
    min-height: 42px;
    padding: 4px;
    background: #eef5f8;
    border: 1px solid #d3e2e9;
    border-radius: 12px;
    overflow: hidden;
}

.dashboard-segment {
    min-width: 0;
    height: 34px;
    padding: 0 10px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--text);
    font-size: 0.78rem;
    font-weight: 850;
    line-height: 34px;
    white-space: nowrap;
    text-align: center;
    cursor: pointer;
    transition: all .18s ease;
}

.dashboard-segment:hover {
    background: rgba(0, 59, 92, .08);
}

.dashboard-segment.is-active {
    background: linear-gradient(180deg, #ffffff 0%, #f7fbfc 100%);
    color: var(--lac-blue);
    box-shadow: 0 5px 14px rgba(16, 50, 74, .14);
}

.dashboard-btn-icon {
    margin-right: 6px;
    color: var(--lac-teal);
}

/* =========================================================
   Selects
========================================================= */

.dashboard-chart-select,
.dashboard-range-select {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    height: 42px;
    padding: 0 36px 0 12px;
    border: 1px solid #c9d9e2;
    border-radius: 11px;
    background: #ffffff;
    color: var(--text);
    font-size: .84rem;
    font-weight: 800;
    cursor: pointer;
    transition: border .15s ease, box-shadow .15s ease;
}

.dashboard-chart-select:focus,
.dashboard-range-select:focus {
    outline: none;
    border-color: var(--lac-teal);
    box-shadow: 0 0 0 3px rgba(0, 122, 120, .14);
}

.dashboard-location-filter {
    min-width: 0;
}

.dashboard-location-filter select {
    width: 100%;
    max-width: none;
}

.dashboard-range-select {
    color: #ffffff;
    background: var(--lac-teal);
    border-color: var(--lac-teal);
}

.dashboard-range-select:hover {
    background: var(--lac-teal-dark);
    border-color: var(--lac-teal-dark);
}

/* =========================================================
   KPI Cards
========================================================= */

.dashboard-kpis {
    display: grid;
    gap: 18px;
    padding: 20px 24px;
}

.dashboard-kpis-desktop {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-kpis-mobile {
    display: none;
    grid-template-columns: 1fr;
}

.dashboard-kpi {
    position: relative;
    min-width: 0;
    padding: 18px 18px 16px;
    border-radius: 16px;
    color: #ffffff;
    overflow: hidden;
    background: linear-gradient(135deg, #003B5C, #005b7f);
    box-shadow: 0 10px 26px rgba(0, 59, 92, 0.21);
    transition: box-shadow 0.18s ease;
    font-size: 0.75rem;
}

.dashboard-kpi:hover {
    box-shadow: 0 16px 38px rgba(0, 59, 92, 0.35);
}

.dashboard-kpi::after {
    content: "";
    position: absolute;
    top: 0;
    right: -40%;
    width: 80%;
    height: 100%;
    background: linear-gradient(120deg,
            transparent,
            rgba(255, 255, 255, 0.18),
            transparent);
    transform: skewX(-20deg);
}

/* KPI card backgrounds adjusted for WCAG AA contrast */

.dashboard-kpi:nth-child(1) {
    background: linear-gradient(135deg, #003B5C, #005b7f);
}

.dashboard-kpi:nth-child(2) {
    background: linear-gradient(135deg, #006462, #005452);
}

.dashboard-kpi:nth-child(3) {
    background: linear-gradient(135deg, #466A50, #3F5F48);
}

.dashboard-kpi:nth-child(4) {
    background: linear-gradient(135deg, #73582B, #664B22);
}

.dashboard-kpi-icon {
    position: absolute;
    top: 14px;
    right: 16px;
    font-size: 1.6rem;
    opacity: 0.25;
}

.dashboard-kpi span {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #ffffff;
    opacity: 0.9;
}

.dashboard-kpi strong {
    display: block;
    margin-top: 6px;
    font-size: 1.15rem;
    font-weight: 900;
    word-break: break-word;
    overflow-wrap: anywhere;
    line-height: normal;
    color: #ffffff;
}

.dashboard-kpi small {
    display: block;
    margin-top: 4px;
    font-size: 0.75rem;
    color: #ffffff;
    opacity: 0.9;
}

/* Keep trend text ADA compliant */

.dashboard-kpi strong.is-positive,
.dashboard-kpi strong.is-negative,
.dashboard-kpi strong.is-neutral {
    color: #ffffff;
}

/* =========================================================
   Notes / Footnotes
========================================================= */

.dashboard-note {
    margin: 0;
    padding: 0 10px 22px;
    color: var(--muted);
    font-size: 0.88rem;
}

.dashboard-footnotes-card {
    margin-top: 10px;
    padding: 14px;
    color: #24455d;
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: 14px;
    box-shadow: 0 8px 20px rgba(16, 50, 74, 0.06);
}

.dashboard-footnotes-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid #edf3f6;
}

.dashboard-footnotes-icon {
    flex: 0 0 28px;
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    color: var(--lac-teal);
    background: #e7f4f3;
    border-radius: 50%;
}

.dashboard-footnotes-icon i {
    display: block;
    font-size: 13px;
    line-height: 2.2;
}

.dashboard-footnotes-header strong {
    display: block;
    color: var(--lac-blue);
    font-size: 13px;
    font-weight: 900;
    line-height: 1.2;
}

.dashboard-footnotes-header span {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.35;
}

.dashboard-footnotes-grid {
    display: grid;
    gap: 8px;
}

.dashboard-footnote-item {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: start;
    gap: 8px;
    padding: 8px 10px;
    background: #f8fbfc;
    border: 1px solid #edf3f6;
    border-radius: 10px;
}

.dashboard-footnote-marker {
    min-width: 38px;
    padding: 3px 7px;
    color: var(--lac-teal-dark);
    background: #e7f4f3;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 900;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
}

.dashboard-footnote-item p {
    margin: 0;
    color: #4f6375;
    font-size: 11px;
    line-height: 1.45;
}

.dashboard-footnote-source {
    background: #f4f8fa;
}

@media (max-width: 600px) {
    .dashboard-footnotes-card {
        padding: 12px;
    }

    .dashboard-footnote-item {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .dashboard-footnote-marker {
        width: fit-content;
    }
}

#dashboardTrend,
#dashboardTrendMobile {
    display: inline-block;
    border-radius: 8px;
    font-weight: 800;
}

#dashboardTrend.is-positive,
#dashboardTrend.is-negative,
#dashboardTrend.is-neutral,
#dashboardTrendMobile.is-positive,
#dashboardTrendMobile.is-negative,
#dashboardTrendMobile.is-neutral {
    color: #ffffff;
}

#dashboardTrend.is-positive,
#dashboardTrendMobile.is-positive {
    text-shadow: 0 0 6px rgba(182, 245, 216, 0.6);
}

#dashboardTrend.is-negative,
#dashboardTrendMobile.is-negative {
    text-shadow: 0 0 6px rgba(255, 160, 160, 0.6);
}

#dashboardTrend.is-neutral,
#dashboardTrendMobile.is-neutral {
    opacity: 0.85;
}

.dashboard-kpi strong.kpi-updated::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    transform: translateX(-100%);
    animation: kpiShimmer 0.6s ease;
}

@keyframes kpiShimmer {
    to {
        transform: translateX(100%);
    }
}

/* =========================================================
   Cards / Charts
========================================================= */

.dashboard-chart-card,
.dashboard-insight-card,
.dashboard-mini-chart-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-top-left-radius: 18px;
    border-top-right-radius: 18px;
    box-shadow: 0 12px 28px rgba(16, 50, 74, .08);
}

.dashboard-chart-card {
    margin: 0 10px;
    padding: 20px 10px;
}

.dashboard-chart-header,
.dashboard-mini-chart-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.dashboard-chart-header h3,
.dashboard-mini-chart-header h3 {
    margin: 0;
    color: var(--lac-blue);
    font-weight: 900;
}

.dashboard-chart-header h3 {
    font-size: 1.1rem;
}

.dashboard-mini-chart-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
}

.dashboard-title-icon-inline {
    color: var(--lac-teal);
    font-size: 0.9rem;
}

.dashboard-chart-header p,
.dashboard-mini-chart-header p {
    margin: 4px 0 0;
    color: var(--muted);
    line-height: 1.4;
}

.dashboard-chart-header p {
    font-size: .88rem;
}

.dashboard-mini-chart-header p {
    font-size: .82rem;
}

.dashboard-chart-actions {
    display: grid;
    grid-template-columns: auto auto auto;
    align-items: start;
    justify-content: end;
    gap: 10px;
}

.dashboard-chart-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 13px 10px;
    border-radius: 999px;
    color: var(--lac-teal);
    background: #e7f4f3;
    font-size: .75rem;
    font-weight: 900;
    white-space: nowrap;

    grid-column: 1;
    align-self: start;
}

.dashboard-view-toggle {
    grid-column: 2;
    align-self: start;
}

.dashboard-range-stack {
    grid-column: 3;

    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.dashboard-month-pager {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 34px;
}

.dashboard-month-pager[hidden] {
    display: none !important;
}

.dashboard-chart-wrap,
.dashboard-mini-chart-wrap {
    position: relative;
    border-radius: 14px;
}

.dashboard-chart-wrap {
    min-height: clamp(300px, 50vw, 440px);
    position: relative;
    padding: 10px 10px 0 10px;
    background:
        linear-gradient(#ffffff, #ffffff) padding-box,
        linear-gradient(135deg, rgba(0, 59, 92, .2), rgba(0, 122, 120, .18)) border-box;
    border: 1px solid transparent;
}

.dashboard-chart-wrap canvas {
    width: 100% !important;
    height: clamp(280px, 48vw, 430px) !important;
}

.dashboard-mini-chart-wrap {
    display: block;
    min-height: 250px;
}

.dashboard-mini-chart-wrap canvas {
    width: 100% !important;
    height: 250px !important;
}

/* =========================================================
   Chart / Table Flip View
========================================================= */

.dashboard-view-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 13px 11px;
    border: 1px solid var(--border-light);
    border-radius: 999px;
    background: #ffffff;
    color: var(--lac-teal);
    font-size: .75rem;
    font-weight: 900;
    white-space: nowrap;
    cursor: pointer;
    transition: background .18s ease, box-shadow .18s ease, transform .18s ease;
}

.dashboard-view-toggle:hover {
    background: #e7f4f3;
    box-shadow: 0 8px 18px rgba(16, 50, 74, .10);
    transform: translateY(-1px);
}

.dashboard-view-toggle:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 122, 120, .16);
}

.dashboard-view-container {
    position: relative;
    perspective: 1400px;
    min-height: 250px;
}

.dashboard-chart-card .dashboard-view-container {
    min-height: clamp(300px, 50vw, 450px);
}

.dashboard-view-flipper {
    position: relative;
    width: 100%;
    min-height: inherit;
    transform-style: preserve-3d;
    transition: transform .65s cubic-bezier(.2, .8, .2, 1), filter .35s ease;
}

.dashboard-kpi strong {
    display: block;
    margin-top: 4px;
}

.dashboard-kpi small {
    display: block;
}

.dashboard-view-container.is-flipped .dashboard-view-flipper {
    transform: rotateY(180deg);
}

.dashboard-view-container.is-flipped {
    filter: drop-shadow(0 18px 28px rgba(16, 50, 74, .14));
}

.dashboard-view {
    position: absolute;
    inset: 0;
    width: 100%;
    min-height: inherit;
    border-radius: 14px;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.dashboard-view-chart {
    transform: rotateY(0deg);
}

.dashboard-view-table {
    transform: rotateY(180deg);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.dashboard-view-table table {
    width: 100%;
    min-width: 640px;
    border-collapse: collapse;
}

.dashboard-view-table-inner,
.dashboard-view-table .table-wrapper {
    width: 100%;
    max-width: 100%;
    height: 100%;
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.dashboard-view::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    opacity: 0;
    background: linear-gradient(90deg,
            rgba(255, 255, 255, .05),
            rgba(255, 255, 255, .34),
            rgba(255, 255, 255, .05));
    transition: opacity .25s ease;
}

.dashboard-view-container.is-flipping .dashboard-view::after {
    opacity: 1;
}

/* =========================================================
   Data View Panel
========================================================= */

.dashboard-chart-data-panel {
    height: auto;
    max-height: none;
    overflow: visible;
    padding: 0;
    border: 1px solid var(--border-light);
    border-radius: 16px;
    background:
        radial-gradient(circle at top right, rgba(0, 122, 120, .08), transparent 34%),
        linear-gradient(180deg, #ffffff 0%, #f8fbfc 100%);
}

.dashboard-chart-data-panel-large {
    max-height: none;
}

.dashboard-table-shell {
    display: grid;
    gap: 16px;
    height: auto;
    min-height: 0;
}

.dashboard-table-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
    background: linear-gradient(180deg, #ffffff 0%, #f7fbfc 100%);
}

.dashboard-table-topbar strong {
    display: block;
    margin-top: 4px;
    color: var(--lac-blue);
    font-size: .95rem;
    font-weight: 900;
}

.dashboard-table-eyebrow,
.dashboard-table-summary {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--lac-teal);
    font-size: .68rem;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.dashboard-table-summary {
    padding: 7px 10px;
    border-radius: 999px;
    background: #e7f4f3;
    white-space: nowrap;

    width: 100%;
    max-width: fit-content;
}

.dashboard-table-container,
.dashboard-table-desktop,
.dashboard-table-mobile-cards,
.dashboard-data-table {
    display: none !important;
}

.dashboard-empty-table {
    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 440px;
    width: 100%;

    text-align: center;
    color: var(--muted);

    font-size: 1.5rem;
    font-weight: 800;
}

.dashboard-empty-chart {
    position: absolute;
    inset: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    text-align: center;
    color: var(--muted);

    font-size: 1.5rem;
    font-weight: 800;

    border-radius: 14px;
    background: #fff;
}

/* =========================================================
   Card-Based Data View
========================================================= */

.dashboard-card-data-shell {
    display: grid;
    gap: 16px;
}

.dashboard-data-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
    padding: 16px;
}

.dashboard-data-card {
    min-width: 0;
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: 16px;
    box-shadow: 0 8px 20px rgba(16, 50, 74, 0.06);
    overflow: hidden;
}

.dashboard-data-card-header {
    padding: 12px 14px;
    background: linear-gradient(180deg, #f8fbfc 0%, #eef6f8 100%);
    border-bottom: 1px solid var(--border-light);
    color: var(--lac-blue);
    font-weight: 900;
}

.dashboard-data-card-header span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dashboard-data-card-body {
    display: grid;
    gap: 12px;
    padding: 14px;
}

.dashboard-data-metric-row {
    display: grid;
    gap: 6px;
}

.dashboard-data-metric-label {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    color: var(--text);
    font-size: 0.84rem;
    font-weight: 800;
}

.dashboard-data-metric-label span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    overflow-wrap: anywhere;
}

.dashboard-data-metric-label span i {
    flex: 0 0 auto;
    color: var(--lac-teal);
}

.dashboard-data-metric-label strong {
    color: var(--lac-blue);
    white-space: nowrap;
}

.dashboard-data-bar {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #e8f0f4;
}

.dashboard-data-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--lac-teal), var(--lac-blue));
}

.dashboard-data-total-card {
    margin: 0 16px 16px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #f8fbfc;
}

.dashboard-data-total-card>strong {
    display: block;
    margin-bottom: 10px;
    color: var(--lac-blue);
    font-size: 0.95rem;
}

.dashboard-data-total-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
}

.dashboard-data-total-grid div {
    min-width: 0;
    padding: 10px 12px;
    border-radius: 12px;
    background: #ffffff;
    border: 1px solid var(--border-light);
}

.dashboard-data-total-grid span {
    display: block;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.dashboard-data-total-grid strong {
    display: block;
    margin-top: 4px;
    color: var(--lac-blue);
    font-size: 1rem;
}

.dashboard-data-total-card {
    position: relative;
    background: linear-gradient(135deg, #ffffff 0%, #f0f7f9 100%);
    border: 1px solid rgba(0, 122, 120, 0.25);
    box-shadow: 0 12px 30px rgba(0, 59, 92, 0.12);
    overflow: hidden;
}

.dashboard-data-total-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--lac-teal), var(--lac-blue));
}

.dashboard-data-total-card>strong {
    font-size: 1.5rem;
    letter-spacing: 0.04em;
    color: var(--lac-blue);
}

.dashboard-data-total-grid div {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbfc 100%);
    border: 1px solid rgba(0, 122, 120, 0.15);
    box-shadow: 0 6px 16px rgba(16, 50, 74, 0.08);
    transition: all 0.18s ease;

    text-align: center;
}

.dashboard-data-total-grid div:hover {
    box-shadow: 0 10px 22px rgba(16, 50, 74, 0.14);
    border-color: var(--lac-teal);
}

.dashboard-data-total-grid strong {
    font-size: 1.15rem;
    font-weight: 900;
}

.dashboard-data-total-grid span i {
    color: var(--lac-teal);
    margin-right: 6px;
}

/* =========================================================
   Insights / Mini Charts
========================================================= */

.dashboard-insights-grid {
    display: none;
    grid-template-columns: minmax(260px, 0.9fr) minmax(260px, 1fr) minmax(260px, 1fr);
    gap: 18px;
    padding: 0 24px 22px;
}

.dashboard-insight-card {
    display: flex;
    gap: 14px;
    min-width: 0;
    padding: 18px;
    background:
        radial-gradient(circle at top right, rgba(0, 122, 120, .10), transparent 38%),
        linear-gradient(180deg, #ffffff 0%, #f7fbfc 100%);
}

.dashboard-insight-icon {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    color: var(--lac-teal);
    background: #e7f4f3;
    font-size: 1.25rem;
}

.dashboard-insight-label {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: .68rem;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.dashboard-insight-card strong {
    display: block;
    color: var(--lac-blue);
    font-size: 1.05rem;
    font-weight: 900;
    line-height: 1.25;
}

.dashboard-insight-card p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: .88rem;
    line-height: 1.5;
}

.dashboard-mini-chart-card {
    min-width: 0;
    padding: 16px;
}

.dashboard-mini-chart-header span {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 12px;
    color: var(--lac-teal);
    background: #e7f4f3;
}

.insight-pill {
    display: inline-block;
    padding: 2px 4px;
    margin: 0 2px;
    border-radius: 8px;
    background: #e7f4f3;
    color: var(--lac-teal);
    font-weight: 700;
    white-space: nowrap;
}

#dashboardInsightText {
    line-height: 1.4;
    word-break: normal;
}

/* =========================================================
   Mobile Data Lists
========================================================= */

.dashboard-mobile-data-list {
    display: none;
}

.dashboard-mobile-data-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    background: #f8fbfc;
}

.dashboard-mobile-data-row span {
    color: var(--text);
    font-size: .84rem;
    font-weight: 800;
}

.dashboard-mobile-data-row strong {
    color: var(--lac-blue);
    font-size: .88rem;
    font-weight: 900;
    white-space: nowrap;
}

.dashboard-data-table thead th {
    position: sticky;
    top: 0;
    z-index: 4;
    padding: 12px 12px 14px;
    background:
        linear-gradient(180deg, #ffffff 0%, #f3f9fb 100%);
    border-bottom: 2px solid var(--border-light);
}

.dashboard-th-content {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #eef6f8;
    color: var(--lac-blue);
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .04em;
    line-height: 1;
    transition: all .18s ease;
}

.dashboard-th-content i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #ffffff;
    color: var(--lac-teal);
    font-size: .7rem;
    box-shadow: 0 2px 6px rgba(16, 50, 74, .12);
}

.dashboard-data-table thead th:nth-child(2) .dashboard-th-content {
    background: rgba(0, 122, 120, .12);
}

.dashboard-data-table thead th:nth-child(3) .dashboard-th-content {
    background: rgba(201, 151, 0, .14);
}

.dashboard-data-table thead th:nth-child(4) .dashboard-th-content {
    background: rgba(106, 141, 115, .16);
}

.dashboard-data-table thead th:nth-child(5) .dashboard-th-content {
    background: rgba(0, 59, 92, .12);
}

.dashboard-data-table thead th:first-child .dashboard-th-content {
    background: #e7f4f3;
    color: var(--lac-teal-dark);
}

.dashboard-data-table thead th:hover .dashboard-th-content {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(16, 50, 74, .10);
}

/*.dashboard-data-table.has-column-hover th.is-column-hover,
.dashboard-data-table.has-column-hover td.is-column-hover {
    background: #e7f4f3 !important;
}*/

.dashboard-data-table.has-column-hover th.is-column-hover .dashboard-th-content {
    background: var(--lac-teal);
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(0, 122, 120, .18);
}

.dashboard-data-table.has-column-hover th.is-column-hover .dashboard-th-content i {
    color: var(--lac-teal);
    background: #ffffff;
}

.dashboard-data-table.has-column-hover td.is-column-hover .dashboard-value-pill {
    background: var(--lac-teal);
    color: #ffffff;
}

.dashboard-mobile-section {
    display: none;
}

/* =========================================================
   KPI Status Colors
========================================================= */

.dashboard-kpi strong.is-positive {
    color: #087f5b;
}

.dashboard-kpi strong.is-negative {
    color: #c92a2a;
}

.dashboard-kpi strong.is-neutral {
    color: var(--lac-blue);
}


/* =========================================================
   Insight Text / Week Pager
========================================================= */

.dashboard-insight-card>div:last-child {
    min-width: 0;
    width: 100%;
}

#dashboardInsightText {
    margin-top: 10px;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.7;
    white-space: normal;
}

#dashboardInsightText strong {
    display: inline;
    color: var(--lac-blue);
    font-size: inherit;
    font-weight: 900;
}

.insight-pill {
    display: inline;
    padding: 2px 6px;
    margin: 0 2px;
    line-height: 1.8;
}

.dashboard-week-pager {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border: 1px solid var(--border-light);
    border-radius: 999px;
    background: #ffffff;
}

.dashboard-week-pager button {
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 999px;
    background: var(--lac-teal);
    color: #ffffff;
    cursor: pointer;
}

.dashboard-week-pager button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.dashboard-week-pager span {
    color: var(--lac-blue);
    font-size: .75rem;
    font-weight: 900;
    white-space: nowrap;
}

/* =========================================================
   Month Pager
========================================================= */

.dashboard-month-pager {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.dashboard-month-pager button {
    width: 34px;
    height: 34px;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    background: #fff;
    color: var(--lac-blue);
    cursor: pointer;
    transition: all .18s ease;
}

.dashboard-month-pager button:hover:not(:disabled) {
    background: #eef6f8;
    border-color: var(--lac-teal);
    color: var(--lac-teal);
}

.dashboard-month-pager button:disabled {
    opacity: .35;
    cursor: not-allowed;
}

/* =========================================================
   Accessibility / Motion
========================================================= */

@media (prefers-reduced-motion: reduce) {
    .dashboard-view-flipper {
        transition: none;
    }

    .dashboard-segment,
    .dashboard-control-block,
    .dashboard-view-toggle {
        transition: none;
    }
}

/* =========================================================
   Responsive: 1100px and below
========================================================= */

@media (max-width: 1100px) {
    .dashboard-insights-grid {
        grid-template-columns: 1fr 1fr;
    }

    .dashboard-insight-card {
        grid-column: 1 / -1;
    }
}

/* =========================================================
   Responsive: 985px and below
========================================================= */

@media (max-width: 985px) {
    .dashboard-control-row {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-areas:
            "year clinic"
            "service location";
        gap: 12px;
        width: 100%;
        align-items: stretch;
    }

    .dashboard-control-block {
        width: 100%;
        min-width: 0;
        min-height: 88px;
        margin: 0;
        padding: 10px;
        box-sizing: border-box;
    }

    .dashboard-control-block:nth-child(1) {
        grid-area: year;
    }

    .dashboard-control-block:nth-child(2) {
        grid-area: clinic;
    }

    .dashboard-control-block:nth-child(3) {
        grid-area: service;
    }

    .dashboard-control-block:nth-child(4) {
        grid-area: location;
    }

    .dashboard-control-row select {
        width: 100%;
        max-width: 100%;
        height: 40px;
        padding: 0 28px 0 8px;
        font-size: .75rem;
        box-sizing: border-box;
    }

    .dashboard-control-label {
        font-size: .62rem;
        text-align: center;
    }

    .dashboard-segment {
        padding: 0 8px;
        font-size: .74rem;
    }

    .dashboard-kpis-desktop {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .dashboard-view-container {
        perspective: none;
        min-height: 0;
    }

    .dashboard-chart-card .dashboard-view-container {
        min-height: 0;
    }

    .dashboard-view-flipper {
        transform: none !important;
        transition: none;
        min-height: 0;
        height: auto;
    }

    .dashboard-view {
        position: relative;
        inset: auto;
        width: 100%;
        min-height: 0;
        backface-visibility: visible;
        -webkit-backface-visibility: visible;
        transform: none !important;
    }

    .dashboard-view-chart {
        display: block;
    }

    .dashboard-view-table {
        display: none;
        overflow: visible;
    }

    .dashboard-view-container.is-flipped .dashboard-view-chart {
        display: none;
    }

    .dashboard-view-container.is-flipped .dashboard-view-table {
        display: block;
    }

    .dashboard-view-container.is-flipped {
        filter: none;
    }

    .dashboard-chart-wrap {
        min-height: 300px;
    }

    .dashboard-chart-wrap canvas {
        height: 300px !important;
    }

    .dashboard-chart-data-panel,
    .dashboard-chart-data-panel-large {
        height: auto;
        max-height: 380px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .dashboard-table-topbar {
        position: sticky;
        top: 0;
        z-index: 2;
        background: #ffffff;
    }

    .dashboard-table-summary {
        white-space: normal;
    }

    .dashboard-data-card-grid {
        grid-template-columns: 1fr;
        padding: 12px;
    }

    .dashboard-data-total-card {
        margin: 0 12px 12px;
    }

    .dashboard-view-toggle {
        border-radius: 12px;
        background: #eef6f8;
    }

    .dashboard-view-toggle[aria-expanded="true"] {
        background: var(--lac-teal);
        color: #ffffff;
    }

    .dashboard-chart-actions {
        display: grid;
        grid-template-columns: auto auto auto;
        justify-content: center;
    }

    .dashboard-control-row {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .dashboard-control-block {
        width: 100%;
        min-width: 0;
    }

    .dashboard-chart-select {
        width: 100%;
    }

    #metricFamilyButtons {
        display: none !important;
    }

    .dashboard-metric-dropdown {
        display: block !important;
        width: 100%;
    }
}

@media (max-width: 740px) {

    #filterServiceType {
        font-size: 0.75rem;
    }

    #filterServiceType option[value="all"] {
        content: "All Services";
    }

    .dashboard-control-label {
        font-size: 0.68rem;
    }
}

@media (max-width: 700px) {
    .dashboard-chart-actions {
        width: 100%;
        max-width: 100%;
        display: grid;
        grid-template-columns: 1fr;
        justify-content: stretch;
        gap: 10px;
        overflow: hidden;
    }

    .dashboard-chart-badge,
    .dashboard-view-toggle,
    .dashboard-range-stack,
    .dashboard-week-pager {
        width: 100%;
        max-width: 100%;
        grid-column: 1;
        justify-content: center;
        box-sizing: border-box;
    }

    .dashboard-chart-badge {
        min-height: 44px;
        padding: 10px 12px;
        white-space: normal;
        text-align: center;
        line-height: 1.25;
        overflow-wrap: anywhere;
    }

    .dashboard-view-toggle {
        min-height: 44px;
        padding: 10px 12px;
    }

    .dashboard-chart-range-control {
        width: 100%;
        min-height: 44px;
        justify-content: center;
        box-sizing: border-box;
        padding: 8px 10px;
    }

    .dashboard-chart-range-control .dashboard-range-select {
        min-width: 110px;
        height: 38px;
        font-size: .78rem;
    }

    .dashboard-month-pager {
        width: 100%;
        min-height: 40px;
        justify-content: center;
    }

    .dashboard-month-pager button,
    .dashboard-week-pager button {
        width: 38px;
        height: 38px;
    }

    .dashboard-week-pager {
        min-height: 44px;
        padding: 6px 10px;
        overflow: hidden;
    }

    #waitTimeWeekPagerLabel {
        white-space: normal;
        text-align: center;
    }
}

/* =========================================================
   Responsive: 600px and below
========================================================= */

@media (max-width: 600px) {
    .dashboard-section {
        margin: 20px 0 30px;
    }

    .dashboard-hero,
    .dashboard-toolbar,
    .dashboard-kpis {
        padding: 20px;
    }

    .dashboard-hero {
        flex-direction: column;
        gap: 16px;
    }

    .dashboard-hero h2 {
        font-size: 1.45rem;
    }

    .dashboard-title-icon {
        width: 36px;
        height: 36px;
    }

    .dashboard-kpis-desktop {
        display: none;
    }

    .dashboard-kpis-mobile {
        display: grid;
    }


    .dashboard-insights-grid {
        display: grid;
        grid-template-columns: 1fr;
        padding: 0 20px 20px;
    }

    .dashboard-insight-card {
        flex-direction: column;
    }

    .dashboard-mini-chart-card {
        padding: 16px;
    }

    .dashboard-mobile-section {
        display: block;
        padding: 0 20px 16px;
    }

    .dashboard-mobile-data-list {
        display: none !important;
    }

    .dashboard-mini-chart-wrap {
        display: block !important;
        min-height: 250px;
    }

    .dashboard-mini-chart-wrap canvas {
        width: 100% !important;
        height: 250px !important;
    }
}

/* =========================================================
   Responsive: 520px and below
========================================================= */

@media (max-width: 520px) {
    .dashboard-section {
        margin: 12px 0 24px;
    }

    .dashboard-shell {
        border-radius: 14px;
    }

    .dashboard-hero {
        padding: 18px 16px;
    }

    .dashboard-hero h2 {
        display: grid;
        grid-template-columns: 36px 1fr;
        gap: 10px;
        font-size: 1.2rem;
    }

    .dashboard-hero p,
    .dashboard-chart-header p {
        font-size: .82rem;
    }

    .dashboard-toolbar,
    .dashboard-kpis,
    .dashboard-insights-grid {
        padding-inline: 12px;
    }

    .dashboard-control-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) !important;
        grid-template-areas:
            "year"
            "clinic"
            "service"
            "location";
        gap: 10px;
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }

    .dashboard-control-block:nth-child(1) {
        grid-area: year;
    }

    .dashboard-control-block:nth-child(2) {
        grid-area: clinic;
    }

    .dashboard-control-block:nth-child(3) {
        grid-area: service;
    }

    .dashboard-control-block:nth-child(4) {
        grid-area: location;
    }

    .dashboard-control-block,
    .dashboard-control-row .dashboard-control-block,
    .dashboard-location-filter {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        min-height: 68px;
        margin: 0;
        padding: 10px;
        box-sizing: border-box;
        justify-self: stretch;
    }

    .dashboard-chart-select,
    .dashboard-metric-dropdown,
    .dashboard-location-filter select,
    #metricFamilyDropdown,
    #filterHealthCenter {
        display: block;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        height: 40px;
        box-sizing: border-box;
    }

    #metricFamilyButtons {
        display: none !important;
    }

    .dashboard-metric-dropdown {
        display: block !important;
    }

    .dashboard-btn-icon {
        display: none;
    }

    .dashboard-kpi {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 4px 12px;
        padding: 14px;
    }

    .dashboard-kpi-icon {
        position: static;
        grid-row: 1 / 4;
        grid-column: 2;
        align-self: center;
        font-size: 1.15rem;
        opacity: .32;
    }

    .dashboard-kpi span,
    .dashboard-kpi strong,
    .dashboard-kpi small {
        grid-column: 1;
    }

    .dashboard-insights-grid {
        gap: 14px;
        padding-bottom: 18px;
    }

    .dashboard-mini-chart-card {
        padding: 14px;
    }

    .dashboard-mini-chart-header {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .dashboard-chart-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .dashboard-mobile-data-list {
        margin-inline: 12px;
    }
}

@media (max-width: 480px) {
    .dashboard-data-total-card>strong {
        text-align: center;
    }

    .dashboard-chart-card {
        margin: 0 6px 18px;
        padding: 14px 6px;
    }

    .dashboard-chart-wrap {
        min-height: 360px;
        padding: 8px 4px 0;
    }

    .dashboard-chart-wrap canvas {
        height: 360px !important;
    }

    .dashboard-chart-header {
        gap: 10px;
    }

    .dashboard-chart-actions {
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }

    .dashboard-chart-badge,
    .dashboard-view-toggle {
        justify-content: center;
    }
}

/* =========================================================
   Responsive: 420px and below
========================================================= */

@media (max-width: 420px) {
    .dashboard-hero h2 {
        font-size: 1.25rem;
    }

    .dashboard-kpi {
        padding: 16px;
    }
}