html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.chat-message-badge {
    inset: auto auto calc(100% - 24px) calc(100% - 32px) !important;
}

.mud-tabs-toolbar-inner {
}

.mud-tab {
}
.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;
    padding-left: 10px !important;
    padding-right: 10px !important;
}
.mud-table-cell {
    display: table-cell;
    padding: 12px;
    font-size: .750rem !important;
   
}

/* ---- Field labels, app-wide: smaller and lighter than the content ------------------------------
   MudBlazor floats an outlined label as the 16px label scaled to 75% (12px) in the content colour
   (text-primary). Here a floating label is 14.67px before that scale, so 11px on screen, and uses a
   lighter colour derived from the theme's content colour, which keeps it right in dark mode too.
   Focus (primary), error (red, MudBlazor uses !important) and disabled keep MudBlazor's colours: the
   colour rules exclude error and disabled, and the focus rule below repeats MudBlazor's with the same
   weight as the colour rule so it wins by order. The resting label inside an empty field keeps its
   size and only takes the lighter colour. */
.mud-input-control > .mud-input-control-input-container > label.mud-input-label.mud-input-label-inputcontrol:not(.mud-disabled):not(.mud-input-error),
.mud-input-control > .mud-input-control-input-container > .mud-shrink ~ label.mud-input-label.mud-input-label-inputcontrol:not(.mud-disabled):not(.mud-input-error) {
    color: var(--mud-palette-text-secondary);
    color: color-mix(in srgb, var(--mud-palette-text-primary) 72%, transparent);
}

.mud-input-control > .mud-input-control-input-container > .mud-input:focus-within ~ label.mud-input-label.mud-input-label-inputcontrol:not(.mud-disabled):not(.mud-input-error) {
    color: var(--mud-palette-primary);
}

.mud-input-control > .mud-input-control-input-container > .mud-shrink ~ label.mud-input-label.mud-input-label-inputcontrol.mud-input-label-outlined,
.mud-input-control > .mud-input-control-input-container > .mud-input:focus-within ~ label.mud-input-label.mud-input-label-inputcontrol.mud-input-label-outlined {
    font-size: 0.9167rem;   /* 14.67px, scaled by MudBlazor's 0.75 = 11px */
}

.mud-table-sticky-header * .mud-table-root .mud-table-head * .mud-table-cell.sticky-left, .mud-table-sticky-header * .mud-table-root .mud-table-head * .mud-table-cell.sticky-right {
    z-index: 30;
    background-color: var(--mud-palette-background-gray);
}

.mud-table-sticky-footer * .mud-table-root .mud-table-foot * .mud-table-cell.sticky-left, .mud-table-sticky-footer * .mud-table-root .mud-table-foot * .mud-table-cell.sticky-right {
    z-index: 3;
    background-color: var(--mud-palette-background-gray);
}


.search-com .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: 9px !important;
}

.search-com .mud-input-control-input-container > .mud-input-label-outlined.mud-input-label-inputcontrol {
    line-height: 14px !important;
}

.mud-input-control.search-com {
    margin: 0 !important;
}

/* Date/time pickers: keep the label small and on the border even when the field is empty.
   Text fields, selects and autocompletes do this with ShrinkLabel="true", but MudBlazor 7
   pickers have no such parameter, so an empty picker showed its label at the full 16px inside
   a 30px-high dense field, cutting into the border. The values are the ones MudBlazor itself
   applies to a shrunk outlined label (.mud-shrink ~ label). This relies on MudBlazor 7 drawing
   the notch with the label's own background: revisit it when upgrading MudBlazor. */
.mud-picker .mud-input-control > .mud-input-control-input-container > label.mud-input-label.mud-input-label-inputcontrol.mud-input-label-outlined {
    transform: translate(14px, -6px) scale(0.75);
    max-width: calc(100% - 14px);
    font-size: 0.9167rem;   /* same 11px on screen as the other floating labels */
}

/* Search field in a toolbar row (Opret Borger, Sagsbehandlere): MudBlazor gives a labelled dense
   control uneven margins (8px top, 4px bottom), which left the box 2px below the centre line of
   the buttons beside it. The selector repeats MudBlazor's own (.mud-input-control
   .mud-input-control-margin-dense.mud-input-outlined-with-label) plus the wrapper, because
   MudBlazor.min.css is loaded after this file and would win a tie. */
.search-field-wrap > .mud-input-control.mud-input-control-margin-dense.mud-input-outlined-with-label {
    margin-top: 0;
    margin-bottom: 0;
}

:root {
}

/* ---- Responsive foundation --------------------------------------------------------------- */

/* The page area fills the visible viewport; 100dvh follows the mobile browser's collapsing
   toolbars, 100vh is the fallback for browsers without it. */
.app-main-content {
    height: 100vh;
    height: 100dvh;
}

