@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --saffron: #ff9933;
    --india-green: #138808;
    --navy: #0b1f4a;
    --royal-blue: #1d4ed8;
    --panel-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
}

html, body {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    color: var(--text-main);
    background: #f0f4fa;
}

.gov-stripe {
    height: 5px;
    background: linear-gradient(90deg, var(--saffron) 33%, #ffffff 33%, #ffffff 66%, var(--india-green) 66%);
}

.sidebar {
    background: linear-gradient(180deg, #0b1f4a 0%, #122b5c 55%, #0f2347 100%);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.topbar-brand-block {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.gov-emblem {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, #fff7ed, #ffedd5);
    display: grid;
    place-items: center;
    font-size: 1.6rem;
    box-shadow: 0 4px 14px rgba(255, 153, 51, 0.25);
}

.meta-pill {
    background: linear-gradient(135deg, #fff7ed, #dcfce7);
    color: #7c2d12;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    border: 1px solid #fed7aa;
}

.hero-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-radius: 18px;
    margin-bottom: 1.25rem;
    background: linear-gradient(135deg, #1d4ed8, #2563eb 45%, #38bdf8);
    color: white;
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.25);
}

.hero-banner h2 {
    margin: 0;
    font-size: 1.55rem;
    font-weight: 800;
}

.hero-banner p {
    margin: 0.35rem 0 0;
    opacity: 0.92;
}

.hero-orange { background: linear-gradient(135deg, #ea580c, #f97316, #fb923c); box-shadow: 0 12px 30px rgba(234, 88, 12, 0.25); }
.hero-green { background: linear-gradient(135deg, #15803d, #16a34a, #22c55e); box-shadow: 0 12px 30px rgba(22, 163, 74, 0.25); }
.hero-blue { background: linear-gradient(135deg, #1e3a8a, #1d4ed8, #3b82f6); }
.hero-purple { background: linear-gradient(135deg, #6d28d9, #7c3aed, #a78bfa); box-shadow: 0 12px 30px rgba(124, 58, 237, 0.25); }

.btn-gov {
    background: linear-gradient(135deg, var(--saffron), #fb923c);
    color: #fff;
    border: none;
    font-weight: 700;
    padding: 0.55rem 1.1rem;
    border-radius: 10px;
    box-shadow: 0 6px 16px rgba(255, 153, 51, 0.35);
}

.btn-gov:hover { color: #fff; filter: brightness(1.05); }

.btn-gov-outline {
    background: rgba(255,255,255,0.15);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.45);
    font-weight: 600;
    border-radius: 10px;
}

.btn-gov-outline:hover { background: rgba(255,255,255,0.25); color: #fff; }

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.page-header h2 {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--navy);
}

.page-header p {
    margin: 0.35rem 0 0;
    color: var(--text-muted);
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.stat-card {
    background: var(--panel-bg);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 1.1rem 1.2rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
}

.card-saffron::before { background: linear-gradient(90deg, var(--saffron), #fdba74); }
.card-blue::before { background: linear-gradient(90deg, #1d4ed8, #60a5fa); }
.card-green::before { background: linear-gradient(90deg, var(--india-green), #4ade80); }
.card-purple::before { background: linear-gradient(90deg, #7c3aed, #c4b5fd); }
.card-orange::before { background: linear-gradient(90deg, #ea580c, #fdba74); }
.card-indigo::before { background: linear-gradient(90deg, #4338ca, #818cf8); }

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-size: 1.4rem;
    background: #eff6ff;
}

.stat-label { color: var(--text-muted); font-size: 0.85rem; font-weight: 600; }
.stat-value { font-size: 1.65rem; font-weight: 800; line-height: 1.2; }
.stat-subtitle { color: var(--text-muted); font-size: 0.8rem; }

.type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.type-card {
    background: white;
    border-radius: 18px;
    padding: 1rem;
    border: 1px solid var(--border);
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
    position: relative;
    overflow: hidden;
}

.type-card::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    background: var(--type-color);
}

.type-card-icon { font-size: 1.6rem; margin-bottom: 0.5rem; }
.type-card-label { color: var(--text-muted); font-size: 0.82rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.type-card-value { font-size: 1.55rem; font-weight: 800; color: var(--type-color); }
.type-card-pct { color: var(--text-muted); font-size: 0.8rem; }
.type-card-bar { height: 6px; background: #e2e8f0; border-radius: 999px; margin-top: 0.75rem; overflow: hidden; }
.type-card-bar-fill { height: 100%; background: var(--type-color); border-radius: 999px; }

.dashboard-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 1rem;
}

.panel {
    background: var(--panel-bg);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 1.2rem;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.panel-wide, .panel-chart { grid-column: 1 / -1; }

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.panel-header h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--navy);
}

.chart-box { height: 300px; position: relative; }

.dashboard-table { margin-bottom: 0; }
.dashboard-table thead th {
    background: linear-gradient(180deg, #f8fafc, #f1f5f9);
    color: #475569;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid #dbeafe;
}
.dashboard-table tbody td { vertical-align: middle; border-color: #f1f5f9; }
.dashboard-table tbody tr:hover { background: #f8fbff; }

.type-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.22rem 0.55rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
}

.type-opd { background: #dbeafe; color: #1d4ed8; }
.type-ipd { background: #ffedd5; color: #c2410c; }
.type-discharge { background: #dcfce7; color: #15803d; }
.type-facility { background: #ede9fe; color: #6d28d9; }
.type-lab { background: #ccfbf1; color: #0f766e; }

.rank-badge {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-weight: 800;
    font-size: 0.82rem;
    background: #e2e8f0;
    color: #334155;
}

.rank-1 { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #78350f; }
.rank-2 { background: linear-gradient(135deg, #d1d5db, #9ca3af); color: #1f2937; }
.rank-3 { background: linear-gradient(135deg, #fdba74, #fb923c); color: #7c2d12; }

.share-bar, .perf-bar-track {
    height: 8px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}

.share-bar-fill, .perf-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #1d4ed8, #38bdf8);
}

.perf-bar-row { margin-bottom: 0.85rem; }
.perf-bar-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.3rem;
    font-size: 0.88rem;
}

.dept-list { display: flex; flex-direction: column; gap: 0.2rem; }

.filter-bar {
    display: grid;
    grid-template-columns: 2fr auto;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.filter-bar-4 { grid-template-columns: 1fr 1fr auto; }

.performance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

.perf-card {
    background: white;
    border-radius: 18px;
    padding: 1rem;
    border: 1px solid var(--border);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.perf-rank-1 { border-top: 5px solid #f59e0b; }
.perf-rank-2 { border-top: 5px solid #9ca3af; }
.perf-rank-3 { border-top: 5px solid #fb923c; }

.perf-card-top {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.9rem;
}

.perf-rank {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #eff6ff;
    color: #1d4ed8;
    display: grid;
    place-items: center;
    font-weight: 800;
}

.perf-card-top h4 { margin: 0; font-size: 1rem; }
.perf-share {
    margin-left: auto;
    background: #dbeafe;
    color: #1d4ed8;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    font-weight: 800;
    font-size: 0.82rem;
}

.perf-totals {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 0.9rem;
}

.perf-totals span { display: block; color: var(--text-muted); font-size: 0.78rem; }
.perf-totals strong { font-size: 1.1rem; }

.perf-types {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.4rem;
    margin-bottom: 0.9rem;
}

.mini-type {
    text-align: center;
    padding: 0.45rem 0.25rem;
    border-radius: 10px;
    font-size: 0.72rem;
}

.mini-type span { display: block; font-weight: 700; }
.mini-type strong { display: block; font-size: 0.85rem; }
.mini-type.opd { background: #dbeafe; color: #1d4ed8; }
.mini-type.ipd { background: #ffedd5; color: #c2410c; }
.mini-type.discharge { background: #dcfce7; color: #15803d; }
.mini-type.facility { background: #ede9fe; color: #6d28d9; }
.mini-type.lab { background: #ccfbf1; color: #0f766e; }

.perf-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.detail-list {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 0.65rem 1rem;
    margin: 0;
}

.detail-list dt { color: var(--text-muted); font-weight: 600; }
.detail-list dd { margin: 0; }

.loading-panel {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 2rem;
    background: white;
    border-radius: 18px;
    border: 1px solid var(--border);
}

.dashboard-alert { border-radius: 12px; }
.pager { display: flex; align-items: center; gap: 0.75rem; margin-top: 1rem; }

@media (max-width: 1200px) {
    .dashboard-grid { grid-template-columns: 1fr; }
    .filter-bar, .filter-bar-4 { grid-template-columns: 1fr; }
    .perf-types { grid-template-columns: repeat(3, 1fr); }
}
