/* ==========================================================================
   Onix DataGrid — the look of Components/Shared/Grid/DataGrid.razor, a data
   grid modelled on the DevExpress GridView and drawn with the OnixBI tokens
   (onix-theme.css · onix-glass.css). Behaviour lives in the component and in
   js/onix-datagrid.js; this sheet is only the surface.

   Anatomy (top to bottom, all inside one rounded frame):

     .dxg-toolbar       the page's controls · search · grid tools
       .dxg-title       the page's heading, at the row's start (Breadcrumbs → PageTitleSlot)
       .dxg-groupby     StickyToolbar: "Group by" + the group chips, in the row
       .dxg-hint        a page's word that rides in the row (where to drop files): glyph, a word, a tooltip
       .dxg-toppager    PagerPosition Top: "1-50 / 312" · ◀ ▶ · page size
       .dxg-toolbar-end ToolbarEndContent: the page's view switcher, last
     .dxg-grouppanel    "Drag a column header here…" / the group chips
     .dxg-notices       the page's word on the list (a digitization, a hint)
     .dxg-scroll        the scrolling body: sticky header, filter row, rows,
       table.dxg-table  group rows, detail rows, sticky totals footer
                        (.dxg-fit: Fit to screen — as wide as the grid, no sideways scroll)
     .dxg-alt           AlternateContent: another view of the list in the table's place (a kanban)
     .dxg-filterpanel   the active filter, spelled out, with Clear
     .dxg-pager         page x of y · page buttons · page size
     .dxg-popup         column chooser · header filter · menus (fixed, placed by JS)

   Presets: .dxg-full fills the window and scrolls inside (fixed header and
   pager, like a dx grid with a height); .dxg-compact is as tall as its rows.
   .dxg-toolbar.dxg-sticky is a control row that stays in view while the page
   scrolls (Odoo's control panel — every Full grid's, with the page's heading
   in it: the shell's bar, then this row, are all that stands over the rows);
   .dxg-unpinned an ordinary scrolling table (no pinned action column, no
   sticky totals — the header row alone stays). Rows are 30px, heads 30px:
   a list is read, not browsed.

   The first block restyles every plain table.grid that is NOT a DataGrid
   (report matrices, the odd hand-made table) so the two read as one family.
   Every colour is a token; the rgba tints below are the only literals.
   ========================================================================== */

:root {
    --dx-row-hover:    rgba(0, 113, 227, 0.06);
    --dx-row-selected: rgba(0, 113, 227, 0.11);
    --dx-header-bg:    var(--panel);

    /* Opaque twins of the tints: sticky cells must hide what scrolls under them. */
    --dxg-surface:     var(--panel);
    --dxg-head:        var(--panel-2);
    --dxg-hover:       color-mix(in srgb, var(--brand) 5%, var(--panel));
    --dxg-selected:    color-mix(in srgb, var(--brand) 10%, var(--panel));
    --dxg-focused:     color-mix(in srgb, var(--brand) 16%, var(--panel));
    --dxg-group:       color-mix(in srgb, var(--ink) 3%, var(--panel));
    --dxg-mark:        #FBE3A6;
    --dxg-mark-ink:    #12171D;
    --dxg-radius:      14px;
}

:root[data-theme="dark"] {
    --dx-row-hover:    rgba(41, 151, 255, 0.12);
    --dx-row-selected: rgba(41, 151, 255, 0.22);
    --dx-header-bg:    rgba(255, 255, 255, 0.03);
    --dxg-hover:       color-mix(in srgb, var(--brand) 9%, var(--panel));
    --dxg-selected:    color-mix(in srgb, var(--brand) 16%, var(--panel));
    --dxg-focused:     color-mix(in srgb, var(--brand) 24%, var(--panel));
    --dxg-group:       color-mix(in srgb, var(--ink) 5%, var(--panel));
    --dxg-mark:        #7A5A12;
    --dxg-mark-ink:    #FFFFFF;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --dx-row-hover:    rgba(41, 151, 255, 0.12);
        --dx-row-selected: rgba(41, 151, 255, 0.22);
        --dx-header-bg:    rgba(255, 255, 255, 0.03);
        --dxg-hover:       color-mix(in srgb, var(--brand) 9%, var(--panel));
        --dxg-selected:    color-mix(in srgb, var(--brand) 16%, var(--panel));
        --dxg-focused:     color-mix(in srgb, var(--brand) 24%, var(--panel));
        --dxg-group:       color-mix(in srgb, var(--ink) 5%, var(--panel));
        --dxg-mark:        #7A5A12;
        --dxg-mark-ink:    #FFFFFF;
    }
}

/* ─── Plain table.grid (not a DataGrid): same family, no behaviour ─────── */

table.grid thead th {
    background: var(--dx-header-bg);
    font-weight: 660;
    color: var(--ink-soft);
    border-bottom: 1px solid var(--line-strong);
    user-select: none;
}
table.grid tbody tr:hover { background: var(--dx-row-hover); }
table.grid tbody tr.selected,
table.grid tbody tr.selected:hover { background: var(--dx-row-selected); }
table.grid tbody tr.selected td:first-child { box-shadow: inset 2px 0 0 var(--brand); }

/* Line editors and read-only line lists inside forms and detail rows. */
table.lines thead th { border-bottom: 1px solid var(--line-strong); color: var(--ink-soft); }
table.lines tbody tr:hover { background: var(--dx-row-hover); }
table.lines th.num, table.lines td.num { text-align: right; font-variant-numeric: tabular-nums; }
/* IDE-034: a row of the statement-mapping preview whose type is in neither sign list ('?') — tinted as a warning, in
   the theme's soft amber (light and dark). */
table.lines tbody tr.mapping-row-unknown > td { background: var(--warn-soft); }

/* ─── Frame ────────────────────────────────────────────────────────────── */

.dxg {
    position: relative;
    min-width: 0;
    margin: 0 0 12px;
    font-size: 0.88rem;
}
.dxg-frame {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--dxg-surface);
    border: 1px solid var(--line);
    border-radius: var(--dxg-radius);
    box-shadow: var(--glass-shadow, var(--shadow-sm));
    overflow: hidden;
    overflow: clip;
}
.dxg-compact { --dxg-radius: 10px; margin-bottom: 10px; }
.dxg-compact > .dxg-frame { box-shadow: var(--shadow-xs); }
/* A grid inside a detail row or a card sits flush: the host is the card. */
.dxg-detail .dxg:last-child, .form-card .dxg:last-child, .card .dxg:last-child { margin-bottom: 0; }

