﻿.budget-layout {
    display: block;
    min-height: 100%;
}

.budget-grid {
    display: grid;
    grid-template-rows: auto auto 1fr;
    gap: 14px;
    min-height: 100%;
}

.budget-kpi-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.budget-kpi-card,
.budget-detail-card,
.budget-table-card {
    border-radius: 18px;
    padding: 16px;
    background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(250,250,250,0.72));
    border: 1px solid rgba(72, 113, 159, 0.12);
    box-shadow: 0 12px 28px rgba(53, 55, 71, 0.05);
    min-height: 0;
}

.budget-kpi-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: center;
    min-height: 96px;
}

.budget-kpi-highlight {
    background: linear-gradient(135deg, rgba(72, 113, 159, 0.14), rgba(130, 208, 213, 0.18));
    border-color: rgba(72, 113, 159, 0.20);
}

.budget-kpi-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-soft);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.budget-kpi-value {
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--surface-dark);
    line-height: 1.1;
}

.budget-split-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.budget-detail-card .section-card-header,
.budget-table-card .section-card-header {
    margin-bottom: 12px;
}

.budget-metric-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 14px;
}

.budget-metric-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255,255,255,0.64);
    border: 1px solid rgba(72, 113, 159, 0.08);
}

.budget-metric-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-soft);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.budget-metric-value {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--surface-dark);
}

.budget-table-card {
    display: flex;
    flex-direction: column;
}

.budget-table-wrapper {
    overflow: auto;
    border-radius: 14px;
    border: 1px solid rgba(72, 113, 159, 0.10);
    background: rgba(255,255,255,0.55);
}

.budget-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 0.88rem;
}

    .budget-table thead th {
        position: sticky;
        top: 0;
        z-index: 1;
        background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(241,244,248,0.96));
        color: var(--surface-dark);
        font-weight: 800;
        text-align: left;
        padding: 10px;
        border-bottom: 1px solid rgba(72, 113, 159, 0.16);
        white-space: nowrap;
    }

    .budget-table tbody td {
        padding: 10px;
        border-bottom: 1px solid rgba(72, 113, 159, 0.10);
        color: var(--text);
        vertical-align: middle;
    }

    .budget-table tbody tr:hover {
        background: rgba(130, 208, 213, 0.08);
    }

    .budget-table th:first-child,
    .budget-table td:first-child {
        width: 110px;
        font-weight: 700;
    }

.budget-total-row td {
    font-weight: 800;
    background: rgba(72, 113, 159, 0.06);
}

.budget-delta-positive {
    color: #1f7a3d;
    font-weight: 700;
}

.budget-delta-negative {
    color: #b42318;
    font-weight: 700;
}

.budget-delta-neutral {
    color: var(--text-soft);
    font-weight: 700;
}

@media (max-width: 1200px) {
    .budget-kpi-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .budget-split-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .budget-kpi-row {
        grid-template-columns: 1fr;
    }

    .budget-metric-list {
        grid-template-columns: 1fr;
    }

    .budget-kpi-value {
        font-size: 1.3rem;
    }

    .budget-table {
        font-size: 0.8rem;
    }
}
