:root {
    --sp-plum-950: #211a23;
    --sp-plum-900: #2f2431;
    --sp-plum-700: #5b4355;
    --sp-mauve: #a8758a;
    --sp-mauve-soft: #ead9df;
    --sp-gold: #c9a85f;
    --sp-cream: #fcfaf8;
    --sp-rose-surface: #f7f0f2;
    --sp-ink: #332735;
    --sp-muted: #786a76;
    --sp-line: #eadfe3;
    --sp-radius: 16px;
    --sp-shadow: 0 18px 45px rgba(55, 33, 49, 0.09);
}

html, body {
    min-height: 100%;
    font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    background: var(--mud-palette-background, var(--sp-cream));
    color: var(--mud-palette-text-primary, var(--sp-ink));
}

body {
    margin: 0;
}

h1, h2, h3, h4, h5, h6,
.mud-typography-h1, .mud-typography-h2, .mud-typography-h3,
.mud-typography-h4, .mud-typography-h5, .mud-typography-h6 {
    font-family: "Cormorant Garamond", Georgia, serif;
    font-weight: 600;
    letter-spacing: -0.015em;
}

.mud-appbar {
    background: var(--mud-palette-appbar-background, var(--sp-cream)) !important;
    color: var(--mud-palette-appbar-text, var(--sp-ink)) !important;
    border-bottom: 1px solid var(--sp-line);
    box-shadow: 0 8px 28px rgba(55, 33, 49, 0.06) !important;
    backdrop-filter: blur(16px);
}

.mud-drawer {
    border-right: 1px solid var(--sp-line) !important;
    box-shadow: 8px 0 28px rgba(55, 33, 49, 0.04);
}

.mud-main-content {
    background:
        radial-gradient(circle at 90% 0%, rgba(234, 217, 223, 0.34), transparent 22rem),
        var(--mud-palette-background, var(--sp-cream));
}

.mud-nav-link {
    margin: 0.18rem 0.65rem;
    border-radius: 12px;
    color: var(--mud-palette-text-secondary, var(--sp-muted));
    transition: background-color 180ms ease, color 180ms ease;
}

.mud-nav-link:hover {
    color: var(--mud-palette-text-primary, var(--sp-ink));
    background: rgba(168, 117, 138, 0.10);
}

.mud-nav-link.active {
    color: var(--mud-palette-primary, var(--sp-plum-900)) !important;
    background: linear-gradient(90deg, rgba(168, 117, 138, 0.20), rgba(201, 168, 95, 0.10));
    font-weight: 700;
}

.sp-appbar-nav .app-nav-menu {
    flex-direction: row !important;
    align-items: center;
    gap: 0.2rem !important;
    padding: 0 !important;
}

/*
 * Collegamenti diretti (MudNavLink) e gruppi a tendina (MudMenu) devono sembrare la stessa voce:
 * MudBlazor dà ai primi i colori del drawer e ai secondi la tipografia dei pulsanti, qui si allineano.
 */
.sp-appbar-nav .app-nav-menu .mud-nav-link,
.sp-appbar-nav .sp-nav-gruppo .mud-button-root {
    margin: 0;
    padding: 6px 12px;
    border-radius: 12px;
    white-space: nowrap;
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0;
    line-height: 1.75;
    text-transform: none;
    color: var(--mud-palette-text-secondary, var(--sp-muted));
}

.sp-appbar-nav .app-nav-menu .mud-nav-link .mud-nav-link-text {
    font-weight: inherit;
}

.sp-appbar-nav .app-nav-menu .mud-nav-link .mud-nav-link-icon.mud-nav-link-icon-default,
.sp-appbar-nav .sp-nav-gruppo .mud-button-root .mud-icon-root {
    color: inherit;
}

.sp-appbar-nav .app-nav-menu .mud-nav-link:hover,
.sp-appbar-nav .sp-nav-gruppo .mud-button-root:hover {
    color: var(--mud-palette-text-primary, var(--sp-ink));
    background: rgba(168, 117, 138, 0.10);
}

.sp-appbar-nav .app-nav-menu .mud-nav-link.active,
.sp-appbar-nav .sp-nav-gruppo.active .mud-button-root {
    color: var(--mud-palette-primary, var(--sp-plum-900)) !important;
    background: linear-gradient(90deg, rgba(168, 117, 138, 0.20), rgba(201, 168, 95, 0.10));
    font-weight: 700;
}

