﻿/* Perhaps.. Makes buttons and fields on line, but makes it tight with the labels in a larger form*/
/*.mud-input-control.mud-input-control-margin-dense.mud-input-outlined-with-label {
    margin-top: 4px !important;
}*/









/* "All modes" */
:root {
    --mab-col-gap: 0.4rem;
    --mab-datagrid-selected-background: var(--mud-palette-info-lighten);
    --mab-datagrid-selected-foreground: var(--mud-palette-info-text);
    --mab-datagrid-selected-hover-background: color-mix( in srgb, var(--mab-datagrid-selected-background) 100%, var(--mud-palette-info) 100% );
    --title-max-height: 32px;
    --mab-tab-toolbar-height: 48px;
    --mab-toolbar-background: #24242a;
    --mab-tab-hover: #4c4c4c;
    --mab-datagrid-footer-background: var(--mab-tab-hover);
    --mab-drawer-logo-height: 150px;
    --context-menu-background: var(--mab-toolbar-background);
    --mab-datagrid-stripe-background: rgba(255,255,255,0.05);
    --mud-typography-button-text-transform: none !important; /* No more uppercase buttons*/
    --mud-appbar-height: 36px !important;
    --mab-datagrid-header-background: rgba(39,39,47,1);
    --mab-datagrid-sticky-divider: color-mix(in srgb, var(--mud-palette-text-primary) 40%, var(--mud-palette-surface));
    --mab-primary-hover: var(--mud-palette-primary-hover);
}

/* Restore sane defaults for lists */
ul, ol, li {
    all: revert;
}


/* Dark mode specific */
/*#main-layout-container.dark {
    --mab-datagrid-selected-background: #909090;
}*/
/* /Dark mode specific */


.icon-fade-out {
    animation: iconFadeOut ease-in 4s forwards;
}

@keyframes iconFadeOut {
    to {
        opacity: 0;
    }
}

.mab-select-item.nomargin .mud-list-item-text {
    margin: 0px !important;
}

/* MudIconButton color */
.fill-inherit .mud-icon-root.mud-svg-icon {
    fill: inherit;
}
/* /MudIconButton*/


/* Mud field overrides (smaller font, padding etc) */
.mud-input > textarea.mud-input-root-outlined {
    margin-top: 0px !important;
}

.mud-input-control .mud-input-label-inputcontrol {
    font-size: 0.8rem !important;
}

.mud-input.mud-shrink .mud-input-outlined-border legend {
    padding: 0 4px !important;
}

.mud-input-outlined-border legend {
    margin: 0px 11px 0px 8px !important;
    font-size: 0.6rem !important;
}

.mud-input > input.mud-input-root-outlined.mud-input-root-margin-dense, div.mud-input-slot.mud-input-root-outlined.mud-input-root-margin-dense {
    padding-top: 8px !important;
    padding-bottom: 8px !important;
}

.mud-shrink ~ label.mud-input-label.mud-input-label-inputcontrol.mud-input-label-outlined {
    margin-top: unset; /* Try to make sure the label does not go "too high" when it's shrunk */
}

.mud-input-control > .mud-input-control-input-container > .mud-input-label-outlined.mud-input-label-inputcontrol {
    max-width: calc(100% - 1em);
    margin-top: -3px; /* Move the placeholder a bit up.. Because we have changed the margins of the parent */
    margin-left: -5px; /* Move the label (placeholder) to the left */
}

.mud-shrink ~ label.mud-input-label.mud-input-label-inputcontrol.mud-input-label-outlined, .mud-input:focus-within ~ label.mud-input-label.mud-input-label-inputcontrol.mud-input-label-outlined {
    margin-top: 0px;
}

/* Make readonly fields more "visible" that they're read only */
.mud-input-control.readonly .mud-input-outlined-border {
    background: rgba(0, 0, 0, 0.2);
}
/* /Mud field overrides */


/* Navigation overrides */
.mud-navmenu .mud-icon-size-medium {
    /*font-size: 1.25rem !important;*/
}

.mud-navmenu .mud-nav-link {
    padding-top: 2px !important;
    padding-bottom: 2px !important;
}
/* /Navigation overrides */


/* Mud overrides */
@media(max-width: 720px) {
    .mud-dialog-width-full {
        width: calc(100% - 16px) !important;
    }

    .mud-container {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }

    .mud-dialog .mud-dialog-content {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
}

.mud-dialog-content {
    padding: 0px 12px !important;
}

.mud-dialog .mud-dialog-title {
    padding-bottom: 0px !important;
}

/* Fullscreen workspaces need less chrome than ordinary modal dialogs. */
.mab-dialog.mud-dialog-fullscreen > .mud-dialog-title {
    padding: 4px 12px 0 !important;
}

.mab-dialog.mud-dialog-fullscreen .mab-dialog-item-id > span {
    margin: 0 !important;
    top: 0;
    right: 12px;
    color: var(--mud-palette-text-secondary);
}

.mud-treeview-item-arrow {
    margin: 0 !important;
}

.mud-tabs-toolbar {
    background-color: var(--mab-toolbar-background);
}

.mud-tab:hover {
    background-color: var(--mab-tab-hover);
}


input[tabindex="-1"] {
    background-color: rgba(0, 0, 0, 0.2) !important;
}

.mud-drawer-header {
    padding: 6px 12px !important; /* Was 12 / 24*/
}

.mud-card-header {
    padding: 8px 16px !important;
}

.mud-card-content {
    padding: 8px 16px !important;
}

.mud-collapse-entering.mud-navgroup-collapse {
    animation-duration: 100ms !important;
}



.mud-icon-button:not(.mud-switch-base) {
    padding: 3px !important;
}

.mud-treeview-dense .mud-icon-button {
    padding: 0px !important;
}

.mud-treeview-item-arrow {
    width: 24px;
}

.mud-treeview-group {
    margin-left: 12px;
    margin-inline-start: 12px;
}

.mud-treeview-dense .mud-treeview-item-content {
    padding: 2px 0px !important;
}

.mud-treeview-item-icon {
    width: 24px;
}

.mud-treeview-item svg {
    font-size: 1.25rem;
}

.mud-treeview-item-content {
    overflow: clip; /* Scenario: Document center, many sub-folders, long names. */
}


.mud-expand-panel .mud-expand-panel-header {
    padding: 0px !important;
    /*padding-bottom: 0px !important;
    padding-top: 0px !important;*/
}

.mud-expand-panel .mud-expand-panel-content {
    padding: 0px !important;
    /*padding-bottom: 0px !important;
    padding-top: 0px !important;*/
}
/* TextField colors */
.mud-input-control.warning {
    background: rgba(255,255,0,0.1);
}
/* /TextField colors */



/* Signature */
.signature-wrapper {
    width: 100%;
}

.signature-canvas {
    margin: 0 auto;
}

.signature-canvas-wrap {
    position: relative;
    width: 100%;
    max-width: 400px;
    justify-self: center;
}

.signature-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    color: #888;
    font-style: italic;
    user-select: none;
    padding: 0.5rem;
    text-align: center;
}
/* /Signature */


