:root {
    --primary-color: #2b7fff;
    --rz-primary: #2b7fff !important;
    --text-color: #0F172A;
    --rz-root-font-size: 14px !important;
    --rz-body-font-size: 14px !important;
}

html, body {
    font-family: "Lexend", sans-serif;
    height: 100%;
    margin: 0;
}

#app {
    height: 100%;
    display: flex;
    background-color: #F6F6F8;
}

#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;
}

/* Full-screen centered loader used while Blazor app initializes */
.loader-container {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    background: transparent;
    z-index: 2000;
    pointer-events: none;
}

.loader-logo {
    width: 96px;
    height: 96px;
    object-fit: contain;
}

.loader-title {
    margin: 0;
    font-size: 1.25rem;
    color: var(--primary-color, #0F172A);
    font-weight: 700;
}

.loader-progress {
    width: min(420px, 80%);
    height: 14px;
    background: #e9eef6;
    border-radius: 999px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.04);
}

.loader-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color, #2b7fff), #1b6ec2);
    width: 0%;
    transition: width 0.15s linear;
}

.loader-percentage {
    font-weight: 600;
    color: #475569;
}

.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;
}

.sidebar-navigation-item {
    .title {
        font-size: 16px;
        color: #71717b;
        font-weight: 500;
    }

    a {
        display: flex;
        padding: 10px;
        border-radius: 7.5px;
        background: transparent;
        transition: 0.3s;
        gap: 0.5rem;
        color: #475569;
        text-decoration: none !important;
        align-items: center;
        font-size: 14px;
        justify-content: center;

        .icon {
            font-size: 20px;
        }

        .text {
            flex: 1;
        }
    }

    .parent {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        max-height: 41px;
        transition: 0.3s;
        overflow: hidden;
        cursor: pointer;

        .parent-title {
            display: flex;
            padding: 10px;
            border-radius: 7.5px;
            background: transparent;
            transition: 0.3s;
            gap: 0.5rem;
            color: #475569;
            text-decoration: none !important;
            align-items: center;
            font-size: 14px;
            justify-content: center;

            .icon {
                font-size: 20px;
            }

            .text {
                flex: 1;
            }

            .icon.suffix {
                transition: 0.3s;
                transform: rotate(0deg);
            }
        }

        .children {
            padding-left: 5px;
            margin-left: 15px;
            border-left: 1px solid rgba(19, 91, 236, 0.1);
        }
    }

    .parent-title:hover {
        background: #eeefff;

        .icon, .text {
            color: var(--primary-color);
        }
    }

    .parent.openned {
        max-height: 500px;

        .parent-title {


            .icon.suffix {
                transform: rotate(180deg);
            }
        }
    }

    a:hover:not(.active) {
        background: #eeefff;

        .icon, .text {
            color: var(--primary-color);
        }
    }

    a.active {
        color: #fff;
        background: var(--primary-color);
    }

    .parent:not(.openned):has(a.active) {

        .parent-title:hover {
            background: var(--primary-color);

            .icon, .text {
                color: #fff;
            }
        }

        .parent-title {
            color: #fff;
            background: var(--primary-color);
        }
    }
}

.sidebar {
    width: 280px;
    transition: 0.3s;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    background-color: white;
    border-right: 1px solid rgba(19, 91, 236, 0.1);

    .sidebar-header {
        display: flex;
        padding: 0.5rem;
        height: 60px;
        gap: 0.5rem;
        border-bottom: 1px solid rgba(19, 91, 236, 0.1);
        align-items: center;
        justify-content: center;

        img {
            height: 80%;
            aspect-ratio: 1;
        }

        h1 {
            font-size: 12px;
            text-align: center;
            margin: 0;
        }

        .collapse-icon {
            width: 30px;
            height: 30px;
            border-radius: 5px;
            border: 1px solid #cccccc54;
            color: #777;
            display: flex;
            justify-content: center;
            align-items: center;
            cursor: pointer;

            .icon {
                font-size: 17px;
                transition: 0.3s;
            }
        }
    }

    .sidebar-navigation {
        padding: 10px;
        width: 100%;
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
}

    .sidebar.collapsed {
        width: 80px;

        .sidebar-header {
            h1 {
                display: none;
            }

            .collapse-icon {
                display: none;

                .icon {
                    transform: rotate(180deg);
                }
            }
        }
    }

        .sidebar.collapsed:hover {
            width: 280px;

            .sidebar-header {
                h1 {
                    display: block !important;
                }

                .collapse-icon {
                    display: flex !important;
                    transform: rotate(0deg);
                }
            }
        }



        .sidebar.collapsed .sidebar-navigation .sidebar-navigation-item .title,
        .sidebar.collapsed .sidebar-navigation .sidebar-navigation-item .text,
        .sidebar.collapsed .sidebar-navigation .sidebar-navigation-item .icon.suffix {
            display: none !important;
        }

        .sidebar.collapsed:hover .sidebar-navigation .sidebar-navigation-item .title,
        .sidebar.collapsed:hover .sidebar-navigation .sidebar-navigation-item .text,
        .sidebar.collapsed:hover .sidebar-navigation .sidebar-navigation-item .icon.suffix {
            display: flex !important;
        }

header, main, footer {
    width: 100%;
}

main {
    overflow-x: hidden;
    overflow-y: scroll;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;

    header {
        display: flex;
        padding: 0.5rem 2rem;
        height: 60px;
        gap: 0.5rem;
        border-bottom: 1px solid rgba(19, 91, 236, 0.1);
        align-items: center;
        justify-content: space-between;
        background-color: white;

        .left-content {
            display: flex;
            gap: 10px;

            .toggle-menu {
                background-color: transparent;
                display: flex;
                justify-content: center;
                padding: 0.25rem;
                border: 1px solid #6d6d6d;
                outline: none;
                border-radius: 5px;
                align-items: center;
                display: none;

                .icon {
                    font-size: 15px;
                    color: #6d6d6d;
                }
            }
        }

        .profile {
            display: flex;
            gap: 10px;
            height: 100%;

            .info {
                margin: 0;
                font-size: 14px;
                color: #64748B;

                b {
                    color: var(--text-color);
                    font-weight: 500;
                }
            }

            img {
                height: 100%;
                aspect-ratio: 1;
                border-radius: 1000px;
            }
        }
    }

    footer {
        color: #ddd;
        font-weight: 400;
        font-size: 11px;
        display: flex;
        padding: 0.5rem;
        height: 40px;
        background-color: white;
        align-items: center;
        justify-content: space-between;
    }

    main {
        flex: 1;
        padding: 2rem;
    }
}

.mobile-menu-backdrop {
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    display: flex;
    justify-content: center;
    padding-left: 280px;
    align-items: center;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(10px);
    cursor: pointer;

    .icon {
        font-size: 50px;
        color: white;
    }
}


/* Overlay loading */
.r-overlay-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.r-spinner-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100px;
    height: 100px;
}

.r-spinner {
    border: 8px solid rgba(255, 255, 255, 0.3);
    border-top: 8px solid white;
    border-radius: 50%;
    position: absolute;
    top: 0px;
    left: 0px;
    width: 100px;
    height: 100px;
    animation: r-spin 1s linear infinite;
}

.r-spinner-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
}

@keyframes r-spin {
    to {
        transform: rotate(360deg);
    }
}

.r-message {
    color: white;
    margin-top: 1rem;
    font-size: 1.2rem;
}

/* RECONNECT MODAL */
.components-reconnect-first-attempt-visible,
.components-reconnect-repeated-attempt-visible,
.components-reconnect-failed-visible,
.components-pause-visible,
.components-resume-failed-visible,
.components-rejoining-animation {
    display: none;
}

