﻿:root {
    --da-navy: #4a0000;
    --da-blue: #b71c1c;
    --da-cyan: #d32f2f;
    --da-green: #9a1b1b;
    --da-amber: #ffb300;
    --da-red: #c62828;
    --da-violet: #7b0000;
    --da-pink: #d84343;
    --da-bg: #fffaf0;
    --da-card: #ffffff;
    --da-muted: #795548;
    --da-border: #f1d7a5;
    --da-shadow: 0 12px 34px rgba(123,0,0,.09);
}

body {
    background: var(--da-bg);
}

.district-dashboard {
    font-family: Inter,"Segoe UI",Arial,sans-serif;
    color: var(--da-navy);
    padding-bottom: 30px;
}

.dashboard-hero {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    padding: 23px;
    color: #fff;
    background: radial-gradient(circle at 85% 15%,rgba(255,255,255,.19),transparent 22%), radial-gradient(circle at 8% 100%,rgba(255,179,0,.30),transparent 28%), linear-gradient(120deg,#4a0000 0%,#7b0000 30%,#b71c1c 67%,#ffb300 100%);
    box-shadow: 0 18px 45px rgba(123,0,0,.22);
    margin: 12px 0 18px;
}

    .dashboard-hero:after {
        content: "";
        position: absolute;
        width: 270px;
        height: 270px;
        border-radius: 50%;
        right: -110px;
        bottom: -170px;
        border: 34px solid rgba(255,213,79,.13);
    }

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 11px;
    border-radius: 999px;
    border: 1px solid rgba(255,224,130,.55);
    background: rgba(255,255,255,.12);
    backdrop-filter: blur(8px);
    font-size: .75rem;
    font-weight: 850;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.hero-title {
    margin: 10px 0 4px;
    font-size: clamp(1.45rem,3vw,2.2rem);
    line-height: 1.12;
    font-weight: 950;
    letter-spacing: -.03em;
}

.hero-subtitle {
    margin: 0;
    opacity: .90;
    font-size: .9rem;
    max-width: 850px;
}

.fy-box {
    min-width: 215px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(255,224,130,.45);
    background: rgba(255,255,255,.14);
    backdrop-filter: blur(10px);
}

    .fy-box label {
        display: block;
        font-size: .7rem;
        text-transform: uppercase;
        letter-spacing: .08em;
        font-weight: 850;
        opacity: .88;
        margin-bottom: 5px;
    }

    .fy-box .form-select {
        border: 0;
        border-radius: 10px;
        font-weight: 850;
        color: #4a0000;
        background-color: #fffdf7;
        box-shadow: none !important;
    }

.glass-alert {
    border: 1px solid #ef9a9a;
    background: #fff5f3;
    color: #8e0000;
    border-radius: 14px;
    padding: 12px 14px;
    font-weight: 750;
    margin-bottom: 14px;
}

.dashboard-card {
    background: var(--da-card);
    border: 1px solid var(--da-border);
    border-radius: 20px;
    box-shadow: var(--da-shadow);
}

.map-card {
    position: sticky;
    top: 10px;
    overflow: hidden;
}

.card-head {
    padding: 16px 18px 12px;
    border-bottom: 1px solid #f5e2bc;
}

.card-title-main {
    margin: 0;
    font-size: 1rem;
    font-weight: 950;
    color: #7b0000;
}

.card-subtitle {
    color: var(--da-muted);
    font-size: .76rem;
    margin-top: 3px;
}

.map-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    align-items: center;
    margin-top: 12px;
}