/* Tabs */
.mab-tabs .mud-tab {
    padding: 6px 14px;
    border-radius: 10px 10px 0 0;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
    min-width: 120px !important;
}

    .mab-tabs .mud-tab:hover {
        background: rgba(255, 255, 255, 0.07);
        border-color: rgba(255, 255, 255, 0.10);
    }

    .mab-tabs .mud-tab.mud-tab-active {
        background: rgba(255, 255, 255, 0.12);
        border-color: rgba(255, 255, 255, 0.18);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
    }

    .mab-tabs .mud-tab.mud-disabled {
        opacity: 0.5;
    }
/* /Tabs */



.shrink-to-fit {
    display: inline-block;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    transform-origin: left center;
}

.load-error {
    width: 100%;
    overflow: auto;
    height: 100%;
    min-height: 100px;
}

.mab-error,
.mab-error .load-error,
.mab-error .load-error *,
.mab-error .mud-alert-message,
.mab-error .mud-alert-message * {
    -webkit-user-select: text !important;
    user-select: text !important;
}

.mab-error .load-error,
.mab-error .mud-alert-message {
    cursor: text;
}


/* Alert */
.mab-alert.mud-alert-filled-success {
    color: darkslategray;
}

.mab-alert.mud-alert-filled-warning {
    color: darkslategray;
}
/* Dialog */
.mab-dialog-background-passive { /* To allow the background to be clicked */
    pointer-events: none !important;
    background-color: transparent !important;
}

.mab-dialog-background-events { /* To allow the dialog to be clicked if the background is clickable ._. */
    pointer-events: auto !important;
}

.mab-dialog-background-transparent { /* To allow the user to see the background if it's "clickable" */
    background-color: transparent !important;
}

.mab-dialog.fullheight {
    max-height: 100dvh;
}

    .mab-dialog.fullheight .mud-dialog-content {
        height: calc(100dvh - 160px);
        overflow: auto;
    }

.mab-dialog.dynamic-maxheight .mud-dialog-content {
    max-height: calc(100dvh - 160px);
    overflow: auto;
}

.mab-dialog.keep-actions-visible {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.mab-dialog-scroll-body,
.mab-dialog-scroll-body > .mud-focus-trap,
.mab-dialog-scroll-body > .mud-focus-trap > .mud-focus-trap-child-container {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1 1 auto;
}

.mab-dialog.keep-actions-visible .mud-dialog-content {
    min-height: 0;
    flex: 1 1 auto;
    overflow-y: auto;
}

.mab-dialog.keep-actions-visible .mud-dialog-actions {
    flex: 0 0 auto;
}

.mab-dialog.fullheight.no-actions .mud-dialog-content {
    height: calc(100vh - 120px);
}

.mab-dialog.dynamic-maxheight.no-actions .mud-dialog-content {
    max-height: calc(100vh - 120px);
}

.mud-dialog-title.draggable {
    cursor: move !important;
    user-select: none;
}

.mud-dialog-fullscreen .mud-focus-trap {
    display: flex;
    flex-direction: column;
    height: 100%;
}
/* Buttons */
.mab-button.mud-button {
    --mab-button-edge: inset 0 0 0 0 transparent;
    border-radius: 6px;
    transition: background-color 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

/* Neutral enabled buttons need a distinct surface, not a disabled-looking fill. */
.mab-button.mud-button-filled-default:not(:disabled):not(.mud-disabled) {
    --mab-button-edge: inset 0 0 0 1px var(--mud-palette-lines-inputs);
    background-color: color-mix(in srgb, var(--mud-palette-text-primary) 16%, var(--mud-palette-surface));
}

.mab-button.mud-button-filled-default:not(:disabled):not(.mud-disabled):is(:hover, :focus-visible) {
    background-color: color-mix(in srgb, var(--mud-palette-text-primary) 22%, var(--mud-palette-surface));
}

.mab-button.mud-button-outlined-default:not(:disabled):not(.mud-disabled) {
    border-color: var(--mud-palette-lines-inputs);
}

.mab-button.mud-button-outlined-default:not(:disabled):not(.mud-disabled):is(:hover, :focus-visible) {
    border-color: var(--mud-palette-text-secondary);
}

/* Keep semantic colours and MudBlazor's disabled / no-elevation behaviour. */
.mab-button.mud-button-filled:not(:disabled):not(.mud-disabled) {
    background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0.045), rgba(0, 0, 0, 0.045));
}

.mab-button.mud-button-filled:not(:disabled):not(.mud-disabled):not(.mud-button-disable-elevation) {
    box-shadow: var(--mab-button-edge), inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 1px 2px rgba(0, 0, 0, 0.18);
}

@media (hover: hover) and (pointer: fine) {
    .mab-button.mud-button-filled:not(:disabled):not(.mud-disabled):not(.mud-button-disable-elevation):hover {
        box-shadow: var(--mab-button-edge), inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 2px 4px rgba(0, 0, 0, 0.2);
    }
}

.mab-button.mud-button-filled:not(:disabled):not(.mud-disabled):not(.mud-button-disable-elevation):active {
    box-shadow: var(--mab-button-edge), inset 0 1px 2px rgba(0, 0, 0, 0.18);
}

/* A keyboard focus ring must not replace a button's status colour. */
.mud-button-root:focus-visible {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: 2px;
}

@media (max-width: 768px) {
    .hide-icon-on-mobile .mud-button-icon-start { /* Hide the icon on mobile, but not on desktop.. */
        display: none !important;
    }
}
.mud-button.nowrap {
    white-space: nowrap;
}
/* /Buttons*/

/* Snackbars share the theme surface so dark and light modes stay readable. */
.mud-snackbar {
    --mab-snackbar-accent: var(--mud-palette-text-secondary);
    border: 1px solid var(--mud-palette-lines-default);
    border-inline-start: 3px solid var(--mab-snackbar-accent);
    border-radius: 8px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.16);
}

.mud-snackbar:is(.mud-alert-filled-success, .mud-alert-text-success, .mud-alert-outlined-success) {
    --mab-snackbar-accent: var(--mud-palette-success);
}

.mud-snackbar:is(.mud-alert-filled-info, .mud-alert-text-info, .mud-alert-outlined-info) {
    --mab-snackbar-accent: var(--mud-palette-info);
}

.mud-snackbar:is(.mud-alert-filled-warning, .mud-alert-text-warning, .mud-alert-outlined-warning) {
    --mab-snackbar-accent: var(--mud-palette-warning);
}

.mud-snackbar:is(.mud-alert-filled-error, .mud-alert-text-error, .mud-alert-outlined-error) {
    --mab-snackbar-accent: var(--mud-palette-error);
}

.mud-snackbar[class*="mud-alert-"] {
    color: var(--mud-palette-text-primary);
    background-color: var(--mud-palette-surface);
    background-color: color-mix(in srgb, var(--mab-snackbar-accent) 8%, var(--mud-palette-surface));
}

.mud-snackbar .mud-snackbar-icon {
    color: var(--mab-snackbar-accent);
    opacity: 1;
}

.mud-snackbar .mud-snackbar-content-action > .mud-button-root {
    color: var(--mud-palette-text-primary);
}

