﻿/* =============================================================
   RcmInsights.razor.css
   Navy #1e2d4a  |  Gold #e6a817  |  Page bg #ffffff
   ============================================================= */

/* ── Outermost wrapper: white page padding ───────────────── */
.rcm-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;
    gap: 0;
}

/* ══════════════════════════════════════════════════════════
   TITLE ROW — sits above blue box + grey bar, full width
   Gold underline is exactly as wide as the sidebar (220px)
   so it aligns perfectly with the left edge of the blue box
   ══════════════════════════════════════════════════════════ */
.rcm-title-row {
    display: flex;
    align-items: flex-end;
    padding: 0 0 10px 0; /* 10px gap between gold bar and blue box */
    background: #ffffff;
    flex-shrink: 0;
}

.rcm-page-title {
    font-size: 17px;
    font-weight: 700;
    color: #1e2d4a;
    margin: 0;
    padding-bottom: 8px;
    /* Gold underline = sidebar width exactly */
    width: 220px;
    border-bottom: 2px solid #e6a817;
    display: block;
    text-align: left;
    line-height: 1.3;
    box-sizing: border-box;
}

/* ══════════════════════════════════════════════════════════
   CONTENT ROW: blue box + grey KPI bar side by side
   ══════════════════════════════════════════════════════════ */
.rcm-wrap {
    display: flex;
    flex: 1;
}

/* ══════════════════════════════════════════════════════════
   SIDEBAR
   ══════════════════════════════════════════════════════════ */