/* Below MudBlazor's md breakpoint (960px) NavMenu swaps the mini drawer for a temporary one that
   slides over the page. MudBlazor applies the mini drawer's content and app-bar offsets without a
   media query, so they are zeroed here for that range. The layout classes are set by the module's
   drawer.js on the inner MudLayout (MainLayout nests a second one around AuthorizedLayout); the
   extra .mud-layout in the selector outranks MudBlazor's rule, which loads after this file and
   would otherwise win the tie. */
@media (max-width: 959.98px) {
    .mud-layout.mud-drawer-open-mini-md-left .mud-main-content,
    .mud-layout.mud-drawer-close-mini-md-left .mud-main-content,
    .mud-layout.mud-drawer-open-responsive-md-left .mud-main-content,
    .mud-layout.mud-drawer-close-responsive-md-left .mud-main-content {
        margin-left: 0 !important;
    }

    .mud-layout.mud-drawer-open-mini-md-left.mud-drawer-left-clipped-never .mud-appbar,
    .mud-layout.mud-drawer-close-mini-md-left.mud-drawer-left-clipped-never .mud-appbar,
    .mud-layout.mud-drawer-open-responsive-md-left.mud-drawer-left-clipped-never .mud-appbar,
    .mud-layout.mud-drawer-close-responsive-md-left.mud-drawer-left-clipped-never .mud-appbar {
        margin-left: 0 !important;
        width: 100% !important;
    }
}

/* Phones (below the sm breakpoint, 600px). */
@media (max-width: 599.98px) {
    /* Rows of fields and buttons wrap instead of squeezing. MudBlazor 7 renders a MudStack row as
       plain "d-flex flex-row" utility classes, so that is what is targeted, limited to the page
       area and dialogs. A field (text, select, autocomplete, picker) takes a line of its own;
       buttons, checkboxes and labels keep their size and flow onto the next line. Class "keep-row"
       on a stack keeps it on one line. */
    .app-main-content .d-flex.flex-row:not(.keep-row),
    .mud-dialog .d-flex.flex-row:not(.keep-row) {
        flex-wrap: wrap;
    }

    .app-main-content .d-flex.flex-row:not(.keep-row) > *,
    .mud-dialog .d-flex.flex-row:not(.keep-row) > * {
        min-width: 0;
    }

    .app-main-content .d-flex.flex-row:not(.keep-row) > .mud-input-control,
    .app-main-content .d-flex.flex-row:not(.keep-row) > .mud-picker,
    .app-main-content .d-flex.flex-row:not(.keep-row) > .mud-select,
    .app-main-content .d-flex.flex-row:not(.keep-row) > .mud-autocomplete,
    .mud-dialog .d-flex.flex-row:not(.keep-row) > .mud-input-control,
    .mud-dialog .d-flex.flex-row:not(.keep-row) > .mud-picker,
    .mud-dialog .d-flex.flex-row:not(.keep-row) > .mud-select,
    .mud-dialog .d-flex.flex-row:not(.keep-row) > .mud-autocomplete {
        flex: 1 1 100%;
        max-width: 100%;
    }

    /* Dialogs use the whole width of the screen. */
    .mud-dialog-container .mud-dialog {
        margin: 8px;
        width: calc(100% - 16px) !important;
        max-width: calc(100% - 16px) !important;
        max-height: calc(100% - 16px);
    }

    /* Wide grids (the edit screens) scroll sideways instead of pushing the page out. */
    .mud-table-container {
        overflow-x: auto;
    }
}

/* ---- Drawer header ---------------------------------------------------------------------------
   Dense MudDrawerHeader is 48px like the dense app bar; its 24px side padding is tightened so the
   40px wordmark and "CMS" fit the 240px drawer on one line. The extra .mud-drawer in the selector
   outranks MudBlazor's padding rule, which loads after this file. */
.mud-drawer .mud-drawer-header.app-drawer-header {
    padding: 4px 14px;
    gap: 10px;
}

.app-drawer-wordmark {
    height: 40px;
    width: auto;
    display: block;
}

.app-drawer-product {
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.06em;
    color: var(--mud-palette-drawer-text);
    white-space: nowrap;
}

/* ---- Unsaved changes on the case screens ---------------------------------------------------
   A field whose value differs from the loaded one carries .field-changed (set by the page's
   ChangeTracker): amber border and fill, amber label with a pencil. The colours are mixed from
   the theme's warning colour so they hold in dark mode. The strip under the app bar is described
   further down; its error variant uses the error colour. Nothing of this prints. */
.field-changed {
    --app-unsaved: color-mix(in srgb, var(--mud-palette-warning) 65%, var(--mud-palette-text-primary));
    --app-unsaved-fill: color-mix(in srgb, var(--mud-palette-warning) 14%, var(--mud-palette-surface));
}

.field-changed .mud-input.mud-input-outlined {
    background-color: var(--app-unsaved-fill);
}

.field-changed .mud-input.mud-input-outlined > .mud-input-outlined-border {
    border-color: var(--app-unsaved) !important;
    border-width: 2px;
}