/* Sotto i 1280 px le voci della barra non stanno tutte con le icone: si tolgono. */
@media (max-width: 1279.98px) {
    .sp-appbar-nav .app-nav-menu .mud-nav-link-icon,
    .sp-appbar-nav .sp-nav-gruppo .mud-button-icon-start {
        display: none;
    }
}

.mud-button-root {
    border-radius: 12px;
    text-transform: none;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.mud-paper, .mud-card {
    border: 1px solid var(--sp-line);
    border-radius: var(--sp-radius);
    box-shadow: var(--sp-shadow);
}

.mud-table,
.mud-table-container {
    border: 1px solid var(--sp-line);
    border-radius: 0;
    box-shadow: var(--sp-shadow);
}

/*html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
  outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}*/

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1zbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

/*.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}*/


#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;
    }

/* --- PRENOTAZIONE GUIDATA --- */
/* Riquadri su fondo grigio. Da lg in su la modale occupa quasi tutto lo schermo, le colonne hanno
   altezza fissa e i riquadri estesi scorrono da soli: intestazioni e comandi restano sempre in vista. */

.prenotazione-dialog .mud-dialog-content {
    background-color: var(--mud-palette-background-gray);
    border-top: 1px solid var(--mud-palette-lines-default);
    border-bottom: 1px solid var(--mud-palette-lines-default);
    padding-top: 16px;
    padding-bottom: 16px;
}