@media (max-width: 600px) {
    #mud-snackbar-container[class*="mud-snackbar-location-"] {
        left: max(12px, env(safe-area-inset-left));
        right: max(12px, env(safe-area-inset-right));
        width: auto;
        transform: none;
    }

    .mud-snackbar {
        min-width: 0;
        max-width: none;
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mab-button.mud-button {
        transition: none;
    }

    .mud-snackbar {
        animation-duration: 1ms !important;
        transition-duration: 1ms !important;
    }
}
/* /Snackbars */
/* MudSelect - show border around the MudList */
.mud-popover .mud-list {
    border-width: 2px;
    border-color: var(--mud-palette-primary);
}

.mud-popover .mud-list.mud-menu-list {
    /* Hide from normal mud menu */
    border-width: 0px;
}

/* /MudSelect - show border around the MudList */
/* MudTreeView - Add underline to selected */
.mud-treeview-item-content.mud-treeview-item-selected,
.mud-treeview-item-content.mud-treeview-item-selected a {
    text-decoration: underline;
}
/* /MudTreeView */
/* /Mud overrides */


/* Drag and drop / DropZone */
.drag-dropzone-valid {
    transition: border 10ms linear;
    box-shadow: 0 0 0 2px lightblue inset;
}

.drag-source {
    background-color: green;
}

.is-copy {
    opacity: 0.95;
}

.is-move {
    opacity: 0.95;
}

.dnd-helper,
.dnd-modifier-tooltip {
    background-color: var(--mud-palette-info);
    border-radius: 5px;
    padding: 5px;
    font-size: 1em;
    font-weight: 600;
}

.dnd-helper {
    background-color: var(--mud-palette-background);
}

.dnd-move-mode .dnd-modifier-tooltip {
    background-color: var(--mud-palette-warning);
    color: black;
}


/* Global file capture */
/* example */
.file-dropzone-active {
    outline: 2px dashed var(--mud-palette-primary);
    outline-offset: -2px;
}

.file-dropzone-blocked {
    opacity: 0.85;
}
/* A single full-screen overlay, no extra DOM nodes needed */
/*body.file-drag-active::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 2147480000;
    background: rgba(220, 0, 0, 0.10);*/ /* default = blocked (red tint) */
/*transition: background 80ms linear;
}*/

/* When over allowed zone -> green tint */
/*body.file-drag-active.file-drag-allowed::before {
    background: rgba(0, 170, 70, 0.10);
}*/
/* /Global file capture */

/* MabSelect popover */
.mab-autocomplete-more {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-top: 1px solid var(--mud-palette-lines-default);
    color: var(--mud-palette-text-secondary);
    font-size: 0.8rem;
}

.mabselect-tall {
    /* Leave room for the field and an edge gutter on either side of the viewport
       midpoint. MudBlazor can then flip the whole dropdown without covering its
       field. Override its inline pixel limit, but keep its native positioning. */
    max-height: min(480px, calc(50vh - 32px)) !important;
    max-height: min(480px, calc(50dvh - 32px)) !important;
    overflow-y: auto;
}
/* Opt-in for complete menus such as Planner statuses. ViewportDropdown.js keeps
   their position inside the visible viewport after MudBlazor positions/flips them. */
.mabselect-viewport {
    max-height: min(600px, calc(100vh - 24px)) !important;
    max-height: min(600px, calc(var(--mab-dropdown-viewport-height, 100dvh) - 24px)) !important;
    overflow-y: auto;
}
/* MabInput */

/* MudSelect */
.noborder .mud-input-outlined-border {
    border-width: 0px !important;
}

.noborder:hover .mud-input-outlined-border {
    border-width: 1px !important;
}
/* /MudSelect */


.plain-until-selected .mud-input-outlined-border {
    border-width: 0px !important;
}

.plain-until-selected input:focus ~ .mud-input-outlined-border,
.plain-until-selected .editing .mud-input-outlined-border {
    border-width: 1px !important;
}

.mud-input-control.cursor-pointer input {
    cursor: pointer;
}

.mud-input-control.fullheight,
.mud-input-control.fullheight div {
    height: 100%;
}

    .mud-input-control.fullheight textarea {
        height: 100% !important;
    }
/* /MabInput */
/* Input */
.input-text-align-end input {
    text-align: end;
}
/* DragDrop */
.drag-drop-item {
    /* Makes the item undraggable... */
    /*display: contents;*/
}

.drag-drop-item.dragging {
    opacity: 0.5; /* Optional, to make the item semi-transparent while dragging */
    border: 2px dashed #888; /* Optional, to show a dashed border while dragging */
}

.drag-drop-zone {
    /*display: contents;*/
}

    .drag-drop-zone.dnd-outline-valid {
        outline: 2px dashed var(--mud-palette-primary);
        outline-offset: -2px; /* or 2px depending on look */
        border-radius: 6px;
    }

/* /DragDrop */
    .drag-drop-zone.dnd-outline-valid[data-dnd-edge] { outline: none; }
    .drag-drop-zone[data-dnd-edge="before"] > td { box-shadow: inset 0 2px var(--mud-palette-primary); }
    .drag-drop-zone[data-dnd-edge="after"] > td { box-shadow: inset 0 -2px var(--mud-palette-primary); }

/* Drag and drop */
.file-drop-zone {
    width: 100%;
    height: 100%;
    align-items: center;
    margin-bottom: 2px;
    min-height: 100px;
}

    .file-drop-zone.outline {
        border: 3px dotted #fb275d;
    }

    .file-drop-zone.dragging {
        border: 3px dotted green;
        background-color: var(--mud-palette-grey-default);
    }
/* Textfield */
.mab-hide-error-text .mud-input-helper-text.mud-input-error {
    display: none;
}
.mab-no-helper-space > .mud-input-control-helper-container {
    margin-top: 0 !important;
    min-height: 0 !important;
}

.texfield-badge-root {
    position: relative;
    display: block;
    width: 100%;
    min-width: 0;
}

.textfield-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    z-index: 2;
    pointer-events: none;
}
/*.textfield-badge.top.right {
    inset: auto auto calc(100% - 20px) calc(100% - 13px);
}*/
/* Tabs */
.mab-tabs {
    overflow: hidden !important; /* Workaround to allow MudGrid inside of a tab to not overlap.. Ref https://github.com/MudBlazor/MudBlazor/issues/9477 */
    /* Allows filters, outlines, and shadows to render 20px past the hidden edges */

    /* Do not add this, it will f up "expand" inside of a tab */
    /*clip-path: inset(-20px);
    overflow-clip-margin: 10px;*/
}
.mab-tabs .mud-tab {
    text-transform: none !important;
}

