/* ===== Jal Ganga Samvardhan Dashboard - Premium Dark Theme v2 ===== */

/* --- CSS Variables --- */
:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-card: rgba(17, 24, 39, 0.85);
    --bg-glass: rgba(255, 255, 255, 0.04);
    --border-glass: rgba(255, 255, 255, 0.08);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent-blue: #3b82f6;
    --accent-teal: #14b8a6;
    --accent-green: #22c55e;
    --accent-emerald: #10b981;
    --accent-purple: #8b5cf6;
    --accent-orange: #f59e0b;
    --accent-red: #ef4444;
    --accent-cyan: #06b6d4;
    --accent-pink: #ec4899;
    --gradient-water: linear-gradient(135deg, #0c4a6e 0%, #0e7490 50%, #14b8a6 100%);
    --gradient-hero: linear-gradient(135deg, #0f172a 0%, #0c4a6e 40%, #134e4a 100%);
    --gradient-card: linear-gradient(145deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.9));
    --shadow-glow: 0 0 30px rgba(14, 116, 144, 0.15);
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3);
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Outfit', 'Inter', sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Reset --- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* --- Animated Water Background --- */
.water-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.wave {
    position: absolute;
    bottom: -10%;
    width: 200%;
    height: 300px;
    border-radius: 45%;
    opacity: 0.06;
}

.wave1 {
    background: var(--accent-teal);
    animation: wave 12s ease-in-out infinite;
    left: -50%;
}

.wave2 {
    background: var(--accent-blue);
    animation: wave 15s ease-in-out infinite reverse;
    left: -30%;
    bottom: -15%;
}

.wave3 {
    background: var(--accent-cyan);
    animation: wave 18s ease-in-out infinite;
    left: -60%;
    bottom: -20%;
}

@keyframes wave {

    0%,
    100% {
        transform: rotate(0deg) translateY(0);
    }

    25% {
        transform: rotate(2deg) translateY(-20px);
    }

    50% {
        transform: rotate(-1deg) translateY(10px);
    }

    75% {
        transform: rotate(1deg) translateY(-15px);
    }
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes droplet {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(1.3);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =============================== */
/*        LANDING PAGE              */
/* =============================== */

.landing-page {
    background: var(--gradient-hero);
}

/* --- Standardized Header & Navbar (Two Rows) --- */
.main-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
}

.header-top-bar {
    background: rgba(10, 14, 26, 0.95);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--border-glass);
    padding: 12px 40px;

}

.header-nav-bar {
    backdrop-filter: blur(29px);
    border-bottom: none;
    /* Removed border for better blending */
    padding: 8px 40px;
    transition: all 0.3s ease;
}

.header-nav-bar.nav-transparent {
    background: transparent !important;
    backdrop-filter: none !important;
    border-bottom: none !important;
    padding: 0 40px !important;
}

.header-inner {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-nav-bar .header-inner {
    justify-content: center;
    position: relative;
}

.premium-navbar {
    display: flex;
    align-items: center;
    gap: 16px;
    /* Increased gap since container is gone */
    padding: 4px;
}

.nav-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    border-radius: 25px;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 700;
    transition: var(--transition);
}

.nav-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.nav-tab.active {
    color: var(--accent-teal);
    /* Changed from bg-primary to accent-teal */
    background: rgba(20, 184, 166, 0.1);
    /* Subtle background instead of solid */
    border: 1px solid rgba(20, 184, 166, 0.2);
    font-weight: 1000;
}

.nav-tab-icon {
    font-size: 16px;
}

/* Global Back Link for drill-down pages */
.nav-back-global {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition);
    padding: 2px 0;
}

.nav-back-global:hover {
    color: var(--accent-teal);
    transform: translateX(-4px);
}

.back-icon {
    font-size: 16px;
}

.header-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 20px;
    background: rgba(14, 116, 144, 0.1);
    border: 1px solid rgba(14, 116, 144, 0.2);
    font-size: 12px;
    color: var(--accent-teal);
    font-weight: 500;
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-green);
    animation: pulse 2s infinite;
}

.logo-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: var(--transition);
}

.logo-link:hover {
    opacity: 0.9;
}

.main-header .logo-group {
    display: flex;
    align-items: center;
    gap: 24px;
}

.header-logo-img {
    height: 85px;
    /* Noticeable increase in Govt logo size */
    width: auto;
    object-fit: contain;
}

.header-mpsedc-img {
    height: 80px;
    /* Noticeable increase in MPSEDC logo size */
    width: auto;
    object-fit: contain;
}

.logo-text-stack {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}

