/* =====================================================================
   Tema grafico — Bootstrap 5.3 personalizzato
   ===================================================================== */
:root {
    /* Tema: valori predefiniti (sovrascritti da Impostazioni → Aspetto, vedi layouts/_theme.php) */
    --p: #4f46e5;            /* colore principale */
    --p-rgb: 79, 70, 229;
    --p-dark: #4338ca;
    --p-darker: #3730a3;
    --p-50: #f5f3ff;
    --p-100: #eef2ff;
    --p-150: #e0e7ff;
    --p-200: #c7d2fe;
    --p-300: #a5b4fc;
    --brand-1: #6366f1;      /* inizio gradiente */
    --brand-2: #a855f7;      /* fine gradiente / accento */
    --heading-font: inherit;
    --btn-radius: .6rem;
    --brand-grad: linear-gradient(135deg, var(--brand-1) 0%, var(--brand-2) 100%);
    --bs-primary: var(--p);
    --bs-primary-rgb: var(--p-rgb);
    --bs-link-color: var(--p);
    --bs-link-color-rgb: var(--p-rgb);
    --bs-link-hover-color: var(--p-dark);
    --bs-body-font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --bs-body-bg: #f6f7fb;
    --bs-border-radius: .65rem;
    --bs-border-radius-lg: 1rem;
    --soft-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 16px rgba(16, 24, 40, .06);
    --lift-shadow: 0 10px 30px rgba(var(--p-rgb), .18);
}

