/* AG Grid in this app's dark mode.
 *
 * AG Grid 33+ replaced the old `ag-theme-alpine-dark` stylesheet with a Theming API: it generates
 * one class per grid and emits every parameter onto that element as
 *
 *     :where(.ag-theme-params-N) { --ag-background-color: var(--ag-inherited-background-color, #fff); ... }
 *
 * with the rest derived from those roots, e.g.
 *
 *     --ag-chrome-background-color: color-mix(in srgb, var(--ag-background-color), var(--ag-foreground-color) 2%)
 *
 * Two consequences decide everything below.
 *
 * **Set the `--ag-inherited-*` hooks, not the `--ag-*` ones.** A derived value is substituted at
 * the element where it is declared — the generated one — so redefining `--ag-background-color`
 * further down leaves every colour derived from it still light. That is how you get a grid whose
 * header obeys you and whose rows stay white.
 *
 * **Set them on the generated element itself.** The `--ag-inherited-*` properties are registered
 * as non-inheriting, so putting them on `<html>` next to Mantine's own colour-scheme attribute
 * does nothing at all. That element has no stable class of its own — the generated name carries a
 * counter — but it is always the parent of `.ag-root-wrapper`, which `:has()` can say directly.
 *
 * The `:where()` in AG Grid's own rule has zero specificity, so nothing here needs `!important`.
 *
 * Only the three roots are set. Headers, borders, hover, row striping, inputs, menus and the
 * checkbox accent all recompute from them, which is why this file is short and why it should stay
 * that way: a value pinned here by hand is one that stops tracking the palette.
 *
 * Colours are the `dark` palette from theme.js — [6]/[7] #111111 page and card, [0] #e8e3e6
 * lightest text — so the grid sits on the same background as the Paper around it. The accent is
 * Mantine blue 4 rather than the blue 6 used in light mode: on #111 the darker blue goes muddy.
 */

[data-mantine-color-scheme="dark"] div:has(> .ag-root-wrapper) {
    --ag-inherited-background-color: #111111;
    --ag-inherited-foreground-color: #e8e3e6;
    --ag-inherited-accent-color: #4dabf7;
}