#components-reconnect-modal.components-reconnect-show .components-reconnect-first-attempt-visible,
#components-reconnect-modal.components-reconnect-show .components-rejoining-animation,
#components-reconnect-modal.components-reconnect-paused .components-pause-visible,
#components-reconnect-modal.components-reconnect-resume-failed .components-resume-failed-visible,
#components-reconnect-modal.components-reconnect-retrying,
#components-reconnect-modal.components-reconnect-retrying .components-reconnect-repeated-attempt-visible,
#components-reconnect-modal.components-reconnect-retrying .components-rejoining-animation,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-failed .components-reconnect-failed-visible {
    display: block;
}


#components-reconnect-modal {
    background-color: white;
    width: 20rem;
    margin: 20vh auto;
    padding: 2rem;
    border: 0;
    border-radius: 0.5rem;
    box-shadow: 0 3px 6px 2px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: display 0.5s allow-discrete, overlay 0.5s allow-discrete;
    animation: components-reconnect-modal-fadeOutOpacity 0.5s both;

    &[open] {
        animation: components-reconnect-modal-slideUp 1.5s cubic-bezier(.05, .89, .25, 1.02) 0.3s, components-reconnect-modal-fadeInOpacity 0.5s ease-in-out 0.3s;
        animation-fill-mode: both;
    }
}

    #components-reconnect-modal::backdrop {
        background-color: rgba(0, 0, 0, 0.4);
        animation: components-reconnect-modal-fadeInOpacity 0.5s ease-in-out;
        opacity: 1;
    }

@keyframes components-reconnect-modal-slideUp {
    0% {
        transform: translateY(30px) scale(0.95);
    }

    100% {
        transform: translateY(0);
    }
}

@keyframes components-reconnect-modal-fadeInOpacity {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

@keyframes components-reconnect-modal-fadeOutOpacity {
    0% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

.components-reconnect-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

#components-reconnect-modal p {
    margin: 0;
    text-align: center;
}

#components-reconnect-modal button {
    border: 0;
    background-color: #6b9ed2;
    color: white;
    padding: 4px 24px;
    border-radius: 4px;
}

    #components-reconnect-modal button:hover {
        background-color: #3b6ea2;
    }

    #components-reconnect-modal button:active {
        background-color: #6b9ed2;
    }

.components-rejoining-animation {
    position: relative;
    width: 80px;
    height: 80px;
}

    .components-rejoining-animation div {
        position: absolute;
        border: 3px solid #0087ff;
        opacity: 1;
        border-radius: 50%;
        animation: components-rejoining-animation 1.5s cubic-bezier(0, 0.2, 0.8, 1) infinite;
    }

        .components-rejoining-animation div:nth-child(2) {
            animation-delay: -0.5s;
        }

@keyframes components-rejoining-animation {
    0% {
        top: 40px;
        left: 40px;
        width: 0;
        height: 0;
        opacity: 0;
    }

    4.9% {
        top: 40px;
        left: 40px;
        width: 0;
        height: 0;
        opacity: 0;
    }

    5% {
        top: 40px;
        left: 40px;
        width: 0;
        height: 0;
        opacity: 1;
    }

    100% {
        top: 0px;
        left: 0px;
        width: 80px;
        height: 80px;
        opacity: 0;
    }
}


/* CUSTOM TABLE */
.custom-table {
    width: 100%;
    background-color: #F1F5F9;
    border: 1px solid rgba(19, 91, 236, 0.05);
    border-radius: 10px;
    overflow: hidden;

    .table-header {
        gap: 1rem;
        width: 100%;
        display: flex;
        align-items: center;
        padding: 1rem;
        border-bottom: 1px solid rgba(19, 91, 236, 0.05);

        .title {
            font-size: 18px;
            font-weight: 500;
        }

        .table-toolbar {
            flex: 1;
            display: flex;
            justify-content: end;
            gap: 0.5rem;
            align-items: center;
        }
    }

    table {
        width: 100%;
        background-color: #F8FAFC;


        th {
            color: #64748B;
            font-weight: 500;
            font-size: 16px;
            padding: 10px;
        }

        td {
            color: var(--text-color);
            padding: 10px;
        }

        tr {
            border-bottom: 1px solid rgba(19, 91, 236, 0.05);
        }
    }

    .table-footer-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 1rem;

        .table-statistic {
            margin: 0;
            font-size: 12px;
            font-weight: 400;
        }

        .table-pagination {
            display: flex;
            gap: 10px;

            .table-paging-btn {
                box-shadow: none;
                background: transparent;
                border: 1px solid var(--primary-color);
                color: var(--primary-color);
                transition: 0.3s;
            }

                .table-paging-btn:enabled:hover, .table-paging-btn.active {
                    box-shadow: none;
                    background-color: var(--primary-color);
                    color: white;
                }
        }
    }
}

.custom-card {
    background-color: white;
    padding: 1rem;
    border-radius: 10px;
    border: 1px solid rgba(19, 91, 236, 0.05);
}

.unauthorize-overlay {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center center;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.login-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    max-width: 400px;
    background-color: rgba(255, 255, 255, 0.5);

    img {
        height: 80px;
    }

    h2 {
        font-size: 20px;
        margin: 0;
    }

    h5 {
        font-size: 16px;
        margin: 0;
    }
}

.table-card-container {
    display: flex;
    flex-direction: column;
    gap: 10px;

    .table-cell-data-card {
        background-color: #F8FAFC;
        display: flex;
        flex-direction: column;
        border-bottom: 1px solid rgba(19, 91, 236, 0.2);
        border-top: 1px solid rgba(19, 91, 236, 0.2);

        .table-cell-data-card-content {
            display: flex;
            gap: 15px;
            padding: 5px 10px;
            justify-content: space-between;

            .header {
                color: #64748B;
                font-weight: 500;
                font-size: 16px;
            }

            div {
                text-align: end;
                margin: 0;
            }
        }

            .table-cell-data-card-content:nth-child(even) {
                background-color: rgba(0, 0, 0, 0.05);
            }
    }
}
.menu-popup {
    display: none;
    position: absolute;
    overflow: hidden;
    border: var(--rz-panel-border);
    background-color: var(--rz-panel-background-color);
    box-shadow: var(--rz-panel-shadow);
    border-radius: var(--rz-border-radius)
}


@media(max-width: 996px) {
    .sidebar {
        width: 0px;
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 20;

        .sidebar-header {
            .collapse-icon {
                display: none;
            }
        }
    }

    body:has(.main-content.menu-mobile) .sidebar {
        width: 280px;
    }

    .main-content {
        header {
            padding: 0.5rem 1rem;

            .left-content {
                .toggle-menu {
                    display: flex;
                    
                }
            }

            .profile {
                .info {
                    display: none;
                }
            }
        }

        main {
            padding: 1rem;
        }
    }

    .table-header, .table-footer-row {
        flex-direction: column;
        gap: 10px;
    }
}

.answer-preview {
    display: flex;
    gap: 10px;
    align-items: center;
    /* box-shadow: #ccc 0px 0px 4px 0px; */
    padding: 10px;
    border-radius: 10px;
    border: 1px solid #e2e2e2;

    b {
        width: 30px;
        height: 30px;
        background-color: #F1F5F9;
        display: flex;
        justify-content: center;
        align-items: center;
        border-radius: 1000px;
    }

    p {
        margin: 0px;
    }
}

/* ========================================================================== */
/* Remastered administration theme overrides                                  */
/* ========================================================================== */

