﻿/*
    The reception page's grid typography and density, opted into by a class.

    The look of the grid inside WarehouseActiveReceptionV2Page's card lives in
    Components/SelectionCardComponent.razor.css. Two things in there are not the theme and not the card -
    they are decisions about type and density that hold for any grid in this app:

        a row at 13px over 6px of padding, and a column header at 11px in caps.

    This file is those two decisions, and nothing else. No colour, no border, no surface, no fold - the card,
    the four-step grey ramp and the collapsing summary stay with the component that owns them. A page adopting
    this gets the size and the spacing and keeps whatever else it already looks like.

    HOW A PAGE ADOPTS IT
        Not per grid, and no longer per page. "grid-dense" goes on an ANCESTOR of the grids, and MainLayout
        puts it unconditionally on the <article> that wraps @Body. Every selector here is therefore a
        descendant rule, ".grid-dense .e-grid ...", global, no ::deep and no scoped-CSS hash.

        It used to be gated on the route being a Master data destination. That gate is gone now that every
        section has been through - see the note in MainLayout - and NavMenu.IsMasterDataRoute went with it.

        NOT "<SfGrid CssClass="grid-dense">", which is the obvious thing and does not work. The attribute
        compiles - CssClass is on a Syncfusion base class - and the grid then never writes it to its root
        element, which comes out as

            class="sf-grid e-grid e-control e-responsive e-default e-gridhover ..."

        with no sign of what was passed. That was this change's first shape: the attribute went onto all 50
        grids, it built clean, and not one rule applied. Checked in the DOM afterwards, which is the only
        reason it is known rather than guessed at. SfGrid 34.2.3 documents no CssClass and no HtmlAttributes;
        if a later version does, this can move back onto the grids and the selectors lose a level.

    WHY STILL SCOPED AT ALL AND NOT JUST ".e-grid"
        The scope is what made the rollout possible a section at a time, and that is done - so the obvious
        tidy-up is to drop ".grid-dense " from every selector below and be rid of the class. It is left in
        on purpose, for two reasons that have nothing to do with the rollout:

          - the two OTHER shells in MainLayout must not take these rules. The reception page brings the
            same look itself from Components/SelectionCardComponent.razor.css, and ".e-grid" would put this
            file on top of that component's own rules for the same elements; the iqboard signage pages are
            plain HTML served inside this app and are not meant to look like it at all.
          - a grid rendered outside @Body is not inside the <article> at all. Syncfusion appends a dialog
            to <body>, so a grid INSIDE a dialog was out of reach of this file entirely - which is why
            every selector below now carries a ".dense-dialog" twin. Thirteen of the app's dialogs hold a
            grid, and until that twin existed those grids sat at the theme's 14px rows inside a modal
            whose fields had all been taken to 13px.

        So the class is the boundary of "a surface this app owns" - the page's content, or a modal - and
        not a rollout flag any more.

        THE TWINS ARE MECHANICAL AND MUST STAY THAT WAY. Every rule below is "X, and the same under
        .dense-dialog". If you add a rule, add both halves; a grid on a page and a grid in a dialog
        looking different is the bug this pairing exists to stop.

    LOAD ORDER
        index.html loads this AFTER the Syncfusion theme and after app.css, so at equal specificity these
        rules win. They are still written one class more specific than the theme's own, because the V2 page
        injects its theme from <HeadContent> - which renders at head::after, i.e. after every <link> here -
        and any page doing that would otherwise put the theme back on top.
*/

/*
    Row height and row type.

    Three values make a row, and bootstrap5.3 ships ".e-grid .e-rowcell" at

        font-size: 14px; line-height: 22px; padding: 6px 8px

    so a row is 6 + 22 + 6 + a 1px top border = 35px. The padding is already the 6px the reception page
    sets, so repeating it here changes nothing and the two values left are the ones that move. (The
    reception page runs on this same theme - there is no Fluent 2 anywhere in the app - which is why its
    own 6px is equally redundant; see the note on row height in SelectionCardComponent.razor.css.)

    13px, against the 11px caps of the column header below. The theme's 14px made a row larger than its own
    heading, so the data shouted and the label whispered; 13px keeps them a step apart in the right order
    while leaving the data the bit of size that 12px would take off a table people read all day.

    20px line, which is the line the reception page's rows sit on, and the whole of the 2px difference
    between a row there and a row here. 6 + 20 + 6 + 1 = 33px, measured the same on both.

    Only the vertical metrics are touched, so a row still sizes itself to its content and a wrapped cell is
    free to be taller - which is why this is not the grid's RowHeight parameter. RowHeight pins every row to
    one number and would clip such a cell, and every one of these pages runs AllowTextWrap="true".

    SO ROWS ARE NOT ALL THE SAME HEIGHT, AND THAT IS THE CHOICE, NOT AN OVERSIGHT. A row is 33px where the
    content fits and 53px where a cell takes two lines - on Mco Users that is the Email column, declared
    Width="100" against an address needing about 180.

    The reception page looks more even than this, and the reason is NOT a style difference: its cells wrap
    under exactly this rule (white-space: normal, measured on both pages). Its columns are 150-260px wide,
    so they rarely have to - and it pays for that with the horizontal scrollbar its grids carry.

    Both ways of evening this out were offered and declined: clipping cells to one line with an ellipsis,
    and widening the cramped columns page by page. Nothing is hidden here, nothing scrolls sideways, and
    rows are uneven. Asked and answered - do not re-"fix" it.
*/
.grid-dense .e-grid .e-rowcell,
.dense-dialog .e-grid .e-rowcell {
    padding-top: 6px;
    padding-bottom: 6px;
    font-size: 13px;
    line-height: 20px;
}

