/* App-global styles. Kept intentionally minimal — nearly all styling is component-scoped .razor.css.

   The "Navigate to ..." nav dialogs dock as a full-height panel flush against the 72px nav-menu
   drawer, below the 72px fixed app bar, instead of floating centred. It is hooked via an inert
   marker element rendered inside the dialog because MudBlazor 9.7's DialogOptions still exposes no
   dialog-level custom class (only BackgroundClass, which lands on the overlay); the dialog also renders
   in the overlay, out of reach of scoped CSS. It runs from under the app bar to the window's bottom edge -
   top and bottom, not a height worked out from the window - and the modal's FillBody hands that height to
   the picker's lists and grids (ADR-modal-sizes). The modal aligns its panel to the start, which would size a
   positioned box to its content between those insets, so the dock stretches. */
.mud-dialog:has(.kompan-nav-dialog-marker) {
    position: fixed !important;
    top: 72px !important;
    bottom: 0 !important;
    left: 72px !important;
    margin: 0 !important;
    width: max-content !important;
    min-width: 600px !important;
    max-width: calc(100vw - 72px) !important;
    height: auto !important;
    max-height: none !important;
    align-self: stretch !important;
    border-radius: 0 !important;
    transform: none !important;
}

/* The docked panel's height is the window's, so its body takes all the header and the footer leave, as Full's
   does: the body token's cap stopped it 2000px under the header, leaving the panel empty below its footer on a
   window taller than about 2270px. */
.mud-dialog:has(.kompan-nav-dialog-marker) .kompan-modal__body {
    max-block-size: none;
}

/* Docked nav dialogs read as an attached panel, not a modal — drop the dimming scrim and the blur
   Kompan.UI's modal draws behind itself. BackgroundClass lands on the overlay, so zero the scrim (matched
   both as the classed element and as its descendant). The panel's own column - header, body that fills
   and scrolls, footer at the bottom - is the modal's (Kompan.UI ADR-0093). */
.kompan-nav-dialog-no-scrim,
.kompan-nav-dialog-no-scrim .mud-overlay-scrim {
    background-color: transparent !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
}

/* Navigate-dialog selected list row: a left accent bar plus a clearer (opaque) tint than
   mud-primary-hover, since the faint hover tint alone was too subtle to spot the selected row. */
.kompan-nav-selected-row td {
    background-color: color-mix(in srgb, var(--color-bg-brand-solid) 12%, var(--color-bg-primary)) !important;
}
.kompan-nav-selected-row td:first-child {
    box-shadow: inset 4px 0 0 0 var(--color-bg-brand-solid) !important;
}

/* A navigator's grid picks a row on click, as its Bookmarked and Recent lists pick an item, so its rows answer the mouse
   as those items do. Kompan.UI gives such a row the pointer; its hover is a 2% black wash a dark theme cannot show, so
   the rows take a translucent wash of the theme's foreground, as faint as the lists' hover in the light theme. The tint
   is a background image so it also lies over a sticky cell's opaque background, and over the selected row's tint. */
@media (hover: hover) {
    .kompan-nav-grid .kompan-table__body > tr.kompan-table__row:not(.kompan-table__empty-row):hover > td {
        background-image: linear-gradient(color-mix(in srgb, var(--color-fg-primary) 8%, transparent), color-mix(in srgb, var(--color-fg-primary) 8%, transparent));
    }
}

/* What stands in for the rows of a picker's grid - "Choose a view", "No views to choose from", "No baskets found" in
   the D365 view pickers, "Choose what to search for" in Add line's archived quotes - is Figma's Empty state with its block padding cut to spacing-xl. The grid takes what its pane's tabs and filters
   leave, which on a short window (a 1366x768 screen at 125%, stacked) is about 125px under the header, and Figma's 40px and
   48px made the empty state 156px: it scrolled inside the grid. A decision of ours (docs/architecture/pattern-load-states.md, decision 1). */
.d365-view-list .kompan-empty-state,
.archived-quotes-list .kompan-empty-state {
    padding-block: var(--spacing-xl);
}

/* Bookmarked/Recent tabs render as a MudList; give the selected list item the same accent bar + tint
   as the table rows. MudBlazor paints a selected item with .mud-primary-hover, whose background-color is
   !important inside the vendor cascade layer, and a layered !important outranks any unlayered one - so
   the tint goes in through the custom property that rule reads rather than against it. */
.mud-dialog:has(.kompan-nav-dialog-marker) .mud-list-item.mud-selected-item {
    --mud-palette-primary-hover: color-mix(in srgb, var(--color-bg-brand-solid) 12%, var(--color-bg-primary));
    box-shadow: inset 4px 0 0 0 var(--color-bg-brand-solid) !important;
}

/* A status marker's hover card — the basket line's and the catalogue row's alike. KompanTooltip renders
   into MudPopoverProvider at the document root, so no scoped rule in either app can reach it — not even
   through ::deep, which needs a scoped ancestor, and which is also why this is not named for either of
   them. The card is KeepOpen and one exists per grid row, so without an explicit stacking order a card
   opened on one row is painted under the rows below it. */
.kompan-status-card {
    z-index: 1400;
}

/* A toast's action keeps its label on one line. MudBlazor 9.7 lets the button wrap, so beside a long
   message a two-word action ("Open case", "Open folder") broke over two lines in a 71px-wide button. The
   snackbar renders in MudSnackbarProvider at the document root, out of reach of scoped CSS. */
.mud-snackbar-content-action > button {
    white-space: nowrap;
}

/* An alert that reports an outcome rather than demanding attention - the newly created variant. The
   severity colour as a real border plus a 12% tint of it, which is the same treatment
   .kompan-nav-selected-row uses, instead of MudBlazor's filled variant shouting the whole panel green.

   Both halves are needed and neither MudBlazor variant supplies them: .mud-alert-outlined-* draws its
   border at --mud-palette-border-opacity (0.12), which alone is nearly invisible, and .mud-alert-text-*
   backgrounds with the equally faint --mud-palette-success-hover alpha. No !important: MudBlazor sits in
   the vendor cascade layer, so an unlayered rule here beats its ordinary declarations whatever their
   specificity or order. */
.kompan-alert-outcome-success {
    background-color: color-mix(in srgb, var(--color-border-success-solid) 12%, var(--color-bg-primary));
    border: 1px solid var(--color-border-success-solid);
}