.rcm-sidebar {
    width: 220px;
    min-width: 220px;
    background: #1e2d4a;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

/* ── Total Claims navy block — same height as .kpi-banner ── */
.sidebar-kpi-block {
    background: #1e2d4a;
    text-align: center;
    height: 90px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-kpi-label {
    font-size: 11px;
    font-weight: 400;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 4px;
}

.sidebar-kpi-value {
    font-size: 36px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1;
}

/* ── Filters card: light grey ── */
.sidebar-filters-card {
    background: #f3f4f6;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px 14px;
}

.sidebar-filter-block {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.sidebar-label {
    font-size: 10px;
    font-weight: 400;
    color: #374151;
    margin-bottom: 2px;
}

/* Date range picker */
::deep .sf-sidebar-daterange.e-input-group,
::deep .sf-sidebar-daterange.e-control-wrapper {
    background: #ffffff !important;
    border: 1px solid #d1d5db !important;
    border-radius: 3px !important;
    padding: 3px 8px !important;
    box-shadow: none !important;
    width: 100% !important;
}

::deep .sf-sidebar-daterange .e-input,
::deep .sf-sidebar-daterange input {
    color: #111827 !important;
    font-size: 11px !important;
    background: transparent !important;
    font-family: 'Segoe UI', system-ui !important;
}

::deep .sf-sidebar-daterange .e-input-group-icon,
::deep .sf-sidebar-daterange .e-range-icon {
    color: #6b7280 !important;
    font-size: 13px !important;
}

/* Facility native select */
.rcm-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;
    appearance: auto;
    box-shadow: none;
    outline: none;
}

    .rcm-select:focus {
        border-color: #e6a817;
        outline: none;
    }

/* ══════════════════════════════════════════════════════════
   MAIN CONTENT
   ══════════════════════════════════════════════════════════ */
.rcm-main {
    flex: 1;
    padding: 0;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
    background: #ffffff;
}

/* ══════════════════════════════════════════════════════════
   KPI BANNER — grey, exact same height as sidebar-kpi-block
   ══════════════════════════════════════════════════════════ */
.kpi-banner {
    display: flex;
    align-items: center;
    background: #f3f4f6;
    height: 90px;
    padding: 0 20px;
    gap: 0;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.kpi-tile {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    padding: 0 20px 0 0;
    min-width: 0;
}

    .kpi-tile:first-child {
        padding-left: 0;
    }

.kpi-gold-bar {
    width: 4px;
    min-width: 4px;
    height: 48px;
    background: #e6a817;
    border-radius: 2px;
    flex-shrink: 0;
}

.kpi-icon-wrap {
    width: 50px;
    height: 50px;
    min-width: 50px;
    border-radius: 50%;
    background: #111827;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.kpi-svg {
    width: 24px;
    height: 24px;
}

.kpi-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.kpi-amount {
    font-size: 22px;
    font-weight: 700;
    color: #111827;
    line-height: 1.2;
    white-space: nowrap;
}

.kpi-label {
    font-size: 13px;
    color: #374151;
    font-weight: 400;
}

/* Active filter chip */
.active-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #1e2d4a;
    color: #fff;
    font-size: 12px;
    border-radius: 20px;
    padding: 4px 12px 4px 14px;
    margin-left: 10px;
}

    .active-filter-chip strong {
        color: #e6a817;
    }

.chip-clear {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 13px;
    padding: 0 2px;
    line-height: 1;
}

    .chip-clear:hover {
        color: #fff;
    }

/* ══════════════════════════════════════════════════════════
   CHARTS AREA
   ══════════════════════════════════════════════════════════ */
.charts-area {
    flex: 1;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: #ffffff;
}

.chart-row {
    display: flex;
    gap: 14px;
}

.chart-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    padding: 14px 16px 10px;
    min-width: 0;
}

    .chart-card.wide {
        flex: 2;
    }

    .chart-card.narrow {
        flex: 1;
    }

    .chart-card.half {
        flex: 1;
    }

.chart-card-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,
::deep .e-accumulation-chart-legend text {
    font-family: 'Segoe UI', system-ui !important;
    font-size: 11px !important;
    fill: #374151 !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: 1024px) {
    .chart-row {
        flex-direction: column;
    }

    .chart-card {
        flex: unset;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .rcm-outer {
        padding: 8px;
    }

    .rcm-wrap {
        flex-direction: column;
    }

    .rcm-sidebar {
        width: 100%;
    }

    .kpi-banner {
        height: auto;
        flex-wrap: wrap;
        gap: 12px;
        padding: 16px;
    }

    .sidebar-kpi-block {
        height: auto;
        padding: 16px;
    }

    .kpi-tile {
        flex: 1 1 40%;
    }
}

/* ══════════════════════════════════════════════════════════
   DRILL-THROUGH MODAL
   ══════════════════════════════════════════════════════════ */
.drill-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.drill-modal {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    width: 92vw;
    max-width: 1200px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.drill-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #1e2d4a;
    color: #ffffff;
    flex-shrink: 0;
}

.drill-modal-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    font-weight: 700;
}

.drill-context-badge {
    background: rgba(230, 168, 23, 0.25);
    color: #e6a817;
    border: 1px solid #e6a817;
    border-radius: 12px;
    padding: 2px 10px;
    font-size: 12px;
    font-weight: 600;
}

.drill-modal-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.drill-export-btn {
    background: #e6a817;
    color: #1e2d4a;
    border: none;
    border-radius: 5px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s;
}

    .drill-export-btn:hover {
        background: #d49914;
    }

.drill-close-btn {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 18px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

    .drill-close-btn:hover {
        color: #ffffff;
    }

.drill-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
    color: #6b7280;
    font-size: 14px;
}

/* Syncfusion grid inside modal */
.drill-modal ::deep .e-grid {
    border: none !important;
    font-family: 'Segoe UI', system-ui !important;
}

.drill-modal ::deep .e-headercell {
    background: #f3f4f6 !important;
    color: #1e2d4a !important;
    font-weight: 700 !important;
}

.drill-modal ::deep .e-rowcell {
    font-size: 13px !important;
}

/* ── Chart card title row with View Details button ── */
.chart-card-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 2px solid #e6a817;
}

.chart-detail-btn {
    background: none;
    border: 1px solid #e6a817;
    border-radius: 4px;
    color: #e6a817;
    font-size: 11px;
    font-weight: 600;
    font-family: 'Segoe UI', system-ui;
    padding: 3px 10px;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, color .15s;
}

    .chart-detail-btn:hover {
        background: #e6a817;
        color: #1e2d4a;
    }