.main-header .main-title {
    font-size: 26px;
    /* Slightly larger for increased header height */
    margin-bottom: 0;
    line-height: 1.1;
    font-weight: 800;
}

.main-header .subtitle {
    font-size: 13px;
    /* Slightly larger to match the upscaled header */
    opacity: 0.8;
    color: var(--accent-teal);
    letter-spacing: 0.3px;
}

/* Adjust hero section to account for sticky header */
.hero-section {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 30px 40px 24px;
}

/* Hero Section */
.hero-section {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 40px 40px 24px;
}

.hero-title {
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.hero-desc {
    font-size: 15px;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 28px;
    line-height: 1.6;
}

/* Hero Split Layout */
.hero-split-layout {
    display: flex;
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
    align-items: flex-start;
}

.hero-kpi-panel {
    flex: 1.2;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.hero-kpi-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.hero-map-panel {
    flex: 0.8;
    background: transparent;
    border: none;
    border-radius: var(--radius-lg);
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 480px;
}

.global-kpi-card {
    background: var(--gradient-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 18px 14px;
    text-align: center;
    transition: var(--transition);
    animation: fadeUp 0.5s ease backwards;
}

.global-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.gkpi-highlight {
    border-color: rgba(14, 116, 144, 0.4);
    background: rgba(14, 116, 144, 0.08);
    border-left: 3px solid var(--accent-teal);
}

.gkpi-financial {
    border-color: rgba(245, 158, 11, 0.3);
    background: rgba(245, 158, 11, 0.06);
    border-left: 3px solid var(--accent-orange);
}

.gkpi-icon {
    font-size: 28px;
    margin-bottom: 6px;
}

.gkpi-value {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
}

.gkpi-label {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

/* Department Grid - Enhanced Cards */
.dept-section {
    position: relative;
    z-index: 10;
    padding: 28px 40px 60px;
}

.section-title {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-icon {
    font-size: 24px;
}

.dept-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 18px;
}

.dept-card-enhanced {
    display: flex;
    flex-direction: column;
    background: var(--gradient-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition);
    animation: fadeUp 0.6s ease backwards;
    animation-delay: var(--delay);
    cursor: pointer;
    overflow: hidden;
}

.dept-card-enhanced:hover {
    border-color: var(--accent-teal);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(14, 116, 144, 0.2);
}

.dept-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 18px 10px;
}

.dept-card-icon-lg {
    font-size: 36px;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: rgba(14, 116, 144, 0.1);
}

/* Completion Ring SVG */
.dept-completion-ring {
    position: relative;
    width: 56px;
    height: 56px;
}

.circular-chart {
    display: block;
    width: 100%;
    height: 100%;
}

.circle-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.06);
    stroke-width: 3;
    stroke-linecap: round;
}

.circle-fill {
    fill: none;
    stroke: var(--accent-teal);
    stroke-width: 3;
    stroke-linecap: round;
    transition: stroke-dasharray 1.5s ease, stroke 0.5s ease;
    transform: rotate(-90deg);
    transform-origin: center;
}

.ring-pct {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 700;
    color: var(--text-primary);
}

.dept-card-body {
    padding: 4px 18px 14px;
}

.dept-card-name-lg {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 10px;
}

/* Mini stats row */
.dept-mini-stats {
    display: flex;
    gap: 12px;
    margin-bottom: 10px;
}

.dms-item {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.dms-val {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.dms-lbl {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Performance bar */
.dept-perf-bar-wrap {
    margin-bottom: 8px;
}

.dept-perf-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 6px;
}

.dept-perf-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 1.5s ease;
}

.dept-perf-badges {
    display: flex;
    gap: 12px;
}

.dpb {
    font-size: 11px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 2px;
}

.dpb-val {
    font-weight: 600;
}

/* Top district */
.dept-top-district {
    font-size: 11px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.dtd-label {
    font-weight: 600;
    color: var(--text-muted);
}

.dtd-name {
    font-weight: 500;
    color: var(--accent-teal);
}

/* Department Financial Stats */
.dept-financial-stats {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.dfs-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2px 0;
    font-size: 11px;
}

.dfs-label {
    color: var(--text-muted);
    font-weight: 500;
}

.dfs-val {
    color: var(--text-secondary);
    font-weight: 600;
    font-family: var(--font-display);
}

.dfs-pct {
    font-weight: 700;
    font-family: var(--font-display);
    font-size: 13px;
}

.dfs-pct-row {
    margin-top: 2px;
    padding-top: 4px;
    border-top: 1px dashed rgba(255, 255, 255, 0.05);
}

.dept-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 18px;
    border-top: 1px solid var(--border-glass);
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.dept-card-arrow {
    font-size: 16px;
    transition: var(--transition);
}

.dept-card-enhanced:hover .dept-card-arrow {
    color: var(--accent-teal);
    transform: translateX(4px);
}

/* Footer */
.landing-footer,
.dash-footer {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 24px 40px;
    border-top: 1px solid var(--border-glass);
    color: var(--text-muted);
    font-size: 12px;
}

/* =============================== */
/*       DASHBOARD PAGE             */
/* =============================== */

.dashboard-page {
    background: var(--bg-primary);
}

/* Navigation */
.dash-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 30px;
    background: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-glass);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-back {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
}

.nav-back:hover {
    color: var(--accent-teal);
    background: rgba(14, 116, 144, 0.1);
}

.back-arrow {
    font-size: 18px;
}

.nav-center {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-logo {
    font-size: 24px;
}

.nav-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, #67e8f9, #14b8a6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-dept-select select {
    background: rgba(30, 41, 59, 0.8);
    color: var(--text-primary);
    border: 1px solid var(--border-glass);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: var(--font-main);
    cursor: pointer;
    outline: none;
    max-width: 250px;
}

.nav-dept-select select:focus {
    border-color: var(--accent-teal);
}

/* Dashboard Header v2 */
.dash-header-v2 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 30px;
    border-bottom: 1px solid var(--border-glass);
    background: linear-gradient(135deg, rgba(12, 74, 110, 0.15), rgba(15, 23, 42, 0.5));
}

.dash-header-left {
    flex: 1;
}

.dash-dept-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 12px;
    background: rgba(14, 116, 144, 0.15);
    border: 1px solid rgba(14, 116, 144, 0.3);
    font-size: 11px;
    color: var(--accent-teal);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.dash-dept-name {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
}

.dash-dept-sub {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.dash-header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Header completion ring */
.header-completion-ring {
    position: relative;
    width: 80px;
    height: 80px;
}

.circular-chart-lg {
    display: block;
    width: 100%;
    height: 100%;
}

.circle-bg-lg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.06);
    stroke-width: 2.5;
    stroke-linecap: round;
}