.mab-tabs.fullheight {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.mab-tabs.fullwidth {
    width: 100%;
}

.mab-tabs-panel {
    overflow: hidden; /* Workaround to allow MudGrid inside of a tab to not overlap.. Ref https://github.com/MudBlazor/MudBlazor/issues/9477 */
    /* Allows filters, outlines, and shadows to render 20px past the hidden edges */
    
    /* Do not add this, it will f up "expand" inside of a tab */
    /*clip-path: inset(-20px);
    overflow-clip-margin: 10px;*/
}

.mab-tabs-panel.fullheight {
    height: calc(100% - var(--mab-tab-toolbar-height));
    display: flex;
    flex-direction: column;
    /*margin-bottom: 1em; */ /* 2025-02-04: Not needed? Old:To show the border if the content is MabFormSection */
}

.mab-tabs-panel.fullheight .mud-tab-panel {
    height: 100%;
    /*display: contents;*/ /* Do not use, fucks up KeepTabsAlive */
}

.mab-tab-content {
    width: 100%;
    padding: 10px 16px;
    transition: box-shadow 300ms cubic-bezier(.4,0,.2,1) 0ms;
    background-color: var(--mud-palette-surface);
    color: var(--mud-palette-text-primary);
    box-shadow: var(--mud-elevation-10);
    border-radius: var(--mud-default-borderradius);
    flex: 0;
    max-height: 99%; /* So we can see the bottom border ._. */
    height: 99%;
}

.mab-tabs.dense .mud-tabs-tabbar-inner,
.mab-tabs.dense .mud-tab {
    min-height: 36px !important;
}
/* Content container */
.mab-content-container {
}

.mab-container.fullheight {
    height: calc(100dvh - 68px);
    /*height: calc(100vh - 96px);*/
}

/* Opt-in pages whose navigation stays in view while their content panes scroll.
   MainLayout supplies the app bar and 12px top/bottom container margins. */
.mab-container.viewport-fit {
    height: calc(100dvh - var(--mud-appbar-height) - 24px);
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
}
.viewport-fit > .mab-header { flex-shrink: 0; }
.viewport-fit > .mab-content-section.fullheight {
    flex: 1 1 0;
    height: auto;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
}
.viewport-fit .mab-tabs.fullheight,
.viewport-fit .mab-tabs-panel.fullheight {
    flex: 1 1 0;
    height: auto;
    min-height: 0;
    min-width: 0;
}
.viewport-fit .mab-tabs-panel.fullheight > .mud-tab-panel.mud-tab-panel-active:not(.mud-tab-panel-hidden) {
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    height: auto;
    min-height: 0;
    min-width: 0;
    overflow: auto;
    overscroll-behavior: contain;
}
.viewport-fit .mud-tabs-tabbar { flex-shrink: 0; min-width: 0; }
.viewport-fit .datagrid-container {
    flex: 1 1 0;
    height: auto;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
}
.viewport-fit .datagrid-scroll-container { min-height: 0 !important; }

@media(min-width: 0) {
    .mab-container-maxwidth-xs {
        max-width: 444px;
    }
}

@media(min-width: 600px) {
    .mab-container-maxwidth-sm {
        max-width: 600px;
    }
}

@media(min-width: 960px) {
    .mab-container-maxwidth-md {
        max-width: 960px;
    }
}

@media(min-width: 1280px) {
    .mab-container-maxwidth-lg {
        max-width: 1280px;
    }
}

@media(min-width: 1920px) {
    .mab-container-maxwidth-xl {
        max-width: 1920px;
    }
}

@media(min-width: 2560px) {
    .mab-container-maxwidth-xxl {
        max-width: 2560px;
    }
}
/* /Content container */
/* Content section */
.mab-content-section.outlined {
    border: 1px solid var(--mud-palette-lines-default);
}

.mab-content-section {
    border-radius: var(--mud-default-borderradius);
    background-color: var(--mud-palette-surface);
    transition: border-radius 250ms cubic-bezier(.4,0,.2,1);
    display: flex;
    flex-direction: column;
    position: relative;
    /*padding: 1em;*/ /* 2025-12-17 KB - Fjernet etter forespørsel fra Magnus */
}

    /*@media(max-width: 720px) {
    .mab-content-section {
        padding: 8px;
    }
}*/

    .mab-content-section.fullheight {
        height: calc(100% - var(--title-max-height));
    }
/* /Content section */
/* Form section */
.mab-form-section {
    display: flex;
    flex-direction: column;
    padding: 10px 8px;
    transition: box-shadow 300ms cubic-bezier(.4,0,.2,1) 0ms;
    background-color: var(--mud-palette-surface);
    color: var(--mud-palette-text-primary);
    box-shadow: var(--mud-elevation-10);
    border-radius: var(--mud-default-borderradius);
}

    .mab-form-section.fullheight {
        height: 100%;
    }

    .mab-form-section.fullwidth {
        width: 100%;
    }

    .mab-form-section:not(:last-child) {
        margin-bottom: 1em;
    }

    .mab-form-section.grow {
        flex-grow: 1;
        max-height: 100%;
        min-height: 0;
    }


.darken-section {
    background: linear-gradient(0deg, #1e1e2d 0%, rgba(21, 21, 33, 1) 50%);
    border: 1px solid rgba(51, 50, 62, 1);
}
/* /Form section */


/* Badges */
.mab-badge-click-through {
    pointer-events: none;
}
/* /Badges */

/* Table */
table.simple-table td {
    padding: 0 15px 0 0;
}

.mab-simple-table thead {
    top: 0;
    background: var(--mab-datagrid-header-background);
    z-index: 1;
}

.mab-simple-table th.justify-end,
.mab-simple-table td.justify-end {
    justify-items: end !important;
    text-align: end !important;
}

.mab-simple-table th.justify-center,
.mab-simple-table td.justify-center {
    justify-items: center !important;
    text-align: center !important;
}

.mab-simple-table tfoot {
    border-top: 1px solid var(--mud-palette-table-lines);
    background-color: var(--mab-datagrid-footer-background);
}

.mab-simple-table * tr > td,
.mab-simple-table * tr > th {
    padding: 0px !important;
    padding-left: 4px !important;
}

/* /Table */
/* MAB Service */
.service-info {
    display: flex;
}

.service-info-label {
    flex-grow: 0;
    min-width: 100px;
    flex-basis: 20%;
}

.service-info-data {
    flex-grow: 1;
}


/* Opt-in mobile cards share desktop column templates, but use natural heights. */
.dg-header { display: flex; align-items: center; gap: 8px; flex-shrink: 0; min-width: 0; }
.dg-header-content { flex: 1 1 auto; min-width: 0; display: flex; }
.dg-view-toggle { display: flex; align-items: center; justify-content: center; flex: 0 0 44px; }
.datagrid-container.dg-responsive-grid { min-height: 0; min-width: 0; overflow: hidden; }
.dg-responsive-grid .datagrid-scroll-container { min-height: 0 !important; min-width: 0; overscroll-behavior: contain; }
.datagrid-container.dg-mobile-container {
    min-width: 0;
    --scroll-pad: 0px;
}

table.datagrid.dg-mobile-cards {
    table-layout: fixed;
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0 10px;
    background: transparent;
}
table.datagrid.dg-mobile-cards > tbody > tr.dg-row { background: transparent !important; }

table.datagrid.dg-mobile-cards > tbody > tr > td.dg-mobile-card-cell {
    padding: 0;
    border: 1px solid var(--mud-palette-divider);
    border-radius: 10px;
    height: auto;
    text-align: start;
}

table.datagrid.dg-mobile-cards > tbody > tr > td,
table.datagrid.dg-mobile-cards > tbody > tr > td div {
    white-space: normal;
    overflow: visible;
    overflow-wrap: anywhere;
    text-overflow: clip;
    min-width: 0;
}

table.datagrid.dg-mobile-cards .dg-mobile-card {
    padding: 14px;
    border-radius: 10px;
    background: var(--mud-palette-surface);
    color: var(--mud-palette-text-primary);
}
table.datagrid.dg-mobile-cards .selected .dg-mobile-card { box-shadow: inset 0 0 0 2px var(--mud-palette-primary); }
table.datagrid.dg-mobile-cards .dg-mobile-card-link { cursor: pointer; }
table.datagrid.dg-mobile-cards .dg-mobile-primary-button {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex-basis: 100%;
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: start;
    cursor: pointer;
}
table.datagrid.dg-mobile-cards .dg-mobile-primary-button .dg-mobile-primary {
    flex-basis: auto;
    text-align: start;
    overflow-wrap: anywhere;
}
table.datagrid.dg-mobile-cards .dg-mobile-primary-button:focus-visible {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: 4px;
}
table.datagrid.dg-mobile-cards .dg-mobile-summary,
table.datagrid.dg-mobile-cards .dg-mobile-details {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
}
table.datagrid.dg-mobile-cards .dg-mobile-field { flex: 1 1 120px; }
table.datagrid.dg-mobile-cards .dg-mobile-template { flex-basis: 100%; }
table.datagrid.dg-mobile-cards .dg-mobile-primary {
    flex-basis: 100%;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.45;
}
table.datagrid.dg-mobile-cards .dg-mobile-icon { flex: 0 0 auto; align-self: center; }
table.datagrid.dg-mobile-cards .dg-mobile-label {
    display: block;
    font-size: .75rem;
    /* Follow the card's foreground/background pair, including custom row colours. */
    color: inherit;
    opacity: .75;
    /* Reset separately inherited order-line text-fill colours to this foreground. */
    -webkit-text-fill-color: currentColor;
    margin-bottom: 2px;
}
table.datagrid.dg-mobile-cards .dg-mobile-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
table.datagrid.dg-mobile-cards .dg-mobile-details { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--mud-palette-divider); }
.dg-mobile-button {
    min-height: 44px;
    min-width: 44px;
    padding: 8px 12px;
    border: 1px solid var(--mud-palette-divider);
    border-radius: 6px;
    background: var(--mud-palette-surface);
    color: var(--mud-palette-text-primary);
    font: inherit;
    cursor: pointer;
}
.dg-mobile-button:hover { background: var(--mud-palette-action-default-hover); }
.dg-mobile-button.dg-view-toggle {
    flex-basis: 34px;
    min-width: 34px;
    min-height: 34px;
    height: 34px;
    padding: 5px;
    align-self: center;
}
.dg-mobile-button:focus-visible, .dg-mobile-toolbar select:focus-visible { outline: 2px solid var(--mud-palette-primary); outline-offset: 2px; }
.dg-mobile-button:disabled { opacity: .5; cursor: default; }
.dg-mobile-button[aria-pressed="true"] { border-color: var(--mud-palette-primary); color: var(--mud-palette-primary); }
.dg-mobile-open { background: var(--mud-palette-primary); color: var(--mud-palette-primary-text); border-color: var(--mud-palette-primary); }
.dg-mobile-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; padding: 6px 0; }
.dg-mobile-toolbar label { flex: 1 1 160px; min-width: 0; display: grid; gap: 4px; font-size: .8rem; }
.dg-mobile-toolbar select { width: 100%; min-width: 0; min-height: 44px; padding: 8px; border: 1px solid var(--mud-palette-divider); border-radius: 6px; background: var(--mud-palette-surface); color: var(--mud-palette-text-primary); font: inherit; }
.dg-mobile-pagination { display: grid; gap: 10px; text-align: center; padding: 8px 0 16px; color: var(--mud-palette-text-secondary); }
.dg-mobile-load { width: 100%; }
.dg-mobile-selection { display: flex; gap: 8px; align-items: center; min-height: 44px; }
.dg-mobile-selection input { width: 22px; height: 22px; }
table.datagrid.dg-mobile-cards .hover-icon { display: inline-flex; visibility: visible; opacity: 1; min-width: 44px; min-height: 44px; }

