/* =========================================================
   UI HOTFIX V7.3 — legacy Dash tables + Distribution matrix
   Loaded after style.css so these rules only override the
   remaining legacy surfaces that were still visually inconsistent.
   ========================================================= */

/* Day Parts + Hourly Performance still use dash_table.DataTable.
   Bring them onto the same warm TucoData table palette as Tabulator. */
#p10-table-container .dash-spreadsheet-container,
#p09-hourly-table .dash-spreadsheet-container {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--surface);
}

#p10-table-container .dash-spreadsheet-container .dash-spreadsheet-inner th,
#p09-hourly-table .dash-spreadsheet-container .dash-spreadsheet-inner th {
    background-color: var(--grid-header) !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
    font-weight: var(--fw-semibold) !important;
}

#p10-table-container .dash-spreadsheet-container .dash-spreadsheet-inner td,
#p09-hourly-table .dash-spreadsheet-container .dash-spreadsheet-inner td {
    background-color: var(--surface) !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
}

#p10-table-container .dash-spreadsheet-container .dash-spreadsheet-inner tr:nth-child(even) td,
#p09-hourly-table .dash-spreadsheet-container .dash-spreadsheet-inner tr:nth-child(even) td {
    background-color: var(--grid-stripe) !important;
}

/* Distribution has exactly seven weekday rows. The global Tabulator maxHeight
   is useful for long grids, but here it can create a pointless vertical
   scrollbar beside the real horizontal scrollbar. Let this matrix grow to
   its natural height and keep horizontal scrolling only. */
#p32-matrix-grid {
    max-height: none !important;
}

#p32-matrix-grid .tabulator-tableHolder {
    max-height: none !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scrollbar-gutter: auto;
}

/* Keep the one useful scrollbar small and visually neutral. */
#p32-matrix-grid .tabulator-tableHolder::-webkit-scrollbar {
    height: 8px;
    width: 0;
}

#p32-matrix-grid .tabulator-tableHolder::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 999px;
}

#p32-matrix-grid .tabulator-tableHolder::-webkit-scrollbar-track {
    background: transparent;
}