.circle-fill-lg {
    fill: none;
    stroke: var(--accent-teal);
    stroke-width: 2.5;
    stroke-linecap: round;
    transition: stroke-dasharray 1.5s ease, stroke 0.5s ease;
    transform: rotate(-90deg);
    transform-origin: center;
}

.header-ring-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.header-ring-pct {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    display: block;
}

.header-ring-label {
    font-size: 9px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.last-updated {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.update-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-green);
    animation: pulse 2s infinite;
}

/* =============================== */
/*        KPI CARDS V2              */
/* =============================== */

.kpi-section-v2 {
    padding: 24px 30px;
}

.kpi-grid-v2 {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 14px;
}

.kpi-card-v2 {
    padding: 18px;
    border-radius: var(--radius-md);
    background: var(--gradient-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-glass);
    transition: var(--transition);
    animation: fadeUp 0.5s ease backwards;
}

.kpi-card-v2:nth-child(1) {
    animation-delay: 0.05s;
}

.kpi-card-v2:nth-child(2) {
    animation-delay: 0.1s;
}

.kpi-card-v2:nth-child(3) {
    animation-delay: 0.15s;
}

.kpi-card-v2:nth-child(4) {
    animation-delay: 0.2s;
}

.kpi-card-v2:nth-child(5) {
    animation-delay: 0.25s;
}

.kpi-card-v2:nth-child(6) {
    animation-delay: 0.3s;
}

.kpi-card-v2:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.kpiv2-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.kpiv2-icon {
    font-size: 24px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

.kpiv2-blue {
    background: rgba(59, 130, 246, 0.15);
}

.kpiv2-green {
    background: rgba(34, 197, 94, 0.15);
}

.kpiv2-teal {
    background: rgba(20, 184, 166, 0.15);
}

.kpiv2-purple {
    background: rgba(139, 92, 246, 0.15);
}

.kpiv2-orange {
    background: rgba(245, 158, 11, 0.15);
}

.kpiv2-emerald {
    background: rgba(16, 185, 129, 0.15);
}

.kpiv2-red {
    background: rgba(239, 68, 68, 0.15);
}

.kpiv2-cyan {
    background: rgba(6, 182, 212, 0.15);
}

.kpiv2-trend {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.kpiv2-trend-up {
    background: rgba(34, 197, 94, 0.12);
    color: #4ade80;
}

.kpiv2-trend-down {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
}

.kpiv2-value {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 4px;
}

.kpi-unit {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-secondary);
}

.kpiv2-label {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 10px;
}

.kpiv2-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    overflow: hidden;
}

