﻿/* =============================================================
   ClinicalInsights.razor.css
   Navy #1e2d4a  |  Gold #e6a817  |  Page bg #ffffff
   Mirrors the RCM Insights layout patterns
   ============================================================= */

/* ── Outer wrapper ───────────────────────────────────────── */
.ci-outer {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: #ffffff;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    padding: 16px;
    box-sizing: border-box;
}

/* ── Title row ───────────────────────────────────────────── */
.ci-title-row {
    display: flex;
    align-items: flex-end;
    padding: 0 0 10px 0;
    background: #ffffff;
    flex-shrink: 0;
}

.ci-page-title {
    font-size: 17px;
    font-weight: 700;
    color: #1e2d4a;
    margin: 0;
    padding-bottom: 8px;
    width: 220px;
    border-bottom: 2px solid #e6a817;
    display: block;
    text-align: left;
    line-height: 1.3;
    box-sizing: border-box;
}

/* ── Body row ────────────────────────────────────────────── */
.ci-wrap {
    display: flex;
    flex: 1;
}

/* ══════════════════════════════════════════════════════════
   SIDEBAR
   ══════════════════════════════════════════════════════════ */
.ci-sidebar {
    width: 220px;
    min-width: 220px;
    background: #1e2d4a;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

/* Active Census block */
.ci-kpi-block {
    background: #1e2d4a;
    text-align: center;
    height: 90px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ci-kpi-label {
    font-size: 11px;
    font-weight: 400;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 4px;
}

.ci-kpi-value {
    font-size: 36px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1;
}

/* Filters card */
.ci-filters-card {
    background: #f3f4f6;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px 14px;
}

.ci-filter-block {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.ci-label {
    font-size: 10px;
    font-weight: 400;
    color: #374151;
    margin-bottom: 2px;
}

/* Date range picker */
::deep .sf-ci-daterange.e-input-group,
::deep .sf-ci-daterange.e-control-wrapper {
    background: #ffffff !important;
    border: 1px solid #d1d5db !important;
    border-radius: 3px !important;
    padding: 2px 6px !important;
    box-shadow: none !important;
}

::deep .sf-ci-daterange .e-input,
::deep .sf-ci-daterange input {
    color: #111827 !important;
    font-size: 11px !important;
    background: transparent !important;
    font-family: 'Segoe UI', system-ui !important;
    padding: 0 !important;
}

::deep .sf-ci-daterange .e-input-group-icon {
    color: #6b7280 !important;
    font-size: 12px !important;
}

/* Facility select */
.ci-select {
    width: 100%;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 3px;
    padding: 5px 8px;
    font-size: 12px;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: #111827;
    cursor: pointer;
    outline: none;
}

    .ci-select:focus {
        border-color: #e6a817;
    }

/* ══════════════════════════════════════════════════════════
   MAIN CONTENT
   ══════════════════════════════════════════════════════════ */
.ci-main {
    flex: 1;
    padding: 0;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: #ffffff;
}

/* ══════════════════════════════════════════════════════════
   KPI BANNER — same height as ci-kpi-block
   ══════════════════════════════════════════════════════════ */
.ci-kpi-banner {
    display: flex;
    align-items: center;
    background: #f3f4f6;
    height: 90px;
    padding: 0 24px;
    gap: 0;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.ci-kpi-tile {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    padding: 0 20px 0 0;
    min-width: 0;
}

    .ci-kpi-tile:first-child {
        padding-left: 0;
    }

.ci-kpi-divider {
    width: 1px;
    height: 44px;
    background: #d1d5db;
    flex-shrink: 0;
    margin-right: 20px;
}

.ci-kpi-icon {
    width: 50px;
    height: 50px;
    min-width: 50px;
    border-radius: 50%;
    background: #111827;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ci-kpi-svg {
    width: 24px;
    height: 24px;
}

.ci-kpi-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.ci-kpi-num {
    font-size: 22px;
    font-weight: 700;
    color: #111827;
    line-height: 1.2;
    white-space: nowrap;
}

.ci-kpi-lbl {
    font-size: 13px;
    color: #374151;
    font-weight: 400;
}

/* ══════════════════════════════════════════════════════════
   CHARTS AREA — 2 rows of 3
   ══════════════════════════════════════════════════════════ */
.ci-charts-area {
    flex: 1;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: #ffffff;
}

.ci-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #6b7280;
    font-size: 14px;
}

.ci-chart-row {
    display: flex;
    gap: 14px;
}

.ci-chart-card {
    flex: 1;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    padding: 14px 16px 10px;
    min-width: 0;
}

/* Gold underline title */
.ci-chart-title {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 2px solid #e6a817;
    display: inline-block;
}

/* ══════════════════════════════════════════════════════════
   SYNCFUSION OVERRIDES
   ══════════════════════════════════════════════════════════ */
::deep .e-chart-legend-text {
    font-family: 'Segoe UI', system-ui !important;
}

::deep .e-tooltip-wrap .e-tip-content {
    font-family: 'Segoe UI', system-ui !important;
    font-size: 12px !important;
}

::deep .e-tooltip-wrap {
    border-radius: 5px !important;
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════ */
@media (max-width: 1100px) {
    .ci-chart-row {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .ci-wrap {
        flex-direction: column;
    }

    .ci-sidebar {
        width: 100%;
    }

    .ci-kpi-banner {
        height: auto;
        flex-wrap: wrap;
        gap: 12px;
        padding: 16px;
    }

    .ci-kpi-tile {
        flex: 1 1 40%;
    }

    .ci-kpi-divider {
        display: none;
    }
}

/* ── Clickable KPI numbers ───────────────────────────────── */
.ci-clickable {
    cursor: pointer;
    transition: opacity .15s;
}

    .ci-clickable:hover {
        opacity: 0.75;
        text-decoration: underline;
    }

.ci-kpi-block.ci-clickable:hover {
    background: #162138;
    text-decoration: none;
    opacity: 1;
}

/* ── Chart title row with View Details button ─────────── */
.ci-chart-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 2px solid #e6a817;
}

/* ── Active filter chips ─────────────────────────────── */
.active-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #1e2d4a;
    color: #ffffff;
    border-radius: 20px;
    padding: 4px 12px 4px 14px;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 8px;
    margin-right: 6px;
}

    .active-filter-chip strong {
        color: #e6a817;
    }

.chip-clear {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 14px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

    .chip-clear:hover {
        color: #fff;
    }
