/* =========================================================
   RESET CSS MODERNO
   ========================================================= */

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: 'Poppins', sans-serif;
    background: #F5F6F8;
    color: #0A1A2F;
    line-height: 1.4;
    font-size: 14px;
}

img {
    max-width: 100%;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

/* =========================================================
   VARIABILI CORPORATE
   ========================================================= */

:root {
    --rosso: #B00020;
    --rosso-scuro: #8A001A;
    --navy: #0A1A2F;
    --grigio-chiaro: #F5F6F8;
    --grigio: #D9D9D9;
    --grigio-scuro: #7A7A7A;
    --bianco: #FFFFFF;
    --antracite: #20242B;

    --radius: 8px;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* =========================================================
   STRUTTURA BASE DEL LAYOUT
   ========================================================= */

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main.content-modern {
    /* niente flex-grow: l'altezza è gestita sotto (header → footer),
       altrimenti il contenuto si allungherebbe dietro al footer */
    flex: none;
}
/* =========================================================
   LOGIN PAGE PREMIUM
   ========================================================= */

.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: linear-gradient(135deg, var(--grigio-chiaro), #ffffff);
    padding: 20px;
}

.login-card {
    background: var(--bianco);
    padding: 40px 45px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    width: 100%;
    max-width: 380px;
    animation: fadeIn 0.35s ease;
    text-align: center;
}

.login-logo {
    width: 140px;
    margin: 0 auto 20px auto;
    opacity: 0.95;
}

.login-card h2 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 25px;
    color: var(--navy);
}

.login-card .input-group input {
    border-radius: 6px;
    padding: 12px;
    font-size: 15px;
}

.login-card button {
    padding: 12px;
    font-size: 16px;
    border-radius: 6px;
}

.login-footer-text {
    margin-top: 20px;
    font-size: 13px;
    color: var(--grigio-scuro);
}

/* Logo più piccolo */
.login-logo-small {
    width: 300px;
    margin: 0 auto 15px auto;
    display: block;
    opacity: 0.95;
}

/* Titolo elegante */
.login-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 22px;
    color: var(--navy);
    letter-spacing: 0.3px;
}

/* =========================================================
   HEADER MODERNO FISSO
   ========================================================= */

.header-modern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background: var(--bianco);
    border-bottom: 1px solid var(--grigio);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 25px;
    z-index: 1000;
    box-shadow: var(--shadow);
}

/* Logo */
.logo-link {
    display: flex;
    align-items: center;
}

.logo-modern {
    height: 48px;
    width: auto;
    object-fit: contain;
}

/* NAV PRINCIPALE */
.header-nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-item {
    font-size: 14px;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: var(--radius);
    transition: 0.2s;
    color: var(--navy);
}

.nav-item:hover {
    background: var(--grigio-chiaro);
}

/* Voce di menu presente ma non ancora collegata (pagina in arrivo) */
.nav-item-soon {
    opacity: 0.45;
    cursor: default;
}
.nav-item-soon:hover {
    background: none;
}

/* Logout */
.logout-btn {
    color: var(--rosso);
    font-weight: 600;
}

/* DROPDOWN */
.nav-dropdown {
    position: relative;
}

.drop-btn {
    font-size: 14px;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: var(--radius);
    transition: 0.2s;
    color: var(--navy);
}

.drop-btn:hover {
    background: var(--grigio-chiaro);
}

.drop-menu {
    position: absolute;
    top: 100%; /* ATTACCA IL MENU AL BOTTONE */
    left: 0;
    background: var(--bianco);
    border: 1px solid var(--grigio);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: none;
    flex-direction: column;
    min-width: 180px;
    z-index: 999;
    padding-top: 6px; /* CUSCINETTO ANTI-SPARIZIONE */
    pointer-events: auto;
}

.nav-dropdown {
    position: relative;
    padding-bottom: 6px; /* CUSCINETTO ANTI-SPARIZIONE */
}


.nav-dropdown:hover .drop-menu {
    display: flex;
}

.drop-menu a {
    padding: 10px 14px;
    font-size: 14px;
    color: var(--navy);
    transition: 0.2s;
}

.drop-menu a:hover {
    background: var(--grigio-chiaro);
}
/* =========================================================
   SIDEBAR MODERNA FISSA
   ========================================================= */

.sidebar-modern {
    position: fixed;
    top: 80px; /* sotto l’header */
    left: 0;
    width: 230px;
    height: calc(100vh - 80px); /* tutta l’altezza rimanente */
    background: var(--antracite);
    border-right: 1px solid rgba(255,255,255,0.08);
    padding: 20px 0;
    overflow-y: auto;
    box-shadow: 2px 0 14px rgba(0,0,0,0.15);
    z-index: 900;
}

/* Logo nella sidebar */
.sidebar-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.sidebar-logo img {
    width: 120px;
    opacity: 0.9;
}

/* Menu della sidebar */
.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 15px;
}

.sidebar-item {
    padding: 10px 14px;
    font-size: 15px;
    font-weight: 500;
    border-radius: var(--radius);
    color: rgba(255,255,255,0.82);
    transition: 0.2s;
}

.sidebar-item:hover {
    background: rgba(255,255,255,0.10);
    color: #fff;
}

/* Stato attivo */
.sidebar-item.active {
    background: var(--rosso);
    color: #fff;
    font-weight: 600;
}

/* Titolo dentro la sidebar (es. "Filtri documenti") */
.sidebar-title {
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    padding: 0 4px 12px;
    opacity: 0.95;
}
/* ============================================================
   FILTRI SIDEBAR — VERSIONE PREMIUM
============================================================ */
/* BOXED STYLE */
.sidebar-filter {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.sidebar-filter label {
    font-size: 13px;
    color: #ffffff;
}

.sidebar-filter select,
.sidebar-filter input {
    background: #f2f2f2;
    border: 1px solid #ccc;
    padding: 8px 10px;
    border-radius: 6px;
    color: #000;
    font-size: 13px;
}
/* ============================================================
   BOTTTONI SIDEBAR — VERSIONE PREMIUM
============================================================ */
/* Pulsante aggiungi cliente nella sidebar */
#btn-apri-add {
    background: var(--navy) !important;
    color: #fff !important;
    border: 1px solid rgba(255,255,255,0.25);
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

#btn-apri-add:hover {
    background: var(--rosso) !important;
    border-color: var(--rosso);
}

/* =========================================================
   LAYOUT WRAPPER
   ========================================================= */

.layout-wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
    background: var(--grigio-chiaro);
}

/* =========================================================
   LAYOUT SCROLLABILE TRA HEADER E FOOTER
   ========================================================= */

body {
    height: 100vh;
    overflow: hidden; /* il body NON scrolla */
}

/* L'area centrale deve scrollare */
.content-modern {
    flex: none;
    display: flex;
    flex-direction: column;
    margin-left: 230px;   /* sidebar */
    margin-top: 80px;     /* header */
    padding: 22px 28px;

    /* Altezza disponibile TRA header (80px) e footer (56px) */
    height: calc(100vh - 80px - 56px);

    /* Piccolo spazio tra contenuto e footer */
    padding-bottom: 14px;

    overflow-y: auto; /* SOLO questa scrolla */
    background: var(--grigio-chiaro);
    animation: fadeIn 0.25s ease;
}

/* Pagine senza sidebar: il contenuto usa tutta la larghezza.
   (specificità a 2 classi: vince anche sulle media query della sidebar) */
.content-modern.content-full { margin-left: 0; }

/* Modalità "pagina piena": scrolla l'intera pagina invece dell'area interna.
   Utile per liste lunghe/accordion che con lo scroll interno fisso
   finirebbero sotto il footer. L'header resta fisso in alto, il footer in basso. */
body.pagina-piena { height: auto; overflow: visible; }
body.pagina-piena .content-modern {
    height: auto;
    overflow: visible;
    padding-bottom: 80px;   /* spazio per il footer fisso */
}

/* Scroll fluido */
html {
    scroll-behavior: smooth;
}

/* ============================================================
   TABELLA DOCUMENTI — VERSIONE PREMIUM
============================================================ */

