#budget-tracking-page {
    background: var(--bg);
    color: var(--text);
    /* Reduced base font size to fit more columns */
    font: 12px/1.4 system-ui, -apple-system, sans-serif;
    padding: 15px; 
    max-width: 100%;
    box-sizing: border-box;
}

/* Reduced Chart Height to keep more of the table visible */
#budget-tracking-page .chart-container { 
    height: 300px; /* Reduced from 450px */
    margin-bottom: 20px; 
    width: 100%; 
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
}

/* TABLE WRAPPER - Crucial for preventing page-break */
#budget-tracking-page .table-container { 
    overflow-x: auto; 
    max-width: 100%;
    border: 1px solid var(--border); 
    border-radius: 8px;
    background: var(--panel);
}

#budget-tracking-page table { 
    width: 100%; 
    border-collapse: separate; 
    border-spacing: 0;
    /* Extra-small font for the wide table */
    font-size: 11px; 
    white-space: nowrap; 
}

#budget-tracking-page th, 
#budget-tracking-page td { 
    border-bottom: 1px solid var(--border); 
    border-right: 1px solid var(--border);
    /* Tighter padding to save width */
    padding: 6px 8px; 
    text-align: right; 
}

/* Sticky Column Adjustment */
#budget-tracking-page td:first-child, 
#budget-tracking-page th:first-child { 
    position: sticky; 
    left: 0; 
    background: #132033; 
    z-index: 3; 
    min-width: 120px; /* Constraints width of the category column */
}

/* Compression for the Labels */
.history-label, .forecast-label {
    padding: 4px !important;
    font-size: 10px;
    letter-spacing: 0.5px;
    text-align: center !important; 
}