/* AquaVolt Administration UI — remastered theme overrides. */
:root {
    --av-primary: #4f46e5;
    --av-primary-hover: #4338ca;
    --av-primary-soft: #eef2ff;
    --av-on-primary: #fff;
    --av-accent: #06b6d4;
    --av-success: #10b981;
    --av-warning: #f59e0b;
    --av-danger: #ef4444;
    --av-canvas: #f5f7fb;
    --av-surface: #ffffff;
    --av-surface-raised: #ffffff;
    --av-surface-muted: #f8fafc;
    --av-border: #e7eaf1;
    --av-border-strong: #d8deea;
    --av-text: #172033;
    --av-text-muted: #697386;
    --av-sidebar: #fff;
    --av-sidebar-text: #475569;
    --av-sidebar-icon: #64748b;
    --av-sidebar-title: #94a3b8;
    --av-sidebar-heading: #172033;
    --av-sidebar-border: #e7eaf1;
    --av-sidebar-hover: #eef2ff;
    --av-sidebar-hover-text: #3730a3;
    --av-sidebar-control: #64748b;
    --av-sidebar-control-bg: #f8fafc;
    --av-sidebar-glow: rgba(79, 70, 229, .08);
    --av-sidebar-width: 278px;
    --av-header-height: 72px;
    --av-radius-sm: 8px;
    --av-radius: 12px;
    --av-radius-lg: 18px;
    --av-shadow-sm: 0 1px 2px rgba(16, 24, 40, .04), 0 2px 8px rgba(16, 24, 40, .04);
    --av-shadow: 0 8px 24px rgba(16, 24, 40, .08);
    --av-shadow-lg: 0 20px 48px rgba(16, 24, 40, .14);
    --primary-color: var(--av-primary);
    --text-color: var(--av-text);
    --rz-primary: var(--av-primary) !important;
    --rz-primary-light: var(--av-primary-soft) !important;
    --rz-base-background-color: var(--av-surface) !important;
    --rz-text-color: var(--av-text) !important;
    --rz-text-title-color: var(--av-text) !important;
    --rz-text-secondary-color: var(--av-text-muted) !important;
    --rz-border-normal: var(--av-border) !important;
    --rz-border-radius: var(--av-radius-sm) !important;
    --rz-panel-background-color: var(--av-surface) !important;
    --rz-panel-border: 1px solid var(--av-border) !important;
    --rz-panel-shadow: var(--av-shadow) !important;
}

html[data-theme="dark"] {
    --av-primary: #6366f1;
    --av-primary-hover: #4f46e5;
    --av-primary-soft: rgba(99, 102, 241, .16);
    --av-canvas: #0b1020;
    --av-surface: #131a2b;
    --av-surface-raised: #182135;
    --av-surface-muted: #0f1728;
    --av-border: #263249;
    --av-border-strong: #35425b;
    --av-text: #e8edf7;
    --av-text-muted: #9aa8bd;
    --av-sidebar: #080d19;
    --av-sidebar-text: #b8c2d2;
    --av-sidebar-icon: #8290a5;
    --av-sidebar-title: #7f8ba0;
    --av-sidebar-heading: #fff;
    --av-sidebar-border: rgba(255, 255, 255, .08);
    --av-sidebar-hover: rgba(255, 255, 255, .07);
    --av-sidebar-hover-text: #fff;
    --av-sidebar-control: #aab5c7;
    --av-sidebar-control-bg: rgba(255, 255, 255, .06);
    --av-sidebar-glow: rgba(79, 70, 229, .22);
    --av-shadow-sm: 0 1px 2px rgba(0, 0, 0, .2), 0 2px 8px rgba(0, 0, 0, .16);
    --av-shadow: 0 10px 28px rgba(0, 0, 0, .25);
    --av-shadow-lg: 0 22px 56px rgba(0, 0, 0, .38);
    --rz-base-100: var(--av-surface-raised) !important;
    --rz-base-200: var(--av-surface-muted) !important;
    --rz-datepicker-trigger-icon-color: var(--av-text-muted);
    --rz-datepicker-trigger-icon-hover-color: var(--av-primary);
    --rz-datepicker-calendar-color: var(--av-text);
    --rz-datepicker-calendar-hover-color: #fff;
    --rz-datepicker-calendar-hover-background-color: var(--av-primary);
    --rz-datepicker-calendar-selected-color: #fff;
    --rz-datepicker-calendar-selected-background-color: var(--av-primary);
    --rz-datepicker-calendar-selected-hover-color: #fff;
    --rz-datepicker-calendar-selected-hover-background-color: var(--av-primary-hover);
    --rz-datepicker-calendar-today-color: var(--av-text);
    --rz-datepicker-calendar-today-box-shadow: inset 0 0 0 1px var(--av-text-muted);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
    font-family: "Inter", "Segoe UI", sans-serif;
    color: var(--av-text);
    background: var(--av-canvas);
    font-size: 14px;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

body { overflow: hidden; }

::selection { color: #fff; background: var(--av-primary); }

::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--av-border-strong); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--av-text-muted); }

#app { background: var(--av-canvas); }

.sidebar {
    width: var(--av-sidebar-width);
    min-width: var(--av-sidebar-width);
    color: var(--av-sidebar-text);
    background:
        radial-gradient(circle at 20% 0, var(--av-sidebar-glow), transparent 28%),
        var(--av-sidebar);
    border-right: 1px solid var(--av-sidebar-border);
    box-shadow: 8px 0 28px rgba(15, 23, 42, .08);
    z-index: 30;
}

.sidebar .sidebar-header {
    height: var(--av-header-height);
    padding: 12px 18px;
    justify-content: flex-start;
    border-bottom: 1px solid var(--av-sidebar-border);
}

.sidebar .sidebar-header img {
    width: 42px;
    height: 42px;
    padding: 5px;
    object-fit: contain;
    background: rgba(255, 255, 255, .94);
    border-radius: 12px;
    box-shadow: 0 5px 18px rgba(0, 0, 0, .16);
}

.sidebar .sidebar-header h1 {
    color: var(--av-sidebar-heading);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -.02em;
    text-align: left;
}

.sidebar .sidebar-header .collapse-icon {
    width: 32px;
    height: 32px;
    margin-left: auto;
    color: var(--av-sidebar-control);
    border-color: var(--av-sidebar-border);
    background: var(--av-sidebar-control-bg);
    border-radius: 9px;
}

.sidebar .sidebar-header .collapse-icon:hover {
    color: var(--av-sidebar-hover-text);
    background: var(--av-sidebar-hover);
}

.sidebar .sidebar-navigation {
    gap: 5px;
    padding: 20px 14px 24px;
    overflow-x: hidden;
    overflow-y: auto;
}