/*
    The column header reads as a label rather than as more data: smaller than the row, but in caps and
    heavier, so it still comes first to the eye. The three go together - 11px on its own is just small text.

    0.02em and not more: caps plus generous tracking is what pushes a long heading onto a line it did not
    need. It wraps rather than truncating now - see the rule below - so this costs height instead of words,
    which is better but still worth not spending.
*/
.grid-dense .e-grid .e-headercelldiv,
.dense-dialog .e-grid .e-headercelldiv {
    text-transform: uppercase;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    /* a step back from the near-black the data is in, so the label does not compete with it */
    color: var(--color-sf-content-text-color-alt1, #33506b);
}

/*
    A HEADER WRAPS. IT IS NEVER TRUNCATED. This is the rule, and it is the opposite of what the reception
    page does - there every column carries an explicit width, so a heading pinned to one line always fits;
    here the widths are automatic and a one-line heading just loses its words. "BADGE NUM..." is not a
    column name.

    So: white-space normal, text-overflow clip, height auto. Nothing is ever hidden, and a heading that
    needs a third line takes a third line rather than dropping anything.

    Three selectors because there are three ways a header can be told to behave, and the wrap has to win
    all three:

      - ".grid-dense .e-grid .e-columnheader .e-headercelldiv" (0,4,0) beats
        ".e-grid.e-responsive .e-headercelldiv" (0,3,0), which is where "white-space: nowrap" comes from on
        a grid WITHOUT AllowTextWrap - and e-responsive is on every grid in this app.
      - the other two (0,5,0) beat the theme's own pair of wrap rules at (0,4,0), which set line-height to
        21px. Both forms exist because Syncfusion puts .e-wrap on the grid root AND on the header row.

    15px, not the theme's 21px: 21px is a line for 14px text, and the heading is 11px caps here. That is
    what pays for the wrap. The header cell brings 8px of padding above and below, so measured on Mco Users:

        one line   15 + 16 = 31px
        two lines  30 + 16 = 46px   (58px if the theme's 21px line is left alone)

    i.e. a wrapped header band costs 12px less than it did before this file existed, and an unwrapped one
    costs 6px less than the 37px the theme gives. The 34px on .e-headercell is a minimum, not a cap - it
    does not hold a second line in, which is why the band grows at all.
*/
.grid-dense .e-grid .e-columnheader .e-headercelldiv,
.dense-dialog .e-grid .e-columnheader .e-headercelldiv,
.grid-dense .e-grid .e-columnheader.e-wrap .e-headercelldiv,
.dense-dialog .e-grid .e-columnheader.e-wrap .e-headercelldiv,
.grid-dense .e-grid.e-wrap .e-columnheader .e-headercelldiv,
.dense-dialog .e-grid.e-wrap .e-columnheader .e-headercelldiv {
    white-space: normal;
    overflow-wrap: break-word;
    text-overflow: clip;
    height: auto;
    line-height: 15px;
}

/* ---------------------------------------------------------------------------------------------------
   THE SURFACES

   The whole point: a grid reads as four bands, lightest to deepest and back, and the reception page is
   the only place in the app that does it. The tokens are already global - wwwroot/css/syoneex-tokens.css
   maps the SYONEEX palette onto --color-sf-* for every page - so this is not a new palette, it is the
   same four values the reception card already draws from:

       toolbar   #eff4ff   (alt2)   - what you can do
       headers   #dce9ff   (alt3)   - what the columns are
       rows      #ffffff   (alt1)   - the data
       pager     #eff4ff   (alt2)   - closing the bracket

   Worth recording what these pages measured as BEFORE, because three of the four were not a colour
   choice at all - they were the absence of one:

       header band   #ffffff   same white as the rows, so the columns had no lid
       toolbar       #ffffff   same again, so actions and data were one sheet
       grid body     #f4f8fb   the PAGE's own ground - the data sat on the page, not on a surface, and
                               the bottom of every grid dissolved into the background behind it
       pager         #f4f8fb   same

   Named by token and not by literal, so a change to the palette moves these with it. The literal after
   each comma is only the fallback for a page where no theme has loaded.
   --------------------------------------------------------------------------------------------------- */

/*
    The header band. All four selectors are needed: the theme paints .e-gridheader AND each .e-headercell
    from --color-sf-content-bg-color-alt1 (white), so tinting only the container leaves the cells sitting
    on white squares over it.
*/
.grid-dense .e-grid .e-gridheader,
.dense-dialog .e-grid .e-gridheader,
.grid-dense .e-grid .e-gridheader .e-headercell,
.dense-dialog .e-grid .e-gridheader .e-headercell,
.grid-dense .e-grid .e-gridheader .e-detailheadercell,
.dense-dialog .e-grid .e-gridheader .e-detailheadercell,
.grid-dense .e-grid .e-gridheader .e-headercelldiv,
.dense-dialog .e-grid .e-gridheader .e-headercelldiv {
    background-color: var(--color-sf-content-bg-color-alt3, #dce9ff);
}

/* the data sits on a surface of its own, not on the page's ground */
.grid-dense .e-grid .e-gridcontent,
.dense-dialog .e-grid .e-gridcontent {
    background-color: var(--color-sf-content-bg-color-alt1, #ffffff);
}

/*
    A DIVIDER IN THE HEADER ONLY, because that is where you grab a column.

    The vertical cell lines are gone on purpose - rows read as rows, not as a spreadsheet - and that is
    not being undone here. But removing them took the column BOUNDARY with them, and the boundary is the
    thing you have to aim at to resize: the handle sits on it and there was nothing to tell you where it
    was. You could only find it by sweeping the header until the cursor changed.

    So the line comes back for the header band and nowhere else. The data area stays clean.

    #b9d2f7 and not the theme's own #e2e8f0: the theme defines that colour for this border and then ships
    it at width 0, and it was chosen against a WHITE header. This header band is alt3 #dce9ff, and
    #e2e8f0 is LIGHTER than the band it would sit on - it would read as a gap, not a division. b9d2f7 is
    the same hue a step down.

    :last-child carries no divider. A line after the final column is an edge, and the grid already has
    one of those.
*/
.grid-dense .e-grid .e-gridheader .e-headercell,
.dense-dialog .e-grid .e-gridheader .e-headercell {
    border-right: 1px solid #b9d2f7;
}

.grid-dense .e-grid .e-gridheader .e-headercell:last-child,
.dense-dialog .e-grid .e-gridheader .e-headercell:last-child {
    border-right: 0;
}

/*
    The one number app.css cannot know.

    app.css pins the excel filter popup to the top of the header rather than to the column menu entry
    that opened it - see the long note beside ".e-filter-popup" there for why Syncfusion's own
    repositioning never fires. The pin needs the header's height, and that height is set HERE: 15px of
    line over 8px of padding a side, so 31px for a one-line heading against the theme's 38px.

    A wrapped heading is 46px and the popup overlaps its bottom 15px. Left alone deliberately - CSS has
    no way to read the header's height, and the alternative is pinning to 46 and leaving a 15px gap
    under every single-line header in the app to pay for the handful that wrap.
*/
.grid-dense .e-grid,
.dense-dialog .e-grid {
    --filter-popup-top: 31px;
}

/*
    And the handle itself says when you have it.

    THE HANDLE WAS NEVER MISSING - ".e-rhandler.e-rcursor", 4px wide, 21 of them on this grid, all
    present and all working. It is painted rgba(0,0,0,0). So the control was there and invisible, which
    is worse than absent: the cursor changes and nothing explains why.

    Hover fills it. That is the Excel behaviour and it is what makes a 4px target findable - you sweep,
    it lights up, you drag. The divider above tells you roughly where to aim; this confirms you arrived.

    The transition is short on purpose. Anything slower reads as a hover effect rather than as feedback
    on a control you are about to use.
*/
.grid-dense .e-grid .e-gridheader .e-rhandler,
.dense-dialog .e-grid .e-gridheader .e-rhandler {
    background-color: transparent;
    transition: background-color .12s ease;
}

.grid-dense .e-grid .e-gridheader .e-rhandler:hover,
.dense-dialog .e-grid .e-gridheader .e-rhandler:hover {
    background-color: #4a86c8;
}

/*
    THE HEADER ICONS COME OUT OF THE FLOW, because the icon on the right was eating the column name.

    Turning Excel filtering on put an ".e-filtermenudiv" in every header cell, and it is laid out INLINE -
    it takes 18px of the cell's width away from the text. Next to the sort indicator's 10px and 16px of
    cell padding, a 70px column was leaving 25px for its heading. Measured on Ongoing Delivery Requests:

        cell 70px = padding 16 + text 25 + sort 10 + filter 18 + resize handle 4

    So "DOC NO" wrapped onto four lines, and the header band went from about 46px to 78px. Every grid in
    the app, every column. It reads as the divider having stolen the space - the divider is 1px.

    Taking both icons out of the flow gives the whole cell back to the text. They are positioned against
    the cell's right edge, the menu icon outermost because it is the one you click; the heading keeps
    enough padding-right that it never runs underneath them.

        measured after: text 25px -> 61px, band 78px -> 58px, and most headings that took three or four
        lines now take one or two

    The cell padding goes 8px -> 4px in the same breath. At 11px caps the extra 4 a side was buying
    nothing and it is 8px per column.

    THE ICON IS NO LONGER THE FUNNEL, AND THE PROBLEM CAME STRAIGHT BACK WITH THE REPLACEMENT. Every
    filtering grid carries ShowColumnMenu now, and where the menu is on Syncfusion does not render
    ".e-filtermenudiv" at all - it is not hidden, it is absent, so the rule that used to pull it out of
    the flow matches nothing. ".e-columnmenu" takes its place and arrives position:static, 18px wide,
    inline: measured on Part numbers, a 160px cell gave its heading 133px of the 152px inside the
    padding and the other 18px to the icon, with the old 23px of padding-right still being reserved on
    top of that. Same 18px, same cause, new class name - hence the rule below.

    THE ICONS STILL WORK. position:absolute on a child of a header cell does not stop it receiving
    clicks - checked by opening the column menu from the repositioned icon, not assumed. The resize
    handle is deliberately left in the flow: it belongs on the boundary, and it is 4px.
*/
.grid-dense .e-grid .e-gridheader .e-headercell,
.dense-dialog .e-grid .e-gridheader .e-headercell {
    position: relative;
    padding-left: 4px;
    padding-right: 4px;
}

/* immediately inboard of the menu icon, which now ends at 5 + 18 = 23. It was 21 while the funnel
   outboard of it was 14px wide at 7. */
.grid-dense .e-grid .e-gridheader .e-sortfilterdiv,
.dense-dialog .e-grid .e-gridheader .e-sortfilterdiv {
    position: absolute;
    right: 23px;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
}

/*
    5px off the right edge, so the menu icon is not touching the column divider beside it. The funnel
    this replaces sat at 7px and was 14px wide; the menu is 18px, so 5 keeps the same 23px of total
    reserved width and the heading loses nothing in the swap. Below 5 the gap measures 3px of clear
    space against a 1px line and the two read as stuck together.

    The dots are the ONLY control in this header now - sorting, grouping, autofit, the column chooser
    and filtering are all behind them - so this is the one icon that has to be easy to hit. It keeps
    the full 18px rather than being trimmed the way the funnel was.
*/
.grid-dense .e-grid .e-gridheader .e-columnmenu,
.dense-dialog .e-grid .e-gridheader .e-columnmenu {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    margin: 0;
}

/* the heading keeps clear of both icons */
.grid-dense .e-grid .e-gridheader .e-headercelldiv,
.dense-dialog .e-grid .e-gridheader .e-headercelldiv {
    padding-right: 23px;
}

/*
    ALT-ROW STRIPING IS LEFT ON, AND THERE IS DELIBERATELY NO RULE HERE. This block is a note, because the
    obvious rule was written, was wrong, and should not come back.

    app.css sets ".e-grid .e-altrow { background-color: #fafafa }" app-wide, on the <tr>. Nothing in the
    theme competes with it - searched, and bootstrap5.3 carries no .e-altrow background for a grid at all -
    and the theme gives .e-rowcell no background either, so the row's colour shows through its cells. The
    stripe is therefore painted on every grid in the app, this section included. It needs nothing from
    this file.

    Why it LOOKED absent on these pages, and why it does not any more: the grid body had no surface of its
    own, so it took --color-sf-content-bg-color - #f4f8fb, the page's ground - and #fafafa over #f4f8fb is
    1.023:1. The stripe was being drawn and was the same colour as what it was drawn on. The rule further
    up that puts .e-gridcontent on alt1 white is what fixes it: #fafafa over #ffffff is 1.044:1, which is
    exactly what the reception page shows, because that page sets the same white for the same reason.

    What was wrong before: this block used to zero the stripe, on the reasoning that the reception page
    drops it too. The reception page does not. SelectionCardComponent.razor.css writes

        .rec-panel ::deep .e-grid .e-altrow .e-rowcell { background-color: transparent }

    which touches the CELL - already transparent - and never the <tr> that carries the colour. It is a
    no-op, its comment claims otherwise, and copying its intent rather than its effect is what took the
    stripe off master data while the trucks grid kept it. The cell/row distinction is the whole bug: a
    measurement of ".e-altrow .e-rowcell" reads rgba(0,0,0,0) on BOTH pages whether the stripe is showing
    or not, so it cannot tell them apart. Measure the <tr>.

    If a stronger stripe is ever wanted, 1.044:1 is faint - alt2 #eff4ff would be 1.102:1 - but that is a
    change to make on both pages at once, not here alone.
*/

/*
    The selected row, marked on its EDGE as well as by its fill.

    The fill itself is left alone and is already identical on both pages - both run bootstrap5.3, where
    --color-sf-table-bg-color-selected is rgba(0,0,0,.1), a grey wash. What the reception page adds is
    3px of the brand's cyan down the leading edge, and that is the half that survives a colour-blind eye;
    a 10%-black wash over white is a 1.1:1 difference and is nearly invisible on a projector or a warehouse
    screen.

    The cyan is spent on exactly this and nothing else in the palette - see the note in syoneex-tokens.css.

    ON THE CELL, NOT ON THE ROW. SelectionCardComponent.razor.css writes this as

        .e-grid .e-row.e-selectionbackground .e-rowcell:first-child

    and that selector matches nothing: Syncfusion marks the TDs, not the TR. A selected row reads

        <tr class="e-row e-altrow">
          <td class="e-rowcell e-selectionbackground e-active e-leftalign">

    so there is no .e-row.e-selectionbackground anywhere in the document and the reception page has never
    drawn this edge either - its selected row is the grey wash alone. Copied here in its working form; the
    component still has the broken one, which is a one-line fix on that page when someone wants it.
*/
.grid-dense .e-grid .e-rowcell.e-selectionbackground:first-child,
.dense-dialog .e-grid .e-rowcell.e-selectionbackground:first-child {
    box-shadow: inset 3px 0 0 var(--rec-accent, #00d1ff);
}

/*
    The toolbar gets its own step, one lighter than the column headers.

    Transparent was wrong - it took the white of the rows, so toolbar and data were one sheet. Giving it
    the SAME tint as the headers is wrong the other way: the two merge into one slab and you cannot see
    where the actions end and the columns begin.
*/
.grid-dense .e-grid .e-toolbar,
.dense-dialog .e-grid .e-toolbar {
    background-color: var(--color-sf-content-bg-color-alt2, #eff4ff);
    border-bottom: 1px solid var(--color-sf-border-light, #e2e8f0);
}

.grid-dense .e-grid .e-toolbar .e-toolbar-items,
.dense-dialog .e-grid .e-toolbar .e-toolbar-items {
    background-color: transparent;
}

/*
    The pager. The padding is the density half - the theme's 7px looks heavy under a compact grid - and the
    tint is what stops the foot of a grid being the one part of it painted in the page's own colour, which
    is what made the bottom edge dissolve into the background.
*/
.grid-dense .e-grid .e-gridpager,
.dense-dialog .e-grid .e-gridpager {
    padding: 6px 8px;
    background-color: var(--color-sf-content-bg-color-alt2, #eff4ff);
}

/*
    The toolbar, to the same scale - the theme puts Add/Edit/Delete at the same 14px the rows used to be.

    Written down to .e-toolbar-item .e-tbar-btn and not just .e-tbar-btn-text: the theme's own rule is
    ".e-toolbar .e-toolbar-item .e-tbar-btn .e-tbar-btn-text", four classes, which the short form here would
    only tie with. A tie goes to whichever stylesheet loads last, and that is this one today only because no
    master data page injects a theme from <HeadContent>. Winning on specificity instead means it keeps
    working on a page that does.

    text-transform is restated because the theme uppercases a toolbar label on some builds, and
    Add/Edit/Delete in caps over a header row already in caps is one row of shouting too many - the caps are
    spent on the column names, which is where they do work.

    The orange search button from app.css is deliberately left alone - it is the convention across the rest
    of the app, and it is the one warm thing on a page of blues, which is what makes the search findable.
*/
.grid-dense .e-grid .e-toolbar .e-toolbar-item .e-tbar-btn .e-tbar-btn-text,
.dense-dialog .e-grid .e-toolbar .e-toolbar-item .e-tbar-btn .e-tbar-btn-text {
    font-size: 12.5px;
    font-weight: 500;
    text-transform: none;
    color: var(--color-sf-content-text-color-alt1, #33506b);
}

.grid-dense .e-grid .e-toolbar .e-toolbar-item .e-tbar-btn .e-btn-icon,
.dense-dialog .e-grid .e-toolbar .e-toolbar-item .e-tbar-btn .e-btn-icon {
    font-size: 13px;
    color: var(--color-sf-content-text-color-alt2, #5b7590);
}

/*
    A TOOLBAR BUTTON IS NOT A BUTTON-SHAPED BLOCK.

    The theme gives each one a plate of its own:

        .e-toolbar .e-toolbar-item .e-tbar-btn { background: var(--color-sf-content-bg-color-alt1) }

    and the SYONEEX remap makes alt1 #ffffff - so Add, Edit, Delete and Excel Export each paint a white
    rectangle on the tinted band the rule above gives the toolbar. On the app's untinted toolbars that was
    invisible, white on white; tint the band and four white blocks appear. Transparent is what the
    reception card does and this is the rule that was missing from the port.
*/
.grid-dense .e-grid .e-toolbar .e-toolbar-item .e-tbar-btn,
.dense-dialog .e-grid .e-toolbar .e-toolbar-item .e-tbar-btn {
    background: transparent;
    box-shadow: none;
}

/*
    Hover, and it MUST come with the rule above rather than after it.

    The theme's hover is a matched pair: a dark plate (--color-sf-secondary-bg-color-hover) with white
    text and a white icon on top of it. The rule above takes the plate away. Nothing takes the white away
    with it, and white text on the #eff4ff band is about 1.06:1 - the label would disappear under the
    pointer. Removing one half of a themed pair is what obliges you to handle the other half.

    Hover is given back as a plate rather than as a colour change, because the text colour here already
    carries meaning - alt1 for a label, alt2 for its icon - and recolouring them on hover would read as a
    different control rather than the same one under the pointer. alt3 is the next step on the grid's own
    surface ramp, the same blue the column headers use, so the button lifts one step toward the data it
    acts on.

    :focus and .e-active are listed for the same reason and not because they were seen broken - the theme
    pairs white with a dark plate in all three, and one override removes all three plates.
*/
.grid-dense .e-grid .e-toolbar .e-toolbar-item .e-tbar-btn:hover,
.dense-dialog .e-grid .e-toolbar .e-toolbar-item .e-tbar-btn:hover {
    background: var(--color-sf-content-bg-color-alt3, #dce9ff);
}

.grid-dense .e-grid .e-toolbar .e-toolbar-item .e-tbar-btn:hover .e-tbar-btn-text,
.dense-dialog .e-grid .e-toolbar .e-toolbar-item .e-tbar-btn:hover .e-tbar-btn-text,
.grid-dense .e-grid .e-toolbar .e-toolbar-item .e-tbar-btn:hover .e-icons,
.dense-dialog .e-grid .e-toolbar .e-toolbar-item .e-tbar-btn:hover .e-icons,
.grid-dense .e-grid .e-toolbar .e-toolbar-item .e-tbar-btn:focus .e-tbar-btn-text,
.dense-dialog .e-grid .e-toolbar .e-toolbar-item .e-tbar-btn:focus .e-tbar-btn-text,
.grid-dense .e-grid .e-toolbar .e-toolbar-item .e-tbar-btn:focus .e-icons,
.dense-dialog .e-grid .e-toolbar .e-toolbar-item .e-tbar-btn:focus .e-icons,
.grid-dense .e-grid .e-toolbar .e-toolbar-item .e-tbar-btn.e-active .e-tbar-btn-text,
.dense-dialog .e-grid .e-toolbar .e-toolbar-item .e-tbar-btn.e-active .e-tbar-btn-text,
.grid-dense .e-grid .e-toolbar .e-toolbar-item .e-tbar-btn.e-active .e-icons,
.dense-dialog .e-grid .e-toolbar .e-toolbar-item .e-tbar-btn.e-active .e-icons {
    color: var(--color-sf-content-text-color-alt1, #33506b);
}

/*
    A disabled item - Edit and Delete with no row selected, Change password likewise - carries its own
    plate too:

        .e-toolbar .e-toolbar-item.e-overlay { background: var(--color-sf-content-bg-color-alt1); opacity: .5 }

    which on a tinted band reads as a hole punched in the toolbar rather than as an unavailable action.
    The opacity goes with it, because a half-transparent label over the band is muddier than an honestly
    grey one; the disabled token says "unavailable" on its own.

    :not(.e-template) is the one place this deliberately differs from SelectionCardComponent, and it is
    load-bearing. Giving back opacity: 1 only works because the two rules below then repaint the label and
    the icon in the disabled colour - and those selectors name .e-tbar-btn-text and .e-btn-icon, which are
    the toolbar's OWN buttons. A templated item is an <SfButton> the page wrote; it has neither class, so
    it would get the opacity back and nothing to replace the fade, i.e. a disabled "Change password" that
    looks perfectly enabled. Template items therefore keep the theme's own fade.

    The reception page has the unguarded version and gets away with it because Close car and Close
    reception are never disabled. That is luck, not design.
*/
.grid-dense .e-grid .e-toolbar .e-toolbar-item.e-overlay:not(.e-template),
.dense-dialog .e-grid .e-toolbar .e-toolbar-item.e-overlay:not(.e-template),
.grid-dense .e-grid .e-toolbar .e-toolbar-item.e-overlay:not(.e-template) .e-tbar-btn,
.dense-dialog .e-grid .e-toolbar .e-toolbar-item.e-overlay:not(.e-template) .e-tbar-btn {
    background: transparent;
    opacity: 1;
}

.grid-dense .e-grid .e-toolbar .e-toolbar-item.e-overlay .e-tbar-btn-text,
.dense-dialog .e-grid .e-toolbar .e-toolbar-item.e-overlay .e-tbar-btn-text,
.grid-dense .e-grid .e-toolbar .e-toolbar-item.e-overlay .e-btn-icon,
.dense-dialog .e-grid .e-toolbar .e-toolbar-item.e-overlay .e-btn-icon {
    color: var(--color-sf-content-text-color-disabled, #a8bccd);
}

/* and it must not light up under the pointer - the hover plate above would otherwise paint behind it */
.grid-dense .e-grid .e-toolbar .e-toolbar-item.e-overlay .e-tbar-btn:hover,
.dense-dialog .e-grid .e-toolbar .e-toolbar-item.e-overlay .e-tbar-btn:hover {
    background: transparent;
}

/* a templated item (the search box, and whatever a page adds) has no business carrying its own plate */
.grid-dense .e-grid .e-toolbar .e-toolbar-item.e-template,
.dense-dialog .e-grid .e-toolbar .e-toolbar-item.e-template {
    background-color: transparent;
}

/* ---------------------------------------------------------------------------------------------------
   THE SEARCH PANEL ABOVE THE GRID

   Every master data page opens with the same block: an <EditForm> wrapping ".search-border", holding the
   page's filters, then "Search" as a bootstrap <button class="btn btn-primary"> and "Cancel" as an
   <SfButton CssClass="e-flat">. At the theme's own default sizes that panel measured:

       Search      font-size 16px (bootstrap .btn, 1rem), padding 6px 12px, line-height 1.5   -> 38px
       Cancel      font-size 14px (the theme's .e-btn),   padding 4px 8px,  line-height 1.57  -> 32px
       a text box  font-size 14px, input height 30px, wrapper margin-top 24px                 -> 54px
       the float label above it                                                                  14px
       every control's wrapper carries bootstrap .mb-3                                           16px

   against a grid whose rows are 13px and whose column headings are 11px. The panel was the largest type
   on the page, which it should not be - the data is - and the Search and Cancel buttons did not even
   agree with each other.

   HOW THIS IS DONE, AND WHY THERE IS SO LITTLE OF IT HERE: the markup declares "e-small" next to
   "search-border" on each of the 42 panels, and the theme's own small variant does nearly all of the
   work. That is a real, complete variant in bootstrap5.3 - not just a font-size - and crucially its
   selectors come in an ANCESTOR form as well as an element form:

       .e-small .e-input-group input          height  30px -> 24px
       .e-small .e-input-group input.e-input  font    14px -> 12px, padding-left 8px
       .e-small .e-float-input                margin-top 24px -> 20px, line-height 1.35
       .e-small .e-float-input input ~ label.e-label-top.e-float-text
                                              the floated label: 12px -> 10px, top 17px, and the
                                              translate3d that re-seats it over the shorter box
       .e-small .e-input-group .e-input-group-icon   14px -> 12px, min 24x24
       .e-small .e-input-group .e-clear-icon         min-width 36px -> 24px
       .e-small .e-btn                        font 14px -> 12px, padding 4px 8px -> 5px 6px

   so one class on the panel reaches every Syncfusion control inside it. A text box goes from 54px to
   44px, Cancel from 32px to 28px, and the floated label lands where the theme intends it to.

   THE FLOAT LABEL IS WHY THIS IS NOT HAND-WRITTEN. An earlier version of this block set the input and
   the label to 12.5px/11px directly and left everything else to the theme. That sizes the TEXT and not
   the BOX: the label is absolutely positioned by a translate3d tuned to a 30px input, so shrinking the
   type alone leaves it sitting at the wrong height over the field. The theme ships the matching offset
   (-36px instead of -35px, with !important on the ancestor form) and getting that by hand is work with
   nothing to show for it. Use the design system's own step.

   WHAT IS LEFT HERE is the part e-small cannot reach: the bootstrap button, which is not a Syncfusion
   control and knows nothing about e-small, and the panel's own spacing, which is bootstrap's too.

   SCOPED TO .search-border, NOT TO THE SECTION. ".grid-dense .btn" would catch every button on a master
   data page, including the ones in the edit dialog's FooterTemplate (Insert/Update/Cancel). The panel is
   the thing being made smaller, so the panel is what the selector names. For the same reason "e-small"
   goes on the panel div rather than on <article> next to "grid-dense": up there it would shrink every
   other Syncfusion control on the page too.

   This note used to end "those are a dialog's actions, they are not cramped, and shrinking them was not
   asked for". It has been asked for since, and a dialog's Save and Cancel now take these same numbers -
   but from ".dense-dialog .e-footer-content" in app.css, which is where a dialog is reachable from.
   Widening the selector here still would not do it: Syncfusion appends the dialog to <body>, outside the
   <article> this file hangs off.
   --------------------------------------------------------------------------------------------------- */

/*
    A FILTER IS AS WIDE AS WHAT IT HOLDS, NOT AS WIDE AS THE MONITOR.

    The panels are laid out in Bootstrap columns whose breakpoints stop at "md" - 768px AND UP WITH NO
    CEILING - so a "col-md-3" is 25% of the content area at any size. Measured on Log Transactions at
    1536px: the Customer and Customer Order comboboxes were 529px each and the two date pickers 264px.
    A date needs about 150. Nothing was wrong with the markup; it was proportional where it should have
    been intrinsic, and the restyle only made it obvious by shrinking the controls inside those columns.

    A CAP, NOT A WIDTH. max-width leaves the column free to be NARROWER - below the md breakpoint the
    markup falls back to "col-sm-12", one field per line, and a fixed width there would overflow. So the
    column takes min(its 25%, the cap) and the rule costs nothing on a small window.

    320px for the general case, which is what a name wants: of the 852 partners in arad2 the average is
    26 characters, 90% fit in 42, and 42 characters is about 300px at 12px. The long tail is handled by
    the dropdown popup wrapping rather than by making every filter on every page wide enough for it - see
    the note on .e-ddl.e-popup .e-list-item in app.css.

    190px where the control cannot hold a long value in the first place: a date, a time, a number, a
    checkbox. Those are the ones that looked absurd at 264px and they are detected by WHAT THEY CONTAIN
    rather than by a class somebody has to remember to add. :has() is what makes that possible - checked
    with CSS.supports('selector(:has(a))') in this app's Chrome before relying on it.

    MATCH THE WRAPPER, NOT THE INPUT. The first version of this named ".e-datepicker" and silently missed
    half the date fields in the app: Syncfusion does not put that class on every date picker's input.
    Log Transactions renders "e-control e-datepicker e-lib" on the input; Report Daily Goods Movements
    renders "mandatory_item e-lib e-keyboard" on it and carries no .e-datepicker anywhere in the column.
    Its dates stayed at their 267px col-md-2 while the identical fields one page over were 190px.

    ".e-date-wrapper" and its siblings are the component's structural wrapper and are always written, so
    they match both. If a control type ever looks too wide here, check what Syncfusion actually renders
    for it in the DOM before adding a selector - the class you expect may not be there.

    WHY THIS AND NOT A CLASS PER FIELD. The first version of this was "fld-wide"/"fld-narrow" written by
    hand on Customer Order Logistics, and rolling that out meant a judgement call - is this field a name
    or a code - on about 229 columns across 95 pages. This rule needs no markup, cannot be forgotten on a
    new page, and gets the same answer on the cases that matter. The page-level classes still exist for
    the cases this cannot see: a STATUS dropdown holds one short word but is a dropdown like any other,
    so only a human knows it should be narrow.
*/
@media (min-width: 768px) {
    /*
        A FULL-WIDTH COLUMN IS EXEMPT, and leaving it out of the cap broke a page.

        "col-md-12" is not a field that happens to be wide, it is an explicit "this takes the whole row",
        and Bootstrap relies on that to push it onto a line of its own. Ongoing Delivery Requests ends its
        panel with

            <div class="mb-3 col-md-12 col-sm-12 odr-refresh-bar">  Refresh | Last refresh | @ 5 min

        after four filters totalling 10 of 12 columns, so the bar cannot fit beside them and wraps. Cap it
        at 320px and it fits in the leftover 2 columns perfectly well - so it stopped wrapping and the
        Refresh button, the timestamp and the note appeared in a narrow stack to the RIGHT of the filters
        instead of as a row underneath.

        Wrapping is decided on the item's hypothetical main size AFTER max-width is applied, which is why
        a cap can move an element to a different line. Any rule that narrows flex items has to leave the
        ones whose width is structural alone.
    */
    .grid-dense .search-border [class*="col-md-"]:not([class*="col-md-12"]) {
        max-width: 320px;
    }

    .grid-dense .search-border [class*="col-md-"]:not([class*="col-md-12"]):has(.e-date-wrapper),
    .grid-dense .search-border [class*="col-md-"]:not([class*="col-md-12"]):has(.e-datetime-wrapper),
    .grid-dense .search-border [class*="col-md-"]:not([class*="col-md-12"]):has(.e-time-wrapper),
    .grid-dense .search-border [class*="col-md-"]:not([class*="col-md-12"]):has(.e-numeric),
    .grid-dense .search-border [class*="col-md-"]:not([class*="col-md-12"]):has(.e-checkbox-wrapper) {
        max-width: 190px;
    }
}

/*
    The Search button, given the same size e-small gives Cancel - 12px over 5px/6px on a 1.34em line, so
    both come out at 28px and the pair finally match. These are the theme's numbers for ".e-small .e-btn"
    copied deliberately rather than invented, so the two buttons stay together if the theme's small step
    ever moves.

    No !important: ".grid-dense .search-border .btn" is (0,3,0) against bootstrap's ".btn" (0,1,0), and
    specificity settling it matters because the theme is re-injected from <HeadContent> on some pages -
    see the LOAD ORDER note at the top of this file.

    Only .btn. Cancel is a Syncfusion button - class="e-control e-btn e-lib e-flat", no ".btn" anywhere on
    it - and it is already handled by e-small. Listing .e-btn here as well would mean this file and the
    theme both sizing the same control, and the next person to change one would miss the other.
*/
.grid-dense .search-border .btn,
.dense-dialog .search-border .btn {
    font-size: 12px;
    line-height: 1.34em;
    padding: 5px 6px;
}

/*
    The panel's own padding. 10px/5px/20px/20px was set for controls half as tall again as these; 6px over
    12px keeps the border clear of the fields without framing them in whitespace.
*/
.grid-dense .search-border,
.dense-dialog .search-border {
    padding: 6px 12px;
}

/*
    4px AT THE TOP WHEN THE PANEL STARTS WITH A FLOAT LABEL, so the two ends look the same.

    6px a side is symmetric as a box and is NOT symmetric to the eye. A panel whose first ink is a
    floating label measures 8px above it and 6px below the last control - the label's box sits 2px below
    its row's top, a residue of Syncfusion positioning it inside the input wrapper's own margin. A panel
    that opens with a plain control has no such offset and measures 6 and 6.

    So the correction belongs only to the first kind, and :has(.e-float-text) is what tells them apart -
    the same technique the width cap and the single-tab indicator use. Taking 2px off the padding lands
    the label at 6 and leaves the other shape untouched.

    Measured across ten panels of both shapes after the change: every one of them 6px top and 6px bottom.

    Behind the md breakpoint with everything else here: below it the panel is one field per line and this
    2px is not what anybody is looking at.
*/
@media (min-width: 768px) {
    .grid-dense .search-border:has(.e-float-text),
    .dense-dialog .search-border:has(.e-float-text) {
        padding-top: 4px;
    }
}

/*
    EVERY FLOAT LABEL IN A PANEL IS 12px, because the theme only shrinks some of them.

    "e-small" on the panel is what sizes the Syncfusion controls, and one of the rules it brings is

        .e-small .e-float-input input ~ label.e-label-top.e-float-text   12px -> 10px

    That selector needs an <input> as the label's SIBLING. A dropdown or combobox renders that way and
    gets 10px; a MULTISELECT does not, so it keeps 12px. The result was two label sizes side by side in
    the same panel - measured on Ongoing Delivery Requests, "Customer" at 10px next to "Priority" and
    "Type PN" at 12px, same top, same weight, same colour, different size.

    12px is the one to keep. It is the size the dialogs already use for a field label, it is a step under
    the 13px of the value as everywhere else in this restyle, and 10px was the theme shrinking a label
    that was already small.

    No position work is needed with it. The label is absolutely positioned and its top is set by the
    theme, so only the glyphs grow: the multiselects were ALREADY rendering 12px at that exact position
    with 3px of clearance above the input, which is what makes this safe. Checked across six panels after
    the change - one font size throughout, no label overlapping its field.
*/
@media (min-width: 768px) {
    .grid-dense .search-border .e-float-input input ~ label.e-label-top.e-float-text,
    .grid-dense .search-border label.e-float-text.e-label-top,
    .dense-dialog .search-border .e-float-input input ~ label.e-label-top.e-float-text,
    .dense-dialog .search-border label.e-float-text.e-label-top {
        font-size: 12px;
    }
}

/*
    The gap under each control. Every filter sits in a <div class="mb-3">, which is 16px - more than the
    10px a 24px-tall field now needs, and it is the single biggest number left in the panel once the
    controls themselves are small.

    !important because bootstrap's spacing utilities are declared that way: ".mb-3 { margin-bottom: 1rem
    !important }". Specificity cannot beat an !important, so this is the one place in this file that has
    to answer in kind. It is as tightly scoped as it can be - inside a master data search panel only.
*/
.grid-dense .search-border .mb-3,
.dense-dialog .search-border .mb-3 {
    margin-bottom: .5rem !important;
}

/*
    AND NOT UNDER THE LAST ROW, where there is nothing for it to separate.

    The rule above puts 8px under every control so one row clears the next. On the FINAL row - which on
    every one of these panels is Search and Cancel - that 8px separates the buttons from the panel's own
    bottom padding, so the panel ends up 7px above its first element and 15px below its last.

    Measured on Customer Orders Invoicing, whose panel is only the buttons: 7px above, 15px below, and
    the lopsidedness is the whole of the complaint. Zeroing it gives 7 and 7, and takes 8px of dead
    height off the bottom of all 95 panels at the same time.

    THE COMBINATOR IS THE WHOLE RULE, and the first version of it was wrong in a way worth recording.

    It read "> .row:last-child .mb-3" - the panel's own last row, then any .mb-3 DESCENDED from it. That
    works only while the panel is flat. Several panels are not: Inspection COs, CO Logistics and Ongoing
    Delivery Requests wrap all their rows in one outer <div class="row">, so that outer row IS the
    panel's last child and the descendant combinator reached every .mb-3 inside it. Every filter row lost
    its 8px and Status sat directly on top of Search with no gap at all.

    So: the last row, then "> " to take only its DIRECT column children, which is what stops it reaching
    back up into the filters. On a flat panel the two readings coincide; on a nested one only this
    reading is right.

    THIRD ATTEMPT, AND THE REASON IT TOOK THREE. The middle version said ".row:last-child" at ANY depth,
    which finds a last-child row ANYWHERE - including one that is not the panel's final row at all.
    Monthly Storage Report is the counter-example:

        panel
          row            <- wrapper, holds the Date
            row          <- :last-child OF THE WRAPPER, so it matched
              col  Date  <- and lost its 8px
          row  buttons   <- the actual final row

    The Date field ended up sitting directly on the Search button. The selector now walks the last-child
    CHAIN from the panel itself - one level for a flat panel, two for a nested one - so a row only counts
    as final if every ancestor up to the panel is also last.

    AND ":last-child" ON THE COLUMN TOO, which is the second thing this got wrong.

    Zeroing every column of the last row assumes that row is one visual line. Ongoing Delivery Requests
    is the counter-example: its refresh bar is a col-md-12 INSIDE the same row as the four filters, so it
    wraps to a line of its own - and zeroing the filters' margin along with it left the Refresh button
    jammed directly under the Customer field with no gap at all.

    Only the LAST column can be on the final line, so only the last column may lose its margin. Everything
    above it keeps the 8px that separates the wrapped lines.

    Checked across fifteen panels covering every shape in the app - flat, nested, a full-width bar inside
    the last row, and filters wrapping onto four lines: every one of them keeps 8px between lines and 7px
    below the last control.

    The columns are named as well as .mb-3 because a field is wrapped either as
    <div class="mb-3 col-md-3"> or as a bare <div class="col-md-3">.
*/
.grid-dense .search-border > .row:last-child > .mb-3:last-child,
.grid-dense .search-border > .row:last-child > [class*="col-"]:last-child,
.grid-dense .search-border > .row:last-child > .row:last-child > .mb-3:last-child,
.grid-dense .search-border > .row:last-child > .row:last-child > [class*="col-"]:last-child,
.dense-dialog .search-border > .row:last-child > .mb-3:last-child,
.dense-dialog .search-border > .row:last-child > [class*="col-"]:last-child,
.dense-dialog .search-border > .row:last-child > .row:last-child > .mb-3:last-child,
.dense-dialog .search-border > .row:last-child > .row:last-child > [class*="col-"]:last-child {
    margin-bottom: 0 !important;
}

/*
    The <br> spacers. Most of these panels are laid out with a bare <br> or two between the filters and
    the buttons - about 21px each at the body's line-height, which was invisible next to 54px controls and
    is now the tallest thing in the panel. The padding above and the .mb-3 below already separate the rows.

    This hides them rather than the pages dropping them, deliberately: it is one rule against 42 edits,
    and it reverses in one line if the panel reads too tight.
*/
.grid-dense .search-border br,
.dense-dialog .search-border br {
    display: none;
}