/* ─── Toolbar ──────────────────────────────────────────────────────────── */

.dxg-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 10px;
    padding: 5px 10px;
    background: var(--dxg-head);
    border-bottom: 1px solid var(--line);
}
/* The page's heading in the row: the trail's h2, as large as the row allows, the controls after it. */
.dxg-title {
    flex: none;
    max-width: 30vw;
    margin: 0 4px 0 2px;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.2;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dxg-title + .dxg-toolbar-main:not(:empty) { padding-left: 8px; border-left: 1px solid var(--line); }
/* A page's hint in the row (the invoice list's "Drop PDFs here"): a quiet chip — the glyph, a word, the whole
   sentence as its tooltip; on a tight window the glyph alone. */
.dxg-hint {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex: none;
    height: 28px;
    margin: 0;              /* not app.css's .dropzone-hint banner */
    padding: 0 8px;
    border: 1px dashed var(--line-strong);
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.78rem;
    white-space: nowrap;
    cursor: help;
}
.dxg-hint__glyph { font-size: 0.9rem; line-height: 1; }
@media (max-width: 1500px) {
    .dxg-hint { padding: 0 7px; }
    .dxg-hint__text { display: none; }
}
/* The page's controls keep the .toolbar look of their inputs, without its box. */
.dxg .dxg-toolbar-main.toolbar {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}
.dxg-toolbar-main:empty { display: none; }
.dxg-tools { display: flex; align-items: center; gap: 2px; margin-left: auto; }

.dxg-search { position: relative; display: inline-flex; align-items: center; margin-right: 4px; }
.dxg-search svg {
    position: absolute; left: 10px;
    width: 14px; height: 14px;
    color: var(--muted);
    pointer-events: none;
}
.dxg-search input {
    width: 190px;
    height: 28px;
    padding: 0 10px 0 29px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: var(--dxg-surface);
    color: var(--ink);
    font: inherit;
    font-size: 0.84rem;
    transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), width 0.2s var(--ease);
}
.dxg-search input:hover { border-color: var(--muted-2); }
.dxg-search input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring); width: 240px; }
.dxg-search input::placeholder { color: var(--muted-2); }
.dxg-search input::-webkit-search-cancel-button { -webkit-appearance: none; }

.dxg-tool {
    display: inline-grid;
    place-items: center;
    width: 28px; height: 28px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 8px;
    background: none;
    color: var(--ink-soft);
    cursor: pointer;
    transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.dxg-tool svg { width: 16px; height: 16px; }
.dxg-tool:hover { background: var(--panel-hover); color: var(--ink); }
.dxg-tool.active { background: var(--brand-soft); color: var(--brand-strong); }
.dxg-tool:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
/* An export under way (all the rows of a server-paged list are being read): the button waits. */
.dxg-tool.is-busy, .dxg-tool:disabled { cursor: progress; opacity: 0.55; }

/* StickyToolbar: one control row that stays in view while the page scrolls — under the shell's top bar
   at the offset of the editor's control bar (.page-trail.has-record, css/onix-trail.css), and under that
   bar while it stays in view (--trail-h, js/onix-trail.js; 0 while a list shows alone) — above the rows.
   The page's controls take the height of the grid's tools, so the row is one line as long as the window
   allows; past that it wraps, the search, the tools and the pager keeping the right end. */
.dxg-toolbar.dxg-sticky {
    position: sticky;
    top: calc(var(--shell-gap) + var(--shell-bar-h) + 8px + var(--trail-h, 0px) + min(var(--trail-h, 0px), 6px));
    z-index: 5;
    gap: 4px 6px;
    padding: 4px 8px;
}
.dxg .dxg-sticky > .dxg-toolbar-main.toolbar { flex: 0 1 auto; gap: 5px; }
.dxg-sticky .dxg-toolbar-main .button { padding: 4px 9px; font-size: 0.8rem; }
.dxg-sticky .dxg-toolbar-main select { padding: 4px 6px; font-size: 0.8rem; }
.dxg-sticky .dxg-toolbar-main label.inline { gap: 4px; font-size: 0.8rem; }
/* A select as wide as the choice it shows, not as its longest one (where the browser can). */
.dxg-sticky select { field-sizing: content; }
.dxg-sticky .dxg-search input { width: 130px; }
.dxg-sticky .dxg-search input:focus { width: 220px; }
/* A control's caption in the row ("E-invoice"): a tight window drops the word, the control's tooltip keeps it. */
.dxg-caption { color: var(--muted); }
@media (max-width: 1600px) {
    .dxg-sticky .dxg-caption { display: none; }
    .dxg-sticky .dxg-search input { width: 110px; }
    .dxg-sticky .dxg-search input:focus { width: 200px; }
    .dxg-sticky .dxg-tools { gap: 0; }
}
.dxg-sticky .dxg-toppager, .dxg-sticky .dxg-toolbar-end { margin-left: 2px; padding-left: 6px; }
/* Rows ticked (the page says so with has-selection): the actions over them have the filters' place, and the
   grouping gives way too while nothing is grouped — Odoo's list with records selected — so the row stays one
   line; an active grouping keeps its chips in view. */
.dxg.has-selection .dxg-groupby:not(:has(.dxg-chip)) { display: none; }

/* The grouping in the row: a pill select of the columns, then the groups as brand chips. Like the group
   panel it takes a dragged header (data-dxg-zone="group"). */
.dxg-groupby { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; min-width: 0; border-radius: 10px; }
.dxg-groupby.dxg-drop-hot { background: var(--brand-soft); outline: 2px dashed var(--brand); outline-offset: 3px; }
.dxg-groupby-pick { position: relative; display: inline-flex; align-items: center; }
.dxg-groupby-pick svg {
    position: absolute; left: 9px;
    width: 15px; height: 15px;
    color: var(--muted);
    pointer-events: none;
}
/* It always reads "Group by" (a pick re-creates it): as wide as that, not as its longest column. */
.dxg-groupby-pick select {
    max-width: 11.5em;
    height: 28px;
    padding: 0 22px 0 29px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: var(--dxg-surface);
    color: var(--ink);
    font: inherit;
    font-size: 0.8rem;
    cursor: pointer;
    transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.dxg-groupby-pick select:hover { border-color: var(--muted-2); }
.dxg-groupby-pick select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring); }
.dxg-groupby .dxg-chip { background: var(--brand-soft); border-color: transparent; color: var(--brand-strong); }
.dxg-groupby .dxg-chip-x { color: inherit; }

