/* /admin/inventory — flush full-shell host + the product workbench grid.
 *
 * The dfl workbench fills every pixel of AppShellMain, pinned beneath the
 * ~70px header (mirror of .sg-flush-shell / .ts-flush-shell). The page title
 * lives inside the Products tab so nothing pushes the dfl down.
 */
.adinv-flush-shell {
    position:    fixed;
    top:         var(--app-shell-header-offset, 56px);
    left:        var(--app-shell-navbar-offset, 0px);
    right:       0;
    bottom:      0;
    z-index:     10;
    background:  var(--mantine-color-body);
    border-top:  1px solid var(--mantine-color-default-border);
    overflow:    hidden;
}

.adinv-flush-shell > #adinv-flex-host > .flexlayout__layout {
    height: 100%;
    width:  100%;
}

/*
 * Status group-header rows (rowClassRules sets ``adinv-grp-row``) read as
 * bold, tinted section dividers; the per-row thumbnail (markdown image cell)
 * is constrained so the 44px row height holds. Both theme classes are targeted
 * because Mantine tokens are color-scheme aware and the grid toggles between
 * ``ag-theme-quartz`` and ``ag-theme-quartz-dark`` with the app scheme. */

#adinv-grid .adinv-grp-row {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.74em;
    letter-spacing: 0.04em;
    background: var(--mantine-color-default-hover);
}

#adinv-grid .ag-cell img {
    max-height: 30px;
    max-width: 44px;
    border-radius: 3px;
    object-fit: cover;
    vertical-align: middle;
}

/* The pinned bottom totals row reads as a quiet footer. */
#adinv-grid .ag-floating-bottom .ag-cell {
    font-weight: 600;
}

/* Selected-row highlight — a deliberate dark slate when a product row is the
 * active selection. This OVERRIDES the app-wide quartz selection tint set in
 * admin_map_tilesets.css (a tidal/mint `--ag-selected-row-background-color`,
 * served on every page), but scoped to THIS grid only via the id selector
 * (specificity 1,1,0 beats the global `.ag-theme-quartz*` 0,1,0) so the
 * tilesets/userbase grids keep their mint selection. #363c42 is an intentional
 * fixed brand colour requested for the inventory grid — not a theme token — so
 * it stays constant in both light and dark mode; the near-white foreground keeps
 * the cell text legible on the slate in either scheme. */
#adinv-grid.ag-theme-quartz,
#adinv-grid.ag-theme-quartz-dark,
#adinv-grid .ag-theme-quartz,
#adinv-grid .ag-theme-quartz-dark {
    --ag-selected-row-background-color: #363c42;
}

#adinv-grid .ag-row-selected,
#adinv-grid .ag-row-selected .ag-cell {
    color: var(--mantine-color-gray-0);
}

/* Hovering an already-selected row lifts the slate a touch (#424a52) so it still
 * reads as interactive, instead of the flat selection colour washing it out. */
#adinv-grid .ag-row-selected.ag-row-hover {
    --ag-row-hover-color: #424a52;
}

/* AI-suggested cells — the "AI review & migrate" pass tints the cells it
 * proposes changing (cellClassRules in _grid_columns: price / category) and the
 * AI indicator column, with the "current → suggested" value shown inline. A
 * translucent brass reads on both light + dark without a colour-scheme-keyed
 * re-render (the documented alpha-over-scheme-token preference). */
#adinv-grid .adinv-cell-suggest {
    background-color: color-mix(in srgb, var(--mantine-color-brass-5) 20%, transparent);
    box-shadow: inset 2px 0 0 var(--mantine-color-brass-filled);
    font-weight: 600;
}
