/* Stile Non Solo Capelli sopra Easy!Appointments */
:root { --nsc-red: #DE231C; --nsc-black: #0d0d0d; --nsc-grey: #f4f4f4; --nsc-radius: 18px; }
body, .btn, .form-control, .form-select, input, select, textarea, label, .badge { font-family: 'Montserrat', sans-serif !important; }
body { background: var(--nsc-grey) !important; background-image: none !important; color: #222; }

/* cornice */
#book-appointment-wizard { border-radius: var(--nsc-radius); box-shadow: 0 20px 60px rgba(0,0,0,.12) !important; }
#book-appointment-wizard .wizard-frame { padding: 2rem 2.5rem !important; }

/* barra nera con logo */
#book-appointment-wizard #header { background: var(--nsc-black) !important; border: 0 !important; padding: 1.25rem 2rem !important; gap: 1rem; }
#book-appointment-wizard #company-logo { max-height: 46px !important; margin: 0 !important; }
#book-appointment-wizard #company-name { display: flex !important; align-items: center; gap: 1.25rem; flex-wrap: wrap; font-size: 1rem !important; margin: 0 !important; }
#book-appointment-wizard #company-name > span:first-of-type { display: none; } /* il nome è già nel logo */
#book-appointment-wizard #company-name .display-booking-selection { color: #bdbdbd !important; font-size: .8rem; letter-spacing: .03em; }

/* passi */
#book-appointment-wizard #steps { margin: 0 !important; display: flex !important; flex-wrap: nowrap; flex-shrink: 0; }
#book-appointment-wizard .book-step { float: none !important; display: inline-block !important; text-align: center; }
#book-appointment-wizard #service-description:empty { display: none !important; }
#book-appointment-wizard #steps .book-step { width: 34px !important; height: 34px !important; line-height: 34px; padding: 0 !important;
    margin: 0 4px !important; border-radius: 50% !important; background: #2a2a2a !important; transition: background .2s; }
#book-appointment-wizard #steps .book-step strong { color: #9a9a9a !important; font-weight: 600; font-size: .85rem !important; }
#book-appointment-wizard #steps .book-step.active-step { background: var(--nsc-red) !important; }
#book-appointment-wizard #steps .book-step.active-step strong { color: #fff !important; }

/* titoli */
#book-appointment-wizard .frame-title { font-family: 'Great Vibes', cursive !important; color: var(--nsc-red) !important;
    font-size: 2.6rem; font-weight: 400 !important; margin: .5rem 0 1.75rem !important; }

/* campi */
#book-appointment-wizard .form-control, #book-appointment-wizard .form-select {
    border-radius: 12px; border: 1px solid #e2e2e2; padding: .8rem 1rem; font-size: 16px; background-color: #fafafa; }
#book-appointment-wizard .form-control:focus, #book-appointment-wizard .form-select:focus {
    border-color: var(--nsc-black); box-shadow: 0 0 0 3px rgba(0,0,0,.08); background-color: #fff; }
#book-appointment-wizard label { font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: #555; }
#book-appointment-wizard #service-description { border: 0 !important; background: var(--nsc-grey); border-radius: 12px; padding: 1rem !important; }

/* pulsanti */
#book-appointment-wizard .btn { border-radius: 999px !important; padding: .7rem 1.6rem; font-weight: 600; letter-spacing: .02em; }
#book-appointment-wizard .button-next, #book-appointment-wizard #book-appointment-submit {
    background: var(--nsc-red) !important; border-color: var(--nsc-red) !important; color: #fff !important; }
#book-appointment-wizard .button-next:hover, #book-appointment-wizard #book-appointment-submit:hover { background: #b81b15 !important; }
#book-appointment-wizard .button-back { background: transparent !important; color: #333 !important; border: 1px solid #ccc !important; }

/* calendario e orari */
#book-appointment-wizard .flatpickr-calendar { box-shadow: none !important; border: 1px solid #eee; border-radius: 14px; }
#book-appointment-wizard .flatpickr-day.selected { background: var(--nsc-red) !important; border-color: var(--nsc-red) !important; }
/* orari: scuri, in grassetto, pulsanti comodi da toccare; quello scelto nel rosso del salone */
#book-appointment-wizard #available-hours .available-hour {
    border-radius: 12px !important; border: 1.5px solid #d4d4d4 !important; background: #fff;
    color: #161616 !important; font-weight: 600; font-size: 16px; letter-spacing: .02em;
    font-variant-numeric: tabular-nums; transition: border-color .15s, color .15s, background .15s, transform .1s; }
#book-appointment-wizard #available-hours .available-hour:hover { border-color: var(--nsc-red) !important; color: var(--nsc-red) !important; }
#book-appointment-wizard #available-hours .available-hour:active { transform: scale(.97); }
#book-appointment-wizard #available-hours .selected-hour, #book-appointment-wizard #available-hours .selected-hour:hover {
    background: var(--nsc-red) !important; border-color: var(--nsc-red) !important; color: #fff !important;
    box-shadow: 0 4px 14px rgba(222,35,28,.3); }
/* titoletti Mattina / Pomeriggio / Sera (inseriti dallo script in company_color_style.php) */
#book-appointment-wizard #available-hours .nsc-slot-group {
    grid-column: 1 / -1; display: flex; align-items: center; gap: .6rem; margin: .7rem 0 .1rem;
    font-size: .74rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #8a8a8a; }
#book-appointment-wizard #available-hours .nsc-slot-group:first-child { margin-top: 0; }
#book-appointment-wizard #available-hours .nsc-slot-group::after { content: ""; flex: 1; height: 1px; background: #ececec; }

/* orari in griglia, senza fuso orario (il salone è solo a Roma) */
#book-appointment-wizard div:has(> #select-timezone) { display: none !important; }
#book-appointment-wizard #available-hours { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
    gap: 8px; max-height: none !important; height: auto !important; overflow: visible !important; padding: 2px; }
#book-appointment-wizard #available-hours .available-hour { width: auto !important; margin: 0 !important; padding: .75rem 0 !important; }
#book-appointment-wizard .command-buttons .btn { display: inline-flex !important; align-items: center; justify-content: center; gap: .4rem; white-space: nowrap; }
#book-appointment-wizard .command-buttons .btn br { display: none; }

/* piè di pagina */
#frame-footer { background: #fff; color: #999; border-color: #f0f0f0 !important; }
#frame-footer a { color: #777; }
#frame-footer .backend-link { background: var(--nsc-black) !important; border-color: var(--nsc-black) !important; border-radius: 999px; }

/* cellulare */
@media (max-width: 767.98px) {
    #main.container { padding: 0 !important; max-width: 100%; }
    #book-appointment-wizard { border-radius: 0; box-shadow: none !important; min-height: 100vh; }
    #book-appointment-wizard #header { flex-direction: row !important; justify-content: space-between; padding: .9rem 1rem !important;
        position: sticky; top: 0; z-index: 10; }
    #book-appointment-wizard #company-name .display-booking-selection { display: none !important; }
    #book-appointment-wizard #company-logo { max-height: 32px !important; }
    #book-appointment-wizard #steps .book-step { width: 28px !important; height: 28px !important; line-height: 28px; margin: 0 2px !important; }
    #book-appointment-wizard .wizard-frame { padding: 1.25rem 1rem 6rem !important; }
    #book-appointment-wizard .frame-title { font-size: 2.1rem; margin-top: .25rem !important; }
    #book-appointment-wizard .command-buttons { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; padding: .75rem 1rem;
        box-shadow: 0 -6px 20px rgba(0,0,0,.08); display: flex !important; gap: .5rem; z-index: 20; margin: 0 !important; }
    #book-appointment-wizard .command-buttons .btn { flex: 1; margin: 0 !important; min-width: 0 !important; }
    #book-appointment-wizard #available-hours { grid-template-columns: repeat(4, 1fr); }
}

