/* =========================================================
   TrackServe - Summary Reports & Analytics Stylesheet
   ========================================================= */

/* Module Quick-Hub Navigation Bar */
.reports-module-hub {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 12px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(20, 45, 90, 0.04);
}

.module-hub-label {
    font-size: 11px;
    font-weight: 800;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-right: 4px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.module-hub-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 700;
    text-decoration: none;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #334155;
    transition: all 0.15s ease;
}

.module-hub-chip:hover {
    background: #eff6ff;
    border-color: #93c5fd;
    color: var(--primary);
    transform: translateY(-1px);
}

.module-hub-chip .chip-count {
    background: #e2e8f0;
    color: #0f172a;
    font-size: 10px;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 10px;
}

.module-hub-chip:hover .chip-count {
    background: #bfdbfe;
    color: #1e40af;
}

/* Desktop Horizontal Layout for Summary Stats & Filters */
.reports-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.stat-card.stat-rate {
    border-top: 4px solid #10b981;
}
.stat-card.stat-rate .stat-icon {
    background: #ecfdf5;
    color: #059669;
}

.stat-card.stat-planned {
    border-top: 4px solid #f59e0b;
}
.stat-card.stat-planned .stat-icon {
    background: #fffbeb;
    color: #d97706;
}

.stat-card.stat-beneficiaries {
    border-top: 4px solid #3b82f6;
}
.stat-card.stat-beneficiaries .stat-icon {
    background: #eff6ff;
    color: #2563eb;
}

/* Report Navigation Tabs */
.report-tabs-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(20, 45, 90, 0.04);
    overflow: hidden;
}

.report-tabs-header {
    display: flex;
    gap: 4px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 6px 10px 0 10px;
    overflow-x: auto;
}

.report-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    background: transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.report-tab-btn:hover {
    color: #1e293b;
    background: #f1f5f9;
}

.report-tab-btn.active {
    color: var(--primary);
    background: #ffffff;
    border-color: #e2e8f0;
    border-bottom: 2px solid #ffffff;
    margin-bottom: -1px;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.02);
}

.report-tab-badge {
    background: #e2e8f0;
    color: #475569;
    font-size: 10px;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 10px;
}

.report-tab-btn.active .report-tab-badge {
    background: #dbeafe;
    color: #1e40af;
}

/* Referred vs. Served Visual Analytics Section */
.comparison-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    margin-bottom: 18px;
}

.comparison-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(20, 45, 90, 0.04);
}

.comparison-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f3f8;
    flex-wrap: wrap;
    gap: 8px;
}

.comparison-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 800;
    color: #17233c;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Comparative Bar Item */
.comp-bar-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.comp-bar-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #fafbfc;
    border: 1px solid #f1f5f9;
    transition: background 0.12s ease;
}

.comp-bar-item:hover {
    background: #f1f5f9;
    border-color: #e2e8f0;
}

.comp-bar-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    font-weight: 700;
    color: #334155;
}

.comp-bar-track {
    height: 10px;
    background: #e2e8f0;
    border-radius: 5px;
    overflow: hidden;
    display: flex;
    position: relative;
}

.comp-bar-segment.served {
    background: #10b981;
    height: 100%;
    transition: width 0.4s ease;
}

.comp-bar-segment.referred {
    background: #0284c7;
    height: 100%;
    transition: width 0.4s ease;
}

.comp-bar-segment.planned {
    background: #f59e0b;
    height: 100%;
    transition: width 0.4s ease;
}

.comp-bar-legend-inline {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    font-size: 11px;
    color: #64748b;
}

.legend-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 4px;
}

.legend-dot.served { background: #10b981; }
.legend-dot.referred { background: #0284c7; }
.legend-dot.planned { background: #f59e0b; }

/* Conversion KPI Pill */
.rate-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 800;
}

.rate-pill.high { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.rate-pill.medium { background: #fff8e6; color: #b45309; border: 1px solid #fde68a; }
.rate-pill.low { background: #fee2e2; color: #dc2626; border: 1px solid #fca5a5; }

/* IPCRF Summary Table */
.ipcrf-table-card {
    margin-bottom: 20px;
}

.ipcrf-table {
    width: 100%;
    border-collapse: collapse;
}

.ipcrf-table th {
    background: #f8fafc;
    color: #334155;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 10px 14px;
    border-bottom: 2px solid #cbd5e1;
    text-align: left;
}

.ipcrf-table td {
    padding: 10px 14px;
    border-bottom: 1px solid #edf2f7;
    font-size: 12.5px;
    vertical-align: middle;
}

.ipcrf-table tr.total-row {
    background: #f1f5f9;
    font-weight: 900;
    border-top: 2px solid #94a3b8;
}

.sector-grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
    padding: 16px;
}

.sector-card-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    padding: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.sector-card-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.sector-card-title strong {
    font-size: 13px;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sector-kpi-row {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #64748b;
    margin-bottom: 8px;
}

/* Printable IPCRF Report Sheet */
.ipcrf-print-sheet {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    padding: 36px 42px;
    max-width: 880px;
    margin: 0 auto;
    font-family: 'Segoe UI', Arial, sans-serif;
    color: #0f172a;
    line-height: 1.4;
}

@media print {
    body * {
        visibility: hidden;
    }
    .ipcrf-print-sheet, .ipcrf-print-sheet * {
        visibility: visible;
    }
    .ipcrf-print-sheet {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        margin: 0;
        padding: 20px;
        border: none;
        box-shadow: none;
    }
    .slip-modal-header, .slip-modal-footer, .side-panel-backdrop, .app-shell {
        display: none !important;
    }
}

/* =========================================================
   Reports Module Mobile Responsiveness (max-width: 900px)
   ========================================================= */
@media (max-width: 900px) {
    .reports-module-hub {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        gap: 8px !important;
        overflow: visible !important;
        white-space: normal !important;
        padding: 10px 12px !important;
        box-sizing: border-box !important;
    }

    .module-hub-label {
        width: 100% !important;
        margin-bottom: 2px !important;
        font-size: 11.5px !important;
    }

    .module-hub-chip {
        display: flex !important;
        width: 100% !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 9px 12px !important;
        font-size: 12.5px !important;
        box-sizing: border-box !important;
        border-radius: 8px !important;
    }

    .module-hub-chip .chip-count {
        margin-left: auto !important;
    }
}