.field-changed .mud-input-control > .mud-input-control-input-container > label.mud-input-label,
.field-changed .mud-input-control > .mud-input-control-input-container > .mud-shrink ~ label.mud-input-label {
    color: var(--app-unsaved) !important;
    font-weight: 600;
}

.field-changed label.mud-input-label::after {
    content: "";
    display: inline-block;
    width: 11px;
    height: 11px;
    margin-left: 5px;
    vertical-align: -1px;
    background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20h9'/%3E%3Cpath d='M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4Z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20h9'/%3E%3Cpath d='M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.field-changed .mud-checkbox .mud-typography,
.field-changed.mud-checkbox .mud-typography {
    color: var(--app-unsaved);
    font-weight: 600;
}

/* A changed field that fails a ContactRules check shows the error colour, not the amber. */
.field-changed .mud-input.mud-input-outlined.mud-input-error > .mud-input-outlined-border {
    border-color: var(--mud-palette-error) !important;
}

.field-changed .mud-input-control > .mud-input-control-input-container > label.mud-input-label.mud-input-error {
    color: var(--mud-palette-error) !important;
}

/* The strip lives in the layout (AuthorizedLayout), directly under the app bar and above the
   page's scroll area, which takes the remaining height: the page scrolls below the strip, so it
   never covers content. The main content's top padding already matches the app bar's height in
   this app (measured at phone and desktop widths), so the strip needs no offset of its own. */
.mud-layout .app-main-content {
    display: flex;
    flex-direction: column;
}

.unsaved-strip {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex: none;
    padding: 7px 16px;
    font-size: 14px;
    line-height: 1.35;
    color: var(--mud-palette-text-primary);
    background: color-mix(in srgb, var(--mud-palette-warning) 14%, var(--mud-palette-surface));
    border-bottom: 1px solid color-mix(in srgb, var(--mud-palette-warning) 65%, var(--mud-palette-text-primary));
}

.unsaved-strip-icon {
    flex: none;
    margin-top: 1px;
    color: color-mix(in srgb, var(--mud-palette-warning) 65%, var(--mud-palette-text-primary));
}

.unsaved-strip-error {
    background: color-mix(in srgb, var(--mud-palette-error) 12%, var(--mud-palette-surface));
    border-bottom-color: var(--mud-palette-error);
}

.unsaved-strip-error .unsaved-strip-icon {
    color: var(--mud-palette-error);
}

@media print {
    .unsaved-strip { display: none !important; }
    .field-changed .mud-input.mud-input-outlined { background-color: transparent; }
    .field-changed .mud-input.mud-input-outlined > .mud-input-outlined-border { border-color: #c4c7cc !important; border-width: 1px; }
    .field-changed label.mud-input-label { color: inherit !important; font-weight: normal; }
    .field-changed label.mud-input-label::after { display: none; }
}

/* Paper is white: print with the light palette whatever the screen theme. In dark mode the page
   otherwise printed light text on white, or - where a page forces backgrounds to print, as Mine
   sager does for its row colours - on the dark background. MudThemeProvider writes the palette as
   variables on :root in a <style> after this sheet, hence !important. Values are MudBlazor's light
   defaults, with the main text darkened for paper. */
@media print {
    :root {
        --mud-palette-text-primary: rgba(0,0,0,0.87) !important;
        --mud-palette-text-secondary: rgba(0,0,0,0.6) !important;
        --mud-palette-text-disabled: rgba(0,0,0,0.38) !important;
        --mud-palette-action-default: rgba(0,0,0,0.54) !important;
        --mud-palette-action-default-hover: rgba(0,0,0,0.06) !important;
        --mud-palette-action-disabled: rgba(0,0,0,0.26) !important;
        --mud-palette-action-disabled-background: rgba(0,0,0,0.12) !important;
        --mud-palette-surface: #ffffff !important;
        --mud-palette-background: #ffffff !important;
        --mud-palette-background-gray: #f5f5f5 !important;
        --mud-palette-drawer-background: #ffffff !important;
        --mud-palette-drawer-text: rgba(0,0,0,0.87) !important;
        --mud-palette-drawer-icon: rgba(0,0,0,0.6) !important;
        --mud-palette-appbar-background: #ffffff !important;
        --mud-palette-appbar-text: rgba(0,0,0,0.87) !important;
        --mud-palette-lines-default: rgba(0,0,0,0.12) !important;
        --mud-palette-lines-inputs: #bdbdbd !important;
        --mud-palette-table-lines: #e0e0e0 !important;
        --mud-palette-table-striped: rgba(0,0,0,0.02) !important;
        --mud-palette-table-hover: rgba(0,0,0,0.04) !important;
        --mud-palette-divider: #e0e0e0 !important;
        --mud-palette-divider-light: rgba(0,0,0,0.8) !important;
        --mud-palette-skeleton: rgba(0,0,0,0.12) !important;
    }

    html, body {
        background: #ffffff !important;
        color: rgba(0,0,0,0.87) !important;
    }
}