/* ===== sfondo con la foto del salone (login e gestionale) ===== */
/* Solo sulla pagina di login: nel gestionale il calendario deve restare pulito e leggibile */
/* Anche sulla pagina di prenotazione dei clienti (il riquadro bianco resta sopra, leggibile) */
body:has(#login-form), body:has(#book-appointment-wizard) { background-color: #1a1a1a !important; }
body:has(#book-appointment-wizard) #main, body:has(#book-appointment-wizard) .container-fluid { background: transparent !important; }
body:has(#login-form)::before, body:has(#book-appointment-wizard)::before {
    content: ""; position: fixed; inset: -40px; z-index: -1; pointer-events: none;
    background: url(/assets/brand/sfondo.jpg) center / cover no-repeat;
    filter: blur(7px) brightness(.6);
}

/* ===== niente crediti/licenza in fondo alle pagine di uso quotidiano
   (licenza e crediti restano visibili nella pagina "Info" del gestionale) ===== */
#frame-footer .footer-powered-by,      /* pagina di prenotazione */
#message-frame > .mt-2,                /* pagina di conferma */
.nsc-powered,                          /* login */
#footer { display: none !important; }  /* gestionale */
#frame-footer .footer-options { width: 100% !important; text-align: center !important; }

/* ===== login ===== */
.min-vh-mobile.card { border: 0 !important; border-radius: var(--nsc-radius) !important; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.12) !important; }
.nsc-login-brand { background: var(--nsc-black); margin: -3rem -3rem 2rem; padding: 1.75rem 2rem; text-align: center; }
.nsc-login-brand img { height: 52px; max-width: 100%; }
.min-vh-mobile.card h4 { font-family: 'Great Vibes', cursive !important; color: var(--nsc-red) !important; font-size: 2.4rem; font-weight: 400 !important; }
#login-form .form-control { border-radius: 0 12px 12px 0; padding: .75rem 1rem; font-size: 16px; }
#login-form .input-group-text { border-radius: 12px 0 0 12px; }
#login-form .btn-primary, #login-form #login { background: var(--nsc-red) !important; border-color: var(--nsc-red) !important; border-radius: 999px; padding: .75rem; font-weight: 600; }
.nsc-powered { background: #fff !important; color: #aaa; font-size: .85rem; border-top-color: #f0f0f0 !important; }
.nsc-powered a { color: #999; }
@media (max-width: 575.98px) {
    .min-vh-mobile.card { border-radius: 0 !important; box-shadow: none !important; }
    .min-vh-mobile.card .card-body { padding: 2rem 1.25rem !important; }
    .nsc-login-brand { margin: -2rem -1.25rem 1.5rem; }
}

/* ===== gestionale ===== */
nav#header.navbar { background: var(--nsc-black) !important; border: 0 !important; }
nav#header .navbar-brand { padding: .55rem 1rem !important; }
.nsc-backend-logo { height: 34px; width: auto; }
nav#header .nav-item .nav-link { color: #cfcfcf !important; font-weight: 500 !important; border-bottom: 3px solid transparent; }
nav#header .nav-item.active { background: transparent !important; }
nav#header .nav-item.active .nav-link, nav#header .nav-item .nav-link:hover { color: #fff !important; border-bottom-color: var(--nsc-red); background: transparent !important; }
.backend-page .btn { border-radius: 10px; }
.backend-page .btn-primary { background: var(--nsc-red); border-color: var(--nsc-red); }
#calendar-page .fc-event, #calendar .fc-event { border-radius: 8px !important; border: 0 !important; padding: 2px 4px; }
#calendar .fc-day-today, #calendar .fc-col-header-cell.fc-day-today { background: rgba(222,35,28,.05) !important; }
#calendar .nsc-operator { font-weight: 800; }
#footer { background: #fff !important; color: #aaa; }
@media (max-width: 767.98px) {
    nav#header .navbar-collapse { background: var(--nsc-black); }
    nav#header .nav-item { text-align: left !important; }
}

/* pagina di conferma */
#message-frame { border-radius: var(--nsc-radius) !important; box-shadow: 0 20px 60px rgba(0,0,0,.12) !important; overflow: hidden; padding: 0 !important; }
.nsc-confirm { padding: 0 0 2rem; }
.nsc-confirm-logo { display: block; width: 100%; height: 86px; background: var(--nsc-black); padding: 1.25rem 2rem; object-fit: contain; }
.nsc-check { width: 72px; height: 72px; border-radius: 50%; background: rgba(222,35,28,.1); color: var(--nsc-red); display: flex;
    align-items: center; justify-content: center; font-size: 1.9rem; margin: 2rem auto 1rem; }
.nsc-title { font-family: 'Great Vibes', cursive; color: var(--nsc-red); font-size: 2.6rem; font-weight: 400; margin-bottom: 1.5rem; }
.nsc-summary { margin: 0 auto 1.5rem; max-width: 380px; background: var(--nsc-grey); border-radius: 14px; padding: .5rem 1.25rem; text-align: left; }
.nsc-summary div { display: flex; justify-content: space-between; gap: 1rem; padding: .7rem 0; border-bottom: 1px solid #e6e6e6; }
.nsc-summary div:last-child { border-bottom: 0; }
.nsc-summary span { color: #888; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.nsc-summary strong { text-align: right; font-weight: 600; }
.nsc-note { color: #555; padding: 0 1.5rem; }
.nsc-note a { color: var(--nsc-red); font-weight: 600; text-decoration: none; }
.nsc-actions { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; padding: .5rem 1.5rem 0; }
.nsc-actions .btn { border-radius: 999px; padding: .7rem 1.6rem; font-weight: 600; }
.nsc-actions .btn-primary { background: var(--nsc-red); border-color: var(--nsc-red); }
@media (max-width: 767.98px) {
    #main.container { padding: 0 !important; max-width: 100%; }
    #message-frame { border-radius: 0 !important; box-shadow: none !important; min-height: 100vh; }
    .nsc-actions .btn { width: 100%; }
}

/* Foto mandata dal cliente (anteprima nell'agenda e nella scheda appuntamento) */
.nsc-foto-box{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}
.nsc-foto{display:block;width:150px;height:150px;object-fit:cover;border-radius:10px;border:1px solid #ddd;box-shadow:0 4px 12px rgba(0,0,0,.12)}
.nsc-foto:hover{opacity:.9}

/* ===== Prenotazione da telefono: riquadro un po' più stretto, con la foto del salone ai lati ===== */
@media (max-width: 767.98px) {
    body:has(#book-appointment-wizard) #main > .row,
    body:has(#book-appointment-wizard) .wrapper.row { margin-left: 0 !important; margin-right: 0 !important; }
    #book-appointment-wizard {
        flex: 0 0 calc(100% - 28px) !important; width: calc(100% - 28px) !important;
        max-width: calc(100% - 28px) !important; min-width: 0 !important;
        margin: 12px auto 24px !important;
        border-radius: 22px !important; overflow: hidden;
        box-shadow: 0 24px 50px -18px rgba(0,0,0,.7) !important;
    }
    #book-appointment-wizard .wizard-frame { padding-left: 22px !important; padding-right: 22px !important; }
    #book-appointment-wizard #header { padding-left: 18px !important; padding-right: 18px !important; gap: 10px; }
    #book-appointment-wizard #header img { max-height: 30px !important; max-width: 118px !important; width: auto !important; height: auto !important; }
    #book-appointment-wizard #steps .book-step { width: 30px !important; height: 30px !important; margin: 0 2px !important; }
    #book-appointment-wizard #company-name { flex: 0 0 auto !important; width: auto !important; }
    #book-appointment-wizard #steps { margin-left: auto !important; flex: 0 0 auto; width: auto !important; }
    #book-appointment-wizard .wizard-frame .form-control,
    #book-appointment-wizard .wizard-frame .form-select { font-size: 15.5px; }
}

/* ===== Agenda: legenda dei colori per operatore ===== */
.nsc-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin: 4px 0 10px; font-size: 13.5px; font-weight: 600; color: #444; }
.nsc-legend span { display: inline-flex; align-items: center; gap: 6px; }
.nsc-legend i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
#calendar .fc-event, #calendar .fc-event .fc-event-main { color: #fff !important; }

/* ===== Scheda operatore: tasti ruolo (Parrucchiere / Estetista) ===== */
.nsc-role-btn.active { background: var(--nsc-red, #d9363e) !important; border-color: var(--nsc-red, #d9363e) !important; color: #fff !important; }

.nsc-roles { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -4px 0 12px; }
.nsc-roles > span { font-weight: 600; font-size: 14px; }
.nsc-roles .btn { border-radius: 999px !important; padding: 4px 14px; font-weight: 600; }
.nsc-roles small { color: #888; font-size: 12.5px; }

/* ===== Scheda appuntamento: suggerimento cliente dal telefono ===== */
.nsc-phone-hint { margin-top: 8px; font-size: 13.5px; border-radius: 10px; padding: 8px 10px; display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }
.nsc-phone-hint[hidden] { display: none; }
.nsc-phone-hint.found { background: #fff6e8; border: 1px solid #f5dcb0; font-weight: 600; }
.nsc-phone-hint.new { background: #eef9f3; border: 1px solid #c9ecd8; color: #2a6b47; }
.nsc-phone-hint.ok { background: #e8f8f5; border: 1px solid #c6ebe6; color: #0a7f85; font-weight: 600; }
.nsc-phone-hint .btn { border-radius: 999px !important; padding: 2px 12px; }

/* ===== Agenda: riquadro appuntamento (card) — operatore e servizio in evidenza, effetto vetro ===== */
#calendar .fc-timegrid-event { border-radius: 10px !important; border: 1px solid rgba(255,255,255,.4) !important;
    -webkit-backdrop-filter: blur(6px) saturate(140%); backdrop-filter: blur(6px) saturate(140%); overflow: hidden; }
#calendar .fc-timegrid-event .fc-event-main { padding: 0 !important; height: 100%; }
.nsc-card { height: 100%; display: flex; flex-direction: column; justify-content: space-between; gap: 2px;
    padding: 4px 7px 5px; color: #fff; line-height: 1.15; overflow: hidden; text-shadow: 0 1px 1px rgba(0,0,0,.18); }
.nsc-card-head { display: flex; flex-direction: column; min-width: 0; }
.nsc-card-op { font-weight: 800; letter-spacing: .01em; text-transform: uppercase; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* operatore in un'etichetta: riquadro bianco, nome nel colore dell'operatore (si legge a colpo d'occhio) */
html:not(.pv-ristorante) .nsc-card-op { align-self: flex-start; max-width: 100%; background: rgba(255,255,255,.95);
    color: var(--nsc-op, #1d1f24); text-shadow: none; border-radius: 6px; padding: 1px 7px 2px; margin-bottom: 2px;
    box-shadow: 0 1px 2px rgba(0,0,0,.15); line-height: 1.2; }
html:not(.pv-ristorante) .nsc-card.nsc-s .nsc-card-op { padding: 0 5px; margin: 0; border-radius: 4px; flex: none; }
html:not(.pv-ristorante) .nsc-card.nsc-xl .nsc-card-op { padding: 2px 9px 3px; border-radius: 8px; }
.nsc-card-svc { font-weight: 600; font-size: 12.5px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.nsc-card-foot { display: flex; flex-wrap: wrap; gap: 0 6px; align-items: baseline; font-size: 11px; opacity: .9; min-width: 0; }
.nsc-card-time { font-weight: 700; white-space: nowrap; }
.nsc-card-cli { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1 1 auto; }
.nsc-card-cli::before { content: "👤 "; opacity: .85; }
/* poco spazio: una riga sola "OPERATORE · servizio" */
.nsc-card.nsc-s { flex-direction: row; align-items: center; padding: 1px 6px; }
.nsc-card.nsc-s .nsc-card-head { flex-direction: row; gap: 5px; align-items: baseline; white-space: nowrap; overflow: hidden; }
.nsc-card.nsc-s .nsc-card-op { font-size: 11.5px; }
.nsc-card.nsc-s .nsc-card-svc { font-size: 11px; display: block; white-space: nowrap; text-overflow: ellipsis; }
.nsc-card.nsc-s .nsc-card-svc::before { content: "· "; }
.nsc-card.nsc-s .nsc-card-foot { display: none; }
/* medio: operatore + servizio su 1 riga, sotto orario */
.nsc-card.nsc-m { justify-content: center; }
.nsc-card.nsc-m .nsc-card-svc { -webkit-line-clamp: 1; }
.nsc-card.nsc-m .nsc-card-foot { display: none; }
/* grande e molto grande: scritte più grandi */
.nsc-card.nsc-l .nsc-card-op { font-size: 14.5px; }
.nsc-card.nsc-l .nsc-card-svc { font-size: 13.5px; }
.nsc-card.nsc-l .nsc-card-foot { font-size: 12px; }
.nsc-card.nsc-xl { padding: 8px 10px; }
.nsc-card.nsc-xl .nsc-card-op { font-size: 17px; }
.nsc-card.nsc-xl .nsc-card-svc { font-size: 15px; -webkit-line-clamp: 3; margin-top: 2px; }
.nsc-card.nsc-xl .nsc-card-foot { font-size: 13px; flex-direction: column; align-items: flex-start; gap: 2px; }

/* SALONE-RIGA: operatore a sinistra, servizio a destra sulla stessa riga; orario e cliente sempre visibili */
html:not(.pv-ristorante) .nsc-card-head { flex-direction: row; flex-wrap: wrap; align-items: flex-start; gap: 0 6px; }
html:not(.pv-ristorante) .nsc-card-op { flex: none; }
html:not(.pv-ristorante) .nsc-card-svc { flex: 1 1 90px; text-align: right; min-width: 0; }
html:not(.pv-ristorante) .nsc-card.nsc-m .nsc-card-head { flex-wrap: nowrap; }
html:not(.pv-ristorante) .nsc-card.nsc-m .nsc-card-svc { display: block; white-space: nowrap; text-overflow: ellipsis; }
html:not(.pv-ristorante) .nsc-card.nsc-m .nsc-card-foot { display: flex; flex-wrap: nowrap; }
/* piccolo: tutto su una riga "OPERATORE 11:00 - 11:30 👤 Cliente ......... servizio" */
html:not(.pv-ristorante) .nsc-card.nsc-s .nsc-card-head { display: contents; }
html:not(.pv-ristorante) .nsc-card.nsc-s { gap: 6px; white-space: nowrap; }
html:not(.pv-ristorante) .nsc-card.nsc-s .nsc-card-op { order: 1; }
html:not(.pv-ristorante) .nsc-card.nsc-s .nsc-card-foot { display: flex; flex-wrap: nowrap; order: 2; flex: 0 1 auto; overflow: hidden; }
html:not(.pv-ristorante) .nsc-card.nsc-s .nsc-card-svc { order: 3; flex: 0 1 auto; }
html:not(.pv-ristorante) .nsc-card.nsc-s .nsc-card-svc::before { content: none; }

/* SALONE-ORARIO: sotto l'operatore l'orario in grande, poi il cliente a sinistra */
html:not(.pv-ristorante) .nsc-card { justify-content: flex-start; gap: 3px; }
html:not(.pv-ristorante) .nsc-card-foot { flex-direction: column; align-items: flex-start; gap: 1px; opacity: 1; }
html:not(.pv-ristorante) .nsc-card-time { font-size: 14px; font-weight: 800; letter-spacing: .01em; }
html:not(.pv-ristorante) .nsc-card-cli { flex: none; max-width: 100%; font-size: 12px; font-weight: 600; opacity: .95; }
html:not(.pv-ristorante) .nsc-card.nsc-l .nsc-card-time { font-size: 15.5px; }
html:not(.pv-ristorante) .nsc-card.nsc-l .nsc-card-cli { font-size: 12.5px; }
html:not(.pv-ristorante) .nsc-card.nsc-xl .nsc-card-time { font-size: 19px; }
html:not(.pv-ristorante) .nsc-card.nsc-xl .nsc-card-cli { font-size: 14px; }
/* medio: orario (grande) e cliente sulla stessa riga; piccolo: tutto su una riga */
/* medio (circa un'ora in agenda, ~48px): tre righe compatte operatore / orario / cliente */
html:not(.pv-ristorante) .nsc-card.nsc-m { gap: 1px; padding: 2px 7px; justify-content: center; }
html:not(.pv-ristorante) .nsc-card.nsc-m .nsc-card-op { margin-bottom: 0; font-size: 11.5px; padding: 0 6px; line-height: 1.3; }
html:not(.pv-ristorante) .nsc-card.nsc-m .nsc-card-svc { font-size: 11.5px; line-height: 1.3; }
html:not(.pv-ristorante) .nsc-card.nsc-m .nsc-card-foot { gap: 0; }
html:not(.pv-ristorante) .nsc-card.nsc-m .nsc-card-time { line-height: 1.1; }
html:not(.pv-ristorante) .nsc-card.nsc-m .nsc-card-cli { font-size: 11.5px; line-height: 1.15; }
html:not(.pv-ristorante) .nsc-card.nsc-m.nsc-basso .nsc-card-foot,
html:not(.pv-ristorante) .nsc-card.nsc-s .nsc-card-foot { flex-direction: row; align-items: baseline; gap: 0 7px; }
html:not(.pv-ristorante) .nsc-card.nsc-m .nsc-card-time { font-size: 13px; }
html:not(.pv-ristorante) .nsc-card.nsc-m .nsc-card-cli { flex: 0 1 auto; min-width: 0; }
html:not(.pv-ristorante) .nsc-card.nsc-s .nsc-card-time { font-size: 11.5px; }
html:not(.pv-ristorante) .nsc-card.nsc-s .nsc-card-cli { flex: 0 1 auto; min-width: 0; font-size: 11px; }

/* VETRO: scheda più trasparente, riflesso di luce in alto e bordo luminoso */
#calendar .fc-timegrid-event { border-radius: 12px !important; border: 1px solid rgba(255,255,255,.55) !important; }
#calendar .fc-timegrid-event::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 0;
    background: linear-gradient(180deg, rgba(255,255,255,.30) 0%, rgba(255,255,255,.08) 34%, rgba(255,255,255,0) 58%),
                radial-gradient(130% 70% at 0% 0%, rgba(255,255,255,.22), transparent 60%); }
#calendar .fc-timegrid-event .nsc-card { z-index: 1; text-shadow: 0 1px 2px rgba(0,0,0,.22); }

/* STRETTE: appuntamenti contemporanei affiancati (due = stretta, tre o più = strettissima).
   Niente tagli con i puntini: le scritte diventano più piccole e vanno a capo. */
html:not(.pv-ristorante) .nsc-card.nsc-stretta .nsc-card-op { font-size: 11px; padding: 0 5px; max-width: 100%; }
html:not(.pv-ristorante) .nsc-card.nsc-stretta:not(.nsc-basso) .nsc-card-time { font-size: 13px; white-space: normal; }
html:not(.pv-ristorante) .nsc-card.nsc-stretta .nsc-card-svc { font-size: 11.5px; }
html:not(.pv-ristorante) .nsc-card.nsc-stretta:not(.nsc-basso) .nsc-card-cli { font-size: 12px; white-space: normal;
    overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; padding: 0 16px 0 2px; }
html:not(.pv-ristorante) .nsc-card.nsc-strettissima { padding: 3px 5px; }
html:not(.pv-ristorante) .nsc-card.nsc-strettissima .nsc-card-op { font-size: 10px; padding: 0 4px; letter-spacing: 0; }
html:not(.pv-ristorante) .nsc-card.nsc-strettissima:not(.nsc-basso) .nsc-card-time { font-size: 12px; }
html:not(.pv-ristorante) .nsc-card.nsc-strettissima .nsc-card-svc { font-size: 11px; text-align: left; flex-basis: 100%; }
html:not(.pv-ristorante) .nsc-card.nsc-strettissima:not(.nsc-basso) .nsc-card-cli { font-size: 11.5px; }
html:not(.pv-ristorante) .nsc-card.nsc-m.nsc-basso.nsc-stretta.nsc-strettissima .nsc-t2 { display: none; }
html:not(.pv-ristorante) .nsc-card.nsc-m.nsc-basso.nsc-stretta.nsc-strettissima .nsc-card-cli { font-size: 11px; padding: 0 14px 0 0; }

/* strette: il cliente occupa tutta la larghezza (va a capo), lo stato è solo il puntino */
html:not(.pv-ristorante) .nsc-card.nsc-stretta:not(.nsc-basso) .nsc-card-cli { padding: 0 2px; }
html:not(.pv-ristorante) .nsc-card.nsc-stretta .nsc-card-cli::before { content: none; }
html:not(.pv-ristorante) .nsc-card.nsc-stretta.nsc-con-stato:not(.nsc-basso) .nsc-card-cli { padding-right: 16px; }
html:not(.pv-ristorante) .nsc-card.nsc-strettissima { padding: 3px 4px; }
html:not(.pv-ristorante) .nsc-card.nsc-strettissima .nsc-card-op { font-size: 9.5px; padding: 0 3px; }
html:not(.pv-ristorante) .nsc-card.nsc-m.nsc-basso.nsc-stretta.nsc-strettissima { column-gap: 3px; padding-left: 3px; padding-right: 3px; }
html:not(.pv-ristorante) .nsc-card.nsc-m.nsc-basso.nsc-stretta.nsc-strettissima .nsc-card-time { font-size: 10.5px; overflow: visible; }
html:not(.pv-ristorante) .nsc-card.nsc-m.nsc-basso.nsc-stretta.nsc-strettissima .nsc-card-op { font-size: 9px; padding: 0 3px; }
html:not(.pv-ristorante) .nsc-card.nsc-strettissima:not(.nsc-basso) .nsc-card-cli { font-size: 11px; }

/* SPOSTAMENTI: capsula in vetro nell'angolo in basso della scheda, con un puntino luminoso del colore dello stato
   (arancione in attesa del cliente, verde confermato, rosso non può, ambra da chiamare) */
.nsc-card { position: relative; }
.nsc-card-st { position: absolute; right: 5px; bottom: 5px; z-index: 1; display: inline-flex; align-items: center; gap: 5px;
    padding: 2px 8px 2px 3px; border-radius: 999px; font-size: 10.5px; font-weight: 700; letter-spacing: .01em;
    line-height: 1.5; color: #fff; text-shadow: 0 1px 1px rgba(0,0,0,.25); white-space: nowrap;
    background: linear-gradient(135deg, rgba(255,255,255,.34), rgba(255,255,255,.14));
    border: 1px solid rgba(255,255,255,.55);
    -webkit-backdrop-filter: blur(10px) saturate(160%); backdrop-filter: blur(10px) saturate(160%);
    box-shadow: 0 4px 12px -4px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.6); }
.nsc-card-st b { font-weight: 700; }
.nsc-dot { --c: #f59e0b; flex: none; width: 15px; height: 15px; border-radius: 50%; display: inline-flex;
    align-items: center; justify-content: center; font-style: normal; font-size: 9px; font-weight: 900; color: #fff;
    text-shadow: none; background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.55), transparent 55%), var(--c);
    box-shadow: 0 0 0 1px rgba(255,255,255,.7), 0 0 8px 1px var(--c); }
.attesa .nsc-dot { --c: #f59e0b; animation: nsc-respiro 1.8s ease-in-out infinite; }
.ok .nsc-dot { --c: #10b981; }
.no .nsc-dot { --c: #ef4444; }
.chiama .nsc-dot { --c: #f59e0b; }
@keyframes nsc-respiro { 50% { box-shadow: 0 0 0 1px rgba(255,255,255,.7), 0 0 14px 4px var(--c); } }
.nsc-con-stato .nsc-card-foot { padding-right: 24px; }
/* scheda grande ma non enorme: solo il puntino in basso a destra (la parola solo nelle schede molto grandi) */
.nsc-card.nsc-l .nsc-card-st { padding: 2px; }
.nsc-card.nsc-l .nsc-card-st b { display: none; }
/* schede piccole e medie: solo il puntino, a destra al centro (la parola resta nel suggerimento al passaggio del mouse) */
.nsc-card.nsc-s .nsc-card-st, .nsc-card.nsc-m .nsc-card-st { padding: 2px; bottom: auto; top: 50%; transform: translateY(-50%); }
.nsc-card.nsc-s .nsc-card-st b, .nsc-card.nsc-m .nsc-card-st b { display: none; }
.nsc-card.nsc-s .nsc-dot { width: 12px; height: 12px; font-size: 8px; }
.nsc-card.nsc-s.nsc-con-stato { padding-right: 24px; }
.nsc-card.nsc-m .nsc-card-st { top: auto; bottom: 4px; transform: none; }
.nsc-card.nsc-m.nsc-con-stato { padding-right: 7px; }
.nsc-card.nsc-m.nsc-con-stato .nsc-card-foot { padding-right: 22px; }
.nsc-card.nsc-s.nsc-con-stato .nsc-card-foot { padding-right: 0; }
/* scheda stretta (appuntamenti contemporanei affiancati) da mezz'ora: sopra operatore e orario, sotto il cliente;
   il servizio si legge passando il mouse */
html:not(.pv-ristorante) .nsc-card.nsc-m.nsc-basso.nsc-stretta { grid-template-columns: max-content minmax(0, 1fr); column-gap: 5px; }
html:not(.pv-ristorante) .nsc-card.nsc-m.nsc-basso.nsc-stretta .nsc-card-svc { display: none; }
html:not(.pv-ristorante) .nsc-card.nsc-m.nsc-basso.nsc-stretta .nsc-card-time { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html:not(.pv-ristorante) .nsc-card.nsc-m.nsc-basso.nsc-stretta .nsc-card-op { font-size: 10.5px; padding: 0 5px; }
/* schede grandi: il cliente al centro dello spazio sotto l'orario, staccato da esso */
html:not(.pv-ristorante) .nsc-card.nsc-l .nsc-card-foot,
html:not(.pv-ristorante) .nsc-card.nsc-xl .nsc-card-foot { flex: 1 1 auto; align-items: stretch; }
html:not(.pv-ristorante) .nsc-card.nsc-l .nsc-card-cli,
html:not(.pv-ristorante) .nsc-card.nsc-xl .nsc-card-cli { margin: auto 0; text-align: center; padding: 0 18px; }
html:not(.pv-ristorante) .nsc-card.nsc-l .nsc-card-cli { font-size: 14px; }
html:not(.pv-ristorante) .nsc-card.nsc-xl .nsc-card-cli { font-size: 16px; }
/* mezz'ora (scheda bassa): due righe -> "OPERATORE  10:00 - 10:30 ....... servizio" e sotto il cliente */
html:not(.pv-ristorante) .nsc-card.nsc-m.nsc-basso { display: grid; grid-template-columns: max-content max-content minmax(0, 1fr); align-content: center;
    column-gap: 7px; row-gap: 1px; }
html:not(.pv-ristorante) .nsc-card.nsc-m.nsc-basso .nsc-card-head,
html:not(.pv-ristorante) .nsc-card.nsc-m.nsc-basso .nsc-card-foot { display: contents; }
html:not(.pv-ristorante) .nsc-card.nsc-m.nsc-basso .nsc-card-op { grid-column: 1; grid-row: 1; align-self: center; }
html:not(.pv-ristorante) .nsc-card.nsc-m.nsc-basso .nsc-card-time { grid-column: 2; grid-row: 1; align-self: center; }
html:not(.pv-ristorante) .nsc-card.nsc-m.nsc-basso .nsc-card-svc { grid-column: 3; grid-row: 1; align-self: center; }
html:not(.pv-ristorante) .nsc-card.nsc-m.nsc-basso .nsc-card-cli { grid-column: 1 / -1; grid-row: 2; padding: 0 20px; text-align: center; font-size: 12px; }
.nsc-card.nsc-xl .nsc-card-st { font-size: 12px; right: 8px; bottom: 8px; padding: 3px 10px 3px 4px; }
.nsc-card.nsc-xl .nsc-dot { width: 18px; height: 18px; font-size: 11px; }
.nsc-card.nsc-xl.nsc-con-stato .nsc-card-foot { padding-right: 0; padding-bottom: 26px; }

/* ===== Riquadro dell'appuntamento (cliccando la scheda): vetro smerigliato ===== */
.popover.nsc-pop-glass { --bs-popover-bg: transparent; border: 1px solid rgba(255,255,255,.7); border-radius: 18px;
    background: linear-gradient(160deg, rgba(255,255,255,.86), rgba(255,255,255,.72));
    -webkit-backdrop-filter: blur(22px) saturate(170%); backdrop-filter: blur(22px) saturate(170%);
    box-shadow: 0 24px 48px -16px rgba(15,23,42,.45), 0 2px 6px rgba(15,23,42,.08), inset 0 1px 0 rgba(255,255,255,.9);
    min-width: 290px; max-width: 340px; overflow: hidden; }
.popover.nsc-pop-glass .popover-arrow { display: none; }
.popover.nsc-pop-glass .popover-header { display: none; }
.popover.nsc-pop-glass .popover-body { padding: 16px 16px 14px; color: #1f2430; }
.nsc-pop { --nsc-op: #4b5563; display: flex; flex-direction: column; gap: 10px; }
.nsc-pop-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.nsc-pop-cli { font-size: 18px; font-weight: 800; line-height: 1.2; letter-spacing: -.01em; }
.nsc-pop-st { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 4px; border-radius: 999px;
    font-size: 11.5px; font-weight: 700; white-space: nowrap; color: #374151;
    background: rgba(255,255,255,.65); border: 1px solid rgba(15,23,42,.08); box-shadow: 0 2px 6px -2px rgba(15,23,42,.15); }
.nsc-pop-st .nsc-dot { width: 12px; height: 12px; }
.nsc-pop-st.ok { color: #047857; } .nsc-pop-st.no { color: #b91c1c; } .nsc-pop-st.attesa, .nsc-pop-st.chiama { color: #b45309; }
.nsc-pop-sub { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; margin-top: -4px; }
.nsc-pop-svc { font-size: 14.5px; font-weight: 600; color: #374151; }
.nsc-pop-op { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; color: var(--nsc-op);
    background: color-mix(in srgb, var(--nsc-op) 12%, white); border: 1px solid color-mix(in srgb, var(--nsc-op) 30%, white);
    border-radius: 7px; padding: 1px 8px; }
.nsc-pop-when { display: flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 600; color: #4b5563;
    background: rgba(255,255,255,.55); border: 1px solid rgba(15,23,42,.06); border-radius: 10px; padding: 7px 10px; }
.nsc-pop-when svg { width: 16px; height: 16px; fill: currentColor; opacity: .7; flex: none; }
.nsc-pop-contatti { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 8px; }
.nsc-pop-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 9px 4px 8px; border-radius: 12px;
    font-size: 12px; font-weight: 700; text-decoration: none !important; color: var(--c) !important;
    background: linear-gradient(160deg, rgba(255,255,255,.9), rgba(255,255,255,.55));
    border: 1px solid color-mix(in srgb, var(--c) 22%, white);
    box-shadow: 0 6px 14px -8px color-mix(in srgb, var(--c) 70%, transparent), inset 0 1px 0 #fff;
    transition: transform .12s ease, box-shadow .12s ease; }
.nsc-pop-btn svg { width: 20px; height: 20px; fill: currentColor; }
.nsc-pop-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 18px -8px color-mix(in srgb, var(--c) 80%, transparent), inset 0 1px 0 #fff; }
.nsc-pop-btn.tel { --c: #4f46e5; } .nsc-pop-btn.wa { --c: #16a34a; } .nsc-pop-btn.mail { --c: #475569; }
.nsc-pop-recapiti { font-size: 12px; color: #6b7280; text-align: center; margin-top: -4px; word-break: break-all; }
.nsc-pop-link { font-size: 13px; font-weight: 600; }
.nsc-pop-note { font-size: 13px; color: #4b5563; white-space: pre-line; background: rgba(255,255,255,.5);
    border-left: 3px solid color-mix(in srgb, var(--nsc-op) 55%, white); border-radius: 6px; padding: 6px 9px; }
.nsc-pop .d-flex { margin-top: 2px; padding-top: 10px; border-top: 1px solid rgba(15,23,42,.08); gap: 6px; }
.nsc-pop .d-flex .btn { border-radius: 10px; font-size: 13px; font-weight: 600; flex: 1 1 0; margin: 0 !important;
    display: inline-flex; align-items: center; justify-content: center; gap: 5px; white-space: nowrap; padding: 6px 8px; }
.nsc-pop .d-flex .btn svg, .nsc-pop .d-flex .btn i { margin: 0 !important; flex: none; }
.popover.nsc-pop-glass { min-width: 320px; }

/* ===== Versione ristorante ===== */
.pv-ristorante .pv-hide-provider { display: none !important; }   /* i tavoli li sceglie il sistema */
.pv-ristorante .nsc-card-op { text-transform: none; }            /* "4 persone" */

/* RISTORANTE-EXTRA */
/* riquadro in agenda: numero del tavolo e icone delle richieste */
.nsc-card-tav { align-self: flex-start; background: rgba(255,255,255,.94); color: #1d1f24; font-weight: 800; font-size: 12px;
  border-radius: 7px; padding: 0 6px; line-height: 1.5; margin-bottom: 2px; white-space: nowrap; }
.nsc-card.nsc-s .nsc-card-tav { margin: 0; font-size: 11px; }
.nsc-card.nsc-xl .nsc-card-tav { font-size: 15px; padding: 1px 8px; }
.nsc-card-req { font-size: 13px; letter-spacing: .04em; white-space: nowrap; }
.nsc-card.nsc-xl .nsc-card-req { font-size: 16px; margin-top: 2px; }

/* tasti delle richieste (pagina di prenotazione e scheda del gestionale) */
.nsc-req { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 8px; }
.nsc-req-btn { border: 1.5px solid #d5d8de; background: #fff; color: #1d1f24; border-radius: 999px; padding: 6px 13px;
  font-size: 14px; font-weight: 600; cursor: pointer; line-height: 1.2; transition: background .15s, border-color .15s; }
.nsc-req-btn:hover { border-color: var(--bs-primary, #0e9fa6); }
.nsc-req-btn.active { background: var(--bs-primary, #0e9fa6); border-color: var(--bs-primary, #0e9fa6); color: #fff; }

/* lista della serata */
.nsc-serata-btn { margin: 0 0 10px; font-weight: 600; }
.nsc-serata { position: fixed; inset: 0; z-index: 2000; background: #fff; overflow: auto; color: #1d1f24; }
html.nsc-serata-open { overflow: hidden; }
.nsc-serata-bar { position: sticky; top: 0; background: #fff; display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  padding: 14px 22px; border-bottom: 1px solid #e3e5e9; z-index: 1; }
.nsc-serata-bar h2 { font-size: 20px; font-weight: 800; margin: 0 auto 0 0; }
.nsc-serata-bar input[type=date] { width: auto; }
.nsc-serata-turni { display: flex; gap: 6px; }
.nsc-serata-turni .active { background: var(--bs-primary, #0e9fa6); color: #fff; }
.nsc-serata-body { padding: 8px 22px 40px; }
.nsc-serata-h { font-size: 18px; font-weight: 800; margin: 22px 0 10px; }
.nsc-serata-empty { color: #777; }
.nsc-serata-full { margin-left: 10px; font-size: 13px; background: #b5462a; color: #fff; border-radius: 999px; padding: 2px 10px; vertical-align: middle; }
.nsc-serata-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.nsc-serata-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: #666;
  border-bottom: 2px solid #1d1f24; padding: 6px 8px; }
.nsc-serata-table td { border-bottom: 1px solid #e3e5e9; padding: 9px 8px; vertical-align: top; }
.nsc-s-ora { font-weight: 800; white-space: nowrap; }
.nsc-s-pp { font-weight: 800; font-size: 18px; text-align: center; }
.nsc-s-nome { font-weight: 600; }
.nsc-s-tel { white-space: nowrap; }
.nsc-s-tav { font-weight: 800; font-size: 18px; min-width: 70px; }
.nsc-s-tav.vuoto::after { content: "____"; color: #bbb; font-weight: 400; }
.nsc-s-req b { display: block; }
.nsc-s-req div { white-space: pre-line; color: #444; }
.nsc-s-wa { color: #1a8f4c; font-weight: 600; }
@media (max-width: 700px) {
  .nsc-serata-bar, .nsc-serata-body { padding-left: 12px; padding-right: 12px; }
  .nsc-serata-table th:nth-child(4), .nsc-serata-table td:nth-child(4) { display: none; }
}
@media print {
  html.nsc-serata-open body > *:not(.nsc-serata) { display: none !important; }
  .nsc-serata { position: static; overflow: visible; }
  .nsc-serata-bar { position: static; border: 0; padding: 0 0 6px; }
  .nsc-serata-bar > *:not(h2) { display: none !important; }
  .nsc-serata-body { padding: 0; }
  .nsc-serata-table { font-size: 12.5px; }
  .nsc-serata-table tr { break-inside: avoid; }
}

/* MOBILE-GESTIONALE */
/* "Oggi" invece di "Giorno" sul tasto che riporta alla data di oggi (in tutte le misure) */
#calendar .fc-today-button { font-size: 0 !important; padding: 6px 14px !important; }
#calendar .fc-today-button::after { content: "Oggi"; font-size: 1rem; }

@media (max-width: 767.98px) {
  /* barra scura: filtro e tasti su una riga */
  #calendar-page #calendar-toolbar { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; padding: 8px 4px !important; margin-bottom: 8px !important; }
  #calendar-page #calendar-filter { flex: 1 1 auto; min-width: 0; width: auto; padding-right: 0; }
  #calendar-page #select-filter-item { margin: 0 !important; height: 42px; font-size: 15px; padding-top: 6px; padding-bottom: 6px; border-radius: 12px; }
  #calendar-page #calendar-actions { flex: 0 0 auto; width: auto; display: flex; gap: 6px; padding-left: 0; }
  #calendar-page #calendar-actions > .btn, #calendar-page #calendar-actions > .btn-group > .btn { width: 42px; height: 42px; padding: 0; margin: 0 !important;
    border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; }
  #calendar-page #calendar-actions .btn-group > .btn + .btn { width: 26px; }
  #calendar-page #calendar-actions [hidden] { display: none !important; }
  /* vista a colonne: sul telefono non serve (si filtra per operatore dal menu) */
  #calendar-page #calendar-actions a[href*="view=table"] { display: none !important; }

  /* legenda su una riga che scorre */
  .nsc-legend { flex-wrap: nowrap; overflow-x: auto; gap: 14px; font-size: 12.5px; margin: 0 0 6px; padding-bottom: 2px; scrollbar-width: none; white-space: nowrap; }
  .nsc-legend::-webkit-scrollbar { display: none; }

  /* intestazione del calendario: data a sinistra, sotto i tasti piccoli */
  #calendar .fc-header-toolbar { display: flex; flex-wrap: wrap; gap: 6px 8px; margin-bottom: 8px !important; }
  #calendar .fc-header-toolbar .fc-toolbar-chunk:nth-child(2) { order: -1; flex: 1 0 100%; }
  #calendar .fc-toolbar-title { font-size: 19px !important; text-align: left; margin: 0; text-transform: capitalize; }
  #calendar .fc-header-toolbar .fc-toolbar-chunk:first-child { display: flex; gap: 6px; }
  #calendar .fc-header-toolbar .fc-toolbar-chunk:last-child { margin-left: auto; }
  #calendar .fc-header-toolbar .fc-toolbar-chunk:first-child, #calendar .fc-header-toolbar .fc-toolbar-chunk:last-child { flex: 0 0 auto; }
  #calendar .fc-button:not(.fc-today-button):not(.fc-timeGridWeek-button) { font-size: 13.5px !important; }
  #calendar .fc-button { padding: 7px 9px !important; line-height: 1.2; }
  #calendar .fc-today-button { margin-left: 0 !important; }
  #calendar .fc-today-button::after { font-size: 13.5px; }
  #calendar .fc-timeGridWeek-button { font-size: 0 !important; }
  #calendar .fc-timeGridWeek-button::after { content: "Sett."; font-size: 13.5px; }
  #calendar .fc-prev-button, #calendar .fc-next-button { padding: 7px 12px !important; }

  /* vista giorno: niente riga con il nome del giorno (è già nel titolo) e niente "Tutto il giorno" se vuoto */
  #calendar .fc-timeGridDay-view .fc-scrollgrid-section-header { display: none; }
  #calendar .fc-timegrid .fc-scrollgrid-section:has(.fc-daygrid-body):not(:has(.fc-daygrid-event)) { display: none; }
  #calendar .fc-timegrid .fc-scrollgrid-section:has(.fc-timegrid-divider) { display: none; }
  #calendar .fc-timegrid-slot-label-cushion { font-size: 12px; padding: 0 4px; }
  #calendar .fc-timegrid-event .nsc-card { padding: 4px 8px; }

  /* dettagli dell'appuntamento: pannello che sale dal basso, a tutta larghezza */
  .popover { position: fixed !important; inset: auto 8px 8px 8px !important; transform: none !important; max-width: none !important;
    border-radius: 18px !important; box-shadow: 0 -10px 40px rgba(0,0,0,.28) !important; max-height: 75vh; overflow: auto; z-index: 1080; }
  .popover .popover-arrow { display: none !important; }
  .popover .popover-header { font-size: 16px; font-weight: 700; padding: 14px 16px 6px; border: 0; background: transparent; }
  .popover .popover-body { padding: 6px 16px 14px; font-size: 15px; }
  .popover .popover-body strong { min-width: 86px; }
  .popover .popover-body .d-flex { flex-wrap: wrap; gap: 8px; }
  .popover .popover-body .d-flex { flex-wrap: nowrap; }
  .popover .popover-body .d-flex .btn { flex: 1 1 0; margin: 0 !important; padding: 10px 6px; font-size: 14px; white-space: nowrap;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
  .popover .popover-body .d-flex .btn svg { margin: 0 !important; }

  /* scheda appuntamento a tutto schermo, tasti sempre visibili in fondo */
  #appointments-modal .modal-dialog { margin: 0; max-width: none; min-height: 100%; }
  #appointments-modal .modal-content { border-radius: 0; min-height: 100vh; }
  #appointments-modal .modal-footer { position: sticky; bottom: 0; background: #fff; z-index: 2; box-shadow: 0 -6px 16px rgba(0,0,0,.08); }
}

/* vista settimana/mese: il giorno in alto si tocca per aprirlo */
#calendar a.fc-col-header-cell-cushion[data-navlink], #calendar a.fc-daygrid-day-number[data-navlink] { cursor: pointer; text-decoration: none; color: inherit; }
#calendar .fc-col-header-cell:has(a[data-navlink]):hover { background: rgba(0,0,0,.05); }
#calendar a.fc-col-header-cell-cushion[data-navlink] { display: block; padding: 6px 2px; }
#calendar a.fc-col-header-cell-cushion[data-navlink]::after { content: " ›"; opacity: .45; }
@media (max-width: 767.98px) {
  #calendar a.fc-col-header-cell-cushion[data-navlink]::after { content: none; }
  #calendar a.fc-col-header-cell-cushion[data-navlink] { font-size: 13px; line-height: 1.25; padding: 6px 0; text-decoration: underline dotted; text-underline-offset: 3px; }
}

/* schede strette: la capsula di stato diventa solo il puntino (la parola non ci sta) */
.nsc-card.nsc-stretta .nsc-card-st { padding: 2px; right: 4px; bottom: 4px; }
.nsc-card.nsc-stretta .nsc-card-st b { display: none; }
.nsc-card.nsc-stretta.nsc-xl.nsc-con-stato .nsc-card-foot { padding-bottom: 0; }

/* ===== VARIAZIONI: bollini accanto alla data del calendario + tendina con elenco e storico ===== */
#calendar .fc-toolbar-chunk:has(> .nsc-var) { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px 12px; }
.nsc-var { display: inline-flex; align-items: center; gap: 6px; vertical-align: middle; }
.nsc-var:empty { display: none; }
.nsc-var-b { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px 0 7px; border-radius: 999px;
    font-family: inherit; font-size: 12.5px; font-weight: 600; line-height: 1; color: #374151; cursor: pointer; white-space: nowrap;
    background: linear-gradient(160deg, rgba(255,255,255,.92), rgba(255,255,255,.7));
    border: 1px solid rgba(15,23,42,.1); box-shadow: 0 4px 12px -6px rgba(15,23,42,.35), inset 0 1px 0 rgba(255,255,255,.9);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); transition: transform .12s, box-shadow .12s; }
.nsc-var-b:hover { transform: translateY(-1px); box-shadow: 0 8px 18px -8px rgba(15,23,42,.45), inset 0 1px 0 #fff; }
.nsc-var-b b { font-size: 14px; font-weight: 800; }
.nsc-var-b .nsc-dot { width: 11px; height: 11px; }
.nsc-var-b.no { color: #b91c1c; border-color: rgba(239,68,68,.35); }
.nsc-var-b.attesa { color: #b45309; border-color: rgba(245,158,11,.4); }
.nsc-var-b.nov { color: #1d4ed8; border-color: rgba(59,130,246,.35); }
.nsc-var-b.nov .nsc-dot { --c: #3b82f6; }
.nsc-var-b.storico { width: 30px; padding: 0; justify-content: center; color: #6b7280; }
.nsc-var-b.storico svg { width: 17px; height: 17px; fill: currentColor; }

.nsc-var-panel { position: fixed; z-index: 1080; max-height: min(70vh, 560px); display: flex; flex-direction: column;
    border-radius: 18px; overflow: hidden; color: #1f2430; border: 1px solid rgba(255,255,255,.7);
    background: linear-gradient(160deg, rgba(255,255,255,.93), rgba(255,255,255,.8));
    -webkit-backdrop-filter: blur(22px) saturate(170%); backdrop-filter: blur(22px) saturate(170%);
    box-shadow: 0 24px 48px -16px rgba(15,23,42,.45), 0 2px 6px rgba(15,23,42,.08), inset 0 1px 0 rgba(255,255,255,.9); }
.nsc-var-panel[hidden] { display: none; }
.nsc-var-tabs { display: flex; align-items: center; gap: 4px; padding: 8px 8px 6px; border-bottom: 1px solid rgba(15,23,42,.08); }
.nsc-var-tabs [role=tab] { border: 0; background: transparent; border-radius: 999px; padding: 7px 12px; font-size: 13.5px; font-weight: 700; color: #6b7280; cursor: pointer; }
.nsc-var-tabs [role=tab].on { background: rgba(15,23,42,.07); color: #111827; }
.nsc-var-tabs [role=tab] b { display: inline-block; min-width: 20px; padding: 1px 6px; margin-left: 3px; border-radius: 999px; background: rgba(15,23,42,.1); font-size: 12px; }
.nsc-var-tabs small { font-weight: 600; color: #9ca3af; margin-left: 2px; }
.nsc-var-x { margin-left: auto; border: 0; background: transparent; font-size: 22px; line-height: 1; color: #6b7280; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; }
.nsc-var-x:hover { background: rgba(15,23,42,.07); }
.nsc-var-body { overflow-y: auto; padding: 6px 8px 10px; }
.nsc-var-body ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.nsc-var-it { padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.7); border: 1px solid rgba(15,23,42,.06); }
.nsc-var-it.nuovo { border-color: rgba(59,130,246,.45); box-shadow: inset 3px 0 0 #3b82f6; }
.nsc-var-row1 { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.nsc-var-cli { font-size: 15px; font-weight: 800; letter-spacing: -.01em; }
.nsc-var-fa { font-size: 11.5px; color: #9ca3af; white-space: nowrap; }
.nsc-var-sub { font-size: 12.5px; color: #6b7280; margin-top: 1px; }
.nsc-var-when { display: flex; align-items: center; gap: 5px; margin-top: 6px; font-size: 13.5px; font-weight: 700; color: #111827; text-transform: capitalize; }
.nsc-var-when svg { width: 14px; height: 14px; fill: #6b7280; }
.nsc-var-cosa { margin-top: 5px; font-size: 13px; color: #1f2937; }
.nsc-var-cosa s { color: #9ca3af; }
.nsc-var-it.t-annullato .nsc-var-cosa { color: #b91c1c; }
.nsc-var-it.t-non_puo .nsc-var-cosa { color: #b91c1c; font-weight: 600; }
.nsc-var-it.t-confermato .nsc-var-cosa { color: #047857; font-weight: 600; }
.nsc-var-chi { margin-top: 3px; font-size: 11.5px; color: #9ca3af; }
.nsc-var-chi a { color: #2563eb; }
.nsc-var-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.nsc-var-act { display: inline-flex; align-items: center; gap: 5px; padding: 6px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
    color: #1f2937; text-decoration: none; white-space: nowrap; background: rgba(255,255,255,.85); border: 1px solid rgba(15,23,42,.1); }
.nsc-var-act:hover { background: #fff; color: #111827; }
.nsc-var-act svg { width: 14px; height: 14px; fill: currentColor; }
.nsc-var-act.apri { background: #1f2430; color: #fff; border-color: #1f2430; }
.nsc-var-act.wa { color: #128c4b; }
.nsc-var-empty { margin: 18px 8px; text-align: center; color: #6b7280; font-size: 14px; }
.nsc-var-it .nsc-pop-st { padding: 2px 9px 2px 4px; font-size: 11px; }
@media (max-width: 767.98px) {
    .nsc-var-b span { display: none; }
    .nsc-var-b { padding: 0 9px 0 7px; height: 28px; }
    #calendar .fc-toolbar-chunk:has(> .nsc-var) { justify-content: flex-start; }
}