/* Datagrid */
.datagrid-container {
    display: flex;
    flex-flow: column;
    height: 100%;
    overflow: auto;
    --scroll-pad: 50px;
}

.datagrid-container.dg-fit-columns,
.dg-fit-columns > .datagrid-scroll-container {
    min-width: 0;
    max-width: 100%;
}

.dg-multi-select-header {
    justify-content: center;
    padding-right: 0 !important;
}

.datagrid-container.dg-with-pager {
    min-height: 0;
    min-width: 0;
    overflow: hidden;
}

.dg-with-pager > .datagrid-scroll-container {
    min-height: 0 !important;
    min-width: 0;
}

.dg-pager-content {
    flex-shrink: 0;
    padding: 0.5rem;
    border-top: 1px solid var(--mud-palette-divider);
    background: var(--mud-palette-surface);
}

.dg-pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.dg-pager-summary {
    font-variant-numeric: tabular-nums;
}

.dg-multi-selection {
    display: grid;
    gap: 0.5rem;
    padding: 0.5rem;
    border-top: 1px solid var(--mud-palette-divider);
    background: var(--mud-palette-surface);
}

.dg-multi-selection-toolbar,
.dg-multi-selection-actions,
.dg-multi-selection-items {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.dg-multi-selection-actions {
    flex: 1 1 auto;
}

.dg-multi-selection-items {
    min-height: 30px;
    max-height: 80px;
    overflow-y: auto;
    overflow-x: hidden;
    width: 100%;
}

@media (max-width: 600px) {
    .dg-multi-selection-toolbar,
    .dg-multi-selection-actions {
        align-items: stretch;
    }

    .dg-multi-selection-actions {
        flex-basis: 100%;
    }
}

table.datagrid {
    border-spacing: 0;
    width: 100%;
    background-color: var(--mud-palette-surface);
    border-radius: var(--mud-default-borderradius);
    transition: box-shadow 300ms cubic-bezier(.4,0,.2,1) 0ms;
    border-collapse: collapse;
}

    table.datagrid .sortable {
        cursor: pointer;
        display: inline-flex;
    }

        table.datagrid .sortable svg {
            fill: currentColor;
            font-size: 1.5rem;
            width: 1em;
            height: 1em;
        }

            table.datagrid .sortable svg.desc {
                transform: rotate(180deg);
            }

        table.datagrid .sortable:hover {
            color: var(--mud-palette-action-default);
        }

    table.datagrid * tr th {
        background-color: var(--mab-datagrid-header-background) !important;
        position: sticky;
        top: 0;
        z-index: 1;
        vertical-align: bottom;
    }

    table.datagrid * th .div {
        display: flex;
    }

/* Collapsed table borders are painted separately from sticky cells and can
   expose scrolled content through their seams. Give pinned grids cell-owned
   borders, keeping a single border between neighboring cells. */
table.datagrid.dg-sticky-columns:not(.mobile):not(.dg-mobile-cards) {
    border-collapse: separate;
    border-spacing: 0;
}

table.datagrid.dg-sticky-columns:not(.mobile):not(.dg-mobile-cards) > tbody > tr > td {
    border-width: 0 1px 1px 0;
}

table.datagrid.dg-sticky-columns:not(.mobile):not(.dg-mobile-cards) > tbody > tr > td:first-child {
    border-left-width: 1px;
}

table.datagrid.dg-sticky-columns:not(.mobile):not(.dg-mobile-cards) > tbody > tr:first-child > td {
    border-top-width: 1px;
}

/* Each sticky cell gets a measured left offset shared by its header and body.
   Keep body cells below the normal headers, and pinned headers above both. */
table.datagrid:not(.mobile):not(.dg-mobile-cards) > tbody > tr > td.dg-sticky-column {
    position: sticky;
    z-index: 1;
    background-color: inherit;
}

table.datagrid:not(.mobile):not(.dg-mobile-cards) > thead > tr > th {
    z-index: 2;
}

table.datagrid:not(.mobile):not(.dg-mobile-cards) > thead > tr > th.dg-sticky-column {
    z-index: 3;
}

/* Only the final visible pinned column draws the group boundary. Its inherited
   divider color also reaches newly virtualized rows without touching each row. */
table.datagrid:not(.mobile):not(.dg-mobile-cards) > thead > tr > th.dg-sticky-column {
    box-shadow: inset -2px 0 0 var(--dg-sticky-divider, transparent);
}

/* Repaint the inherited row/cell background over a solid backing. This also
   preserves translucent hover colors without showing scrolling text through. */
table.datagrid:not(.mobile):not(.dg-mobile-cards) > tbody > tr > td.dg-sticky-column::before,
table.datagrid:not(.mobile):not(.dg-mobile-cards) > tbody > tr > td.dg-sticky-column::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
}