/* PagerPosition Top: Odoo's pager at the row's right end — the rows on this page out of all, ◀ ▶, the size. */
.dxg-toppager {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-left: 4px;
    padding-left: 8px;
    border-left: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.dxg-toppager .dxg-pager-selected { margin-right: 6px; }
.dxg-range { padding: 0 4px; color: var(--ink-soft); font-weight: 600; }
/* A server-paged list sorted, filtered or totalled: the title says those cover this page alone. */
.dxg-range.is-partial { text-decoration: underline dotted var(--warn); text-underline-offset: 4px; cursor: help; }
.dxg-pagesize-pick {
    height: 26px;
    margin-left: 2px;
    padding: 0 4px;
    border: 1px solid var(--line-strong);
    border-radius: 7px;
    background: var(--dxg-surface);
    color: var(--ink);
    font: inherit;
    font-size: 0.8rem;
    cursor: pointer;
}
.dxg-pagesize-pick:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 2px var(--ring); }

/* ToolbarEndContent: the page's own end of the row, after the pager — the view switcher of Odoo's control panel. */
.dxg-toolbar-end { display: inline-flex; align-items: center; gap: 4px; margin-left: 4px; padding-left: 8px; border-left: 1px solid var(--line); }
.dxg-toolbar-end .view-switcher { margin-left: 0; }

/* ─── Group panel ──────────────────────────────────────────────────────── */

.dxg-grouppanel {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 36px;
    padding: 4px 12px;
    background: var(--dxg-surface);
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.82rem;
    transition: background var(--dur) var(--ease);
}
.dxg-grouppanel-hint { display: inline-flex; align-items: center; gap: 8px; }
.dxg-grouppanel-hint svg { width: 16px; height: 16px; opacity: 0.7; }
.dxg-grouppanel.dxg-drop-hot {
    background: var(--brand-soft);
    color: var(--brand-strong);
    outline: 2px dashed var(--brand);
    outline-offset: -5px;
}
.dxg-grouppanel-actions { display: inline-flex; gap: 12px; margin-left: auto; }

/* NoticeContent: what the page says about the list — a digitization under way, the drop hint — between
   the control row and the rows. */
.dxg-notices {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 4px 10px;
    background: var(--dxg-surface);
    border-bottom: 1px solid var(--line);
}
/* Nothing to say right now (the page's notices are all conditional, the markup leaves whitespace): no strip. */
.dxg-notices:empty, .dxg-notices:not(:has(*)) { display: none; }
.dxg-notices > * { margin: 0; }
/* The drop hint in there: one slim line (its whole text is its tooltip), not a banner. */
.dxg-notices > .dropzone-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    margin: 0;
    padding: 3px 10px;
    border-radius: 8px;
    font-size: 0.78rem;
    line-height: 1.4;
}
.dxg-notices > .dropzone-hint .dropzone-hint__glyph { flex: none; font-size: 0.9rem; }
.dxg-notices > .dropzone-hint .dropzone-hint__text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.dxg-chip {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: var(--dxg-head);
    color: var(--ink);
    font-weight: 600;
    font-size: 0.82rem;
    cursor: grab;
    overflow: hidden;
}
/* dx joins grouped columns with a little step: level 1 › level 2. */
.dxg-chip + .dxg-chip { position: relative; margin-left: 10px; }
.dxg-chip + .dxg-chip::before {
    content: "";
    position: absolute; left: -12px; top: 50%;
    width: 10px; height: 1px;
    background: var(--line-strong);
}
.dxg-chip-main, .dxg-chip-x {
    display: inline-flex; align-items: center; gap: 6px;
    border: 0; background: none; color: inherit; font: inherit; cursor: pointer;
}
.dxg-chip-main { padding: 4px 4px 4px 10px; }
.dxg-chip-x { padding: 0 8px 0 4px; color: var(--muted); }
.dxg-chip-x svg { width: 12px; height: 12px; }
.dxg-chip-main:hover, .dxg-chip-x:hover { color: var(--brand); }

.dxg-sort { display: inline-flex; align-items: center; color: var(--brand); flex: none; }
.dxg-sort svg { width: 13px; height: 13px; stroke-width: 2.4; }
.dxg-sort sub { font-size: 0.62rem; font-weight: 700; margin-left: 1px; line-height: 1; }

.dxg-link {
    padding: 0; border: 0; background: none;
    color: var(--brand); font: inherit; font-weight: 600; font-size: 0.82rem;
    cursor: pointer;
}
.dxg-link:hover:not(:disabled) { color: var(--brand-strong); text-decoration: underline; }
.dxg-link:disabled { color: var(--muted-2); cursor: default; }

/* ─── The table ────────────────────────────────────────────────────────── */

.dxg-scroll {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    scrollbar-width: thin;
    /* Lets group and detail rows size themselves to the visible width (100cqw), not the table's. */
    container-type: inline-size;
}
/* A page's main grid fills the window and scrolls inside: header, totals and pager stay in view. The chrome over
   and under it — the shell's bar, the control row, a pager at the foot, the page's margins — is about 190px. */
.dxg-full > .dxg-frame > .dxg-scroll { max-height: max(340px, calc(100dvh - 190px)); }
/* Room for the loading panel only while there is nothing to show: a reload must not make a short list jump. */
.dxg.is-loading.is-empty > .dxg-frame > .dxg-scroll { min-height: 170px; }

/* AlternateContent: another view of the same list (the invoice kanban) in the table's place, under the same row. */
.dxg-alt { min-width: 0; padding: 10px; background: var(--dxg-surface); }
.dxg-alt > .kanban { min-height: 0; padding-bottom: 4px; }
/* A row's panel opened from it (a card's Pay…): above the other view, drawn as the table's detail row. */
.dxg-alt-detail {
    padding: 14px 18px 16px;
    background: var(--bg-soft);
    border-bottom: 1px solid var(--line);
    box-shadow: inset 3px 0 0 var(--brand-soft-2);
}
.dxg-alt-detail > .toolbar { margin: 0; }
.dxg.is-loading.is-empty > .dxg-frame > .dxg-alt { min-height: 170px; }

.dxg .dxg-table {
    width: 100%;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    font-size: inherit;
}
.dxg .dxg-table.dxg-fixed { table-layout: fixed; }
.dxg-table th, .dxg-table td { border-radius: 0 !important; }
/* Only header and data cells clip: a group or detail cell that clipped would become the
   scrollport its pinned content sticks to. */
