/* ============================================================
   GestImpianti - Stili Principali
   ============================================================ */

:root {
    --sidebar-width: 230px;
    --sidebar-bg: #1e2a3a;
    --sidebar-hover: #2d3f55;
    --sidebar-active: #0d6efd;
}

/* ---- Allegati dropzone ---- */
.dropzone-area {
    border: 2px dashed #0d6efd;
    border-radius: 8px;
    background: #f0f5ff;
    text-align: center;
    padding: 2rem 1rem;
    color: #0d6efd;
    font-size: .9rem;
    margin: 0.75rem;
    pointer-events: none;
}
#card-allegati.drag-over .dropzone-area { display: flex !important; flex-direction: column; align-items: center; justify-content: center; }
#card-allegati.drag-over .card-body     { display: none; }
.allegato-row:last-child { border-bottom: none !important; }

/* ---- Autocomplete cliente ---- */
.cliente-autocomplete-wrap {
    position: relative;
}
.cliente-autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1060;
    background: #fff;
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,.12);
    max-height: 220px;
    overflow-y: auto;
    display: none;
}
.cliente-autocomplete-dropdown .ac-item {
    padding: 6px 10px;
    cursor: pointer;
    font-size: .875rem;
    border-bottom: 1px solid #f0f0f0;
}
.cliente-autocomplete-dropdown .ac-item:last-child { border-bottom: none; }
.cliente-autocomplete-dropdown .ac-item:hover,
.cliente-autocomplete-dropdown .ac-item.ac-active { background: #e9f0ff; }
.cliente-autocomplete-dropdown .ac-empty {
    padding: 8px 10px;
    color: #6c757d;
    font-size: .8rem;
    font-style: italic;
}

/* ---- Sidebar ---- */
.sidebar {
    background-color: var(--sidebar-bg) !important;
    min-height: calc(100vh - 56px);
    flex-shrink: 0;
}

.sidebar-section {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: #6c8099;
    text-transform: uppercase;
    padding: 1rem 1rem 0.3rem;
    margin-top: 0.5rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 1rem;
    color: #b0c4d8;
    text-decoration: none;
    font-size: 0.875rem;
    border-radius: 6px;
    margin: 2px 8px;
    transition: all 0.15s ease;
}

.sidebar-link:hover {
    background-color: var(--sidebar-hover);
    color: #fff;
}

.sidebar-link.active {
    background-color: var(--sidebar-active);
    color: #fff;
    font-weight: 600;
}

.sidebar-link i {
    width: 18px;
    text-align: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.sidebar-link .badge {
    margin-left: auto;
}

/* ---- Pagine ---- */
.page-header {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 1rem 1.5rem;
}

.page-header h1 {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0;
    color: #1e2a3a;
}

.page-body {
    padding: 1.5rem;
}

/* ---- Card Stats ---- */
.stat-card {
    border: none;
    border-radius: 12px;
    transition: transform 0.15s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-card .stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.1;
}

.stat-card .stat-label {
    font-size: 0.8rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ---- Tabelle ---- */
.table th {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6c757d;
    border-top: none;
    background-color: #f8f9fa;
}

.table td {
    vertical-align: middle;
    font-size: 0.9rem;
}

.table-hover tbody tr:hover {
    background-color: #f0f4ff;
}

/* ---- Calendario ---- */
:is(#calendar, .pf-cal) {
    background: #fff;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}

.fc-event {
    cursor: pointer;
    border-radius: 4px !important;
    padding: 1px 4px !important;
    font-size: 0.82rem !important;
}

.fc-event:hover {
    opacity: 0.9;
}

.fc-toolbar-title {
    font-size: 1.2rem !important;
    font-weight: 700 !important;
}

/* ---- Form e Modal ---- */
.modal-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

label.form-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.25rem;
}

/* ---- Magazzino scorta ---- */
.scorta-ok    { color: #198754; font-weight: 600; }
.scorta-bassa { color: #dc3545; font-weight: 600; }
.scorta-warn  { color: #fd7e14; font-weight: 600; }

/* ---- Badge priorità ---- */
.badge { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.03em; }

/* ---- Checklist attività ---- */
.attivita-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.attivita-item:last-child { border-bottom: none; }

.attivita-completata .attivita-text {
    text-decoration: line-through;
    color: #9ca3af;
}

/* ---- Prodotti intervento ---- */
.prodotto-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    border-left: 3px solid #0d6efd;
}

/* ---- Ordini ---- */
.ordine-stato-bozza    { border-left: 4px solid #6c757d; }
.ordine-stato-inviato  { border-left: 4px solid #0dcaf0; }
.ordine-stato-parziale { border-left: 4px solid #ffc107; }
.ordine-stato-completato { border-left: 4px solid #198754; }
.ordine-stato-annullato  { border-left: 4px solid #dc3545; }

/* ---- Sidebar overlay (mobile) ---- */
#sidebarOverlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 1040;
}
#sidebarOverlay.active { display: block; }

/* ---- Responsive ---- */
@media (max-width: 767.98px) {
    /* Sidebar off-canvas */
    #mainSidebar {
        position: fixed !important;
        top: 56px;
        left: 0;
        bottom: 0;
        z-index: 1045;
        width: 240px !important;
        min-width: 240px !important;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        overflow-y: auto;
    }
    #mainSidebar.sidebar-open {
        transform: translateX(0);
    }

    /* Contenuto occupa tutta la larghezza */
    .d-flex > main.flex-grow-1 {
        width: 100% !important;
    }

    /* Spaziatura ridotta */
    .page-body {
        padding: 0.75rem 0.5rem;
    }
    .page-header {
        padding: 0.6rem 0.75rem;
    }
    .page-header h1 {
        font-size: 1.1rem;
    }
    .page-header .btn {
        padding: 0.35rem 0.65rem;
        font-size: 0.85rem;
    }

    /* Bottoni touch più grandi */
    .btn-action {
        padding: 0.4rem 0.7rem;
        font-size: 0.875rem;
        min-height: 36px;
    }
    .btn {
        min-height: 38px;
    }
    .btn-sm {
        min-height: 32px;
    }

    /* Card stats */
    .stat-card .stat-value {
        font-size: 1.5rem;
    }
    .stat-card .card-body {
        padding: 0.75rem;
    }
    .stat-icon {
        width: 36px !important;
        height: 36px !important;
        font-size: 1rem !important;
    }

    /* Header calendario: stack verticale */
    .page-header.flex-wrap .d-flex.gap-2 {
        flex-wrap: wrap;
        width: 100%;
    }
    .page-header.flex-wrap .d-flex.gap-2 .form-select {
        flex: 1;
        min-width: 0 !important;
    }

    /* FullCalendar mobile */
    .fc .fc-toolbar-title {
        font-size: 1rem !important;
    }
    .fc .fc-button {
        padding: 0.3rem 0.5rem !important;
        font-size: 0.8rem !important;
    }
    .fc .fc-list-event-title a {
        font-size: 0.9rem;
    }

    /* Tabelle: scroll orizzontale */
    .table-responsive {
        -webkit-overflow-scrolling: touch;
    }
    .table td, .table th {
        white-space: nowrap;
        font-size: 0.85rem;
        padding: 0.45rem 0.6rem;
    }

    /* Form inputs più alti per touch */
    .form-control, .form-select {
        min-height: 42px;
        font-size: 1rem;
    }
    .form-label {
        font-size: 0.9rem;
        margin-bottom: 0.25rem;
    }

    /* Modal full-screen */
    .modal-dialog {
        margin: 0.25rem;
        max-width: calc(100vw - 0.5rem);
    }
    .modal-dialog-scrollable .modal-body {
        max-height: calc(100vh - 140px);
    }
    .modal-header {
        padding: 0.75rem 1rem;
    }
    .modal-footer {
        padding: 0.5rem 0.75rem;
        gap: 0.4rem;
    }
    .modal-footer .btn {
        flex: 1;
    }

    /* Card intervento dettaglio: stack verticale */
    .card-body .row.g-3 > [class^="col-"] {
        margin-bottom: 0;
    }

    /* Sidebar link area più alta */
    .sidebar-link {
        padding: 0.65rem 1.2rem;
        font-size: 0.95rem;
    }

    /* Nascondi colonne non essenziali nelle liste interventi */
    .table .col-hide-mobile {
        display: none;
    }

    /* Badge e label */
    .badge {
        font-size: 0.75rem;
        padding: 0.3em 0.55em;
    }

    /* Gap ridotto nelle griglie */
    .row.g-4 {
        --bs-gutter-x: 0.75rem;
        --bs-gutter-y: 0.75rem;
    }
    .row.g-3 {
        --bs-gutter-x: 0.5rem;
        --bs-gutter-y: 0.5rem;
    }
}

/* ---- Utility ---- */
.btn-action { padding: 0.25rem 0.5rem; font-size: 0.8rem; }
.text-nowrap { white-space: nowrap; }
.cursor-pointer { cursor: pointer; }

/* ---- Loading overlay ---- */
.loading-overlay {
    position: fixed; inset: 0;
    background: rgba(255,255,255,0.7);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999;
    display: none;
}

/* ---- Nominatim address autocomplete ---- */
.nominatim-drop {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1060;
    background: #fff;
    border: 1px solid #ced4da;
    border-top: none;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
    max-height: 220px;
    overflow-y: auto;
}
.nominatim-item {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    outline: none;
    line-height: 1.35;
}
.nominatim-item:last-child { border-bottom: none; }
.nominatim-item:hover,
.nominatim-item:focus { background: #f0f7ff; color: #0d6efd; }

/* Giorni bloccati nel calendario */
.fc-giorno-bloccato { opacity: 0.55 !important; }
.fc .fc-daygrid-day.fc-day-blocked { background: rgba(220,53,69,.08) !important; }

/* =====================================================================
   Finestra Nuovo / Modifica intervento (includes/form_intervento.php)
   ===================================================================== */
.fi-step {
    display: flex; align-items: center; gap: .6rem;
    font-weight: 600; font-size: .95rem; color: #1e2a3a;
    padding-bottom: .35rem; border-bottom: 1px solid #e9ecef; margin-top: .25rem;
}
.fi-num {
    width: 24px; height: 24px; border-radius: 50%;
    background: #0d6efd; color: #fff; font-size: .78rem;
    display: inline-flex; align-items: center; justify-content: center; flex: none;
}
.fi-panel { border: 1px solid #dbe4f0; background: #f7faff; border-radius: 10px; padding: .9rem 1rem; }
.fi-vuoto { color: #6c757d; font-size: .9rem; padding: .75rem 1rem; border: 1px dashed #ced4da; border-radius: 10px; }
.fi-scelto {
    display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap;
    border: 1px solid #b6d4fe; background: #eef5ff; border-radius: 10px; padding: .6rem .9rem;
}
.fi-avviso { background: #fff8e1; border: 1px solid #ffe08a; border-radius: 8px; padding: .5rem .75rem; font-size: .88rem; }

/* tendine di ricerca (clienti, comuni) */
.fi-drop {
    display: none; position: absolute; left: 0; right: 0; top: 100%; z-index: 1080;
    background: #fff; border: 1px solid #dee2e6; border-radius: 8px; margin-top: 2px;
    max-height: 260px; overflow-y: auto; box-shadow: 0 8px 24px rgba(0,0,0,.12);
}
.fi-drop-item { padding: .5rem .75rem; cursor: pointer; border-bottom: 1px solid #f3f4f6; }
.fi-drop-item:hover { background: #eef5ff; }
.fi-drop-vuoto { padding: .6rem .75rem; color: #6c757d; font-size: .9rem; }

/* schede immobile */
.fi-immobili { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .6rem; }
.fi-immobili.fi-invalido .fi-imm { border-color: #dc3545; }
.fi-imm {
    position: relative; display: flex; gap: .6rem; align-items: flex-start; margin: 0;
    border: 1.5px solid #dee2e6; border-radius: 10px; padding: .7rem .8rem; background: #fff;
    cursor: pointer; transition: border-color .15s, box-shadow .15s; text-align: left;
}
.fi-imm:hover { border-color: #86b7fe; }
.fi-imm input[type=radio] { margin-top: .2rem; accent-color: #0d6efd; }
.fi-imm-on { border-color: #0d6efd; box-shadow: 0 0 0 3px rgba(13,110,253,.12); background: #f7faff; }
.fi-imm-corpo { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fi-imm-titolo { font-weight: 600; }
.fi-imm-sub { font-size: .85rem; color: #495057; }
.fi-imm-meta { display: flex; gap: .5rem; align-items: center; font-size: .78rem; color: #6c757d; margin-top: 2px; }
.fi-imm-add {
    align-items: center; justify-content: center; gap: .5rem; color: #0d6efd; font-weight: 500;
    border-style: dashed; background: #fbfcfe;
}
.fi-badge-zona {
    display: inline-block; font-size: .72rem; font-weight: 600; letter-spacing: .02em;
    color: #0a58ca; background: #e7f1ff; border-radius: 999px; padding: .1rem .5rem;
}
.fi-badge-zona-no { color: #997404; background: #fff3cd; }
.fi-zona { min-height: 38px; display: flex; align-items: center; gap: .4rem; }

/* Finestre scorrevoli con <form> che racchiude header/body/footer:
   il form deve passare l'altezza al corpo, altrimenti il fondo resta tagliato
   e non si vede il pulsante Salva. */
.modal-dialog-scrollable .modal-content > form {
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
}
.modal-dialog-scrollable .modal-content > form > .modal-body { overflow-y: auto; }

/* Scheda intervento: "cosa vuoi fare adesso?" (intervento appena registrato) */
.prossimo-passo {
    background: #fff; border: 1px solid #dbe4f0; border-left: 4px solid #0d6efd;
    border-radius: 12px; padding: 1rem 1.25rem; box-shadow: 0 1px 3px rgba(16,24,40,.06);
}
.prossimo-passo-icona {
    width: 42px; height: 42px; border-radius: 10px; flex: none;
    background: #e7f1ff; color: #0d6efd; display: flex; align-items: center; justify-content: center; font-size: 1.15rem;
}
.prossimo-passo-scelte { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .6rem; }
.prossimo-passo-scelta {
    display: flex; gap: .75rem; align-items: flex-start; text-align: left; text-decoration: none; color: inherit;
    border: 1.5px solid #dee2e6; border-radius: 10px; background: #fff; padding: .75rem .9rem;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.prossimo-passo-scelta:hover { border-color: #0d6efd; background: #f7faff; box-shadow: 0 0 0 3px rgba(13,110,253,.10); color: inherit; }
.prossimo-passo-scelta > i { color: #0d6efd; font-size: 1.1rem; margin-top: .15rem; width: 20px; text-align: center; }
.prossimo-passo-scelta span { display: flex; flex-direction: column; }
.prossimo-passo-scelta small { color: #6c757d; font-size: .8rem; }

/* =====================================================================
   SISTEMA STATI — unica tavolozza (vedi statiDefinizione() in functions.php)
   Pallino colorato + testo scuro su fondo tenue: contrasto AA, colori pochi e riconoscibili.
   ===================================================================== */
:root {
    --t-testo: #1f2937;  --t-tenue: #6b7280;  --t-bordo: #e5e7eb;  --t-fondo: #f8fafc;
    --neutro: #64748b;   --neutro-bg: #f1f5f9;   --neutro-tx: #334155;
    --azzurro: #0284c7;  --azzurro-bg: #e0f2fe;  --azzurro-tx: #075985;
    --viola: #7c3aed;    --viola-bg: #ede9fe;    --viola-tx: #5b21b6;
    --blu: #2563eb;      --blu-bg: #dbeafe;      --blu-tx: #1e40af;
    --ambra: #d97706;    --ambra-bg: #fef3c7;    --ambra-tx: #92400e;
    --arancio: #ea580c;  --arancio-bg: #ffedd5;  --arancio-tx: #9a3412;
    --rosso: #dc2626;    --rosso-bg: #fee2e2;    --rosso-tx: #991b1b;
    --verde: #16a34a;    --verde-bg: #dcfce7;    --verde-tx: #166534;
    --spento: #9ca3af;   --spento-bg: #f3f4f6;   --spento-tx: #6b7280;
}
.stato {
    display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap;
    font-size: .8rem; font-weight: 600; line-height: 1; padding: .32rem .6rem .32rem .5rem; border-radius: 999px;
}
.stato-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; display: inline-block; background: currentColor; }
.stato-neutro  { background: var(--neutro-bg);  color: var(--neutro-tx); }   .stato-neutro  .stato-dot, .stato-neutro-dot  { background: var(--neutro); }
.stato-azzurro { background: var(--azzurro-bg); color: var(--azzurro-tx); }  .stato-azzurro .stato-dot, .stato-azzurro-dot { background: var(--azzurro); }
.stato-viola   { background: var(--viola-bg);   color: var(--viola-tx); }    .stato-viola   .stato-dot, .stato-viola-dot   { background: var(--viola); }
.stato-blu     { background: var(--blu-bg);     color: var(--blu-tx); }      .stato-blu     .stato-dot, .stato-blu-dot     { background: var(--blu); }
.stato-ambra   { background: var(--ambra-bg);   color: var(--ambra-tx); }    .stato-ambra   .stato-dot, .stato-ambra-dot   { background: var(--ambra); }
.stato-arancio { background: var(--arancio-bg); color: var(--arancio-tx); }  .stato-arancio .stato-dot, .stato-arancio-dot { background: var(--arancio); }
.stato-rosso   { background: var(--rosso-bg);   color: var(--rosso-tx); }    .stato-rosso   .stato-dot, .stato-rosso-dot   { background: var(--rosso); }
.stato-verde   { background: var(--verde-bg);   color: var(--verde-tx); }    .stato-verde   .stato-dot, .stato-verde-dot   { background: var(--verde); }
.stato-spento  { background: var(--spento-bg);  color: var(--spento-tx); }   .stato-spento  .stato-dot, .stato-spento-dot  { background: var(--spento); }

.priorita { display: inline-flex; align-items: center; gap: .25rem; font-size: .75rem; font-weight: 600; }
.priorita-alta    { color: var(--arancio-tx); }
.priorita-urgente { color: var(--rosso-tx); }
.pratica { font-size: .78rem; color: var(--t-tenue); }

/* ── Barra filtri ── */
.filtri-bar { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.filtri-bar .form-select { width: auto; min-width: 170px; }
.filtri-cerca { flex: 1 1 280px; }
.filtri-cerca > i { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); color: var(--t-tenue); font-size: .85rem; }
.filtri-cerca .form-control { padding-left: 2.1rem; }

/* ── Filtri rapidi (chip) ── */
.chips { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.chips-titolo { font-size: .8rem; color: var(--t-tenue); margin-right: .2rem; }
.chip {
    display: inline-flex; align-items: center; gap: .45rem; text-decoration: none;
    font-size: .82rem; color: var(--t-testo); background: #fff; border: 1px solid var(--t-bordo);
    border-radius: 999px; padding: .3rem .75rem; transition: border-color .15s, background .15s;
}
.chip:hover { border-color: #cbd5e1; background: var(--t-fondo); color: var(--t-testo); }
.chip-on { background: var(--t-testo); border-color: var(--t-testo); color: #fff; }
.chip-on:hover { background: #111827; color: #fff; }
.chip-n { font-size: .72rem; font-weight: 700; background: var(--neutro-bg); color: var(--neutro-tx); border-radius: 999px; padding: .05rem .45rem; }
.chip-on .chip-n { background: rgba(255,255,255,.2); color: #fff; }

/* ── Tabella ── */
.tabella-card { border: 1px solid var(--t-bordo); border-radius: 12px; overflow: hidden; }
.tabella { --bs-table-hover-bg: #f8fafc; }
.tabella thead th {
    font-size: .72rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
    color: var(--t-tenue); background: var(--t-fondo); border-bottom: 1px solid var(--t-bordo);
    padding: .65rem .9rem; white-space: nowrap;
}
.tabella tbody td { padding: .7rem .9rem; vertical-align: middle; border-color: #f1f5f9; font-size: .9rem; color: var(--t-testo); }
.tabella tbody tr { cursor: pointer; }
.tabella tbody tr:hover td { background: #f8fafc; }
.cella-id { color: var(--t-tenue); font-size: .8rem !important; font-variant-numeric: tabular-nums; }
.cella-titolo { font-weight: 600; }
.cella-sotto { font-size: .8rem; color: var(--t-tenue); margin-top: 1px; }
.cella-vuota { font-size: .82rem; color: #9ca3af; font-style: italic; }
.cella-azioni { text-align: right; white-space: nowrap; }
.tabella-piede { font-size: .8rem; color: var(--t-tenue); padding: .6rem .9rem; border-top: 1px solid var(--t-bordo); background: #fff; }
.squadra { display: inline-flex; align-items: center; gap: .45rem; font-size: .88rem; }
.squadra-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }

.btn-icona {
    width: 32px; height: 32px; border-radius: 8px; border: 1px solid transparent; background: transparent;
    color: var(--t-tenue); display: inline-flex; align-items: center; justify-content: center; font-size: .85rem;
}
.btn-icona:hover { background: var(--neutro-bg); color: var(--t-testo); }
.btn-icona-rischio:hover { background: var(--rosso-bg); color: var(--rosso-tx); }

/* Pagina Stati: flusso */
.flusso { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.flusso-freccia { color: #cbd5e1; font-size: .9rem; }

/* form usato come semplice contenitore di un pulsante dentro una griglia */
.d-contents { display: contents; }
.prossimo-passo-scelta.prossimo-passo-fatto { border-color: var(--verde); background: var(--verde-bg); }
.chips-sep { width: 1px; height: 20px; background: var(--t-bordo); margin: 0 .25rem; }
.prossimo-passo-scelta[data-bloccata] { background: #f8fafc; border-style: dashed; }
.prossimo-passo-scelta[data-bloccata] > i, .prossimo-passo-scelta[data-bloccata] strong { color: #94a3b8; }
.prossimo-passo-scelta[data-bloccata]:hover { border-color: #cbd5e1; box-shadow: none; background: #f8fafc; }

/* =====================================================================
   LEGGIBILITÀ — il testo cresce con la larghezza dello schermo.
   Quasi tutte le misure del programma sono in "rem": aumentando la base
   si ingrandisce tutto in proporzione (testi, pulsanti, tabelle, spazi).
   Base 16px = 100%. Massimo +20% sugli schermi più grandi, poi a scalare.
   ===================================================================== */
html { font-size: 16.5px; }                                   /* telefono e tablet  +3%  */
@media (min-width: 992px)  { html { font-size: 16.8px; } }    /* portatile piccolo  +5%  */
@media (min-width: 1200px) { html { font-size: 17.6px; } }    /* portatile          +10% */
@media (min-width: 1400px) { html { font-size: 18.4px; } }    /* monitor            +15% */
@media (min-width: 1750px) { html { font-size: 19.2px; } }    /* monitor grande     +20% (massimo) */
/* (le regole valgono per entrambi gli aspetti, classico e nuovo) */

/* testi secondari un po' meno piccoli */
.tabella tbody td   { font-size: .95rem; }
.tabella thead th   { font-size: .75rem; }
.cella-sotto        { font-size: .85rem; }
.cella-id           { font-size: .85rem !important; }
.stato              { font-size: .85rem; }
.pratica            { font-size: .85rem; }
.chip               { font-size: .88rem; }
.chips-titolo       { font-size: .85rem; }
.tabella-piede      { font-size: .85rem; }
.prossimo-passo-scelta small { font-size: .85rem; }
/* Scelte del riquadro "prossimo passo": solo icona + titolo (la spiegazione è nel suggerimento al passaggio del mouse) */
.prossimo-passo-scelta { align-items: center; padding: .7rem .9rem; }
.prossimo-passo-scelta > i { margin-top: 0; }

/* Finestra intervento: lavori da fare (scelta multipla a "pillole") */
.fi-lavori { display: flex; flex-wrap: wrap; gap: .5rem; }
.fi-lavori.fi-invalido .fi-lavoro span { border-color: #dc3545; }
.fi-lavoro { margin: 0; cursor: pointer; }
.fi-lavoro input { position: absolute; opacity: 0; pointer-events: none; }
.fi-lavoro span {
    display: inline-flex; align-items: center; gap: .45rem; padding: .45rem .9rem;
    border: 1.5px solid #dee2e6; border-radius: 999px; background: #fff; transition: all .15s;
}
.fi-lavoro span i { display: none; font-size: .8em; }
.fi-lavoro:hover span { border-color: #86b7fe; }
.fi-lavoro input:checked + span { border-color: #0d6efd; background: #eef5ff; color: #0a58ca; font-weight: 600; }
.fi-lavoro input:checked + span i { display: inline; }
.fi-lavoro input:focus-visible + span { box-shadow: 0 0 0 3px rgba(13,110,253,.25); }
/* Scheda: preventivi per lavoro */
.prev-riga .stato { font-size: .75rem; }
.prev-lavoro { border: 1px solid var(--t-bordo); border-radius: 10px; padding: .75rem .9rem; margin-bottom: .6rem; }
/* Intestazione scheda intervento: sotto il nome, stato e lavori ben leggibili */
.scheda-sotto { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-top: .35rem; }
.scheda-sotto .stato { font-size: 1rem; padding: .4rem .8rem .4rem .65rem; }
.scheda-sotto .stato-dot { width: 9px; height: 9px; }
.scheda-lavori { font-size: 1.1rem; font-weight: 500; color: #374151; }
.scheda-sotto .priorita { font-size: .95rem; }
/* Scheda intervento: riquadro Informazioni (etichetta a sinistra, valore a destra; su telefono uno sotto l'altro) */
.info-lista { display: grid; grid-template-columns: minmax(110px, 38%) 1fr; gap: .45rem 1rem; font-size: .95rem; }
.info-lista dt { color: var(--t-tenue); font-weight: 500; }
.info-lista dd { margin: 0; color: var(--t-testo); word-break: break-word; }
@media (max-width: 575.98px) {
    .info-lista { grid-template-columns: 1fr; gap: .1rem; }
    .info-lista dd { margin-bottom: .55rem; }
}

/* ---------- Squadre: orari di lavoro ---------- */
.sq-orari { font-size: .9rem; color: #475569; background: #f8fafc; border-radius: 8px; padding: .4rem .6rem; }
.orari-grid { display: grid; grid-template-columns: 8.5rem minmax(0,1fr) minmax(0,1fr); gap: .4rem .75rem; align-items: center;
    border: 1px solid #e5e7eb; border-radius: 10px; padding: .75rem; }
.orari-grid .og-h { font-size: .8rem; font-weight: 600; color: #64748b; text-transform: uppercase; letter-spacing: .04em; }
.og-giorno { display: flex; align-items: center; gap: .5rem; font-weight: 500; margin: 0; cursor: pointer; }
.og-giorno.off { color: #94a3b8; }
.og-fascia { display: flex; align-items: center; gap: .35rem; }
.og-fascia .form-control { padding: .3rem .4rem; min-width: 0; flex: 1 1 0; }
.og-fascia .form-control:disabled { background: #f8fafc; color: #cbd5e1; }
@media (max-width: 576px) { .orari-grid { grid-template-columns: 1fr; } .orari-grid .og-h { display: none; } }

/* =====================================================================
   CALENDARIO (pages/calendario.php) — stile pulito, colori della squadra
   ===================================================================== */
.cal-orario { display: inline-block; margin-left: .75rem; font-size: .85rem; font-weight: 400; color: #64748b;
    background: #f1f5f9; border-radius: 999px; padding: .2rem .7rem; vertical-align: middle; }
.cal-squadre { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.cal-sq { display: inline-flex; align-items: center; gap: .5rem; padding: .45rem .9rem; border-radius: 999px;
    border: 1px solid #e2e8f0; background: #fff; color: #334155; text-decoration: none; font-weight: 500; transition: .12s; }
.cal-sq:hover { border-color: #cbd5e1; background: #f8fafc; color: #0f172a; }
.cal-sq-dot { width: .7rem; height: .7rem; border-radius: 50%; background: var(--sq); }
.cal-sq.on { background: #0f172a; border-color: #0f172a; color: #fff; }
.cal-sq.on .cal-sq-dot { box-shadow: 0 0 0 2px #fff; }
.cal-sq-tutte { margin-left: auto; color: #64748b; }
.cal-box { background: #fff; border: 1px solid #e8ecf1; border-radius: 14px; padding: 1rem 1.25rem; }

:is(#calendar, .pf-cal).fc {
    --fc-border-color: #edf0f4;
    --fc-today-bg-color: rgba(37, 99, 235, .045);
    --fc-now-indicator-color: #ef4444;
    --fc-non-business-color: rgba(241, 245, 249, .85);
    --fc-neutral-bg-color: #f8fafc;
    --fc-page-bg-color: #fff;
    --fc-list-event-hover-bg-color: #f8fafc;
}
:is(#calendar, .pf-cal) .fc-scrollgrid { border-radius: 10px; overflow: hidden; }
:is(#calendar, .pf-cal) .fc-toolbar.fc-header-toolbar { margin-bottom: 1rem; }
:is(#calendar, .pf-cal) .fc-toolbar-chunk:first-child { display: flex; align-items: center; gap: .5rem; }
:is(#calendar, .pf-cal) .fc-toolbar-title { font-size: 1.3rem !important; font-weight: 600 !important; color: #0f172a; margin-left: .5rem !important; text-transform: capitalize; }

/* pulsanti: chiari, il selezionato scuro */
:is(#calendar, .pf-cal) .fc-button { background: #fff; border: 1px solid #e2e8f0; color: #334155; font-weight: 500;
    box-shadow: none !important; text-transform: none; padding: .4rem .85rem; }
:is(#calendar, .pf-cal) .fc-button:hover { background: #f1f5f9; color: #0f172a; border-color: #cbd5e1; }
:is(#calendar, .pf-cal) .fc-button:disabled { opacity: .45; }
:is(#calendar, .pf-cal) .fc-button-primary:not(:disabled).fc-button-active,
:is(#calendar, .pf-cal) .fc-button-primary:not(:disabled):active { background: #0f172a; border-color: #0f172a; color: #fff; }
:is(#calendar, .pf-cal) .fc-prev-button, :is(#calendar, .pf-cal) .fc-next-button { padding: .4rem .6rem; }

/* intestazione giorni: "lun" piccolo, numero grande; oggi cerchiato */
:is(#calendar, .pf-cal) .fc-col-header-cell { border-color: transparent; border-bottom-color: var(--fc-border-color); }
:is(#calendar, .pf-cal) .fc-col-header-cell-cushion { text-decoration: none; color: #64748b; padding: .5rem .25rem .6rem; display: flex;
    flex-direction: column; align-items: center; gap: .1rem; font-weight: 500; }
:is(#calendar, .pf-cal) .dh-g { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; }
:is(#calendar, .pf-cal) .dh-n { font-size: 1.35rem; font-weight: 600; color: #0f172a; width: 2.3rem; height: 2.3rem; line-height: 2.3rem;
    text-align: center; border-radius: 50%; }
:is(#calendar, .pf-cal) .fc-day-today .dh-n { background: #2563eb; color: #fff; }
:is(#calendar, .pf-cal) .fc-day-today .dh-g { color: #2563eb; }
:is(#calendar, .pf-cal) .fc-daygrid-day-number { text-decoration: none; color: #475569; font-weight: 500; }
:is(#calendar, .pf-cal) .fc-day-today .fc-daygrid-day-number { background: #2563eb; color: #fff; border-radius: 999px; min-width: 1.8rem; text-align: center; margin: 2px; }

/* griglia ore: righe leggere, solo le ore intere */
:is(#calendar, .pf-cal) .fc-timegrid-slot { height: 2.6rem; }
:is(#calendar, .pf-cal) .fc-timegrid-slot-minor { border-top-color: transparent; }
:is(#calendar, .pf-cal) .fc-timegrid-slot-label-cushion { font-size: .8rem; color: #94a3b8; }
:is(#calendar, .pf-cal) .fc-timegrid-axis, :is(#calendar, .pf-cal) .fc-timegrid-slot-label { border-color: transparent; }
:is(#calendar, .pf-cal) .fc-timegrid-now-indicator-line { border-width: 2px 0 0; }

/* appuntamenti: sfondo tenue del colore squadra, barra a sinistra, testo scuro */
:is(#calendar, .pf-cal) .fc-event.ev-int { --ev: #64748b; background: color-mix(in srgb, var(--ev) 13%, #fff) !important;
    border: none !important; border-left: 4px solid var(--ev) !important; border-radius: 6px !important;
    color: #0f172a !important; box-shadow: 0 1px 2px rgba(15, 23, 42, .06); padding: 0 !important; font-size: .85rem !important; }
:is(#calendar, .pf-cal) .fc-event.ev-int:hover { background: color-mix(in srgb, var(--ev) 20%, #fff) !important; opacity: 1; }
:is(#calendar, .pf-cal) .fc-event.ev-int .fc-event-main { color: #0f172a; padding: 0; }
:is(#calendar, .pf-cal) .fc-event.ev-fatto { opacity: .55; }
:is(#calendar, .pf-cal) .ev-in { padding: .3rem .45rem; overflow: hidden; line-height: 1.25; height: 100%; }
:is(#calendar, .pf-cal) .ev-top { display: flex; justify-content: space-between; gap: .3rem; font-size: .75rem; color: #475569; }
:is(#calendar, .pf-cal) .ev-fase { font-weight: 600; color: color-mix(in srgb, var(--ev) 70%, #000); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
:is(#calendar, .pf-cal) .ev-cli { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
:is(#calendar, .pf-cal) .ev-lav { font-size: .78rem; color: #475569; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
:is(#calendar, .pf-cal) .fc-daygrid-event.ev-int { margin: 1px 3px; }
:is(#calendar, .pf-cal) .fc-daygrid-event.ev-int .ev-in { padding: .15rem .35rem; }
:is(#calendar, .pf-cal) .fc-daygrid-event.ev-int .ev-lav { display: none; }

/* giorni bloccati (chiusure, ferie): grigio a righe con il motivo */
:is(#calendar, .pf-cal) .fc-bg-event.fc-giorno-bloccato { opacity: 1 !important;
    background: repeating-linear-gradient(135deg, #f1f5f9 0 8px, #e9eef3 8px 16px) !important; }
:is(#calendar, .pf-cal) .fc-giorno-bloccato .fc-event-title { font-style: normal; font-size: .8rem; color: #64748b; font-weight: 500; }

/* agenda */
:is(#calendar, .pf-cal) .fc-list-day-cushion { background: #f8fafc; }
:is(#calendar, .pf-cal) .fc-list-event-dot { border-color: var(--ev, #64748b); }

/* finestrella dettaglio */
.ev-card-head { --ev: #64748b; background: #fff; border-bottom: 1px solid #eef1f5; border-top: 4px solid var(--ev); }
.ev-card-lista { grid-template-columns: 30% 1fr !important; font-size: .92rem; }
:is(#calendar, .pf-cal) { padding: 0; box-shadow: none; border-radius: 0; background: transparent; }
:is(#calendar, .pf-cal) .ev-ora { white-space: nowrap; flex: none; }
:is(#calendar, .pf-cal) .fc-list-event .ev-cli { font-weight: 600; }
:is(#calendar, .pf-cal) .fc-list-event .ev-lav { color: #64748b; }
:is(#calendar, .pf-cal) .ev-fase-l { display: inline-block; margin-left: .35rem; font-size: .75rem; font-weight: 600; color: #475569;
    background: #f1f5f9; border-radius: 999px; padding: .05rem .5rem; }
:is(#calendar, .pf-cal) .fc-list-day-cushion { font-weight: 600; color: #0f172a; text-transform: capitalize; }
:is(#calendar, .pf-cal) .fc-list-day-cushion a { text-decoration: none; color: inherit; }
:is(#calendar, .pf-cal) .fc-col-header-cell-cushion { text-transform: none; }
:is(#calendar, .pf-cal) .fc-dayGridMonth-view .fc-col-header-cell-cushion { text-transform: uppercase; font-size: .75rem; letter-spacing: .06em; }
@media (max-width: 767.98px) {
    .cal-orario { display: block; margin: .35rem 0 0; width: fit-content; font-size: .8rem; }
    .cal-box { padding: .75rem; }
    :is(#calendar, .pf-cal) .fc-toolbar-title { font-size: 1.05rem !important; }
}
:is(#calendar, .pf-cal) .fc-list-event.ev-int { background: #fff !important; border-left: none !important; box-shadow: none; }
:is(#calendar, .pf-cal) .fc-list-event.ev-int:hover td { background: #f8fafc; }
:is(#calendar, .pf-cal) .fc-list-day-cushion { text-align: left; }

/* Intestazione tabelle più leggibile: fondo grigio-azzurro, testo scuro, niente maiuscolo */
.tabella thead th {
    font-size: .9rem !important; font-weight: 700; letter-spacing: 0; text-transform: none;
    color: #1e293b; background: #e8edf4; border-bottom: 2px solid #cbd5e1; padding: .75rem .9rem;
}

/* =====================================================================
   CHECKLIST SOPRALLUOGO (assets/js/checklist.js) — pulsanti grandi, comodi da telefono
   ===================================================================== */
.cl-sez { --lav: #64748b; margin-bottom: 1.5rem; }
.cl-sez + .cl-sez { border-top: 1px solid #e2e8f0; padding-top: 1.25rem; }
.cl-sez-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .75rem; }
.cl-sez-head h3 { font-size: 1.15rem; font-weight: 700; margin: 0; padding-left: .6rem; border-left: 4px solid var(--lav); color: #0f172a; }
.cl-stato { font-size: .8rem; color: #64748b; white-space: nowrap; }
.cl-stato.ok { color: #15803d; }
.cl-stato.attesa { color: #b45309; }
.cl-stato.errore { color: #b91c1c; white-space: normal; text-align: right; }
.cl-avviso { background: #f1f5f9; border-radius: 8px; padding: .5rem .75rem; font-size: .9rem; color: #475569; margin-bottom: .75rem; }

.cl-unita { border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; margin-bottom: .75rem; overflow: hidden; }
.cl-unita-head { display: flex; align-items: center; gap: .6rem; padding: .6rem .75rem; background: #f8fafc; border-bottom: 1px solid #eef1f5; }
.cl-n { flex: none; width: 1.9rem; height: 1.9rem; border-radius: 8px; background: color-mix(in srgb, var(--lav) 15%, #fff);
    color: color-mix(in srgb, var(--lav) 80%, #000); display: grid; place-items: center; font-weight: 700; }
.cl-unita-nome { flex: 1; min-width: 0; border: 1px solid transparent; background: transparent; border-radius: 8px;
    font-size: 1.05rem; font-weight: 600; padding: .3rem .5rem; color: #0f172a; }
.cl-unita-nome:hover { border-color: #e2e8f0; background: #fff; }
.cl-unita-nome:focus { outline: none; border-color: #2563eb; background: #fff; }
.cl-unita-nome::placeholder { color: #94a3b8; font-weight: 500; }
.cl-del { flex: none; border: none; background: transparent; color: #94a3b8; width: 2.2rem; height: 2.2rem; border-radius: 8px; }
.cl-del:hover { background: #fee2e2; color: #b91c1c; }

.cl-voci { padding: 0 .75rem; }
.cl-voce { display: flex; align-items: center; gap: .75rem; padding: .65rem 0; border-bottom: 1px solid #f1f5f9; flex-wrap: wrap; }
.cl-voce:last-child { border-bottom: none; }
.cl-info { flex: 1 1 12rem; min-width: 0; }
.cl-nome { font-weight: 600; color: #1e293b; }
.cl-hint { font-size: .8rem; color: #64748b; }
.cl-costo { flex: none; min-width: 5.5rem; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; color: #0f172a; }
.cl-costo.zero { color: #cbd5e1; font-weight: 400; }

.cl-voce-scelta { display: block; }
.cl-voce-scelta .cl-nome { margin-bottom: .5rem; }
.cl-scelta { display: grid; grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr)); gap: .4rem; }
.cl-opz { border: 1px solid #e2e8f0; background: #fff; border-radius: 10px; padding: .6rem .4rem; font-weight: 600; color: #334155;
    display: flex; flex-direction: column; align-items: center; gap: .1rem; line-height: 1.2; min-height: 3.2rem; justify-content: center; }
.cl-opz small { font-weight: 500; color: #64748b; font-size: .78rem; }
.cl-opz:hover:not(:disabled) { border-color: #94a3b8; }
.cl-opz.on { background: #0f172a; border-color: #0f172a; color: #fff; }
.cl-opz.on small { color: #cbd5e1; }

.cl-sino { display: inline-flex; border: 1px solid #e2e8f0; border-radius: 10px; overflow: hidden; flex: none; }
.cl-sino button { border: none; background: #fff; min-width: 3.4rem; padding: .5rem .8rem; font-weight: 600; color: #64748b; }
.cl-sino button + button { border-left: 1px solid #e2e8f0; }
.cl-sino button.on { background: #e2e8f0; color: #0f172a; }
.cl-sino button.on.si { background: #0f172a; color: #fff; }

.cl-qta { display: inline-flex; align-items: center; gap: .3rem; flex: none; }
.cl-qta button { width: 2.6rem; height: 2.6rem; border: 1px solid #e2e8f0; background: #fff; border-radius: 10px; font-size: 1.3rem; line-height: 1; color: #0f172a; }
.cl-qta button:hover:not(:disabled) { border-color: #94a3b8; }
.cl-qta input { width: 4.2rem; height: 2.6rem; text-align: center; border: 1px solid #e2e8f0; border-radius: 10px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cl-qta input:focus, .cl-imp input:focus, .cl-sconto input:focus { outline: none; border-color: #2563eb; }
.cl-um { width: 1.2rem; color: #64748b; font-size: .9rem; }

.cl-prev { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.cl-imp { display: inline-flex; align-items: center; gap: .3rem; }
.cl-imp input { width: 9rem; height: 2.4rem; border: 1px solid #f59e0b; border-radius: 10px; padding: 0 .5rem; text-align: right; }

.cl-unita-piede { display: flex; justify-content: space-between; padding: .55rem .75rem; background: #f8fafc; border-top: 1px solid #eef1f5; font-size: .9rem; color: #475569; }
.cl-unita-piede strong { color: #0f172a; font-variant-numeric: tabular-nums; }
.cl-aggiungi { width: 100%; border: 1.5px dashed #cbd5e1; background: #fff; color: #334155; border-radius: 12px; padding: .8rem; font-weight: 600; margin-bottom: 1rem; }
.cl-aggiungi:hover { border-color: #2563eb; color: #2563eb; }
.cl-sottotitolo { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #64748b; margin: .5rem 0 .4rem; }

.cl-note-lab { font-weight: 600; color: #1e293b; margin: .5rem 0 .3rem; display: block; }
.cl-note { width: 100%; border: 1px solid #e2e8f0; border-radius: 10px; padding: .6rem .75rem; resize: vertical; }
.cl-note:focus { outline: none; border-color: #2563eb; }

.cl-riep { margin-top: .9rem; border-radius: 12px; background: #f8fafc; border: 1px solid #e2e8f0; padding: .75rem 1rem; }
.cl-riep-prom { font-size: .9rem; color: #334155; margin-bottom: .5rem; }
.cl-riep-prev { font-size: .9rem; color: #92400e; background: #fef3c7; border-radius: 8px; padding: .4rem .6rem; margin-bottom: .5rem; }
.cl-riep-riga { display: flex; justify-content: space-between; align-items: center; padding: .25rem 0; font-variant-numeric: tabular-nums; }
.cl-sconto { display: inline-flex; align-items: center; gap: .3rem; color: #475569; }
.cl-sconto input { width: 7rem; height: 2.2rem; border: 1px solid #e2e8f0; border-radius: 8px; text-align: right; padding: 0 .5rem; }
.cl-imponibile { border-top: 1px solid #e2e8f0; margin-top: .3rem; padding-top: .5rem; font-weight: 700; font-size: 1.15rem; color: #0f172a; }
.cl-iva { font-size: .75rem; color: #94a3b8; text-align: right; }
.cl-ro .cl-opz:disabled, .cl-ro .cl-sino button:disabled, .cl-ro .cl-qta button:disabled { cursor: default; }

@media (max-width: 575.98px) {
    .cl-voce { gap: .5rem; }
    .cl-info { flex-basis: 100%; }
    .cl-costo { margin-left: auto; }
    .cl-scelta { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Tipi di lavoro: editor del listino checklist ---------- */
.lst { display: flex; flex-direction: column; gap: .5rem; }
.lst-voce { display: flex; gap: .5rem; align-items: flex-start; border: 1px solid #e2e8f0; border-radius: 10px; padding: .5rem; background: #fff; }
.lst-ord { display: flex; flex-direction: column; gap: 2px; }
.lst-ord .btn { padding: 0 .4rem; line-height: 1.3; }
.lst-campi { flex: 1; min-width: 0; }
.lst-riga { display: flex; gap: .4rem; flex-wrap: wrap; }
.lst-riga .lst-nome { flex: 2 1 14rem; font-weight: 600; }
.lst-riga select { flex: 1 1 11rem; width: auto; }
.lst-prezzo { flex: 0 1 9rem; }
.lst-um { flex: 0 0 6rem; }
.lst-passo { flex: 0 1 10rem; }
.lst-minuti { flex: 0 1 9.5rem; }
.lst-opz { margin-top: .4rem; padding-left: .75rem; border-left: 3px solid #e2e8f0; display: flex; flex-direction: column; gap: .3rem; }
.lst-opz-riga { display: grid; grid-template-columns: minmax(0, 1fr) 8.5rem auto; gap: .3rem; max-width: 30rem; }
/* checklist: stanze riducibili (aperte sul telefono del tecnico, chiuse in negozio) */
.cl-unita-head { cursor: pointer; user-select: none; }
.cl-unita:not(.aperta) .cl-unita-head { border-bottom: none; }
.cl-freccia { flex: none; width: 1.2rem; color: #64748b; font-size: .85rem; text-align: center; }
.cl-unita-titolo { flex: 1; font-weight: 600; color: #334155; }
.cl-unita-tot { flex: none; font-variant-numeric: tabular-nums; color: #0f172a; margin-left: auto; padding-left: .5rem; }
.cl-unita-head:hover { background: #f1f5f9; }
.cl-tutte { border: 1px solid #e2e8f0; background: #fff; border-radius: 8px; padding: .25rem .7rem; font-size: .85rem; color: #334155; margin-left: .5rem; white-space: nowrap; }
.cl-tutte:hover { background: #f1f5f9; }
.cl-sez-head .cl-stato { margin-left: auto; }
.cl-sez-head { flex-wrap: wrap; }
@media (max-width: 575.98px) {
    .cl-unita-head { gap: .35rem; padding: .5rem .5rem; }
    .cl-n { width: 1.6rem; height: 1.6rem; font-size: .85rem; }
    .cl-unita-nome { padding: .25rem .3rem; font-size: 1rem; }
    .cl-unita-tot { font-size: .9rem; padding-left: .25rem; }
    .cl-del { width: 1.8rem; }
    .cl-freccia { width: .9rem; }
}

/* ---------- Pulsanti azione della scheda intervento: grandi, colori tenui ---------- */
.azioni-scheda { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: flex-end; }
.btn-az { display: inline-flex; align-items: center; gap: .5rem; padding: .55rem 1rem; border-radius: 10px;
    font-weight: 600; font-size: 1rem; line-height: 1.2; border: 1px solid; text-decoration: none; cursor: pointer; transition: .12s; white-space: nowrap; }
.btn-az i { font-size: .95em; }
.az-blu    { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
.az-blu:hover    { background: #dbeafe; color: #1e40af; }
.az-neutro { background: #f8fafc; border-color: #e2e8f0; color: #334155; }
.az-neutro:hover { background: #f1f5f9; color: #0f172a; }
.az-ambra  { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.az-ambra:hover  { background: #fef3c7; color: #78350f; }
.az-rosso  { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.az-rosso:hover  { background: #fee2e2; color: #991b1b; }
.az-verde  { background: #f0fdf4; border-color: #bbf7d0; color: #15803d; }
.az-verde:hover  { background: #dcfce7; color: #166534; }
@media (max-width: 767.98px) { .azioni-scheda { justify-content: flex-start; } .btn-az { font-size: .95rem; padding: .5rem .8rem; } }

/* =====================================================================
   PREVENTIVO (pages/ct_preventivo_dettaglio.php)
   ===================================================================== */
.pv-sotto { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; font-size: 1rem; }
.pv-lavoro { font-weight: 600; color: #0f172a; }
.pv-pratica { background: #f1f5f9; border-radius: 999px; padding: .15rem .7rem; color: #334155; font-size: .9rem; }
.pv-cliente { color: #2563eb; text-decoration: none; }
.pv-stato { display: inline-flex; align-items: center; gap: .4rem; padding: .5rem .9rem; border-radius: 999px; background: #f1f5f9; color: #475569; font-weight: 600; }
.pv-stato.ok { background: #dcfce7; color: #166534; }

.pv-card { border: 1px solid #e2e8f0; border-radius: 14px; box-shadow: none; overflow: visible; }
.pv-card-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .9rem 1.1rem; border-bottom: 1px solid #eef1f5; flex-wrap: wrap; }
.pv-card-head h2 { font-size: 1.15rem; font-weight: 700; margin: 0; color: #0f172a; }
.pv-card-body { padding: 1rem 1.1rem; }
.pv-card-foot { padding: .75rem 1.1rem; border-top: 1px solid #eef1f5; }
.pv-zona { font-size: .9rem; color: #334155; background: #f1f5f9; border-radius: 999px; padding: .2rem .75rem; }
.pv-zona.manca { background: #fef3c7; color: #92400e; }

.pv-righe { width: 100%; border-collapse: collapse; }
.pv-righe th { font-size: .85rem; font-weight: 700; color: #1e293b; background: #e8edf4; padding: .55rem .6rem; border-bottom: 2px solid #cbd5e1; }
.pv-righe th:first-child, .pv-righe td:first-child { padding-left: 1.1rem; }
.pv-righe td { padding: .55rem .6rem; border-bottom: 1px solid #f1f5f9; vertical-align: top; }
.pv-righe .num { text-align: right; }
.pv-righe th.num { width: 9.5rem; }
.pv-righe input.num { font-variant-numeric: tabular-nums; }
.pv-righe .riga-incentivo { background: #f0fdf4; border-color: #bbf7d0; color: #166534; font-weight: 600; }
.riga-info { font-size: .8rem; color: #64748b; margin-top: .25rem; }
.riga-dropdown { display: none; position: absolute; top: 100%; left: 0; width: min(34rem, 88vw); max-height: 360px; z-index: 9999; background: #fff; border: 1px solid #e2e8f0;
    border-radius: 10px; overflow-y: auto; box-shadow: 0 8px 24px rgba(15, 23, 42, .12); margin-top: 2px; }
.pv-del { border: none; background: transparent; color: #94a3b8; width: 2.2rem; height: 2.2rem; border-radius: 8px; }
.pv-del:hover { background: #fee2e2; color: #b91c1c; }
.pv-vuoto { padding: 1rem 1.1rem; color: #94a3b8; }

.pv-campo { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .55rem 0; flex-wrap: wrap; }
.pv-campo label { font-weight: 600; color: #1e293b; margin: 0; }
.pv-campo label small { font-weight: 400; color: #64748b; margin-left: .25rem; }
.pv-euro { display: inline-flex; align-items: center; gap: .4rem; }
.pv-euro span { color: #64748b; }
.pv-euro input { width: 10rem; height: 2.6rem; text-align: right; border: 1px solid #e2e8f0; border-radius: 10px; padding: 0 .7rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.pv-euro input:focus { outline: none; border-color: #2563eb; }
.pv-cl { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: .7rem .9rem; margin: .25rem 0 .75rem; }
.pv-cl-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.pv-cl-head small { color: #64748b; }
.pv-cl-usa { padding: .35rem .8rem; font-size: .9rem; }
.pv-cl-avviso { margin-top: .5rem; font-size: .9rem; color: #92400e; background: #fef3c7; border-radius: 8px; padding: .35rem .6rem; }
.pv-cl-dett summary { cursor: pointer; color: #475569; font-size: .9rem; margin-top: .4rem; }
.pv-cl-dett ul { list-style: none; padding: 0; margin: .4rem 0 0; font-size: .9rem; }
.pv-cl-dett li { display: flex; justify-content: space-between; gap: 1rem; padding: .15rem 0; border-bottom: 1px dashed #e2e8f0; }
.pv-cl-nessuna { color: #64748b; font-size: .9rem; }

details.pv-pratica > summary { list-style: none; cursor: pointer; border-bottom: none; }
details.pv-pratica > summary::-webkit-details-marker { display: none; }
details.pv-pratica > summary h2::before { content: "\f054"; font-family: "Font Awesome 6 Free"; font-weight: 900; font-size: .8rem; margin-right: .6rem; color: #64748b; display: inline-block; transition: .15s; }
details.pv-pratica[open] > summary h2::before { transform: rotate(90deg); }
details.pv-pratica[open] > summary { border-bottom: 1px solid #eef1f5; }
.pv-pratica-sint { font-size: .9rem; color: #64748b; }
.pv-imm { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: .55rem .8rem; color: #334155; }

.pv-riep .pv-card-body { padding-top: .5rem; }
.pv-r { display: flex; justify-content: space-between; gap: 1rem; padding: .4rem 0; font-variant-numeric: tabular-nums; color: #334155; }
.pv-r span:last-child { font-weight: 600; color: #0f172a; white-space: nowrap; }
.pv-tot { border-top: 1px solid #e2e8f0; margin-top: .3rem; padding-top: .7rem; font-size: 1.2rem; font-weight: 700; }
.pv-tot span { color: #0f172a !important; font-weight: 700; }
.pv-inc span { color: #15803d !important; font-weight: 600; }
.pv-inc small { font-weight: 400; color: #b45309; }
.pv-paga { margin-top: .5rem; background: #0f172a; color: #fff; border-radius: 10px; padding: .8rem 1rem; font-size: 1.35rem; font-weight: 700; }
.pv-paga span { color: #fff !important; }
.pv-salvato { font-size: .8rem; color: #64748b; }
.pv-salvato.ok { color: #15803d; } .pv-salvato.attesa { color: #b45309; } .pv-salvato.errore { color: #b91c1c; }
@media (max-width: 767.98px) { .pv-righe th.num { width: 7rem; } .pv-euro input { width: 8rem; } }
.pv-nota { font-weight: 400; color: #64748b; font-size: .8rem; }
.pv-detr { align-items: flex-start; }
.pv-perc { display: flex; width: fit-content; margin-top: .35rem; }
.pv-perc button { min-width: 0; padding: .3rem .6rem; font-size: .8rem; }
.pv-inc small.pv-nota { color: #64748b; }

/* Simula preventivo: scelta della pratica, riquadri tutti uguali */
.sp-lavoro + .sp-lavoro { margin-top: 1.1rem; padding-top: 1.1rem; border-top: 1px solid #eef1f5; }
.sp-nome { font-weight: 700; font-size: 1.1rem; color: #0f172a; margin-bottom: .6rem; }
.sp-griglia { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.sp-pratica { display: flex; align-items: center; gap: .7rem; min-height: 4rem; padding: .7rem 1rem; border: 1px solid #e2e8f0;
    border-radius: 12px; background: #fff; color: #1e293b; font-weight: 600; text-decoration: none; transition: .12s; }
.sp-pratica i { width: 2.2rem; height: 2.2rem; flex: none; display: grid; place-items: center; border-radius: 10px; background: #eff6ff; color: #1d4ed8; }
.sp-pratica:hover { border-color: #93c5fd; background: #eff6ff; color: #1e40af; }
.sp-pratica:hover i { background: #1d4ed8; color: #fff; }
.sp-dialog { max-width: 620px; } .sp-pratica span { white-space: nowrap; }
.pv-dup { border: none; background: transparent; color: #64748b; width: 2.2rem; height: 2.2rem; border-radius: 8px; } .pv-dup:hover { background: #eff6ff; color: #1d4ed8; } .pv-righe th:last-child { width: 5.5rem; }

/* Suggerimenti al passaggio del mouse: grandi e leggibili */
.tip-grande { position: fixed; z-index: 3000; max-width: 360px; padding: .55rem .8rem; border-radius: 8px;
    background: #0f172a; color: #fff; font-size: 1rem; line-height: 1.35; font-weight: 500;
    box-shadow: 0 6px 20px rgba(15, 23, 42, .25); pointer-events: none; opacity: 0; transform: translateY(-2px);
    transition: opacity .12s, transform .12s; left: -9999px; top: -9999px; }
.tip-grande.on { opacity: 1; transform: none; }
.tooltip { --bs-tooltip-font-size: 1rem; --bs-tooltip-max-width: 360px; --bs-tooltip-padding-x: .8rem; --bs-tooltip-padding-y: .55rem; }
/* Preventivo: quota agevolata da scalare (per la fattura sull'altro gestionale) */
.pv-scalare-tab { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.pv-scalare-tab th { font-size: .85rem; font-weight: 700; color: #1e293b; background: #e8edf4; padding: .5rem .8rem; border-bottom: 2px solid #cbd5e1; }
.pv-scalare-tab td { padding: .5rem .8rem; border-bottom: 1px solid #f1f5f9; }
.pv-scalare-tab .num { text-align: right; white-space: nowrap; }
.pv-scalare-tab td.num { font-weight: 600; }
.pv-scalare-tab tfoot td { font-weight: 700; font-size: 1.05rem; border-top: 1.5px solid #334155; border-bottom: none; }
.pv-scalare-avviso { margin: .75rem 1rem 0; background: #fef3c7; color: #92400e; border-radius: 8px; padding: .55rem .75rem; font-size: .92rem; }
.pv-scalare-piede { padding: .6rem 1rem .8rem; font-size: .8rem; color: #64748b; }
.pv-scalare-sotto { font-weight: 600; color: #334155; font-size: .95rem; } .pv-scalare-tab tfoot td { padding-bottom: .8rem; }
.badge-gse { display: inline-block; font-size: .7rem; font-weight: 700; letter-spacing: .03em; color: #166534; background: #dcfce7; border: 1px solid #bbf7d0; border-radius: 6px; padding: .05rem .35rem; vertical-align: middle; margin-left: .3rem; }
.badge-dich { display: inline-block; font-size: .7rem; font-weight: 700; letter-spacing: .03em; color: #1e40af; background: #dbeafe; border: 1px solid #bfdbfe; border-radius: 6px; padding: .05rem .35rem; vertical-align: middle; margin-left: .3rem; }
.sc-filtri { max-width: 32rem; margin-bottom: .75rem; } .cal-sq small { color: inherit; opacity: .6; margin-left: .2rem; }

/* ===== Rendiconti ditte ===== */
.rd-ditte { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(22rem, 100%), 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.rd-ditta { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 1rem 1.1rem; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.rd-nome { font-size: 1.2rem; font-weight: 700; margin-bottom: .4rem; }
.rd-num { font-size: 2rem; font-weight: 800; color: #b45309; line-height: 1.1; margin-bottom: .6rem; }
.rd-num span { font-size: 1rem; font-weight: 600; color: #555; }
.rd-mesi { display: flex; flex-wrap: wrap; gap: .5rem; }
.rd-ok { font-size: 1.05rem; font-weight: 600; color: #15803d; }
.rd-tab td, .rd-tab th, .rd-righe td, .rd-righe th { font-size: 1.05rem; vertical-align: middle; }
.rd-stato { display: inline-block; font-size: .95rem; font-weight: 700; padding: .3rem .7rem; border-radius: 999px; border: 1px solid transparent; }
.rd-stato.az-neutro { background: #f3f4f6; color: #374151; border-color: #e5e7eb; }
.rd-stato.az-blu    { background: #dbeafe; color: #1e40af; border-color: #bfdbfe; }
.rd-stato.az-verde  { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.rd-totali { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(15rem, 100%), 1fr)); gap: .8rem; margin-bottom: 1.25rem; }
.rd-tot { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: .9rem 1rem; }
.rd-tot-n { font-size: 1.9rem; font-weight: 800; line-height: 1.1; }
.rd-tot-n span { font-size: 1.05rem; font-weight: 600; color: #555; }
.rd-tot-l { font-size: .98rem; color: #555; margin-top: .25rem; }
.rd-tot-g { background: #fef3c7; border-color: #fde68a; }
.rd-tot-g .rd-tot-n { color: #92400e; }
@media (max-width: 576px) { .rd-num, .rd-tot-n { font-size: 1.6rem; } }

/* ===== Documenti pratica ===== */
.dp-sottotitolo { font-size: 1.1rem; color: #444; }
.dp-scelta { display: flex; flex-direction: column; gap: .7rem; max-width: 40rem; }
.dp-data { display: flex; align-items: center; gap: .8rem; margin-bottom: 1rem; flex-wrap: wrap; }
.dp-data label { font-size: 1.1rem; font-weight: 600; }
.dp-data input { max-width: 13rem; font-size: 1.1rem; }
.dp-avviso { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; background: #fef3c7; border: 1px solid #fde68a; border-radius: 12px; padding: .8rem 1rem; font-size: 1.1rem; margin-bottom: 1rem; }
.dp-docs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(21rem, 100%), 1fr)); gap: .9rem; margin-bottom: 1.5rem; }
.dp-doc { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .5rem; }
.dp-doc-testa { display: flex; justify-content: space-between; align-items: flex-start; gap: .6rem; }
.dp-doc-nome { font-size: 1.15rem; font-weight: 700; line-height: 1.25; }
.dp-doc .rd-stato { white-space: nowrap; font-size: .85rem; }
.rd-stato.az-ambra { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.rd-stato.az-rosso { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.dp-manca { font-size: 1rem; color: #92400e; }
.dp-nota { font-size: 1rem; color: #1e40af; }
.dp-doc .btn-az { align-self: flex-start; margin-top: auto; }
.dp-form .form-label { font-size: 1rem; font-weight: 600; }
.dp-form .form-control, .dp-form .form-select { font-size: 1.1rem; }
.dp-h2 { font-size: 1.3rem; font-weight: 700; margin: 0 0 .8rem; }
.dp-h2-sub { font-size: 1rem; font-weight: 500; color: #555; margin-left: .4rem; }
.dp-scelte { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.dp-lab { font-size: 1.1rem; font-weight: 600; margin-right: .3rem; }
.dp-scelta-btn { display: inline-block; font-size: 1.05rem; font-weight: 600; padding: .55rem 1rem; border-radius: 10px; border: 1.5px solid #cbd5e1; background: #fff; color: #334155; cursor: pointer; }
.btn-check:checked + .dp-scelta-btn, .dp-scelta-btn.on { background: #dbeafe; border-color: #1f6fb2; color: #1e40af; }

/* Elementi dell'aspetto nuovo: nascosti nell'aspetto classico */
.stato-ico, .percorso, .percorso-nota, .tn-sotto { display: none; }

/* ================================================================== */
/*  Magazzino: schede, valori, ritiri squadra, furgoni, strumenti      */
/*  (vale per entrambi gli aspetti; i colori seguono il tema se c'è)   */
/* ================================================================== */
.mg-schede { display: flex; gap: .35rem; overflow-x: auto; padding: .25rem .1rem .6rem; margin-bottom: .75rem; scrollbar-width: thin; }
.mg-scheda { display: inline-flex; align-items: center; gap: .5rem; white-space: nowrap; padding: .6rem 1rem; border-radius: 999px;
    font-size: 1rem; font-weight: 600; text-decoration: none; color: var(--notte, #1f2937); background: #fff; border: 1px solid var(--linea, #e5e7eb); }
.mg-scheda i { color: var(--nebbia, #6b7280); }
.mg-scheda:hover { border-color: var(--freddo, #0d6efd); color: var(--freddo-2, #0a58ca); }
.mg-scheda.on { background: var(--freddo, #0d6efd); border-color: var(--freddo, #0d6efd); color: #fff; }
.mg-scheda.on i { color: #fff; }
.mg-badge { background: var(--caldo, #dc3545); color: #fff; border-radius: 999px; font-size: .78rem; padding: .05rem .5rem; font-weight: 700; }

.mg-valori { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.mg-valore { display: flex; flex-direction: column; gap: .15rem; padding: 1rem 1.2rem; background: #fff; border: 1px solid var(--linea, #e5e7eb);
    border-radius: var(--r-medio, 12px); color: var(--notte, #1f2937); text-decoration: none; }
.mg-valore span { font-size: .95rem; color: var(--nebbia, #6b7280); font-weight: 600; }
.mg-valore strong { font-size: 1.75rem; font-weight: 750; line-height: 1.15; font-variant-numeric: tabular-nums; }
.mg-valore small { color: var(--nebbia, #6b7280); }
.mg-valore-forte { background: var(--freddo, #0d6efd); border-color: var(--freddo, #0d6efd); color: #fff; }
.mg-valore-forte span, .mg-valore-forte small { color: rgba(255,255,255,.85); }
.mg-valore-caldo { background: var(--caldo-bg, #fde8e8); border-color: var(--caldo, #dc3545); }
.mg-valore-caldo strong { color: var(--caldo-tx, #9b1c1c); }
a.mg-valore:hover { border-color: var(--freddo, #0d6efd); color: inherit; }

/* --- Ritiri squadra --- */
.rt-h2 { font-size: 1.15rem; font-weight: 700; margin: .25rem 0 .75rem; display: flex; align-items: center; gap: .5rem; }
.rt-conta { background: var(--ghiaccio, #e7f1ff); color: var(--freddo-2, #0a58ca); border-radius: 999px; font-size: .9rem; padding: .1rem .6rem; }
.rt-pallino { display: inline-block; width: .85rem; height: .85rem; border-radius: 50%; flex: 0 0 auto; vertical-align: middle; margin-right: .4rem; }
.rt-pallino-sm { width: .6rem; height: .6rem; margin-right: .35rem; }
.rt-pallino-lg { width: 1.3rem; height: 1.3rem; margin-right: 0; }
.rt-aperti { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .6rem; margin-bottom: 1.5rem; }
.rt-aperto { display: flex; align-items: center; gap: .6rem; padding: .9rem 1rem; background: var(--ambra-bg, #fff4d6); border: 1px solid var(--ambra, #f0b429);
    border-radius: var(--r-medio, 12px); color: var(--notte, #1f2937); text-decoration: none; font-size: 1rem; }
.rt-aperto:hover { color: inherit; filter: brightness(.98); }
.rt-aperto-testo { display: flex; flex-direction: column; line-height: 1.25; }
.rt-aperto-testo small { color: var(--nebbia, #6b7280); }
.rt-squadre { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: .75rem; }
.rt-squadra { background: #fff; border: 1px solid var(--linea, #e5e7eb); border-radius: var(--r-grande, 16px); padding: 1rem; display: flex; flex-direction: column; gap: .8rem; }
.rt-squadra-testa { display: flex; align-items: center; gap: .3rem; }
.rt-squadra-nome { font-size: 1.2rem; font-weight: 700; }
.rt-squadra-sub { color: var(--nebbia, #6b7280); font-size: .92rem; }
.rt-squadra-azioni { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: auto; }
.rt-squadra-azioni .btn-az { justify-content: center; flex: 1 1 160px; white-space: nowrap; }
.rt-nota { color: var(--caldo-tx, #9b1c1c); background: var(--caldo-bg, #fde8e8); border-radius: 8px; padding: .4rem .6rem; font-size: .92rem; }
.rt-persone { display: flex; flex-wrap: wrap; gap: .4rem; }
.rt-percorso { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; font-size: 1.05rem; color: var(--nebbia, #6b7280); margin-top: .3rem; }
.rt-percorso span { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; color: var(--notte, #1f2937); }
.rt-percorso > i { color: var(--freddo, #0d6efd); }

.rt-pagina { max-width: 760px; padding-bottom: 7rem; }
.rt-cerca { position: relative; margin-bottom: .5rem; }
.rt-cerca i { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--nebbia, #6b7280); }
body .rt-cerca input.form-control { font-size: 1.15rem; padding: .85rem 1rem .85rem 2.7rem; border-radius: var(--r-medio, 12px); }
.rt-risultati { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1rem; }
.rt-risultati:empty { display: none; }
.rt-art { display: flex; align-items: center; gap: .75rem; width: 100%; text-align: left; padding: .75rem 1rem; background: #fff;
    border: 1px solid var(--linea, #e5e7eb); border-radius: var(--r-medio, 12px); font-size: 1rem; color: var(--notte, #1f2937); }
.rt-art > span:first-child { flex: 1 1 auto; min-width: 0; }
.rt-art small { display: block; color: var(--nebbia, #6b7280); }
.rt-art-q { white-space: nowrap; font-weight: 700; font-variant-numeric: tabular-nums; }
.rt-art > i { color: #fff; background: var(--freddo, #0d6efd); width: 2.2rem; height: 2.2rem; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.rt-art:hover, .rt-art:focus-visible { border-color: var(--freddo, #0d6efd); }
.rt-chi { margin-bottom: 1rem; }
.rt-chi label { font-weight: 600; margin-bottom: .25rem; display: block; }
.rt-lista { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--linea, #e5e7eb); border-radius: var(--r-medio, 12px); overflow: hidden; }
.rt-riga { display: flex; align-items: center; gap: .75rem; padding: .75rem 1rem; border-bottom: 1px solid var(--linea-2, #f0f0f0); }
.rt-riga:last-child { border-bottom: 0; }
.rt-riga-testo { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.rt-riga-testo strong { font-size: 1.05rem; }
.rt-riga-testo small { color: var(--nebbia, #6b7280); }
.rt-riga-q { font-weight: 700; font-size: 1.1rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rt-poco { background: var(--caldo-bg, #fde8e8); }
.rt-poco .rt-riga-testo small { color: var(--caldo-tx, #9b1c1c); font-weight: 600; }
.rt-passi { display: flex; align-items: center; gap: .3rem; flex: 0 0 auto; }
.rt-passi input { width: 4.6rem; text-align: center; font-size: 1.1rem; font-weight: 700; padding: .4rem .2rem; }
.rt-meno, .rt-piu { width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 1px solid var(--linea, #e5e7eb); background: #fff; color: var(--notte, #1f2937); font-size: 1rem; }
.rt-piu { background: var(--freddo, #0d6efd); border-color: var(--freddo, #0d6efd); color: #fff; }
.rt-um { min-width: 2rem; color: var(--nebbia, #6b7280); font-size: .9rem; }
.rt-vuoto { padding: 1.25rem 1rem; color: var(--nebbia, #6b7280); text-align: center; font-size: 1rem; }
.rt-barra { position: sticky; bottom: 0; z-index: 20; display: flex; gap: .5rem; padding: .75rem 0; margin-top: 1rem;
    background: linear-gradient(to top, var(--aria, #f5f6f8) 75%, transparent); }
.rt-barra .btn-az { padding-top: .85rem; padding-bottom: .85rem; font-size: 1.1rem; }
.rt-riepilogo { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.rt-riepilogo > div { background: #fff; border: 1px solid var(--linea, #e5e7eb); border-radius: var(--r-medio, 12px); padding: .7rem 1rem; display: flex; flex-direction: column; }
.rt-riepilogo span { color: var(--nebbia, #6b7280); font-size: .9rem; }
.rt-riepilogo strong { font-size: 1.15rem; }

/* --- Furgoni, magazzini, strumenti, il mio furgone --- */
.fu-griglia, .mz-griglia { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 1rem; align-items: start; }
.fu-card .card-header { font-size: 1.1rem; font-weight: 700; }
.fu-valore { font-weight: 750; font-variant-numeric: tabular-nums; color: var(--freddo-2, #0a58ca); }
.mz-nome { font-size: 1.2rem; font-weight: 700; }
.mz-ditta { color: var(--nebbia, #6b7280); }
.mz-numeri, .st-numeri { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: .5rem; margin-top: .75rem; }
.mz-numeri > div, .st-numeri > * { display: flex; flex-direction: column; padding: .6rem .8rem; background: var(--t-fondo, #f8f9fa); border-radius: 10px;
    color: var(--notte, #1f2937); text-decoration: none; }
.mz-numeri strong, .st-numeri strong { font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.mz-numeri span, .st-numeri span { color: var(--nebbia, #6b7280); font-size: .88rem; }
.st-numeri { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin: 0 0 1rem; }
.st-numeri > * { background: #fff; border: 1px solid var(--linea, #e5e7eb); padding: .9rem 1.1rem; }
.st-numeri strong { font-size: 1.6rem; }
.st-allarme { background: var(--caldo-bg, #fde8e8) !important; border-color: var(--caldo, #dc3545) !important; }
.st-allarme strong { color: var(--caldo-tx, #9b1c1c); }
.st-azione { background: var(--t-fondo, #f8f9fa); border-radius: var(--r-medio, 12px); padding: .9rem; }
.st-storia { list-style: none; padding: 0; margin: 0; }
.st-storia li { display: flex; gap: .8rem; padding: .55rem 0; border-bottom: 1px solid var(--linea-2, #f0f0f0); }
.st-storia li > span { flex: 0 0 5.5rem; color: var(--nebbia, #6b7280); font-variant-numeric: tabular-nums; font-size: .92rem; }
.st-storia small { display: block; color: var(--nebbia, #6b7280); }
.mf-lista .list-group-item { padding: .9rem 1rem; font-size: 1.05rem; }
.mf-q { font-size: 1.35rem; font-weight: 750; white-space: nowrap; font-variant-numeric: tabular-nums; }

@media (max-width: 767.98px) {
    .rt-squadre, .fu-griglia, .mz-griglia { grid-template-columns: 1fr; }
    .tema-nuovo .rt-barra { bottom: calc(74px + env(safe-area-inset-bottom, 0px)); }
    .rt-riga:has(.rt-passi) { flex-wrap: wrap; }
    .rt-riga:has(.rt-passi) .rt-riga-testo { flex-basis: calc(100% - 1rem); }
    .st-numeri { grid-template-columns: 1fr 1fr; }
    .st-numeri strong { font-size: 1.35rem; }
    .rt-passi { margin-left: auto; }
    .mg-valore strong { font-size: 1.45rem; }
}

/* --- Anomalie inventariali --- */
.an-viste { display: inline-flex; background: #fff; border: 1px solid var(--linea, #e5e7eb); border-radius: 999px; padding: .2rem; }
.an-viste a { padding: .45rem 1rem; border-radius: 999px; font-weight: 600; text-decoration: none; color: var(--nebbia, #6b7280); }
.an-viste a.on { background: var(--notte, #1f2937); color: #fff; }
.an-vuoto { display: flex; flex-direction: column; align-items: center; gap: .3rem; text-align: center; padding: 2.5rem 1rem; background: #fff;
    border: 1px solid var(--linea, #e5e7eb); border-radius: var(--r-grande, 16px); color: var(--nebbia, #6b7280); }
.an-vuoto i { font-size: 2.2rem; color: var(--verde, #198754); }
.an-vuoto strong { font-size: 1.2rem; color: var(--notte, #1f2937); }
.an-lista { display: flex; flex-direction: column; gap: 1rem; }
.an-card { background: #fff; border: 1px solid var(--linea, #e5e7eb); border-left: 5px solid var(--caldo, #dc3545); border-radius: var(--r-grande, 16px); padding: 1rem 1.2rem; }
.an-testa { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.an-art { display: flex; flex-direction: column; min-width: 0; }
.an-art strong { font-size: 1.2rem; }
.an-art small { color: var(--nebbia, #6b7280); }
.an-giacenza { display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.an-giacenza span, .an-giacenza small { color: var(--nebbia, #6b7280); font-size: .88rem; }
.an-giacenza strong { font-size: 1.6rem; font-variant-numeric: tabular-nums; line-height: 1.15; }
.an-giacenza.neg strong { color: var(--caldo-tx, #9b1c1c); }
.an-giacenza.ok strong { color: var(--verde-tx, #0f5132); }
.an-eventi { list-style: none; margin: .75rem 0; padding: 0; border-top: 1px solid var(--linea-2, #f0f0f0); }
.an-eventi li { display: flex; gap: .9rem; padding: .6rem 0; border-bottom: 1px solid var(--linea-2, #f0f0f0); }
.an-eventi small { color: var(--nebbia, #6b7280); }
.an-quando { flex: 0 0 5.2rem; color: var(--nebbia, #6b7280); font-variant-numeric: tabular-nums; font-size: .92rem; padding-top: .1rem; }
.an-piede { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; }
.an-totale { font-size: 1.05rem; }
.an-azioni { display: flex; gap: .5rem; flex-wrap: wrap; }
.rt-anomalia { display: flex; gap: .6rem; align-items: center; background: var(--caldo-bg, #fde8e8); color: var(--caldo-tx, #9b1c1c);
    border-radius: var(--r-medio, 12px); padding: .75rem 1rem; margin-bottom: 1rem; font-weight: 600; }
.rt-anomalia a { color: inherit; }
@media (max-width: 767.98px) {
    .an-giacenza { align-items: flex-start; text-align: left; }
    .an-azioni, .an-azioni .btn-az { width: 100%; justify-content: center; }
}

/* Pianificazione: data bloccata finché non c'è la squadra */
.ds-avviso { display: flex; align-items: center; gap: .55rem; color: var(--ambra-tx, #7a4e00); background: var(--ambra-bg, #fff4d6);
    border-radius: 10px; padding: .55rem .8rem; font-weight: 600; font-size: .95rem; }
.ds-avviso-col:has(.ds-avviso[style*="none"]) { display: none; }
.ds-bloccato { opacity: .5; }
.ds-bloccato input { cursor: not-allowed; }

/* --- Pianificatore: calendario settimanale con le squadre --- */
.pf { display: flex; flex-direction: column; gap: .6rem; }
.modal-body:has(> .pf) { padding-top: .8rem; padding-bottom: .4rem; }
.modal:has(.pf) .modal-footer { padding-top: .5rem; padding-bottom: .6rem; }
.pf-testa { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: space-between; }
.pf-modi { display: inline-flex; background: var(--t-fondo, #f3f4f6); border-radius: 999px; padding: .2rem; gap: .15rem; }
.pf-modi button { border: 0; background: transparent; border-radius: 999px; padding: .4rem .9rem; font-weight: 600; color: var(--nebbia, #6b7280);
    white-space: nowrap; display: inline-flex; align-items: center; gap: .1rem; }
.pf-modi button.on { background: #fff; color: var(--notte, #1f2937); box-shadow: 0 1px 3px rgba(16,37,60,.15); }
.pf-vai { display: inline-flex; align-items: center; gap: .4rem; color: var(--nebbia, #6b7280); margin: 0; }
.pf-vai input { width: auto; }
.pf-legenda { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .9rem; font-size: .92rem; font-weight: 600; }
.pf-legenda:empty { display: none; }
.pf-leg { display: inline-flex; align-items: center; }
.pf-leg-ditta { color: var(--nebbia, #6b7280); font-weight: 700; font-size: .8rem; margin-left: .3rem; }
.pf-leg-ditta:first-child { margin-left: 0; }
.pf-cal { background: #fff; border: 1px solid var(--linea, #e5e7eb); border-radius: var(--r-medio, 12px); padding: .6rem; }
.pf-cal .fc-toolbar.fc-header-toolbar { margin-bottom: .5rem; }
.pf-cal .fc-toolbar-title { font-size: 1.15rem; }
.pf-cal .fc-timegrid-slot { height: var(--pf-slot, 1.6rem) !important; }
.pf-cal .fc-timegrid-slot-label-cushion { line-height: 1; padding: 0 .3rem 0 0; font-size: .72rem !important; }
.pf-cal .fc-timegrid-slot-label-frame { line-height: 1; height: 0; overflow: visible; }   /* l'etichetta non impone altezza alla riga */
.pf-cal .fc-timegrid-slot-label-cushion { position: relative; z-index: 3; top: .1em; background: transparent; }
.pf-cal .fc-timegrid-slot-label { position: relative; z-index: 3; }
.pf-cal .fc-timegrid-slots td { line-height: 1; font-size: 0; }   /* senza, le righe non scendono sotto l'altezza del testo (le etichette hanno la loro misura in rem) */
@media (max-width: 767.98px) { .pf-cal .fc-timegrid-slot { height: 1.9rem !important; } }
.pf-cal .fc-highlight { background: color-mix(in srgb, var(--freddo, #0d6efd) 22%, transparent); }
.pf-cal .fc-non-business { background: var(--spento-bg, #eef2f5); }
.pf-cal .fc-timegrid-col.fc-day-past { background: repeating-linear-gradient(-45deg, transparent 0 6px, rgba(148,163,184,.08) 6px 12px); }
.pf-cal .fc-event.pf-sel-ev { background: var(--ev, #0d6efd) !important; border: 2px solid #fff !important; box-shadow: 0 0 0 2px var(--ev, #0d6efd), 0 4px 12px rgba(16,37,60,.25) !important; z-index: 5 !important; }
.pf-cal .fc-event.pf-sel-ev .ev-in, .pf-cal .fc-event.pf-sel-ev .ev-top { color: #fff !important; }
.pf-cal .fc-event.pf-sel-da-scegliere { --ev: #94a3b8 !important; background: repeating-linear-gradient(-45deg, #94a3b8 0 6px, #a8b4c4 6px 12px) !important; }
.pf-cal .fc-event:not(.pf-sel-ev) { cursor: default; }
.pf-scelta:empty { display: none; }
.pf-scelta { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .9rem; padding: .7rem .9rem; border-radius: var(--r-medio, 12px); font-size: 1rem; }
.pf-scelta > i { font-size: 1.1rem; }
.pf-scelta.ok { background: var(--verde-bg, #dbf4e6); color: var(--verde-tx, #0e6136); }
.pf-scelta.manca { background: var(--ambra-bg, #fff1cc); color: var(--ambra-tx, #7a4e00); font-weight: 600; }
.pf-scelta.no { background: var(--rosso-bg, #fde3e6); color: var(--rosso-tx, #93162a); font-weight: 600; }
.pf-scuoti { animation: pfScuoti .4s; }
@keyframes pfScuoti { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@media (prefers-reduced-motion: reduce) { .pf-scuoti { animation: none; outline: 2px solid currentColor; } }
.pf-altre { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .35rem; font-weight: 600; }
.pf-sq-scegli { display: inline-flex; align-items: center; border: 1.5px solid var(--linea, #e5e7eb); background: #fff; color: var(--notte, #1f2937);
    border-radius: 999px; padding: .3rem .8rem; font-weight: 600; }
.pf-sq-scegli:hover { border-color: var(--freddo, #0d6efd); }
.pf-sq-scegli.on { border-color: var(--notte, #1f2937); box-shadow: inset 0 0 0 1px var(--notte, #1f2937); }
.pf-cambio { display: inline-flex; align-items: center; gap: .4rem; background: var(--ambra-bg, #fff1cc); color: var(--ambra-tx, #7a4e00);
    border-radius: 999px; padding: .2rem .7rem; font-weight: 600; font-size: .92rem; }
@media (max-width: 767.98px) { .pf-modi { width: 100%; } .pf-modi button { flex: 1; justify-content: center; } .pf-vai { width: 100%; } .pf-vai input { flex: 1; } }

/* --- Squadra in testata della scheda intervento --- */
.sq-etichetta { display: inline-flex; align-items: center; gap: .45rem; border: 1px solid var(--linea, #e5e7eb); background: #fff; border-radius: 999px;
    padding: .3rem .4rem .3rem .8rem; font-size: 1rem; font-weight: 600; color: var(--notte, #1f2937); }
.sq-etichetta small { color: var(--nebbia, #6b7280); font-weight: 500; }
.sq-etichetta .sq-cambia { border: 0; background: var(--t-fondo, #f3f4f6); border-radius: 999px; padding: .2rem .7rem; font-weight: 600; color: var(--freddo-2, #0a58ca); }
.sq-etichetta .sq-cambia:hover { background: var(--ghiaccio, #e7f1ff); }
.sq-manca { display: inline-flex; align-items: center; gap: .45rem; border: 1px dashed var(--ambra, #d58a00); background: var(--ambra-bg, #fff1cc);
    color: var(--ambra-tx, #7a4e00); border-radius: 999px; padding: .35rem .9rem; font-weight: 700; font-size: 1rem; }
.sq-manca:hover { filter: brightness(.97); }
.ds-info { cursor: help; margin-left: .2rem; }
.sq-nota { display: flex; align-items: center; gap: .5rem; color: var(--nebbia, #6b7280); font-weight: 600; }
.dp-scelte-manca .dp-scelta-btn { border-color: var(--rosso, #dc3545); }
/* nome dell'intervento e squadra sulla stessa riga */
.scheda-titolo { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem 1rem; margin-bottom: .25rem; }
.scheda-titolo h1 { margin: 0; }

/* --- Pianificatore: griglia ben leggibile (sfondo bianco, ore e giorni marcati) --- */
.pf .pf-cal .fc-scrollgrid, .pf .pf-cal .fc-timegrid-body { background: #fff; }
.pf .pf-cal .fc-timegrid-slots, .pf .pf-cal .fc-timegrid-slot-lane { background: transparent; }   /* le righe stanno sopra le colonne: trasparenti */
.pf .pf-cal .fc-timegrid-col.fc-day-today { background: #fffbeb; }                 /* oggi: leggero giallo */
.pf .pf-cal .fc-non-business { background: #e4e9f0 !important; opacity: 1; }         /* fuori turno: grigio deciso */
.pf .pf-cal .fc-timegrid-slot-lane { border-top: 1px solid #cbd3dd !important; }     /* ogni ora: linea piena */
.pf .pf-cal .fc-timegrid-slot-lane.fc-timegrid-slot-minor { border-top: 1px dashed #dfe5ec !important; }  /* mezz'ora: tratteggio */
.pf .pf-cal .fc-timegrid-col, .pf .pf-cal .fc-col-header-cell { border-left: 1.5px solid #b9c3cf !important; }  /* separazione tra i giorni */
.pf .pf-cal .fc-timegrid-axis + .fc-col-header-cell, .pf .pf-cal .fc-timegrid-axis + .fc-timegrid-col { border-left-color: #b8c2ce !important; }
.pf .pf-cal .fc-timegrid-slot-label-cushion { color: #475569 !important; font-weight: 600; }
.pf .pf-cal .fc-col-header { border-bottom: 2px solid #c3ccd7; }
.pf .pf-cal .fc-scrollgrid { border: 1px solid #c3ccd7 !important; }

/* --- Rendiconti: anteprima prima della creazione --- */
.rd-anteprima { border: 2px solid var(--freddo, #0d6efd); }
.rd-ant-t { font-size: 1.3rem; font-weight: 700; }
.rd-ant-sub { color: var(--nebbia, #6b7280); }
.rd-ant-tot { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.rd-ant-tot > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem; background: var(--t-fondo, #f8f9fa); border-radius: 12px; padding: .8rem 1rem; }
.rd-ant-tot strong { font-size: 1.6rem; }
.rd-ant-tot small { flex-basis: 100%; color: var(--nebbia, #6b7280); }
.rd-ant-tot .rd-ant-imp { background: var(--ambra-bg, #fdecd9); }
.rd-zero td { background: var(--ambra-bg, #fff4d6) !important; }

/* --- Aggiungi materiale all'intervento --- */
.am-cerca { position: relative; margin-bottom: .6rem; }
.am-cerca i { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--nebbia, #6b7280); }
body .am-cerca input.form-control { font-size: 1.1rem; padding: .8rem 1rem .8rem 2.7rem; border-radius: 12px; }
.am-lista { display: flex; flex-direction: column; gap: .35rem; max-height: 46vh; overflow-y: auto; padding: .1rem; }
.am-art { display: flex; align-items: center; gap: .8rem; width: 100%; text-align: left; padding: .7rem .9rem; background: #fff;
    border: 1.5px solid var(--linea, #e5e7eb); border-radius: 12px; color: var(--notte, #1f2937); }
.am-art:hover { border-color: var(--freddo, #0d6efd); }
.am-art.on { border-color: var(--freddo, #0d6efd); background: var(--ghiaccio, #e7f1ff); box-shadow: inset 0 0 0 1px var(--freddo, #0d6efd); }
.am-art:focus-visible { outline: 2px solid var(--freddo, #0d6efd); outline-offset: 1px; }
.am-testo { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.am-testo strong { font-size: 1.05rem; }
.am-testo small { color: var(--nebbia, #6b7280); }
.am-disp { display: flex; align-items: center; gap: .4rem; flex: 0 0 auto; white-space: nowrap; }
.am-q { display: inline-flex; align-items: center; gap: .3rem; border-radius: 999px; padding: .15rem .6rem; font-weight: 700; font-variant-numeric: tabular-nums; font-size: .95rem; }
.am-q i { font-size: .8rem; opacity: .8; }
.am-q.si { background: var(--verde-bg, #dbf4e6); color: var(--verde-tx, #0e6136); }
.am-q.no { background: var(--t-fondo, #f1f3f5); color: var(--nebbia, #8a94a3); }
.am-um { color: var(--nebbia, #6b7280); font-size: .9rem; min-width: 1.6rem; }
.am-vuoto { padding: 1rem; text-align: center; color: var(--nebbia, #6b7280); }
.am-quantita { margin-top: .9rem; padding: .9rem 1rem; background: var(--t-fondo, #f8f9fa); border-radius: 12px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; }
.am-scelto { font-weight: 700; font-size: 1.05rem; }
.am-passi { display: flex; align-items: center; gap: .4rem; }
.am-passi input { width: 6rem; text-align: center; font-size: 1.2rem; font-weight: 700; }
.am-um-big { font-weight: 600; color: var(--nebbia, #6b7280); min-width: 2rem; }
@media (max-width: 575.98px) { .am-art { flex-wrap: wrap; } .am-disp { margin-left: auto; } }
.am-q.neg { background: var(--rosso-bg, #fde3e6); color: var(--rosso-tx, #93162a); }
.mat-macchina td { background: var(--ghiaccio, #e7f1ff) !important; color: var(--notte, #1f2937); font-size: 1rem; } .mat-macchina i { color: var(--freddo, #0d6efd); margin-right: .4rem; }
.mat-attesa { display: inline-flex; align-items: center; gap: .4rem; background: var(--ambra-bg, #fff1cc); color: var(--ambra-tx, #7a4e00); border-radius: 999px; padding: .3rem .8rem; font-weight: 600; font-size: .9rem; }

/* --- Catalogo prodotti --- */
.mg-scheda-nuova { border-style: dashed; color: var(--nebbia, #6b7280); }
.cat-inc { display: inline-flex; align-items: center; border-radius: 999px; padding: .15rem .7rem; font-weight: 600; font-size: .9rem; background: var(--t-fondo, #f1f3f5); color: var(--nebbia, #6b7280); }
.cat-inc-ct { background: var(--verde-bg, #dbf4e6); color: var(--verde-tx, #0e6136); }
.cat-inc-detrazione { background: var(--ghiaccio, #e7f1ff); color: var(--freddo-2, #0a58ca); }
.cat-cerca { position: relative; max-width: 560px; }
.cat-cerca i { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--nebbia, #6b7280); }
body .cat-cerca input.form-control { padding-left: 2.6rem; font-size: 1.05rem; border-radius: 12px; }
.cat-ico { min-width: 3rem; justify-content: center; font-size: 1.15rem; }
.badge-cat { display: inline-block; font-size: 10px; font-weight: 700; border-radius: 4px; padding: 1px 6px; background: #eef2f6; color: #475569; margin-left: .3rem; }
.cat-listino { width: 7.5rem; margin-left: auto; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.cat-listino.salva { opacity: .6; }
.cat-listino.ok { border-color: var(--verde, #198754); box-shadow: 0 0 0 2px var(--verde-bg, #dbf4e6); }
.cat-listino.ko { border-color: var(--rosso, #dc3545); box-shadow: 0 0 0 2px var(--rosso-bg, #fde3e6); }

/* ── Paginatore compatto ── */
.pag { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .35rem; margin: 1rem 0 .5rem; }
.pag[hidden] { display: none; }
.pag-btn { min-width: 2.5rem; height: 2.5rem; padding: 0 .6rem; display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid #d5dde6; border-radius: 10px; background: #fff; color: #1f2d3d; font-weight: 600; text-decoration: none; font-variant-numeric: tabular-nums; }
.pag-btn:hover { background: #eef4fb; color: #0a63c2; border-color: #b9cde3; }
.pag-btn.attiva { background: #0a63c2; border-color: #0a63c2; color: #fff; }
.pag-btn.disattiva { opacity: .35; pointer-events: none; }
.pag-gap { color: #7b8a99; padding: 0 .15rem; }
.pag-vai { display: inline-flex; align-items: center; gap: .4rem; margin-left: .75rem; color: #5b6b7b; font-size: .92rem; white-space: nowrap; }
.pag-vai input { width: 4.6rem; height: 2.5rem; border: 1px solid #d5dde6; border-radius: 10px; padding: 0 .5rem; text-align: center; font-weight: 600; }

/* ── Pianificatore: durata dell'installazione e giornate ── */
.pf-durata { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem; }
.pf-dur-lab { font-weight: 600; color: #5b6b7b; margin-right: .1rem; }
.pf-dur-btn { width: 2.4rem; height: 2.4rem; border: 1px solid #c9d6e3; border-radius: 10px; background: #fff; color: #1f2d3d; display: inline-flex; align-items: center; justify-content: center; }
.pf-dur-btn:hover { background: #eef4fb; color: #0a63c2; }
.pf-dur-val { min-width: 5.2rem; text-align: center; font-size: 1.15rem; font-variant-numeric: tabular-nums; cursor: help; }
.pf-dur-rapide { display: inline-flex; gap: .3rem; margin-left: .35rem; }
.pf-dur-rapide button, .pf-dur-calc { height: 2.4rem; padding: 0 .75rem; border: 1px solid #c9d6e3; border-radius: 999px; background: #fff; font-weight: 600; color: #37474f; }
.pf-dur-rapide button:hover { background: #eef4fb; color: #0a63c2; }
.pf-dur-calc { background: #fff4e5; border-color: #f5c48a; color: #8a4b00; display: inline-flex; align-items: center; gap: .4rem; }
.pf-dur-calc[hidden] { display: none; }
.pf-gio { display: inline-block; padding: .05rem .5rem; margin: .1rem .15rem 0 0; border-radius: 999px; background: rgba(255,255,255,.7); border: 1px solid rgba(0,0,0,.08); white-space: nowrap; }
.pf-gio.no { background: #fde3e6; border-color: #f1a7b0; color: #9b1c2c; }
.pf-cal .pf-sel-conflitto { outline: 2px dashed #dc3545; outline-offset: 1px; }
@media (max-width: 767.98px) { .pf-dur-rapide { margin-left: 0; } }
.ck-barra { display: inline-block; vertical-align: middle; width: calc(100% - 3.5rem); height: .7rem; border-radius: 999px; background: #eef2f5; overflow: hidden; }
.ck-barra span { display: block; height: 100%; border-radius: 999px; }
.ck-ok { background: #2f9e44; } .ck-medio { background: #f59f00; } .ck-basso { background: #e03131; }
.ck-perc { display: inline-block; width: 3.2rem; text-align: right; font-variant-numeric: tabular-nums; }
.pf-stima { display: inline-flex; align-items: center; gap: .35rem; height: 2.4rem; padding: 0 .75rem; border-radius: 999px; background: #fff4e5; border: 1px solid #f5c48a; color: #8a4b00; font-weight: 600; cursor: help; }
.pf-stima[hidden] { display: none; }

/* ── Richieste di materiale, preparazione ritiri, segnalazioni ── */
.rq-schede { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-bottom: 1rem; }
.rq-schede button { display: flex; align-items: center; gap: .75rem; text-align: left; padding: .9rem 1rem; border: 2px solid #d5dde6; border-radius: 14px; background: #fff; color: #1f2d3d; }
.rq-schede button i { font-size: 1.5rem; color: #6b7a89; }
.rq-schede button small { display: block; color: #6b7a89; font-size: .82rem; }
.rq-schede button.on { border-color: #0a63c2; background: #eef4fb; }
.rq-schede button.on i { color: #0a63c2; }
@media (max-width: 575.98px) { .rq-schede { grid-template-columns: 1fr; } }
.rq-stato { display: flex; align-items: center; gap: .7rem; padding: .85rem 1rem; border-radius: 14px; margin-bottom: 1rem; font-size: 1.02rem; }
.rq-stato i { font-size: 1.4rem; }
.rq-stato.inviata { background: #fff4e5; color: #8a4b00; }
.rq-stato.pronta { background: #dbf4e6; color: #146c43; }
.rq-stato[hidden] { display: none; }
.rq-poco { display: block; color: #b35c00; font-weight: 600; font-size: .85rem; }
.rq-no { display: block; color: #c92a2a; font-weight: 600; font-size: .85rem; }
.rq-invio { margin-top: 1rem; display: grid; gap: .6rem; }
.rq-invio[hidden] { display: none; }
.rq-ora { display: flex; align-items: center; gap: .6rem; font-weight: 600; }
.rq-ora input { max-width: 9rem; }
.rq-scelto { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; padding: .6rem .8rem; border-radius: 12px; background: #eef4fb; margin-bottom: .4rem; }
.rq-scelto i { color: #0a63c2; } .rq-scelto small { color: #5b6b7b; }
.rq-scelto[hidden] { display: none; }
.rq-foto { cursor: pointer; }
.rq-segn { display: grid; gap: .5rem; }
.rq-segn-riga { display: flex; align-items: flex-start; gap: .7rem; padding: .7rem .9rem; background: #fff; border: 1px solid #e3e8ee; border-radius: 12px; }
.rq-segn-riga .rd-stato { flex: none; }
.rt-prep-info { display: flex; gap: .7rem; align-items: flex-start; padding: .85rem 1rem; border-radius: 14px; background: #eef4fb; color: #1f3a5a; margin-bottom: 1rem; }
.rt-prep-info i { font-size: 1.3rem; color: #0a63c2; margin-top: .15rem; }
.rp-riga { align-items: center; }
.rp-spunta { flex: none; cursor: pointer; }
.rp-spunta input { position: absolute; opacity: 0; pointer-events: none; }
.rp-spunta span { width: 2.6rem; height: 2.6rem; border-radius: 12px; border: 2px solid #c9d6e3; display: inline-flex; align-items: center; justify-content: center; color: transparent; background: #fff; }
.rp-spunta input:checked + span { background: #198754; border-color: #198754; color: #fff; }
.rp-spunta input:focus-visible + span { outline: 3px solid rgba(10, 99, 194, .45); outline-offset: 2px; }
.rp-fatta .rt-riga-testo > strong { text-decoration: line-through; color: #6b7a89; }
.rp-rich { display: block; }
.rp-conta { display: flex; align-items: center; gap: .4rem; font-size: .88rem; font-weight: 600; color: #8a4b00; margin-top: .2rem; }
.rp-conta[hidden] { display: none; }
.rp-conta input { width: 5.5rem; height: 2.1rem; border: 1px solid #f5c48a; border-radius: 8px; text-align: center; }
.rp-conta-fatta { display: block; color: #8a4b00; font-weight: 600; }
.rt-da-preparare { border-color: #f5c48a !important; }
.an-diff { display: inline-block; margin-left: .4rem; padding: 0 .45rem; border-radius: 999px; font-weight: 700; font-size: .85rem; }
.an-diff.neg { background: #fde3e6; color: #9b1c2c; } .an-diff.pos { background: #dbf4e6; color: #146c43; }
.sg-fuori { display: inline-block; padding: 0 .5rem; border-radius: 999px; background: #fff4e5; color: #8a4b00; font-weight: 600; }
.sg-piu { display: block; color: #0a63c2; font-weight: 600; }
.sg-foto { max-width: 160px; max-height: 120px; border-radius: 10px; border: 1px solid #e3e8ee; }

/* ── Numeri e report (Multiservice) ── */
.rr-testa { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.rr-testa h1 { margin: 0; }
.rr-sotto { color: var(--nebbia, #52677b); font-size: 1rem; margin: .2rem 0 0; }
.rr-schede { display: flex; gap: .35rem; background: #fff; border: 1px solid var(--linea, #d3e0eb); border-radius: 999px; padding: .25rem; max-width: 100%; overflow-x: auto; }
.rr-schede a { padding: .5rem 1rem; border-radius: 999px; text-decoration: none; color: var(--nebbia, #52677b); font-weight: 600; white-space: nowrap; }
.rr-schede a.on { background: var(--notte, #10253c); color: #fff; }
.rr-schede a i { margin-right: .35rem; font-size: .8rem; }
.rr-filtri { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; background: #fff; border: 1px solid var(--linea, #d3e0eb); border-radius: 16px; padding: .75rem 1rem; margin-bottom: 1.25rem; }
.rr-periodo { display: flex; gap: .3rem; flex-wrap: wrap; }
.rr-periodo a, .rr-periodo button { border: 1px solid var(--linea, #d3e0eb); background: #fff; border-radius: 999px; padding: .4rem .85rem; font-weight: 600; color: var(--notte, #10253c); text-decoration: none; }
.rr-periodo a.on, .rr-periodo button.on { background: var(--ghiaccio, #e6f0fb); border-color: var(--freddo, #0a63c2); color: var(--freddo-2, #0a4f9c); }
.rr-date { display: inline-flex; align-items: center; gap: .4rem; }
.rr-date[hidden] { display: none; }
.rr-date input { width: 10.5rem; }
.rr-filtri select { width: auto; min-width: 10.5rem; max-width: 18rem; }
.rr-kpi { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.rr-k { background: #fff; border: 1px solid var(--linea, #d3e0eb); border-radius: 18px; padding: 1.1rem 1.15rem 1rem; display: flex; flex-direction: column; gap: .35rem; cursor: help; }
.rr-k-lab { color: var(--nebbia, #52677b); font-weight: 600; font-size: .92rem; line-height: 1.25; min-height: 2.3em; }
.rr-k-val { font-family: var(--font-titoli, inherit); font-weight: 700; font-size: 2.1rem; line-height: 1.05; color: var(--notte, #10253c); white-space: nowrap; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.rr-k-diff { display: flex; flex-direction: column; align-items: flex-start; gap: .3rem; font-size: .86rem; color: var(--nebbia, #52677b); margin-top: .15rem; }
.rr-k-diff b, .rr-a small b { display: inline-flex; align-items: center; gap: .25rem; padding: .1rem .5rem; border-radius: 999px; font-weight: 700; }
.rr-bene { background: var(--verde-bg, #dbf4e6); color: var(--verde-tx, #0e6136); }
.rr-male { background: #fde3e6; color: #9b1c2c; }
.rr-uguale { background: var(--aria, #edf3f8); color: var(--notte, #10253c); }
.rr-admin { background: #fff; border: 1px dashed #b9c7d5; border-radius: 18px; padding: .8rem 1rem 1rem; margin-bottom: 1.25rem; }
.rr-admin-tit { font-weight: 700; color: var(--nebbia, #52677b); font-size: .88rem; margin-bottom: .6rem; display: flex; align-items: center; gap: .45rem; }
.rr-admin-tit a { font-weight: 600; text-decoration: none; }
.rr-admin-griglia { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; }
.rr-a { display: flex; flex-direction: column; gap: .15rem; }
.rr-a > span { color: var(--nebbia, #52677b); font-weight: 600; font-size: .92rem; }
.rr-a strong { font-family: var(--font-titoli, inherit); font-size: 1.5rem; color: var(--notte, #10253c); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rr-a strong em { font-style: normal; color: #b9c7d5; margin: 0 .2rem; }
.rr-a small { color: var(--nebbia, #52677b); line-height: 1.3; }
.rr-manca strong { color: #b9c7d5; }
.rr-manca small { color: #8a4b00; }
.rr-griglia { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr); gap: 1rem; }
.rr-largo { grid-column: 1 / -1; }
.rr-card { background: #fff; border: 1px solid var(--linea, #d3e0eb); border-radius: 18px; padding: 1.1rem 1.2rem; }
.rr-card h2 { font-size: 1.1rem; margin: 0 0 .2rem; }
.rr-sotto2 { color: var(--nebbia, #52677b); font-size: .9rem; margin-bottom: .8rem; }
.rr-card-testa { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: .6rem; }
.rr-card-testa h2 { margin-top: .3rem; }
.rr-grafico { height: 280px; }
.rr-sat { display: grid; gap: 1rem; margin-top: .4rem; }
.rr-sat-riga { display: grid; grid-template-columns: 8.5rem 1fr 6.5rem; align-items: center; gap: .9rem; cursor: help; }
.rr-sat-nome { font-weight: 600; display: flex; align-items: center; gap: .4rem; }
.rr-sat-barra { height: 1.1rem; background: #e8eef4; border-radius: 999px; overflow: hidden; }
.rr-sat-barra span { display: block; height: 100%; background: var(--freddo, #0a63c2); border-radius: 999px; }
.rr-sat-barra span.oltre { background: var(--caldo, #ee5a1e); }
.rr-sat-num { display: flex; flex-direction: column; text-align: right; line-height: 1.15; }
.rr-sat-num strong { font-family: var(--font-titoli, inherit); font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.rr-sat-num small { color: var(--nebbia, #52677b); }
.rr-occhio { display: grid; gap: .5rem; }
.rr-occhio details { border-radius: 12px; background: var(--aria, #edf3f8); }
.rr-occhio summary { display: flex; align-items: center; gap: .75rem; padding: .7rem .8rem; cursor: pointer; list-style: none; }
.rr-occhio summary::-webkit-details-marker { display: none; }
.rr-occhio summary strong { font-family: var(--font-titoli, inherit); font-size: 1.35rem; min-width: 2rem; text-align: right; font-variant-numeric: tabular-nums; }
.rr-occhio summary span { flex: 1; line-height: 1.25; }
.rr-occhio summary i { color: var(--nebbia, #52677b); transition: transform .15s; }
.rr-occhio details[open] summary i { transform: rotate(180deg); }
.rr-occhio details.vuoto summary { cursor: default; opacity: .6; }
.rr-occhio details.vuoto summary i { display: none; }
.rr-occhio ul { list-style: none; margin: 0; padding: 0 .9rem .7rem 3.6rem; display: grid; gap: .25rem; }
.rr-occhio ul li { display: flex; justify-content: space-between; gap: .5rem; }
.rr-tab { margin-bottom: 0; }
.rr-tab th { font-size: .86rem; color: var(--nebbia, #52677b); white-space: nowrap; }
.rr-tab td, .rr-tab th { font-variant-numeric: tabular-nums; }
.rr-tab td.text-end, .rr-tab th.text-end { white-space: nowrap; }
.rr-tab tfoot th { color: var(--notte, #10253c); border-top: 2px solid var(--linea, #d3e0eb); }
.rr-gruppo td { background: var(--aria, #edf3f8) !important; font-weight: 700; color: var(--nebbia, #52677b); }
.rr-avviso { display: flex; gap: .7rem; align-items: flex-start; padding: .85rem 1rem; border-radius: 14px; background: #fff4e5; color: #8a4b00; margin-bottom: 1rem; }
.rr-avviso i { margin-top: .2rem; }
@media (max-width: 1399.98px) { .rr-kpi { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 991.98px) { .rr-griglia { grid-template-columns: 1fr; } .rr-admin-griglia { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767.98px) { .rr-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; } .rr-k-val { font-size: 1.6rem; } .rr-k { padding: .85rem; } .rr-filtri select { min-width: 0; flex: 1; } .rr-sat-riga { grid-template-columns: 6.5rem 1fr 5rem; gap: .5rem; } }

/* ── Etichette per il GSE ── */
.et-conta { padding: .1rem .6rem; border-radius: 999px; font-weight: 700; font-size: .85rem; }
.et-conta.manca { background: #fff4e5; color: #8a4b00; } .et-conta.ok { background: #dbf4e6; color: #146c43; }
.et-corpo { display: grid; gap: 1rem; }
.et-macchina { border: 1px solid #e3e8ee; border-radius: 14px; padding: .8rem; }
.et-mac-nome { display: flex; align-items: center; gap: .5rem; margin-bottom: .6rem; }
.et-num { width: 1.7rem; height: 1.7rem; border-radius: 50%; background: #0a63c2; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; }
.et-slots { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
@media (max-width: 575.98px) { .et-slots { grid-template-columns: 1fr; } }
.et-slot { background: #f6f9fc; border: 2px dashed #c9d6e3; border-radius: 12px; padding: .7rem; display: flex; flex-direction: column; gap: .5rem; }
.et-slot.fatta { border-style: solid; border-color: #a9e2c2; background: #f3fbf6; }
.et-slot-tit { font-weight: 700; color: #37474f; }
.et-scatta { justify-content: center; cursor: pointer; }
.et-foto { display: flex; gap: .6rem; align-items: flex-start; }
.et-foto img { width: 92px; height: 70px; object-fit: cover; border-radius: 8px; border: 1px solid #d5dde6; }
.et-matr { display: flex; flex-direction: column; gap: .2rem; font-size: .85rem; font-weight: 600; color: #5b6b7b; flex: 1; }
.et-matr input { font-family: ui-monospace, monospace; font-weight: 700; letter-spacing: .03em; }
.et-matr input.ok { border-color: #198754; } .et-matr input.ko { border-color: #dc3545; }
.et-letta { display: inline-block; padding: 0 .4rem; border-radius: 999px; background: #e6f0fb; color: #0a4f9c; font-size: .75rem; }
.et-attenzione { display: block; color: #b35c00; font-weight: 600; }
.et-esito { display: flex; gap: .7rem; align-items: flex-start; padding: .6rem; border-radius: 10px; background: #fff; border: 1px solid #e3e8ee; }
.et-esito[hidden] { display: none; }
.et-esito.no { border-color: #f1a7b0; background: #fff6f7; } .et-esito.ok { border-color: #a9e2c2; }
.et-ante { width: 110px; border-radius: 8px; flex: none; }
.et-giudizio { display: flex; flex-direction: column; gap: .35rem; flex: 1; min-width: 0; }
.et-giudizio > small { color: #5b6b7b; }
.et-azioni { display: flex; gap: .4rem; flex-wrap: wrap; }

/* ── Presenza in cantiere (GPS) ── */
.pr-lista { display: flex; flex-direction: column; gap: .4rem; margin-bottom: .8rem; }
.pr-riga { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; padding: .45rem .6rem; border-radius: 10px; background: #f6f9fc; }
.pr-giorno { font-weight: 700; min-width: 5.5rem; }
.pr-ore { font-variant-numeric: tabular-nums; font-size: 1.05rem; }
.pr-durata { color: #37474f; font-weight: 600; font-variant-numeric: tabular-nums; }
.pr-fonte { padding: 0 .5rem; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.pr-fonte.gps { background: #e6f0fb; color: #0a4f9c; } .pr-fonte.man { background: #fff4e5; color: #8a4b00; }
.pr-riga .pr-correggi { margin-left: auto; }
.pr-geo { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.pr-geo small { flex: 1 1 14rem; }
.pr-form { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; margin-top: .8rem; padding: .7rem; border: 1px solid #e3e8ee; border-radius: 12px; }
.pr-form[hidden] { display: none; }
.pr-form label { display: flex; flex-direction: column; gap: .2rem; font-size: .85rem; font-weight: 600; color: #5b6b7b; }
.pr-form .pr-note { flex: 1 1 14rem; }
.pr-azioni { display: flex; gap: .4rem; align-items: center; }
.pr-card [hidden] { display: none !important; }

/* ── Riordino veloce (Articoli) ── */
.ro-in-ordine { display: inline-flex; align-items: center; gap: .25rem; margin-left: .4rem; padding: .05rem .5rem; border-radius: 999px;
    background: #e6f0fb; color: #0a4f9c; font-size: .75rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
.ro-in-ordine.bozza { background: #fff4e5; color: #8a4b00; }
.ro-in-ordine:hover { filter: brightness(.95); }
.ro-carrello.fatto { background: #0a63c2; color: #fff; border-color: #0a63c2; }
.ro-n { display: inline-block; min-width: 1.4rem; padding: 0 .35rem; border-radius: 999px; background: #334155; color: #fff; font-size: .75rem; text-align: center; }
.ro-avviso { position: fixed; right: 1.2rem; bottom: 1.2rem; z-index: 1090; max-width: min(460px, calc(100vw - 2rem)); padding: .9rem 2.4rem .9rem 1rem;
    border-radius: 14px; background: #fff; border: 1px solid #a9e2c2; box-shadow: 0 10px 30px rgba(15, 40, 70, .18); font-size: 1rem; line-height: 1.45; }
.ro-avviso[hidden] { display: none; }
.ro-avviso.ok { border-left: 6px solid #198754; } .ro-avviso.info { border-left: 6px solid #0a63c2; border-color: #bcd4f0; } .ro-avviso.ko { border-left: 6px solid #dc3545; border-color: #f1a7b0; }
.ro-avviso a { font-weight: 700; white-space: nowrap; }
.ro-avviso ul { margin: .3rem 0; padding-left: 1.1rem; }
.ro-avviso .ro-righe { color: #5b6b7b; font-size: .85rem; }
.ro-avviso .ro-attenzione { color: #8a4b00; margin-top: .3rem; }
.ro-chiudi { position: absolute; top: .35rem; right: .5rem; border: 0; background: none; font-size: 1.4rem; line-height: 1; color: #78909c; cursor: pointer; }
@media (max-width: 575.98px) { .ro-avviso { left: 1rem; right: 1rem; bottom: 5rem; } }
/* ordine: righe modificabili */
.or-tabella td { vertical-align: middle; }
.or-cod-forn { display: inline-block; margin-left: .4rem; padding: 0 .4rem; border-radius: 6px; background: #f1f5f9; color: #334155; font-size: .78rem; font-family: ui-monospace, monospace; }
.or-qta { display: inline-flex; align-items: center; gap: .3rem; }
.or-qta input { width: 5.5rem; text-align: right; font-weight: 700; }
.or-prezzo { width: 6.5rem; text-align: right; margin-left: auto; }
.or-salva { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: flex-end; gap: .8rem; padding: .7rem 1rem; background: #fffbeb; border-top: 1px solid #fde68a; }
.or-salva[hidden] { display: none; }
.btn-az:disabled, .btn-az[disabled] { opacity: .5; cursor: not-allowed; }
.ro-copre { display: block; color: #5b6b7b; font-size: .78rem; white-space: nowrap; cursor: help; }
.ro-copre.poco { color: #b35c00; font-weight: 700; }
.ro-regole td, .ro-regole th { vertical-align: middle; }
.or-codforn-manca { max-width: 14rem; margin-top: .25rem; border-color: #f0b46b; background: #fffaf2; }

/* ── checklist: ogni lavoro è una barra colorata che si apre e si chiude ── */
.cl-sez + .cl-sez { border-top: 0; padding-top: 0; }
.cl-sez { margin-bottom: .8rem; }
.cl-sez-barra { display: flex; align-items: center; flex-wrap: wrap; gap: .3rem .6rem; width: 100%; min-height: 56px; padding: .7rem 1rem; border: 0; border-radius: 14px;
    background: var(--lav); color: #fff; text-align: left; box-shadow: 0 2px 6px rgba(16, 37, 60, .15); }
.cl-sez-barra:active { filter: brightness(.95); }
.cl-sez-frecc { width: 1rem; font-size: .95rem; }
.cl-sez-nome { font-size: 1.15rem; font-weight: 800; letter-spacing: .01em; }
.cl-sez-riass { font-size: .9rem; opacity: .92; }
.cl-sez-barra .cl-stato { margin-left: auto; font-size: .78rem; color: #fff; opacity: .9; background: rgba(255, 255, 255, .18); padding: .1rem .5rem; border-radius: 999px; }
.cl-sez-barra .cl-stato:empty { display: none; }
.cl-sez:not(.chiusa) .cl-sez-barra { border-radius: 14px 14px 0 0; margin-bottom: .7rem; }
.cl-sez:not(.chiusa) { border: 2px solid var(--lav); border-radius: 16px; padding: 0 .7rem .7rem; }
.cl-sez:not(.chiusa) .cl-sez-barra { width: calc(100% + 1.4rem); margin-left: -.7rem; margin-right: -.7rem; }
.cl-sez-strum { display: flex; justify-content: flex-end; margin: -.2rem 0 .5rem; }
.cl-sez { scroll-margin-top: calc(var(--top-h, 60px) + 84px); }
.cl-sez.cl-chiaro .cl-sez-barra { color: #10253c; }
.cl-sez.cl-chiaro .cl-sez-barra .cl-stato { color: #10253c; background: rgba(16, 37, 60, .1); }

.lavoro-scartato { color: var(--bs-secondary-color, #6c757d); text-decoration: line-through; font-size: .85em; margin-left: .35rem; }

/* Voci checklist: articoli di magazzino collegati */
.lst-art { margin-top: .5rem; padding: .55rem .7rem; border-radius: 10px; background: var(--t-fondo, #f6f8fa); border: 1px dashed var(--linea, #dfe3e8); }
.lst-art-titolo { font-size: .85rem; font-weight: 700; color: var(--nebbia, #6b7280); margin-bottom: .35rem; }
.lst-art-titolo i { margin-right: .35rem; }
.lst-art-titolo small { font-weight: 500; }
.lst-art-riga { display: flex; align-items: center; gap: .5rem; padding: .25rem 0; flex-wrap: wrap; }
.lst-art-nome { flex: 1 1 12rem; min-width: 0; font-weight: 600; font-size: .92rem; }
.lst-art-q { width: 8.5rem; }
.lst-art-pv { font-size: .85rem; color: var(--nebbia, #6b7280); min-width: 6rem; text-align: right; }
.lst-art-cerca { position: relative; margin-top: .3rem; max-width: 24rem; }
.lst-art-ris { position: absolute; left: 0; right: 0; top: 100%; z-index: 20; background: #fff; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.12); overflow: hidden; }
.lst-art-ris:empty { display: none; }
.lst-art-scelta { display: block; width: 100%; text-align: left; border: 0; background: #fff; padding: .45rem .7rem; font-size: .9rem; }
.lst-art-scelta:hover { background: var(--t-fondo, #f3f5f8); }
.lst-art-prezzo { margin: .45rem 0 0; font-size: .88rem; }

/* Materiale proposto dal sopralluogo */
.mat-prop { border-radius: 12px; background: #eef7ff; border: 1px solid #cfe5fb; padding: .75rem .9rem; margin-bottom: .9rem; }
.mat-prop-testa { display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; margin-bottom: .4rem; }
.mat-prop-testa strong { font-size: .98rem; }
.mat-prop-testa i { color: var(--freddo, #0b6bcb); margin-right: .35rem; }
.mat-prop-riga { display: flex; align-items: center; gap: .6rem; padding: .45rem 0; border-top: 1px solid #d9eafb; }
.mat-prop-riga:first-of-type { border-top: 0; }
.mat-prop-nome { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.mat-prop-nome small { color: var(--nebbia, #6b7280); }
.mat-prop-q { font-weight: 800; white-space: nowrap; }
.mat-prop-nota { font-size: .82rem; color: var(--nebbia, #6b7280); margin-top: .35rem; }
.mat-prop-form { display: flex; align-items: center; gap: .35rem; flex: none; }
.mat-prop-form .mat-prop-q { width: 7.5rem; }
@media (max-width: 575.98px) {
    .mat-prop-riga { flex-wrap: wrap; }
    .mat-prop-nome { flex: 1 1 100%; }
    .mat-prop-form { margin-left: auto; }
}
.mat-prop .btn-primary i { color: inherit; }
.mat-da-contr { background: #fff1d6; color: #8a5300; font-weight: 700; }
#prodotti .card-header .btn-primary { white-space: nowrap; }

/* Preventivo: interruttore T.bk (installazione pagata a domicilio alla ditta) */
.pv-man-riga { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }
.pv-man-riga .pv-euro { flex: 1 1 10rem; }
.pv-tbk { display: inline-flex; align-items: center; gap: .45rem; cursor: pointer; user-select: none; margin: 0; padding: .35rem .7rem; border-radius: 999px;
    background: var(--ghiaccio, #eef2f6); font-size: .95rem; }
.pv-tbk input { position: absolute; opacity: 0; pointer-events: none; }
.pv-tbk-int { position: relative; width: 2.4rem; height: 1.35rem; border-radius: 999px; background: #c5ccd6; transition: background .15s; flex: none; }
.pv-tbk-int::after { content: ""; position: absolute; top: .15rem; left: .15rem; width: 1.05rem; height: 1.05rem; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.pv-tbk input:checked + .pv-tbk-int { background: #e8a33d; }
.pv-tbk input:checked + .pv-tbk-int::after { transform: translateX(1.05rem); }
.pv-tbk input:focus-visible + .pv-tbk-int { outline: 2px solid var(--freddo, #0b6bcb); outline-offset: 2px; }
.pv-tbk-nota { margin-top: .45rem; padding: .5rem .7rem; border-radius: 10px; background: #fff4e0; color: #6b4100; font-size: .9rem; }
.pv-tbk-nota i { margin-right: .4rem; }
.pv-r-tbk { color: #8a5300; }
@media (prefers-reduced-motion: reduce) { .pv-tbk-int, .pv-tbk-int::after { transition: none; } }
.rd-tbk { display: inline-block; margin-left: .35rem; padding: .05rem .45rem; border-radius: 999px; background: #fff1d6; color: #8a5300; font-size: .75rem; font-weight: 800; }
.rd-imp-tbk { color: #8a5300 !important; }
.rd-tot-tbk { background: #fff4e0 !important; }
.rd-riga-tbk td { color: #8a5300; font-weight: 600; }
.rr-tbk { color: #8a5300; font-weight: 600; }