table.datagrid:not(.mobile):not(.dg-mobile-cards) > tbody > tr > td.dg-sticky-column::before {
    z-index: -2;
    background: var(--mud-palette-surface);
}

table.datagrid:not(.mobile):not(.dg-mobile-cards) > tbody > tr > td.dg-sticky-column::after {
    z-index: -1;
    background: inherit;
    box-shadow: inset -2px 0 0 var(--dg-sticky-divider, transparent);
}

    table.datagrid .col-header-content {
        padding-right: var(--mab-col-gap);
        position: relative;
        display: flex;
        align-items: center;
        width: 100%;
        vertical-align: bottom;
    }

        table.datagrid .col-header-content.wrap {
            white-space: normal;
            overflow: hidden;
            max-height: 70px;
        }

    table.datagrid .col-options {
        margin-left: -0.4em;
    }

        table.datagrid .col-options button {
            padding: 0px;
        }

    table.datagrid .col-title {
        display: flex; /* So that we can make col-title-text expand as much as possible, and still hide overflow with ellipsis */
        line-height: 1.5rem;
        font-weight: 500;
        /*gap: 0.4rem;*/
        min-width: 0px;
        flex-grow: 1;
        padding: 0;
    }

    table.datagrid div.col-title {
        /*padding-left: 0.5em;*/
    }
    /* If the column is sortable, its title is rendered as a button element for accessibility and to support navigation by tab */
    table.datagrid button.col-title {
        border: none;
        background: none;
        position: relative;
        cursor: pointer;
        justify-content: start;
    }

    table.datagrid .col-justify-end .col-title {
        justify-content: end;
        flex-direction: row-reverse; /* For end-justified cols, the sort indicator should appear before the title text */
        padding-left: 0em;
    }

    table.datagrid .col-justify-start .col-title {
        justify-content: start;
    }

    table.datagrid .col-justify-center .col-title {
        justify-content: center;
        padding-left: 0em;
    }


    /* Datagrid: Mobile */
    table.datagrid.mobile td {
        display: flex;
        justify-content: space-between;
        align-items: start;
        text-align: end !important;
        border: none;
    }

    table.datagrid.mobile colgroup {
        display: none;
    }

    table.datagrid.mobile td:before {
        content: attr(data-label);
        font-weight: 500;
        padding-right: 16px;
        padding-inline-end: 16px;
        padding-inline-start: unset
    }

    table.datagrid.mobile td:last-child {
        /*border-bottom: 2px solid var(--mud-palette-table-lines);*/
        border-bottom: 1px solid rgba(255,255,255,0.5);
    }
    /* Hide empty cells on mobile */
    table.datagrid.mobile td:has(span:empty),
    table.datagrid.mobile td:empty {
        /*display:none; This will hide the "lines" as well.. */
        height: 0;
    }

    table.datagrid.mobile tr {
        display: revert;
    }

    table.datagrid.mobile thead {
        display: none;
    }
    /* We put the column title text in its own element primarily so that it can use text-overflow: ellipsis */
    table.datagrid .col-title-text {
        text-overflow: ellipsis;
        overflow: hidden;
        white-space: nowrap;
    }

    table.datagrid .icon-column-small {
        width: 25px;
        padding: 0px;
        text-align: center;
        margin-top: 3px;
        justify-items: center; /* For the header */
    }

    table.datagrid .icon-column-medium {
        width: 33px;
    }

    table.datagrid th.icon-column-small {
        padding: 0.1rem;
    }

    table.datagrid .icon-column-small .col-header-content {
        padding-right: 0px; /* So the header and the icons lines up.. */
    }

    table.datagrid > thead .col-width-draghandle {
        width: 0.4rem;
        /*right: calc(var(--mab-col-gap)/2);*/
        /*right: calc(-9px + var(--mab-col-gap)/2);*/
        right: -5px;
        position: absolute;
        top: 0;
        bottom: 0;
        cursor: ew-resize;
    }

        table.datagrid > thead .col-width-draghandle:after {
            top: 5px;
            bottom: 5px;
            position: absolute;
            content: ' ';
            border-left: 1px solid #ccc;
        }

    table.datagrid .sort-indicator {
        opacity: 0;
        width: 0em;
        height: 1em;
        align-self: center;
        text-align: center;
        user-select: none;
        transition: opacity 300ms cubic-bezier(.4,0,.2,1) 0ms,transform 200ms cubic-bezier(.4,0,.2,1) 0ms;
    }

    table.datagrid .col-sort-desc .sort-indicator,
    table.datagrid .col-sort-asc .sort-indicator {
        opacity: 0.5;
        width: 1em;
        /*background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M 2 3.25 L 12 20.75 L 22 3.25 L 12 10 z" /></svg>');*/
    }

    table.datagrid .col-sort-desc .sort-indicator {
        transform: scaleY(-1);
    }

    table.datagrid * tr {
        white-space: nowrap; /* We want to allow multi-lines in tables? OR - atleast on mobile!! */
    }


    /* DataGrid row colors */
    /* normal hover (non-selected) */
    table.datagrid tr:not(.selected):hover {
        background-color: var(--mud-palette-table-hover) !important;
        transition: background-color 0.15s ease;
    }

    table.datagrid tr.selected:hover {
        background-color: var(--mab-datagrid-selected-hover-background) !important;
        transition: background-color 0.15s ease;
    }

    table.datagrid tr.error {
        background-color: darkred !important;
    }

    table.datagrid tr.selected.error {
        background-color: red !important;
    }

    table.datagrid tr.selected,
    table.datagrid tr.success.selected {
        background-color: var(--mab-datagrid-selected-background) !important;
        color: var(--mab-datagrid-selected-foreground) !important;
    }

    table.datagrid tr.success {
        background-color: #A4FFA4 !important;
        color: black !important;
    }

    table.datagrid tr.success:hover {
        background-color: lawngreen !important;
        color: black !important;
    }

    table.datagrid tr.success.selected:hover {
        background-color: var(--mab-datagrid-selected-hover-background) !important;
        color: var(--mab-datagrid-selected-foreground) !important;
    }

    table.datagrid tr.warning {
        background-color: #FFFFA4 !important;
        color: black;
    }

    table.datagrid tr.error {
        background-color: #FFA4A4 !important;
        color: black;
    }

    table.datagrid tr.level-1 {
        box-shadow: inset 0 0 0 9999px rgba(33, 150, 243, 0.2); /* Blue*/
    }

    table.datagrid tr.level-2 {
        box-shadow: inset 0 0 0 9999px rgba(0, 150,136, 0.2); /* Teal */
    }

    table.datagrid tr.level-3 {
        box-shadow: inset 0 0 0 9999px rgba(156, 39, 176, 0.2); /* Violet */
    }

    table.datagrid tr.level-4 {
        box-shadow: inset 0 0 0 9999px rgba(255, 193, 7, 0.2); /* Amber */
    }


    table.datagrid * tr td {
        border: 1px solid var(--mud-palette-table-lines);
    }

    table.datagrid * tr td,
    table.datagrid * tr td div {
        text-overflow: ellipsis;
        overflow: hidden;
        white-space: nowrap; /* We want to allow multi-lines in tables? OR - atleast on mobile!! */
    }


    table.datagrid * tr td.slider,
    table.datagrid * tr td.slider div {
        overflow: unset;
    }