.dxg .dxg-table.dxg-fixed thead th { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Fit to screen: the table is as wide as the grid and never scrolls sideways — a fixed layout whose data columns
   share the width by the percentages the grid gives them (the widths the person dragged, else what the columns
   hold), the action column the width of its widest row (js/onix-datagrid.js: --dxg-fit-command); a cell too narrow
   for its text ends in an ellipsis. The dragged widths are kept for when it is off. */
.dxg .dxg-table.dxg-fit { table-layout: fixed; width: 100%; }
.dxg .dxg-table.dxg-fit thead th,
.dxg .dxg-table.dxg-fit tfoot td { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dxg .dxg-table.dxg-fit tbody tr.dxg-row > td { max-width: none; }
.dxg-scroll.dxg-scroll-fit { overflow-x: hidden; }
.dxg-table col.dxg-col-check { width: 40px; }

/* Header */
.dxg .dxg-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    height: 30px;
    padding: 0 10px;
    background: var(--dxg-head);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    color: var(--ink-soft);
    font-weight: 660;
    border-bottom: 1px solid var(--line-strong);
}
.dxg .dxg-table thead tr.dxg-head th + th { box-shadow: inset 1px 0 0 var(--hairline); }
.dxg .dxg-table thead th.sortable { cursor: pointer; }
.dxg .dxg-table thead th.sortable:hover { color: var(--brand); background: color-mix(in srgb, var(--brand) 6%, var(--dxg-head)); }
.dxg .dxg-table thead th.sorted-asc, .dxg .dxg-table thead th.sorted-desc { color: var(--brand); }
.dxg-th { display: flex; align-items: center; gap: 6px; min-width: 0; }
.dxg-th-title { overflow: hidden; text-overflow: ellipsis; }
th.num > .dxg-th, th.amount > .dxg-th { justify-content: flex-end; }
th.dxg-command > .dxg-th { justify-content: flex-end; }

.dxg-th-btn {
    display: inline-grid; place-items: center;
    flex: none;
    width: 22px; height: 22px;
    margin-left: auto;
    padding: 0;
    border: 0; border-radius: 6px;
    background: none;
    color: var(--muted);
    cursor: pointer;
    opacity: 0;
    transition: opacity var(--dur) var(--ease), background var(--dur) var(--ease), color var(--dur) var(--ease);
}
th.num .dxg-th-btn, th.amount .dxg-th-btn { margin-left: 0; order: -1; margin-right: auto; }
.dxg-th-btn svg { width: 13px; height: 13px; }
th:hover > .dxg-th > .dxg-th-btn, .dxg-th-btn:focus-visible, .dxg-th-btn.active { opacity: 1; }
.dxg-th-btn:hover, .dxg-th-btn.active { background: var(--brand-soft); color: var(--brand-strong); }
th.filtered > .dxg-th > .dxg-th-btn { opacity: 1; color: var(--brand); }
th.filtered > .dxg-th > .dxg-th-btn svg { fill: currentColor; }
@media (pointer: coarse) { .dxg-th-btn { opacity: 0.6; } }

.dxg-resizer {
    position: absolute;
    top: 0; right: 0;
    width: 8px; height: 100%;
    cursor: col-resize;
    touch-action: none;
    z-index: 1;
}
.dxg-resizer::after {
    content: "";
    position: absolute; top: 22%; bottom: 22%; right: 0;
    width: 2px;
    border-radius: 1px;
    background: transparent;
    transition: background var(--dur) var(--ease);
}
.dxg-resizer:hover::after, .dxg-resizer.active::after { background: var(--brand); }
.dxg-resizing, .dxg-resizing * { cursor: col-resize !important; user-select: none; }
.dxg-dragging th[data-dxg-col] { cursor: grabbing; }
.dxg-drag-source { opacity: 0.45; }
.dxg-drop-indicator {
    position: fixed;
    z-index: 130;
    display: none;
    width: 3px;
    border-radius: 2px;
    background: var(--brand);
    box-shadow: 0 0 0 3px var(--ring);
    pointer-events: none;
}

/* Filter row */
.dxg .dxg-table thead tr.dxg-filter-row th {
    top: 30px;
    z-index: 2;
    height: 30px;
    padding: 2px 4px;
    background: var(--dxg-surface);
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
}
.dxg-filter-cell { display: flex; align-items: center; gap: 2px; min-width: 0; }
.dxg-filter-cell input, .dxg-filter-cell select {
    flex: 1 1 auto;
    width: 100%;
    min-width: 40px;
    height: 24px;
    padding: 0 6px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--dxg-surface);
    color: var(--ink);
    font: inherit;
    font-size: 0.8rem;
    transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.dxg-filter-cell input:hover, .dxg-filter-cell select:hover { border-color: var(--line-strong); }
.dxg-filter-cell input:focus, .dxg-filter-cell select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 2px var(--ring); }
th.num .dxg-filter-cell input, th.amount .dxg-filter-cell input { text-align: right; }
.dxg-op {
    flex: none;
    min-width: 22px; height: 24px;
    padding: 0 3px;
    border: 0; border-radius: 6px;
    background: none;
    color: var(--muted);
    font: inherit; font-size: 0.78rem; font-weight: 700;
    cursor: pointer;
}
.dxg-op:hover { background: var(--brand-soft); color: var(--brand-strong); }
.dxg-op svg, .dxg-menu-glyph svg { width: 13px; height: 13px; stroke-width: 2.4; vertical-align: -2px; }
.dxg .dxg-table thead th:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--ring); }

/* Rows — every cell paints the row colour, so pinned cells cover what scrolls under them. */
.dxg .dxg-table tbody tr.dxg-row { --dxg-row: var(--dxg-surface); background: none; }
.dxg .dxg-table tbody tr.dxg-row > td { background: var(--dxg-row); padding: 5px 10px; }
.dxg .dxg-table tbody tr.dxg-row:hover { --dxg-row: var(--dxg-hover); }
.dxg .dxg-table tbody tr.dxg-row.selected { --dxg-row: var(--dxg-selected); }
.dxg .dxg-table tbody tr.dxg-row.dxg-focused { --dxg-row: var(--dxg-focused); }
.dxg .dxg-table tbody tr.dxg-row.dxg-focused > td:first-child { box-shadow: inset 3px 0 0 var(--brand); }
.dxg .dxg-table tbody tr.dxg-row.dxg-clickable { cursor: pointer; }
/* A row with a "row-open" control opens its record on a click (js/onix-datagrid.js), so the control
   itself is not drawn — it stays reachable from the keyboard and shows while it has the focus. */