/* =========================================================
   TITOLO PAGINA — uniforme su tutto il gestionale
   ========================================================= */
.titolo-pagina,
.page-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--navy);
    margin: 2px 0 18px;
    padding-bottom: 8px;
    border-bottom: 3px solid var(--rosso);
    display: inline-block;
    line-height: 1.25;
}

.contenitore-tabella {
    margin-top: 20px;
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.tabella-documenti {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
}

.tabella-documenti thead th {
    text-align: left;
    padding: 9px 11px;
    font-size: 13px;
    font-weight: 600;
    color: #0A1A2F;
    border-bottom: 2px solid #e5e7eb;
}

.tabella-documenti tbody tr {
    background: #f8f9fb;
    border-radius: 10px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tabella-documenti tbody tr:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.08);
}

.tabella-documenti tbody td {
    padding: 9px 11px;
    font-size: 13px;
    color: #333;
}

/* RIGA NON VISTA */
.tabella-documenti tbody tr.non-visto {
    background: #fff4e6;
    border-left: 4px solid var(--rosso);
}

/* LINK DOCUMENTO */
.tabella-documenti a {
    color: var(--navy);
    font-weight: 600;
    text-decoration: none;
}

.tabella-documenti a:hover {
    color: var(--rosso);
}

/* ICONA NUOVO */
.nuovo-icon {
    background: var(--rosso);
    color: #fff;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 11px;
    margin-left: 6px;
}

/* COLONNA AZIONI */
/* SOLO i link senza classi devono essere rossi */
.tabella-documenti td:last-child a:not(.btn) {
    background: var(--rosso);
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 13px;
}

.tabella-documenti td:last-child a:not(.btn):hover {
    background: var(--rosso-scuro);
}

/* =========================================================
   FOOTER PREMIUM — FISSO
   ========================================================= */

.footer-premium {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;

    background: var(--bianco);
    border-top: 1px solid var(--grigio);
    height: 56px;
    display: flex;
    align-items: center;
    box-shadow: 0 -2px 6px rgba(0,0,0,0.05);
    z-index: 800;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 25px;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px 18px;
}

/* Logo principale */
.footer-logo2 {
    height: 32px;
    width: auto;
    opacity: 0.9;
}

/* Linea divisoria: non serve più nel layout compatto */
.footer-divider {
    display: none;
}

/* Riga loghi secondari */
.footer-logos-row {
    display: flex;
    gap: 14px;
    align-items: center;
}

.footer-logo-small {
    height: 26px;
    width: auto;
    opacity: 0.85;
}

/* Testo finale */
.footer-text {
    font-size: 12px;
    color: var(--grigio-scuro);
    text-align: center;
    margin-top: 0;
}

/* =========================================================
   BOTTONI GLOBALI (VERSIONE PREMIUM UNIFICATA)
   ========================================================= */

.btn {
    display: inline-block;
    padding: 7px 12px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    transition: 0.2s ease;
    cursor: pointer;
    text-align: center;
    border: 1px solid transparent;
    text-decoration: none;
}

/* --- VARIANTI PRINCIPALI --- */

/* Blu (azione principale) */
.btn-primary {
    background: var(--navy);
    color: var(--bianco);
    border-color: var(--navy);
}
.btn-primary:hover {
    background: #0d2747;
}

/* Rosso (azioni pericolose) */
.btn-danger {
    background: var(--rosso);
    color: var(--bianco);
    border-color: var(--rosso);
}
.btn-danger:hover {
    background: var(--rosso-scuro);
}

/* Grigio chiaro */
.btn-light {
    background: var(--grigio-chiaro);
    color: var(--navy);
    border-color: var(--grigio);
}
.btn-light:hover {
    background: var(--grigio);
}

/* =========================================================
   BOTTONI AZIONI TABELLE (MODIFICA / ELIMINA / MEZZI SEDE)
   ========================================================= */

/* Stile base per TUTTI i pulsanti della tabella */
button.btn-azione,
a.btn-azione,
button.btn-toggle,
a.btn-toggle {
    display: inline-block;
    padding: 8px 14px;
    font-size: 14px;
    border-radius: var(--radius);
    border: 1px solid var(--navy);
    background: white;
    color: var(--navy);
    cursor: pointer;
    transition: 0.2s ease;
    text-decoration: none;
    margin-right: 6px;
}

/* Hover standard */
button.btn-azione:hover,
a.btn-azione:hover,
button.btn-toggle:hover,
a.btn-toggle:hover {
    background: var(--navy);
    color: white;
}

/* Variante rossa SOLO per ELIMINA */
button.btn-elimina-cliente {
    border-color: var(--rosso);
    color: var(--rosso);
}

button.btn-elimina-cliente:hover {
    background: var(--rosso);
    color: white;
}

/* =========================================================
   CARD MODERNE
   ========================================================= */

.card {
    background: var(--bianco);
    border-radius: var(--radius);
    padding: 14px 18px;
    box-shadow: var(--shadow);
    margin-bottom: 18px;
}

.card h2 {
    font-size: 17px;
    margin-bottom: 10px;
    color: var(--navy);
}
/* =========================================================
   CARD FORM ELEMENTS (compatibili con .card)
   ========================================================= */

.card-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.card-field {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-field label {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--navy);
}

.input-premium {
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 13px;
    background: #f9fafb;
}

.input-premium:focus {
    outline: none;
    border-color: var(--rosso);
    background: #fff;
}

.card-actions {
    margin-top: 10px;
    display: flex;
    justify-content: flex-end;
}

/* CARD FULL WIDTH PER TABELLE */
.card-wide {
    padding: 0 !important;
    margin-bottom: 25px;
    background: var(--bianco);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* TABELLA FULL WIDTH */
.table-full {
    width: 100% !important;
    max-width: 100% !important;
    border-collapse: collapse;
}

/* =========================================================
   TABELLE MODERNE
   ========================================================= */

.table-modern {
    width: 100%;
    border-collapse: collapse;
    background: var(--bianco);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.table-modern th {
    background: var(--navy);
    color: var(--bianco);
    padding: 12px;
    font-size: 14px;
    text-align: left;
}

.table-modern td {
    padding: 12px;
    border-bottom: 1px solid var(--grigio);
    font-size: 14px;
}

.table-modern tr:hover td {
    background: var(--grigio-chiaro);
}

/* =========================================================
   FORM MODERNI
   ========================================================= */

.input-group {
    margin-bottom: 18px;
}

.input-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--navy);
}

.input-group input,
.input-group select,
.input-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--grigio);
    border-radius: var(--radius);
    font-size: 15px;
    background: var(--bianco);
    transition: 0.2s;
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
    border-color: var(--navy);
    outline: none;
}
/* ============================================================
   FORM PREMIUM
============================================================ */

.box-premium {
    background: #fff;
    padding: 30px;
    border-radius: 14px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    width: 450px;
}

.form-premium {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.input-premium {
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #d0d0d0;
    font-size: 13px;
    transition: all 0.2s ease;
}

.input-premium:focus {
    border-color: var(--rosso);
    box-shadow: 0 0 0 2px rgba(176,0,32,0.15);
    outline: none;
}

.btn-salva-premium {
    background: var(--rosso);
    color: #fff;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: background 0.2s ease;
}

.btn-salva-premium:hover {
    background: var(--rosso-scuro);
}

.contenitore-centrato {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 180px); /* evita che tocchi header/footer */
}

/* =========================================================
   ALERT / NOTIFICHE
   ========================================================= */

.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-success {
    background: #d4f8d4;
    color: #1e7a1e;
}

.alert-danger {
    background: #ffd4d4;
    color: #8a0000;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
}

/* =========================================================
   BADGE
   ========================================================= */

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--radius);
    font-size: 12px;
    font-weight: 600;
}

.badge-green {
    background: #d4f8d4;
    color: #1e7a1e;
}

.badge-red {
    background: #ffd4d4;
    color: #8a0000;
}

.badge-blue {
    background: #d4e6ff;
    color: #003a8c;
}