table.datagrid * tr th {
    text-align: start;
    /*padding: 0.1rem calc(0.4rem + var(--mab-col-gap)) 0.1rem 0rem*/
    padding: 0.1rem 0.4rem;
}

table.datagrid * tr td {
    text-align: start;
    padding: 0.1rem calc(0.4rem + var(--mab-col-gap)) 0.1rem 6px;
}
/* Datagrid editable columns */
table.datagrid * tr td:has(.mud-input-control) {
    padding: 0px;
    margin: 0px;
}
table.datagrid * tr td .mud-input-control,
table.datagrid * tr td .mud-input-control div {
    overflow: visible;
}

table.datagrid .mud-input-control {
    margin: 0px;
}
/* /Datagrid editable columns */
/* Stripe only master rows (those with .dg-row) */
table.datagrid tbody > .dg-row:nth-child(even of .dg-row) {
    background-color: #373740;
}

table.datagrid tbody > .dg-row:nth-child(odd of .dg-row) {
    background-color: #41414A;
}
/* Make the detail row match the master above it */
table.datagrid tbody > .dg-row:nth-child(even of .dg-row) + .dg-detail-row {
    background-color: #373740;
}
/* Inline-block tooltip wrappers add a text baseline below icons/badges, which can
   make a row taller than ItemSize. Keep the trigger in a single flex box instead.
   Scope to ordinary desktop cells, not headers, detail rows or mobile cards. */
table.datagrid.fixed-row-height:not(.mobile) > tbody > tr.dg-row > td > .mud-tooltip-root.mud-tooltip-inline {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
}

table.datagrid.fixed-row-height td > button,
table.datagrid.fixed-row-height:not(.mobile) > tbody > tr.dg-row > td > .mud-tooltip-root > button {
     padding-top: 0px;
     padding-bottom: 0px;
}



table.datagrid .col-justify-end {
    text-align: end;
    padding-right: 1em;
    justify-items: end;
}

table.datagrid .col-justify-center {
    text-align: center;
    justify-items: center;
}

table.datagrid tfoot {
    background-color: var(--mab-datagrid-footer-background)
}

table.datagrid .resizer {
    height: 100%;
    position: absolute;
    top: 0;
    right: 0;
    width: 8px;
    cursor: col-resize;
    user-select: none;
}

table.datagrid .resizer:hover {
    border-right: 2px solid var(--mud-palette-primary);
}

table.datagrid .dg-detail-cell {
    color: goldenrod;
}

.datagrid-search .mud-input-adornment {
    padding-left: 6px !important;
}

.datagrid-search .mud-icon-root.mud-svg-icon {
    margin-top: -2px !important;
}
/* /Datagrid */


/* Input */
.clickable-input input {
    cursor: pointer;
}
/* /Input */




/* Context menu */
.context-menu-surface {
    min-width: 200px;
    width: 100%;
    padding: 4px 0;
    background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 6px;
    box-shadow: var(--mud-elevation-8);
}

.context-menu-item {
    width: 100%;
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) 16px;
    align-items: center;
    gap: 8px;
    min-height: 30px;
    padding: 4px 10px;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.context-menu-item:hover {
    background: var(--mud-palette-action-default-hover);
}

.context-menu-item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.context-menu-item-label {
    font-size: 0.875rem;
}
.context-menu-item-title {
    /* Prevent clicks, selection, and hover states */
    pointer-events: none;
    user-select: none;
    /* Text wrapping rules */
    overflow-wrap: break-word;
    white-space: normal;
    width: 100%;
    grid-column: 1 / -1;
    word-break: break-word;
    /* Styling as a title */
    font-size: 0.75rem;
    font-weight: 600;
    color: #666666;
    padding: 6px 12px;
}

.context-menu-item-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
}
.context-menu-wrapper {
    touch-action: manipulation;
}
.context-menu-item-root {
    /* Whatever you change later, do not use display: contents.. It makes the submenus not anchor properly :P */
    /*display: contents;*/
}
/* /Context menu */


/* Tooltip */
.mab-light-tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
}

/* Text-mode tooltip bubble */
.mab-light-tooltip-text::after {
    content: attr(data-tooltip);
    position: absolute;
    z-index: 9999;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(2px);
    min-width: max-content;
    max-width: 260px;
    white-space: pre-line;
    overflow-wrap: break-word;
    background: var(--mud-palette-surface);
    color: var(--mud-palette-text-primary);
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 0.75rem;
    line-height: 1.25rem;
    box-shadow: var(--mud-elevation-6);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 120ms ease, transform 120ms ease, visibility 120ms ease;
}

.mab-light-tooltip-text::before {
    content: "";
    position: absolute;
    z-index: 10000;
    bottom: calc(100% + 3px);
    left: 50%;
    transform: translateX(-50%) translateY(2px);
    border-width: 5px 5px 0 5px;
    border-style: solid;
    border-color: var(--mud-palette-surface) transparent transparent transparent;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 120ms ease, transform 120ms ease, visibility 120ms ease;
}

/* Show text-mode tooltip */
.mab-light-tooltip-text:hover::after,
.mab-light-tooltip-text:hover::before,
.mab-light-tooltip-text:focus-within::after,
.mab-light-tooltip-text:focus-within::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Hide empty text-mode tooltips */
.mab-light-tooltip[data-tooltip=""]::after,
.mab-light-tooltip[data-tooltip=""]::before {
    display: none;
}

/* Rich/content-mode tooltip */
.mab-light-tooltip-content {
    display: none;
    position: absolute;
    z-index: 9999;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(2px);
    min-width: max-content;
    max-width: 320px;
    white-space: normal;
    background: var(--mud-palette-surface);
    color: var(--mud-palette-text-primary);
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 0.75rem;
    line-height: 1.25rem;
    box-shadow: var(--mud-elevation-6);
    pointer-events: none;
}

