:root {
    --navy: #1c2b5a;
    --blue: #0264d6;
    --bg: #eef2f7;
    --card: #ffffff;
    --text: #1e2430;
    --muted: #5c6778;
    --line: #e2e6ee;
    --projects: #0264d6;
    --amount: #0f8a6a;
    --districts: #c47b12;
    --ministries: #5b4db7;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(circle at top right, rgba(2, 100, 214, 0.08), transparent 28%),
        var(--bg);
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.45;
    min-height: 100vh;
}

a {
    color: var(--blue);
    text-decoration: none;
}

.wrap {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.site-header {
    background: linear-gradient(120deg, #152246 0%, #1c2b5a 42%, #0264d6 100%);
    color: #fff;
}

.site-header-home {
    padding-bottom: 64px;
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 22px 0;
}

.header-inner img {
    width: 68px;
    height: 68px;
    object-fit: contain;
    background: #fff;
    border-radius: 12px;
    padding: 4px;
    flex-shrink: 0;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

.header-text {
    flex: 1;
    min-width: 0;
}

.eyebrow {
    margin: 0;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.78;
}

.title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 2px;
}

.header-text h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.year-pill {
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 13px;
    font-weight: 700;
}

.signin {
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    padding: 9px 16px;
    font-weight: 700;
    flex-shrink: 0;
}

.signin:hover {
    background: rgba(255, 255, 255, 0.18);
}

main {
    padding: 28px 0 36px;
}

.site-header-home + main {
    padding-top: 0;
}

.kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: -42px;
}

.kpi {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 10px 24px rgba(21, 34, 70, 0.08);
    border-top: 4px solid var(--blue);
}

.kpi-projects { border-top-color: var(--projects); }
.kpi-amount { border-top-color: var(--amount); }
.kpi-districts { border-top-color: var(--districts); }
.kpi-ministries { border-top-color: var(--ministries); }

.kpi-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: #e8f2fc;
    color: var(--projects);
}

.kpi-amount .kpi-icon { background: #e7f6f1; color: var(--amount); }
.kpi-districts .kpi-icon { background: #fbf3e6; color: var(--districts); }
.kpi-ministries .kpi-icon { background: #efedf9; color: var(--ministries); }

.kpi-icon svg,
.explore-icon svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.kpi span {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

.kpi strong {
    display: block;
    margin-top: 2px;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--navy);
}

.section-head {
    margin: 36px 0 14px;
}

.section-head h2 {
    margin: 0 0 4px;
    font-size: 22px;
    color: var(--navy);
}

.section-head p,
.prompt,
.empty {
    margin: 0;
    color: var(--muted);
}

.explore-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.explore-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 18px 16px 16px;
    color: inherit;
    min-height: 176px;
    box-shadow: 0 8px 18px rgba(21, 34, 70, 0.04);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.explore-card:hover {
    transform: translateY(-3px);
    border-color: #b9d4f5;
    box-shadow: 0 14px 28px rgba(28, 43, 90, 0.12);
}

.explore-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e8f2fc;
    color: var(--blue);
}

.explore-ministry .explore-icon { background: #efedf9; color: var(--ministries); }
.explore-fund .explore-icon { background: #e7f6f1; color: var(--amount); }
.explore-sector .explore-icon { background: #fbf3e6; color: var(--districts); }
.explore-category .explore-icon { background: #e8f2fc; color: var(--navy); }

.explore-card h3 {
    margin: 4px 0 0;
    font-size: 18px;
    color: var(--navy);
}

.explore-card p {
    margin: 0;
    color: var(--muted);
    flex: 1;
}

.explore-action {
    font-weight: 700;
    color: var(--blue);
}

.explore-action::after {
    content: " →";
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
    color: var(--muted);
    font-size: 14px;
}

.crumbs li {
    display: flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
}

.crumbs li + li::before {
    content: "/";
    color: #9aa3b2;
}

.crumbs a {
    font-weight: 600;
}

.crumbs .current {
    color: var(--navy);
    font-weight: 700;
}

.view-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.view-nav a {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 7px 12px;
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
}

.view-nav a.active {
    background: var(--navy);
    border-color: var(--navy);
    color: #fff;
}

.explorer {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 16px;
    align-items: start;
}

.pane {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 16px;
    min-width: 0;
    box-shadow: 0 8px 18px rgba(21, 34, 70, 0.04);
}

.pane h2 {
    margin: 0 0 12px;
    font-size: 16px;
    color: var(--navy);
}

.search {
    display: block;
    margin-bottom: 10px;
}

.search input {
    width: 100%;
    border: 1px solid var(--line);
    background: #f7f9fc;
    border-radius: 10px;
    padding: 9px 12px;
    font: inherit;
    color: var(--text);
}

.search input:focus {
    outline: 2px solid rgba(2, 100, 214, 0.25);
    border-color: var(--blue);
    background: #fff;
}

.group-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 62vh;
    overflow: auto;
}

.group-list a {
    display: block;
    padding: 10px 10px 8px;
    border-radius: 10px;
    color: inherit;
    border: 1px solid transparent;
}

.group-list a:hover {
    background: #f4f8fd;
}

.group-list li.active > a {
    background: #e8f2fc;
    border-color: #c5daf6;
}

.group-name {
    display: block;
    font-weight: 700;
    color: var(--navy);
}

.group-meta {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 13px;
}

.share {
    display: block;
    height: 4px;
    margin-top: 8px;
    background: #e6ebf2;
    border-radius: 99px;
    overflow: hidden;
}

.share > span {
    display: block;
    height: 100%;
    width: var(--share);
    min-width: 3px;
    background: linear-gradient(90deg, #0264d6, #4aa0ef);
    border-radius: 99px;
}

.group-list li.active .share > span {
    background: var(--navy);
}

.detail-title {
    margin: 0 0 4px;
    font-size: 20px;
    color: var(--navy);
}

.detail-title.spaced {
    margin-top: 20px;
}

.detail-meta {
    margin: 0 0 12px;
    color: var(--muted);
}

.table-wrap {
    max-height: 65vh;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.projects {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.projects th,
.projects td {
    padding: 11px 12px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--line);
}

.projects th {
    position: sticky;
    top: 0;
    background: #f4f7fb;
    font-size: 12px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--muted);
    z-index: 1;
}

.projects tbody tr:nth-child(even) {
    background: #f8fafc;
}

.projects tbody tr:hover {
    background: #eef5fd;
}

.projects td.num,
.projects th.num {
    text-align: right;
    white-space: nowrap;
}

.district-pill {
    display: inline-block;
    background: #e8f2fc;
    color: var(--navy);
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.amount {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    color: var(--navy);
}

.site-footer {
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
    padding: 16px 0 28px;
}

@media (max-width: 900px) {
    .kpis,
    .explore-grid,
    .explorer {
        grid-template-columns: 1fr;
    }

    .header-inner {
        align-items: flex-start;
    }

    .header-text h1 {
        font-size: 22px;
    }

    .site-header-home {
        padding-bottom: 28px;
    }

    .kpis {
        margin-top: 16px;
    }
}