.sidebar-navigation-item .title {
    display: block;
    padding: 16px 11px 7px;
    color: var(--av-sidebar-title);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.sidebar-navigation-item a,
.sidebar-navigation-item .parent .parent-title {
    min-height: 43px;
    padding: 10px 11px;
    gap: 11px;
    color: var(--av-sidebar-text);
    font-size: 13.5px;
    font-weight: 500;
    border-radius: 10px;
    transition: color .18s ease, background-color .18s ease, transform .18s ease;
}

.sidebar-navigation-item a .icon,
.sidebar-navigation-item .parent .parent-title .icon {
    color: var(--av-sidebar-icon);
    font-size: 20px;
}

.sidebar-navigation-item a:hover:not(.active),
.sidebar-navigation-item .parent-title:hover,
.sidebar-navigation-item .parent-title:focus-visible {
    color: var(--av-sidebar-hover-text);
    background: var(--av-sidebar-hover);
    outline: none;
}

.sidebar-navigation-item a:hover:not(.active) .icon,
.sidebar-navigation-item a:hover:not(.active) .text,
.sidebar-navigation-item .parent-title:hover .icon,
.sidebar-navigation-item .parent-title:hover .text { color: var(--av-sidebar-hover-text); }

.sidebar-navigation-item a.active,
.sidebar-navigation-item .parent:not(.openned):has(a.active) > .parent-title {
    color: #fff;
    background: linear-gradient(135deg, #635bff, #4f46e5);
    box-shadow: 0 7px 18px rgba(79, 70, 229, .28);
}

.sidebar-navigation-item a.active .icon,
.sidebar-navigation-item .parent:not(.openned):has(a.active) > .parent-title .icon {
    color: #fff !important;
}

.sidebar-navigation-item .parent { max-height: 43px; gap: 4px; }
.sidebar-navigation-item .parent.openned { max-height: 520px; }

.sidebar-navigation-item .parent .children {
    margin: 3px 0 3px 20px;
    padding: 4px 0 4px 10px;
    border-left-color: var(--av-sidebar-border);
}

.sidebar-navigation-item .children a {
    min-height: 38px;
    padding-block: 8px;
    font-size: 13px;
}

.sidebar-navigation-item .children a .icon { font-size: 13px; }

.sidebar.collapsed { width: 76px; min-width: 76px; }
.sidebar.collapsed:hover { width: var(--av-sidebar-width); min-width: var(--av-sidebar-width); }

.main-content { min-width: 0; background: var(--av-canvas); }

.main-content > header {
    position: relative;
    z-index: 15;
    height: var(--av-header-height);
    padding: 0 30px;
    background: color-mix(in srgb, var(--av-surface) 93%, transparent);
    border-bottom: 1px solid var(--av-border);
    box-shadow: 0 1px 0 rgba(16, 24, 40, .015);
    backdrop-filter: blur(14px);
}

.main-content > header .left-content { align-items: center; }

.main-content > header .left-content .mobile-brand-logo { display: none; }

.main-content > header .profile {
    height: 42px;
    align-items: center;
    padding: 4px 6px 4px 12px;
    background: var(--av-surface-muted);
    border: 1px solid var(--av-border);
    border-radius: 12px;
}

.main-content > header .profile .info {
    color: var(--av-text-muted);
    font-size: 12px;
    line-height: 1.35;
}

.main-content > header .profile .info b { color: var(--av-text); font-weight: 600; }

.main-content > header .profile img {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border: 2px solid var(--av-surface);
    box-shadow: 0 0 0 1px var(--av-border);
}

.av-theme-toggle {
    width: 40px;
    height: 40px;
    margin-left: auto;
    padding: 9px;
    color: var(--av-text-muted);
    background: var(--av-surface);
    border: 1px solid var(--av-border);
    border-radius: 11px;
    box-shadow: var(--av-shadow-sm);
    transition: .18s ease;
}

.av-theme-toggle:hover {
    color: var(--av-primary);
    border-color: color-mix(in srgb, var(--av-primary) 35%, var(--av-border));
}

.av-theme-toggle:focus-visible { outline: 3px solid color-mix(in srgb, var(--av-primary) 25%, transparent); }
.av-theme-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.main-content main {
    padding: 28px 30px 34px;
    background:
        radial-gradient(circle at 100% 0, rgba(79, 70, 229, .045), transparent 28%),
        var(--av-canvas);
}

.main-content footer {
    height: 38px;
    padding: 0 30px;
    color: var(--av-text-muted);
    background: var(--av-surface);
    border-top: 1px solid var(--av-border);
}

.custom-card,
.custom-table {
    color: var(--av-text);
    background: var(--av-surface);
    border: 1px solid var(--av-border);
    border-radius: var(--av-radius-lg);
    box-shadow: var(--av-shadow-sm);
}

.custom-card { padding: 22px; }

.custom-table {
    position: relative;
    overflow-x: auto;
    overflow-y: hidden;
}

.custom-table.is-scrollable::after {
    content: "";
    position: sticky;
    right: 0;
    float: right;
    width: 20px;
    height: 1px;
    box-shadow: -12px 0 18px rgba(15, 23, 42, .13);
}

.custom-table .table-header {
    position: sticky;
    left: 0;
    z-index: 2;
    width: 100%;
    min-width: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding: 20px 22px;
    background: var(--av-surface);
    border-bottom: 1px solid var(--av-border);
}

.custom-table .table-header .title {
    color: var(--av-text);
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -.025em;
}

.custom-table .table-toolbar {
    width: 100%;
    min-width: 0;
    display: block;
}

.custom-table .table-toolbar > .rz-row {
    width: 100%;
}

.custom-table .table-toolbar .rz-column {
    min-width: 0;
}

.custom-table table {
    min-width: 760px;
    color: var(--av-text);
    background: var(--av-surface);
    border-collapse: separate;
    border-spacing: 0;
}

.custom-table table thead { background: var(--av-surface-muted); }

.custom-table table th {
    padding: 12px 14px;
    color: var(--av-text-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .055em;
    text-transform: uppercase;
    white-space: nowrap;
    border-bottom: 1px solid var(--av-border);
}

.custom-table table td {
    padding: 14px;
    color: var(--av-text);
    font-size: 13px;
    line-height: 1.55;
    vertical-align: middle;
    border-bottom: 1px solid var(--av-border);
}

.custom-table table tbody tr { border: 0; transition: background-color .16s ease; }
.custom-table table tbody tr:hover { background: color-mix(in srgb, var(--av-primary) 3.5%, var(--av-surface)); }
.custom-table table tbody tr:last-child td { border-bottom: 0; }
.custom-table table td b { font-weight: 600; }

.custom-table .table-footer-row {
    min-width: max-content;
    padding: 15px 22px;
    background: var(--av-surface-muted);
    border-top: 1px solid var(--av-border);
}

.custom-table .table-footer-row .table-statistic { color: var(--av-text-muted); font-size: 12px; }

.custom-table .table-footer-row .table-pagination .table-paging-btn {
    min-width: 34px;
    height: 34px;
    color: var(--av-text-muted);
    background: var(--av-surface);
    border: 1px solid var(--av-border);
    border-radius: 9px;
}

.custom-table .table-footer-row .table-pagination .table-paging-btn:enabled:hover,
.custom-table .table-footer-row .table-pagination .table-paging-btn.active {
    color: #fff;
    background: var(--av-primary);
    border-color: var(--av-primary);
    box-shadow: 0 5px 12px color-mix(in srgb, var(--av-primary) 25%, transparent);
}

/* Radzen controls */
.rz-form-field { color: var(--av-text); }
.rz-form-field-label { color: var(--av-text-muted) !important; font-size: 12px !important; font-weight: 600 !important; }

.rz-form-field.rz-variant-outlined > .rz-form-field-content {
    min-height: 42px;
    background: var(--av-surface) !important;
    border: 1px solid var(--av-border-strong) !important;
    border-radius: 10px !important;
    box-shadow: none !important;
    transition: border-color .16s ease, box-shadow .16s ease !important;
}

.rz-form-field.rz-variant-outlined:not(.rz-state-disabled):hover > .rz-form-field-content {
    border-color: color-mix(in srgb, var(--av-primary) 45%, var(--av-border)) !important;
}

.rz-form-field.rz-variant-outlined.rz-state-focused .rz-form-field-content {
    border-color: var(--av-primary) !important;
    box-shadow: none !important;
}

.rz-form-field.rz-variant-outlined .rz-form-field-label {
    background: var(--av-surface) !important;
}

.rz-textbox,
.rz-password,
.rz-dropdown,
.rz-numeric,
.rz-textarea,
.rz-datepicker,
.rz-multiselect {
    min-height: 42px;
    color: var(--av-text) !important;
    background: var(--av-surface) !important;
    border-color: var(--av-border-strong) !important;
    border-radius: 10px !important;
    box-shadow: none !important;
    transition: border-color .16s ease, box-shadow .16s ease !important;
}

.rz-textbox:hover,
.rz-password:hover,
.rz-dropdown:hover,
.rz-numeric:hover,
.rz-textarea:hover,
.rz-datepicker:hover { border-color: color-mix(in srgb, var(--av-primary) 45%, var(--av-border)) !important; }

.rz-textbox:focus,
.rz-password:focus,
.rz-dropdown:focus-within,
.rz-numeric:focus-within,
.rz-textarea:focus {
    border-color: var(--av-primary) !important;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--av-primary) 14%, transparent) !important;
    outline: none !important;
}

.rz-form-field-content .rz-textbox,
.rz-form-field-content .rz-password,
.rz-form-field-content .rz-dropdown,
.rz-form-field-content .rz-numeric,
.rz-form-field-content .rz-textarea,
.rz-form-field-content .rz-datepicker,
.rz-form-field-content .rz-multiselect {
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    outline: none !important;
}

.rz-form-field-content .rz-textbox:hover,
.rz-form-field-content .rz-textbox:focus,
.rz-form-field-content .rz-password:hover,
.rz-form-field-content .rz-password:focus,
.rz-form-field-content .rz-dropdown:hover,
.rz-form-field-content .rz-dropdown:focus-within,
.rz-form-field-content .rz-numeric:hover,
.rz-form-field-content .rz-numeric:focus-within,
.rz-form-field-content .rz-textarea:hover,
.rz-form-field-content .rz-textarea:focus,
.rz-form-field-content .rz-datepicker:hover,
.rz-form-field-content .rz-datepicker:focus-within,
.rz-form-field-content .rz-multiselect:hover,
.rz-form-field-content .rz-multiselect:focus-within {
    border: 0 !important;
    box-shadow: none !important;
    outline: none !important;
}

.rz-numeric {
    --rz-numeric-input-padding-inline: .9375rem;
}

.rz-numeric .rz-numeric-button {
    display: none !important;
}

.rz-dropdown-panel,
.rz-popup,
.menu-popup {
    color: var(--av-text);
    background: var(--av-surface-raised) !important;
    border: 1px solid var(--av-border) !important;
    border-radius: 12px !important;
    box-shadow: var(--av-shadow-lg) !important;
}

.rz-dropdown-item { color: var(--av-text) !important; border-radius: 7px; }
.rz-dropdown-item:hover { background: var(--av-primary-soft) !important; }

.rz-button {
    min-height: 38px;
    padding-inline: 15px !important;
    font-weight: 600 !important;
    border-radius: 10px !important;
    box-shadow: none !important;
    transition: box-shadow .16s ease, background-color .16s ease !important;
}

.rz-datepicker-trigger,
.rz-timespanpicker-trigger {
    width: 40px !important;
    height: 40px !important;
    min-height: 0 !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 40px !important;
    border-radius: 0 !important;
    overflow: visible !important;
    transform: none !important;
}

.rz-datepicker-trigger .rzi,
.rz-timespanpicker-trigger .rzi {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    font-size: 20px !important;
    line-height: 1 !important;
}

.rz-datepicker-trigger:hover,
.rz-datepicker-trigger:focus,
.rz-datepicker-trigger:active,
.rz-timespanpicker-trigger:hover,
.rz-timespanpicker-trigger:focus,
.rz-timespanpicker-trigger:active {
    transform: none !important;
}

.rz-button.rz-primary { color: var(--av-on-primary) !important; background: var(--av-primary) !important; border-color: var(--av-primary) !important; }
.rz-button.rz-primary .rz-button-text,
.rz-button.rz-primary .rzi { color: var(--av-on-primary) !important; }
.rz-button.rz-primary:hover:not(:disabled) { background: var(--av-primary-hover) !important; box-shadow: 0 7px 16px color-mix(in srgb, var(--av-primary) 24%, transparent) !important; }
.rz-button.rz-danger { background: var(--av-danger) !important; }

.rz-dialog-wrapper { backdrop-filter: blur(4px); background: rgba(15, 23, 42, .36) !important; }

.rz-dialog {
    color: var(--av-text);
    background: var(--av-surface-raised) !important;
    border: 1px solid var(--av-border);
    border-radius: 18px !important;
    box-shadow: var(--av-shadow-lg) !important;
    overflow: hidden;
}

.rz-dialog-titlebar {
    padding: 20px 22px !important;
    color: var(--av-text) !important;
    background: var(--av-surface-raised) !important;
    border-bottom: 1px solid var(--av-border);
}

.rz-dialog-title,
.rz-dialog-side-title {
    color: var(--av-text) !important;
    font-size: 17px !important;
    font-weight: 700 !important;
    letter-spacing: -.02em;
}
.rz-dialog-content { padding: 22px !important; background: var(--av-surface-raised); }
.rz-dialog-titlebar-close { color: var(--av-text-muted) !important; border-radius: 9px; }

.rz-tabview-nav { gap: 4px; border-bottom: 1px solid var(--av-border) !important; }
.rz-tabview-nav li a { color: var(--av-text-muted) !important; font-weight: 600; }
.rz-tabview-nav li.rz-tabview-selected a { color: var(--av-primary) !important; }

.rz-chkbox-box {
    background: var(--av-surface) !important;
    border: 2px solid var(--av-border-strong) !important;
    border-radius: 6px !important;
}

.rz-chkbox-box.rz-state-active {
    background: var(--av-primary) !important;
    border-color: var(--av-primary) !important;
}

html[data-theme="dark"] .rz-chkbox-box:not(.rz-state-active) {
    border-color: var(--av-text) !important;
}

.rz-notification-item { border-radius: 12px !important; box-shadow: var(--av-shadow-lg) !important; }

/* TooltipPopup is also rendered as .rz-popup; keep it free of panel styling. */
.rz-tooltip.rz-popup {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

.rz-tooltip-content {
    background: var(--rz-tooltip-background-color) !important;
    box-shadow: var(--rz-tooltip-shadow) !important;
}

/* Login */
.unauthorize-overlay {
    position: relative;
    isolation: isolate;
    background-color: #0f172a;
}

.unauthorize-overlay::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(120deg, rgba(8, 15, 36, .94), rgba(30, 41, 85, .72)),
        radial-gradient(circle at 80% 20%, rgba(6, 182, 212, .3), transparent 34%);
}

.login-card {
    gap: 12px;
    max-width: 440px;
    padding: 0;
    background: transparent;
}

.login-card > .custom-card,
.login-card.rz-card,
.login-card .rz-card {
    width: 100%;
    padding: 34px;
    background: color-mix(in srgb, var(--av-surface) 94%, transparent);
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 22px;
    box-shadow: 0 30px 70px rgba(2, 6, 23, .32);
    backdrop-filter: blur(16px);
}

.login-card img { height: 72px; margin-bottom: 4px; filter: drop-shadow(0 8px 16px rgba(15, 23, 42, .15)); }
.login-card h2 { color: var(--av-text); font-size: 23px; font-weight: 700; letter-spacing: -.03em; }
.login-card h5 { margin-bottom: 8px; color: var(--av-text-muted); font-size: 14px; font-weight: 500; }
.login-card .rz-button { min-height: 44px; margin-top: 6px; }

.loader-container { background: var(--av-canvas); }
.loader-logo { width: 82px; height: 82px; filter: drop-shadow(0 10px 24px rgba(79, 70, 229, .2)); }
.loader-title { color: var(--av-text); font-size: 18px; letter-spacing: -.02em; }
.loader-progress { width: min(340px, 76%); height: 8px; background: var(--av-border); box-shadow: none; }
.loader-progress-fill { background: linear-gradient(90deg, var(--av-primary), var(--av-accent)); }
.loader-percentage { color: var(--av-text-muted); font-size: 12px; }

.table-card-container .table-cell-data-card {
    color: var(--av-text);
    background: var(--av-surface);
    border-color: var(--av-border);
    border-radius: 10px;
    overflow: hidden;
}

.table-card-container .table-cell-data-card .table-cell-data-card-content:nth-child(even) { background: var(--av-surface-muted); }
.table-card-container .table-cell-data-card .table-cell-data-card-content .header { color: var(--av-text-muted); }

@media (max-width: 996px) {
    :root { --av-header-height: 64px; }

    .sidebar,
    .sidebar.collapsed,
    .sidebar.collapsed:hover {
        width: min(280px, 86vw);
        min-width: min(280px, 86vw);
        transform: translateX(-100%);
        visibility: hidden;
        pointer-events: none;
        box-shadow: none;
    }

    body:has(.main-content.menu-mobile) .sidebar,
    body:has(.main-content.menu-mobile) .sidebar.collapsed,
    body:has(.main-content.menu-mobile) .sidebar.collapsed:hover {
        transform: translateX(0);
        visibility: visible;
        pointer-events: auto;
        box-shadow: 18px 0 50px rgba(2, 6, 23, .3);
    }

    body:has(.main-content.menu-mobile) .sidebar.collapsed .sidebar-header h1 {
        display: block !important;
    }

    body:has(.main-content.menu-mobile) .sidebar.collapsed .sidebar-navigation .sidebar-navigation-item .title,
    body:has(.main-content.menu-mobile) .sidebar.collapsed .sidebar-navigation .sidebar-navigation-item .text,
    body:has(.main-content.menu-mobile) .sidebar.collapsed .sidebar-navigation .sidebar-navigation-item .icon.suffix {
        display: flex !important;
    }

    .mobile-menu-backdrop {
        left: min(280px, 86vw);
        width: calc(100% - min(280px, 86vw));
        padding-left: 0;
        z-index: 25;
        background: rgba(8, 15, 31, .54);
        backdrop-filter: blur(3px);
    }

    .main-content > header { padding: 0 16px; }
    .main-content > header .left-content .toggle-menu {
        width: 38px;
        height: 38px;
        color: var(--av-text-muted);
        background: var(--av-surface);
        border-color: var(--av-border);
        border-radius: 10px;
    }

    .main-content > header .left-content .mobile-brand-logo {
        display: block;
        width: 38px;
        height: 38px;
        padding: 4px;
        object-fit: contain;
        background: rgba(255, 255, 255, .94);
        border-radius: 10px;
        box-shadow: var(--av-shadow-sm);
    }

    .main-content > header .profile { padding: 4px; background: transparent; border: 0; }
    .av-theme-toggle { margin-left: auto; }
    .main-content main { padding: 18px 14px 26px; }
    .main-content footer { padding-inline: 16px; }

    .custom-table .table-header { align-items: stretch; padding: 17px 16px; }
    .custom-table .table-header .table-toolbar { width: 100%; justify-content: stretch; }
    .custom-table .table-footer-row { align-items: stretch; padding: 14px 16px; }
    .custom-table .table-footer-row .table-pagination { flex-wrap: wrap; justify-content: center; }
    .custom-card { padding: 16px; }
    .rz-dialog { width: calc(100vw - 24px) !important; max-height: calc(100vh - 24px) !important; }
    .rz-dialog-content { padding: 17px !important; }
}

@media (max-width: 560px) {
    .main-content > header .profile { height: 36px; }
    .main-content > header .profile img { width: 30px; height: 30px; }
    .av-theme-toggle { width: 36px; height: 36px; padding: 8px; }
    .custom-table { border-radius: 14px; }
    .custom-table table { min-width: 680px; }
    .login-card > .custom-card,
    .login-card.rz-card,
    .login-card .rz-card { padding: 26px 20px; border-radius: 18px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

.rz-datepicker-field-button {
    inset-block-start: 0!important;
    inset-inline-end: -.2rem!important;
}

/* LiveView page */
.live-view-page {
    display: grid;
    gap: 1rem;
    min-height: calc(100vh - 8rem);
    color: #dcecf7;
    padding: 1rem;
    border-radius: 1rem;
    background: linear-gradient(180deg, #dff5ff 0%, #87ceeb 100%);
}

.live-view-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.25rem 0.25rem 0;
}

.live-view-eyebrow {
    margin: 0 0 0.25rem;
    color: #39d6b5;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.16em;
}

.live-view-header h1 {
    margin: 0;
    color: var(--rz-text-title-color, #10283b);
    font-size: clamp(1.4rem, 2.4vw, 2rem);
    font-weight: 700;
}

.live-view-summary {
    margin: 0.35rem 0 0;
    color: var(--rz-text-secondary-color, #60778a);
}

.live-view-status {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    flex: 0 0 auto;
    padding: 0.55rem 0.8rem;
    border: 1px solid rgba(22, 140, 120, 0.25);
    border-radius: 999px;
    background: rgba(22, 140, 120, 0.08);
    color: #177a69;
    font-size: 0.8rem;
    font-weight: 600;
}

.live-view-status-dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: #20c997;
    box-shadow: 0 0 0 0.25rem rgba(32, 201, 151, 0.14);
}

.live-view-stage {
    position: relative;
    min-height: 34rem;
    border: 1px solid rgba(71, 116, 145, 0.25);
    border-radius: 1rem;
    padding: 0.35rem;
    background: #87ceeb;
    box-shadow: 0 1rem 2.5rem rgba(8, 28, 43, 0.12);
}

.live-view-hint {
    position: absolute;
    right: 1rem;
    bottom: 1rem;
    z-index: 2;
    padding: 0.45rem 0.7rem;
    border: 1px solid rgba(151, 188, 211, 0.18);
    border-radius: 0.5rem;
    background: rgba(3, 14, 23, 0.72);
    color: #a9c3d4;
    font-size: 0.72rem;
    backdrop-filter: blur(0.5rem);
    pointer-events: none;
}

@media (max-width: 768px) {
    .live-view-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .live-view-stage {
        min-height: 26rem;
    }

    .live-view-hint {
        display: none;
    }
}

.live-view-map {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 34rem;
    overflow: hidden;
    border-radius: 0.9rem;
    background: #87ceeb;
}

.live-view-drag-hold-indicator {
    position: fixed;
    z-index: 2147483647;
    width: 2.5rem;
    height: 2.5rem;
    margin: -1.25rem 0 0 -1.25rem;
    border: 0.18rem solid rgba(34, 197, 94, 0.96);
    border-radius: 50%;
    background: rgba(34, 197, 94, 0.18);
    box-shadow: 0 0 0 0.35rem rgba(34, 197, 94, 0.16), 0 0 1rem rgba(34, 197, 94, 0.8);
    pointer-events: none;
    transform: scale(0.7);
    animation: live-view-drag-hold-pulse 0.85s ease-in-out infinite;
}

.live-view-drag-hold-indicator::after {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0.46rem;
    height: 0.46rem;
    border-radius: 50%;
    background: #ecfccb;
    box-shadow: 0 0 0.5rem #ecfccb;
    content: "";
    transform: translate(-50%, -50%);
}

.live-view-drag-placeholder {
    position: absolute;
    z-index: 2147483646;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.live-view-drag-placeholder__front {
    fill: #a3e635;
    fill-opacity: .45;
    stroke: #365314;
    stroke-width: 3;
    stroke-dasharray: 6 3;
    vector-effect: non-scaling-stroke;
}

.live-view-drag-placeholder__roof {
    fill: #a3e635;
    fill-opacity: 0.32;
    stroke: #4d7c0f;
    stroke-width: 2.2;
    vector-effect: non-scaling-stroke;
}

.live-view-drag-placeholder__base {
    fill: #a3e635;
    fill-opacity: 0.10;
    stroke: #65a30d;
    stroke-opacity: 0.72;
    stroke-width: 1.5;
    vector-effect: non-scaling-stroke;
}

.live-view-drag-placeholder__side {
    stroke: #4d7c0f;
    stroke-opacity: 0.9;
    stroke-width: 1.8;
    vector-effect: non-scaling-stroke;
}

@keyframes live-view-drag-hold-pulse {
    0%, 100% {
        opacity: 0.82;
        transform: scale(0.74);
    }

    50% {
        opacity: 1;
        transform: scale(1.08);
    }
}

.live-view-layer-selector {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 4;
    display: grid;
    min-width: 8.5rem;
    gap: 0.35rem;
    padding: 0.65rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.6rem;
    background: rgba(3, 14, 23, 0.76);
    color: #fff;
    box-shadow: 0 0.55rem 1.4rem rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(0.35rem);
}

/* Shared LiveView navigation and orthographic annotations (global for publish). */
.live-view-navigable > .viewer3dContainer {
    position: absolute; inset: 0; width: 100%; height: 100%;
}
.live-view-navigable[data-view-mode="2d"] > .viewer3dContainer {
    position: absolute; inset: 0 0 0 190px; width: calc(100% - 190px); height: 100%;
}
.live-view-navigable[data-view-mode="3d"] .live-view-layer-selector { top: 58px; max-height: calc(100% - 200px); overflow-y: auto; }
.live-view-mode-switch { position: absolute; top: 10px; left: 10px; z-index: 8; display: flex; gap: 4px; }
.live-view-mode-switch button, .live-view-block-navigator button, .live-view-fullscreen-button {
    background: #25394c; color: #fff; border: 1px solid #60778b; border-radius: 6px;
    min-height: 36px; padding: 6px 10px; cursor: pointer; font: inherit; font-size: 12px;
}
.live-view-mode-switch button.active, .live-view-block-navigator button.active {
    background: #075985; border-color: #7dd3fc; color: #fff;
}
.live-view-mode-switch button:focus-visible, .live-view-block-navigator button:focus-visible,
.live-view-fullscreen-button:focus-visible { outline: 2px solid #facc15; outline-offset: 2px; }
.live-view-fullscreen-button { position: absolute; top: 10px; right: 10px; z-index: 9; font-size: 23px; line-height: 1; min-width: 40px; }
.live-view-search-toggle {
    position: absolute; top: 10px; right: 60px; z-index: 10;
    color: #fff; background: #172638ed; border: 1px solid #94a3b8;
    border-radius: 7px; padding: 8px 12px; min-height: 40px; cursor: pointer;
}
.live-view-search-panel {
    position: absolute; top: 58px; right: 10px; bottom: 12px; z-index: 30;
    width: min(380px, calc(100% - 20px)); display: flex; flex-direction: column;
    padding: 14px; gap: 10px; color: #f1f5f9; background: #142033f5;
    border: 1px solid #64748b; border-radius: 10px; box-shadow: 0 8px 24px #0006;
    font-size: 13px; overflow: auto; overscroll-behavior: contain; color-scheme: dark;
}
.live-view-search-panel[hidden] { display: none !important; }
.live-view-search-heading, .live-view-search-result-title, .live-view-search-result-actions {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.live-view-search-panel button {
    color: #f1f5f9; background: #334155; border: 1px solid #64748b;
    border-radius: 6px; padding: 6px 10px; min-height: 36px; cursor: pointer;
}
.live-view-search-panel button:hover, .live-view-search-toggle:hover { background: #475569; }
.live-view-search-panel :focus-visible, .live-view-search-toggle:focus-visible {
    outline: 2px solid #7dd3fc; outline-offset: 2px;
}
.live-view-search-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; flex-shrink: 0; }
.live-view-search-fields label { display: flex; flex-direction: column; gap: 5px; color: #e2e8f0; min-width: 0; }
.live-view-search-fields label:first-child { grid-column: 1 / -1; }
.live-view-search-fields input, .live-view-search-fields select {
    width: 100%; min-width: 0; height: 38px; color: #fff; background: #0f172a;
    border: 1px solid #64748b; border-radius: 5px; padding: 6px 8px; font: inherit;
}
.live-view-search-fields input::placeholder { color: #94a3b8; }
.live-view-search-reset { align-self: end; }
.live-view-search-count { color: #bae6fd; flex-shrink: 0; }
.live-view-search-results { overflow-y: auto; min-height: 100px; flex: 1; overscroll-behavior: contain; }
.live-view-search-result { padding: 10px; margin-bottom: 8px; background: #1e293b; border: 1px solid #475569; border-radius: 7px; cursor: pointer; }
.live-view-search-result:hover { border-color: #7dd3fc; }
.live-view-search-result p { margin: 6px 0; font-size: 12px; overflow-wrap: anywhere; }
.live-view-search-panel .live-view-search-code { color: #7dd3fc; background: transparent; border: 0; padding-left: 0; font-weight: 700; }
.live-view-search-result-actions { justify-content: flex-end; }
.live-view-search-empty { color: #cbd5e1; padding: 10px; }
@media (max-height: 500px) {
    .live-view-search-panel { bottom: 6px; padding: 10px; }
    .live-view-search-fields { gap: 5px; }
}
.live-view-block-navigator {
    position: absolute; top: 54px; bottom: 10px; left: 10px; width: 170px; z-index: 4;
    display: flex; flex-direction: column; gap: 8px; padding: 8px; overflow: auto;
    background: rgba(15, 23, 42, .91); color: #fff; border-radius: 8px; font-size: 12px;
}
.live-view-block-overview { flex-shrink: 0; width: 100%; height: 130px; background: #e0f2fe; border-radius: 5px; }
.live-view-block-overview polygon { fill: #fbbf24; stroke: #92400e; stroke-width: 1; cursor: pointer; }
.live-view-block-overview polygon.active, .live-view-block-overview polygon:hover { fill: #38bdf8; stroke: #075985; }
.live-view-block-list { display: grid; gap: 5px; }
.live-view-bay-picks { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.live-view-bay-picks svg { width: 100%; height: 100%; overflow: hidden; }
.live-view-bay-picks polygon { fill: transparent; pointer-events: all; cursor: pointer; stroke: transparent; stroke-width: 2px; }
.live-view-bay-picks polygon:hover, .live-view-bay-picks polygon:focus-visible { fill: #38bdf844; stroke: #0284c7; outline: none; }
.live-view-bay-picks text { pointer-events: none; text-anchor: middle; dominant-baseline: middle; fill: #0f172a; stroke: #e0f2fe; stroke-width: 3px; paint-order: stroke; font: bold 11px Arial, sans-serif; }
.live-view-bay-caption { position: absolute; top: 10px; left: 200px; right: 60px; z-index: 4; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: #0f172a; font-size: 12px; }
.live-view-bay-caption button { border: 1px solid #bae6fd; border-radius: 5px; background: #0c4a6e; color: #fff; padding: 7px; cursor: pointer; }
.live-view-map[data-view-mode="2d"] canvas { touch-action: none; }
.live-view-2d-annotations { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; overflow: hidden; }
.live-view-2d-annotations text { text-anchor: middle; dominant-baseline: middle; font-family: Arial, sans-serif; }
.live-view-2d-annotations .bay-axis { fill: #0f172a; stroke: #e0f2fe; stroke-width: 3px; paint-order: stroke; font-size: 12px; font-weight: 700; }
.live-view-2d-annotations .bay-code { fill: #fff; stroke: #334155; stroke-width: 2px; paint-order: stroke; }
.live-view-2d-annotations .bay-cell { fill: none; stroke: #334155; stroke-opacity: .4; stroke-dasharray: 3 3; stroke-width: 1; }
.live-view-navigable[data-view-mode="2d"] .live-view-legend { left: 200px; }
.live-view-navigable .container-hover-details { top: 58px; }
.live-view-map.live-view-fullscreen, .live-view-map:fullscreen {
    position: fixed !important; inset: 0 !important; width: 100vw !important;
    height: 100vh !important; height: 100dvh !important; min-height: 0 !important;
    max-width: none !important; border-radius: 0; z-index: 2147483000;
}
@media (max-width: 768px) {
    .live-view-navigable[data-view-mode="2d"] > .viewer3dContainer { left: 120px; width: calc(100% - 120px); }
    .live-view-block-navigator { left: 4px; width: 112px; padding: 5px; }
    .live-view-block-overview { height: 88px; }
    .live-view-block-navigator button { min-height: 44px; padding: 4px; }
    .live-view-bay-caption { left: 126px; }
    .live-view-navigable[data-view-mode="2d"] .live-view-legend { left: 124px; max-width: calc(100% - 132px); min-width: 0; font-size: 9px; gap: 2px; padding: 5px; }
    .live-view-mode-switch button, .live-view-fullscreen-button { min-height: 40px; }
    .live-view-fullscreen .live-view-mode-switch, .live-view-fullscreen .live-view-fullscreen-button { top: max(10px, env(safe-area-inset-top)); }
}

.live-view-layer-selector strong {
    padding: 0.1rem 0.3rem 0.25rem;
    font-size: 0.76rem;
}

.live-view-layer-selector button {
    padding: 0.38rem 0.55rem;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 0.38rem;
    background: rgba(255, 255, 255, 0.07);
    color: rgba(255, 255, 255, 0.82);
    font: inherit;
    font-size: 0.74rem;
    text-align: left;
    cursor: pointer;
}

.live-view-layer-selector button:hover,
.live-view-layer-selector button.active {
    border-color: #7dd3fc;
    background: rgba(14, 165, 233, 0.3);
    color: #fff;
}

.live-view-legend {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    z-index: 3;
    display: grid;
    min-width: 12.5rem;
    gap: 0.42rem;
    padding: 0.7rem 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 0.6rem;
    background: rgba(3, 14, 23, 0.76);
    color: #fff;
    font-size: 0.76rem;
    line-height: 1.2;
    box-shadow: 0 0.55rem 1.4rem rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(0.35rem);
    pointer-events: none;
}

.live-view-legend strong {
    margin-bottom: 0.1rem;
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.77rem;
}

.live-view-legend div {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-swatch {
    display: inline-block;
    width: 0.9rem;
    height: 0.9rem;
    flex: 0 0 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 0.18rem;
}

.legend-container { background: #6b7280; }
.legend-export { background: #4ade80; }
.legend-move { background: #fdba74; }
.legend-blocked { background: #a16207; }
.legend-hooked { background: #38bdf8; }
.legend-selected { background: #fff59d; }
.legend-history { background: #7dd3fc; }
.legend-origin { background: #f472b6; }
.legend-destination { background: #a3e635; }
.legend-blocker { background: #fb7185; }

.live-view-issues {
    margin-top: 0.75rem;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--av-warning) 45%, var(--av-border));
    border-radius: 0.75rem;
    background: var(--av-surface);
    color: var(--av-text);
}

.live-view-issues > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.7rem 0.9rem;
    background: color-mix(in srgb, var(--av-warning) 12%, var(--av-surface));
}

.live-view-issues > header span {
    color: var(--av-text-muted);
    font-size: 0.78rem;
}

.live-view-issues-scroll { overflow-x: auto; }

.live-view-issues table {
    width: 100%;
    min-width: 36rem;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.82rem;
}

.live-view-issues th,
.live-view-issues td {
    padding: 0.65rem 0.9rem;
    border-top: 1px solid var(--av-border);
    vertical-align: top;
}

.live-view-issues th { color: var(--av-text-muted); font-size: 0.72rem; text-transform: uppercase; }
.live-view-issues th:first-child { width: 6.5rem; }
.live-view-issues th:nth-child(2) { width: 12rem; }
.live-view-issues .issue-level { display: inline-block; padding: 0.18rem 0.45rem; border-radius: 999px; font-weight: 700; }
.live-view-issues .issue-warning .issue-level { background: color-mix(in srgb, var(--av-warning) 18%, transparent); color: var(--av-warning); }
.live-view-issues .issue-error .issue-level { background: rgba(239, 68, 68, 0.15); color: #ef4444; }

.container-hover-details {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 3;
    display: grid;
    min-width: 11rem;
    gap: 0.35rem;
    padding: 0.75rem 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 0.55rem;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 0.78rem;
    line-height: 1.25;
    box-shadow: 0 0.55rem 1.4rem rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(0.35rem);
    pointer-events: none;
}

    .container-hover-details div {
        display: grid;
        grid-template-columns: 3.25rem 1fr;
        gap: 0.65rem;
    }

    .container-hover-details span {
        color: rgba(255, 255, 255, 0.68);
    }

    .live-view-container-actions {
        visibility: hidden;
        position: absolute;
        z-index: 15;
        left: var(--container-action-x, 50%);
        top: var(--container-action-y, 45%);
        transform: translate(-50%, calc(-100% - 14px));
        width: 210px;
        padding: 10px;
        border: 1px solid #64748b;
        border-radius: 12px;
        background: #172033f2;
        color: #fff;
        box-shadow: 0 5px 18px #0005;
    }
    .live-view-container-actions::after {
        content: '';
        position: absolute;
        top: 100%;
        left: calc(var(--bubble-arrow-x, 50%) - 9px);
        border: 9px solid transparent;
        border-top-color: #172033;
    }
    .live-view-container-action-title {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        margin-bottom: 8px;
        padding: 0;
        background: transparent;
        color: #fff;
    }
    .live-view-container-actions strong { overflow-wrap: anywhere; color: #fff; min-width: 0; }
    .live-view-container-action-title > button { flex-shrink: 0; }
    .live-view-container-actions[data-below="true"] { transform: translate(-50%, 14px); }
    .live-view-container-actions[data-below="true"]::after {
        top: auto; bottom: 100%; border-top-color: transparent; border-bottom-color: #172033;
    }
    .live-view-move-instructions {
        position: absolute; z-index: 16; top: 12px; left: 50%; transform: translateX(-50%);
        max-width: 70%; padding: 8px 12px; border-radius: 8px; background: #172033ef; color: white;
        display: flex; align-items: center; gap: 10px;
    }
    .live-view-move-instructions button { color: white; background: #475569; border: 0; border-radius: 5px; padding: 6px 12px; cursor: pointer; }
    .live-view-move-touch-hint, .live-view-move-instructions .live-view-touch-confirm { display: none; }
    .live-view-map[data-touch-move="true"] .live-view-move-mouse-hint { display: none; }
    .live-view-map[data-touch-move="true"] .live-view-move-touch-hint { display: block; flex-basis: 100%; }
    .live-view-map[data-touch-move="true"] .live-view-move-instructions {
        top: auto; bottom: 14px; max-width: calc(100% - 24px); width: max-content;
        flex-wrap: wrap; justify-content: center; box-sizing: border-box;
    }
    .live-view-map[data-touch-move="true"] .live-view-touch-confirm { display: inline-block; background: #15803d; }
    .live-view-map[data-touch-move="true"] .live-view-move-instructions button { min-height: 44px; }
    .live-view-move-instructions button:disabled { opacity: .45; cursor: not-allowed; }
    .live-view-container-actions button {
        border: 1px solid #64748b;
        border-radius: 6px;
        padding: 6px 9px;
        color: #fff;
        background: #334155;
        cursor: pointer;
        min-height: 36px;
    }
    .live-view-container-actions button:hover,
    .live-view-container-actions button:focus-visible { background: #475569; }
    .live-view-container-action-buttons { display: flex; gap: 8px; }
    .live-view-container-action-buttons button { flex: 1; }

    .container-hover-details strong {
        color: #fff;
        font-weight: 600;
        overflow-wrap: anywhere;
    }

@media (max-width: 768px) {
    .live-view-map {
        min-height: 26rem;
    }

    .live-view-legend {
        bottom: 0.6rem;
        left: 0.6rem;
        min-width: 11.5rem;
        padding: 0.55rem 0.65rem;
        font-size: 0.7rem;
    }
}
