/* PreWorkOrderReport KPI cards - global scope needed for MudBlazor child components */
.kpi-card {
    border-top-width: 3px !important;
    border-top-style: solid !important;
}

.kpi-card-default {
    border-top-color: var(--mud-palette-text-primary) !important;
}

.kpi-card-primary {
    border-top-color: var(--mud-palette-primary) !important;
}

.kpi-card-secondary {
    border-top-color: var(--mud-palette-secondary) !important;
}

.kpi-card-success {
    border-top-color: var(--mud-palette-success) !important;
}

.kpi-card-info {
    border-top-color: var(--mud-palette-info) !important;
}

.kpi-card-warning {
    border-top-color: var(--mud-palette-warning) !important;
}

.kpi-card-error {
    border-top-color: var(--mud-palette-error) !important;
}

.my-7 {
    min-width: 24vw;
}

.mud-table-dense * .mud-table-row .mud-table-cell {
    padding: 1px 4px 1px 4px;
    padding-inline-start: 2px;
    padding-inline-end: 3px;
}


.mud-input-label-inputcontrol {
    transform: translate(0, 12px) scale(1);
}

.mud-input-label-shrink {
    transform: translate(0, -12px) scale(0.75) !important;
}
.mud-card-content, .mud-card-header {
    padding: 4px !important;
}

/* ===== Compact density (html.o-compact, toggled by DensityPreferenceService) ===== */
/* html.o-compact outranks the :root variables emitted by MudThemeProvider. */
html.o-compact {
    --mud-typography-default-size: .8125rem;
    --mud-typography-body1-size: .8125rem;
    --mud-typography-body2-size: .75rem;
    --mud-typography-subtitle1-size: .8125rem;
    --mud-typography-subtitle2-size: .75rem;
    --mud-typography-button-size: .75rem;
    --mud-typography-caption-size: .6875rem;
    --mud-typography-h6-size: 1rem;
    --mud-typography-h5-size: 1.125rem;
    --mud-typography-h4-size: 1.375rem;
    --mud-drawer-width-left: 220px;
}

html.o-compact .mud-main-content.o-main-content {
    padding-left: 8px !important;
    padding-right: 8px !important;
    padding-bottom: 8px !important;
}

/* Inputs (outlined + dense): ~30px instead of ~40px */
html.o-compact .mud-input-control.mud-input-control-margin-dense,
html.o-compact .mud-input-control.mud-input-control-margin-dense.mud-input-outlined-with-label {
    margin-top: 6px;
    margin-bottom: 0;
}

html.o-compact .mud-input > input.mud-input-root-outlined.mud-input-root-margin-dense,
html.o-compact div.mud-input-slot.mud-input-root-outlined.mud-input-root-margin-dense {
    padding-top: 6px;
    padding-bottom: 6px;
}

html.o-compact .mud-input > textarea.mud-input-root-outlined.mud-input-root-margin-dense {
    padding-top: 6px;
    padding-bottom: 6px;
    mask-image: linear-gradient(to bottom, transparent 6px, black 6px);
}

/* Resting label position for the shorter input; the shrunk (floating) rule is more specific and still wins. */
html.o-compact .mud-input-label-outlined.mud-input-label-margin-dense {
    transform: translate(14px, 8px) scale(1);
}

html.o-compact .mud-input-adornment .mud-icon-button {
    padding: 2px;
}

html.o-compact .mud-input-helper-text-margin-dense {
    margin-top: 1px;
}

/* Checkbox / radio / switch */
html.o-compact .mud-checkbox > .mud-icon-button,
html.o-compact .mud-radio > .mud-icon-button {
    padding: 2px;
}

/* MudGrid spacing halved (Spacing=1 stays 4px) */
html.o-compact .mud-grid-spacing-xs-2 { width: calc(100% + 4px); margin-left: -4px; margin-top: -4px; }
html.o-compact .mud-grid-spacing-xs-2 > .mud-grid-item { padding-left: 4px; padding-top: 4px; }
html.o-compact .mud-grid-spacing-xs-3 { width: calc(100% + 6px); margin-left: -6px; margin-top: -6px; }
html.o-compact .mud-grid-spacing-xs-3 > .mud-grid-item { padding-left: 6px; padding-top: 6px; }
html.o-compact .mud-grid-spacing-xs-4 { width: calc(100% + 8px); margin-left: -8px; margin-top: -8px; }
html.o-compact .mud-grid-spacing-xs-4 > .mud-grid-item { padding-left: 8px; padding-top: 8px; }
html.o-compact .mud-grid-spacing-xs-5 { width: calc(100% + 10px); margin-left: -10px; margin-top: -10px; }
html.o-compact .mud-grid-spacing-xs-5 > .mud-grid-item { padding-left: 10px; padding-top: 10px; }
html.o-compact .mud-grid-spacing-xs-6 { width: calc(100% + 12px); margin-left: -12px; margin-top: -12px; }
html.o-compact .mud-grid-spacing-xs-6 > .mud-grid-item { padding-left: 12px; padding-top: 12px; }

/* MudStack gaps halved */
html.o-compact .mud-stack.gap-2 { gap: 4px; }
html.o-compact .mud-stack.gap-3 { gap: 6px; }
html.o-compact .mud-stack.gap-4 { gap: 8px; }
html.o-compact .mud-stack.gap-5 { gap: 10px; }
html.o-compact .mud-stack.gap-6 { gap: 12px; }

/* Tabs */
html.o-compact .mud-tabs-tabbar-inner {
    min-height: 34px;
}

html.o-compact .mud-tab {
    min-height: 34px;
    padding: 4px 10px;
}

html.o-compact .mud-tab .mud-icon-root {
    font-size: 1.125rem;
}

/* Buttons & chips */
html.o-compact .mud-button-filled:not(.mud-button-filled-size-small):not(.mud-button-filled-size-large) { padding: 4px 12px; }
html.o-compact .mud-button-outlined:not(.mud-button-outlined-size-small):not(.mud-button-outlined-size-large) { padding: 3px 11px; }
html.o-compact .mud-button-text:not(.mud-button-text-size-small):not(.mud-button-text-size-large) { padding: 4px 6px; }
html.o-compact .mud-button-filled-size-small { padding: 2px 8px; }
html.o-compact .mud-button-outlined-size-small { padding: 1px 7px; }
html.o-compact .mud-button-text-size-small { padding: 2px 4px; }

html.o-compact .mud-chip.mud-chip-size-small {
    height: 20px;
    font-size: 11px;
    padding: 0 6px;
}

/* Tables / data grids */
html.o-compact .mud-table-toolbar {
    --mud-internal-toolbar-height: 40px;
}

html.o-compact .mud-table-pagination-toolbar {
    height: 36px;
}

/* Navigation & lists (menus, select/autocomplete popovers) */
html.o-compact .mud-nav-link {
    padding: 4px 12px;
}

html.o-compact .mud-list-item {
    padding-top: 4px;
    padding-bottom: 4px;
}

html.o-compact .mud-list-item-dense {
    padding-top: 2px;
    padding-bottom: 2px;
}

/* Dialogs */
html.o-compact .mud-dialog-title {
    padding: 8px 16px;
}

html.o-compact .mud-dialog-content {
    padding: 4px 16px;
}

html.o-compact .mud-dialog-actions {
    padding: 4px 8px;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.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."
    }

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto 0 auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #c02d76;
}