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;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* html5-qrcode draws its dimming overlay around the scan box with fixed, full-viewport
   positioning — left unchecked it sits on top of everything else on the page (including
   the Scan.razor buttons) and silently swallows every click, even far from the camera. */
#qr-shaded-region {
    pointer-events: none;
}

/* A stray unwrapped element (long text, a fixed-width control) shouldn't be able to make the
   whole page scroll sideways — each table/dialog handles its own horizontal overflow instead. */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}

/* Two adjacent Size.Small MudIconButtons (row actions in every admin table) sit right against
   each other by default — a few px of touch/mis-tap margin between them, and a slightly larger
   hit area than the raw ~34px icon box, makes them easier to tap accurately on a phone. */
.mud-table .mud-icon-button, .mud-tree-item-content .mud-icon-button {
    min-width: 40px;
    min-height: 40px;
}

.mud-table .mud-icon-button + .mud-icon-button, .mud-tree-item-content .mud-icon-button + .mud-icon-button {
    margin-left: 4px;
}

/* The FAB is fixed to the viewport corner, so on a notched/gesture-bar phone (iOS home
   indicator, Android 3-button nav) it can sit under system UI without this — env() falls back
   to 0 on devices without a safe area, so it's a no-op everywhere else. */
.mud-fab {
    margin-left: env(safe-area-inset-left, 0px);
    margin-bottom: env(safe-area-inset-bottom, 0px);
}

/* Every MudDialog becomes edge-to-edge full-screen below phone width instead of a cramped
   fixed-width card with its own internal scrollbar — there's no per-dialog opt-in for this in
   the installed MudBlazor version, so it's applied globally here. */
@media (max-width: 600px) {
    .mud-dialog-container .mud-dialog {
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        margin: 0 !important;
        border-radius: 0 !important;
        padding-top: env(safe-area-inset-top, 0px);
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }
}

/* A product variant has ~20 fields — a table forces horizontal scrolling at any screen size
   since that many columns never fit. auto-fill + minmax instead wraps fields onto as many rows
   as the viewport needs, so the card only ever grows downward: never sideways, on phone or
   desktop alike. */
.variant-field-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px 20px;
}

.variant-field-full {
    grid-column: 1 / -1;
}

.variant-field-label {
    font-size: 0.75rem;
    color: var(--mud-palette-text-secondary);
    margin-bottom: 2px;
}

.variant-field-value {
    overflow-wrap: break-word;
}

/* Print only the barcode label (opened via the "Print" button in BarcodeViewDialog) —
   hides the rest of the app so a Bluetooth/thermal label printer gets just the label. */
@media print {
    body * {
        visibility: hidden;
    }

    /* body's own background (the app's dark theme) isn't covered by "body *" above — left
       alone it bleeds through as a full-page dark background behind the label on print. */
    body {
        background: white !important;
    }

    .printable-label, .printable-label * {
        visibility: visible;
    }

    /* MudDialog's paper (.mud-dialog) sets overflow:auto + a max-height sized to fit the
       screen, and carries a `transform` (even though it's just the identity matrix) which
       makes it the containing block for any descendant position:fixed/absolute element. The
       label — now taller than the dialog's max-height because of the added QR code — was
       getting clipped to the dialog's own bounds instead of the full print page. */
    .mud-dialog-content, .mud-dialog {
        overflow: visible !important;
        max-height: none !important;
        transform: none !important;
    }

    .printable-label {
        position: absolute;
        top: 0;
        left: 0;
        border: none !important;
    }
}