#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    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;
}

:root {
    font-size: var(--rz-root-font-size, 16px);
}

body {
    font-family: var(--rz-text-font-family, sans-serif);
    color: var(--rz-text-color, #333);
    font-size: var(--rz-body-font-size, 1rem);
    line-height: var(--rz-body-line-height, 1.5);
    background-color: var(--rz-body-background-color, #fff);
    margin: 0;
    padding: 0;
}

.rz-body {
    --rz-body-padding: 0;
}

a {
    color: var(--rz-link-color, #007bff);
    text-decoration: none;
}

a:hover,
a:focus {
    color: var(--rz-link-hover-color, #0056b3);
    text-decoration: underline;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,...) 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");
}

.map-container {
    width: 100%;
    height: 50vh;
    min-height: 300px;
}

/* ----------------- Responsive Layout Improvements ------------------ */

@media (max-width: 768px) {
    .map-container {
        height: 60vh;
    }

    .rz-p-12 {
        padding: 1rem !important;
    }

    .rz-mt-md-12 {
        margin-top: 2rem !important;
    }

    .rz-pt-md-12 {
        padding-top: 2rem !important;
    }

    .rz-display-sm-block {
        display: block !important;
    }

    .rz-border-radius-4 {
        border-radius: 0 !important;
    }

    .rz-shadow-3 {
        box-shadow: none !important;
    }
}

/* ------------------ Optional: Card Flexibility ------------------ */
@media (max-width: 480px) {
    .login-card {
        width: 100% !important;
        border-radius: 0 !important;
        padding: 1rem !important;
    }
}

.btn-stack {
    display: flex;
    flex-direction: column;
}

    .btn-stack .rz-button {
        width: 100%;
    }

    /* spazio solo tra bottoni adiacenti, robusto anche col primo condizionale */
    .btn-stack > .rz-button + .rz-button {
        margin-top: .5rem; /* ~8px – aumenta se vuoi più spazio */
    }

/* --- Surface condivisa tra Tabs panel e Fieldset --- */
:root {
    /* scegli un surface neutro, verrà usato anche come fallback */
    --app-surface: var(--rz-panel-background, var(--rz-base-background, #f7f9fc));
    --app-border: var(--rz-panel-border, var(--rz-base-300, #e5e7eb));
}

/* Pannelli dei Tabs (contenuto) */
.rz-tabs .rz-tabs-panels {
    background-color: var(--app-surface);
}

/* Fieldset allineato ai Tabs */
.rz-fieldset,
.rz-fieldset .rz-fieldset-content {
    background-color: var(--app-surface);
}

/* Bordi/angoli coerenti */
.rz-fieldset {
    border-color: var(--app-border);
    border-radius: .5rem;
    box-shadow: var(--rz-elevation-1, 0 1px 2px rgba(0,0,0,.05));
}

/* Legenda/Title del Fieldset: togli il fondo diverso, lascia trasparente */
.rz-fieldset-legend {
    background-color: transparent;
}
.todo-done {
    text-decoration: line-through;
    opacity: .7;
}
.rz-grid .rz-cell .rz-button.rz-button-sm {
    padding: 0.25rem 0.4rem;
}

/* wwwroot/css/site.css */
.chat-icon-wrap {
    position: relative;
    display: inline-block;
}

    .chat-icon-wrap .rz-badge {
        position: absolute;
        top: -6px;
        right: -6px;
    }
.chat-fab {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 1040;
}

.chat-fab-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
}

.chat-fab-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #e53935;
    color: #fff;
    border-radius: 999px;
    padding: 2px 6px;
    font-size: .75rem;
}

.chat-float-panel {
    position: fixed;
    right: 22px;
    bottom: 90px;
    width: 380px;
    height: 520px;
    background: #fff;
    border: 1px solid var(--rz-light);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    z-index: 1040;
}

.chat-float-header {
    background: #000;
    color: #fff;
    padding: .5rem .6rem;
    cursor: move;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
}

.chat-float-body {
    flex: 1;
    overflow: hidden;
    padding: .25rem;
}

@media (max-width: 540px) {
    .chat-float-panel {
        width: calc(100vw - 24px);
        height: 60vh;
        right: 12px;
        bottom: 84px;
    }
}

.rz-dropdown-panel,
.rz-autocomplete-panel,
.rz-popup {
    z-index: 2147483647 !important;
}

/* Centro la form nella pagina o nel dialog */
.kit-form-centered {
    width: 100%;
    max-width: 1500px; /* regola la larghezza massima a piacere */
    margin: 0 auto; /* centro orizzontalmente */
    padding: 1rem;
    box-sizing: border-box;
    background: var(--rz-base-background, #fff);
    border-radius: 12px;
    box-shadow: 0 6px 24px rgba(0,0,0,.08);
}

/* Se la apri in un dialog Radzen full-screen, centra anche il contenuto */
.dlg-fullscreen .rz-dialog-content {
    display: flex;
    justify-content: center;
    align-items: flex-start; /* o 'center' se vuoi anche centratura verticale */
    padding: 0 1rem 1rem 1rem; /* spazio ai lati */
}

    .dlg-fullscreen .rz-dialog-content > * {
        width: 100%;
        max-width: 1100px; /* stessa larghezza massima del form */
        margin: 0 auto;
    }

/* Se la griglia può essere larga, permetti lo scroll orizzontale evitando overflow della pagina */
.kit-form-centered .rz-data-grid {
    overflow-x: auto;
}

/* === VERA MODAL FULL-SCREEN === */
.dlg-fullscreen.rz-dialog {
    margin: 0 !important;
    width: 100vw !important;
    max-width: none !important;
    height: 100vh !important;
    max-height: none !important;
    border-radius: 0 !important;
}

/* (opzionale) altezza interna: header ~56px + footer ~56px */
.dlg-fullscreen .rz-dialog-content {
    height: calc(100vh - 56px - 56px);
    overflow: auto;
}
