/* 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. */
.mud-dialog:has(.kompan-nav-dialog-marker) {
    position: fixed !important;
    top: 72px !important;
    left: 72px !important;
    margin: 0 !important;
    width: max-content !important;
    min-width: 600px !important;
    max-width: calc(100vw - 72px) !important;
    height: calc(100vh - 72px) !important;
    max-height: calc(100vh - 72px) !important;
    border-radius: 0 !important;
    transform: none !important;
}

/* A Full modal that holds a working view (what an Add line option opens) floats with the same minimal margin on
   every side, instead of Full's 7xl top margin and its run to the bottom edge. The panel is the modal's own
   element, out of reach of scoped CSS. */
.kompan-modal.mud-dialog.evenly-inset-modal {
    margin: var(--spacing-lg);
    border-radius: var(--radius-modal-md);
}

/* 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(--mud-palette-primary) 12%, var(--mud-palette-surface)) !important;
}
.kompan-nav-selected-row td:first-child {
    box-shadow: inset 4px 0 0 0 var(--mud-palette-primary) !important;
}

/* 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(--mud-palette-primary) 12%, var(--mud-palette-surface));
    box-shadow: inset 4px 0 0 0 var(--mud-palette-primary) !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 page that runs to the bottom of the window marks its root .page-fills-window. The main content then takes
   the window's height - its own top padding is what clears the app bar - and its container hands that height
   down as a flex column, so the page fills its box rather than measuring the window. Everywhere else the main
   content keeps growing with its page. Here because the layout's elements are a child component's, out of reach
   of a page's scoped CSS. */
.mud-main-content:has(.page-fills-window) {
    height: 100dvh;
    display: flex;
    flex-direction: column;
}

.mud-main-content:has(.page-fills-window) > .mud-container {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.page-fills-window {
    flex: 1 1 auto;
    min-height: 0;
}

/* 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(--mud-palette-success) 12%, var(--mud-palette-surface));
    border: 1px solid var(--mud-palette-success);
}
