/* ==========================================================================
   committee-budget.css — Member Portal Committee Budget & Balance (Phase 4)
   Token-pure, no raw hex/colors, 44px min targets, 16px inputs, D21 focus.
   ========================================================================== */

#cm-budget-root {
    display: flex;
    flex-direction: column;
    gap: var(--oecta-space-xl);
    width: 100%;
}

.cb-view {
    display: flex;
    flex-direction: column;
    gap: var(--oecta-space-xl);
    width: 100%;
}

/* ── Top Navigation / Back Bar ────────────────────────────────────────── */
.cb-nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--oecta-space-md);
    flex-wrap: wrap;
}

.cb-back-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--oecta-space-sm);
    min-height: 44px;
    padding: var(--oecta-space-sm) var(--oecta-space-md);
    background: var(--oecta-surface-lowest);
    border: 1px solid var(--oecta-border);
    border-radius: var(--oecta-radius-md);
    color: var(--oecta-primary);
    font-size: var(--oecta-text-sm);
    font-weight: var(--oecta-font-semibold);
    cursor: pointer;
    text-decoration: none;
    transition: background var(--oecta-duration-fast) var(--oecta-ease-default),
                border-color var(--oecta-duration-fast) var(--oecta-ease-default);
}

.cb-back-btn:hover {
    background: var(--oecta-surface-container);
    border-color: var(--oecta-primary);
}

.cb-back-btn:focus-visible {
    outline: 2px solid var(--oecta-focus-ring);
    outline-offset: 2px;
}

.cb-fy-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--oecta-space-xs);
    min-height: 32px;
    padding: var(--oecta-space-xs) var(--oecta-space-md);
    background: var(--oecta-surface-container);
    border-radius: var(--oecta-radius-full);
    font-size: var(--oecta-text-xs);
    font-weight: var(--oecta-font-semibold);
    color: var(--oecta-on-surface);
}

/* ── Header Card ───────────────────────────────────────────────────────── */
.cb-header-card {
    background: var(--oecta-surface-lowest);
    border-radius: var(--oecta-radius-xl);
    padding: var(--oecta-space-xl);
    box-shadow: var(--portal-shadow);
    display: flex;
    flex-direction: column;
    gap: var(--oecta-space-sm);
    position: relative;
    overflow: hidden;
}

.cb-header-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--oecta-primary);
}

.cb-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--oecta-space-md);
    flex-wrap: wrap;
}

.cb-title-group {
    display: flex;
    align-items: center;
    gap: var(--oecta-space-md);
}

.cb-title-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--oecta-radius-md);
    background: var(--oecta-surface-container);
    color: var(--oecta-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cb-title-text {
    margin: 0;
    font-size: var(--oecta-text-xl);
    font-weight: var(--oecta-font-bold);
    color: var(--oecta-on-surface);
}

.cb-gl-code {
    display: inline-flex;
    align-items: center;
    padding: var(--oecta-space-2xs) var(--oecta-space-sm);
    border-radius: var(--oecta-radius-sm);
    background: var(--oecta-surface-container-high);
    color: var(--oecta-on-surface-subtle);
    font-size: var(--oecta-text-xs);
    font-family: monospace;
    font-weight: var(--oecta-font-semibold);
}

.cb-subtitle {
    margin: 0;
    font-size: var(--oecta-text-sm);
    color: var(--oecta-on-surface-subtle);
}

/* ── Honest Empty / Notice Banner ──────────────────────────────────────── */
.cb-notice-banner {
    display: flex;
    align-items: flex-start;
    gap: var(--oecta-space-md);
    padding: var(--oecta-space-md) var(--oecta-space-lg);
    background: var(--oecta-surface-container);
    border-left: 4px solid var(--oecta-accent);
    border-radius: var(--oecta-radius-md);
    color: var(--oecta-on-surface);
}

.cb-notice-banner .material-icons-outlined {
    color: var(--oecta-accent);
    font-size: 24px;
    flex-shrink: 0;
    margin-top: 2px;
}

.cb-notice-content {
    display: flex;
    flex-direction: column;
    gap: var(--oecta-space-2xs);
    font-size: var(--oecta-text-sm);
}

.cb-notice-title {
    font-weight: var(--oecta-font-bold);
    color: var(--oecta-on-surface);
}

.cb-notice-desc {
    margin: 0;
    color: var(--oecta-on-surface-subtle);
    line-height: 1.5;
}

/* ── KPI Stat Cards Grid ───────────────────────────────────────────────── */
.cb-kpis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--oecta-space-md);
}

.cb-kpi-card {
    background: var(--oecta-surface-lowest);
    border-radius: var(--oecta-radius-lg);
    padding: var(--oecta-space-lg);
    box-shadow: var(--portal-shadow);
    display: flex;
    flex-direction: column;
    gap: var(--oecta-space-xs);
    transition: transform var(--oecta-duration-fast) var(--oecta-ease-default);
}

.cb-kpi-lbl {
    font-size: var(--oecta-text-xs);
    font-weight: var(--oecta-font-semibold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--oecta-on-surface-subtle);
}

.cb-kpi-val {
    font-size: var(--oecta-text-2xl);
    font-weight: var(--oecta-font-bold);
    color: var(--oecta-on-surface);
    font-variant-numeric: tabular-nums;
}

.cb-kpi-sub {
    font-size: var(--oecta-text-xs);
    color: var(--oecta-on-surface-subtle);
}