/* ============================================================
   MODALE PREMIUM
============================================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.55);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(3px);
}

.modal-premium {
    background: #ffffff;
    width: 420px;
    padding: 25px 30px;
    border-radius: 14px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    animation: modalFadeIn 0.25s ease-out;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 20px;
}

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.modal-input {
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #d0d0d0;
    font-size: 14px;
    transition: all 0.2s ease;
}

.modal-input:focus {
    border-color: var(--rosso);
    box-shadow: 0 0 0 2px rgba(176,0,32,0.15);
    outline: none;
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 10px;
}

.btn-modal-primary {
    background: var(--rosso);
    color: #fff;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s ease;
}

.btn-modal-primary:hover {
    background: var(--rosso-scuro);
}

.btn-modal-secondary {
    background: #e5e5e5;
    color: #333;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s ease;
}

.btn-modal-secondary:hover {
    background: #d0d0d0;
}

/* =========================================================
   RESPONSIVE DESIGN
   ========================================================= */

/* Laptop piccoli (max 1400px) */
@media (max-width: 1400px) {
    .content-modern {
        padding: 25px 30px;
    }
}

/* Laptop 13" (max 1200px) */
@media (max-width: 1200px) {
    .sidebar-modern {
        width: 200px;
    }

    .content-modern {
        margin-left: 200px;
    }
}

/* Tablet orizzontale (max 992px) */
@media (max-width: 992px) {
    .header-nav {
        gap: 12px;
    }

    .sidebar-modern {
        width: 180px;
    }

    .content-modern {
        margin-left: 180px;
        padding: 20px 25px;
    }

    .footer-inner {
        padding: 0 15px;
    }
}

/* Tablet verticale (max 768px) */
@media (max-width: 768px) {

    /* Sidebar diventa comprimibile */
    .sidebar-modern {
        left: -230px;
        transition: 0.3s;
    }

    .sidebar-modern.open {
        left: 0;
    }

    /* Bottone per aprire la sidebar */
    .sidebar-toggle-btn {
        display: block;
        position: fixed;
        top: 90px;
        left: 15px;
        z-index: 1200;
        background: var(--navy);
        color: var(--bianco);
        padding: 8px 12px;
        border-radius: var(--radius);
        font-size: 14px;
    }

    .content-modern {
        margin-left: 0;
        padding: 20px;
    }
}

/* Smartphone (max 576px) */
@media (max-width: 576px) {

    .header-modern {
        padding: 0 15px;
    }

    .logo-modern {
        height: 40px;
    }

    .content-modern {
        padding: 15px;
    }

    .footer-logo2 {
        width: 110px;
    }

    .footer-logo-small {
        width: 55px;
    }

    .footer-text {
        font-size: 12px;
    }
}
/* =========================================================
   ANIMAZIONI
   ========================================================= */

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-20px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes slideInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* =========================================================
   UTILITY CLASSES
   ========================================================= */

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mt-30 { margin-top: 30px; }

.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.mb-30 { margin-bottom: 30px; }

.p-10 { padding: 10px; }
.p-20 { padding: 20px; }
.p-30 { padding: 30px; }

.w-100 { width: 100%; }
.w-50 { width: 50%; }

.d-flex { display: flex; }
.flex-center { display: flex; justify-content: center; align-items: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-column { display: flex; flex-direction: column; }

/* =========================================================
   SCROLLBAR MODERNA
   ========================================================= */

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--grigio-chiaro);
}

::-webkit-scrollbar-thumb {
    background: var(--grigio);
    border-radius: var(--radius);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--grigio-scuro);
}

/* =========================================================
   FIX FINALI
   ========================================================= */

/* Evita che il contenuto scorra sotto l’header */
body {
    overflow-x: hidden;
}

/* Evita glitch con modali */
.modal-overlay {
    backdrop-filter: blur(2px);
}

/* Migliora rendering font */
body, input, button, textarea {
    -webkit-font-smoothing: antialiased;
}

/* Evita che immagini enormi rompano il layout */
img {
    max-width: 100%;
    height: auto;
}

/* Rende cliccabili intere righe tabella se vuoi usarlo */
.table-row-clickable tr {
    cursor: pointer;
}

.table-row-clickable tr:hover td {
    background: var(--grigio-chiaro);
}

/* =========================================================
   TABELLA PRESIDI: filtri colonna (stile Excel) e azioni
   ========================================================= */

