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

/* Modern startup loader */
#app {
    min-height: 100vh;
}

.startup-loader {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: radial-gradient(circle at top, #f4faf6 0%, #eef3ef 35%, #e8ecea 100%);
}

.startup-brand {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #1d7f36;
    margin-bottom: 0.25rem;
}

.startup-ring {
    position: relative;
    width: 78px;
    height: 78px;
}

    .startup-ring span {
        position: absolute;
        inset: 0;
        border-radius: 50%;
        border: 3px solid transparent;
        border-top-color: #1d7f36;
        animation: startup-spin 1.1s linear infinite;
    }

        .startup-ring span:nth-child(2) {
            inset: 8px;
            border-top-color: #2f9d4a;
            animation-duration: 1.5s;
            animation-direction: reverse;
        }

        .startup-ring span:nth-child(3) {
            inset: 16px;
            border-top-color: #5cba74;
            animation-duration: 1.9s;
        }

.startup-caption {
    color: #51615a;
    font-size: 0.95rem;
    animation: startup-fade 1.8s ease-in-out infinite;
}

.startup-progress-text {
    font-weight: 700;
    color: #1d7f36;
    min-height: 1.25rem;
}

    .startup-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading...");
    }

/* Top app bar notification badge alignment */
.notification-menu-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
}

.notification-counter {
    position: absolute;
    top: 0;
    right: 0;
    transform: translate(38%, -32%);
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    justify-content: center;
    pointer-events: none;
    z-index: 2;
    padding: 0 4px;
    font-size: 0.70rem;
    line-height: 18px;
}

@keyframes startup-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes startup-fade {
    0%, 100% {
        opacity: 0.55;
    }

    50% {
        opacity: 1;
    }
}

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

/* UI polish utilities */
:root {
    --ux-ease: cubic-bezier(.22,.61,.36,1);
}

.ux-page-enter {
    animation: ux-fade-up .35s var(--ux-ease);
}

.ux-page-header {
    margin-bottom: 1rem;
}

.ux-title-gradient {
    background: linear-gradient(90deg, #1f8f3f, #277f8e);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.ux-card {
    border-radius: 12px !important;
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: transform .22s var(--ux-ease), box-shadow .22s var(--ux-ease);
}

.ux-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.10) !important;
}

.ux-soft-table {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.ux-soft-table .mud-table-row {
    transition: background-color .16s ease;
}

.ux-soft-table .mud-table-row:hover {
    background-color: rgba(46, 125, 50, 0.04);
}

.ux-action-btn {
    transition: transform .14s ease, filter .14s ease;
}

.ux-action-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.04);
}

.ux-pill {
    border-radius: 999px !important;
}

.mud-navmenu .mud-nav-link {
    border-radius: 10px;
}

.appbar-logo-avatar {
    background: linear-gradient(145deg, var(--mud-palette-surface), var(--mud-palette-background-grey));
    border: 1px solid var(--mud-palette-lines-default);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.appbar-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 2px;
    border-radius: 6px;
}

/* Shared page composition tokens */
.ux-hero,
.ux-panel,
.ux-summary-card {
    border-radius: 12px;
    border: 1px solid var(--mud-palette-lines-default);
}

.ux-hero {
    border-radius: 14px;
}

.ux-summary-card {
    min-height: 205px;
}

.ux-panel {
    overflow: hidden;
}

.ux-hero-row {
    gap: 12px;
}

.ux-kpi-row {
    flex-wrap: wrap;
}

.ux-actions-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, minmax(130px, 1fr));
    gap: 8px;
    width: 100%;
}

.ux-actions-grid-4 > .mud-button-root {
    width: 100%;
}

.ux-integration-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(170px, 1fr));
    gap: 8px;
    margin-top: 6px;
}

.ux-integration-actions .mud-button-root {
    width: 100%;
    white-space: normal;
    line-height: 1.25;
    min-height: 42px;
}

.ux-metric-chip {
    width: 100%;
    justify-content: flex-start;
    font-weight: 600;
}

.ux-section-title {
    letter-spacing: 0.2px;
    font-weight: 700;
}

.ux-metric-value {
    font-weight: 700;
}

.ux-hero-subtitle {
    max-width: 760px;
}

.ux-totals-card {
    background: linear-gradient(180deg, var(--mud-palette-background-grey), var(--mud-palette-surface));
}

.ux-footer-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background-color: var(--mud-palette-surface);
}

@media (max-width: 960px) {
    .ux-actions-grid-4,
    .ux-integration-actions {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 900px) {
    .ux-hero-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .ux-footer-actions {
        flex-direction: column;
    }

    .ux-footer-actions .mud-button-root {
        width: 100%;
    }
}

@media (max-width: 600px) {
    .ux-actions-grid-4,
    .ux-integration-actions {
        grid-template-columns: 1fr;
    }
}

/* Role Matrix premium actions */
.role-matrix-sticky-actions {
    position: sticky;
    bottom: 8px;
    z-index: 2;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 12px;
    background: color-mix(in srgb, var(--mud-palette-surface) 92%, white 8%);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.role-matrix-actions-wrap {
    gap: 10px;
}

.role-matrix-actions-buttons {
    flex-wrap: wrap;
}

@keyframes ux-fade-up {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

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