.cb-kpi-card--remaining {
    border-left: 4px solid var(--oecta-primary);
}

.cb-kpi-card--over {
    border-left: 4px solid var(--oecta-error);
}

.cb-kpi-card--over .cb-kpi-val {
    color: var(--oecta-error-text);
}

/* ── Progress Bar Wrap ─────────────────────────────────────────────────── */
.cb-progress-card {
    background: var(--oecta-surface-lowest);
    border-radius: var(--oecta-radius-lg);
    padding: var(--oecta-space-lg);
    box-shadow: var(--portal-shadow);
    display: flex;
    flex-direction: column;
    gap: var(--oecta-space-sm);
}

.cb-progress-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--oecta-space-md);
    font-size: var(--oecta-text-sm);
    font-weight: var(--oecta-font-semibold);
}

.cb-progress-title {
    color: var(--oecta-on-surface);
}

.cb-progress-pct {
    color: var(--oecta-primary);
    font-variant-numeric: tabular-nums;
}

.cb-bar-track {
    width: 100%;
    height: 12px;
    background: var(--oecta-surface-container);
    border-radius: var(--oecta-radius-full);
    overflow: hidden;
    position: relative;
}

.cb-bar-fill {
    height: 100%;
    border-radius: var(--oecta-radius-full);
    transition: width var(--oecta-duration-slow) var(--oecta-ease-default);
}

.cb-bar--ok {
    background: var(--oecta-primary);
}

.cb-bar--warn {
    background: var(--oecta-accent);
}

.cb-bar--over {
    background: var(--oecta-error);
}

/* ── Claims Ledger Table Card ──────────────────────────────────────────── */
.cb-ledger-card {
    background: var(--oecta-surface-lowest);
    border-radius: var(--oecta-radius-xl);
    padding: var(--oecta-space-xl);
    box-shadow: var(--portal-shadow);
    display: flex;
    flex-direction: column;
    gap: var(--oecta-space-md);
}

.cb-ledger-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--oecta-space-md);
    flex-wrap: wrap;
}

.cb-ledger-title {
    margin: 0;
    font-size: var(--oecta-text-lg);
    font-weight: var(--oecta-font-bold);
    color: var(--oecta-on-surface);
}

.cb-ledger-count {
    font-size: var(--oecta-text-xs);
    font-weight: var(--oecta-font-semibold);
    color: var(--oecta-on-surface-subtle);
    background: var(--oecta-surface-container);
    padding: var(--oecta-space-2xs) var(--oecta-space-sm);
    border-radius: var(--oecta-radius-full);
}

.cb-table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.cb-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--oecta-text-sm);
    text-align: left;
}

.cb-table th {
    padding: var(--oecta-space-sm) var(--oecta-space-md);
    font-size: var(--oecta-text-xs);
    font-weight: var(--oecta-font-semibold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--oecta-on-surface-subtle);
    border-bottom: 1px solid var(--oecta-border);
    white-space: nowrap;
}

.cb-table td {
    padding: var(--oecta-space-md);
    border-bottom: 1px solid var(--oecta-border);
    color: var(--oecta-on-surface);
    vertical-align: middle;
}

.cb-table tr:last-child td {
    border-bottom: none;
}

.cb-table tr:hover td {
    background: var(--oecta-surface-container-low);
}

.cb-amount-col {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: var(--oecta-font-semibold);
    white-space: nowrap;
}

.cb-status-badge {
    display: inline-flex;
    align-items: center;
    padding: var(--oecta-space-2xs) var(--oecta-space-sm);
    border-radius: var(--oecta-radius-full);
    font-size: var(--oecta-text-xs);
    font-weight: var(--oecta-font-semibold);
    white-space: nowrap;
}

.cb-status-badge--approved,
.cb-status-badge--paid {
    background: color-mix(in srgb, var(--oecta-primary) 15%, transparent);
    color: var(--oecta-primary);
}

.cb-status-badge--submitted,
.cb-status-badge--under-review {
    background: color-mix(in srgb, var(--oecta-accent) 20%, transparent);
    color: var(--oecta-on-surface);
}

.cb-status-badge--draft {
    background: var(--oecta-surface-container);
    color: var(--oecta-on-surface-subtle);
}

/* ── Empty State ───────────────────────────────────────────────────────── */
.cb-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--oecta-space-2xl) var(--oecta-space-lg);
    gap: var(--oecta-space-sm);
}

.cb-empty-icon {
    font-size: 48px;
    color: var(--oecta-on-surface-subtle);
    opacity: 0.6;
}

.cb-empty-title {
    margin: 0;
    font-size: var(--oecta-text-base);
    font-weight: var(--oecta-font-semibold);
    color: var(--oecta-on-surface);
}

.cb-empty-desc {
    margin: 0;
    max-width: 440px;
    font-size: var(--oecta-text-sm);
    color: var(--oecta-on-surface-subtle);
    line-height: 1.5;
}

/* ── Responsive adjustments ────────────────────────────────────────────── */
@media (max-width: 768px) {
    .cb-header-card {
        padding: var(--oecta-space-lg);
    }

    .cb-kpis-grid {
        grid-template-columns: 1fr 1fr;
    }

    .cb-table th,
    .cb-table td {
        padding: var(--oecta-space-sm);
    }
}

@media (max-width: 480px) {
    .cb-kpis-grid {
        grid-template-columns: 1fr;
    }
}