.prenotazione-guidata > .prenotazione-colonna {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.prenotazione-sezione {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.prenotazione-sezione-testata {
    min-height: 72px;
    padding: 8px 16px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.prenotazione-sezione-testata,
.prenotazione-sezione-strumenti {
    flex-shrink: 0;
}

.prenotazione-sezione-testata-campo {
    min-height: 0;
    padding: 12px 16px;
}

.prenotazione-sezione-campo {
    flex: 1 1 auto;
    min-width: 0;
}

.prenotazione-sezione-campo-contenuto {
    flex: 1 1 auto;
    min-width: 0;
}

.prenotazione-sezione-strumenti {
    padding: 12px 16px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}


.prenotazione-sezione-corpo {
    padding: 16px;
}

.prenotazione-note-cliente {
    flex: 1 1 auto;
    min-width: 0;
}

.prenotazione-note-testo {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: pre-line;
}

.prenotazione-note-tooltip {
    max-width: 360px;
    white-space: pre-line;
    text-align: left;
}

/*
    Scheda della cliente in un pannello (SchedaClienteLaterale), nella prenotazione e nell'editor
    dell'appuntamento: su schermo stretto prende il posto del contenuto, su schermo largo scorre
    da destra sopra di esso.
*/
.prenotazione-guidata-coperta,
.appuntamento-editor-coperto {
    display: none;
}

.scheda-cliente-laterale {
    display: flex;
    flex-direction: column;
    min-height: 0;
    background-color: var(--mud-palette-surface);
}

.scheda-cliente-laterale-testata {
    flex-shrink: 0;
    padding: 8px 8px 8px 16px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.scheda-cliente-laterale-corpo {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 8px;
}

@keyframes scheda-cliente-entra {
    from {
        transform: translateX(100%);
    }

    to {
        transform: translateX(0);
    }
}

@media (min-width: 960px) {
    .e-schedule-dialog .e-dlg-content {
        position: relative;
    }

    .appuntamento-editor-coperto {
        display: block;
    }

    .e-schedule-dialog .scheda-cliente-laterale {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: 66.6667%;
        z-index: 5;
        animation: scheda-cliente-entra 200ms ease-out;
    }
}

.prenotazione-guidata .mud-list-item-icon {
    min-width: 36px;
}

@media (min-width: 1280px) {
    .mud-dialog.prenotazione-dialog {
        height: calc(100vh - 64px);
    }

    .prenotazione-dialog .mud-dialog-content {
        flex: 1 1 auto;
        min-height: 0;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    .prenotazione-guidata {
        flex: 1 1 auto;
        min-height: 0;
    }

    .prenotazione-guidata > .prenotazione-colonna {
        height: 100%;
        min-height: 0;
    }

    .prenotazione-sezione-estesa {
        flex: 1 1 0;
    }

    .prenotazione-sezione-estesa > .prenotazione-sezione-corpo {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
    }

    /* Su schermo largo la scheda scorre da destra sopra i riquadri 2 e 3: la cliente resta visibile. */
    .prenotazione-dialog .mud-dialog-content {
        position: relative;
    }

    .prenotazione-guidata-coperta {
        display: flex;
    }

    .prenotazione-dialog .scheda-cliente-laterale {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: 66.6667%;
        z-index: 5;
        animation: scheda-cliente-entra 200ms ease-out;
    }
}

/* --- SYNCFUSION SCHEDULER COMMON STYLES --- */
/* Stili comuni per SfSchedule dialog */

.agenda-page {
    flex: 1 1 0;
    min-height: 0;
}

.mud-container:has(> .agenda-page) > .flex-grow-1 {
    display: none;
}

.agenda-page > .e-schedule {
    min-height: 0;
}

/* Allinea gli indicatori temporali e il giorno corrente all'accento dell'interfaccia. */
.e-schedule .e-header-cells.e-current-day,
.e-schedule .e-header-cells.e-current-day .e-header-day,
.e-schedule .e-header-cells.e-current-day .e-header-date,
.e-schedule .e-current-time,
.e-schedule .e-current-timeline {
    color: var(--mud-palette-primary) !important;
    border-color: var(--mud-palette-primary) !important;
}

.e-schedule .e-toolbar-item.e-active-view .e-btn,
.e-schedule .e-toolbar-item.e-active-view .e-tbar-btn-text,
.e-schedule .e-toolbar-item.e-active-view .e-icons {
    color: var(--mud-palette-primary) !important;
}

/* Celle in cui l'operatrice non lavora, è assente o il centro è chiuso. */
.e-schedule .e-work-cells.agenda-non-disponibile,
.e-schedule .e-vertical-view .e-work-cells.e-work-hours.agenda-non-disponibile {
    background-color: #ece9ee !important;
    background-image: repeating-linear-gradient(135deg, transparent 0 6px, rgba(0, 0, 0, 0.06) 6px 7px) !important;
}

/* Colore dell'operatrice (variabile --agenda-op, generata in Agenda.razor): tinta tenue sulle celle in cui lavora... */
.e-schedule .e-vertical-view .e-work-cells[class*="agenda-op-"]:not(.agenda-non-disponibile):not(.e-selected-cell):not(:hover) {
    background-color: color-mix(in srgb, var(--agenda-op) 22%, var(--mud-palette-surface)) !important;
}

/* ...e banda colorata sotto il nome nell'intestazione. */
.e-schedule .e-resource-cells[class*="agenda-op-"] {
    background-color: color-mix(in srgb, var(--agenda-op) 30%, var(--mud-palette-surface)) !important;
    box-shadow: inset 0 -4px 0 var(--agenda-op);
}

/* Vista per giorno: un bordo più marcato separa i giorni, quello sottile resta fra le operatrici. */
.e-schedule .e-vertical-view .agenda-inizio-giorno:not(:first-child),
.e-schedule.agenda-per-giorno .e-vertical-view .e-date-header-wrap .e-header-cells:not(:first-child) {
    border-left: 1px solid var(--mud-palette-text-secondary) !important;
}

/* Orari già passati: un velo del colore di fondo li attenua, l'occhio va al tempo ancora prenotabile. */
.e-schedule .e-vertical-view .e-work-cells.agenda-passato {
    box-shadow: inset 0 0 0 100vmax color-mix(in srgb, var(--mud-palette-surface) 50%, transparent);
}

/* Passando col mouse su una cella: anteprima della prenotazione (attributo messo da js/agenda-riga.js)
   o motivo per cui l'operatrice non è disponibile (classi agenda-motivo-* messe da OnRenderCell). */
/* Niente position sulle celle: gli appuntamenti stanno in un contenitore posizionato nell'intestazione della
   tabella e celle posizionate verrebbero disegnate sopra di loro. Il testo resta nel flusso della cella. */
.e-schedule .e-vertical-view td.e-work-cells[data-anteprima]:hover::after,
.e-schedule .e-vertical-view td.e-work-cells.agenda-non-disponibile:hover::after {
    display: block;
    overflow: hidden;
    font-size: 0.68rem;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    text-overflow: ellipsis;
    pointer-events: none;
}

.e-schedule .e-vertical-view td.e-work-cells[data-anteprima]:hover::after {
    content: attr(data-anteprima);
    color: var(--mud-palette-primary);
    font-weight: 600;
}

.e-schedule .e-vertical-view td.e-work-cells.agenda-non-disponibile:hover::after {
    content: "Non disponibile";
    color: var(--mud-palette-text-secondary);
}

.e-schedule .e-vertical-view td.e-work-cells.agenda-motivo-centrochiuso:hover::after { content: "Centro chiuso"; }
.e-schedule .e-vertical-view td.e-work-cells.agenda-motivo-assente:hover::after { content: "Assente"; }
.e-schedule .e-vertical-view td.e-work-cells.agenda-motivo-nonprogrammato:hover::after { content: "Da programmare"; }
.e-schedule .e-vertical-view td.e-work-cells.agenda-motivo-libero:hover::after { content: "Riposo"; }
.e-schedule .e-vertical-view td.e-work-cells.agenda-motivo-fuoriturno:hover::after { content: "Fuori turno"; }

/* Sopra un appuntamento (js/agenda-riga.js): gli altri della stessa cliente cerchiati, quelli della stessa
   visita con un anello più marcato, il resto attenuato. Box-shadow e non outline: l'outline segnala già
   fuori listino e fuori turno. */
.e-schedule.agenda-evidenzia-cliente .e-appointment:not(.agenda-collegato):not(.agenda-stessa-visita) {
    opacity: 0.4;
}

.e-schedule .e-appointment.agenda-collegato {
    box-shadow: 0 0 0 2px var(--mud-palette-surface), 0 0 0 4px var(--mud-palette-text-primary) !important;
}

.e-schedule .e-appointment.agenda-stessa-visita {
    box-shadow: 0 0 0 2px var(--mud-palette-surface), 0 0 0 5px var(--mud-palette-primary) !important;
}

/* Trascinando un appuntamento dove non può stare (js/agenda-trascina.js): copia rossa con il motivo. */
.e-schedule .e-appointment.e-schedule-event-clone.agenda-trascina-no {
    background: var(--mud-palette-error) !important;
    outline: 3px solid var(--mud-palette-error) !important;
    outline-offset: 1px;
    cursor: not-allowed;
}

.e-schedule .e-appointment.e-schedule-event-clone.agenda-trascina-no::after {
    content: attr(data-motivo);
    position: absolute;
    right: 2px;
    bottom: 2px;
    padding: 0 4px;
    border-radius: 3px;
    background: var(--mud-palette-surface);
    color: var(--mud-palette-error);
    font-size: 0.65rem;
    font-weight: 700;
}

/* Riga dell'orario sotto il mouse (js/agenda-riga.js): un velo con due linee sottili, sopra i colori delle operatrici. */
.e-schedule .e-vertical-view tr.agenda-riga-attiva > td.e-work-cells {
    box-shadow:
        inset 0 1px 0 color-mix(in srgb, var(--mud-palette-primary) 60%, transparent),
        inset 0 -1px 0 color-mix(in srgb, var(--mud-palette-primary) 60%, transparent),
        inset 0 0 0 100vmax color-mix(in srgb, var(--mud-palette-primary) 12%, transparent);
}

.e-schedule .e-vertical-view tr.agenda-riga-attiva > td.e-time-cells,
.e-schedule .e-vertical-view tr.agenda-riga-attiva > td.e-time-cells * {
    color: var(--mud-palette-primary) !important;
    font-weight: 700;
}

.agenda-toolbar-tasti {
    color: var(--mud-palette-text-secondary);
    cursor: help;
}

/* Pallini nella barra dell'agenda per mostrare o nascondere le operatrici. */
.agenda-filtro-operatrici {
    display: flex;
    gap: 0.25rem;
}

.agenda-filtro-operatrice {
    width: 1.9rem;
    height: 1.9rem;
    border: 2px solid var(--agenda-op, var(--mud-palette-lines-inputs));
    border-radius: 50%;
    background-color: var(--agenda-op, var(--mud-palette-surface));
    color: #332735;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
}

.agenda-filtro-operatrice:not(.attiva) {
    background-color: transparent;
    color: var(--mud-palette-text-disabled);
    text-decoration: line-through;
}

.agenda-filtro-operatrice:focus-visible {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: 1px;
}

/* Selettore del colore dell'operatrice. */
.colore-operatrice {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: 2px solid transparent;
    border-radius: 50%;
    color: #332735;
    cursor: pointer;
}

.colore-operatrice:hover,
.colore-operatrice:focus-visible {
    border-color: var(--mud-palette-text-secondary);
}

.colore-operatrice.nessun-colore {
    border-color: var(--mud-palette-lines-inputs);
    background-color: var(--mud-palette-surface);
    color: var(--mud-palette-text-secondary);
}

.colore-operatrice.selezionato {
    border-color: var(--mud-palette-text-primary);
}

.colore-operatrice-pallino {
    display: inline-block;
    flex-shrink: 0;
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
}

/* Testo dell'appuntamento su una riga: negli appuntamenti brevi restano leggibili cliente e trattamento. */
.agenda-event-content {
    display: flex;
    flex-wrap: wrap;
    column-gap: 0.4rem;
    max-height: 100%;
    overflow: hidden;
    font-size: 0.75rem;
    line-height: 1.15;
}

.agenda-event-content > small {
    flex-basis: 100%;
}

/* Cliente che deve ancora saldare un pacchetto o un trattamento: pallino € prima del nome. */
.agenda-sospeso {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.1em;
    height: 1.1em;
    margin-inline-end: 0.25em;
    border-radius: 50%;
    background: #f5a623;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.85);
    color: #3a2a00;
    font-size: 0.85em;
    font-weight: 700;
    line-height: 1;
    vertical-align: text-bottom;
}

/* Comandi della toolbar dell'agenda: stessa altezza, raggio e spaziatura per gruppo di viste e pulsanti. */
.e-schedule {
    --agenda-tbar-altezza: 32px;
    --agenda-tbar-raggio: 6px;
}

.e-schedule .e-toolbar .e-toolbar-item:has(.agenda-toolbar-group-toggle, .agenda-toolbar-new-event, .agenda-toolbar-block, .agenda-toolbar-incasso-toggle) {
    padding-inline: 0 !important;
    margin-inline-start: 0.5rem !important;
}

.e-schedule .e-toolbar .e-toolbar-item .agenda-toolbar-new-event,
.e-schedule .e-toolbar .e-toolbar-item .agenda-toolbar-block {
    display: inline-flex !important;
    align-items: center;
    gap: 0.375rem;
    box-sizing: border-box;
    height: var(--agenda-tbar-altezza) !important;
    min-height: var(--agenda-tbar-altezza) !important;
    padding: 0 0.875rem !important;
    border-width: 1px !important;
    border-style: solid !important;
    border-radius: var(--agenda-tbar-raggio) !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    line-height: 1 !important;
    box-shadow: none !important;
}

.e-schedule .e-toolbar .e-toolbar-item .agenda-toolbar-new-event .e-btn-icon,
.e-schedule .e-toolbar .e-toolbar-item .agenda-toolbar-block .e-btn-icon {
    margin: 0 !important;
    width: auto !important;
    font-size: 1rem !important;
    line-height: 1 !important;
}

.e-schedule .e-toolbar .e-toolbar-item .agenda-toolbar-new-event .e-btn-content,
.e-schedule .e-toolbar .e-toolbar-item .agenda-toolbar-block .e-btn-content {
    line-height: 1 !important;
}

/* Mantiene l'azione principale allineata a destra nella toolbar dell'agenda. */
.agenda-toolbar-new-event {
    color: #fff !important;
    background-color: var(--sp-mauve) !important;
    border-color: var(--sp-mauve) !important;
}

.agenda-toolbar-new-event:hover,
.agenda-toolbar-new-event:focus {
    color: #fff !important;
    background-color: var(--sp-plum-700) !important;
    border-color: var(--sp-plum-700) !important;
}

/* Azione secondaria: contorno al posto del riempimento, per non competere con Prenota. */
.agenda-toolbar-block {
    color: var(--sp-mauve) !important;
    background-color: transparent !important;
    border-color: var(--sp-mauve) !important;
}

.agenda-toolbar-block:hover,
.agenda-toolbar-block:focus {
    color: var(--sp-plum-700) !important;
    border-color: var(--sp-plum-700) !important;
}

.agenda-toolbar-group-toggle {
    box-sizing: border-box;
    height: var(--agenda-tbar-altezza, 32px);
    border-radius: var(--agenda-tbar-raggio, 6px) !important;
    overflow: hidden;
}

.agenda-toolbar-group-toggle .mud-toggle-item {
    box-sizing: border-box;
    height: 100%;
    min-width: 2.25rem;
    padding-block: 0;
    padding-inline: 0.5rem;
    border-radius: 0 !important;
}

.agenda-toolbar-group-toggle .mud-icon-root {
    font-size: 1.125rem;
}

/* Nascondi icona salva di default */
.e-save-icon.e-icons {
    display: none !important;
}

/* Nascondi pulsante chiusura dialog */
.e-schedule-dialog .e-dlg-closeicon-btn {
    display: none !important;
}

/* --- FULLSCREEN SFSCHEDULE EDITOR --- */
.e-schedule-dialog.e-popup-open {
    width: 100vw !important;
    height: 100dvh !important;
    max-width: 100vw !important;
    max-height: 100dvh !important;
    top: 0 !important;
    left: 0 !important;
    border-radius: 0 !important;
}

.e-schedule-dialog .e-dlg-content {
    height: calc(100dvh - 52px) !important;
    overflow: auto;
}

/* Abbassa z-index della finestra editor */
.e-dlg-container.e-schedule-dialog {
    z-index: 1351 !important;
}

/* Abbassa z-index dell'overlay scuro */
.e-dlg-overlay {
    z-index: 1350 !important;
}

/* --- FIX Z-INDEX QUICK POPUP SU MOBILE --- */
/* Assicura che il quick popup di Syncfusion sia sopra l'AppBar di MudBlazor */
.e-quick-popup-wrapper.e-popup-open {
    z-index: 1400 !important;
}

/* --- FIX TOOLTIP SYNCFUSION FUORI SCHERMO --- */
/* Forza i tooltip degli eventi a rimanere all'interno del viewport */
.e-schedule-event-tooltip {
    max-width: 90vw !important;
  max-height: 80vh !important;
    overflow: auto !important;
}

/* Impedisce ai tooltip di uscire dai bordi superiori/inferiori dello schermo */
.e-schedule .e-tooltip-wrap {
    position: fixed !important;
    transform-origin: center !important;
}

/* Assicura che il contenuto del tooltip sia scrollabile se troppo lungo */
.e-schedule-event-tooltip .e-tip-content {
    max-height: 75vh !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

/* --- AGENDA SCHEDULER STYLES --- */

/* Evidenzia vista attiva nella toolbar */
.e-toolbar .e-toolbar-item.view-active .e-btn {
    font-weight: bold;
}

/* --- MUDDATAGRID MULTISELECTION STYLES --- */
/* Stile per evidenziare le righe selezionate in modalità multiselezione */
.mud-table-body .mud-table-row.multiselect-row-selected {
    background-color: rgba(var(--mud-palette-primary-rgb), 0.15) !important;
}

.mud-table-body .mud-table-row.multiselect-row-selected:hover {
    background-color: rgba(var(--mud-palette-primary-rgb), 0.25) !important;
}

/* --- EVIDENZIAZONE APPUNTAMENTO CON FOCUS --- */
/* Incrementa l'effetto visivo per l'appuntamento selezionato */
.e-appointment:focus {
    outline: 4px solid var(--mud-palette-primary) !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 16px 4px rgba(var(--mud-palette-primary-rgb), 0.5), 0 0 0 2px rgba(255, 255, 255, 0.8) !important;
    transform: scale(1.02) !important;
    z-index: 100 !important;
    transition: all 0.2s ease-in-out !important;
}

/* Riduce leggermente l'opacità degli appuntamenti non selezionati quando uno ha il focus */
.e-schedule .e-appointment-wrapper .e-appointment:not(:focus) {
    opacity: 0.85;
    transition: opacity 0.2s ease-in-out;
}

/* Ripristina l'opacità al passaggio del mouse */
.e-schedule .e-appointment-wrapper .e-appointment:not(:focus):hover {
    opacity: 1;
}

.e-contextmenu-wrapper ul #Delete,
.e-contextmenu-wrapper ul #Delete .e-menu-icon,
.e-contextmenu-container ul #Delete,
.e-contextmenu-container ul #Delete .e-menu-icon {
    color: #f44336 !important;
}

/* Intestazione informativa del menu contestuale scheduler: cliente/trattamento dell'appuntamento,
   per non confondersi tra eventi vicini quando l'agenda è affollata. Non cliccabile. */
.e-contextmenu-wrapper ul #ContextMenuHeader,
.e-contextmenu-container ul #ContextMenuHeader {
    display: flex;
    align-items: center;
    padding: 8px 12px !important;
    font-weight: 600;
    font-size: 0.8rem;
    line-height: 1.3;
    color: var(--mud-palette-text-secondary, rgba(0, 0, 0, 0.6)) !important;
    background-color: rgba(var(--mud-palette-primary-rgb, 0, 0, 0), 0.06) !important;
    border-bottom: 1px solid var(--mud-palette-lines-default, rgba(0, 0, 0, 0.12));
    cursor: default !important;
    opacity: 1 !important;
    pointer-events: none;
    white-space: normal;
}

/* Ritocchi ai componenti MudBlazor (ex ht.css) */
/* Disable the slider. It doesn't position itself correctly.
https://github.com/MudBlazor/MudBlazor/issues/4161
 */
.mud-tab-slider.mud-tab-slider-horizontal {
    height: 0 !important;
}

.mud-tab.mud-tab-active {
    background-color: var(--mud-palette-primary-hover);
    color: var(--mud-palette-primary);
    border-radius: 0px;
    border-style: solid;
    border-width: 0 0 2px 0;
}

.mud-input-field-align-right input {
    text-align: right;
}

/* https://github.com/MudBlazor/MudBlazor/issues/1668 MudTabs with badges not spaced correctly when tab names are longer - badge gets cut off #1668 */
.mud-tab-badge {
    &.mud-badge-root {
        position: static;
        // Override absolute positioning from _badge.scss margin-left: 8px;

        .mud-badge-wrapper {
            position: static;
            // Override absolute positioning width: auto;
            // Allow natural width pointer-events: auto;
        }

        .mud-badge {
            position: static;
            // Override absolute positioning display: inline-flex;
        }
    }
}

/* Titolo dei documenti stampati (buoni regalo). */
.sp-stampa-titolo {
    font-family: "Cormorant Garamond", serif !important;
}

/* Firma sul tablet: il canvas cattura dito e penna senza far scorrere la pagina. */
.firma-riquadro {
    background: #ffffff;
    overflow: hidden;
}

.firma-canvas {
    display: block;
    width: 100%;
    height: 240px;
    touch-action: none;
    cursor: crosshair;
}

/* Miniature di foto e documenti nella scheda seduta e cliente. */
.allegato-miniatura {
    width: 140px;
    height: 140px;
    object-fit: cover;
    border-radius: 6px;
    cursor: zoom-in;
}

/* Percentuale accanto alla provvigione: larghezza fissa, così le cifre restano allineate con il totale. */
.staff-percentuale {
    display: inline-block;
    min-width: 3.25rem;
    text-align: left;
}

/* L'editor a tutto schermo si apre senza animazione: lo zoom di Syncfusion su una pagina intera è lento e a scatti. */
.e-schedule-dialog.e-popup-open,
.e-schedule-dialog .e-dlg-content {
    animation: none !important;
    transition: none !important;
}

/* Incasso previsto dell'agenda (pulsante €): totale del periodo nella toolbar, importi nelle intestazioni. */
.e-schedule .e-toolbar .e-toolbar-item .agenda-toolbar-incasso-toggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    height: var(--agenda-tbar-altezza) !important;
    min-height: var(--agenda-tbar-altezza) !important;
    width: var(--agenda-tbar-altezza);
    padding: 0 !important;
    border: 1px solid var(--sp-mauve) !important;
    border-radius: var(--agenda-tbar-raggio) !important;
    color: var(--sp-mauve) !important;
    background-color: transparent !important;
    box-shadow: none !important;
}

.e-schedule .e-toolbar .e-toolbar-item .agenda-toolbar-incasso-toggle.attivo {
    color: #fff !important;
    background-color: var(--sp-mauve) !important;
}

.agenda-toolbar-incasso {
    display: inline-flex;
    align-items: baseline;
    gap: 0.5rem;
    font-size: 0.875rem;
    white-space: nowrap;
    cursor: default;
}

.agenda-toolbar-incasso-periodo {
    color: var(--mud-palette-text-secondary);
}

/* Intestazione dell'operatrice: quando la colonna è stretta il nome lascia il posto alle iniziali. */
.agenda-intestazione-operatrice {
    container-type: inline-size;
    width: 100%;
    text-align: center;
}

.agenda-nome-iniziali {
    display: none;
}

.agenda-intestazione-operatrice .e-resource-text {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

@container (max-width: 54px) {
    .agenda-nome-intero {
        display: none;
    }

    .agenda-nome-iniziali {
        display: inline;
    }
}

.agenda-turno {
    overflow: hidden;
    font-size: 0.68rem;
    color: var(--mud-palette-text-secondary);
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* Quanto turno dell'operatrice è già occupato nel giorno. */
.agenda-riempimento {
    height: 3px;
    margin: 2px auto 0;
    width: 80%;
    overflow: hidden;
    border-radius: 2px;
    background-color: color-mix(in srgb, var(--mud-palette-text-secondary) 20%, transparent);
}

.agenda-riempimento > span {
    display: block;
    height: 100%;
    background-color: var(--sp-mauve, var(--mud-palette-primary));
}

.agenda-riempimento.pieno > span {
    background-color: var(--mud-palette-primary-darken);
}

.agenda-incasso {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--sp-mauve);
    white-space: nowrap;
}

.agenda-cella-mese {
    display: flex;
    align-items: baseline;
    gap: 0.375rem;
}

/* Intestazione del giorno: incasso previsto e note sulla stessa riga del nome, allineati a destra. */
.agenda-intestazione-riga {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.agenda-intestazione-extra {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-inline-start: auto;
    min-height: 1.25rem;
}

/* Note del giorno: un foglietto giallo con il numero delle note aperte, tenue dove non ce ne sono. */
.e-schedule .agenda-note {
    display: inline-flex;
    align-items: center;
    gap: 0.125rem;
    padding: 0 0.25rem;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--mud-palette-text-secondary);
    font: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.25rem;
    cursor: pointer;
}

.e-schedule .agenda-note .mud-icon-root {
    font-size: 1rem;
}

.e-schedule .agenda-note.vuote {
    opacity: 0.35;
}

.e-schedule .agenda-note.vuote:hover,
.e-schedule .agenda-note.vuote:focus-visible {
    opacity: 1;
}

.e-schedule .agenda-note.aperte {
    background-color: #fff3b0;
    color: #6d5800;
}

.e-schedule .agenda-note.fatte {
    color: var(--mud-palette-success);
}

.e-schedule .agenda-note .agenda-note-arretrate {
    color: var(--mud-palette-error);
}

.e-schedule .agenda-note:hover {
    filter: brightness(0.95);
}

/* Nel dialog delle note: le note fatte restano visibili ma barrate. */
.nota-agenda-testo {
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.nota-agenda.fatta .nota-agenda-testo {
    text-decoration: line-through;
    color: var(--mud-palette-text-secondary);
}

/* Nella vista Mese il cerchio di oggi resta sul numero del giorno, non sull'importo accanto. */
.e-schedule .e-month-view .e-date-header:has(.agenda-cella-mese) {
    display: block;
    background: transparent !important;
    color: inherit !important;
    border-radius: 0 !important;
    padding: 0 !important;
    text-align: start;
}

.e-schedule .e-month-view .e-current-date .agenda-cella-mese-giorno {
    display: inline-block;
    min-width: 20px;
    padding: 0 4px;
    border-radius: 50%;
    text-align: center;
    background: var(--color-sf-primary);
    color: var(--color-sf-primary-text-color);
}

/* Su schermi medi l'etichetta del periodo lascia spazio ai pulsanti: il periodo resta nel tooltip del totale. */
@media (max-width: 1439.98px) {
    .agenda-toolbar-incasso-periodo {
        display: none;
    }
}