.dxg .dxg-table tbody tr.dxg-row:has(.row-open:not(:disabled)) { cursor: pointer; }
.dxg .dxg-table tbody tr.dxg-row .row-open:not(:focus-visible) {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
    overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
/* A record is a screen of its own, as Odoo's form view is: while the record's bar shows (Breadcrumbs Record →
   .page-trail.has-record) the page's list (the grid with the title slot, .dxg-list) beside it is not drawn — it stays
   alive under display:none, so its page, sort, filters and chosen rows are there again on the way back. A grid inside
   the record's sheet is not the bar's sibling and stays (nor is a record page's own grid ever .dxg-list: compact). */
.page-trail.has-record ~ .dxg.dxg-list,
.page-trail.has-record ~ .dropzone-host > .dxg.dxg-list { display: none !important; }
.dxg .dxg-table tbody tr.dxg-row.row-muted > td { color: var(--muted); }
/* A document's state (DocumentRowState, Odoo's list decorations): a draft — not processed yet — in the info blue, a
   cancelled / void document greyed out like a disabled one (its links and amounts too). */
.dxg .dxg-table tbody tr.dxg-row.row-draft > td { color: var(--info); }
.dxg .dxg-table tbody tr.dxg-row.row-void > td,
.dxg .dxg-table tbody tr.dxg-row.row-void > td :is(a, .num, .amount) { color: var(--muted); }
/* RowClass "row-error": a row that blocks (an import mapping without its column, a VIES row with errors, an NRA finding). */
.dxg .dxg-table tbody tr.dxg-row.row-error > td { color: var(--danger); }
/* The cell that made the row red (an abnormal amount or date) stands out in it. */
.dxg .is-flagged { color: var(--danger-strong); font-weight: 650; }
/* IDE-004 — the document condition paints the whole row (the invoice list's RowClass): a possible duplicate pink, a wrong
   document red; its Document condition column says which and why. Opaque mixes over the grid's own surface — hover, the
   selection and the focus mix in as on any row — so the pinned cells still cover what scrolls under them; both themes
   through the tokens (--hue-rose, --danger). */
.dxg .dxg-table tbody tr.dxg-row.is-duplicate { --dxg-row: color-mix(in srgb, var(--hue-rose) 10%, var(--dxg-surface)); }
.dxg .dxg-table tbody tr.dxg-row.is-duplicate:hover { --dxg-row: color-mix(in srgb, var(--hue-rose) 16%, var(--dxg-surface)); }
.dxg .dxg-table tbody tr.dxg-row.is-duplicate.selected,
.dxg .dxg-table tbody tr.dxg-row.is-duplicate.dxg-focused { --dxg-row: color-mix(in srgb, var(--hue-rose) 16%, var(--dxg-selected)); }
.dxg .dxg-table tbody tr.dxg-row.is-wrong { --dxg-row: color-mix(in srgb, var(--danger) 9%, var(--dxg-surface)); }
.dxg .dxg-table tbody tr.dxg-row.is-wrong:hover { --dxg-row: color-mix(in srgb, var(--danger) 14%, var(--dxg-surface)); }
.dxg .dxg-table tbody tr.dxg-row.is-wrong.selected,
.dxg .dxg-table tbody tr.dxg-row.is-wrong.dxg-focused { --dxg-row: color-mix(in srgb, var(--danger) 14%, var(--dxg-selected)); }
.dxg .dxg-table tbody tr.dxg-row.is-wrong > td { color: var(--danger-strong); }
.dxg .dxg-table tbody tr:last-child > td { border-bottom: 1px solid var(--hairline); }
.dxg .dxg-table.dxg-grouped tbody tr.dxg-row > td.dxg-first { padding-left: calc(10px + var(--dxg-level, 0) * 22px); }

/* One line per row, as in a dx grid: long text ends in an ellipsis and the table scrolls sideways
   instead of rows growing tall. Class="wrap" on a column opts a free-text cell out. */
.dxg .dxg-table tbody tr.dxg-row > td {
    max-width: 380px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dxg .dxg-table tbody tr.dxg-row > td.wrap { max-width: none; white-space: normal; }
.dxg .dxg-table tbody tr.dxg-row > td.dxg-command { max-width: none; overflow: visible; }

/* "amount" is the banking pages' name for a figure column: aligned like "num". */
.dxg .dxg-table th.amount, .dxg .dxg-table td.amount { text-align: right; font-variant-numeric: tabular-nums; }

.dxg .dxg-table th.dxg-col-check, .dxg .dxg-table td.dxg-col-check { width: 40px; padding: 0 0 0 12px !important; text-align: left; }

/* The action column stays in reach however far the row scrolls. */
.dxg .dxg-table td.dxg-command, .dxg .dxg-table th.dxg-command {
    position: sticky;
    right: 0;
    box-shadow: inset 1px 0 0 var(--hairline);
}
.dxg .dxg-table td.dxg-command { z-index: 1; }
.dxg .dxg-table thead th.dxg-command { z-index: 4; }

/* PinActionColumn = false: an ordinary scrolling table — the action column is a last column like the
   others and the totals scroll with the rows (below); only the header row stays in view. The grid's own
   table only: a grid inside one of its detail rows (a payment dialog's) keeps its own pinning. */
.dxg-unpinned > .dxg-frame > .dxg-scroll > .dxg-table > tbody > tr > td.dxg-command { position: static; box-shadow: none; }
.dxg-unpinned > .dxg-frame > .dxg-scroll > .dxg-table > thead > tr > th.dxg-command { right: auto; }

.dxg-bool { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 5px; border: 1.6px solid var(--line-strong); color: var(--brand-ink); }
.dxg-bool.on { background: var(--brand); border-color: var(--brand); }
.dxg-bool svg { width: 12px; height: 12px; stroke-width: 3; }

/* Check boxes (rows, select-all, popup lists): drawn, so "mixed" needs no script. */
.dxg-check {
    position: relative;
    display: inline-grid; place-items: center;
    flex: none;
    width: 18px; height: 18px;
    padding: 0;
    border: 1.6px solid var(--line-strong);
    border-radius: 5px;
    background: var(--dxg-surface);
    cursor: pointer;
    transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.dxg-check-all { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.dxg-check-caption { display: none; }
.dxg-check:hover { border-color: var(--brand); }
.dxg-check:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.dxg-check[aria-checked="true"], .dxg-check[data-checked="true"],
.dxg-check[aria-checked="mixed"], .dxg-check[data-checked="mixed"] { background: var(--brand); border-color: var(--brand); }
.dxg-check[aria-checked="true"]::after, .dxg-check[data-checked="true"]::after {
    content: "";
    width: 9px; height: 5px;
    border: solid var(--brand-ink);
    border-width: 0 0 2px 2px;
    transform: translateY(-1px) rotate(-45deg);
}
.dxg-check[aria-checked="mixed"]::after, .dxg-check[data-checked="mixed"]::after {
    content: "";
    width: 8px; height: 2px;
    border-radius: 1px;
    background: var(--brand-ink);
}

/* Group rows */
.dxg .dxg-table tbody tr.dxg-group-row,
.dxg .dxg-table tbody tr.dxg-group-row:hover { background: none; }
.dxg .dxg-table tbody tr.dxg-group-row > td {
    padding: 0;
    background: var(--dxg-group);
    color: var(--ink);
    text-align: left;
    border-bottom: 1px solid var(--line);
}
/* Pinned to the visible width: on a table wider than the grid the summaries stay in view. */
.dxg-group {
    position: sticky;
    left: 0;
    box-sizing: border-box;
    display: flex; align-items: center; flex-wrap: wrap; gap: 4px 16px;
    min-height: 32px;
    width: 100cqw;
    padding: 0 12px 0 calc(8px + var(--dxg-level, 0) * 22px);
}
.dxg-group-toggle {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 4px;
    border: 0; background: none;
    color: inherit; font: inherit;
    cursor: pointer;
}
.dxg-chevron { display: inline-grid; place-items: center; width: 18px; height: 18px; color: var(--brand); transition: transform var(--dur) var(--ease); transform: rotate(90deg); }
.dxg-chevron svg { width: 14px; height: 14px; stroke-width: 2.4; }
.dxg-group-row.collapsed .dxg-chevron { transform: none; }
.dxg-group-title { color: var(--muted); font-weight: 500; }
.dxg-group-value { font-weight: 660; }
.dxg-group-note { color: var(--muted); font-size: 0.78rem; font-style: italic; }
.dxg-group-sum { margin-left: auto; color: var(--muted); font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.dxg-group-sum + .dxg-group-sum { margin-left: 0; }
.dxg-group-sum b { color: var(--ink); font-weight: 660; }
.dxg-count {
    display: inline-block;
    min-width: 20px;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand-strong);
    font-size: 0.74rem; font-weight: 660;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/* Detail rows (master–detail) */
.dxg .dxg-table tbody tr.dxg-detail-row,
.dxg .dxg-table tbody tr.dxg-detail-row:hover { background: none; }
.dxg .dxg-table tbody tr.dxg-detail-row > td {
    padding: 0;
    color: inherit;
    text-align: left;
    border-bottom: 1px solid var(--line);
}
.dxg-detail {
    position: sticky;
    left: 0;
    width: 100cqw;
    box-sizing: border-box;
    padding: 10px 14px 12px 40px;
    background: var(--bg-soft);
    box-shadow: inset 3px 0 0 var(--brand-soft-2);
    white-space: normal;
}
.dxg-detail > .toolbar { margin: 0; }
.dxg-expander {
    display: inline-grid; place-items: center;
    width: 22px; height: 22px;
    padding: 0; border: 0; border-radius: 6px;
    background: none; color: var(--muted);
    cursor: pointer;
    transition: transform var(--dur) var(--ease), background var(--dur) var(--ease);
}
.dxg-expander svg { width: 14px; height: 14px; stroke-width: 2.4; }
.dxg-expander:hover { background: var(--brand-soft); color: var(--brand-strong); }
.dxg-expander.open { transform: rotate(90deg); color: var(--brand); }

/* Totals footer */
.dxg .dxg-table tfoot td {
    position: sticky;
    bottom: 0;
    z-index: 2;
    padding: 5px 10px;
    background: var(--dxg-head);
    border-top: 1px solid var(--line-strong);
    border-bottom: 0;
    font-weight: 400;
    white-space: nowrap;
}
.dxg .dxg-table tfoot td.dxg-command { z-index: 3; }
.dxg-unpinned > .dxg-frame > .dxg-scroll > .dxg-table > tfoot > tr > td { position: static; }
.dxg-sum-label { color: var(--muted); font-size: 0.72rem; font-weight: 660; text-transform: uppercase; letter-spacing: 0.05em; margin-right: 6px; }
.dxg-sum-value { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }

/* Empty / loading */
.dxg-empty { position: sticky; left: 0; width: 100cqw; box-sizing: border-box; padding: 32px 16px; text-align: center; color: var(--muted); }
.dxg-empty:empty { padding: 0; }
.dxg-empty p { margin: 0 0 10px; }
.dxg-empty p:last-child { margin-bottom: 0; }
.dxg-compact .dxg-empty { padding: 26px 16px; }

.dxg-loading {
    position: absolute;
    inset: 0;
    z-index: 6;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    background: color-mix(in srgb, var(--dxg-surface) 58%, transparent);
    color: var(--ink-soft);
    font-weight: 600;
    animation: dxg-fade 0.18s var(--ease) 0.12s both;   /* a fast reload never flashes it */
}
.dxg-spinner {
    width: 18px; height: 18px;
    border: 2px solid var(--brand-soft-2);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: dxg-spin 0.8s linear infinite;
}
@keyframes dxg-spin { to { transform: rotate(360deg); } }
@keyframes dxg-fade { from { opacity: 0; } to { opacity: 1; } }

/* ─── Filter panel ─────────────────────────────────────────────────────── */

.dxg-filterpanel {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    background: var(--dxg-surface);
    border-top: 1px solid var(--line);
    font-size: 0.82rem;
    color: var(--ink-soft);
}
.dxg-filterpanel-icon { display: inline-grid; color: var(--brand); flex: none; }
.dxg-filterpanel-icon svg { width: 15px; height: 15px; fill: currentColor; }
.dxg-filterpanel-items { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 auto; min-width: 0; }
.dxg-cond {
    display: inline-flex; align-items: center; gap: 5px;
    max-width: 100%;
    padding: 2px 4px 2px 9px;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand-strong);
}
.dxg-cond i { font-style: normal; opacity: 0.75; }
.dxg-cond b { font-weight: 660; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.dxg-cond-x { display: inline-grid; place-items: center; width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%; background: none; color: inherit; cursor: pointer; }
.dxg-cond-x svg { width: 11px; height: 11px; stroke-width: 2.6; }
.dxg-cond-x:hover { background: var(--brand-soft-2); }
.dxg-cond:not(:has(.dxg-cond-x)) { padding-right: 9px; }

/* ─── Pager ────────────────────────────────────────────────────────────── */

.dxg-pager {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 14px;
    padding: 5px 12px;
    background: var(--dxg-head);
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.84rem;
    font-variant-numeric: tabular-nums;
}
.dxg-pager-info { margin-right: auto; }
.dxg-pager-selected { color: var(--brand-strong); font-weight: 600; }
.dxg-pager-selected .dxg-link { margin-left: 6px; }
.dxg-pager-note { display: block; margin-top: 2px; font-size: 0.78rem; color: var(--warn); }
.dxg-pages { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.dxg-page {
    display: inline-grid; place-items: center;
    min-width: 26px; height: 26px;
    padding: 0 6px;
    border: 1px solid transparent;
    border-radius: 7px;
    background: none;
    color: var(--ink-soft);
    font: inherit; font-size: 0.84rem;
    cursor: pointer;
    transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.dxg-page svg { width: 15px; height: 15px; }
.dxg-page:hover:not(:disabled):not(.current) { background: var(--panel-hover); color: var(--brand); }
.dxg-page.current { background: var(--solid); border-color: var(--solid); color: var(--solid-ink); font-weight: 660; cursor: default; }
.dxg-page:disabled { opacity: 0.35; cursor: default; }
.dxg-page:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.dxg-page-gap { padding: 0 2px; color: var(--muted-2); }
.dxg-pagesize { display: inline-flex; align-items: center; gap: 8px; }
.dxg-pagesize select {
    height: 26px;
    padding: 0 6px;
    border: 1px solid var(--line-strong);
    border-radius: 7px;
    background: var(--dxg-surface);
    color: var(--ink);
    font: inherit; font-size: 0.84rem;
    cursor: pointer;
}
.dxg-pagesize select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 2px var(--ring); }

/* ─── Popups: column chooser · header filter · menus ───────────────────── */

.dxg-popup {
    position: fixed;
    left: 0; top: 0;
    z-index: 120;
    visibility: hidden;                 /* onixGrid.place() shows it once it is in position */
    display: flex;
    flex-direction: column;
    min-width: 220px;
    max-width: min(320px, calc(100vw - 16px));
    max-height: min(440px, calc(100dvh - 16px));
    padding: 6px;
    background: var(--glass-pop, var(--panel));
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    color: var(--ink);
    font-size: 0.88rem;
}
.dxg-popup-operators, .dxg-popup-tools, .dxg-popup-headermenu { overflow-y: auto; }
.dxg-popup-title { padding: 6px 10px 4px; font-family: var(--font-display); font-weight: 700; font-size: 0.86rem; }
.dxg-popup-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 2px 0; scrollbar-width: thin; }
.dxg-popup-foot { display: flex; justify-content: space-between; gap: 12px; padding: 8px 10px 4px; border-top: 1px solid var(--line); margin-top: 4px; }
.dxg-popup-empty { margin: 0; padding: 10px; color: var(--muted); font-size: 0.82rem; }
.dxg-popup-search { display: flex; margin: 4px 4px 6px; }
.dxg-popup-search input, .dxg-popup-search input:focus { width: 100%; height: 32px; }

.dxg-menu-item, .dxg-option {
    display: flex; align-items: center; gap: 10px;
    width: 100%;
    padding: 7px 10px;
    border: 0; border-radius: 9px;
    background: none;
    color: inherit; font: inherit; text-align: left;
    cursor: pointer;
}
.dxg-menu-item svg { width: 16px; height: 16px; flex: none; color: var(--muted); }
.dxg-menu-item:hover:not(:disabled), .dxg-option:hover { background: var(--panel-hover); }
.dxg-menu-item:disabled { color: var(--muted-2); cursor: default; }
.dxg-menu-item:disabled svg { color: var(--muted-2); }
.dxg-menu-item.current { color: var(--brand-strong); font-weight: 660; }
.dxg-menu-check, .dxg-menu-glyph { display: inline-grid; place-items: center; width: 16px; flex: none; color: var(--brand); font-weight: 700; }
.dxg-menu-check svg { color: var(--brand); stroke-width: 2.6; }
.dxg-menu-sep { height: 1px; margin: 5px 6px; background: var(--line); }
.dxg-option-all { font-weight: 600; border-bottom: 1px solid var(--line); border-radius: 9px 9px 0 0; margin-bottom: 2px; }
.dxg-option-note { margin-left: auto; color: var(--muted); font-size: 0.74rem; }
.dxg-option span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.dxg-quick { display: flex; gap: 4px; padding: 2px 6px 8px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.dxg-quick-btn {
    flex: 1 1 0;
    display: inline-grid; place-items: center;
    height: 32px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: none;
    color: var(--ink-soft);
    cursor: pointer;
}
.dxg-quick-btn svg { width: 16px; height: 16px; }
.dxg-quick-btn:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.dxg-quick-btn.current { background: var(--brand-soft); border-color: transparent; color: var(--brand-strong); }
.dxg-quick-btn:disabled { opacity: 0.35; cursor: default; }

/* ─── Row actions: the buttons and menus of a command cell ─────────────── */

/* One line, one height: the step the row waits for as text, then its tools — as tall as a line of the row's
   text with its padding, so a row with buttons is no taller than one without. */
.row-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: 4px; }
.row-actions .button.small {
    display: inline-flex; align-items: center; justify-content: center; gap: 5px;
    height: 24px;
    padding: 0 8px;
    line-height: 1;
    white-space: nowrap;
}
.row-actions .button.small.icon { width: 26px; padding: 0; }
.row-actions .button svg { width: 15px; height: 15px; flex: none; }
/* The action column of every list, pinned at the right edge of the rows (PinActionColumn): since 2026-11 each row
   draws only its "⋯" there (docs/CONVENTIONS.md "The command column"), so the cell is as tight as that button and
   the column takes as little of the window as the widest row allows. */
.dxg > .dxg-frame > .dxg-scroll > .dxg-table > tbody > tr.dxg-row > td.dxg-command { padding: 3px 8px 3px 10px; }
.dxg > .dxg-frame > .dxg-scroll > .dxg-table > thead > tr > th.dxg-command { padding-right: 8px; }

/* Print · PDF · more — joined, so a row reads as one tool set, not a run of loose buttons. */
.row-actions-tools { display: inline-flex; align-items: stretch; margin-left: 2px; }
.row-actions-tools > * + * { margin-left: -1px; }
.row-actions-tools .button.small {
    position: relative;
    border-radius: 0;
    box-shadow: none;
    background: var(--dxg-surface);
    color: var(--ink-soft);
}
.row-actions-tools > :first-child, .row-actions-tools > :first-child > .button.small { border-top-left-radius: 9px; border-bottom-left-radius: 9px; }
.row-actions-tools > :last-child, .row-actions-tools > :last-child > .button.small { border-top-right-radius: 9px; border-bottom-right-radius: 9px; }
/* The border of the button in use lies over its neighbours'. */
.row-actions-tools .button.small:hover:not(:disabled),
.row-actions-tools .button.small:focus-visible,
.row-actions-tools .button.small[aria-expanded="true"] { z-index: 1; border-color: var(--brand); color: var(--brand-strong); }

.row-menu { position: relative; display: inline-flex; }
.row-menu-button > svg { width: 16px; height: 16px; flex: none; }
.row-menu-button[aria-expanded="true"] { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-strong); }
.row-menu-caret { display: inline-grid; place-items: center; margin-right: -3px; }
.row-menu-caret svg { width: 12px; height: 12px; stroke-width: 2.4; transform: rotate(90deg); transition: transform var(--dur) var(--ease); }
.row-menu-button[aria-expanded="true"] .row-menu-caret svg { transform: rotate(-90deg); }

/* The panel is a popover: the top layer, above every pinned cell and outside every scrolling box.
   onixGrid places it (left / top) against its button. Closed is display: none — also where the
   browser knows no popovers and the script opens it with [data-open]. */
.row-menu-panel {
    display: none;
    flex-direction: column;
    box-sizing: border-box;
    min-width: 200px;
    max-width: min(320px, calc(100vw - 16px));
    max-height: min(480px, calc(100dvh - 16px));
    overflow-y: auto;
    margin: 0;
    padding: 6px;
    background: var(--glass-pop, var(--panel));
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    color: var(--ink);
    font-size: 0.88rem;
    text-align: left;
    white-space: nowrap;
    scrollbar-width: thin;
}
.row-menu-panel:popover-open { display: flex; animation: pop-in 0.12s var(--ease); }
.row-menu-panel[data-open] { display: flex; position: fixed; left: 0; top: 0; z-index: 130; }

.row-menu-panel a, .row-menu-panel button {
    display: flex; align-items: center; gap: 10px;
    flex: none;
    width: 100%;
    box-sizing: border-box;
    padding: 7px 10px;
    border: 0; border-radius: 9px;
    background: none;
    color: inherit; font: inherit; text-align: left; text-decoration: none;
    cursor: pointer;
}
.row-menu-panel a:hover, .row-menu-panel button:hover:not(:disabled) { background: var(--panel-hover); color: var(--brand-strong); text-decoration: none; }
.row-menu-panel a:focus-visible, .row-menu-panel button:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--ring); }
.row-menu-panel button:disabled { color: var(--muted-2); cursor: default; }
.row-menu-panel .danger { color: var(--danger); }
.row-menu-panel .danger:hover:not(:disabled) { background: var(--danger-soft); color: var(--danger); }
.row-menu-panel hr { flex: none; width: auto; height: 1px; margin: 5px 6px; border: 0; background: var(--line); }
/* Nothing to separate: a rule at either end of the menu, or two in a row. */
.row-menu-panel hr:first-child, .row-menu-panel hr:last-child, .row-menu-panel hr + hr { display: none; }

/* An item that asks twice: armed, it shows its confirmation in its place. */
.row-menu-confirm { display: flex; flex-direction: column; flex: none; }
/* Button/Danger of onix-theme.css: the same coral and white in both themes. */
.row-menu-confirm > .row-menu-confirm-go { display: none; background: var(--dnt-coral-600); color: #FFFFFF; font-weight: 600; }
.row-menu-confirm > .row-menu-confirm-go:hover:not(:disabled) { background: var(--dnt-coral-700); color: #FFFFFF; }
.row-menu-confirm[data-armed] > [data-row-menu-arm] { display: none; }
.row-menu-confirm[data-armed] > .row-menu-confirm-go { display: flex; }

/* Search matches — CSS Custom Highlight API, registered by onix-datagrid.js. */
::highlight(dxg-search) { background-color: #FBE3A6; color: #101B41; }
::highlight(dxg-search) { background-color: var(--dxg-mark, #FBE3A6); color: var(--dxg-mark-ink, #101B41); }

/* ─── Small screens ────────────────────────────────────────────────────── */

/* A phone: the shell's top bar scrolls away with the page and the control row wraps into rows of its
   own, which would cover the list — it scrolls with the page too. */
@media (max-width: 767.98px) {
    .dxg-toolbar.dxg-sticky { position: static; }
}

@media (max-width: 760px) {
    .dxg-tools { width: 100%; margin-left: 0; }
    /* With the pager in the row: the search and the tools on one line, the pager on the next, at the right. */
    .dxg-tools:has(> .dxg-toppager) { flex-wrap: wrap; row-gap: 8px; }
    .dxg-tools:has(> .dxg-toppager) > .dxg-search,
    .dxg-tools:has(> .dxg-toppager) > .dxg-search input { flex: 1 1 120px; min-width: 0; }
    .dxg-toppager { margin-left: auto; padding-left: 0; border-left: 0; }
    .dxg-search { flex: 1 1 auto; }
    .dxg-search input, .dxg-search input:focus,
    .dxg-sticky .dxg-search input, .dxg-sticky .dxg-search input:focus { width: 100%; }
    /* Dragging headers is a pointer gesture; grouping stays available from the column menu. */
    .dxg-grouppanel:has(.dxg-grouppanel-hint) { display: none; }
    .dxg-full > .dxg-frame > .dxg-scroll { max-height: max(320px, calc(100dvh - 260px)); }
    .dxg .dxg-table tbody tr.dxg-row > td { padding: 7px 10px; }
    .dxg .dxg-table td.dxg-command, .dxg .dxg-table th.dxg-command { position: static; box-shadow: none; }
    .dxg-pager { justify-content: space-between; }
    .dxg-pager-info { width: 100%; }
    .dxg-page { min-width: 28px; padding: 0 6px; }
    .dxg-pages { gap: 2px; }
    .dxg-detail { padding-left: 16px; }
}

@media print {
    .dxg-tools, .dxg-grouppanel, .dxg-filter-row, .dxg-pager, .dxg-col-check, .dxg-popup, .dxg-th-btn, .row-menu-panel { display: none !important; }
    .dxg-groupby, .dxg-notices { display: none !important; }
    .dxg-toolbar.dxg-sticky { position: static; }
    .dxg-frame { border-color: #CCCED7; box-shadow: none; }
    .dxg-scroll { max-height: none !important; overflow: visible; }
    .dxg .dxg-table thead th, .dxg .dxg-table tfoot td, .dxg .dxg-table td.dxg-command { position: static; }
}
