﻿:root {
    --bt-accent: #0b5f8b; /* цвет кнопки */
    --bt-surface: #ffffff;
    --bt-text: #0f172a;
    --bt-muted: #64748b;
    --bt-line: rgba(15, 23, 42, .10);
    --bt-line-strong: rgba(15, 23, 42, .18);
    --bt-head-bg: #ffffff;
    --bt-head1-h: 46px;
    --bt-head2-h: 42px;
    --bt-hover: rgba(11,95,139,.06);
    --bt-total: rgba(11,95,139,.10);
    --bt-free-bg: rgba(11,95,139,.05); /* акцент “Свободно” */
}

/* ===== Container ===== */
.budget-table-wrap {
    max-height: 70vh;
    overflow: auto;
    background: var(--bt-surface);
    border-radius: 16px;
    border: 1px solid rgba(15, 23, 42, .08);
    box-shadow: 0 10px 30px rgba(15, 23, 42, .06);
    /* Firefox */
    scrollbar-width: thin;
    scrollbar-color: rgba(11,95,139,.35) transparent;
}

    /* WebKit scrollbar */
    .budget-table-wrap::-webkit-scrollbar {
        width: 6px;
        height: 6px;
    }

    .budget-table-wrap::-webkit-scrollbar-track {
        background: transparent;
    }

    .budget-table-wrap::-webkit-scrollbar-thumb {
        background: rgba(11,95,139,.35);
        border-radius: 6px;
    }

        .budget-table-wrap::-webkit-scrollbar-thumb:hover {
            background: rgba(11,95,139,.55);
        }

/* ===== Table base ===== */
.budget-table {
    width: 100%;
    margin: 0;
    border-collapse: separate; /* sticky-friendly */
    border-spacing: 0; /* важно: без дыр */
    background: var(--bt-surface);
}

    .budget-table th,
    .budget-table td {
        padding: .75rem 1rem;
        vertical-align: middle;
        background: var(--bt-surface);
    }

        /* ===== Alignments ===== */
        .budget-table td:not(:first-child) {
            text-align: right;
            font-variant-numeric: tabular-nums;
            color: var(--bt-text);
        }

        .budget-table th:not(:first-child) {
            text-align: center;
        }

        .budget-table td:first-child {
            font-weight: 600;
            color: var(--bt-text);
            white-space: nowrap;
        }

    /* ===== Header: borders + sticky 2 rows ===== */
    .budget-table thead th {
        font-weight: 700;
        color: var(--bt-text);
        white-space: nowrap;
        background: var(--bt-head-bg);
        border: 1px solid var(--bt-line) !important;
    }

    /* first header row */
    .budget-table thead tr:nth-child(1) th {
        position: sticky;
        top: 0;
        z-index: 5;
        height: var(--bt-head1-h);
    }

    /* second header row */
    .budget-table thead tr:nth-child(2) th {
        position: sticky;
        top: var(--bt-head1-h);
        z-index: 4;
        height: var(--bt-head2-h);
    }

    /* rowspan header cell (Область) */
    .budget-table thead th[rowspan] {
        position: sticky;
        top: 0;
        z-index: 6;
        background: var(--bt-head-bg);
    }

    /* ===== Body: clean rows (no weird gaps) ===== */
    .budget-table tbody td {
        border-bottom: 1px solid rgba(15, 23, 42, .08);
    }

    /* subtle zebra (very light, optional) */
    .budget-table tbody tr:nth-child(odd) td {
        background: rgba(15,23,42,.015);
    }

    /* hover */
    .budget-table tbody tr:hover td {
        background: var(--bt-hover);
    }

    /* Total row (Kazakhstan first row) */
    .budget-table tbody tr:first-child td {
        background: var(--bt-total);
        font-weight: 800;
        border-bottom-color: rgba(11,95,139,.18);
    }

    .budget-table tbody tr:first-child:hover td {
        background: rgba(11,95,139,.12);
    }

    /* ===== Visual separation ОСМС / ГОБМП ===== */
    /* Start of ГОБМП block column (5th) */
    .budget-table thead th:nth-child(5),
    .budget-table tbody td:nth-child(5) {
        border-left: 2px solid var(--bt-line-strong) !important;
    }

    /* ===== “Свободно” highlight (both blocks) ===== */
    /* Свободно ОСМС = 4th col, Свободно ГОБМП = 7th col */
    .budget-table tbody td:nth-child(4),
    .budget-table tbody td:nth-child(7) {
        font-weight: 700;
    }

    /* Keep hover stronger than highlight */
    .budget-table tbody tr:hover td:nth-child(4),
    .budget-table tbody tr:hover td:nth-child(7) {
        background: rgba(11,95,139,.09);
    }

    /* ===== Numbers look calmer (reduce “noise”) ===== */
    .budget-table tbody td:not(:first-child) {
        color: rgba(15,23,42,.88);
    }