.mab-light-tooltip-rich:hover .mab-light-tooltip-content,
.mab-light-tooltip-rich:focus-within .mab-light-tooltip-content {
    display: block;
}

/* Bottom placement */
.mab-light-tooltip-bottom::after {
    top: calc(100% + 8px);
    bottom: auto;
}

.mab-light-tooltip-bottom::before {
    top: calc(100% + 3px);
    bottom: auto;
    border-width: 0 5px 5px 5px;
    border-color: transparent transparent var(--mud-palette-surface) transparent;
}

.mab-light-tooltip-bottom .mab-light-tooltip-content {
    top: calc(100% + 8px);
    bottom: auto;
}
/* /Tooltip */


/* Progress dialog */
.progress-dialog-v2 {
    display: flex;
    flex-direction: row;
    gap: 16px;
    min-height: 90px;
    min-width: 360px;
    align-items: flex-start;
}

.progress-dialog-v2-icon {
    width: 42px;
    display: flex;
    justify-content: center;
    padding-top: 4px;
}

.progress-dialog-v2-content {
    flex: 1;
    min-width: 0;
}

.progress-dialog-v2-progress {
    margin-top: 12px;
}
/* /Progress dialog */



/* Date range picker */
.mud-range-between {
    background-color: #01579B !important;
}
/* /Date range picker */



/* Select */
.mabselect-loading .mud-input-adornment .mud-icon-root,
.mabselect-loading .mud-input-adornment svg,
.mabtextfield-loading .mud-input-adornment svg {
    animation: mabselect-spin 0.9s linear infinite;
}

@keyframes mabselect-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* /Select */





/* DivFlex */
.flex-equal > * {
    flex: 1 1 0;
    min-width: 0;
}
/* /DivFlex */


/* Shortcut hint */
.mab-shortcut-hint {
    display: none;
    position: absolute;
    z-index: 1000;
    padding: 2px 5px;
    border-radius: 4px;
    background: var(--mud-palette-dark);
    color: var(--mud-palette-dark-text);
    font-size: 10px;
    font-weight: 600;
    line-height: 14px;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: var(--mud-elevation-4);
    top: -6px;
    right: -6px;
}

/* Show all shortcut hints while Alt is held */
body.mab-alt-active .mab-shortcut-hint {
    display: block;
}

.mab-tab-shortcut-hint {
    display: none;
    margin-left: 5px;
    padding: 1px 4px;
    border-radius: 4px;
    background: var(--mud-palette-action-default);
    color: var(--mud-palette-text-primary);
    font-size: 10px;
    font-weight: 600;
    line-height: 14px;
    pointer-events: none;
    margin-top: 7px;
    margin-right: 7px;
}

body.mab-alt-active .mab-tab-shortcut-hint {
    display: inline-flex;
}

.mab-nav-link-shortcut-host {
    position: relative;
}

.mab-nav-link-shortcut-host .mab-shortcut-hint {
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
}
/* /Shortcut hint */

/* DateTimeRangePicker dialog header. The picker is rendered in MudBlazor's portal. */
.mud-dialog:has(.mab-date-time-range-picker__panel) {
    max-height: calc(100dvh - 2rem);
    overflow-y: auto;
}

.mud-dialog:has(.mab-date-time-range-picker__panel) .mud-picker-actions {
    position: sticky;
    bottom: 0;
    z-index: 2;
    background: var(--mud-palette-surface);
}

.mud-picker:has(.mab-date-time-range-picker__panel) .mud-picker-datepicker-toolbar {
    position: relative;
}

.mud-picker:has(.mab-date-time-range-picker__panel) .mud-picker-datepicker-toolbar::before {
    position: absolute;
    top: .65rem;
    left: 50%;
    color: inherit;
    content: var(--mab-date-time-range-picker-title);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    transform: translateX(-50%);
    white-space: nowrap;
}

.mud-picker:has(.mab-date-time-range-picker__panel) .mud-button-date {
    width: 100%;
}

.mud-picker:has(.mab-date-time-range-picker__panel) .mud-button-date .mud-button-label {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    width: 100%;
    font-size: 2.125rem;
    font-weight: 400;
    line-height: 1.2;
    text-transform: none;
}

.mud-picker:has(.mab-date-time-range-picker__panel) .mud-button-date .mud-button-label::before {
    grid-column: 1;
    content: var(--mab-date-time-range-picker-start);
    text-align: left;
}

.mud-picker:has(.mab-date-time-range-picker__panel) .mud-button-date .mud-button-label::after {
    grid-column: 3;
    content: var(--mab-date-time-range-picker-end);
    text-align: right;
}

@media (max-width: 600px) {
    .mud-picker:has(.mab-date-time-range-picker__panel) .mud-button-date .mud-button-label {
        font-size: 1.5rem;
    }
}
/* /DateTimeRangePicker dialog header */

/* Opt-in mobile navigation keeps a single set of tab panels alive. */
.mab-tabs-mobile-toolbar { display: none; }
.mab-tabs-mobile-option { display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; }
.mab-tabs-mobile-option > .mud-icon-root { flex-shrink: 0; }
.mab-tabs-mobile-option-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mab-tabs-responsive { min-width: 0; width: 100%; }
.mab-tabs-responsive.fullheight { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.mab-tabs-responsive.fullheight > .mab-tabs { flex: 1; min-height: 0; }
@media (max-width: 767.98px) {
    .mab-tabs-responsive > .mab-tabs > .mud-tabs-tabbar { display: none; }
    .mab-tabs-responsive.fullheight > .mab-tabs { height: auto; }
    .mab-tabs-mobile-toolbar { display: flex; align-items: center; flex-shrink: 0; gap: 8px; padding: 4px 8px; }
    .mab-tabs-mobile-toolbar > .mud-select { flex: 1; min-width: 0; }
    .mab-tabs-mobile-toolbar .mud-icon-button { min-width: 44px; min-height: 44px; }
}

/* Inventory dialogs are portalled to body by MudBlazor; keep these rules
   scoped by their explicit dialog class rather than a component ancestor. */
.inventory-responsive-dialog{--inventory-picker-height:max(160px,calc(100dvh - 370px))}
@media(max-width:767.98px){
 .mud-dialog.inventory-responsive-dialog{--inventory-picker-height:max(140px,calc(100dvh - 300px));width:100vw!important;max-width:100vw!important;height:100dvh;max-height:100dvh;margin:0!important;border-radius:0}
 .mud-dialog.inventory-responsive-dialog > [id^="mab-dialog-"]{height:auto!important;flex:1;min-height:0}
 .mud-dialog.inventory-responsive-dialog .mud-dialog-content{height:auto;flex:1;min-height:0}
}

/* Client-side button hints; toggled by the shared keyboard bridge. */
.mab-button-shortcut-hint{display:none;position:absolute;right:2px;top:1px;min-width:16px;padding:0 3px;border:1px solid var(--mud-palette-lines-default);border-radius:3px;background:var(--mud-palette-surface);color:var(--mud-palette-text-primary);font-size:10px;font-weight:700;line-height:15px;pointer-events:none;z-index:1}.mab-button-shortcut-visible .mab-button-shortcut-hint{display:block}