body { background: var(--bs-body-bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3, .h1, .h2, .h3, .h4, .h5, .navbar-brand, .brand-name { font-family: var(--heading-font); font-weight: 700; letter-spacing: -.01em; }

.btn { border-radius: var(--btn-radius); font-weight: 600; }
.btn-primary {
    --bs-btn-bg: var(--p); --bs-btn-border-color: var(--p);
    --bs-btn-hover-bg: var(--p-dark); --bs-btn-hover-border-color: var(--p-dark);
    --bs-btn-active-bg: var(--p-darker); --bs-btn-active-border-color: var(--p-darker);
    --bs-btn-disabled-bg: var(--p-300); --bs-btn-disabled-border-color: var(--p-300);
}
.btn-outline-primary {
    --bs-btn-color: var(--p); --bs-btn-border-color: var(--p-200);
    --bs-btn-hover-bg: var(--p); --bs-btn-hover-border-color: var(--p);
    --bs-btn-active-bg: var(--p-dark); --bs-btn-active-border-color: var(--p-dark);
}
.btn-gradient { background: var(--brand-grad); color: #fff; border: 0; box-shadow: var(--lift-shadow); }
.btn-gradient:hover { color: #fff; filter: brightness(1.06); }
.text-bg-primary { background-color: var(--p) !important; }
.form-control, .form-select { border-radius: .6rem; border-color: #e3e5ee; }
.form-control:focus, .form-select:focus { border-color: var(--p-300); box-shadow: 0 0 0 .25rem rgba(var(--p-rgb), .18); }
.form-check-input:checked { background-color: var(--p); border-color: var(--p); }

.card { border: 1px solid #eceef5; border-radius: 1rem; box-shadow: var(--soft-shadow); }
.card-header { background: transparent; border-bottom-color: #eceef5; font-weight: 600; padding: .9rem 1.1rem; }
.table > :not(caption) > * > * { padding: .75rem .9rem; }
.table thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: #6b7280; }
.badge { font-weight: 600; border-radius: .5rem; padding: .4em .65em; }
.alert { border: 0; border-radius: .8rem; box-shadow: var(--soft-shadow); }
.list-group-item:first-child { border-top-left-radius: 1rem; border-top-right-radius: 1rem; }
.list-group-item:last-child { border-bottom-left-radius: 1rem; border-bottom-right-radius: 1rem; }

.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: inherit; }
.brand img { width: 36px; height: 36px; }
.brand-name { font-weight: 800; font-size: 1.1rem; letter-spacing: -.02em; }
.text-gradient { background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* --------------------------------------------------------- pubblico */
.site-nav { background: rgba(255, 255, 255, .85); backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid #eceef5; }
.site-nav .nav-link { font-weight: 600; color: #374151; border-radius: .5rem; }
.site-nav .nav-link:hover, .site-nav .nav-link.active { color: var(--p); background: var(--p-100); }

.hero {
    position: relative; overflow: hidden; color: #fff;
    background: var(--brand-grad); border-radius: 1.5rem; padding: 2.5rem 2rem;
    box-shadow: var(--lift-shadow);
}
.hero::after { content: ""; position: absolute; inset: auto -80px -120px auto; width: 320px; height: 320px; border-radius: 50%; background: rgba(255, 255, 255, .08); }
.hero h1 { font-size: clamp(1.6rem, 3.2vw, 2.4rem); font-weight: 800; }
.hero p { opacity: .9; }
.hero .hero-art { max-width: 340px; width: 100%; position: relative; z-index: 1; }
.hero-badges .badge { background: rgba(255, 255, 255, .18); color: #fff; font-weight: 600; }

.step-indicator { display: flex; gap: .5rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.step-indicator .step {
    flex: 1 1 0; min-width: 110px; display: flex; align-items: center; gap: .5rem;
    padding: .6rem .8rem; border-radius: .8rem; background: #fff; border: 1px solid #eceef5;
    color: #6b7280; font-size: .875rem; font-weight: 600;
}
.step-indicator .step .num { width: 1.6rem; height: 1.6rem; border-radius: 50%; display: grid; place-items: center; background: var(--p-100); color: var(--p); font-size: .8rem; flex-shrink: 0; }
.step-indicator .step.active { border-color: var(--p-200); color: var(--p-darker); box-shadow: var(--soft-shadow); }
.step-indicator .step.active .num { background: var(--brand-grad); color: #fff; }
.step-indicator .step.done { color: #047857; }
.step-indicator .step.done .num { background: #d1fae5; color: #047857; }

.service-card { cursor: pointer; transition: transform .15s, box-shadow .15s, border-color .15s; border-radius: 1rem; }
.service-card .svc-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: #fff; background: var(--svc-color, var(--brand-1)); flex-shrink: 0; font-size: 1.2rem; }
.service-card:hover { transform: translateY(-2px); box-shadow: var(--lift-shadow); border-color: var(--p-200); }
.service-card.selected { border-color: var(--brand-1); box-shadow: 0 0 0 .2rem rgba(var(--p-rgb), .25); }
.price-tag { font-weight: 800; color: #111827; }

.month-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.month-grid .dow { text-align: center; font-size: .72rem; font-weight: 700; color: #9ca3af; text-transform: uppercase; padding-bottom: .25rem; }
.month-grid button { aspect-ratio: 1 / 1; border: 1px solid transparent; border-radius: .7rem; background: #f3f4f6; font-size: .92rem; font-weight: 600; color: #9ca3af; transition: all .12s; }
.month-grid button.available { background: var(--p-100); color: var(--p-dark); border-color: var(--p-150); }
.month-grid button.available:hover { background: var(--p-150); }
.month-grid button.selected { background: var(--brand-grad); color: #fff; box-shadow: var(--lift-shadow); }

.hours-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: .5rem; max-height: 340px; overflow: auto; padding: 2px; }
.hours-grid .btn { border-radius: .65rem; font-weight: 700; }
.hours-grid .btn small { display: block; font-size: .68rem; opacity: .8; font-weight: 600; }

.summary-card { position: sticky; top: 90px; }
.summary-card dt { color: #6b7280; font-weight: 600; font-size: .8rem; }
.summary-card dd { font-weight: 600; }

.stat-tile { border-radius: 1rem; padding: 1rem 1.1rem; background: #fff; border: 1px solid #eceef5; box-shadow: var(--soft-shadow); }
.stat-tile .icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 1.15rem; }
.stat-tile .value { font-size: 1.6rem; font-weight: 800; line-height: 1.1; }
.stat-tile .label { font-size: .8rem; color: #6b7280; font-weight: 600; }

.timeline { border-left: 2px solid var(--p-150); margin-left: .5rem; padding-left: 1.4rem; }
.timeline-item { position: relative; padding-bottom: 1.4rem; }
.timeline-item::before { content: ""; position: absolute; left: -1.95rem; top: .3rem; width: .95rem; height: .95rem; border-radius: 50%; background: var(--dot, var(--brand-1)); border: 3px solid #fff; box-shadow: 0 0 0 1px var(--p-150); }

.auth-wrap { min-height: calc(100vh - 160px); display: grid; align-items: center; }
.site-footer { background: #fff; border-top: 1px solid #eceef5; }

/* ------------------------------------------------------- gestionale */
.admin-sidebar { width: 250px; min-height: 100vh; background: #111827; background-image: radial-gradient(1200px 400px at -20% -10%, rgba(var(--p-rgb), .35), transparent 60%); position: sticky; top: 0; align-self: flex-start;
    /* menu più alto dello schermo: scorre per conto suo, con barra sottile */
    height: 100vh; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .25) transparent; }
.admin-sidebar::-webkit-scrollbar { width: 6px; }
.admin-sidebar::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .25); border-radius: 3px; }
.admin-sidebar .nav-link { color: rgba(255, 255, 255, .72); border-radius: .6rem; font-weight: 600; padding: .55rem .75rem; display: flex; align-items: center; }
.admin-sidebar .nav-link i { width: 1.4rem; }
.admin-sidebar .nav-link:hover { color: #fff; background: rgba(255, 255, 255, .07); }
.admin-sidebar .nav-link.active { color: #fff; background: var(--brand-grad); box-shadow: 0 6px 18px rgba(var(--p-rgb), .35); }
.admin-sidebar .section-label { font-size: .7rem; letter-spacing: .08em; color: rgba(255, 255, 255, .4); text-transform: uppercase; font-weight: 700; padding: 0 .75rem; margin-top: 1.2rem; margin-bottom: .3rem; }
.admin-user { background: rgba(255, 255, 255, .06); border-radius: .8rem; padding: .7rem .8rem; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-grad); color: #fff; font-weight: 700; font-size: .85rem; flex-shrink: 0; }
/* menu account in alto a destra (gestionale e gestore): nome, profilo, Esci */
.admin-topbar { display: flex; justify-content: flex-end; margin: -.25rem 0 .75rem; }
@media (max-width: 991.98px) { .admin-sidebar { width: 100%; min-height: auto; height: auto; overflow: visible; position: static; } }

.page-head { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin-bottom: 1.25rem; }
.page-head h1 { margin: 0; margin-right: auto; font-size: 1.5rem; }

.fc { --fc-border-color: #eceef5; --fc-today-bg-color: var(--p-50); --fc-now-indicator-color: #ef4444; --fc-button-bg-color: #fff; --fc-button-text-color: #374151; --fc-button-border-color: #e3e5ee; --fc-button-hover-bg-color: var(--p-100); --fc-button-hover-border-color: var(--p-200); --fc-button-active-bg-color: var(--p); --fc-button-active-border-color: var(--p); }
.fc .fc-button { border-radius: .55rem !important; font-weight: 600; font-size: .85rem; text-transform: capitalize; box-shadow: none !important; }
.fc .fc-button-primary:not(:disabled).fc-button-active, .fc .fc-button-primary:not(:disabled):active { color: #fff; }
.fc .fc-toolbar-title { font-size: 1.2rem; font-weight: 700; text-transform: capitalize; }
.fc .fc-event { cursor: pointer; border-radius: .45rem; border: 0; padding: 1px 3px; font-weight: 600; }
.fc .status-cancelled, .fc .is-cancelled { text-decoration: line-through; opacity: .6; }
.fc .fc-timegrid-event, .fc .fc-daygrid-event { border-left-width: 4px !important; }
.fc .status-completed { opacity: .8; }
.fc .fc-col-header-cell-cushion { font-weight: 700; color: #374151; text-transform: capitalize; }

.auth-split { min-height: 100vh; }
.auth-brand { background: var(--brand-grad); color: #fff; position: relative; overflow: hidden; }
.auth-brand::before { content: ""; position: absolute; width: 420px; height: 420px; border-radius: 50%; background: rgba(255, 255, 255, .08); top: -120px; right: -120px; }
.auth-brand::after { content: ""; position: absolute; width: 260px; height: 260px; border-radius: 50%; background: rgba(255, 255, 255, .06); bottom: -80px; left: -60px; }

@media print { .site-nav, .site-footer, .admin-sidebar, .btn { display: none !important; } }

/* rifiniture */
.fc a, .table a { text-decoration: none; }
.table a { font-weight: 600; }
.auth-brand .brand img, .admin-sidebar .brand img { background: rgba(255, 255, 255, .95); border-radius: 12px; padding: 3px; }

/* ------------------------------------------------- webapp / mobile */
.bottom-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030;
    display: flex; justify-content: space-around; align-items: stretch;
    background: rgba(255, 255, 255, .96); backdrop-filter: blur(12px);
    border-top: 1px solid #eceef5; padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -4px 20px rgba(16, 24, 40, .06);
}
.bottom-nav a { flex: 1 1 0; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px 6px; font-size: .7rem; font-weight: 600; color: #6b7280; text-decoration: none; }
.bottom-nav a i { font-size: 1.3rem; line-height: 1; }
.bottom-nav a.active { color: var(--p); }
.bottom-nav a.active i { background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
@media (max-width: 767.98px) {
    body.has-bottom-nav { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
    .site-footer { display: none; }
    .hero { padding: 1.5rem 1.25rem; border-radius: 1.1rem; }
    .step-indicator .step { min-width: 0; padding: .45rem .5rem; font-size: .75rem; }
    /* telefono: passi compatti su una riga, il nome solo per quello in corso (niente testo tagliato o pagina più larga) */
    .step-indicator { flex-wrap: nowrap; gap: .35rem; margin-bottom: 1rem; }
    .step-indicator .step { flex: 0 0 auto; justify-content: center; }
    .step-indicator .step .lbl { display: none; }
    .step-indicator .step.active { flex: 1 1 auto; min-width: 0; }
    .step-indicator .step.active .lbl { display: inline; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .85rem; }
    .hero h1 { font-size: 1.45rem; }
    .hero p { font-size: .95rem; }
    .summary-card { position: static; }
    .hours-grid { max-height: none; }
    .btn-lg { width: 100%; }
}
@media (max-width: 991.98px) {
    .admin-sidebar + main { padding-bottom: calc(76px + env(safe-area-inset-bottom)) !important; }
    body.has-bottom-nav .admin-sidebar { padding-top: max(1rem, env(safe-area-inset-top)) !important; }
}
.is-standalone .site-nav { padding-top: env(safe-area-inset-top); }
.ios-hint { position: fixed; left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 1040; display: flex; gap: .75rem; align-items: center; background: #fff; border-radius: 1rem; padding: .75rem .9rem; border: 1px solid var(--p-150); }
.ios-hint[hidden] { display: none; }
[data-install-app][hidden] { display: none !important; }
body.embed { padding-bottom: 0; }

/* --------------------------------------------- agenda */
.event-card { position: fixed; z-index: 1060; width: 340px; max-width: calc(100vw - 24px); background: #fff; border-radius: 1rem; padding: 1rem 1.1rem; border: 1px solid #eceef5; }
.event-card.as-sheet { left: 0 !important; right: 0; bottom: 0; top: auto !important; width: 100%; max-width: none; border-radius: 1.2rem 1.2rem 0 0; padding-bottom: calc(1rem + env(safe-area-inset-bottom)); z-index: 1070; }
.event-card dl dd { word-break: break-word; }
.table-cols { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.table-col { border: 1px solid #eceef5; border-radius: .9rem; padding: .5rem; background: #fff; min-width: 0; }
.table-col-head { font-weight: 700; display: flex; align-items: center; gap: .5rem; padding: .25rem .25rem .5rem; }
.table-col .fc .fc-toolbar.fc-header-toolbar { margin-bottom: .4rem; }
.table-col .fc .fc-button { padding: .2rem .5rem; font-size: .75rem; }
.avatar-sm { width: 28px; height: 28px; font-size: .7rem; }
.fc .bg-off { background: repeating-linear-gradient(45deg, #eef0f4, #eef0f4 6px, #e5e7eb 6px, #e5e7eb 12px) !important; opacity: .9; }
.fc .bg-break { background: #fde2e2 !important; opacity: .8; }
.fc .bg-break .fc-event-title, .fc .bg-off .fc-event-title { color: #6b7280; font-size: .7rem; font-style: normal; font-weight: 600; }
.fc .bg-closed { opacity: .5; }
.fc .ev-unavailability { background: repeating-linear-gradient(45deg, #9ca3af, #9ca3af 6px, #8b929c 6px, #8b929c 12px) !important; }
.legend { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-left: 6px; }
.legend-off { background: repeating-linear-gradient(45deg, #eef0f4, #eef0f4 3px, #d1d5db 3px, #d1d5db 6px); }
.legend-break { background: #fde2e2; }
.legend-closed { background: #fecaca; }
.cust-results { z-index: 1065; max-height: 260px; overflow: auto; }
.hour-pick:hover { background: var(--p-100) !important; color: var(--p-dark); }

/* logo dello studio nell'intestazione */
.brand img.company-logo { height: 54px; width: auto !important; max-width: 220px; object-fit: contain; }
@media (max-width: 767.98px) {
    .brand img.company-logo { height: 38px; max-width: 100%; }
    /* logo, "Installa app" e menu sempre su una riga: è il logo a restringersi */
    .site-nav .navbar-brand { flex: 0 1 auto; min-width: 0; margin-right: .5rem; }
    .site-nav .navbar-brand > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .site-nav [data-install-app] { flex-shrink: 0; font-size: .8rem; }
    .site-nav .navbar-toggler { flex-shrink: 0; padding: .25rem .4rem; }
}

/* ------------------------------------------------- ricerca rapida (Ctrl+K) */
.qk-trigger { align-items: center; gap: .55rem; width: 100%; border: 1px solid rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .06); color: rgba(255, 255, 255, .6);
    border-radius: .7rem; padding: .5rem .7rem; font-size: .85rem; text-align: left; transition: background .15s, border-color .15s; }
.qk-trigger:hover { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .25); color: #fff; }
.qk-trigger span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qk-trigger kbd, .qk-head kbd, .qk-foot kbd { background: rgba(127, 127, 127, .15); color: inherit; border: 1px solid rgba(127, 127, 127, .25); border-radius: .35rem; font-size: .7rem; padding: .1rem .35rem; box-shadow: none; }
.qk-dialog { max-width: 640px; margin-top: 10vh; }
.qk-box { border: 0; border-radius: 1.1rem; overflow: hidden; box-shadow: 0 30px 80px rgba(17, 24, 39, .35); }
.qk-head { display: flex; align-items: center; gap: .6rem; padding: .85rem 1rem; border-bottom: 1px solid #eceef5; }
.qk-head > i { color: var(--p); font-size: 1.15rem; }
.qk-head input { border: 0; box-shadow: none !important; font-size: 1.05rem; padding: .25rem 0; }
.qk-list { max-height: 60vh; overflow-y: auto; padding: .35rem .5rem .6rem; }
.qk-group { font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #8a90a2; padding: .7rem .6rem .3rem; }
.qk-item { display: flex; align-items: center; gap: .75rem; padding: .55rem .6rem; border-radius: .7rem; cursor: pointer; }
.qk-item.active { background: rgba(var(--p-rgb), .1); }
.qk-icon { width: 2.1rem; height: 2.1rem; border-radius: .6rem; display: grid; place-items: center; background: #f1f3f9; color: #4b5563; flex-shrink: 0; }
.qk-item.active .qk-icon { background: var(--brand-grad); color: #fff; }
.qk-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.qk-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qk-sub { font-size: .8rem; color: #6b7280; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qk-tools { display: flex; gap: .25rem; flex-shrink: 0; }
.qk-empty { padding: 1.5rem 1rem; color: #6b7280; font-size: .9rem; text-align: center; }
.qk-foot { gap: 1.2rem; padding: .55rem 1rem; border-top: 1px solid #eceef5; font-size: .75rem; color: #8a90a2; background: #fafbfd; }
@media (max-width: 575.98px) { .qk-dialog { margin: 0; max-width: none; height: 100%; } .qk-box { border-radius: 0; height: 100%; } .qk-list { max-height: none; } .qk-tools .btn:not(:last-child) { display: none; } }

/* ------------------------------------------------- scheda cliente rapida */
.qc-dialog { max-width: 520px; }
.qc-box { border: 0; border-radius: 1.1rem; box-shadow: 0 30px 80px rgba(17, 24, 39, .3); overflow: hidden; }
.qc-box .modal-header { background: linear-gradient(180deg, rgba(var(--p-rgb), .1), transparent); padding-top: 1.1rem; }
.qc-avatar { width: 52px; height: 52px; font-size: 1.1rem; border-radius: 1rem; }
.qc-pill { background: rgba(var(--p-rgb), .12); color: var(--p); font-weight: 600; }
.qc-num { border: 1px solid #eceef5; border-radius: .8rem; padding: .55rem .3rem; text-align: center; display: flex; flex-direction: column; align-items: center; line-height: 1.15; height: 100%; }
.qc-num i { color: var(--p); }
.qc-num strong { font-size: 1.25rem; }
.qc-num span { font-size: .7rem; color: #6b7280; }
.qc-next { border-left: 4px solid var(--p); background: rgba(var(--p-rgb), .06); border-radius: .6rem; padding: .6rem .8rem; }
.qc-history li { display: flex; align-items: center; gap: .5rem; padding: .35rem 0; border-bottom: 1px dashed #eceef5; font-size: .85rem; min-width: 0; }
.qc-history li:last-child { border-bottom: 0; }
.qc-dot { width: .6rem; height: .6rem; border-radius: 50%; flex-shrink: 0; }
.min-w-0 { min-width: 0; }

/* ------------------------------------------------- primo posto libero (prenotazione) */
.first-free { display: flex; align-items: center; gap: .85rem; padding: .8rem 1rem; border-radius: 1rem;
    background: linear-gradient(120deg, rgba(var(--p-rgb), .12), rgba(var(--p-rgb), .03)); border: 1px solid rgba(var(--p-rgb), .25); }
.first-free[hidden] { display: none; }
.first-free .ff-icon { width: 2.4rem; height: 2.4rem; border-radius: .8rem; display: grid; place-items: center; background: var(--brand-grad); color: #fff; flex-shrink: 0; font-size: 1.1rem; }
.first-free .ff-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.first-free .ff-kicker { font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--p); }
.first-free strong { font-size: 1.05rem; }
@media (max-width: 575.98px) { .first-free { flex-wrap: wrap; } .first-free .btn { width: 100%; } }

/* ------------------------------------------------- finestre di conferma (al posto di quelle del browser) */
.app-dialog { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 1rem; opacity: 0; transition: opacity .15s; }
.app-dialog.show { opacity: 1; }
.app-dialog-backdrop { position: absolute; inset: 0; background: rgba(17, 24, 39, .5); backdrop-filter: blur(2px); }
.app-dialog-box { position: relative; width: 100%; max-width: 440px; background: #fff; border-radius: 1.1rem; padding: 1.3rem 1.3rem 1.1rem; box-shadow: 0 30px 80px rgba(17, 24, 39, .35);
    transform: translateY(8px) scale(.98); transition: transform .15s; outline: none; }
.app-dialog.show .app-dialog-box { transform: none; }
.app-dialog-box.wide { max-width: 580px; }
.app-dialog-head { display: flex; gap: .85rem; align-items: flex-start; }
.app-dialog-icon { font-size: 1.5rem; line-height: 1; flex-shrink: 0; margin-top: .1rem; }
.app-dialog-text { min-width: 0; }
.app-dialog-title { font-size: 1.05rem; font-weight: 700; margin: 0 0 .25rem; }
.app-dialog-msg { color: #374151; }
.app-dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem; margin-top: 1.2rem; }
@media (max-width: 575.98px) {
    .app-dialog { align-items: flex-end; padding: 0; }
    .app-dialog-box { max-width: none; border-radius: 1.2rem 1.2rem 0 0; padding-bottom: calc(1.1rem + env(safe-area-inset-bottom)); }
    .app-dialog-actions { flex-direction: column-reverse; }
    .app-dialog-actions .btn { width: 100%; }
}

/* ------------------------------------------------- impostazioni in schede */
.settings-tabs { gap: .35rem; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid #e3e5ee; padding-bottom: .1rem; }
.settings-tabs::-webkit-scrollbar { display: none; }
.settings-tabs .nav-link { display: flex; align-items: center; gap: .4rem; white-space: nowrap; color: #4b5563; font-weight: 600; font-size: .9rem; border: 0; background: none;
    border-radius: .6rem .6rem 0 0; padding: .55rem .8rem; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.settings-tabs .nav-link:hover { color: var(--p); background: rgba(var(--p-rgb), .05); }
.settings-tabs .nav-link.active { color: var(--p); border-bottom-color: var(--p); background: rgba(var(--p-rgb), .07); }
.settings-tabs .badge { font-size: .65rem; }
.settings-save { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; gap: .75rem; margin-top: 1rem; padding: .75rem 1rem;
    background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border: 1px solid #eceef5; border-radius: .9rem; box-shadow: 0 -4px 20px rgba(17, 24, 39, .06); }
@media (max-width: 991.98px) { .settings-save { bottom: calc(64px + env(safe-area-inset-bottom)); } }

/* piattaforma: avvisi in testa al gestionale (prova, configurazione, accesso dell'assistenza) */
.trial-bar { color: #fff; border-radius: .9rem; padding: .7rem 1rem; background: linear-gradient(120deg, var(--brand-1), var(--brand-2)); box-shadow: var(--lift-shadow); }
.trial-bar.urgent { background: linear-gradient(120deg, #d97706, #f59e0b); }
.imp-bar { background: repeating-linear-gradient(135deg, #fef3c7 0 14px, #fde68a 14px 28px); color: #78350f; border-radius: .9rem; padding: .6rem .9rem; border: 1px solid #fcd34d; }

/* salone: fasi dell'appuntamento nell'agenda (la posa a righe: l'operatore è libero) */
.fc-event.seg-pose { background: repeating-linear-gradient(135deg, rgba(124, 58, 237, .16) 0 6px, rgba(124, 58, 237, .06) 6px 12px) !important; border: 1px dashed rgba(124, 58, 237, .5) !important; }
.fc-event.seg-pose .fc-event-main, .fc-event.seg-pose .fc-event-title, .fc-event.seg-pose .fc-event-time { color: #6d28d9 !important; }
.fc-event.seg-finish { opacity: .92; }

.st-dot { display: inline-block; width: 12px; height: 12px; border-radius: 4px; vertical-align: -1px; }

/* un elemento con "hidden" resta nascosto anche con le classi di Bootstrap che impostano display (d-flex, d-grid…) */
[hidden].d-flex, [hidden].d-inline-flex, [hidden].d-grid, [hidden].d-block { display: none !important; }

/* colonne che impilano riquadri con una griglia (scheda azienda del gestore, "Il mio piano"): senza min-width 0 un contenuto
   largo allarga la colonna oltre il suo spazio e finisce sotto la colonna accanto */
.row > .d-grid > * { min-width: 0; }