/* Icona imbuto nelle intestazioni */
.tabella-presidi th { white-space: nowrap; }
.th-filter {
    cursor: pointer; margin-left: 6px; font-size: 1.15em;
    opacity: 0.8; user-select: none;
}
.th-filter:hover { opacity: 1; }
.th-filter.attivo { opacity: 1; color: #007bff; }

/* Menù a spuntine */
.filter-dropdown {
    position: absolute; z-index: 1000; background: #fff;
    border: 1px solid #ccc; border-radius: 6px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.18);
    padding: 8px; min-width: 200px; max-width: 300px; font-size: 0.9em;
}
.filter-dropdown .fd-search-input {
    width: 100%; box-sizing: border-box; padding: 4px 6px;
    margin-bottom: 6px; border: 1px solid #ccc; border-radius: 4px;
}
.filter-dropdown .fd-list {
    max-height: 220px; overflow: auto;
    border-top: 1px solid #eee; border-bottom: 1px solid #eee; margin: 4px 0;
}
.filter-dropdown .fd-item {
    display: block; padding: 3px 2px; cursor: pointer;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.filter-dropdown .fd-item:hover { background: #f2f7ff; }
.filter-dropdown .fd-actions {
    display: flex; gap: 6px; justify-content: flex-end; margin-top: 6px;
}
.filter-dropdown .fd-actions button {
    cursor: pointer; padding: 4px 10px; border: none; border-radius: 4px;
}
.filter-dropdown .fd-ok { background: #007bff; color: #fff; }
.filter-dropdown .fd-clear { background: #eee; }

/* Bottoni azioni nella tabella presidi */
.btn-dismetti-mezzo,
.btn-solo-dismetti {
    cursor: pointer; border: none; border-radius: 4px;
    padding: 4px 10px; background: #e74c3c; color: #fff; white-space: nowrap;
}
.btn-dismetti-mezzo:hover,
.btn-solo-dismetti:hover { background: #c0392b; }

/* Dismetti e sostituisci (arancione, per distinguerlo) */
.btn-sost {
    cursor: pointer; border: none; border-radius: 4px;
    padding: 4px 10px; background: #e67e22; color: #fff; white-space: nowrap;
}
.btn-sost:hover { background: #ca6f1e; }

.btn-modifica-mezzo {
    cursor: pointer; border: none; border-radius: 4px;
    padding: 4px 10px; background: #3498db; color: #fff; white-space: nowrap;
}
.btn-modifica-mezzo:hover { background: #2980b9; }

.btn-salva-mezzo {
    cursor: pointer; border: none; border-radius: 4px;
    padding: 4px 10px; background: #27ae60; color: #fff; white-space: nowrap;
}
.btn-salva-mezzo:hover { background: #1e8449; }

.btn-annulla-mezzo {
    cursor: pointer; border: none; border-radius: 4px;
    padding: 4px 10px; background: #eee; white-space: nowrap;
}

/* Campi durante la modifica inline.
   Larghezze contenute così la riga non si allarga oltre lo schermo. */
.tabella-presidi input,
.tabella-presidi select {
    box-sizing: border-box; padding: 3px 5px;
    border: 1px solid #ccc; border-radius: 4px;
    max-width: 100%;
}
.tabella-presidi input.edit-voce,
.tabella-presidi input.edit-costruzione { width: 6.5em; }
.tabella-presidi input.edit-note        { width: 10em; }
.tabella-presidi select.edit-tipo       { width: 10em; }
.tabella-presidi input.edit-installazione { width: 9em; }
.tabella-presidi input.edit-scadenza      { width: 9em; }
.tabella-presidi input.edit-motivo      { width: 12em; }

/* Casella "Mostra anche i dismessi" */
.chk-dismessi { display: flex; align-items: center; gap: 6px; cursor: pointer; }

/* Riga di un mezzo dismesso (sbiadita) */
.riga-dismessa { opacity: 0.6; background: #f6f6f6; font-style: italic; }

/* Pulsante conferma dismissione */
.btn-conferma-dismetti {
    cursor: pointer; border: none; border-radius: 4px;
    padding: 4px 10px; background: #e74c3c; color: #fff; white-space: nowrap;
}
.btn-conferma-dismetti:hover { background: #c0392b; }

/* =========================================================
   POPUP INSERIMENTO MEZZO
   ========================================================= */
.barra-azioni-presidi {
    margin: 10px 0;
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.filtro-inline { display: flex; align-items: center; gap: 8px; }
.filtro-inline select { width: auto; min-width: 160px; }

.modal-mezzo-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5);
    display: none; align-items: flex-start; justify-content: center;
    z-index: 2000; padding: 30px 12px; overflow: auto;
}
.modal-mezzo-overlay.aperto { display: flex; }

.modal-mezzo {
    background: #fff; border-radius: 8px; padding: 20px;
    width: 100%; max-width: 640px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.25);
}
.modal-mezzo-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 14px;
}
.modal-mezzo-head h3 { margin: 0; }
.modal-mezzo-close {
    background: none; border: none; font-size: 1.2em; cursor: pointer; line-height: 1;
}

/* Campi del modulo: in griglia affiancata */
.form-griglia { display: flex; flex-wrap: wrap; gap: 12px; }
.form-griglia .form-campo { flex: 1 1 220px; }

.form-campo { margin-bottom: 12px; }
.form-campo label { display: block; font-weight: 600; margin-bottom: 4px; }
.form-campo input,
.form-campo select,
.form-campo textarea {
    width: 100%; box-sizing: border-box; padding: 6px 8px;
    border: 1px solid #ccc; border-radius: 4px;
}
.form-campo textarea { min-height: 60px; resize: vertical; }

/* Voci in griglia compatta */
.voci-griglia { display: flex; flex-wrap: wrap; gap: 10px; }
.voci-griglia .form-campo { flex: 1 1 150px; margin-bottom: 0; }

.modal-mezzo-actions {
    display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px;
}

/* Messaggio dentro il popup di inserimento */
.msg-inserimento { margin-top: 10px; font-weight: 600; }
.msg-inserimento.ok  { color: #1e8449; }
.msg-inserimento.err { color: #c0392b; }

/* Bottoni Salva/Annulla sempre sulla stessa riga */
.cell-azioni { white-space: nowrap; }

/* =========================================================
   TABELLA PRESIDI — densa, intestazione e azioni sempre visibili
   ========================================================= */
#lista_mezzi {
    max-height: 68vh;
    overflow: auto;                 /* scroll verticale E orizzontale DENTRO il box */
    border: 1px solid var(--grigio);
    border-radius: var(--radius);
}

/* Pagina mezzi: il riquadro tabella riempie lo spazio rimasto e scrolla DENTRO,
   così la PAGINA non scorre mai (resta tra header e footer) */
.contenitore-tabella.riempi {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.contenitore-tabella.riempi #lista_mezzi {
    flex: 1;
    min-height: 0;
    max-height: none;               /* l'altezza la decide lo spazio disponibile */
}

/* =========================================================
   SCHEDE / TAB (admin presidi)
   ========================================================= */
.tabs-presidi {
    display: flex; gap: 4px; flex-wrap: wrap;
    border-bottom: 2px solid var(--grigio);
    margin-bottom: 16px;
}
.tab-btn {
    background: none; border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    padding: 10px 18px;
    font-size: 14px; font-weight: 600;
    color: var(--grigio-scuro); cursor: pointer;
    border-top-left-radius: 6px; border-top-right-radius: 6px;
    transition: color .18s ease, border-color .18s ease, background .18s ease;
}
.tab-btn:hover { color: var(--navy); background: var(--grigio-chiaro); }
.tab-btn.active { color: var(--rosso); border-bottom-color: var(--rosso); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Iconcina "tre puntini" delle azioni di riga */
.btn-menu-mezzo {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 2px 8px;
    color: var(--navy);
    border-radius: 4px;
}
.btn-menu-mezzo:hover { background: var(--grigio-chiaro); }

/* Menù a tendina delle azioni (Modifica / Dismetti / ... future) */
.menu-azioni {
    position: fixed;
    z-index: 2500;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.18);
    padding: 6px;
    min-width: 160px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.menu-azioni .ma-item {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    color: var(--navy);
}
.menu-azioni .ma-item:hover { background: var(--grigio-chiaro); }
.menu-azioni .ma-dismetti,
.menu-azioni .ma-elimina { color: var(--rosso); }

/* Pulsanti azioni nella tabella presidi: più compatti (meno ingombranti) */
.tabella-presidi .btn-modifica-mezzo,
.tabella-presidi .btn-dismetti-mezzo,
.tabella-presidi .btn-sost,
.tabella-presidi .btn-solo-dismetti,
.tabella-presidi .btn-salva-mezzo,
.tabella-presidi .btn-annulla-mezzo,
.tabella-presidi .btn-conferma-dismetti {
    padding: 2px 7px;
    font-size: 11px;
    border-radius: 4px;
    line-height: 1.6;
}
/* Bottoni azione compatti nelle tabelle premium (account, sedi, permessi, dashboard...) */
.tabella-presidi .btn-azione,
.tabella-presidi .btn-toggle,
.tabella-presidi .btn-elimina-cliente,
.tabella-presidi .btn-elimina-account,
.tabella-presidi td:last-child a.btn,
.tabella-presidi td:last-child button.btn {
    padding: 3px 9px;
    font-size: 11px;
    border-radius: 5px;
    margin: 1px;
}

.tabella-presidi {
    border-collapse: collapse;
    border-spacing: 0;
    width: 100%;
    font-size: 12px;
}

/* Link dentro le tabelle premium (es. file documenti) */
.tabella-presidi a { color: var(--navy); font-weight: 600; text-decoration: none; }
.tabella-presidi a:hover { color: var(--rosso); }

/* Intestazione fissa in alto durante lo scroll */
.tabella-presidi thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: var(--antracite);
    color: #fff;
    font-weight: 600;
    padding: 6px 8px;
    white-space: nowrap;
    border: none;
    text-transform: uppercase;   /* intestazioni in MAIUSCOLO come i dati */
    letter-spacing: 0.3px;
}
.tabella-presidi tbody td {
    padding: 4px 8px;
    border-bottom: 1px solid #eceef1;
    white-space: nowrap;
    color: #333;
}

/* Righe a "zebra" + evidenziazione al passaggio (leggibilità su righe larghe) */
.tabella-presidi tbody tr:nth-child(odd)  td { background: #ffffff; }
.tabella-presidi tbody tr:nth-child(even) td { background: #f6f7f9; }
.tabella-presidi tbody tr:hover td { background: #fdeaec; }
/* niente "sollevamento" riga in questa tabella densa */
.tabella-presidi tbody tr:hover { transform: none; box-shadow: none; }

/* Documento NON ancora visto (dashboard): evidenziato anche in tabella premium */
.tabella-presidi tbody tr.non-visto td { background: #fff4e6; }
.tabella-presidi tbody tr.non-visto td:first-child { box-shadow: inset 4px 0 0 var(--rosso); }
.tabella-presidi tbody tr.non-visto:hover td { background: #ffeccc; }

/* =========================================================
   SCADENZARIO VISTA CLIENTE — semaforo urgenza (per cella scadenza)
   ========================================================= */
.tabella-presidi td.cell-scadenza.scad-rossa  { background: #fdecec !important; color: #a11;    font-weight: 600; }
.tabella-presidi td.cell-scadenza.scad-gialla { background: #fff6e0 !important; color: #8a5a00; font-weight: 600; }
.tabella-presidi td.cell-scadenza.scad-verde  { background: #eef7ef !important; }

.badge-scad {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
.badge-scad.rossa  { background: #f8d7da; color: #a11; }
.badge-scad.gialla { background: #ffe8b3; color: #8a5a00; }
.badge-scad.verde  { background: #d8f0dc; color: #1b6e2c; }
.badge-scad.done   { background: #e6e8eb; color: #666; }

/* Tabella senza colonna azioni: niente colonna fissa a destra.
   ATTENZIONE: l'intestazione (thead th) deve restare sticky in ALTO come le altre;
   qui rimuovo solo l'aggancio orizzontale (right) e l'ombra, non il position. */
.tabella-presidi.no-sticky-last td:last-child { position: static; box-shadow: none; }
.tabella-presidi.no-sticky-last th:last-child { right: auto; box-shadow: none; }

/* =========================================================
   VISTA CLIENTE — layout
   ========================================================= */
.vista-cliente-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px 16px;
    margin-bottom: 18px;
}
.vista-cliente-head h3 { margin: 0; font-size: 19px; color: var(--navy); }
.vista-cliente-head .vc-email { color: var(--grigio-scuro); font-size: 13px; }
.riepilogo-scad {
    margin-left: auto;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    gap: 12px;
}
.sede-blocco { margin-bottom: 28px; }
.sede-titolo {
    font-size: 15px;
    color: var(--navy);
    margin: 0 0 8px;
    padding: 8px 12px;
    background: var(--grigio-chiaro);
    border-left: 4px solid var(--rosso);
    border-radius: 6px;
}
.sede-titolo small { color: var(--grigio-scuro); font-weight: 400; margin-left: 8px; }
.sede-vuota { color: var(--grigio-scuro); font-size: 13px; margin: 4px 0 0 4px; }
.cat-titolo { font-size: 13px; font-weight: 600; color: var(--grigio-scuro); margin: 14px 0 6px 2px; text-transform: uppercase; letter-spacing: .3px; }
/* Riga cassetta espandibile (Vista Cliente) */
.tabella-presidi tbody tr.vc-cassetta { cursor: pointer; }
.tabella-presidi tbody tr.vc-cassetta td:first-child::before { content: "📦 "; }
.tabella-presidi tbody tr.vc-cassetta.aperta td { background: #eaf1fb !important; }
.vc-cont-row { display: none; }
.vc-cont-row.aperta { display: table-row; }
.vc-cont-row > td { background: #f4f6f9 !important; padding: 8px 14px !important; }
.vc-cont-inner { padding: 2px 0; }
.tabella-contenuti { width: auto; border-collapse: collapse; font-size: 12px; background: #fff; border-radius: 6px; }
.tabella-contenuti th, .tabella-contenuti td { padding: 5px 12px; text-align: left; border-bottom: 1px solid #e3e6ea; white-space: nowrap; }
.tabella-contenuti th { color: var(--grigio-scuro); text-transform: uppercase; font-size: 10px; letter-spacing: .3px; }
.tabella-contenuti tr:last-child td { border-bottom: none; }

/* Selettori a "chip" (sede / vista / categoria) */
.vc-selettore { display: flex; align-items: center; gap: 10px; margin: 14px 0 6px; flex-wrap: wrap; }
.vc-sel-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--grigio-scuro); }
.vc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.vc-chip {
    border: 1px solid var(--grigio);
    background: #fff;
    color: var(--navy);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.vc-chip:hover { background: var(--grigio-chiaro); }
.vc-chip.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.vc-chip .vc-conta { opacity: .7; font-weight: 400; margin-left: 4px; }

/* Pannelli mostrati/nascosti dalla navigazione a step */
.vc-sede-panel, .vc-vista-panel, .vc-cat-panel, .vc-doc-panel { display: none; }
.vc-sede-panel.active, .vc-vista-panel.active, .vc-cat-panel.active, .vc-doc-panel.active { display: block; }

/* Scroll interno alla tabella: intestazione fissa, scorre solo la lista */
.tabella-scroll { max-height: 62vh; overflow: auto; border-radius: 8px; }

/* =========================================================
   CENTRO SCADENZE — contatori
   ========================================================= */
.cs-contatori { display: flex; flex-wrap: wrap; gap: 12px; margin: 4px 0 6px; }
.cs-conta {
    flex: 1 1 160px;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,.08);
}
.cs-conta .cs-num { font-size: 26px; font-weight: 800; line-height: 1; }
.cs-rossa  { background: #c0392b; }
.cs-gialla { background: #e0a800; }
.cs-arancio{ background: #d97a17; }

.cs-blu { background: var(--navy); }

.sidebar-legenda { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.sidebar-nota { font-size: 12px; opacity: .8; margin-top: 8px; line-height: 1.4; }

/* Legenda semaforo in cima alla pagina (Centro Scadenze, ex sidebar) */
.cs-legenda { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 16px; }
.cs-legenda-nota { font-size: 12px; color: var(--grigio-scuro); }

/* Accordion clienti (Centro Scadenze) */
.cs-cliente {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,.07);
    margin-bottom: 10px;
    overflow: hidden;
}
.cs-cliente > summary {
    list-style: none;
    cursor: pointer;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-weight: 600;
    color: var(--navy);
}
.cs-cliente > summary::-webkit-details-marker { display: none; }
.cs-cliente > summary::before {
    content: "▸";
    color: var(--rosso);
    font-size: 14px;
    transition: transform .15s ease;
}
.cs-cliente[open] > summary::before { transform: rotate(90deg); }
.cs-cliente > summary:hover { background: var(--grigio-chiaro); }
.cs-cli-nome { font-size: 15px; }
.cs-cli-badge { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.cs-dettaglio { padding: 0 16px 16px; }
.cs-link-scheda { margin: 4px 0 10px; font-size: 13px; }
.cs-link-scheda a { color: var(--navy); font-weight: 600; text-decoration: none; }
.cs-link-scheda a:hover { color: var(--rosso); }

/* Riepilogo per sede dentro l'accordion cliente */
.cs-sede-recap { margin: 0 0 16px; }
.cs-sede-tit {
    font-size: 14px;
    color: var(--navy);
    margin: 0 0 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.cs-sede-recap .contenitore-tabella { margin-top: 6px; padding: 12px; }
.cs-sede-recap .tabella-presidi { font-size: 12px; }
.btn-crea-ordine { font-size: 12px; padding: 5px 11px; text-decoration: none; }

/* =========================================================
   ORDINI DI LAVORO
   ========================================================= */
.ol-testata { margin-bottom: 14px; }
.ol-cliente { margin: 0 0 12px; font-size: 14px; color: var(--navy); }
.ol-campi { display: flex; flex-wrap: wrap; gap: 14px; }
.ol-campi label { display: flex; flex-direction: column; font-size: 12px; font-weight: 600; color: var(--grigio-scuro); gap: 4px; }
.ol-campi .ol-note-lbl { flex: 1 1 280px; }
.ol-campi input, .ol-campi select { font-size: 14px; padding: 7px 10px; }

.ol-azioni-top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin: 6px 0 12px; }
.ol-azioni-bottom { display: flex; justify-content: flex-end; gap: 10px; margin: 16px 0; }
.ol-tutti { font-size: 13px; font-weight: 600; color: var(--navy); cursor: pointer; }

.ol-presidio { background: #fff; border: 1px solid var(--grigio); border-radius: 10px; margin-bottom: 10px; overflow: hidden; }
.ol-presidio-head { background: var(--grigio-chiaro); padding: 8px 14px; }
.ol-presidio-tit { font-weight: 700; color: var(--navy); font-size: 13px; }
.ol-ident { font-weight: 400; color: var(--grigio-scuro); margin-left: 8px; }
.ol-scadenze { padding: 8px 14px; display: flex; flex-direction: column; gap: 6px; }
.ol-scad { display: flex; align-items: center; gap: 10px; font-size: 13px; cursor: pointer; }
.ol-scad-nome { min-width: 160px; }
.ol-scad-view { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.ol-scad-view .ol-scad-data { color: var(--grigio-scuro); }
.ol-scad-nota { font-size: 12px; color: #555; margin: 2px 0 10px; padding: 4px 8px; background: #f4f6f9; border-radius: 6px; }
.ol-scad-nota.nota-warn { color: #8a5a00; background: #fff7e0; border-left: 3px solid #d97a17; }

/* Gestione ordine (riassegna/stato) */
.ol-gestione { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin: 4px 0 14px; padding: 12px; background: var(--grigio-chiaro); border-radius: 10px; }
.ol-gestione label { display: flex; flex-direction: column; font-size: 12px; font-weight: 600; color: var(--grigio-scuro); gap: 4px; }
.ol-note-view { font-size: 13px; margin: 4px 0 10px; }
.ol-elimina { margin-top: 12px; }
.ol-meta { font-size: 12px; color: var(--grigio-scuro); }

/* Badge stato ordine */
.badge-stato { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; color: #fff; }
.stato-aperto     { background: #2b6cb0; }
.stato-in_corso   { background: #d97a17; }
.stato-completato { background: #1b6e2c; }
.stato-annullato  { background: #888; }

/* Tecnico: niente footer → il contenuto usa tutta l'altezza */
.ruolo-tecnico .content-modern { height: auto; min-height: calc(100vh - 80px); }

/* Indicatore stato rete / coda offline (app tecnico) */
.net-ind {
    position: sticky;
    top: 0;
    z-index: 1500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
}
.net-ind.off  { background: #fde0e0; color: #a11; }
.net-ind.pend { background: #fff3cd; color: #8a5a00; }
.net-ind button {
    background: var(--navy);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

/* Lista ordini lato TECNICO (mobile-friendly) */
.tec-lista { display: flex; flex-direction: column; gap: 10px; }
.tec-card {
    display: block;
    background: #fff;
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
    text-decoration: none;
    color: var(--navy);
    border-left: 4px solid var(--rosso);
}
.tec-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.14); }
.tec-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tec-card-cliente { font-size: 16px; font-weight: 700; }
.tec-card-sede { font-size: 13px; color: var(--grigio-scuro); margin-top: 4px; }
.tec-card-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 13px; font-weight: 600; }
.tec-card-dafare { background: var(--grigio-chiaro); padding: 3px 10px; border-radius: 999px; }

/* Icona nota nella colonna Note + popup */
.btn-nota {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 4px;
}
.btn-nota:hover { background: var(--grigio-chiaro); }
.modal-nota { max-width: 420px; }

/* Popup contenuti del presidio */
.modal-contenuti { max-width: 860px; }
.contenuti-lista { display: flex; flex-direction: column; gap: 4px; max-height: 62vh; overflow: auto; margin-bottom: 12px; }
.contenuti-vuoto { color: var(--grigio-scuro); font-size: 13px; padding: 6px 2px; }
.contenuto-riga { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-bottom: 1px solid #eee; }
.contenuto-nome { font-weight: 600; color: var(--navy); flex: 1 1 auto; }
.contenuto-qta { color: var(--grigio-scuro); font-size: 12px; font-weight: 600; }
.contenuto-note { color: var(--grigio-scuro); font-size: 12px; }
.contenuto-riga .ed-qta { flex: 0 0 70px; }
.contenuti-form #cont-qta { flex: 0 0 80px; }
.contenuto-azioni { display: flex; gap: 4px; margin-left: auto; }
.btn-mini { background: none; border: 1px solid var(--grigio); border-radius: 6px; cursor: pointer; font-size: 13px; padding: 3px 7px; line-height: 1; }
.btn-mini:hover { background: var(--grigio-chiaro); }
.contenuto-riga input { font-size: 13px; padding: 5px 7px; }
.contenuto-riga .ed-nome { flex: 1 1 120px; }
.contenuti-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-top: 10px; border-top: 1px solid var(--grigio); }
.contenuti-form input { font-size: 14px; padding: 8px 10px; }
.contenuti-form #cont-nome { flex: 1 1 180px; }
.contenuti-form #cont-note { flex: 1 1 140px; }
.menu-azioni .ma-contenuti { color: var(--navy); }
.nota-testo {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 14px;
    color: #333;
    padding: 6px 2px 10px;
    line-height: 1.5;
}

/* Esecuzione ordine lato tecnico */
.to-testata p { margin: 4px 0; font-size: 14px; }
.to-azioni-top { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
.to-azioni-bottom { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; margin: 16px 0 30px; }
.to-scad { padding: 10px 0; border-bottom: 1px solid #eee; }
.to-scad:last-child { border-bottom: none; }
.to-scad-info { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.to-scad-nome { font-weight: 700; color: var(--navy); }
.to-scad-data { font-size: 12px; color: var(--grigio-scuro); }
.to-campi { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.to-campi input { font-size: 15px; padding: 10px; }
.to-campi .to-note { flex: 1 1 160px; }

/* Contenuti cassetta dentro l'ordine del tecnico */
.to-contenuti { margin-top: 10px; padding-top: 10px; border-top: 2px dashed #d7dde6; }
.to-cont-tit { font-weight: 700; color: var(--navy); margin-bottom: 8px; }
.to-cont-n { font-weight: 400; font-size: 12px; color: var(--grigio-scuro); margin-left: 6px; }
.to-cont-riga { padding: 8px 0; border-bottom: 1px solid #f0f0f0; }
.to-cont-riga:last-child { border-bottom: none; }
.to-cont-info { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.to-cont-nome { font-weight: 600; color: var(--antracite); }
.to-cont-qta { font-size: 13px; color: var(--grigio-scuro); }
.to-cont-nodata { font-size: 12px; color: var(--grigio-scuro); font-style: italic; }
.to-cont-campi { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.to-cont-campi .to-cont-lbl { display: flex; flex-direction: column; font-size: 11px; color: var(--grigio-scuro); gap: 2px; }
.to-cont-campi input { font-size: 15px; padding: 9px; }
.to-cont-q { width: 80px; }
.to-cont-note { flex: 1 1 160px; }
.to-cont-note-view { font-size: 13px; color: var(--rosso); }

/* Contenuti cassetta nella vista ufficio (sola lettura) */
.ol-contenuti { margin-top: 8px; padding: 8px 0 0; border-top: 1px dashed #d7dde6; }
.ol-cont-tit { font-weight: 700; color: var(--navy); font-size: 13px; margin-bottom: 6px; }
.ol-cont-riga { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 13px; padding: 3px 0; }
.ol-cont-nome { font-weight: 600; color: var(--antracite); }
.ol-cont-qta { color: var(--grigio-scuro); }
.ol-cont-nota { color: var(--rosso); }

/* Cassette in creazione ordine */
.ol-sezione-tit { font-weight: 700; color: var(--navy); margin: 18px 0 8px; padding-bottom: 4px; border-bottom: 2px solid var(--rosso); }
.ol-cassetta-lbl { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ol-cassetta-meta { font-size: 12px; color: var(--grigio-scuro); }

/* Avviso voci già in ordini aperti */
.ol-info-ordini { background: #fff7e6; border: 1px solid #ffe2a8; color: #8a5a00; border-radius: 8px; padding: 8px 12px; font-size: 13px; margin: 0 0 12px; }

/* Toolbar creazione ordine: filtri (categoria + tipo scadenza) + selezione + crea */
.ol-toolbar {
    position: sticky;
    top: 80px;          /* resta sotto l'header fisso (pagina che scrolla per intero) */
    z-index: 50;
    background: var(--grigio-chiaro);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 10px 0;
    margin: 0 0 12px;
    border-bottom: 1px solid var(--grigio);
}
.ol-filtri { display: flex; flex-direction: column; gap: 8px; }
.ol-filtro-riga { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.ol-filtro-lbl { font-size: 12px; font-weight: 700; color: var(--grigio-scuro); min-width: 78px; }
.ol-filtro-hint { font-size: 11px; color: var(--grigio-scuro); }
.ol-toolbar-azioni { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ol-toolbar-azioni .btn-primary { margin-left: auto; }
.ol-conta { font-size: 13px; font-weight: 600; color: var(--navy); white-space: nowrap; }

/* Barra ricerca + filtri categoria (ordine con tanti mezzi) */
.tec-toolbar {
    position: sticky;
    top: 0;
    z-index: 1200;
    background: #fff;
    padding: 10px;
    margin: 0 0 8px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.tec-cerca {
    font-size: 16px;            /* >=16px evita lo zoom automatico su iPhone */
    padding: 12px 14px;
    border: 2px solid var(--grigio);
    border-radius: 10px;
    width: 100%;
}
.tec-cat-chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.tcat {
    white-space: nowrap;
    border: 1px solid var(--grigio);
    background: #fff;
    color: var(--navy);
    border-radius: 999px;
    padding: 8px 13px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.tcat.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.tcat-n { opacity: .65; font-weight: 400; }
.tec-conta { font-size: 12px; color: var(--grigio-scuro); margin: 2px 0 8px 2px; }

/* Scheda mezzo più chiara/grande nel telefono (logica come le tabelle) */
.tec-head { padding: 10px 14px; }
.tec-mezzo-top { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.tec-num { font-size: 22px; font-weight: 800; color: var(--rosso); line-height: 1; }
.tec-ubic { font-size: 15px; font-weight: 700; color: var(--navy); }
.tec-tipo-line { font-size: 12px; color: var(--grigio-scuro); margin-top: 3px; text-transform: uppercase; letter-spacing: .3px; }
.tec-voci { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; }
.tec-voce { font-size: 12px; color: #333; }
.tec-voce .tv-l { color: var(--grigio-scuro); font-weight: 600; }

/* Scheda mezzo a fisarmonica (apri/chiudi al tocco) */
.tec-presidio > summary { cursor: pointer; list-style: none; position: relative; padding-right: 28px; }
.tec-presidio > summary::-webkit-details-marker { display: none; }
.tec-presidio > summary::after { content: "▸"; position: absolute; right: 12px; top: 12px; color: var(--rosso); font-size: 16px; transition: transform .15s ease; }
.tec-presidio[open] > summary::after { transform: rotate(90deg); }
.tec-prog { margin-left: auto; font-weight: 800; color: var(--grigio-scuro); }
.mezzo-fatto > summary .tec-num { color: #1b6e2c; }
.mezzo-fatto > summary { background: #f3faf4; }

/* Sezione "Eseguiti" */
.tec-eseguiti { margin-top: 16px; border-top: 2px dashed var(--grigio); padding-top: 8px; }
.tec-eseguiti > summary { cursor: pointer; font-weight: 700; color: var(--navy); padding: 8px 4px; list-style: none; }
.tec-eseguiti > summary::-webkit-details-marker { display: none; }
#sez-eseguiti { margin-top: 8px; }

/* Bottoni grandi "da cantiere" per l'esito */
.esito-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.eb {
    border: 2px solid var(--grigio);
    background: #fff;
    color: var(--navy);
    border-radius: 10px;
    padding: 11px 14px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    flex: 1 1 auto;
    min-width: 92px;
    transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.eb.on.eb-eseguito { background: #1b6e2c; border-color: #1b6e2c; color: #fff; }
.eb.on.eb-anomalia { background: #d97a17; border-color: #d97a17; color: #fff; }
.eb.on.eb-non      { background: #c0392b; border-color: #c0392b; color: #fff; }

/* Badge esito riga */
.badge-esito { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.esito-da_fare      { background: #e6e8eb; color: #555; }
.esito-eseguito     { background: #d8f0dc; color: #1b6e2c; }
.esito-anomalia     { background: #ffe0b3; color: #8a5a00; }
.esito-non_eseguito { background: #f8d7da; color: #a11; }

/* Pulsanti stampa / esporta */
.btn-stampa { margin-left: auto; }
.btn-export { background: #1b6e2c; border-color: #1b6e2c; color: #fff; }
.btn-export:hover { background: #155c24; border-color: #155c24; color: #fff; }

/* =========================================================
   STAMPA REGISTRO — intestazione (visibile solo in stampa)
   ========================================================= */
.print-only { display: none; }

.print-intestazione { margin: 0 0 8px; }
.print-intestazione .pi-ditta { display: flex; align-items: center; gap: 12px; }
.print-intestazione .pi-logo { height: 46px; width: auto; }
.print-intestazione .pi-ditta strong { font-size: 14px; }
.print-intestazione .pi-cliente { margin-top: 8px; font-size: 12px; }
.print-intestazione .pi-note { font-size: 12px; margin-top: 2px; }
.print-intestazione .pi-reg { font-size: 16px; font-weight: 700; text-transform: uppercase; margin-top: 10px; letter-spacing: .5px; }

/* Foglio A4 in orizzontale per la stampa del registro */
@page { size: A4 landscape; margin: 10mm; }

@media print {
    /* Nascondi tutta l'interfaccia: resta solo intestazione + tabella */
    header.header-modern,
    aside.sidebar-modern,
    .footer-premium,
    .menu-hamburger,
    .titolo-pagina,
    .vista-cliente-head,
    .vc-selettore,
    .cat-titolo,
    .th-filter,
    .btn-stampa,
    .no-print { display: none !important; }

    .content-modern {
        margin: 0 !important;
        padding: 0 !important;
        height: auto !important;
        overflow: visible !important;
        display: block !important;
    }
    .tabella-scroll { max-height: none !important; overflow: visible !important; }
    .contenitore-tabella { box-shadow: none !important; padding: 0 !important; margin: 0 0 12px !important; }

    .print-only { display: block !important; }

    .tabella-presidi { font-size: 9px !important; }
    .tabella-presidi thead th {
        position: static !important;
        background: #e9ebee !important;
        color: #000 !important;
        text-transform: none !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    /* mantieni i colori del semaforo anche in stampa */
    .tabella-presidi td.cell-scadenza.scad-rossa  { background: #fdecec !important; }
    .tabella-presidi td.cell-scadenza.scad-gialla { background: #fff6e0 !important; }
    .tabella-presidi td.cell-scadenza.scad-verde  { background: #eef7ef !important; }
    .tabella-presidi td.cell-scadenza {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    /* La tabella deve rientrare nella larghezza del foglio (A4 orizzontale) */
    .tabella-presidi { width: 100% !important; table-layout: fixed !important; font-size: 8px !important; }
    .tabella-presidi th,
    .tabella-presidi td {
        white-space: normal !important;
        word-break: break-word;
        overflow-wrap: anywhere;
        padding: 2px 3px !important;
    }

    /* Ogni registro (categoria) inizia su una NUOVA pagina: mai 2 intestazioni insieme */
    .vc-cat-panel { page-break-before: always; }
    .vc-cat-panel.is-first-print { page-break-before: avoid; }
    .print-intestazione { page-break-inside: avoid; }

    /* evita di spezzare le righe a metà pagina; ripeti l'intestazione tabella */
    thead { display: table-header-group; }
    tr { page-break-inside: avoid; }
}

.doc-titolo { font-size: 13px; color: var(--navy); margin: 12px 0 6px 2px; }
.doc-lista { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.doc-lista a { color: var(--navy); text-decoration: none; font-size: 13px; }
.doc-lista a:hover { color: var(--rosso); }
.doc-lista .doc-meta { color: var(--grigio-scuro); font-size: 11px; margin-left: 6px; }

/* Lista clienti nella sidebar (ricerca) */
.vc-cliente-list { display: flex; flex-direction: column; gap: 2px; max-height: 60vh; overflow-y: auto; margin-top: 8px; }
.vc-cliente-list a {
    display: block;
    padding: 7px 10px;
    border-radius: 6px;
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    opacity: 0.85;
}
.vc-cliente-list a:hover { background: rgba(255,255,255,0.12); opacity: 1; }
.vc-cliente-list a.attivo { background: var(--rosso); opacity: 1; }

/* Combobox scelta cliente (in cima alla pagina, ex sidebar) */
.vc-cliente-picker { position: relative; max-width: 480px; margin: 0 0 18px; }
.vc-cliente-input {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--grigio);
    border-radius: 10px;
    font-size: 15px;
    background: #fff;
    color: var(--antracite);
}
.vc-cliente-input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(20,40,70,.08); }
.vc-cliente-dd {
    display: none;
    position: absolute;
    left: 0; right: 0;
    top: calc(100% + 4px);
    background: #fff;
    border: 1px solid var(--grigio);
    border-radius: 10px;
    box-shadow: var(--shadow);
    max-height: 340px;
    overflow-y: auto;
    z-index: 1500;
}
.vc-cliente-dd.aperta { display: block; }
.vc-cliente-opt {
    display: block;
    padding: 10px 14px;
    color: var(--antracite);
    text-decoration: none;
    border-bottom: 1px solid #f0f0f0;
}
.vc-cliente-opt:last-child { border-bottom: none; }
.vc-cliente-opt:hover,
.vc-cliente-opt.evidenzia { background: var(--grigio-chiaro); }
.vc-cliente-opt.attivo { color: var(--rosso); font-weight: 600; }

/* Barra ricerca + azioni della pagina Clienti (ex sidebar) */
.clienti-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0 0 16px; }
.clienti-cerca {
    flex: 1 1 280px;
    max-width: 420px;
    padding: 11px 14px;
    border: 1px solid var(--grigio);
    border-radius: 10px;
    font-size: 15px;
    background: #fff;
    color: var(--antracite);
}
.clienti-cerca:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(20,40,70,.08); }
.clienti-conta { font-size: 12px; color: var(--grigio-scuro); }
.clienti-toolbar #btn-apri-add { margin-left: auto; }

/* Link "torna indietro" in cima alle pagine (ex pulsante sidebar) */
.link-indietro { display: inline-block; margin: 0 0 12px; color: var(--navy); text-decoration: none; font-weight: 600; font-size: 14px; }
.link-indietro:hover { color: var(--rosso); }

/* Selettore sede (attiva categorie) nella barra in cima */
.acs-lbl { font-weight: 600; color: var(--antracite); }
.acs-select {
    flex: 1 1 280px;
    max-width: 480px;
    padding: 10px 12px;
    border: 1px solid var(--grigio);
    border-radius: 10px;
    font-size: 15px;
    background: #fff;
    color: var(--antracite);
}
.acs-select:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(20,40,70,.08); }

/* Breadcrumb di navigazione (in cima a tutte le sotto-pagine, da header.php) */
.breadcrumb { font-size: 13px; margin: 0 0 12px; color: var(--grigio-scuro); }
.breadcrumb a { color: var(--navy); text-decoration: none; font-weight: 600; }
.breadcrumb a:hover { color: var(--rosso); }
.breadcrumb .bc-sep { margin: 0 6px; color: var(--grigio); }
.breadcrumb .bc-corrente { font-weight: 600; color: var(--antracite); }
.ms-contesto { margin: 0 0 16px; color: var(--antracite); }

/* Dropzone caricamento PDF (upload.php) */
.drop-zone {
    border: 2px dashed #999;
    padding: 25px;
    min-height: 150px;
    cursor: pointer;
    transition: 0.2s;
    border-radius: 10px;
}
.drop-zone.dragover { border-color: var(--navy); background-color: #eef6ff; }

/* Colonna AZIONI sempre visibile a destra (non serve più scrollare) */
.tabella-presidi th:last-child,
.tabella-presidi td:last-child {
    position: sticky;
    right: 0;
    box-shadow: -6px 0 8px -6px rgba(0,0,0,0.18);
}
.tabella-presidi td:last-child { z-index: 1; }
.tabella-presidi thead th:last-child { z-index: 4; } /* angolo alto-destra sopra tutto */
.tabella-presidi tbody tr:nth-child(odd)  td:last-child { background: #ffffff; }
.tabella-presidi tbody tr:nth-child(even) td:last-child { background: #f6f7f9; }
.tabella-presidi tbody tr:hover td:last-child { background: #fdeaec; }

/* Ancora più compatta su schermi piccoli */
@media (max-width: 768px) {
    .tabella-presidi { font-size: 11px; }
    .tabella-presidi thead th { padding: 5px 6px; }
    .tabella-presidi tbody td  { padding: 4px 6px; }
    #lista_mezzi { max-height: 75vh; }
}

/* =========================================================
   REWORK 2026 — FASE 1: bottoni filtri unificati + micro-interazioni
   ========================================================= */

/* Bottoni filtri/azioni che prima non avevano stile coerente */
.btn-filtra,
.btn-mail,
.btn-reset {
    display: inline-block;
    padding: 7px 13px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: transform .12s ease, background .18s ease, box-shadow .18s ease;
}
/* Azione principale (applica filtro / crea) → rosso brand */
.btn-filtra {
    background: var(--rosso);
    color: #fff;
    border-color: var(--rosso);
}
.btn-filtra:hover { background: var(--rosso-scuro); }

/* Invio mail / azione secondaria forte → navy */
.btn-mail {
    background: var(--navy);
    color: #fff;
    border-color: var(--navy);
}
.btn-mail:hover { background: #0d2747; }

/* Reset / annulla → chiaro neutro (leggibile sia su chiaro sia su sidebar scura) */
.btn-reset {
    background: var(--bianco);
    color: var(--navy);
    border-color: var(--grigio);
}
.btn-reset:hover { background: var(--grigio); border-color: var(--grigio-scuro); }

/* =========================================================
   REWORK 2026 — FASE 2: menù mobile (hamburger) + responsive
   ========================================================= */
.menu-hamburger {
    display: none;            /* nascosto su desktop */
    font-size: 26px;
    line-height: 1;
    color: var(--navy);
    background: none;
    border: none;
    padding: 4px 10px;
    cursor: pointer;
}

@media (max-width: 768px) {
    /* Mostra l'hamburger */
    .menu-hamburger { display: block; }

    /* Nav principale → pannello a tendina sotto l'header */
    .header-nav {
        display: none;
        position: absolute;
        top: 80px; left: 0; right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background: var(--bianco);
        border-bottom: 1px solid var(--grigio);
        box-shadow: var(--shadow);
        padding: 6px 0;
        z-index: 1500;
    }
    .header-nav.open { display: flex; }
    .header-nav .nav-item,
    .header-nav .drop-btn {
        width: 100%;
        text-align: left;
        border-radius: 0;
        padding: 12px 18px;
    }
    /* Sotto-menù sempre espansi (no hover su touch) */
    .header-nav .drop-menu {
        position: static;
        display: flex;
        flex-direction: column;
        border: none;
        box-shadow: none;
        min-width: 0;
        padding: 0 0 0 30px;
    }
    .nav-dropdown { padding-bottom: 0; }

    /* Sidebar → blocco in cima al contenuto (niente drawer) */
    .sidebar-modern {
        position: static;
        width: 100%;
        height: auto;
        margin-top: 80px;      /* sotto l'header fisso */
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.10);
        box-shadow: none;
        padding: 14px;
    }
    .content-modern {
        margin-left: 0;
        margin-top: 0;
        height: auto;
        overflow: visible;
        padding-bottom: 90px;   /* spazio per il footer fisso su mobile */
    }
    html, body { height: auto; overflow: auto; }

    /* Tabelle larghe: scorrono invece di rompere il layout */
    .contenitore-tabella { overflow-x: auto; }
}

/* Bottoni dei filtri DENTRO la sidebar: a tutta larghezza e ordinati */
.sidebar-modern .btn-filtra,
.sidebar-modern .btn-reset,
.sidebar-modern #btn-apri-add {
    display: block;
    width: 100%;
    text-align: center;
    margin-top: 8px;
}

/* Micro-interazione elegante e discreta su tutti i pulsanti */
.btn,
.btn-filtra,
.btn-mail,
.btn-reset,
.btn-azione,
.btn-modal-primary,
.btn-modal-secondary {
    transition: transform .12s ease, background .18s ease, box-shadow .18s ease, color .18s ease;
}
.btn:hover,
.btn-filtra:hover,
.btn-mail:hover,
.btn-reset:hover,
.btn-modal-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.14);
}
.btn:active,
.btn-filtra:active,
.btn-mail:active,
.btn-reset:active,
.btn-modal-primary:active {
    transform: translateY(0);
    box-shadow: none;
}