.metric-chip {
    border: 1px solid #f1d7a5;
    background: #fffdf7;
    color: #7b0000;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 850;
    cursor: pointer;
    transition: all .2s ease;
}

    .metric-chip:hover {
        transform: translateY(-1px);
        border-color: #ffb300;
        background: #fff8e1;
    }

    .metric-chip.active {
        color: #fff;
        border-color: transparent;
        background: linear-gradient(135deg,#7b0000,#b71c1c,#ffb300);
        box-shadow: 0 5px 14px rgba(123,0,0,.25);
    }

.overview-btn {
    border: 0;
    color: #7b0000;
    background: #fff3cd;
    font-weight: 850;
    font-size: .75rem;
    border-radius: 10px;
    padding: 7px 10px;
}

.map-wrap {
    padding: 10px 12px 5px;
    min-height: 560px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(rgba(255,253,247,.96),rgba(255,253,247,.96)), radial-gradient(circle at 1px 1px,#ead8b5 1px,transparent 1px);
    background-size: auto,18px 18px;
}

.tn-map-object {
    width: 100%;
    height: min(72vh,690px);
    min-height: 540px;
    border: 0;
    display: block;
}

.map-legend {
    padding: 8px 16px 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--da-muted);
    font-size: .7rem;
    font-weight: 750;
}

.legend-gradient {
    height: 9px;
    min-width: 125px;
    flex: 1;
    border-radius: 999px;
    background: linear-gradient( 90deg, #dbeafe,#a7f3d0,#fde68a,#fdba74,#fb7185,#8b5cf6 );
}

.selected-banner {
    position: relative;
    overflow: hidden;
    padding: 18px 20px;
    color: #fff;
    border-radius: 20px;
    background: radial-gradient(circle at 90% 10%,rgba(255,255,255,.18),transparent 24%), linear-gradient(135deg,#4a0000,#8e0000 48%,#b71c1c 72%,#ffb300);
    box-shadow: 0 14px 30px rgba(123,0,0,.20);
}

.selected-label {
    opacity: .82;
    font-size: .7rem;
    letter-spacing: .09em;
    text-transform: uppercase;
    font-weight: 850;
}

.selected-name {
    font-weight: 950;
    font-size: clamp(1.3rem,2vw,1.82rem);
    margin: 2px 0 0;
}

.selected-note {
    font-size: .74rem;
    opacity: .86;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4,minmax(0,1fr));
    gap: 12px;
}

.kpi-card {
    position: relative;
    overflow: hidden;
    min-height: 116px;
    padding: 15px;
    border-radius: 18px;
    background: #fff;
    border: 1px solid var(--da-border);
    box-shadow: 0 8px 24px rgba(123,0,0,.065);
}

    .kpi-card:after {
        content: "";
        position: absolute;
        width: 70px;
        height: 70px;
        border-radius: 50%;
        right: -22px;
        bottom: -25px;
        opacity: .12;
        background: currentColor;
    }

.kpi-blue {
    color: #b71c1c;
}

.kpi-green {
    color: #8e0000;
}

.kpi-violet {
    color: #7b0000;
}

.kpi-pink {
    color: #d84343;
}

.kpi-icon {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 1.08rem;
    background: currentColor;
    color: #fff;
    box-shadow: 0 7px 15px rgba(123,0,0,.12);
}

.kpi-label {
    margin-top: 10px;
    color: #795548;
    font-size: .67rem;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.kpi-value {
    margin-top: 2px;
    color: #4a0000;
    font-size: clamp(1.1rem,2vw,1.38rem);
    line-height: 1.05;
    font-weight: 950;
}

.kpi-foot {
    margin-top: 4px;
    color: #a1887f;
    font-size: .66rem;
    font-weight: 750;
}

.section-card {
    padding: 16px;
    height: 100%;
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
}

    .section-title h6 {
        margin: 0;
        font-size: .9rem;
        font-weight: 950;
        color: #7b0000;
    }

.badge-soft {
    border-radius: 999px;
    padding: 5px 8px;
    font-size: .64rem;
    font-weight: 850;
    background: #fff3cd;
    color: #8e0000;
}

.scheme-row {
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr;
    gap: 8px;
    align-items: center;
    padding: 11px 0;
    border-bottom: 1px dashed #f1d7a5;
}

    .scheme-row:last-child {
        border-bottom: 0;
    }

.scheme-name {
    font-weight: 900;
    font-size: .81rem;
    color: #5d0000;
}

    .scheme-name small {
        display: block;
        color: #a1887f;
        font-weight: 700;
        margin-top: 2px;
    }

.scheme-stat {
    text-align: right;
}

    .scheme-stat strong {
        display: block;
        font-size: .86rem;
        color: #7b0000;
    }

    .scheme-stat small {
        color: #a1887f;
        font-size: .64rem;
        font-weight: 700;
    }

.profile-grid {
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 9px;
}

.profile-box {
    border-radius: 15px;
    padding: 11px 10px;
    border: 1px solid #f1d7a5;
    background: linear-gradient(180deg,#fff,#fffaf0);
}

.p-title {
    font-size: .68rem;
    color: #795548;
    font-weight: 850;
    text-transform: uppercase;
}

.p-count {
    font-size: 1.02rem;
    color: #7b0000;
    font-weight: 950;
    margin-top: 2px;
}

.p-amt {
    color: #795548;
    font-weight: 750;
    font-size: .68rem;
    margin-top: 1px;
}

.chart-card {
    min-height: 365px;
    padding: 15px;
}

.chart-holder {
    position: relative;
    height: 300px;
}

.leaderboard-item {
    display: grid;
    grid-template-columns: 32px 1fr auto;
    align-items: center;
    gap: 8px;
    margin-bottom: 11px;
    cursor: pointer;
}

.rank-badge {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: #fff3cd;
    color: #8e0000;
    font-weight: 950;
    font-size: .74rem;
}

.leader-name {
    font-size: .75rem;
    font-weight: 900;
    color: #5d4037;
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.leader-track {
    height: 7px;
    margin-top: 5px;
    border-radius: 999px;
    background: #f8ead1;
    overflow: hidden;
}

.leader-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient( 90deg, #ffb300, #ef6c00, #d32f2f, #7b0000 );
}

.leader-value {
    white-space: nowrap;
    font-size: .7rem;
    font-weight: 900;
    color: #7b0000;
}

.data-table {
    margin: 0;
    font-size: .74rem;
}

    .data-table thead th {
        white-space: nowrap;
        color: #7b0000;
        background: #fff8e1;
        font-size: .64rem;
        text-transform: uppercase;
        letter-spacing: .03em;
        border-bottom: 1px solid #ffd54f;
    }

    .data-table tbody td {
        vertical-align: middle;
        color: #5d4037;
        font-weight: 700;
    }

    .data-table .num {
        text-align: right;
        white-space: nowrap;
    }

.amount-note {
    font-size: .65rem;
    color: #a1887f;
    font-weight: 700;
    margin-top: 5px;
}

@media(max-width:1199.98px) {
    .kpi-grid {
        grid-template-columns: repeat(2,minmax(0,1fr));
    }

    .map-card {
        position: static;
    }
}

@media(max-width:767.98px) {
    .district-dashboard {
        padding-left: 2px;
        padding-right: 2px;
    }

    .dashboard-hero {
        border-radius: 18px;
        padding: 18px;
    }

    .fy-box {
        min-width: 100%;
        margin-top: 14px;
    }

    .map-wrap {
        min-height: 450px;
    }

    .tn-map-object {
        height: 510px;
        min-height: 450px;
    }

    .kpi-grid {
        grid-template-columns: 1fr 1fr;
        gap: 9px;
    }

    .kpi-card {
        min-height: 104px;
        padding: 12px;
    }

    .profile-grid {
        grid-template-columns: 1fr 1fr;
    }

    .chart-holder {
        height: 285px;
    }

    .chart-card {
        min-height: 345px;
    }
}

@media(max-width:420px) {
    .kpi-grid {
        grid-template-columns: 1fr;
    }

    .profile-grid {
        grid-template-columns: 1fr;
    }

    .scheme-row {
        grid-template-columns: 1.1fr .9fr;
    }

        .scheme-row .scheme-stat:last-child {
            grid-column: 1/-1;
            text-align: left;
        }

    .tn-map-object {
        height: 470px;
    }
}
