.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#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: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem 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;
}

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

#device-map {
    height: calc(100vh - 220px);
}

.atlas-marker, .atlas-map-marker {
    pointer-events: auto;
    cursor: pointer;
}

.hover-elevate:hover {
    box-shadow: var(--mud-elevation-6);
    transition: box-shadow .2s;
}

.alerts-scroll {
    flex: 1; /* take remaining space */
    min-height: 0; /* critical so flex children can shrink and allow scrolling */
    overflow-y: auto; /* vertical scroll when needed */
}

.metric-card {
    border-radius: 12px;
    transition: all 0.25s ease;
}

.metric-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 14px rgba(0,0,0,0.15);
}

.metric-card:nth-child(odd) {
    background-color: var(--mud-palette-surface);
}

.metric-card:nth-child(even) {
    background-color: var(--mud-palette-background);
}

.metric-card .mud-typography.h5 {
    color: var(--mud-palette-text-primary);
}

.alerts-list-wrapper {
    overflow-y: auto;
    /* Set a cap. Either fixed px or relative (e.g. to parent height) */
    max-height: 455px; /* tweak as needed */
}

/* If the parent chain is using flex, ensure the wrapper can shrink: */
.d-flex.flex-column .alerts-list-wrapper {
    flex: 1 1 auto;
    min-height: 0;
}

/* Make all buttons same height */
.action-btn {
    height: 40px;
}

/* Prevent text wrapping inside the label area only */
.action-btn .mud-button-label {
    white-space: nowrap;
}

.kpi-chip {
    white-space: nowrap;
}

/* Make the title flex and ellipsize instead of wrapping */
.appbar-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0; /* critical inside flex rows */
    flex: 1 1 auto; /* lets it take remaining space but shrink when needed */
}

/* Make the whole dialog fit within the viewport */
/*.scan-dialog .mud-dialog {
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}*/

/* Make only the content area scroll if needed */
/*.scan-dialog .mud-dialog-content {
    overflow: auto;
    flex: 1 1 auto;
}
*/
/* Cap video height so controls/actions remain reachable */
/*.video-wrap {
    position: relative;
}*/

/*.scan-video {
    width: 100%;
    border-radius: 12px;*/
    /* key line: shrink video if needed */
    /*max-height: 32vh;*/
    /* prevents weird stretching if camera stream aspect differs */
    /*object-fit: cover;
}*/

/* Keep dialog inside viewport */
.scan-dialog .mud-dialog {
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

/* Only content scrolls if needed */
.scan-dialog .mud-dialog-content {
    flex: 1 1 auto;
    overflow-y: auto;
}

/* Shrink video instead of pushing controls off-screen */
.video-wrap {
    width: 100%;
}

.scan-video {
    width: 100%;
    max-height: 30vh;
    border-radius: 12px;
    object-fit: cover;
}

/* Add to your CSS */
.qr-target-box {
    border: 2px solid #00FF00;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5); /* Dims the rest of the screen */
    position: absolute;
    z-index: 100;
    pointer-events: none;
    border-radius: 4px;
}

    /* Optional: Add a 'scanning line' animation to help the user align */
    .qr-target-box::after {
        content: "";
        position: absolute;
        width: 100%;
        height: 2px;
        background: rgba(0, 255, 0, 0.5);
        top: 0;
        left: 0;
        animation: scan-anim 2s infinite linear;
    }

@keyframes scan-anim {
    0% {
        top: 0%;
    }

    100% {
        top: 100%;
    }
}

.fc { /* Main calendar container */
    font-family: var(--mud-typography-default-family);
}

.fc-toolbar-title {
    color: var(--mud-palette-text-primary);
    font-weight: 500;
}

.fc-button-primary {
    background-color: var(--mud-palette-primary) !important;
    border-color: var(--mud-palette-primary) !important;
}

.notif-badge-bubble {
    top: 5px !important;
    right: 16px !important;
}

/*.notif-badge-bubble {
    top: 5px !important;
    transform: translate(30%, -50%) !important;*/ /* was ~50% */
/*}*/
.truncate {
    display: block; /* important */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cursor-pointer {
    cursor: pointer;
}

    .cursor-pointer:hover {
        text-decoration: underline;
    }
.splash-root {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.splash-card {
    width: min(520px, 92vw);
    padding: 32px;
    border-radius: 18px;
    text-align: center;
}
.fm-splash-root {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--mud-palette-background);
    z-index: 2000;
}

.fm-splash-card {
    width: min(480px, 92vw);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
}

.fm-splash-card {
    animation: fmFadeIn 0.25s ease-out;
}

@keyframes fmFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.custom-blue-radio .mud-checked .mud-icon-root {
    fill: #2196F3 !important;
}

.custom-blue-radio .mud-icon-root {
    fill: #2196F3 !important;
}

.custom-black-radio .mud-checked .mud-icon-root {
    fill: #212121 !important;
}

.custom-black-radio .mud-icon-root {
    fill: #212121 !important;
}

.nav-link-with-badge {
    display: flex;
    align-items: center;
}

    .nav-link-with-badge .nav-link-icon {
        width: 24px;
        margin-right: 16px;
        margin-left: -12px;
        display: inline-flex;
        justify-content: center;
        align-items: center;
    }