.kpiv2-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 1s ease;
}

/* =============================== */
/*     INSIGHTS SECTION (v2)        */
/* =============================== */

.insights-section {
    padding: 0 30px 24px;
}

.insights-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.insights-left {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.insights-right {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Re-use ranking card styles */
.ranking-card {
    background: var(--gradient-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.ranking-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-glass);
}

.ranking-header h3 {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 600;
}

.ranking-icon {
    font-size: 20px;
}

.ranking-top {
    border-top: 3px solid var(--accent-green);
}

.ranking-bottom {
    border-top: 3px solid var(--accent-orange);
}

.ranking-list {
    padding: 6px 0;
}

.ranking-loading {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

.ranking-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    transition: var(--transition);
}

.ranking-item:hover {
    background: var(--bg-glass);
}

.rank-badge {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.rank-1 {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #1e1b4b;
}

.rank-2 {
    background: linear-gradient(135deg, #94a3b8, #64748b);
    color: #fff;
}

.rank-3 {
    background: linear-gradient(135deg, #d97706, #b45309);
    color: #fff;
}

.rank-4,
.rank-5 {
    background: rgba(100, 116, 139, 0.2);
    color: var(--text-secondary);
}

.rank-name {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
}

.rank-bar-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rank-bar-track {
    flex: 1;
    height: 7px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    overflow: hidden;
}

.rank-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 1s ease;
    width: 0;
}

.ranking-top .rank-bar-fill {
    background: linear-gradient(90deg, var(--accent-emerald), var(--accent-green));
}

.ranking-bottom .rank-bar-fill {
    background: linear-gradient(90deg, var(--accent-orange), var(--accent-red));
}

.rank-pct {
    font-size: 13px;
    font-weight: 600;
    min-width: 44px;
    text-align: right;
}

/* Observations Panel */
.obs-panel {
    background: var(--gradient-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.obs-panel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-glass);
}

.obs-panel-header h3 {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 600;
}

.obs-panel-body {
    padding: 10px 0;
}

.obs-card {
    display: flex;
    gap: 12px;
    padding: 12px 20px;
    transition: var(--transition);
    animation: fadeUp 0.5s ease backwards;
}

.obs-card:hover {
    background: var(--bg-glass);
}

.obs-card.obs-info {
    border-left: 3px solid var(--accent-blue);
}

.obs-card.obs-success {
    border-left: 3px solid var(--accent-green);
}

.obs-card.obs-warning {
    border-left: 3px solid var(--accent-orange);
}

.obs-card.obs-danger {
    border-left: 3px solid var(--accent-red);
}

.obs-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.obs-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.obs-text {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Quick Facts Card */
.quick-facts-card {
    background: var(--gradient-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.qf-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-glass);
    font-family: var(--font-display);
}

.qf-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.qf-body {
    padding: 12px 20px;
}

.qf-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-size: 13px;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.qf-item:last-child {
    border-bottom: none;
}

.qf-item strong {
    color: var(--text-primary);
}

.qf-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.qf-green {
    background: var(--accent-green);
}

.qf-orange {
    background: var(--accent-orange);
}

.qf-red {
    background: var(--accent-red);
}

.qf-blue {
    background: var(--accent-blue);
}

/* =============================== */
/*       SECTION HEADERS            */
/* =============================== */

.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.section-header h2 {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 600;
    flex: 1;
}

.section-icon-lg {
    font-size: 26px;
}

/* =============================== */
/*       DATA TABLE                 */
/* =============================== */

.table-section {
    padding: 24px 30px 30px;
}

.table-search input {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    outline: none;
    width: 240px;
    font-family: var(--font-main);
    transition: var(--transition);
}

.table-search input:focus {
    border-color: var(--accent-teal);
    box-shadow: 0 0 0 3px rgba(14, 116, 144, 0.15);
}

.table-container {
    border-radius: var(--radius-lg);
    overflow-x: auto;
    overflow-y: auto;
    max-height: 600px;
    border: 1px solid var(--border-glass);
    background: var(--gradient-card);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table thead {
    background: rgba(30, 41, 59, 1);
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-glass);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.data-table th:hover {
    color: var(--accent-teal);
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: var(--transition);
}

.data-table tbody tr:hover {
    background: rgba(14, 116, 144, 0.06);
}

.data-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.015);
}

.data-table tbody tr:nth-child(even):hover {
    background: rgba(14, 116, 144, 0.06);
}

.progress-bar-mini {
    width: 100px;
    height: 7px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill-mini {
    height: 100%;
    border-radius: 4px;
    transition: width 1.2s ease;
}

.progress-fill-mini.fill-green {
    background: var(--accent-green);
}

.progress-fill-mini.fill-teal {
    background: var(--accent-teal);
}

.progress-fill-mini.fill-orange {
    background: var(--accent-orange);
}

.progress-fill-mini.fill-red {
    background: var(--accent-red);
}

.status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.badge-excellent {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

.badge-good {
    background: rgba(20, 184, 166, 0.15);
    color: #2dd4bf;
}

.badge-average {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

.badge-low {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.btn-view {
    padding: 6px 14px;
    background: rgba(14, 116, 144, 0.15);
    border: 1px solid rgba(14, 116, 144, 0.3);
    color: var(--accent-teal);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-main);
}

.btn-view:hover {
    background: var(--accent-teal);
    color: var(--bg-primary);
}

.loading-cell {
    text-align: center;
    color: var(--text-muted);
    padding: 40px !important;
}

/* =============================== */
/*       MODAL                      */
/* =============================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.25s ease;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 1200px;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 22px 26px;
    border-bottom: 1px solid var(--border-glass);
    background: linear-gradient(135deg, rgba(12, 74, 110, 0.2), rgba(15, 23, 42, 0.3));
}

.modal-title {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
}

.modal-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.modal-close {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-glass);
    border-radius: 50%;
    background: transparent;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
    border-color: rgba(239, 68, 68, 0.3);
}

.modal-body {
    padding: 22px 26px;
    overflow-y: auto;
}

.activity-card {
    padding: 16px;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    transition: var(--transition);
}

.activity-card:hover {
    border-color: rgba(14, 116, 144, 0.3);
}

.activity-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.activity-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.activity-pct {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    padding-left: 16px;
}

.activity-pct.pct-high {
    color: var(--accent-green);
}

.activity-pct.pct-mid {
    color: var(--accent-teal);
}

.activity-pct.pct-low {
    color: var(--accent-orange);
}

.activity-pct.pct-crit {
    color: var(--accent-red);
}

.activity-bar-track {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.activity-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 1s ease;
}

.activity-meta {
    display: flex;
    gap: 20px;
    font-size: 12px;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.activity-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.meta-label {
    color: var(--text-muted);
}

/* =============================== */
/*       MATRIX TABLE (LANDING)     */
/* =============================== */

.matrix-section {
    padding: 0 40px 40px;
}

.matrix-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.matrix-container {
    background: var(--gradient-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 24px;
    overflow: hidden;
}

.matrix-wrapper {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 550px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.matrix-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.matrix-table thead {
    background: rgba(15, 23, 42, 1);
    position: sticky;
    top: 0;
    z-index: 20;
}

.matrix-table th {
    padding: 10px 14px;
    text-align: center;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-glass);
    border-right: 1px solid rgba(255, 255, 255, 0.03);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    transition: var(--transition);
}

.matrix-table th:hover {
    color: var(--accent-teal);
    background: rgba(255, 255, 255, 0.02);
}

.matrix-th-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.matrix-th-inner span {
    max-width: 140px;
    white-space: normal;
    line-height: 1.2;
}

.matrix-table td {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    border-right: 1px solid rgba(255, 255, 255, 0.02);
    color: var(--text-primary);
    vertical-align: middle;
    text-align: center;
    font-weight: 500;
}

.matrix-table tbody tr {
    transition: var(--transition);
}

.matrix-table tbody tr:hover {
    background: rgba(14, 116, 144, 0.1);
}

.matrix-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.015);
}

.matrix-table tbody tr:nth-child(even):hover {
    background: rgba(14, 116, 144, 0.1);
}

.matrix-sticky-col {
    position: sticky;
    left: 0;
    background: var(--bg-secondary);
    z-index: 10;
    text-align: left !important;
    border-right: 2px solid var(--border-glass) !important;
}

.matrix-table thead .matrix-sticky-col {
    z-index: 30;
    background: rgba(15, 23, 42, 1);
}

.matrix-table tbody tr:hover .matrix-sticky-col {
    background: #132437;
}

.matrix-cell {
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 600;
    border-radius: 4px;
}

.matrix-cell-empty {
    color: var(--text-muted);
}

.mc-high {
    color: #4ade80;
    background: rgba(74, 222, 128, 0.05);
}

.mc-mid {
    color: #2dd4bf;
    background: rgba(45, 212, 191, 0.05);
}

.mc-low {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.05);
}

.mc-crit {
    color: #f87171;
    background: rgba(248, 113, 113, 0.05);
}

/* =============================== */
/*    UTILITY & DISTRICT CLASSES    */
/* =============================== */

.text-center {
    text-align: center !important;
}

.text-right {
    text-align: right !important;
}

.number-font {
    font-family: var(--font-display);
}

.btn-action {
    padding: 6px 14px;
    background: rgba(14, 116, 144, 0.15);
    border: 1px solid rgba(14, 116, 144, 0.3);
    color: var(--accent-teal);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-main);
}

.btn-action:hover {
    background: var(--accent-teal);
    color: var(--bg-primary);
}

.status-badge.status-high {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

.status-badge.status-good {
    background: rgba(20, 184, 166, 0.15);
    color: #2dd4bf;
}

.status-badge.status-avg {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

.status-badge.status-crit {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.progress-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.progress-bar {
    flex: 1;
    height: 7px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 1s ease;
}

.progress-text {
    font-size: 12px;
    font-weight: 600;
    min-width: 40px;
    text-align: right;
}

/* =============================== */
/*       RESPONSIVE                 */
/* =============================== */

@media (max-width: 1200px) {
    .kpi-grid-v2 {
        grid-template-columns: repeat(3, 1fr);
    }

    .global-kpi-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .kpi-grid-v2 {
        grid-template-columns: repeat(2, 1fr);
    }

    .global-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .insights-grid {
        grid-template-columns: 1fr;
    }

    .dept-grid {
        grid-template-columns: 1fr;
    }

    .landing-header {
        flex-direction: column;
        gap: 12px;
    }

    .dash-nav {
        flex-wrap: wrap;
        gap: 10px;
    }

    .dash-header-v2 {
        flex-direction: column;
        gap: 16px;
    }
}

/* Footer Styles */
.footer {
    text-align: center;
    padding: 60px 40px 40px;
    margin-top: 40px;
    border-top: 1px solid var(--border-glass);
    background: rgba(10, 14, 26, 0.3);
}

.footer p {
    font-size: 14px;
    color: var(--text-secondary);
    opacity: 0.8;
    letter-spacing: 0.5px;
}

@media (max-width: 600px) {
    .footer {
        padding: 40px 20px;
    }

    .footer p {
        font-size: 12px;
    }

    .kpi-grid-v2 {
        grid-template-columns: 1fr;
    }

    .global-kpi-grid {
        grid-template-columns: 1fr;
    }

    .hero-title {
        font-size: 24px;
    }

    .dash-dept-name {
        font-size: 22px;
    }

    .table-container {
        overflow-x: auto;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.3);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 116, 139, 0.5);
}

/* =============================== */
/*        MP MAP STYLES             */
/* =============================== */
/* MP MAP STYLES */
.hero-map-panel #mp-map {
    width: 100%;
    height: 480px;
    background: transparent;
}

@media (max-width: 1100px) {
    .hero-split-layout {
        flex-direction: column-reverse;
    }

    .hero-map-panel {
        width: 100%;
    }

    .hero-kpi-row-2 {
        max-width: 100%;
    }
}

/* Leaflet Dark Theme Overrides */
.leaflet-container {
    background: transparent !important;
}

.leaflet-default-icon-path {
    background-image: url(https://unpkg.com/leaflet@1.9.4/dist/images/marker-icon.png);
}

.leaflet-control-zoom a {
    background-color: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-glass) !important;
}

.leaflet-control-zoom a:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
}

.district-tooltip {
    background: rgba(17, 24, 39, 0.95);
    border: 1px solid var(--accent-teal);
    color: white;
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    font-family: var(--font-display);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.district-tooltip-title {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 4px;
    color: var(--accent-teal);
}

.district-tooltip-pct {
    font-size: 12px;
}

/* =============================== */
/*     THEME TOGGLE BUTTON          */
/* =============================== */

.theme-toggle {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    border: 1px solid var(--border-glass);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    overflow: hidden;
    padding: 0;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--accent-teal);
    box-shadow: 0 0 15px rgba(14, 116, 144, 0.3);
}

.theme-icon {
    font-size: 18px;
    position: absolute;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-icon-sun {
    opacity: 1;
    transform: rotate(0) scale(1);
}

.theme-icon-moon {
    opacity: 0;
    transform: rotate(-90deg) scale(0);
}

/* =============================== */
/*       LIGHT MODE OVERRIDES       */
/* =============================== */

body.light-mode,
html.light-mode body {
    --bg-primary: #f0f4f8;
    --bg-secondary: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.92);
    --bg-glass: rgba(0, 0, 0, 0.03);
    --border-glass: rgba(0, 0, 0, 0.1);
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --gradient-water: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 50%, #7dd3fc 100%);
    --gradient-hero: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 40%, #ccfbf1 100%);
    --gradient-card: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(241, 245, 249, 0.9));
    --shadow-glow: 0 0 30px rgba(14, 116, 144, 0.08);
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.08);
}

/* Water background waves */
body.light-mode .wave1 { background: #7dd3fc; opacity: 0.08; }
body.light-mode .wave2 { background: #93c5fd; opacity: 0.06; }
body.light-mode .wave3 { background: #67e8f9; opacity: 0.05; }

/* Header */
body.light-mode .header-top-bar {
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

body.light-mode .main-title {
    color: #0c4a6e;
}

body.light-mode .subtitle {
    color: #475569;
}

body.light-mode .header-nav-bar {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
}

body.light-mode .nav-tab {
    color: #475569;
}

body.light-mode .nav-tab:hover {
    color: #0c4a6e;
    background: rgba(14, 116, 144, 0.08);
}

body.light-mode .nav-tab.active {
    background: linear-gradient(135deg, #0e7490, #0891b2);
    color: #ffffff;
}

/* Theme toggle in light mode */
body.light-mode .theme-toggle {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.12);
}

body.light-mode .theme-toggle:hover {
    background: rgba(0, 0, 0, 0.1);
    border-color: #0e7490;
}

/* KPI Cards */
body.light-mode .kpi-card-v2 {
    background: var(--gradient-card);
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

body.light-mode .kpi-card-v2:hover {
    border-color: rgba(14, 116, 144, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

body.light-mode .kpiv2-value {
    color: #0f172a;
}

body.light-mode .kpiv2-bar {
    background: rgba(0, 0, 0, 0.06);
}

/* Dashboard Header */
body.light-mode .dash-header-v2 {
    background: var(--gradient-card);
    border-color: rgba(0, 0, 0, 0.06);
}

body.light-mode .dash-dept-name {
    color: #0c4a6e;
}

body.light-mode .dash-dept-badge {
    background: rgba(14, 116, 144, 0.12);
    color: #0e7490;
}

/* Table styles */
body.light-mode .table-container {
    border-color: rgba(0, 0, 0, 0.08);
}

body.light-mode .data-table thead {
    background: #f1f5f9;
}

body.light-mode .data-table th {
    color: #475569;
    border-bottom-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .data-table td {
    border-bottom-color: rgba(0, 0, 0, 0.05);
    color: #334155;
}

body.light-mode .data-table tbody tr:hover {
    background: rgba(14, 116, 144, 0.06);
}

body.light-mode .data-table tbody tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.02);
}

/* Ranking cards */
body.light-mode .ranking-card {
    background: var(--gradient-card);
    border-color: rgba(0, 0, 0, 0.06);
}

body.light-mode .ranking-card.ranking-top .ranking-header {
    border-bottom-color: rgba(34, 197, 94, 0.15);
}

body.light-mode .ranking-card.ranking-bottom .ranking-header {
    border-bottom-color: rgba(239, 68, 68, 0.15);
}

/* Observations & Quick Facts */
body.light-mode .obs-panel {
    background: var(--gradient-card);
    border-color: rgba(0, 0, 0, 0.06);
}

body.light-mode .quick-facts-card {
    background: var(--gradient-card);
    border-color: rgba(0, 0, 0, 0.06);
}

/* Section headers */
body.light-mode .section-header h2 {
    color: #0f172a;
}

/* Insights panels */
body.light-mode .obs-item {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.06);
}

body.light-mode .obs-item:hover {
    border-color: rgba(14, 116, 144, 0.2);
}

/* Matrix table */
body.light-mode .matrix-container {
    background: var(--gradient-card);
    border-color: rgba(0, 0, 0, 0.06);
}

body.light-mode .matrix-wrapper {
    border-color: rgba(0, 0, 0, 0.08);
}

body.light-mode .matrix-table thead {
    background: #f1f5f9;
}

body.light-mode .matrix-table thead .matrix-sticky-col {
    background: #f1f5f9;
}

body.light-mode .matrix-table th {
    color: #475569;
    border-bottom-color: rgba(0, 0, 0, 0.1);
    border-right-color: rgba(0, 0, 0, 0.04);
}

body.light-mode .matrix-table td {
    color: #334155;
    border-bottom-color: rgba(0, 0, 0, 0.05);
    border-right-color: rgba(0, 0, 0, 0.03);
}

body.light-mode .matrix-sticky-col {
    background: #ffffff;
}

body.light-mode .matrix-table tbody tr:hover {
    background: rgba(14, 116, 144, 0.06);
}

body.light-mode .matrix-table tbody tr:hover .matrix-sticky-col {
    background: #f0fdfa;
}

body.light-mode .matrix-table tbody tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.015);
}

/* Color scale adjustments for light mode readability */
body.light-mode .mc-high { color: #15803d; background: rgba(34, 197, 94, 0.1); }
body.light-mode .mc-mid { color: #0e7490; background: rgba(14, 180, 166, 0.1); }
body.light-mode .mc-low { color: #b45309; background: rgba(245, 158, 11, 0.1); }
body.light-mode .mc-crit { color: #dc2626; background: rgba(239, 68, 68, 0.1); }

/* Status badges */
body.light-mode .status-badge.badge-excellent,
body.light-mode .status-badge.status-high { background: rgba(34, 197, 94, 0.12); color: #15803d; }
body.light-mode .status-badge.badge-good,
body.light-mode .status-badge.status-good { background: rgba(20, 184, 166, 0.12); color: #0e7490; }
body.light-mode .status-badge.badge-average,
body.light-mode .status-badge.status-avg { background: rgba(245, 158, 11, 0.12); color: #b45309; }
body.light-mode .status-badge.badge-low,
body.light-mode .status-badge.status-crit { background: rgba(239, 68, 68, 0.12); color: #dc2626; }

/* Modal */
body.light-mode .modal-content {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .modal-header {
    background: linear-gradient(135deg, rgba(224, 242, 254, 0.6), rgba(240, 249, 255, 0.4));
    border-bottom-color: rgba(0, 0, 0, 0.06);
}

body.light-mode .modal-close {
    border-color: rgba(0, 0, 0, 0.1);
    color: #475569;
}

body.light-mode .modal-close:hover {
    background: rgba(239, 68, 68, 0.1);
}

body.light-mode .activity-card {
    background: rgba(241, 245, 249, 0.7);
    border-color: rgba(0, 0, 0, 0.06);
}

body.light-mode .activity-card:hover {
    border-color: rgba(14, 116, 144, 0.2);
}

body.light-mode .activity-bar-track {
    background: rgba(0, 0, 0, 0.08);
}

/* Buttons */
body.light-mode .btn-action {
    background: rgba(14, 116, 144, 0.1);
    border-color: rgba(14, 116, 144, 0.25);
    color: #0e7490;
}

body.light-mode .btn-action:hover {
    background: #0e7490;
    color: #ffffff;
}

body.light-mode .btn-view {
    background: rgba(14, 116, 144, 0.1);
    border-color: rgba(14, 116, 144, 0.2);
    color: #0e7490;
}

body.light-mode .btn-view:hover {
    background: #0e7490;
    color: #ffffff;
}

/* Search input */
body.light-mode .table-search input {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
    color: #334155;
}

body.light-mode .table-search input:focus {
    border-color: #0e7490;
    background: #ffffff;
}

body.light-mode #matrixSearch {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
    color: #334155;
}

body.light-mode #matrixSearch:focus {
    border-color: #0e7490;
    background: #ffffff;
}

/* Footer */
body.light-mode .footer {
    background: rgba(241, 245, 249, 0.6);
    border-top-color: rgba(0, 0, 0, 0.06);
}

body.light-mode .footer p {
    color: #64748b;
}

/* Scrollbar */
body.light-mode ::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.25);
}

body.light-mode ::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 116, 139, 0.4);
}

/* Header ring */
body.light-mode .header-ring-pct,
body.light-mode .header-ring-label {
    color: #0f172a;
}

/* Progress bars */
body.light-mode .progress-bar {
    background: rgba(0, 0, 0, 0.08);
}

/* Circle chart backgrounds */
body.light-mode .circle-bg-lg {
    stroke: rgba(0, 0, 0, 0.08);
}

/* Hero / landing */
body.light-mode.landing-page,
body.light-mode .landing-page {
    background: var(--gradient-hero);
}

/* Dept grid cards */
body.light-mode .dept-card {
    background: var(--gradient-card);
    border-color: rgba(0, 0, 0, 0.06);
}

body.light-mode .dept-card:hover {
    border-color: rgba(14, 116, 144, 0.2);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

/* Update dot */
body.light-mode .update-dot {
    background: #22c55e;
}

body.light-mode .last-updated {
    color: #64748b;
}