/*
 * Target portable Depusoft - CSS centralizzato Hydro normalizzato.
 * Sorgente fornita: docs/reference/hydrometalservice_css_fornito_2026-06-30.css
 * Normalizzazioni: path /assets -> /products/depusoft/assets, import remoti disattivati.
 */

/*
 * ============================================================================
 * Hydrometalservice — hydrometalservice.css  (versione unificata, sostituisce style.css)
 * THCS - Telemedicine for Health Care Solutions
 *
 * COME PERSONALIZZARE I COLORI:
 * Modifica SOLO le variabili nella sezione :root (01).
 * Tutti i componenti si aggiorneranno automaticamente.
 *
 * INDICE SEZIONI
 * ─────────────────────────────────────────────────────────────────────────
 *  01. VARIABILI CSS (:root)
 *  02. LOGIN
 *  03. TOPBAR                              → barra_superiore.php
 *  04. NOTIFICHE CAMPANELLA                → barra_superiore.php
 *  05. DROPDOWN PROFILO                    → barra_superiore.php
 *  06. FOOTER                              → footer.php
 *  07. I MIEI DATI — Layout & Profilo      → imieidati.php
 *  08. I MIEI DATI — Upload Foto           → imieidati.php
 *  09. I MIEI DATI — Privacy & Password    → imieidati.php
 *  10. MODAL FOTO PROFILO                  → imieidati.php
 *  11. CLASSI GLOBALI CONDIVISE
 *  12. HOME PAGE
 *  13. TABELLE SCHEDE & LISTE
 *  14. AGENTI
 *  15. RESPONSIVE MOBILE
 *  16. CALENDARIO
 *  17. INTERVENTI
 *  18. INSTALLAZIONI
 *  19. AVVISI
 *  20. GESTIONE AZIENDA
 *  21. DOCUMENTI AZIENDA
 *  22. MEZZI
 *  23. SUPPORTO
 *  24. FRAMEWORK BASE (body, reset, utility)
 *  25. TOPBAR & NAVBAR (framework)
 *  26. SIDEBAR & MENU LATERALE (framework)
 *  27. METISMENU (navigazione)
 *  28. BOTTONI (framework)
 *  29. FORM (framework)
 *  30. PANEL & CARD (framework)
 *  31. MODAL & DRAWER (framework)
 *  32. TABS (framework)
 *  33. PAGINAZIONE & BADGE (framework)
 *  34. TABELLE DATATABLES (framework)
 *  35. DROPDOWN PROFILO (framework)
 *  36. TOAST
 *  37. COMPONENTI AGGIUNTIVI (calendar, timeline, grafici, mappe)
 * ============================================================================
 */


/* ============================================================================
   01. VARIABILI CSS (:root)
   Modifica qui per cambiare l'intero tema grafico
   ============================================================================ */

:root {
    /* ── Colori brand ─────────────────────────────────────────────────────── */
    --brand-color:          #19ADF1;
    --brand-hover:          #0d8bc4;
    --brand-light:          rgba(25, 173, 241, 0.08);
    --brand-light-hover:    rgba(25, 173, 241, 0.15);
    --brand-glow:           rgba(25, 173, 241, 0.28);
    --brand-glow-focus:     rgba(25, 173, 241, 0.18);
    --brand-border:         rgba(25, 173, 241, 0.30);

    /* ── Testi ────────────────────────────────────────────────────────────── */
    --text-dark:            #2c3e50;
    --text-body:            #475467;
    --text-muted:           #7f8c8d;
    --text-placeholder:     #aab0b8;
    --text-white:           #ffffff;

    /* ── Sfondi ───────────────────────────────────────────────────────────── */
    --bg-page:              #f5f5f5;
    --bg-card:              #ffffff;
    --bg-input:             #f5f7fa;
    --bg-input-focus:       #ffffff;
    --bg-subtle:            #f9fafb;
    --bg-info:              #f0f8ff;

    /* ── Bordi ────────────────────────────────────────────────────────────── */
    --border-light:         #eaecf0;
    --border-input:         rgba(0, 0, 0, 0.12);
    --border-card:          rgba(0, 0, 0, 0.08);
    --border-info:          #e1effe;

    /* ── Palette stati ────────────────────────────────────────────────────── */
    --color-danger:         #c9100e;
    --color-danger-dark:    #b42318;
    --color-danger-hover:   #912018;
    --color-danger-light:   #fff5f5;
    --color-danger-subtle:  #fef3f2;
    --color-danger-border:  #f9d5d5;

    --color-success:        #10b981;
    --color-success-hover:  #0ea374;
    --color-success-text:   #027a48;
    --color-success-light:  #ecfdf3;
    --color-success-border: #a6f4c5;
    --color-success-icon:   #a9efc5;

    --color-warning:        #f59e0b;
    --color-warning-hover:  #d97706;
    --color-warning-text:   #b54708;
    --color-warning-light:  #fffaeb;
    --color-warning-border: #fedf89;

    --color-orange:         #ea580c;
    --color-orange-text:    #c2410c;
    --color-orange-light:   #fff7ed;
    --color-orange-border:  #fed7aa;

    --color-info:           #0369a1;
    --color-info-light:     #f0f9ff;
    --color-info-border:    #bae6fd;

    /* ── Scala grigi ──────────────────────────────────────────────────────── */
    --color-gray-50:        #f9fafb;
    --color-gray-100:       #f2f4f7;
    --color-gray-200:       #eaecf0;
    --color-gray-300:       #d0d5dd;
    --color-gray-400:       #98a2b3;
    --color-gray-500:       #667085;
    --color-gray-600:       #475467;
    --color-gray-700:       #344054;
    --color-gray-800:       #1d2939;
    --color-empty:          var(--color-gray-400);

    /* ── Card / Panel / Bottoni ───────────────────────────────────────────── */
    --radius-card:          8px;
    --radius-btn:           50px;
    --radius-input:         12px;
    --shadow-card:          0 2px 10px rgba(0, 0, 0, 0.08);
    --shadow-drawer:        -5px 0 25px rgba(0, 0, 0, 0.15);
    --shadow-btn:           0 4px 6px rgba(50, 50, 93, 0.11), 0 1px 3px rgba(0, 0, 0, 0.08);

    /* ── Login ────────────────────────────────────────────────────────────── */
    --login-bg:             #07111f;
    --login-overlay-left:   rgba(4, 8, 15, 0.42);
    --login-overlay-center: rgba(4, 8, 15, 0.28);
    --login-overlay-right:  rgba(4, 8, 15, 0.62);
    --login-card-bg:        rgba(14, 26, 46, 0.88);
    --login-card-border:    rgba(255, 255, 255, 0.08);
    --login-title-color:    #ffffff;
    --login-label-color:    rgba(255, 255, 255, 0.92);
    --login-input-bg:       rgba(255, 255, 255, 0.10);
    --login-input-bg-focus: rgba(255, 255, 255, 0.14);
    --login-input-border:   rgba(255, 255, 255, 0.08);
    --login-placeholder:    rgba(255, 255, 255, 0.48);
    --login-eye-color:      rgba(255, 255, 255, 0.64);
    --login-input-text:     #ffffff;

    /* ── Layout / Topbar / Sidebar ────────────────────────────────────────── */
    --topbar-bg:            #f5f5f5;
    --topbar-height:        70px;
    --sidebar-width:        240px;
    --sidebar-mini-width:   70px;
    --sidebar-bg:           #ffffff;
    --page-content-bg:      #ffffff;
    --body-bg:              #f5f5f5;
    --border-page:          #f5f5f5;
    --menu-text:            #626773;
    --menu-text-hover:      #ffffff;
    --menu-active-from:     var(--brand-hover);
    --menu-active-to:       var(--brand-color);
    --menu-second-text:     #888d9a;
    --panel-heading-bg:     #f5f5f5;

    /* ── Tabs & Paginazione ───────────────────────────────────────────────── */
    --tab-active-color:     var(--brand-color);
    --tab-border-color:     #cccccc;
    --pagination-active-bg: var(--brand-color);

    /* ── Bottoni base ─────────────────────────────────────────────────────── */
    --btn-primary-bg:       var(--brand-color);
    --btn-primary-hover:    var(--brand-hover);
    --btn-default-bg:       #ffffff;
    --btn-default-border:   #cccccc;
    --btn-success-bg:       #23b195;
    --btn-danger-bg:        var(--color-danger);

    /* ── Input ────────────────────────────────────────────────────────────── */
    --input-border:         gainsboro;
    --input-focus-border:   var(--brand-color);

    /* ── Font ─────────────────────────────────────────────────────────────── */
    --font-main:            'Noto Sans', sans-serif;
    --font-alt:             'Hind', sans-serif;
}


/* ============================================================================
   02. LOGIN — login.html
   ============================================================================ */

html.auth-html,
body.auth-body {
    margin: 0 !important;
    padding: 0 !important;
    width: 100%;
    height: 100%;
    min-height: 100%;
    overflow: hidden;
    background: var(--login-bg);
}

body.auth-body {
    font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
    color: var(--text-white);
}

.auth-page,
.auth-page *,
.auth-page *::before,
.auth-page *::after {
    box-sizing: border-box;
}

.auth-page { position: relative; width: 100vw; height: 100vh; min-height: 100vh; margin: 0; padding: 0; overflow: hidden; background: var(--login-bg); font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif; color: var(--text-white); }
.auth-bg { position: absolute; inset: 0; z-index: 0; }
.auth-bg-img { position: absolute; inset: 0; background: url('/products/depusoft/assets/images/bg_login.jpg') center center / cover no-repeat; }
.auth-bg-overlay { position: absolute; inset: 0; background: linear-gradient(90deg, var(--login-overlay-left) 0%, var(--login-overlay-center) 38%, var(--login-overlay-right) 100%); }
.auth-content { position: relative; z-index: 1; min-height: 100vh; height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 480px); align-items: center; gap: 40px; padding: 32px 48px; }
.auth-hero { display: flex; align-items: center; min-height: 100%; }
.auth-hero-inner { max-width: 760px; padding-right: 20px; }
.auth-hero-title { margin: 0 0 18px; font-size: clamp(42px, 5vw, 68px); line-height: 1.03; font-weight: 500; letter-spacing: -0.03em; color: var(--text-white); text-shadow: 0 8px 30px rgba(0,0,0,0.28); }
.auth-hero-text { margin: 0; max-width: 720px; font-size: clamp(18px, 1.45vw, 24px); line-height: 1.5; font-weight: 400; color: rgba(255,255,255,0.88); text-shadow: 0 6px 18px rgba(0,0,0,0.22); }
.auth-panel-wrap { display: flex; align-items: center; justify-content: center; width: 100%; }
.auth-panel-stack { width: 100%; max-width: 430px; display: flex; flex-direction: column; align-items: stretch; }
.auth-brand-outside { 
    width: fit-content; 
    
    /* MODIFICA QUI: ho inserito -40px al posto dello 0 iniziale */
    margin: -40px auto -50px; 
    
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    gap: 8px; 
    position: relative;
    z-index: 10; 
}

.auth-brand-logo { 
    display: block; 
    /* 1. Prima imposta la grandezza che desideri per il logo */
    width: 250px; 
    max-width: 100%; 
    height: auto; 
    max-height: none; 
    object-fit: contain; 
}
.auth-panel { width: 100%; background: var(--login-card-bg); border: 1px solid var(--login-card-border); border-radius: 24px; padding: 34px 28px 30px; box-shadow: 0 30px 70px rgba(0,0,0,0.35); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.auth-form-title { margin: 0 0 26px; text-align: center; font-size: 36px; line-height: 1.1; font-weight: 500; color: var(--login-title-color); }
.auth-field { margin-bottom: 18px; }
.auth-label { display: block; margin-bottom: 8px; font-size: 15px; font-weight: 400; color: var(--login-label-color); }
.wrap-input100 { position: relative; width: 100%; margin-bottom: 0; background: transparent !important; border: 0 !important; }
.input100.auth-input { display: block; width: 100%; max-width: 100%; height: 52px; padding: 0 54px 0 18px; border-radius: var(--radius-input); border: 1px solid var(--login-input-border); background: var(--login-input-bg); color: var(--login-input-text); font-size: 15px; transition: border-color .2s, box-shadow .2s, background .2s; }
.input100.auth-input:focus { outline: none; border-color: var(--brand-color); background: var(--login-input-bg-focus); box-shadow: 0 0 0 4px var(--brand-glow-focus); }
.input100.auth-input::placeholder { color: var(--text-placeholder); }
.focus-input100 { display: none !important; }
.btn-show-pass { position: absolute; top: 50%; right: 14px; transform: translateY(-50%); z-index: 5; color: #0f2638; font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; margin: 0; padding: 0; border: 0; border-radius: 999px; background: rgba(255,255,255,0.55); opacity: 1; line-height: 1; -webkit-appearance: none; appearance: none; box-shadow: 0 0 0 1px rgba(15,38,56,0.08), 0 2px 8px rgba(0,0,0,0.10); }
.btn-show-pass:hover, .btn-show-pass:focus { color: #07111f; background: rgba(255,255,255,0.80); outline: none; }
.btn-show-pass .auth-eye, .btn-show-pass i { display: block; width: 20px; height: 20px; opacity: 1; }
.btn-show-pass .auth-eye path, .btn-show-pass .auth-eye circle { stroke-width: 2.2; }
.auth-actions { display: flex; justify-content: center; margin: 0 0 20px; }
.auth-forgot-link { font-size: 14px; color: var(--brand-color); text-decoration: none; transition: color .2s; }
.auth-forgot-link:hover { color: var(--brand-hover); text-decoration: none; }
.auth-submit { display: inline-flex; align-items: center; justify-content: center; width: 100%; height: 52px; border: 0; border-radius: var(--radius-input); background: var(--brand-color); color: var(--text-white); font-size: 17px; font-weight: 500; cursor: pointer; transition: background .2s, transform .15s, box-shadow .2s; box-shadow: 0 14px 30px var(--brand-glow); }
.auth-submit:hover { background: var(--brand-hover); }
.auth-submit:active { transform: translateY(1px); }

@media (max-width: 1200px) { .auth-content { grid-template-columns: minmax(0, 1fr) minmax(340px, 430px); padding: 28px; gap: 28px; } }
@media (max-width: 991px) { .auth-content { grid-template-columns: 1fr; gap: 26px; padding: 22px 16px 28px; } .auth-hero-inner { max-width: 100%; padding-right: 0; padding-top: 18px; } .auth-hero-title { font-size: 42px; margin-bottom: 14px; } .auth-panel { max-width: 100%; padding: 28px 20px 24px; border-radius: 20px; } .auth-panel-stack { max-width: 100%; } }
@media (max-width: 575px) { .auth-content { padding: 16px 12px 24px; } .auth-hero-title { font-size: 36px; } .auth-hero-text { font-size: 16px; line-height: 1.45; } }
@media (max-width: 991px) { html.auth-html, body.auth-body { overflow-y: auto; } .auth-page { width: 100%; height: auto; min-height: 100vh; overflow: visible; } .auth-content { height: auto; min-height: 100vh; } }


/* ============================================================================
   03. TOPBAR — barra_superiore.php
   ============================================================================ */

.topbar .logo .logo-lg-img { 
    width: auto !important; 
    height: auto !important;
    max-height: 55px !important;  /* Tiene l'ingombro reale sotto controllo */
    margin: 0 auto !important;
    vertical-align: middle !important; 
    display: inline-block !important;
    
    /* Questo è il trucco: alza o abbassa il valore (es. 1.1, 1.3, 1.5) per regolarlo a vista */
    transform: scale(1.3) !important; 
    transform-origin: center center !important; 
}

.topbar .logo .logo-sm-img { 
    height: 40px !important; 
    width: auto !important; 
    display: none; 
    vertical-align: middle;
}


/* ============================================================================
   04. NOTIFICHE CAMPANELLA — barra_superiore.php
   ============================================================================ */

.notifi-label-text { flex-grow: 1; font-weight: 600; line-height: 1; margin-top: 2px; }
.notification-scroll { max-height: 280px; overflow-y: auto; overflow-x: hidden; }
.notify-icon { background: var(--brand-light); color: var(--brand-color); border-radius: 50%; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.notify-icon i { margin: 0 !important; line-height: 1 !important; display: block; }
.notify-time-small { font-size: 10px; color: var(--text-muted); }
.notify-empty { padding: 40px 15px; border: none; text-align: center; color: var(--text-muted); }
.notify-empty-icon { font-size: 35px; opacity: 0.3; display: block; margin-bottom: 8px; }
.notify-empty-text { font-size: 13px; }
.notify-footer-divider { border-right: 1px solid var(--border-light); }
.btn-segna-letti { color: var(--brand-color); }
.notify-disabled { color: #cccccc; cursor: not-allowed; }


/* ============================================================================
   05. DROPDOWN PROFILO — barra_superiore.php
   ============================================================================ */

.profile-dropdown > li > a.profile-link:hover { background-color: var(--brand-light-hover); color: var(--brand-color); transform: translateX(4px); }
.profile-dropdown > li > a.profile-link:hover i { color: var(--brand-color) !important; }
.profile-dropdown > li > a.logout-link:hover { background-color: var(--color-danger-light); color: var(--color-danger); transform: translateX(4px); }
.profile-dropdown > li > a.logout-link:hover i { color: var(--color-danger) !important; }


/* ============================================================================
   06. FOOTER — footer.php
   ============================================================================ */

.footer a { color: var(--brand-color); }
.footer a:hover { color: var(--brand-hover); }
.footer-powered { font-size: 10px; }


/* ============================================================================
   07. I MIEI DATI — Layout & Profilo — imieidati.php
   ============================================================================ */

.member-card { background: var(--bg-card); padding: 30px; border-radius: var(--radius-card); box-shadow: var(--shadow-card); margin-bottom: 30px; position: relative; }
.member-thumb { position: relative; margin: 0 auto; width: 130px; height: 130px; cursor: pointer; }
.member-thumb img { width: 100%; height: 100%; object-fit: cover; border: 5px solid var(--brand-color) !important; border-radius: 50%; box-shadow: 0 5px 15px rgba(0,0,0,0.15); padding: 0 !important; background-color: transparent !important; }
.member-star { position: absolute; bottom: 5px; right: 5px; background-color: var(--brand-color) !important; color: var(--text-white) !important; width: 35px; height: 35px; border-radius: 50%; text-align: center; line-height: 35px; font-size: 18px; cursor: pointer; box-shadow: 0 2px 5px rgba(0,0,0,0.3); transition: all 0.3s cubic-bezier(0.175,0.885,0.32,1.275); z-index: 10; }
.member-star::before { color: var(--text-white) !important; }
.member-star:hover { background-color: var(--brand-hover) !important; transform: scale(1.1); }
.user-name-title { margin-top: 25px; font-weight: 700; color: var(--text-dark); font-size: 22px; }
.page-bottom-spacer { margin-bottom: 50px; }
.user-name-text { font-weight: 700; color: var(--text-dark); font-size: 14px; }
.user-avatar-circle { width: 35px; height: 35px; border-radius: 50%; background: var(--bg-subtle); color: var(--text-body); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex-shrink: 0; overflow: hidden; }


/* ============================================================================
   08. I MIEI DATI — Upload Foto — imieidati.php
   ============================================================================ */

.upload-area { background: var(--bg-subtle); border: 2px dashed var(--border-light); border-radius: var(--radius-card); padding: 30px; text-align: center; transition: all 0.3s ease; cursor: pointer; position: relative; margin-bottom: 20px; }
.upload-area:hover { border-color: var(--brand-color); background: var(--bg-info); }
.upload-icon { font-size: 40px; color: var(--border-light); margin-bottom: 10px; }
.upload-area:hover .upload-icon { color: var(--brand-color); }
.upload-label-main { font-weight: 600; color: var(--text-body); }
.upload-label-sub { font-size: 12px; color: var(--text-muted); margin-top: 5px; }
#inputFoto { position: absolute; width: 100%; height: 100%; top: 0; left: 0; opacity: 0; cursor: pointer; }
.preview-container { margin-top: 10px; background: var(--bg-card); border: 1px solid var(--border-light); border-radius: var(--radius-card); padding: 10px; box-shadow: var(--shadow-card); text-align: center; min-height: 250px; display: flex; align-items: center; justify-content: center; }
#cropImage { max-width: 100%; display: none; border-radius: 4px; }
.upload-placeholder { color: var(--border-light); text-align: center; }
.upload-placeholder-icon { font-size: 40px; display: block; margin-bottom: 10px; }
.cropper-view-box, .cropper-face { border-radius: 50% !important; }


/* ============================================================================
   09. I MIEI DATI — Privacy & Password — imieidati.php
   ============================================================================ */

.privacy-intro { margin-bottom: 20px; }
.privacy-law-ref { font-size: 12px; }
.privacy-link-row { margin-top: 20px; }
a.subitem { color: var(--brand-color); text-decoration: underline; }
.password-wrapper { position: relative; }
.password-input { padding-right: 40px; }
.password-toggle { position: absolute; right: 15px; top: 50%; transform: translateY(-50%); cursor: pointer; color: var(--text-muted); font-size: 18px; z-index: 10; }


/* ============================================================================
   10. MODAL FOTO PROFILO — imieidati.php
   ============================================================================ */

#modalCaricaFoto { padding-right: 0 !important; }
#modalCaricaFoto .modal-dialog { position: fixed !important; margin: 0 !important; width: 500px; max-width: 100%; height: 100%; right: 0 !important; top: 0 !important; bottom: 0 !important; left: auto !important; transform: translate3d(100%, 0, 0) !important; transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important; }
#modalCaricaFoto.in .modal-dialog, #modalCaricaFoto.show .modal-dialog { transform: translate3d(0, 0, 0) !important; }
#modalCaricaFoto .modal-content { height: 100vh; border-radius: 0; border: none; box-shadow: var(--shadow-drawer); display: flex; flex-direction: column; background: var(--bg-card); padding: 0 !important; }
#modalCaricaFoto .modal-header { padding: 25px 30px; border-bottom: 1px solid var(--border-light); background: var(--bg-card); display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; color: var(--text-dark); }
#modalCaricaFoto .modal-body { padding: 30px; overflow-y: auto; flex-grow: 1; }
#modalCaricaFoto .modal-footer { padding: 20px 30px; border-top: 1px solid var(--border-light); background: var(--bg-card); display: flex; justify-content: center; gap: 10px; flex-shrink: 0; }
.info-box-soft { background-color: var(--bg-info); border: 1px solid var(--border-info); border-radius: var(--radius-card); padding: 25px; margin-top: 20px; margin-bottom: 35px; display: flex; align-items: flex-start; gap: 20px; }
.info-box-icon { flex-shrink: 0; width: 45px; height: 45px; display: flex; align-items: center; justify-content: center; font-size: 24px; color: var(--brand-color); background: var(--bg-card); border-radius: 50%; border: 1px solid var(--brand-border); }
.info-box-content h5 { margin: 0 0 5px; font-size: 15px; font-weight: 700; color: var(--brand-hover); }
.info-box-content p { margin: 0; font-size: 13px; color: var(--text-muted); line-height: 1.5; }

/* Pulsante chiudi drawer */
.close-drawer-round { background: var(--bg-card); border: 1px solid var(--border-light); width: 35px; height: 35px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--text-muted); cursor: pointer; transition: all 0.2s ease; outline: none; font-size: 18px; flex-shrink: 0; margin-left: 15px; }
.close-drawer-round:hover { background-color: var(--brand-light-hover); color: var(--brand-color); border-color: var(--brand-color); transform: rotate(90deg); }
.drawer-close-icon { font-size: 14px; }

@media (max-width: 576px) { #modalCaricaFoto .modal-dialog { width: 100%; } #modalCaricaFoto .modal-header { padding: 20px; } #modalCaricaFoto .modal-body { padding: 20px; } #modalCaricaFoto .modal-footer { justify-content: flex-end; } }


/* ============================================================================
   11. CLASSI GLOBALI CONDIVISE
   ============================================================================ */

.text-custom  { color: var(--brand-color); }
.text-muted   { color: var(--text-muted) !important; }
.m-0 { margin: 0 !important; } .m-t-0 { margin-top: 0 !important; } .m-t-10 { margin-top: 10px !important; } .m-t-20 { margin-top: 20px !important; } .m-t-30 { margin-top: 30px !important; }
.m-l-5 { margin-left: 5px !important; } .m-l-10 { margin-left: 10px !important; }
.m-r-5 { margin-right: 5px !important; } .m-r-10 { margin-right: 10px !important; }
.m-b-0 { margin-bottom: 0 !important; } .m-b-5 { margin-bottom: 5px !important; } .m-b-10 { margin-bottom: 10px !important; } .m-b-20 { margin-bottom: 20px !important; } .m-b-30 { margin-bottom: 30px !important; }
.p-0 { padding: 0 !important; } .p-20 { padding: 20px; padding-bottom: 0; padding-top: 0; } .p-b-0 { padding-bottom: 0 !important; } .p-t-50 { padding-top: 50px !important; }
.font-13 { font-size: 13px; } .font-600 { font-weight: 600; } .center-page { float: none !important; margin: 0 auto; } .d-none { display: none !important; }
.label { font-weight: 600; letter-spacing: 0.05em; padding: 0.3em 0.6em; }
.label-danger { background-color: var(--brand-color); color: var(--text-white); }
.img-circle { border-radius: 50%; }
.required::after { content: " *"; color: var(--color-danger); }
.panel-fill { border-radius: var(--radius-card); border: 1px solid var(--border-light); box-shadow: var(--shadow-card); background: var(--bg-card); }
.panel-body { padding: 24px; }
.align-left-container { text-align: left; margin-bottom: 15px; }
.row-flex-center { display: flex; align-items: center; }
.list-actions { float: right; }
.modal-footer-center { justify-content: center; }
.btn-block { width: 100%; }
.toggle-switch { position: relative; display: inline-block; width: 50px; height: 28px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; cursor: pointer; inset: 0; background: var(--color-gray-300); border-radius: 34px; transition: 0.3s; }
.toggle-slider:before { content: ""; position: absolute; width: 20px; height: 20px; left: 4px; bottom: 4px; background: var(--text-white); border-radius: 50%; transition: 0.3s; }
.toggle-switch input:checked + .toggle-slider { background: var(--brand-color); }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(22px); }


/* ============================================================================
   12. HOME PAGE — home.php
   ============================================================================ */

.kpi-card { display: flex; align-items: center; gap: 16px; background: var(--bg-card); border-radius: 16px; padding: 15px; margin-bottom: 20px; height: 100%; border: 1px solid var(--border-light); box-shadow: var(--shadow-card); text-decoration: none; transition: all 0.25s ease; cursor: pointer; }
.kpi-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,0.09); }
.kpi-icon { width: 52px; height: 52px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 26px; flex-shrink: 0; }
.kpi-body { display: flex; flex-direction: column; justify-content: space-between; height: 100%; flex-grow: 1; margin-left: 15px; }
.kpi-label { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-muted); line-height: 1.2; min-height: 3.6em; }
.kpi-value { display: block; font-size: 34px; font-weight: 800; line-height: 1; letter-spacing: -1px; color: var(--text-dark); margin-top: auto; }
.kpi-blue   .kpi-icon { background: var(--brand-light); color: var(--brand-color); } .kpi-blue:hover { border-color: var(--brand-border); }
.kpi-green  .kpi-icon { background: var(--color-success-light); color: var(--color-success); } .kpi-green:hover { border-color: var(--color-success-border); }
.kpi-red    .kpi-icon { background: var(--color-danger-light); color: var(--color-danger); } .kpi-red:hover { border-color: var(--color-danger-border); } .kpi-red .kpi-value { color: var(--color-danger); }
.kpi-orange .kpi-icon { background: var(--color-orange-light); color: var(--color-orange); } .kpi-orange:hover { border-color: var(--color-orange-border); } .kpi-orange .kpi-value { color: var(--color-orange); }
.kpi-gray   .kpi-icon { background: var(--color-gray-50); color: var(--color-gray-400); }

.quick-card { display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--bg-card); border-radius: 16px; padding: 18px 10px; margin-bottom: 16px; border: 1px solid var(--border-light); text-decoration: none; transition: all 0.25s ease; cursor: pointer; gap: 10px; }
.quick-card:hover { transform: translateY(-4px); box-shadow: 0 10px 24px var(--brand-light-hover); border-color: var(--brand-border); }
.quick-icon { width: 52px; height: 52px; border-radius: 50%; background: var(--brand-light); color: var(--brand-color); display: flex; align-items: center; justify-content: center; font-size: 24px; transition: all 0.25s ease; }
.quick-card:hover .quick-icon { background: var(--brand-color); color: var(--text-white); }
.quick-label { font-size: 11px; font-weight: 700; color: var(--text-body); text-transform: uppercase; letter-spacing: 0.6px; text-align: center; }
.quick-card:hover .quick-label { color: var(--brand-color); }

.home-panel { background: var(--bg-card); border-radius: 16px; border: 1px solid var(--border-light); box-shadow: var(--shadow-card); margin-bottom: 24px; overflow: hidden; }
.home-panel-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border-light); font-weight: 700; font-size: 13px; color: var(--text-dark); text-transform: uppercase; letter-spacing: 0.5px; }
.home-panel-link { font-size: 12px; font-weight: 600; color: var(--brand-color); text-decoration: none; }
.home-panel-link:hover { color: var(--brand-hover); }
.home-panel-icon { margin-right: 7px; }

.home-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.home-table thead th { padding: 10px 16px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: var(--text-muted); border-bottom: 1px solid var(--border-light); background: var(--bg-subtle); }
.home-table-row { cursor: pointer; transition: background 0.15s ease; }
.home-table-row:hover { background: var(--bg-subtle); }
.home-table-row td { padding: 11px 16px; border-bottom: 1px solid var(--border-light); color: var(--text-body); vertical-align: middle; }
.home-table-row:last-child td { border-bottom: none; }
.home-date-text { font-weight: 600; color: var(--text-dark); }

.home-badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 10px; font-weight: 700; letter-spacing: 0.4px; border: 1px solid transparent; }
.badge-gray    { background: var(--color-gray-100); color: var(--text-body); border-color: var(--border-light); }
.badge-warning { background: var(--color-warning-light); color: var(--color-warning-text); border-color: var(--color-warning-border); }
.badge-red     { background: var(--color-orange-light); color: var(--color-orange-text); border-color: var(--color-orange-border); }
.badge-green   { background: var(--color-success-light); color: var(--color-success-text); border-color: var(--color-success-border); }
.today-badge   { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 10px; font-weight: 700; background: var(--brand-color); color: var(--text-white); margin-right: 4px; }

.home-empty { text-align: center; padding: 40px 20px; color: var(--text-muted); font-size: 13px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.home-empty-icon { font-size: 36px; color: var(--border-light); }
.home-empty-icon--success { color: var(--color-success-icon); }
.home-empty-text-ok { color: var(--color-success-text); }

.scad-item { display: flex; align-items: center; gap: 12px; padding: 13px 18px; border-bottom: 1px solid var(--border-light); text-decoration: none; transition: background 0.15s ease; cursor: pointer; }
.scad-item:last-child { border-bottom: none; }
.scad-item:hover { background: var(--bg-subtle); }
.scad-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.scad-dot.scad-expired { background: var(--color-danger); }
.scad-dot.scad-warning { background: var(--color-warning); }
.scad-info { flex: 1; min-width: 0; }
.scad-comp { display: block; font-size: 13px; font-weight: 600; color: var(--text-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scad-cliente { display: block; font-size: 11px; color: var(--text-muted); }
.scad-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex-shrink: 0; }
.scad-meta span { font-size: 11px; font-weight: 700; }
.scad-meta small { font-size: 10px; color: var(--text-muted); }
.scad-meta.scad-expired span { color: var(--color-danger); }
.scad-meta.scad-warning span { color: var(--color-warning-text); }

@media (max-width: 768px) { .kpi-value { font-size: 28px; } .home-table thead { display: none; } .home-table-row td { display: block; padding: 6px 16px; border: none; } .home-table-row { border-bottom: 1px solid var(--border-light); } }


/* ============================================================================
   13. TABELLE SCHEDE & LISTE
   ============================================================================ */

.th-pl, .td-pl { padding-left: 15px !important; }
.th-right, .td-right { text-align: right !important; padding-right: 15px !important; }
.td-mid { vertical-align: middle !important; }
.td-muted-mid { color: var(--text-muted); vertical-align: middle !important; }
.td-name { font-weight: 600; color: var(--text-dark); }
.td-muted { color: var(--text-muted); }
.table-empty { text-align: center; color: var(--color-empty); padding: 30px 0; }
.panel-empty { text-align: center; color: var(--color-empty); padding: 40px 20px; }
.panel-empty-icon { font-size: 36px; display: block; margin-bottom: 10px; }
.btn-group-gap { display: flex; gap: 6px; justify-content: flex-end; }.btn-sm-table { padding: 4px 10px !important; font-size: 11px !important; }
.btn-danger-sm { padding: 4px 10px !important; font-size: 11px !important; color: var(--color-danger) !important; }
.btn-download { border-radius: 50% !important; width: 35px !important; height: 35px !important; padding: 0 !important; display: inline-flex !important; align-items: center; justify-content: center; box-shadow: var(--shadow-btn); }
.badge-tipo-ordinario { background: var(--color-info-light); color: var(--color-info); border-color: var(--color-info-border); }
.badge-tipo-straordinario { background: var(--color-orange-light); color: var(--color-orange-text); border-color: var(--color-orange-border); }
.text-color-empty { color: var(--color-empty); }
.form-inline-table { margin: 0; }
.form-drawer {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-height: 0;
}
.input-group-flex { display: flex; gap: 8px; }
.input-civico { width: 80px !important; flex-shrink: 0; }
.input-cap { width: 90px !important; flex-shrink: 0; }
.textarea-resize { resize: vertical; }
.flatpickr-white { background: var(--bg-card) !important; }
.text-required { color: var(--color-danger); }
.text-empty-dash { color: var(--color-empty); }
.tabs-mb { margin-bottom: 20px; }
.tr-clickable { cursor: pointer; }
.detail-group { margin-bottom: 20px; }
.detail-label { font-weight: 600; font-size: 12px; color: var(--color-gray-500); margin-bottom: 4px; }
.detail-value { font-size: 14px; color: var(--text-dark); font-weight: 500; }
.row-grid-spacer { margin-bottom: 24px; }
.tipo-checkbox-group { display: flex; gap: 16px; flex-wrap: wrap; }
.tipo-checkbox-item { display: flex; align-items: center; gap: 8px; background: var(--bg-subtle); border: 1px solid var(--color-gray-300); border-radius: 6px; padding: 10px 16px; cursor: pointer; transition: all 0.2s; user-select: none; }
.tipo-checkbox-item:hover { border-color: var(--color-gray-400); }
.tipo-checkbox-item input[type=checkbox] { width: 16px; height: 16px; cursor: pointer; }
.tipo-checkbox-item label { margin: 0; cursor: pointer; font-weight: 600; color: var(--color-gray-700); }


/* ============================================================================
   14. AGENTI — det_agenti.php, list_agenti.php
   ============================================================================ */

.tab-badge-counter { background: var(--brand-color); color: var(--text-white); border-radius: 10px; font-size: 10px; padding: 1px 7px; margin-left: 4px; font-weight: 700; }
.panel-title-sub { font-size: 12px; font-weight: 400; color: var(--text-muted); margin-left: 8px; }
.drawer-divider { border: none; border-top: 1px solid var(--border-light); margin: 15px 0; }
.badge-scad-today { background-color: var(--color-warning-light); color: var(--color-warning); border: 1px solid var(--color-warning-border); }
.user-avatar-img { object-fit: cover !important; padding: 0 !important; }
.alert-info-custom { background-color: var(--bg-info); border-color: var(--border-info); color: #5a7388; border-radius: var(--radius-card); margin-bottom: 25px; }
.info-box-blue { background: var(--bg-info); border: 1px solid var(--border-info); border-radius: 12px; padding: 20px; margin-bottom: 25px; display: flex; align-items: flex-start; gap: 15px; }


/* ============================================================================
   15. RESPONSIVE MOBILE
   ============================================================================ */

/* ── Tablet e mobile (<992px): sidebar nascosta, contenuto a piena larghezza ── */
@media (max-width: 991px) {
    #page-right-content {
        margin-left: 0 !important;
        border-left: none !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
    /* Overlay scuro quando sidebar è aperta */
    body.nav-collapse::before {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.45);
        z-index: 98;
    }
}

/* ── Mobile stretto (<768px) ── */
@media (max-width: 767px) {

    /* Topbar: compensazione logo mini (70px) */
    .navbar-default {
        margin-left: var(--sidebar-mini-width) !important;
    }

    /* Il contenuto parte sotto la topbar */
    #page-right-content {
        padding-top: 80px !important;
    }

    /* Card-box e panel: meno padding */
    .card-box  { padding: 8px !important; }
    .panel-body { padding: 12px !important; }

    /* Tabs: scorrevoli orizzontalmente */
    .nav-tabs.tabs-bordered {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .nav-tabs.tabs-bordered::-webkit-scrollbar { display: none; }
    .nav-tabs > li { flex-shrink: 0; }

    /* Griglie: colonne impilate */
    .col-md-6,
    .col-md-4,
    .col-md-3 {
        width: 100% !important;
        float: none !important;
    }

    /* Bottoni azione: a sinistra e a capo */
    .col-md-12.text-right {
        text-align: left !important;
    }
    .col-md-12.text-right .btn {
        margin-bottom: 6px;
        display: block;
        width: 100%;
    }

    /* Drawer: larghezza piena su schermi piccoli */
    .drawer-modal .modal-dialog,
    #newDocumento .modal-dialog {
        max-width: 100% !important;
        width: 100% !important;
    }
    .drawer-modal .modal-body,
    #event-aggiunta .modal-body,
    #event-modal .modal-body {
        padding: 18px !important;
    }

    /* Tabelle DataTables nascondi colonne non essenziali */
    #tbl-clienti-agente thead th:nth-child(3),
    #tbl-clienti-agente thead th:nth-child(5),
    #tbl-clienti-agente tbody td:nth-child(3),
    #tbl-clienti-agente tbody td:nth-child(5),
    #tbl-agenti-cliente thead th:nth-child(2),
    #tbl-agenti-cliente thead th:nth-child(4),
    #tbl-agenti-cliente tbody td:nth-child(2),
    #tbl-agenti-cliente tbody td:nth-child(4) { display: none !important; }

    /* Tabelle generiche: padding ridotto */
    .table tbody td,
    .table thead th {
        padding: 10px 10px !important;
        font-size: 13px !important;
    }

    /* Header pagina (titolo + bottone disattiva) */
    .row.row-flex-center {
        flex-wrap: wrap;
        gap: 8px;
    }
    .row.row-flex-center .col-sm-10,
    .row.row-flex-center .col-sm-2 {
        width: 100% !important;
    }
    .row.row-flex-center .col-sm-2 {
        text-align: left !important;
    }

    /* tipo-checkbox-group: impila le opzioni */
    .tipo-checkbox-group {
        flex-direction: column;
        gap: 8px;
    }
    .tipo-checkbox-item {
        width: 100%;
    }

    /* Panel heading con azioni */
    .panel-heading-actions {
        flex-wrap: wrap;
        gap: 8px;
    }
}

/* ── Extra piccolo (<480px) ── */
@media (max-width: 480px) {
    .header-title { font-size: 16px; }
    .btn { font-size: 13px; }
    .dropdown-menu-lg { width: 240px !important; }
}

/* ── FIX MOBILE: forza sidebar nascosta su schermi piccoli ── */
@media (max-width: 991px) {
    /* Nasconde la sidebar anche in modalità forced-left-mini */
    body.forced-left-mini .sidebar-navigation {
        width: var(--sidebar-width) !important;
        margin-left: -2200px !important;
    }
    body.forced-left-mini.nav-collapse .sidebar-navigation {
        margin-left: 0 !important;
    }
    /* Contenuto a larghezza piena */
    body.forced-left-mini #page-right-content {
        margin-left: 0 !important;
    }
    body.forced-left-mini .navbar-default {
        margin-left: 0 !important;
    }
    /* Topbar sinistra (logo) larghezza corretta */
    body.forced-left-mini .topbar .topbar-left {
        width: var(--sidebar-mini-width) !important;
    }
}

/* ============================================================================
   16. CALENDARIO — calendario.php
   ============================================================================ */

.cal-header-actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.cal-alert-info { background: var(--bg-info); border-color: var(--border-info); color: #5a7388; border-radius: var(--radius-card); margin-bottom: 20px; }
.cal-comp-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-comp-label { margin: 0; font-weight: 700; font-size: 13px; color: var(--color-gray-700); }
.cal-comp-icon { margin-right: 4px; }
.cal-comp-hint { font-size: 11px; color: var(--color-empty); }
.cal-comp-loader { text-align: center; padding: 15px; color: var(--text-muted); font-size: 13px; display: none; }
.cal-comp-loader-icon { font-size: 18px; }
.cal-comp-empty { text-align: center; padding: 20px; color: var(--color-empty); font-size: 13px; display: none; }
.cal-comp-empty-icon { font-size: 28px; display: block; margin-bottom: 6px; color: var(--border-light); }
.cal-drawer-hr { border: none; border-top: 1px solid var(--border-light); margin: 16px 0; }
.cal-select-full { width: 100% !important; }
.comp-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; border: 1px solid var(--border-light); background: var(--bg-subtle); margin-bottom: 6px; transition: background 0.15s ease; }
.comp-row:hover { background: var(--color-info-light); border-color: var(--color-info-border); }
.comp-row.selected { background: var(--color-info-light); border-color: var(--brand-color); }
.comp-row input[type="checkbox"] { flex-shrink: 0; width: 16px; height: 16px; cursor: pointer; }
.comp-info { flex: 1; min-width: 0; }
.comp-name { font-weight: 600; font-size: 13px; color: var(--text-dark); }
.comp-scad { font-size: 11px; margin-top: 2px; }
.comp-azione { flex-shrink: 0; }
.comp-azione select { font-size: 12px; padding: 3px 8px; border-radius: 6px; border: 1px solid var(--border-input); color: var(--text-dark); cursor: pointer; }
.comp-group-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: var(--text-muted); margin: 12px 0 6px; }
.comp-group-label.warn { color: var(--color-warning-text); }
.cal-legend { padding: 20px 20px 40px; }
.cal-legend-title { font-weight: 700; font-size: 11px; color: var(--text-muted); margin-bottom: 4px; text-transform: uppercase; }
.cal-legend-list { list-style: none; padding: 0; margin: 0; font-size: 10px; }
.cal-legend-item { display: inline-block; margin-right: 15px; vertical-align: middle; }
.cal-legend-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; vertical-align: middle; margin-right: 4px; }
.cal-legend-text { vertical-align: middle; color: var(--color-gray-600); }
.cal-event-badges { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.cal-event-link-wrap { text-align: center; margin-top: 28px; }
.cal-event-link { border-radius: 50px !important; padding: 10px 30px !important; }
.cal-event-link-icon { margin-right: 6px; }
.cal-modal-loading { text-align: center; padding-top: 50px; }
.cal-event-day { padding: 5px 7px; }
.cal-event-time { font-size: 10px; opacity: 0.85; margin-bottom: 2px; }
.cal-event-client { font-weight: 700; font-size: 12px; text-transform: uppercase; }
.cal-event-impianto { font-size: 11px; opacity: 0.85; }
.cal-event-city { font-size: 10px; opacity: 0.7; }
.cal-event-note { font-size: 10px; border-top: 1px solid rgba(255,255,255,0.3); margin-top: 3px; padding-top: 3px; font-style: italic; }
.cal-event-week { border-radius: 6px; overflow: hidden; margin-bottom: 2px; }
.cal-event-week-inner { padding: 4px 8px; font-size: 11px; line-height: 1.4; border-radius: 6px; color: var(--text-white); }
.cal-event-week-time { font-size: 9px; opacity: 0.85; }
.cal-event-week-client { font-weight: 700; text-transform: uppercase; }
.cal-event-week-imp { opacity: 0.85; font-size: 10px; }
.cal-resource-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 5px 0; }
.cal-resource-name { font-size: 13px; line-height: 1.2; }
.cal-title-main { font-size: 1.1em; font-weight: 700; }
.cal-title-year { font-size: 0.85em; color: var(--text-muted); font-weight: 400; }


/* ============================================================================
   17. INTERVENTI — det_interventi.php, list_interventi.php
   ============================================================================ */

.orario-badge { display: inline-flex; align-items: center; gap: 6px; background: var(--bg-subtle); border: 1px solid var(--border-light); border-radius: var(--radius-card); padding: 6px 14px; font-size: 13px; font-weight: 600; color: var(--text-dark); margin-left: 10px; }
.orario-badge i { color: var(--color-danger); }
.auto-badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 10px; font-weight: 700; background: var(--color-success-light); color: var(--color-success-text); border: 1px solid var(--color-success-icon); margin-left: 6px; vertical-align: middle; }
.auto-badge-icon { font-size: 9px; }
.filter-label { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); display: block; margin-bottom: 4px; }
.btn-pill { border-radius: 50px !important; }
.filter-remove-link { font-size: 12px; color: var(--color-danger); }
.filter-remove-link:hover { color: var(--color-danger-hover); }
.ricambi-title { font-weight: 700; color: var(--text-dark); font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px; margin-top: 25px; }
.ricambi-title-icon { margin-right: 6px; }
.td-ricambi { padding: 8px 12px !important; }
.alert-intervento { background: var(--bg-info); border-color: var(--border-info); color: #5a7388; border-radius: var(--radius-card); font-size: 12px; padding: 8px 14px; margin-bottom: 0; }
.alert-intervento-lg { background: var(--bg-info); border-color: var(--border-info); color: #5a7388; border-radius: var(--radius-card); margin-bottom: 20px; font-size: 13px; }


/* ============================================================================
   18. INSTALLAZIONI — det_installazioni.php, list_installazioni.php
   ============================================================================ */

.scad-row-expired { background-color: var(--color-danger-light) !important; }
.scad-row-warning { background-color: #fffdf0 !important; }
.badge-intervento-tipo { margin-left: 6px; font-size: 10px; }
.link-intervento { margin-left: 6px; font-size: 12px; color: var(--brand-color); }
.link-intervento:hover { color: var(--brand-hover); }


/* ============================================================================
   19. AVVISI — det_avvisi.php, list_avvisi.php
   ============================================================================ */

.avv-card { background: var(--bg-card); border-radius: var(--radius-card); border: 1px solid var(--border-light); box-shadow: var(--shadow-card); overflow: hidden; }
.avv-header { padding: 24px 28px 0; }
.avv-title { font-size: 20px; font-weight: 700; color: var(--text-dark); margin: 0 0 16px; }
.avv-meta { display: flex; align-items: center; gap: 12px; padding: 0 28px 16px; }
.avv-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--brand-color); color: var(--text-white); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.avv-meta-name { font-weight: 600; color: var(--text-dark); font-size: 14px; }
.avv-meta-sep { color: var(--border-light); margin: 0 4px; }
.avv-divider { border: none; border-top: 1px solid var(--border-light); margin: 0; }
.avv-body { padding: 24px 28px; font-size: 15px; color: var(--text-body); line-height: 1.7; }
.avv-footer { display: flex; align-items: center; justify-content: space-between; padding: 14px 28px; background: var(--bg-subtle); border-top: 1px solid var(--border-light); }
.avv-badge-letto { display: inline-flex; align-items: center; background: var(--color-success-light); color: var(--color-success-text); border: 1px solid var(--color-success-border); border-radius: 20px; padding: 4px 12px; font-size: 12px; font-weight: 600; }
.avv-btn-delete { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 8px; background: var(--color-danger-subtle); color: var(--color-danger-dark); border: 1px solid var(--color-danger-border); font-size: 18px; transition: background 0.2s; text-decoration: none; }
.avv-btn-delete:hover { background: #fee2e2; color: var(--color-danger-dark); }
.table-custom thead th { border-top: 0; border-bottom: 2px solid var(--border-light); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; font-size: 12px; color: var(--text-muted); background: var(--bg-card); padding-top: 15px; padding-bottom: 15px; }
.table-custom tbody tr { transition: background-color 0.2s ease-in-out; }
.table-custom tbody tr:hover { background-color: rgba(0,0,0,0.03) !important; }
.table-custom td { border-top: 1px solid var(--border-light); padding-top: 15px; padding-bottom: 15px; }
.text-truncate-custom { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; max-width: 400px; }
.filter-wrapper { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 15px; }
.filter-pills-container { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.filter-pill { padding: 8px 18px; border-radius: 20px; font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.2s ease-in-out; user-select: none; }

/* Fase 5.80.13.54/54.1 - componenti comuni Hydro per KPI/grafici reportistica */
.hydro-content-padded { padding: 20px 30px; }
.kpi-card-success { border-left: 4px solid var(--btn-success-bg); }
.kpi-card-info { border-left: 4px solid var(--info-color, #0ea5e9); }
.kpi-card-danger { border-left: 4px solid var(--color-danger); }
.filter-actions { flex-shrink: 0; display: flex; gap: 10px; align-items: center; }
.filter-pill-date { border: 1px solid var(--border-light); background: var(--bg-card); width: 135px !important; padding: 6px 14px; }
.filter-wrapper .filter-pills-container input.filter-pill-date[type="date"] { width: 135px !important; max-width: 135px; min-width: 135px; border: 1px solid var(--border-light); background: var(--bg-card); padding: 6px 14px; border-radius: 20px; }
.btn-icon > i, .btn-icon .mdi { font-size: 22px; line-height: 1; }
.chart-box { position: relative; width: 100%; }
.chart-box-sm { height: 220px; min-height: 220px; }
.chart-box-wide { height: 280px; min-height: 280px; }
.legenda-lista { list-style: none; margin: 0; padding: 0; }
.legenda-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border-light); font-size: 13px; color: var(--text-dark); }
.legenda-item:last-child { border-bottom: none; }
.legenda-item b { white-space: nowrap; }
.legenda-dot-entrate-0 { color: #19ADF1; }
.legenda-dot-entrate-1 { color: #2e539f; }
.legenda-dot-entrate-2 { color: #f59e0b; }
.legenda-dot-entrate-3 { color: #10b981; }
.legenda-dot-entrate-4 { color: #8b5cf6; }
.legenda-dot-uscite-0 { color: #c9100e; }
.legenda-dot-uscite-1 { color: #ea580c; }
.legenda-dot-uscite-2 { color: #f43f5e; }
.legenda-dot-uscite-3 { color: #db2777; }
.legenda-dot-uscite-4 { color: #9f1239; }
.empty-chart-message { margin-top: 60px; }
@media (max-width: 767px) {
    .hydro-content-padded { padding: 15px; }
    .filter-actions { width: 100%; justify-content: flex-start; }
    .filter-pill-date,
    .filter-wrapper .filter-pills-container input.filter-pill-date[type="date"] { width: 100% !important; max-width: none; min-width: 100px; }
    .chart-box-wide { height: 240px; min-height: 240px; }
}

.checkbox-custom { width: 18px; height: 18px; cursor: pointer; margin: 0; vertical-align: middle; }
.bulk-action-bar { display: none; background: var(--bg-card); border: 1px solid var(--border-light); box-shadow: var(--shadow-card); padding: 12px 24px; border-radius: 12px; margin-bottom: 25px; align-items: center; justify-content: space-between; animation: slideDown 0.3s ease-out forwards; border-left: 4px solid var(--color-danger); }
.bulk-action-bar-left { display: flex; align-items: center; gap: 10px; }
.bulk-action-bar-left i { font-size: 22px; color: var(--color-danger); display: flex; align-items: center; line-height: 1; }
.bulk-count-number { color: var(--color-danger); font-weight: 700; margin-right: 5px; font-size: 16px; }
.selected-count-text { font-weight: 600; color: var(--text-dark); font-size: 15px; margin: 0; display: flex; align-items: center; line-height: 1; }
.btn-bulk-delete { background: var(--color-danger); color: var(--text-white); border: none; padding: 8px 18px; border-radius: 8px; font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: all 0.2s ease; cursor: pointer; }
.btn-bulk-delete i { font-size: 18px; display: flex; align-items: center; line-height: 1; }
.btn-bulk-delete:hover { background: var(--color-danger-hover); color: var(--text-white); transform: translateY(-1px); }
.avv-row-unread { background-color: rgba(255,153,153,0.08) !important; }
.avv-row-title { font-size: 15px; color: var(--text-dark); }
.avv-icon { font-size: 22px; margin-right: 12px; vertical-align: middle; }
.text-verde { color: var(--color-success) !important; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }


/* ============================================================================
   20. GESTIONE AZIENDA — gestione_azienda.php
   ============================================================================ */

.card-title { font-weight: 700; color: var(--text-dark); font-size: 16px; margin-top: 0; margin-bottom: 25px; text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid var(--border-light); padding-bottom: 15px; }
.info-item { display: flex; align-items: flex-start; margin-bottom: 20px; }
.info-item-icon { width: 42px; height: 42px; background-color: var(--color-gray-100); color: var(--color-gray-700); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 19px; margin-right: 15px; flex-shrink: 0; transition: all 0.3s ease; margin-top: 15px; }
.info-item:hover .info-item-icon { background-color: var(--color-gray-200); color: var(--color-gray-800); }
.info-item-content { flex: 1; }
.info-item-content h6 { margin: 0 0 5px; font-weight: 600; color: var(--text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
.info-item-content p, .info-item-content input, .info-item-content select, .info-item-content textarea { margin: 0; color: var(--text-dark); font-weight: 500; font-size: 15px; }
.notice-text { font-size: 13px; color: var(--text-muted); background-color: var(--bg-subtle); padding: 8px 15px; border-radius: 50px; display: inline-flex; align-items: center; border: 1px solid var(--border-light); }
.notice-icon { font-size: 16px; margin-right: 6px; }
.btn-action { min-width: 140px; padding: 10px 25px; font-weight: 600; letter-spacing: 0.5px; border-radius: 6px; font-size: 14px; transition: all 0.3s ease; box-shadow: 0 2px 4px rgba(0,0,0,0.08); }
.btn-action:hover { transform: translateY(-2px); box-shadow: 0 5px 12px rgba(0,0,0,0.15); }
.btn-action-cancel { background-color: var(--bg-card); border: 1px solid var(--border-light); color: var(--color-gray-600); }
.action-divider { height: 1px; background-color: var(--border-light); margin: 0 auto 25px; width: 80%; }
.azienda-header-divider { border-bottom: 2px solid var(--border-light); margin-top: 10px; margin-bottom: 20px; }
.info-grid-wrap { margin-top: 20px; }
@media (min-width: 768px) { .info-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 0 30px; } }
@media (max-width: 767px) { .info-item-icon { width: 38px; height: 38px; font-size: 17px; } }


/* ============================================================================
   21. DOCUMENTI AZIENDA — list_documenti.php
   ============================================================================ */

.custom-label { display: block; font-weight: 600; color: var(--text-dark); margin-bottom: 10px; font-size: 14px; text-transform: uppercase; letter-spacing: 0.5px; }
.badge-soft-warning { background-color: rgba(255,193,7,0.15); color: var(--color-warning-text); border: 1px solid rgba(255,193,7,0.2); }
.btn-azione-tabella { border-radius: 50% !important; width: 35px; height: 35px; padding: 0 !important; display: inline-flex !important; align-items: center; justify-content: center; box-shadow: var(--shadow-btn); transition: box-shadow 0.2s ease; }
.btn-azione-tabella:hover { box-shadow: 0 7px 14px rgba(50,50,93,0.1), 0 3px 6px rgba(0,0,0,0.08); }
.btn-azione-tabella i { margin: 0 !important; font-size: 16px; }
.td-doc-expired { color: var(--color-danger) !important; font-weight: bold; }
.doc-icon { font-size: 18px; margin-right: 8px; vertical-align: middle; }


/* ============================================================================
   22. MEZZI — det_mezzi.php, list_mezzi.php
   ============================================================================ */

.mezzo-storico-wrap  { margin-top: 30px; }
.mezzo-storico-title { font-weight: 700; color: var(--text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px; }
.mezzo-storico-row   { opacity: 0.6; }
.mezzo-storico-cell  { padding: 8px 12px !important; }


/* ============================================================================
   23. SUPPORTO — guida_e_supporto.php
   ============================================================================ */

.support-wrapper { padding-top: 10px; padding-bottom: 40px; }
.support-card { background: var(--bg-card); border: 0; border-radius: var(--radius-card); box-shadow: var(--shadow-card); overflow: hidden; position: relative; animation: fade-in-up 0.6s ease-out forwards; opacity: 0; transform: translateY(20px); }
.support-card::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 4px; background: var(--brand-color); }
.card-body-custom { padding: 50px 40px; }
.icon-container { width: 80px; height: 80px; background: var(--brand-light); color: var(--brand-color); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 30px; font-size: 32px; transition: transform 0.3s ease; animation: pulse-brand 2s infinite; }
.support-card:hover .icon-container { transform: scale(1.05); }
.card-title-custom { font-weight: 700; color: var(--text-dark); margin-bottom: 15px; font-size: 22px; }
.card-text-custom { color: var(--text-muted); font-size: 16px; line-height: 1.7; margin-bottom: 30px; }
a.link-brand { color: var(--brand-color); font-weight: 600; text-decoration: none; transition: color 0.2s; border-bottom: 1px dotted transparent; }
a.link-brand:hover { color: var(--brand-hover); border-bottom-color: var(--brand-hover); text-decoration: none; }
.btn-custom-brand { background: var(--brand-color); border: none; color: var(--text-white); padding: 12px 35px; font-size: 16px; font-weight: 600; border-radius: 50px; transition: all 0.3s ease; box-shadow: 0 4px 12px var(--brand-glow); display: inline-flex; align-items: center; }
.btn-custom-brand:hover, .btn-custom-brand:focus { background: var(--brand-hover); color: var(--text-white); transform: translateY(-2px); box-shadow: 0 6px 15px rgba(25,173,241,0.4); outline: none; }
.btn-custom-brand i { margin-right: 8px; }
.footer-info-wrapper { background: var(--bg-subtle); padding: 30px 40px; border-top: 1px solid var(--border-light); }
.company-title { font-weight: 700; color: var(--text-dark); margin-bottom: 8px; font-size: 16px; }
.text-small { font-size: 13px; color: var(--text-muted); line-height: 1.6; margin-bottom: 0; }
@keyframes pulse-brand { 0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(25,173,241,0.4); } 70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(25,173,241,0); } 100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(25,173,241,0); } }
@keyframes fade-in-up { to { opacity: 1; transform: translateY(0); } }


/* ============================================================================
   24. FRAMEWORK BASE — body, reset, utility
   ============================================================================ */

/* Import remoto Google Fonts rimosso nel target portable.
   Vendorizzare i font localmente prima del deploy se necessari. */

body { background-color: var(--body-bg); font-family: var(--font-main); color: #676a6c; }
a { text-decoration: none !important; }
button { outline: none !important; }
h1, h2, h3, h4, h5, h6 { font-weight: 700; }
blockquote { background-color: var(--bg-subtle); }
.row { margin-right: -10px; margin-left: -10px; }
.col-lg-1,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-10,.col-lg-11,.col-lg-12,
.col-md-1,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-10,.col-md-11,.col-md-12,
.col-sm-1,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-10,.col-sm-11,.col-sm-12,
.col-xs-1,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9,.col-xs-10,.col-xs-11,.col-xs-12 { padding-left: 10px; padding-right: 10px; padding-top: 2px; padding-bottom: 2px; }
.container { width: auto; }
.text-white { color: var(--text-white); }
.text-danger { color: var(--color-danger); }
.text-dark { color: var(--menu-text) !important; }
.text-primary { color: var(--brand-color) !important; }
.text-success { color: var(--btn-success-bg); }
.text-custom { color: var(--brand-color); }
.blink { animation: glow 1s ease-in-out infinite alternate; }
@keyframes glow { from { opacity: 1; transform: scale(1); } to { opacity: 0.4; transform: scale(1.1); } }
input[type="date"] { appearance: none; -webkit-appearance: none; width: 100% !important; min-width: 100px; }
#page-wrapper { width: 100%; margin: 0; background-color: var(--bg-card); padding-top: var(--topbar-height); }


/* ============================================================================
   25. TOPBAR & NAVBAR — framework
   ============================================================================ */

.topbar { position: fixed; top: 0; left: 0; right: 0; z-index: 1000; }
.topbar .topbar-left { float: left; position: relative; width: var(--sidebar-width); z-index: 999; transition: width 0.3s ease-in-out; }
.logo { color: var(--menu-text) !important; font-size: 20px; font-weight: 700; letter-spacing: 0.05em; line-height: var(--topbar-height); text-transform: uppercase; }
.logo img { height: 40px; }
.logo h1 { height: 50px; margin: 0 auto; text-align: center; }
.logo span { color: var(--brand-color); }
.navbar-default { background-color: var(--topbar-bg); border-radius: 0; z-index: 99; border: none; margin-bottom: 0; }
.navbar-default .navbar-nav > .open > a, .navbar-default .navbar-nav > .open > a:focus, .navbar-default .navbar-nav > .open > a:hover { background-color: var(--color-gray-100); }
.navbar-default .label { position: absolute; top: 9px; right: 9px; }
.navbar-nav { margin: 0; }
.navbar-default .navbar-nav.top-navbar-items > li > a { line-height: var(--topbar-height); padding: 0 15px; }
.top-navbar-items-right { margin-right: 0; }
.top-navbar-items-right a.menu-right-item { padding: 0 15px !important; }
.top-navbar-items-right a.menu-right-item i { line-height: var(--topbar-height); font-size: 35px; }
.button-menu-mobile { background: transparent; border: none; color: var(--menu-text); font-size: 21px; line-height: var(--topbar-height); padding: 0 10px; outline: none !important; }
#btn-toggle-desktop { background: transparent; border: none; color: var(--menu-text); font-size: 21px; line-height: var(--topbar-height); padding: 0 15px; outline: none !important; cursor: pointer; display: inline-block; float: left; }
.profile { line-height: var(--topbar-height) !important; }
.profile img { height: 36px; width: 36px; }


/* ============================================================================
   26. SIDEBAR & MENU LATERALE — framework
   ============================================================================ */

.scrollbar-wrapper { height: 100%; position: relative; justify-items: center; }
.sidebar-navigation { position: fixed; left: 0; background-color: var(--sidebar-bg); width: var(--sidebar-width); top: var(--topbar-height); bottom: 0; overflow-y: auto; transition: margin-left 0.3s, width 0.15s ease-out !important; z-index: 99; }
.sidebar-navigation::-webkit-scrollbar { width: 6px; }
.sidebar-navigation::-webkit-scrollbar-thumb { background-color: var(--color-gray-200); border-radius: 3px; }
/* Scrollbar nascosta */
.sidebar-navigation::-webkit-scrollbar, .scrollbar-wrapper::-webkit-scrollbar, .slimScrollDiv::-webkit-scrollbar { display: none !important; }
.sidebar-navigation, .scrollbar-wrapper, .slimScrollDiv { -ms-overflow-style: none !important; scrollbar-width: none !important; }

.user-details { min-height: 80px; padding: 20px; position: relative; }
.user-details img { position: relative; z-index: 9999; height: 48px; width: 48px; }
.user-details .user-info { color: var(--menu-text); margin-left: 60px; position: relative; z-index: 99999; }
.user-details .user-info p { margin-bottom: 0; font-size: 13px; }
.user-details .user-info a { color: var(--menu-text); display: block; font-weight: 600; padding-top: 5px; }
.sidebar-avatar { width: 40px; height: 40px; }

#page-right-content { background-color: var(--page-content-bg); border-left: 6px solid var(--border-page); padding: 90px 5px 100px 5px; margin-top: 0; margin-left: var(--sidebar-width); min-height: 1050px; position: relative !important; transition: margin-left 0.15s ease-out !important; }
.footer { border-top: 2px solid var(--border-page); bottom: 0; left: 0; padding: 14px 20px; position: absolute; right: 0; }
.btn-mobile-view { height: 19px; width: 20px; line-height: 1px; background-color: var(--brand-color); padding: 0; border-radius: 3px; float: right; z-index: 9999; position: relative; top: 5px; right: 10px; color: var(--text-white); }

/* Transizioni globali */
.sidebar-navigation, #page-right-content, .topbar-left { transition: all 0.15s ease-out !important; }

/* ── Modalità MINI (solo icone) ── */
@media (min-width: 992px) {
    body.forced-left-mini .sidebar-navigation { width: var(--sidebar-mini-width) !important; }
    body.forced-left-mini #page-right-content { margin-left: var(--sidebar-mini-width) !important; }
    body.forced-left-mini .user-info, body.forced-left-mini .sidebar-navigation .fa.arrow, body.forced-left-mini .nav-second-level, body.forced-left-mini #side-menu li a span { display: none !important; }
    body.forced-left-mini #side-menu > li > a { font-size: 0 !important; text-align: center !important; padding: 15px 0 !important; }
    body.forced-left-mini #side-menu > li > a i { font-size: 20px !important; visibility: visible !important; margin: 0 !important; display: block !important; width: 100% !important; }
    body.forced-left-mini .topbar .topbar-left { width: var(--sidebar-mini-width) !important; }
    body.forced-left-mini .logo span, body.forced-left-mini .logo h1 { display: none !important; }
    body.forced-left-mini .topbar-left { width: var(--sidebar-mini-width) !important; overflow: hidden !important; }
    body.forced-left-mini .logo .logo-lg { display: none !important; }
    body.forced-left-mini .logo .logo-sm { display: block !important; margin: 15px auto 0 auto !important; }
    body.forced-left-mini .navbar-default { margin-left: var(--sidebar-mini-width) !important; }
    body.forced-left-mini .user-details .pull-left { width: var(--sidebar-mini-width) !important; text-align: center !important; float: none !important; }
    body.forced-left-mini .user-details .pull-left img { float: none !important; margin: 0 auto !important; display: inline-block !important; }
}

/* ── Modalità SEMI-MINI (espansa al click) ── */
body.forced-semi-mini .sidebar-navigation { width: var(--sidebar-width) !important; }
body.forced-semi-mini #page-right-content { margin-left: var(--sidebar-width) !important; }
body.forced-semi-mini #side-menu > li > a { font-size: 14px !important; text-align: left !important; padding: 13px 20px !important; }
body.forced-semi-mini #side-menu > li > a i { font-size: 16px !important; margin-right: 10px !important; display: inline-block !important; width: 20px !important; }
body.forced-semi-mini .nav-second-level { display: none; visibility: visible !important; }
body.forced-semi-mini .nav-second-level.in { display: block !important; }
body.forced-semi-mini .fa.arrow, body.forced-semi-mini #side-menu li a span { display: inline-block !important; }
body.forced-semi-mini #side-menu li.active > ul.nav-second-level { visibility: visible !important; }
body.forced-semi-mini #side-menu li:not(.active) > ul.nav-second-level { display: none !important; }
body.forced-semi-mini .metismenu .collapsing, body.forced-semi-mini .nav-second-level.collapsing { height: auto !important; display: block !important; overflow: visible !important; transition: none !important; }
body.forced-semi-mini .metismenu .active > ul, body.forced-semi-mini .nav-second-level.in { display: block !important; height: auto !important; visibility: visible !important; }
body.forced-semi-mini .metismenu li:not(.active) > ul { display: none !important; }

/* ── Media query responsive ── */
@media (max-width: 420px) { .dropdown-menu-lg { width: 240px !important; } }
@media (max-width: 767px) {
    .logo-lg { display: none; } .logo-sm { display: inline-block !important; }
    .top-menu-item-xs { display: inline-flex !important; }
    .topbar .topbar-left { width: var(--sidebar-mini-width); }
    .navbar-nav .open .dropdown-menu { background-color: var(--bg-card); box-shadow: 0 2px 5px 0 rgba(0,0,0,0.26); left: auto; position: absolute; right: 0; }
    .footer { text-align: center; }
    .col-sm-1 { display: flex; justify-content: flex-end; }
}
@media (max-width: 991px) {
    .sidebar-navigation { margin-left: -2200px; z-index: 3; }
    body.nav-collapse .sidebar-navigation { margin-left: 0; box-shadow: 7px 8px 9px rgba(0,0,0,0.11); top: 0; z-index: 999; position: fixed; bottom: 0; }
    .scrollbar-wrapper { overflow: auto; }
    #page-right-content { margin-left: 0; }
    body.nav-collapse #page-right-content { margin-left: 0; }
}
@media (max-width: 1024px) { #page-wrapper { width: 100% !important; } .topbar .topbar-left { padding-left: 15px; } }
@media print { .topbar, .footer, .sidebar-navigation { display: none; margin: 0; padding: 0; } .panel-body { padding: 40px 0 0 0; } #page-right-content { border: 0 !important; margin: 0; padding: 0; min-height: 1px; } }


/* ============================================================================
   27. METISMENU — navigazione laterale
   ============================================================================ */

.metisMenu { padding-bottom: 30px; padding-top: 10px; }
.metisMenu .arrow { float: right; line-height: 16px; padding-top: 2px; transition: all 400ms ease-in-out; }
.metisMenu .fa.arrow:before { content: "\f105"; }
.metisMenu .active > a > .fa.arrow:before { content: "\f107"; }
.metisMenu.nav > li > a { padding: 13px 20px; color: var(--menu-text); }
.metisMenu.nav > li > a .label { margin-top: 2px; }
.metisMenu.nav > li > a:hover, .metisMenu.nav > li > a:focus { color: var(--menu-text-hover); background: linear-gradient(90deg, var(--menu-active-from) 0%, var(--menu-active-to) 100%); }
.metisMenu.nav > li > a i { display: inline-block; margin-right: 5px; vertical-align: middle; margin-top: -4px; width: 20px; font-size: 16px; }
.metisMenu.nav > li.active > a { color: var(--menu-text-hover); background: linear-gradient(90deg, var(--menu-active-from) 0%, var(--menu-active-to) 100%); }
.metisMenu.nav > li:last-child a { border-bottom: 0; }
.nav-second-level.nav li a, .nav-thrid-level.nav li a { padding: 7px 20px 7px 10px; text-transform: none; color: var(--menu-second-text); }
.nav-second-level.nav li a:hover, .nav-second-level.nav li a:focus, .nav-thrid-level.nav li a:hover, .nav-thrid-level.nav li a:focus { color: var(--menu-text-hover); background: linear-gradient(90deg, var(--menu-active-from) 0%, rgba(25,173,241,0.7) 100%); }
.nav-second-level.nav > li > a { padding-left: 48px; }
.nav-second-level.nav li.active a { color: var(--text-dark); }
.nav-third-level.nav > li > a { padding-left: 58px; }
.nav-third-level.nav li.active a { color: var(--text-dark); }
/* MetisMenu collapse */
.metismenu .arrow { float: right; line-height: 1.42857; }
.metismenu .fa.arrow:before { content: "\f104"; }
.metismenu .active > a > .fa.arrow:before { content: "\f107"; }
.metismenu .collapse { display: none; }
.metismenu .collapse.in { display: block; }
.metismenu .collapsing { position: relative; height: 0; overflow: hidden; transition-timing-function: ease; transition-duration: 0.35s; transition-property: height, visibility; }


/* ============================================================================
   28. BOTTONI — sistema unificato con variabili
   ============================================================================ */

.btn { border-radius: var(--radius-btn); padding: 8px 22px; outline: none !important; font-weight: 600; letter-spacing: 0.3px; display: inline-flex; align-items: center; justify-content: center; box-shadow: var(--shadow-btn); transition: box-shadow 0.2s ease; }
.btn:hover { box-shadow: 0 7px 14px rgba(50,50,93,0.1), 0 3px 6px rgba(0,0,0,0.08); }
.btn-md { padding: 8px 18px; }
.btn-group-lg > .btn, .btn-lg { padding: 10px 16px !important; font-size: 16px; }
.btn-group-sm > .btn, .btn-sm { padding: 5px 10px !important; }
.btn-group-xs > .btn, .btn-xs { padding: 1px 5px !important; }
.btn-custom, .btn-primary, .btn-success, .btn-info, .btn-warning, .btn-danger, .btn-dark { color: var(--text-white) !important; }
.btn-primary { background-color: var(--btn-primary-bg) !important; border: 1px solid var(--btn-primary-bg) !important; color: var(--text-white) !important; }
.btn-primary:hover, .btn-primary:focus, .btn-primary:active, .btn-primary.active, .open > .dropdown-toggle.btn-primary { background-color: var(--btn-primary-hover) !important; border: 1px solid var(--btn-primary-hover) !important; color: var(--text-white) !important; }
.btn-default { background-color: var(--btn-default-bg) !important; border: 1px solid var(--btn-default-border) !important; color: var(--color-gray-700) !important; }
.btn-default:hover, .btn-default:focus { background-color: var(--bg-subtle) !important; border: 1px solid var(--btn-default-border) !important; }
.btn-success { background-color: var(--btn-success-bg) !important; border: 1px solid var(--btn-success-bg) !important; }
.btn-success:hover, .btn-success:focus { filter: brightness(0.92); }
.btn-info { background-color: var(--color-gray-400) !important; border: 1px solid var(--color-gray-400) !important; }
.btn-warning { background-color: var(--color-warning) !important; border: 1px solid var(--color-warning) !important; }
.btn-danger { background-color: var(--btn-danger-bg) !important; border: 1px solid var(--btn-danger-bg) !important; }
.btn-dark { background-color: var(--btn-primary-bg) !important; border: 1px solid var(--btn-primary-bg) !important; }
.btn-add-pro { width: 40px !important; height: 40px !important; padding: 0 !important; border-radius: 50% !important; display: inline-flex !important; align-items: center; justify-content: center; }
.btn-add-pro i { margin: 0; font-size: 20px; line-height: 1; }
.btn-icon { width: 40px !important; height: 40px !important; padding: 0 !important; border-radius: 50% !important; display: inline-flex !important; align-items: center; justify-content: center; flex-shrink: 0; }
.w-md { min-width: 100px; }
a.disabled { pointer-events: none; cursor: default; opacity: 0.65; }


/* ============================================================================
   29. FORM — controlli con variabili
   ============================================================================ */

.form-control { border: 1px solid var(--input-border); border-radius: 4px; padding: 7px 12px; height: 38px; max-width: 100%; box-shadow: none; }
.form-control:focus { border: 1px solid var(--input-focus-border); box-shadow: none; outline: 0 !important; }
textarea.form-control { min-height: 90px; }
.form-horizontal .form-group { margin-left: -10px; margin-right: -10px; }
.form-control-feedback { line-height: 38px !important; }
.input-group-btn .btn { padding: 8px 12px; }
.input-group-addon { border-radius: 2px; border: 1px solid #eeeeee; }
.required::after { content: " *"; color: var(--color-danger); }
/* Form validation */
.has-error .form-control { border-color: var(--color-danger); box-shadow: none !important; }
.has-success .form-control { border-color: var(--color-success); box-shadow: none !important; }
.has-warning .form-control { border-color: var(--color-warning); box-shadow: none !important; }
/* Select2 */
.select2-container .select2-selection--single { border: 1px solid var(--border-light) !important; height: 38px !important; }
.select2-container .select2-selection--single .select2-selection__rendered { line-height: 36px !important; padding-left: 12px !important; }
.select2-container .select2-selection--single .select2-selection__arrow { height: 34px; width: 34px; right: 3px; }
.select2-container--default .select2-results__option--highlighted[aria-selected] { background-color: var(--brand-color); }
.select2-results__option { padding: 6px 12px; }
.select2-dropdown { border: 1px solid var(--border-light) !important; padding-top: 5px; box-shadow: 0 2px 2px rgba(0,0,0,0.15); }
.select2-container .select2-selection--multiple { min-height: 38px !important; border: 1px solid var(--border-light) !important; }
/* Flatpickr */
.flatpickr-input[readonly] { background: var(--bg-card) !important; opacity: 1; cursor: pointer; }
.flatpickr-calendar { z-index: 9999; }
/* Parsley validation */
.parsley-error { border-color: var(--color-danger) !important; }
.parsley-errors-list { display: none; margin: 0; padding: 0; }
.parsley-errors-list > li { font-size: 12px; list-style: none; color: var(--color-danger); margin-top: 5px; }


/* ============================================================================
   30. PANEL & CARD — con variabili
   ============================================================================ */

.panel { border: none; box-shadow: var(--shadow-card); border-radius: var(--radius-card); background: var(--bg-card); margin-bottom: 25px; }
.panel .panel-body { padding: 20px; }
.panel .panel-body p { margin-bottom: 0; line-height: 24px; }
.panel .panel-body p + p { padding-top: 10px; }
.panel-heading { border: none !important; padding: 15px 20px; margin: -2px; border-radius: 4px 4px 0 0; }
.panel-default > .panel-heading { background-color: var(--bg-subtle); border-bottom: none; color: var(--color-gray-600); }
.panel-title { font-size: 15px; font-weight: 600; margin: 0; }
.panel-footer { background: var(--bg-subtle); border-top: 0; }
.panel-heading-actions { display: flex; align-items: center; justify-content: space-between; }
.card-box { background-color: var(--bg-card); border: 2px solid var(--border-page); padding: 10px; margin-bottom: 20px; }
.header-title { margin-top: 0; font-weight: bold; border-bottom: 1px solid var(--border-light); padding-bottom: 12px; }


/* ============================================================================
   31. MODAL & DRAWER — con variabili
   ============================================================================ */

/* Reset base Bootstrap modal — rimuoviamo padding che interferisce con drawer */
.modal .modal-dialog .modal-content { box-shadow: none; border-color: var(--border-light); border-radius: 2px; padding: 25px; }
.modal .modal-dialog .modal-content .modal-header { border-bottom-width: 2px; margin: 0; padding: 0 0 15px 0; }
.modal .modal-dialog .modal-content .modal-body { padding: 20px 0; }
.modal .modal-dialog .modal-content .modal-footer { padding: 15px 0 0 0; }

/* ── DRAWER GLOBALE (apre da destra) ──
   NOTA: position:fixed e margin:0 sono critici — !important necessario
   per sovrascrivere Bootstrap 3 che usa margin: 30px auto sui modal.
   ─────────────────────────────────────────────────────────────────────── */
.drawer-modal { padding-right: 0 !important; }
.drawer-modal .modal-dialog,
#event-aggiunta .modal-dialog,
#event-modal .modal-dialog,
#newDocumento .modal-dialog {
    position: fixed !important;
    margin: 0 !important;
    height: 100% !important;
    right: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
    left: auto !important;
    z-index: 1041;
    -webkit-transform: translate3d(100%, 0, 0) !important;
    transform: translate3d(100%, 0, 0) !important;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
}
/* Larghezze specifiche */
.drawer-modal .modal-dialog, #newDocumento .modal-dialog { width: 100% !important; max-width: 600px !important; }
#event-aggiunta .modal-dialog, #event-modal .modal-dialog  { width: 100% !important; max-width: 520px !important; }

/* Stato visibile (aperto) */
.drawer-modal.in .modal-dialog, .drawer-modal.show .modal-dialog,
#event-aggiunta.in .modal-dialog, #event-aggiunta.show .modal-dialog,
#event-modal.in .modal-dialog, #event-modal.show .modal-dialog,
#newDocumento.in .modal-dialog, #newDocumento.show .modal-dialog {
    -webkit-transform: translate3d(0, 0, 0) !important;
    transform: translate3d(0, 0, 0) !important;
}

/* Contenuto drawer — override del padding Bootstrap */
.drawer-modal .modal-content,
#event-aggiunta .modal-content,
#event-modal .modal-content {
    height: 100vh !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: var(--shadow-drawer) !important;
    display: flex !important;
    flex-direction: column !important;
    background: var(--bg-card) !important;
    padding: 0 !important;  /* Annulla il padding: 25px di Bootstrap */
}

/* Header drawer */
.drawer-modal .modal-header,
#event-aggiunta .modal-header,
#event-modal .modal-header {
    padding: 25px 30px !important;
    border-bottom: 1px solid var(--border-light) !important;
    background: var(--bg-card) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-shrink: 0;
    margin: 0 !important;
}

/* Body drawer */
.drawer-modal .modal-body,
#event-aggiunta .modal-body,
#event-modal .modal-body {
    padding: 30px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    flex-grow: 1;
    background: var(--bg-card);
}

/* Footer drawer */
.drawer-modal .modal-footer,
#event-aggiunta .modal-footer,
#event-modal .modal-footer {
    padding: 15px 30px !important;
    border-top: 1px solid var(--border-light) !important;
    background: var(--bg-card) !important;
    display: flex !important;
    justify-content: space-between !important;
    flex-wrap: wrap;
    gap: 10px;
    flex-shrink: 0;
}

@media (max-width: 576px) {
    .drawer-modal .modal-dialog, #newDocumento .modal-dialog,
    #event-aggiunta .modal-dialog, #event-modal .modal-dialog { max-width: 100% !important; }
}

/* Titolo e sottotitolo drawer */
.modal-title-group { text-align: left; flex-grow: 1; }
.modal-title-group h4 { font-weight: 700; color: var(--text-dark); font-size: 22px; margin: 0 0 5px; }
.modal-subtitle { display: block; font-size: 13px; color: var(--text-muted); font-weight: 400; }
.drawer-modal .modal-title-group { flex-grow: 1; }
.drawer-modal .modal-title-group h4 { font-weight: 700; color: var(--text-dark); font-size: 22px; margin: 0 0 5px; }
.drawer-modal .modal-subtitle { display: block; font-size: 13px; color: var(--text-muted); }

/* Override modal-header standard per NON colorare i drawer */
.drawer-modal .modal-header,
#event-aggiunta .modal-header,
#event-modal .modal-header,
#modalCaricaFoto .modal-header {
    background: var(--bg-card) !important;
    color: var(--text-dark) !important;
}
.drawer-modal .modal-header h4,
#event-aggiunta .modal-header h4,
#event-modal .modal-header h4,
#modalCaricaFoto .modal-header h4 {
    color: var(--text-dark) !important;
    margin: 0;
}


/* ============================================================================
   32. TABS — con variabili
   ============================================================================ */

.tab-content { padding: 20px 0 0 0; }
.nav-tabs > li > a { color: var(--menu-text); text-transform: uppercase; font-weight: 600; }
.nav-tabs > li > a:hover { background-color: var(--bg-subtle); }
.nav-tabs > li.active > a, .nav-tabs > li.active > a:focus, .nav-tabs > li.active > a:hover { color: var(--tab-active-color); }
.tabs-bordered { border-bottom: 2px solid var(--tab-border-color) !important; font-size: 12px; }
.tabs-bordered li a, .tabs-bordered li a:hover, .tabs-bordered li a:focus { border: 0 !important; background-color: var(--bg-card) !important; padding: 5px 5px !important; }
.tabs-bordered li.active a, .tabs-bordered li.active a:hover, .tabs-bordered li.active a:focus { border-bottom: 2px solid var(--tab-active-color) !important; margin-bottom: -1px; color: var(--tab-active-color); }
.nav-tabs.tabs-bordered > li > a { display: flex !important; align-items: center; gap: 6px; }
.nav-tabs.tabs-bordered > li > a i { margin: 0 !important; font-size: 16px; line-height: 1; }


/* ============================================================================
   33. PAGINAZIONE & BADGE — con variabili
   ============================================================================ */

.pagination > li > a, .pagination > li > span { color: var(--menu-text); }
.pagination > li > a:hover, .pagination > li > span:hover { background-color: var(--bg-subtle); }
.pagination > .active > a, .pagination > .active > span, .pagination > .active > a:hover, .pagination > .active > span:hover, .pagination > .active > a:focus, .pagination > .active > span:focus { background-color: var(--pagination-active-bg) !important; border-color: var(--pagination-active-bg) !important; color: var(--text-white) !important; }
.pagination-rounded .pagination > li > a, .pagination-rounded .pagination > li > span { border-radius: 10px; min-width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; }
.label { font-weight: 600; letter-spacing: 0.05em; padding: 0.3em 0.6em; }
.label-danger { background-color: var(--brand-color); }
.label-dark { background-color: var(--menu-text); }
.label-success { background-color: var(--btn-success-bg); }
.badge { text-transform: uppercase; font-weight: 600; padding: 3px 5px; font-size: 12px; margin-top: 1px; background-color: var(--btn-success-bg); }
.badge-danger { background-color: var(--color-danger); }
.badge-dark { background-color: var(--menu-text); }
.badge-gray-style { display: inline-block; background: var(--bg-subtle); color: var(--color-gray-700); border: 1px solid var(--border-light); padding: 4px 10px; border-radius: 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; }
.table-action-col { width: 60px !important; }
.badge-giacenza-inline { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; border: 1px solid transparent; white-space: nowrap; }
.badge-giacenza-inline.giac-ok { background: var(--color-success-light); color: var(--color-success-text); border-color: var(--color-success-border); }
.badge-giacenza-inline.giac-low { background: var(--color-warning-light); color: var(--color-warning-text); border-color: var(--color-warning-border); }
.badge-giacenza-inline.giac-zero { background: var(--color-danger-light); color: var(--color-danger); border-color: var(--color-danger-border); }
.badge-active   { background: var(--color-success-light); color: var(--color-success-text); border-color: var(--color-success-icon); }
.badge-inactive { background: var(--color-danger-light); color: var(--color-danger); border-color: var(--color-danger-border); }
.badge-scad-expired { background: var(--color-danger-subtle); color: var(--color-danger); border-color: var(--color-danger-border); }
.badge-scad-warning { background: var(--color-warning-light); color: var(--color-warning-text); border-color: var(--color-warning-border); }
.badge-scad-ok      { background: var(--color-success-light); color: var(--color-success-text); border-color: var(--color-success-border); }
.badge-soft-success { background: rgba(16,185,129,0.15); color: var(--color-success); border: 1px solid rgba(16,185,129,0.2); }
.badge-soft-danger  { background: rgba(201,16,14,0.15); color: var(--color-danger); border: 1px solid rgba(201,16,14,0.2); }
.badge-soft-warning { background: rgba(245,158,11,0.15); color: var(--color-warning-text); border: 1px solid rgba(245,158,11,0.2); }
.badge-installatore { background: #eff8ff; color: #175cd3; border: 1px solid #b2ddff; }
.badge-manutentore  { background: #f9f5ff; color: #6941c6; border: 1px solid #d9d6fe; }
.badge-azienda  { background: #fff8eb; color: #b45309; border: 1px solid #fcd34d; }
.badge-persona  { background: #f0fdf4; color: #166534; border: 1px solid #86efac; }
.custom-badge { padding: 5px 10px; border-radius: 4px; font-size: 11px; font-weight: 700; letter-spacing: 0.4px; }


/* ============================================================================
   34. TABELLE DATATABLES — con variabili
   ============================================================================ */

table.dataTable { margin-top: 10px !important; margin-bottom: 18px !important; }
.table { border-color: var(--border-light) !important; }
.table thead th { background: var(--bg-card); border-bottom: 2px solid var(--border-light); color: var(--color-empty); font-size: 11px; text-transform: uppercase; font-weight: 700; letter-spacing: 0.5px; padding: 12px 24px; vertical-align: middle; }
.table tbody tr { background: var(--bg-card); transition: background 0.2s; }
.table tbody tr:hover { background: var(--bg-subtle); }
.table tbody td { border-top: 1px solid var(--border-light); vertical-align: middle; padding: 16px 24px; color: var(--text-body); font-size: 14px; }
.table-bordered.dataTable > thead > tr > td, .table-bordered.dataTable > thead > tr > th { border-bottom-width: 1px !important; }
table.dataTable thead th { position: relative; background-image: none !important; }
table.dataTable thead th.sorting:after { content: "\f0dc"; padding-top: 0.12em; position: absolute; top: 7px; right: 8px; display: block; font-family: FontAwesome; }
table.dataTable thead th.sorting_asc:after { content: "\f0de"; position: absolute; top: 7px; right: 8px; display: block; font-family: FontAwesome; }
table.dataTable thead th.sorting_desc:after { content: "\f0dd"; position: absolute; top: 7px; right: 8px; display: block; font-family: FontAwesome; }
.dataTables_paginate .pagination { display: inline-flex; align-items: center; gap: 6px; }
.dataTables_paginate .pagination > li > a, .dataTables_paginate .pagination > li > span { min-width: 38px; height: 38px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; font-weight: 500; }
.dataTables_length select.form-control { padding: 4px 8px; height: auto; min-height: 36px; margin: 0 5px; }
table.dataTable.dtr-inline.collapsed > tbody > tr > td:first-child:before, table.dataTable.dtr-inline.collapsed > tbody > tr > th:first-child:before { box-shadow: 0 0 3px rgba(67,89,102,0.2); background-color: var(--btn-success-bg); }
table.dataTable.dtr-inline.collapsed > tbody > tr.parent > td:first-child:before, table.dataTable.dtr-inline.collapsed > tbody > tr.parent > th:first-child:before { background-color: var(--color-danger); }
table.dataTable th.focus, table.dataTable td.focus { outline: 2px solid var(--btn-success-bg) !important; outline-offset: -1px; background-color: var(--btn-success-bg); color: var(--text-white); }
div.dataTables_scrollHeadInner, div.dataTables_scrollHeadInner table { width: 100% !important; }


/* ============================================================================
   35. DROPDOWN PROFILO — framework con variabili
   ============================================================================ */

.dropdown-menu { padding: 4px 0; transition: all 0.3s ease; box-shadow: 0 0 8px 0 rgba(0,0,0,0.06), 0 1px 0 0 rgba(0,0,0,0.02); border: 1px solid var(--border-light); }
.dropdown-menu > li > a { padding: 6px 20px; }
.dropdown-menu-lg { width: 300px !important; }
.dropdown-menu-lg .list-group { margin-bottom: 0; }
.dropdown-menu-lg .list-group-item { border: none; border-bottom: 2px solid var(--bg-subtle); padding: 14px 20px; border-radius: 0 !important; }
.profile-dropdown { border: none !important; box-shadow: 0 8px 20px rgba(0,0,0,0.15) !important; border-radius: 6px !important; padding: 0 0 8px 0 !important; min-width: 220px; margin-top: 5px; overflow: hidden; }
.profile-dropdown .dropdown-header { padding: 15px 20px; background-color: var(--bg-card); border-bottom: 1px solid var(--border-light); margin-bottom: 5px; }
.profile-dropdown .dropdown-header h6 { color: var(--menu-text); font-size: 13px; font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase; margin: 0; }
.profile-dropdown > li > a { padding: 10px 20px; color: var(--text-body); font-weight: 500; transition: all 0.2s ease; display: flex; align-items: center; }
.profile-dropdown > li > a i { font-size: 18px; width: 24px; text-align: center; margin-right: 12px; transition: color 0.2s ease; }
.profile-dropdown .divider { margin: 5px 0; background-color: var(--border-light); }
/* Campanella */
.notifi-title { border-bottom: 1px solid rgba(0,0,0,0.1); font-size: 15px; text-transform: uppercase; font-weight: 600; padding: 11px 20px 15px; color: var(--menu-text); background: #fdfdfd; border-radius: 6px 6px 0 0; display: flex; align-items: center; }
.notifi-bell-icon { font-size: 18px; margin-right: 8px; line-height: 1; display: flex; }
.notifi-counter { margin: 0; }
.custom-notify-menu { border: none !important; box-shadow: 0 8px 20px rgba(0,0,0,0.15) !important; border-radius: 6px !important; }
.notify-item { transition: all 0.2s ease; border-bottom: 1px solid var(--bg-subtle) !important; padding: 12px 15px !important; }
.notify-item:hover { background-color: var(--bg-subtle) !important; transform: translateX(4px); }
.notify-item .media { display: flex; align-items: center; }
.notify-item .media-body { display: block !important; flex: 1; width: 100%; }
.notify-item .media-left { padding-right: 15px !important; display: flex; align-items: center; }
.notify-title { font-size: 13px !important; font-weight: 600 !important; color: #4b4e57 !important; margin-bottom: 4px !important; line-height: 1.3 !important; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: normal !important; }
.notify-footer { border-top: 1px solid var(--border-light); background: #fdfdfd; border-radius: 0 0 6px 6px; }
.footer-btn { display: block; padding: 10px 0; transition: background 0.2s; }
.footer-btn:hover { background-color: var(--bg-subtle); }
.custom-scroll::-webkit-scrollbar { width: 4px; }
.custom-scroll::-webkit-scrollbar-thumb { background-color: #d1d1d1; border-radius: 4px; }


/* ============================================================================
   36. TOAST — notifiche globali
   ============================================================================ */

#toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 99999; display: flex; flex-direction: column; gap: 10px; }
.custom-toast { min-width: 250px; max-width: 400px; background: var(--bg-card); color: var(--text-dark); padding: 16px 20px; border-radius: var(--radius-card); box-shadow: 0 4px 15px rgba(0,0,0,0.1); display: flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 500; border-left: 5px solid var(--brand-color); opacity: 0; transform: translateY(20px); transition: all 0.3s cubic-bezier(0.4,0,0.2,1); }
.custom-toast.show { opacity: 1; transform: translateY(0); }
.custom-toast.success { border-left-color: var(--color-success); }
.custom-toast.success i { color: var(--color-success); }
.custom-toast.error { border-left-color: var(--color-danger); }
.custom-toast.error i { color: var(--color-danger); }


/* ============================================================================
   37. COMPONENTI AGGIUNTIVI — FullCalendar, Timeline, Grafici, Mappe
   ============================================================================ */

/* ── FullCalendar ── */
.calendar { float: left; margin-bottom: 0; }
.fc-view { margin-top: 30px; }
.fc-toolbar { margin-bottom: 5px; margin-top: 15px; }
.fc-toolbar h2 { font-size: 18px; font-weight: 600; font-family: var(--font-alt); line-height: 30px; text-transform: uppercase; }
.fc-day { background: var(--bg-card); }
.fc th.fc-widget-header { background: var(--bg-page); font-size: 14px; line-height: 20px; padding: 10px 0; text-transform: uppercase; }
.fc-button { background: var(--bg-subtle); border: none; color: var(--text-dark); text-transform: capitalize; box-shadow: none !important; border-radius: 3px !important; margin: 0 3px !important; padding: 6px 12px !important; height: auto !important; }
.fc-state-hover { background: var(--bg-page); }
.fc-state-down, .fc-state-active, .fc-state-disabled { background-color: var(--brand-color) !important; color: var(--text-white) !important; text-shadow: none !important; }
.fc-event { border-radius: 2px; border: none; cursor: move; font-size: 13px; margin: 5px 7px; padding: 5px; text-align: center; }
.external-event { cursor: move; margin: 10px 0; color: var(--text-white); padding: 6px 10px; }
.fc-basic-view td.fc-week-number span { padding-right: 8px; font-weight: 700; font-family: var(--font-alt); }
.fc-basic-view td.fc-day-number { padding-right: 8px; font-weight: 700; font-family: var(--font-alt); }
.none-border .modal-footer { border-top: none; }
#calendar .fc-event, #calendar .fc-event-main, #calendar .fc-timegrid-event, #calendar .fc-daygrid-event { cursor: pointer; }
#calendar .fc-event-resizer { display: none; }
#calendar .fc-timegrid-slot { height: 3.2em; }
#calendar .fc-timegrid-slot-label { font-size: 12px; color: #8898aa; }
#calendar .fc-col-header-cell { padding: 10px 0; }
#calendar-title { font-family: 'Montserrat', sans-serif; text-transform: uppercase; margin-top: 10px; margin-bottom: 5px; position: relative; display: inline-block; }
.cal-title-main { font-weight: 800; font-size: 3.2rem; color: var(--brand-color); letter-spacing: -2px; line-height: 1; }
.cal-title-year { font-weight: 600; font-size: 3rem; color: #444; margin-left: 10px; line-height: 1; }
#calendar-title::after { content: ''; display: block; width: 90px; height: 5px; background: var(--brand-color); margin: 15px auto 0; border-radius: 2px; }
#event-aggiunta, #event-modal { padding-right: 0; }

/* ── Timeline ── */
.timeline { border-collapse: collapse; border-spacing: 0; display: table; margin-bottom: 50px; position: relative; table-layout: fixed; width: 100%; }
.timeline:before { background-color: rgba(122,125,132,0.3); bottom: 0; content: ""; left: 50%; position: absolute; top: 30px; width: 2px; z-index: 0; }
.timeline .timeline-icon { background: var(--text-muted); border-radius: 50%; color: var(--text-white); display: block; height: 20px; left: -54px; margin-top: -10px; position: absolute; text-align: center; top: 50%; width: 20px; }
.timeline-desk { display: table-cell; vertical-align: top; width: 50%; }
.timeline-desk .panel { background: var(--bg-subtle); display: block; margin-bottom: 5px; margin-left: 45px; position: relative; text-align: left; border: 0; }
h3.timeline-title { color: var(--text-muted); font-size: 20px; font-weight: 400; margin: 0 0 5px; text-transform: uppercase; }
.timeline-item { display: table-row; }
.timeline-item:before { content: ""; display: block; width: 50%; }

/* ── Prezzi ── */
.pricing-column .plan-title { font-size: 16px; padding: 20px; font-family: var(--font-alt); color: var(--text-white); text-transform: uppercase; background-color: var(--brand-color); }
.pricing-column .plan-price { font-size: 48px; font-family: var(--font-alt); margin-bottom: 10px; color: var(--text-dark); }

/* ── Grafici ── */
#flotTip { padding: 8px 12px; background-color: var(--text-dark); z-index: 100; color: var(--text-white); opacity: 0.9; font-size: 13px; border-radius: 3px; }
.morris-hover.morris-default-style { border-radius: 5px; padding: 10px 12px; background-color: var(--text-dark); border-color: var(--text-dark); }
.morris-hover.morris-default-style .morris-hover-point, .morris-hover.morris-default-style .morris-hover-row-label { color: var(--text-white) !important; }

/* ── Mappe ── */
.gmaps, .gmaps-panaroma { height: 300px; background: var(--bg-page); border-radius: 3px; }
.gmaps-overlay { display: block; text-align: center; color: var(--text-white); font-size: 16px; line-height: 40px; background: var(--brand-color); border-radius: 4px; padding: 10px 20px; }
.gmaps-overlay_arrow.above { bottom: -15px; border-left: 16px solid transparent; border-right: 16px solid transparent; border-top: 16px solid var(--brand-color); }
.gmaps-overlay_arrow.below { top: -15px; border-left: 16px solid transparent; border-right: 16px solid transparent; border-bottom: 16px solid var(--brand-color); }

/* ── Summernote ── */
.note-editor .btn-default { background-color: transparent !important; border-color: transparent !important; }
.note-editor .note-toolbar { background-color: var(--bg-page); border-bottom: 1px solid var(--bg-page); margin: 0; }
.note-editor.note-frame { border: 1px solid var(--border-light) !important; }

/* ── Widget & Social ── */
.social-links li a { border-radius: 50%; color: rgba(122,125,132,0.5); display: inline-block; height: 30px; line-height: 27px; border: 2px solid rgba(122,125,132,0.5); text-align: center; width: 30px; }
.social-links li a:hover { color: var(--text-muted); border: 2px solid var(--text-muted); }
.widget-inline .widget-inline-box { border-right: 1px solid var(--border-light); padding: 20px; }
.icon-list-demo i { border: 1px solid var(--border-light); }
.icon-list-demo .col-md-4:hover i { color: var(--brand-color); }

/* ── Account pages ── */
.wrapper-page { margin: 7% auto; position: relative; max-width: 520px; }
.wrapper-page .card-box { padding: 30px; border-radius: 9px; border-color: rgba(98,103,115,0.3); }

/* ── Blink & helper ── */
.btn-group.open .dropdown-toggle { box-shadow: 0 0 0 100px rgba(0,0,0,0.1) inset; }

/* ============================================================================
   38. MAGAZZINO IMPIANTI — list_impianti.php, det_impianti.php
   ============================================================================ */

/* ── Griglia card ── */
.impianti-grid {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
    padding-bottom: 60px;
}
.impianto-card-wrapper {
    width: 25%;
    padding: 10px;
    box-sizing: border-box;
}
@media (max-width: 1200px) { .impianto-card-wrapper { width: 33.33%; } }
@media (max-width: 768px)  { .impianto-card-wrapper { width: 50%; } }
@media (max-width: 480px)  { .impianto-card-wrapper { width: 100%; } }

/* ── Card impianto ── */
.impianto-card {
    border: 1px solid var(--border-light);
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg-card);
    box-shadow: var(--shadow-card);
    transition: box-shadow .2s, transform .2s;
    height: 100%;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}
.impianto-card:hover {
    box-shadow: 0 6px 20px rgba(25, 173, 241, .18);
    transform: translateY(-2px);
}

/* ── Header card (icona + badge giacenza) ── */
.impianto-card-icon {
    width: 100%;
    height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e8f7fd 0%, #d0effa 100%);
    border-bottom: 1px solid #c8e9f6;
    position: relative;
}
.impianto-card-icon > i {
    font-size: 58px;
    color: var(--brand-color);
    opacity: .65;
}

/* ── Badge giacenza (angolo top-right della card) ── */
.badge-giacenza {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 1px solid transparent;
}
.badge-giacenza.giac-ok {
    background: var(--color-success-light);
    color: var(--color-success-text);
    border-color: var(--color-success-border);
}
.badge-giacenza.giac-low {
    background: var(--color-warning-light);
    color: var(--color-warning-text);
    border-color: var(--color-warning-border);
}
.badge-giacenza.giac-zero {
    background: var(--color-danger-light);
    color: var(--color-danger);
    border-color: var(--color-danger-border);
}

/* ── Badge componenti (angolo top-left) ── */
.badge-n-componenti {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(255,255,255,.75);
    color: var(--color-gray-600);
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    border: 1px solid var(--border-light);
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

/* ── Body card ── */
.impianto-card-body {
    padding: 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.impianto-card-nome {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-dark);
    margin-bottom: 5px;
    line-height: 1.3;
}
.impianto-card-desc {
    font-size: 12px;
    color: var(--text-muted);
    flex: 1;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* ── Footer card ── */
.impianto-card-footer {
    background: var(--bg-subtle);
    border-top: 1px solid var(--border-light);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.impianto-card-footer .btn-dettagli {
    font-size: 12px;
    font-weight: 700;
    color: var(--brand-color);
    background: none;
    border: none;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    cursor: pointer;
    transition: color .15s;
}
.impianto-card-footer .btn-dettagli:hover { color: var(--brand-hover); }

/* ── Barra di ricerca lista ── */
.mag-search-wrapper {
    position: relative;
    max-width: 340px;
}
.mag-search-wrapper > i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-placeholder);
    font-size: 15px;
    pointer-events: none;
}
.mag-search-wrapper input {
    padding-left: 36px;
    border-radius: 8px;
    border: 1px solid var(--border-light);
    background: var(--bg-card);
    font-size: 13px;
    height: 36px;
}
.mag-search-wrapper input:focus {
    border-color: var(--brand-color);
    outline: none;
    box-shadow: 0 0 0 2px var(--brand-glow-focus);
}
.mag-count {
    font-size: 12px;
    color: var(--text-placeholder);
    margin-top: 5px;
}

/* ── Empty state griglia ── */
.mag-empty-state {
    width: 100%;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-placeholder);
    display: none;
}
.mag-empty-state i {
    font-size: 52px;
    display: block;
    margin-bottom: 12px;
}
.mag-empty-state p { font-size: 14px; }

/* ── Sezione giacenza nel det_impianti (tab MAGAZZINO) ── */
.giac-box {
    display: flex;
    align-items: center;
    gap: 24px;
    background: var(--bg-subtle);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 20px 28px;
    margin-bottom: 28px;
}
.giac-box-number {
    font-size: 56px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -2px;
    color: var(--text-dark);
    min-width: 80px;
    text-align: center;
}
.giac-box-number.giac-ok   { color: var(--color-success); }
.giac-box-number.giac-low  { color: var(--color-warning); }
.giac-box-number.giac-zero { color: var(--color-danger); }
.giac-box-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-muted);
    margin-bottom: 2px;
}
.giac-box-sub {
    font-size: 12px;
    color: var(--text-placeholder);
}

/* ── Pill tipo movimento ── */
.mov-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    border: 1px solid transparent;
}
.mov-pill.carico  {
    background: var(--color-success-light);
    color: var(--color-success-text);
    border-color: var(--color-success-border);
}
.mov-pill.scarico {
    background: var(--color-danger-light);
    color: var(--color-danger);
    border-color: var(--color-danger-border);
}

/* ── Form movimento (carico/scarico) ── */
.mov-form-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}
.mov-form-card h5 {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-dark);
    margin: 0 0 16px;
    text-transform: uppercase;
    letter-spacing: .4px;
}
.mov-tipo-group {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}
.mov-tipo-btn {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    border: 2px solid var(--border-light);
    background: var(--bg-subtle);
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all .15s;
    color: var(--text-muted);
}
.mov-tipo-btn:hover { border-color: var(--brand-color); color: var(--brand-color); }
.mov-tipo-btn.selected-carico  {
    border-color: var(--color-success);
    background: var(--color-success-light);
    color: var(--color-success-text);
}
.mov-tipo-btn.selected-scarico {
    border-color: var(--color-danger);
    background: var(--color-danger-light);
    color: var(--color-danger);
}

.avviso-esaurito {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: var(--color-warning-light);
    border: 1px solid var(--color-warning-border);
    border-left: 4px solid var(--color-warning);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--color-warning-text);
    line-height: 1.5;
}
.avviso-esaurito i {
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}
.avviso-esaurito a {
    color: var(--color-warning-text);
    font-weight: 700;
    text-decoration: underline !important;
}
.comp-preview-group-title {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .5px; color: var(--text-muted);
    margin: 14px 0 6px;
}
.comp-preview-group-title.proprio { color: var(--brand-color); }
.comp-preview-group-title.esterno { color: var(--color-warning-text); }
.comp-preview-item {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 10px; border-radius: 6px;
    background: var(--bg-subtle); border: 1px solid var(--border-light);
    margin-bottom: 5px; font-size: 12px; color: var(--text-dark);
}
.comp-preview-item .badge-gray-style { font-size: 10px; }

/* ============================================================================
   39. MAPPA INSTALLAZIONI — mappa_installazioni.php
   ============================================================================ */

/* ── Contenitore mappa ── */
.mappa-installazioni-container {
    width: 100%;
    height: 400px; /* Altezza ridotta per stare in una sola schermata */
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-card);
}
@media (max-width: 768px) {
    .mappa-installazioni-container { height: 350px; margin-top: 15px; }
}

/* ── Barra legenda (Verticale a sinistra) ── */
.mappa-legenda-bar {
    display: flex;
    flex-direction: column; /* Dispone in verticale */
    align-items: flex-start;
    gap: 16px;
    background: var(--bg-subtle);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 20px;
    font-size: 13px;
    color: var(--text-body);
    height: 400px; /* Stessa altezza della mappa per allineamento perfetto */
    overflow-y: auto;
}
.mappa-legenda-item {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
}
.mappa-dot {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid transparent;
}
.dot-expired { background: #c9100e; border-color: #912018; }
.dot-warning { background: #f59e0b; border-color: #d97706; }
.dot-ok      { background: #10b981; border-color: #0ea374; }
.dot-none    { background: #98a2b3; border-color: #667085; }

.mappa-legenda-sep {
    display: none; /* Nascondiamo lo spaziatore orizzontale */
}
.mappa-legenda-hint {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
    line-height: 1.4;
}
.mappa-legenda-hint i { font-size: 16px; flex-shrink: 0; }

/* ── Barra progresso geocodifica ── */
.mappa-geocodifica-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--color-info-light);
    border: 1px solid var(--color-info-border);
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 13px;
    color: var(--color-info);
    margin-top: 10px;
}
.mappa-geocodifica-bar i { font-size: 18px; flex-shrink: 0; }
.mappa-progress-wrap {
    flex: 1;
    height: 6px;
    background: var(--color-info-border);
    border-radius: 3px;
    overflow: hidden;
    min-width: 80px;
}
.mappa-progress-fill {
    height: 100%;
    background: var(--brand-color);
    border-radius: 3px;
    transition: width .3s ease;
    width: 0%;
}

/* ── Marcatore Leaflet personalizzato ── */
.map-marker-wrapper {
    background: transparent !important;
    border: none !important;
}
.map-marker-pin {
    width: 46px;
    height: 46px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    border: 3px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(0,0,0,.25);
    transition: transform .15s;
}
.map-marker-wrapper:hover .map-marker-pin {
    transform: rotate(-45deg) scale(1.12);
}
.map-marker-label {
    transform: rotate(45deg);
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    text-align: center;
    display: block;
    font-family: 'Noto Sans', sans-serif;
    white-space: nowrap;
}
.map-marker-tail {
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 10px solid #c9100e; /* sovrascritto inline */
    margin: -1px auto 0;
    display: none; /* il pin rotante funge da puntatore */
}

/* ── Popup Leaflet override ── */
.leaflet-popup-content-wrapper {
    border-radius: 12px !important;
    box-shadow: 0 8px 25px rgba(0,0,0,.15) !important;
    padding: 0 !important;
}
.leaflet-popup-content {
    margin: 18px 20px 25px 20px !important;
}
.leaflet-popup-tip-container { margin-top: -1px; }

/* Posizionamento corretto della X di chiusura */
.leaflet-container a.leaflet-popup-close-button {
    top: 14px !important;
    right: 14px !important;
    color: var(--text-muted) !important;
    width: 24px !important;
    height: 24px !important;
    font-size: 18px !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
}
.leaflet-container a.leaflet-popup-close-button:hover {
    color: var(--color-danger) !important;
    background: var(--bg-subtle);
    border-radius: 50%;
}
.td-nota-testo {
  white-space: pre-line;
  max-width: 480px;
  line-height: 1.5;
}

/* ============================================================================
   40. AUTOCOMPLETE COMUNI — search_comuni.php / list_installazioni / det_installazioni
   ============================================================================ */

.comuni-dropdown {
    position        : absolute;
    top             : 100%;
    left            : 0;
    right           : 0;
    background      : var(--bg-card, #fff);
    border          : 1px solid var(--border-light, #e3e8ef);
    border-top      : none;
    border-radius   : 0 0 8px 8px;
    box-shadow      : 0 4px 16px rgba(0, 0, 0, .10);
    z-index         : 9999;
    max-height      : 220px;
    overflow-y      : auto;
    display         : none;
}

.comune-option {
    padding         : 8px 12px;
    cursor          : pointer;
    font-size       : 13px;
    display         : flex;
    align-items     : center;
    gap             : 4px;
    border-bottom   : 1px solid var(--border-light, #f0f0f0);
    transition      : background .15s;
}

.comune-option:last-child {
    border-bottom   : none;
}

.comune-option:hover {
    background      : var(--bg-hover, #f5f8ff);
}

.comune-nome {
    font-weight     : 500;
    color           : var(--text-dark, #333);
}

.comune-prov {
    color           : var(--text-muted, #aab0be);
    font-size       : 11px;
    margin-left     : 2px;
}

/* Wrapper necessario per il posizionamento del dropdown */
.comune-autocomplete-wrapper {
    position        : relative;
}

/* ── RIEPILOGO INTERVENTI ─────────────────────────────── */
.interventi-summary       { margin-bottom: 4px; }

.int-sum-grid             { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }

.int-sum-card             {
  flex: 1 1 160px;
  background: var(--bg-panel, #f8f9fa);
  border: 1px solid var(--border-color, #e9ecef);
  border-radius: 8px;
  padding: 16px 18px 12px;
  min-width: 140px;
}

.int-sum-number           { font-size: 32px; font-weight: 700; line-height: 1; color: var(--color-text, #2c3e50); }
.int-sum-number.int-sum-ok   { color: #27ae60; }
.int-sum-number.int-sum-warn { color: #e67e22; }

.int-sum-label            { font-size: 11px; font-weight: 600; text-transform: uppercase;
                             letter-spacing: .5px; color: #aab0be; margin: 4px 0 8px; }

.int-sum-sub              { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; min-height: 22px; }

.int-sum-comp-list        { flex-direction: column; align-items: flex-start; gap: 3px; }

.int-sum-comp-pill        {
  font-size: 11px; color: #555;
  display: flex; justify-content: space-between;
  width: 100%; padding: 1px 0;
  border-bottom: 1px solid var(--border-color, #eee);
}
.int-sum-comp-pill:last-child { border-bottom: none; }
.int-sum-comp-pill b      { color: var(--color-primary, #19ADF1); margin-left: 8px; min-width: 16px; text-align: right; }

.int-sum-divider          { margin: 16px 0; border-color: var(--border-color, #e9ecef); }
/* ── BLOCCO PER INSTALLAZIONE ─────────────────────────── */
.inst-interventi-block        { margin-bottom: 8px; }
.inst-dismessa                { opacity: .65; }

.inst-interventi-header       {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 6px;
}
.inst-interventi-title-group  { display: flex; flex-direction: column; gap: 2px; }
.inst-interventi-name         { font-weight: 600; font-size: 14px; color: var(--color-text, #2c3e50); }
.inst-interventi-address      { font-size: 12px; color: #aab0be; }
.inst-interventi-badges       { display: flex; align-items: center; gap: 6px; }

/* Grid compatta (4 card più strette) */
.int-sum-grid-compact .int-sum-card  { padding: 12px 14px 10px; }
.int-sum-grid-compact .int-sum-number { font-size: 26px; }

/* Tabella interna più compatta */
.table-sm-interventi th,
.table-sm-interventi td        { padding: 7px 10px; font-size: 13px; }

.map-marker-wrapper { position: relative; }

.map-marker-badge-segn {
    position: absolute;
    top: -6px; right: -6px;
    width: 18px; height: 18px;
    background: #7c3aed;
    border: 2px solid #fff;
    border-radius: 50%;
    color: #fff;
    font-size: 11px; font-weight: 900;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,.25);
    line-height: 1;
}

/* ============================================================================
   41. COMPLETA INTERVENTO — completa_intervento.php
   ============================================================================ */

/* ── Layout ── */
.ci-wrap     { max-width: 860px; margin: 0 auto; }
.ci-section  {
    background: #fff;
    border: 1px solid var(--border-color, #e9ecef);
    border-radius: 10px; padding: 22px 24px; margin-bottom: 18px;
}
.ci-section-title {
    font-size: 13px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .5px; color: var(--brand-color);
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 10px; margin-bottom: 16px;
    display: flex; align-items: center; gap: 8px;
}
.ci-section-title i { font-size: 18px; }

/* ── Riepilogo ── */
.ci-info-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px;
}
.ci-info-item label {
    font-size: 10px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .4px; color: #aab0be; display: block; margin-bottom: 2px;
}
.ci-info-item span { font-size: 13px; font-weight: 600; color: #323a46; }

/* ── Componenti ── */
.ci-comp-row {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; margin-bottom: 6px;
    background: var(--bg-subtle);
    border: 1px solid var(--border-light); border-radius: 8px;
}
.ci-comp-row .comp-select  { flex: 1; min-width: 0; }
.ci-comp-row .azione-select { width: 140px; flex-shrink: 0; }
.ci-comp-row .btn-remove   { flex-shrink: 0; }
.ci-comp-row.is-changed { border-color: #d97706; background: rgba(217,119,6,.04); }
.ci-comp-inst-row {
    display: grid;
    grid-template-columns: minmax(220px,1fr) minmax(220px,280px);
    gap: 12px;
    align-items: start;
    padding: 10px 12px;
    margin-bottom: 8px;
    background: var(--bg-subtle);
    border: 1px solid var(--border-light);
    border-radius: 8px;
}
.ci-comp-inst-name strong { display: block; }
.ci-comp-inst-name small { display: block; margin-top: 3px; }
.ci-comp-inst-azione { min-width: 0; }
.ci-comp-economia-wrap,
.ci-comp-cambio-wrap { grid-column: 2 / 3; min-width: 0; }
.ci-comp-economia-wrap[hidden],
.ci-comp-cambio-wrap[hidden],
.foto-preview-list[hidden] { display: none !important; }
.ci-comp-row .fornitore-select { flex: 1; min-width: 220px; }
.prezzo-riga-info { display: block; margin-top: 4px; }
.ci-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ci-cancel-section { border-color: #fee2e2; }
.ci-section-title-danger { color: #dc2626; }
.ci-upload-icon { font-size: 32px; }
.ci-comp-pianif-badge {
    font-size: 10px; padding: 2px 7px; border-radius: 50px;
    background: var(--brand-light); color: var(--brand-color); font-weight: 700;
    white-space: nowrap;
}

/* ── Avviso diff componenti ── */
.ci-diff-warn {
    background: rgba(217,119,6,.08); border: 1px solid rgba(217,119,6,.3);
    border-radius: 6px; padding: 8px 12px; font-size: 12px; color: #92400e;
    margin-bottom: 10px; display: none;
}
.ci-diff-warn i { margin-right: 4px; }

/* ── Campi rapportino / dati acqua ── */
.ci-report-fields-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.ci-check-card,
.ci-consenso-card {
    background: var(--bg-subtle);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 14px;
}
.ci-check-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    cursor: pointer;
}
.ci-check-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin: 1px 0 0;
    flex: 0 0 auto;
}
.ci-check-label span { display: flex; flex-direction: column; gap: 3px; }
.ci-check-label strong { color: var(--text-dark); }
.ci-check-label small { color: var(--text-muted); line-height: 1.45; }
.ci-consenso-firma-grid {
    display: grid;
    grid-template-columns: minmax(240px, .8fr) minmax(320px, 1.2fr);
    gap: 18px;
    align-items: start;
}
.ci-check-label-privacy { margin-bottom: 12px; }

/* ── Firma ── */
.firma-wrap {
    position: relative; border-radius: 8px; overflow: hidden;
    border: 2px dashed var(--border-light);
    background: #fafbfc; transition: border-color .2s;
}
.firma-wrap.has-firma { border-color: var(--color-success); border-style: solid; }
#canvas-firma {
    display: block; width: 100%; height: 200px; cursor: crosshair; touch-action: none;
}
.firma-toolbar {
    display: flex; gap: 8px; align-items: center;
    padding: 8px 12px; border-top: 1px solid var(--border-light);
    background: #fff;
}
.firma-hint {
    font-size: 11px; color: #aab0be; text-align: center;
    padding: 10px 0 4px; pointer-events: none;
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 100%; transition: opacity .2s;
}

/* ── Submit bar ── */
.ci-submit-bar {
    display: flex; justify-content: space-between; align-items: center;
    gap: 12px; flex-wrap: wrap;
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 10px; padding: 16px 20px;
    position: sticky; bottom: 0;
    box-shadow: 0 -4px 20px rgba(0,0,0,.06);
}
.ci-firma-status {
    font-size: 12px; color: #aab0be;
    display: flex; align-items: center; gap: 6px;
}
.ci-firma-status.ok { color: var(--color-success); }
.ci-firma-status i { font-size: 16px; }

@media (max-width: 767px) {
    .ci-info-grid { grid-template-columns: 1fr 1fr; }
    .ci-comp-row  { flex-wrap: wrap; }
    .ci-comp-row .azione-select { width: 100%; }
    .ci-comp-inst-row { grid-template-columns: 1fr; }
    .ci-comp-economia-wrap,
    .ci-comp-cambio-wrap { grid-column: 1 / -1; }
    .ci-comp-row .fornitore-select { min-width: 100%; width: 100%; }
    .ci-comp-cambio-wrap { grid-column: auto; }
    .ci-actions { width: 100%; }
    .ci-report-fields-grid,
    .ci-consenso-firma-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   § RAPPORTINO INTERVENTO
   ============================================================ */

.rapp-wrap {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 32px 36px;
    max-width: 800px;
    margin: 0 auto 30px;
    font-size: 13px;
    color: #1e293b;
}

/* Intestazione */
.rapp-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 18px;
}
.rapp-logo-area {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.rapp-logo {
    max-height: 50px;
    max-width: 160px;
    object-fit: contain;
}
.rapp-azienda-name {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
}
.rapp-azienda-contact {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.rapp-azienda-contact span {
    font-size: 11px;
    color: #64748b;
}
.rapp-title-area {
    text-align: right;
}
.rapp-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--brand-color, #19ADF1);
    letter-spacing: .5px;
}
.rapp-num {
    font-size: 13px;
    color: #64748b;
    margin-top: 3px;
}
.rapp-tipo {
    display: inline-block;
    margin-top: 5px;
    background: #f1f5f9;
    color: #475569;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .6px;
    padding: 2px 8px;
    border-radius: 4px;
}

.rapp-hr {
    border: none;
    border-top: 1px solid #e2e8f0;
    margin: 16px 0;
}

/* Griglie dati */
.rapp-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.rapp-block {
    background: #f8fafc;
    border-radius: 5px;
    padding: 10px 14px;
}
.rapp-block-title {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .7px;
    color: #94a3b8;
    margin-bottom: 4px;
}
.rapp-block-val {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
}
.rapp-block-sub {
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
}

.rapp-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}
.rapp-cell {
    background: #f8fafc;
    border-radius: 5px;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.rapp-cell-label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .7px;
    color: #94a3b8;
    text-transform: uppercase;
}
.rapp-cell-val {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
}

/* Titoli sezione */
.rapp-section-title {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .8px;
    color: #94a3b8;
    text-transform: uppercase;
    margin-bottom: 10px;
}

/* Tabella componenti */
.rapp-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 4px;
}
.rapp-th {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .5px;
    color: #64748b;
    border-bottom: 2px solid #e2e8f0;
    padding: 6px 10px;
    text-align: left;
    text-transform: uppercase;
}
.rapp-td {
    padding: 8px 10px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13px;
    vertical-align: middle;
}
.rapp-td-muted {
    color: #64748b;
    font-size: 12px;
}
.rapp-badge {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .4px;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}
.rapp-badge-sost {
    background: #fef3c7;
    color: #92400e;
}
.rapp-badge-ver {
    background: #e0f2fe;
    color: #0369a1;
}
.rapp-empty {
    color: #94a3b8;
    font-style: italic;
    font-size: 12px;
}

/* Note */
.rapp-note-box {
    background: #f8fafc;
    border-radius: 5px;
    padding: 10px 14px;
    font-size: 13px;
    color: #334155;
    min-height: 48px;
    line-height: 1.6;
}

/* Verifica impianto e valori acqua */
.rapp-water-grid {
    display: grid;
    grid-template-columns: 1.15fr repeat(3, 1fr);
    gap: 10px;
}
.rapp-water-status {
    background: #f8fafc;
    border-radius: 5px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
}
.rapp-check {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
}
.rapp-check i { font-size: 17px; }
.rapp-check-ok { color: #047857; }
.rapp-check-no { color: #b91c1c; }
.rapp-check-na { color: #94a3b8; }
.rapp-firma-label-privacy {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}
.rapp-firma-label-privacy .rapp-check {
    font-size: 9px;
    letter-spacing: 0;
    text-transform: none;
}
.rapp-firma-label-privacy .rapp-check i { font-size: 14px; }

/* Firma */
.rapp-firma-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 4px;
}
.rapp-firma-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.rapp-firma-label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .7px;
    color: #94a3b8;
    text-transform: uppercase;
}
.rapp-firma-area {
    border-bottom: 1.5px solid #cbd5e1;
    padding-bottom: 6px;
    font-size: 13px;
    color: #475569;
    min-height: 40px;
    display: flex;
    align-items: flex-end;
}
.rapp-firma-vuota {
    font-size: 11px;
    color: #94a3b8;
    font-style: italic;
}
.rapp-firma-img {
    max-width: 100%;
    max-height: 80px;
    border-bottom: 1.5px solid #cbd5e1;
    padding-bottom: 4px;
}

/* Footer */
.rapp-footer {
    margin-top: 24px;
    text-align: center;
    font-size: 10px;
    color: #cbd5e1;
}

@media (max-width: 767px) {
    .rapp-water-grid { grid-template-columns: 1fr; }
}

/* ── STAMPA ──────────────────────────────────────────── */
@media print {
    /* Nascondi tutto tranne il rapportino */
    body > *:not(.wrapper),
    .topbar, .left-side-menu, .no-print,
    .nav-tabs, .tab-content > .tab-pane:not(#rapportino),
    .panel-heading-actions > .btn,
    .alert-warning {
        display: none !important;
    }
    #rapportino {
        display: block !important;
    }
    .rapp-wrap {
        border: none;
        padding: 0;
        max-width: 100%;
        box-shadow: none;
    }
    .rapp-header,
    .rapp-grid-2,
    .rapp-grid-4,
    .rapp-firma-row {
        break-inside: avoid;
    }
}

/* ============================================================================
   42. MESSAGGISTICA INTERNA — list_messaggi.php, ajax_preview_messaggio.php
   ============================================================================ */

/* Riga non letta */
tr.row-unread td { font-weight: 700; }

/* Badge thread (n° messaggi nella conversazione) */
.badge-thread {
    display: inline-flex; align-items: center; gap: 3px;
    font-size: 11px; font-weight: 600;
    background: var(--brand-light); color: var(--brand-color);
    border: 1px solid var(--brand-border);
    padding: 1px 7px; border-radius: 10px; margin-left: 6px;
}

/* Counter messaggi non letti — rosso, distinto dal .tab-badge-counter brand-blue */
.badge-msg-counter {
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700;
    background: var(--color-danger); color: var(--text-white);
    min-width: 20px; padding: 1px 6px;
    border-radius: 10px; margin-left: 4px;
}

/* Info-box compatto con bordo sinistro colorato (drawer componi/rispondi/modifica)
   Diverso da .info-box-blue: padding ridotto, solo bordo sinistro, cambio colore per stato */
.info-box-msg {
    display: flex; align-items: center; gap: 12px;
    background: var(--bg-info);
    border-left: 3px solid var(--brand-color);
    border-radius: 6px;
    padding: 10px 14px; margin-bottom: 18px;
}
.info-box-msg .info-icon { font-size: 22px; color: var(--brand-color); flex-shrink: 0; }
.info-box-msg.risposta              { border-left-color: var(--color-success); }
.info-box-msg.risposta .info-icon   { color: var(--color-success); }
.info-box-msg.modifica              { border-left-color: var(--color-warning); }
.info-box-msg.modifica .info-icon   { color: var(--color-warning); }

/* ── Thread (bolle chat) ────────────────────────────────────────────────── */
.thread-header { padding: 0 0 12px; border-bottom: 1px solid var(--border-light); margin-bottom: 16px; }
.msg-oggetto-title { font-size: 15px; font-weight: 600; color: var(--text-dark); margin: 0; }
.thread-body {
    display: flex; flex-direction: column; gap: 14px;
    padding: 4px 4px 20px 0; max-height: 60vh; overflow-y: auto;
}

.bubble-wrapper             { display: flex; align-items: flex-end; gap: 8px; }
.bubble-wrapper.bubble-sent { justify-content: flex-end; }
.bubble-wrapper.bubble-received { justify-content: flex-start; }

.bubble-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 600; flex-shrink: 0; color: var(--text-white);
}
.bubble-sent .bubble-avatar     { background: var(--brand-color); order: 2; }
.bubble-received .bubble-avatar { background: var(--text-dark); }

.bubble { max-width: 78%; padding: 10px 14px; border-radius: 14px; font-size: 13px; line-height: 1.55; }
.bubble-sent .bubble     { background: var(--brand-color); color: var(--text-white); border-bottom-right-radius: 3px; }
.bubble-received .bubble { background: var(--color-gray-100); color: var(--text-body); border-bottom-left-radius: 3px; }

.bubble-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px; gap: 10px; }
.bubble-name { font-size: 11px; font-weight: 600; opacity: .8; }
.bubble-time { font-size: 11px; opacity: .65; white-space: nowrap; }
.bubble-text { word-break: break-word; }
.bubble-status { text-align: right; font-size: 12px; margin-top: 5px; opacity: .75; }
.bubble-sent .bubble-status { color: var(--text-white); }

.bubble-attachment { margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,.25); }
.bubble-received .bubble-attachment { border-top-color: var(--border-light); }

.btn-attachment {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 12px; padding: 3px 10px; border-radius: 20px;
    border: 1px solid rgba(255,255,255,.5);
    color: var(--text-white); background: rgba(255,255,255,.15);
    cursor: pointer; text-decoration: none; transition: opacity .2s;
}
.bubble-received .btn-attachment { border-color: var(--brand-color); color: var(--brand-color); background: var(--brand-light); }
.btn-attachment:hover { opacity: .75; color: inherit; }

.thread-reply-bar {
    padding-top: 16px; border-top: 1px solid var(--border-light);
    display: flex; justify-content: flex-end; align-items: center; gap: 8px;
}

.kpi-sublabel {
    font-size: 11px;
    color: rgba(255,255,255,0.75);
    margin-top: 4px;
    display: block;
}

/* ============================================================================
   FORZA DIMENSIONE LOGHI TOPBAR (Modalità "Forza Bruta")
   ============================================================================ */

body:not(.forced-left-mini) a.logo img.logo-lg-img { 
    width: 215px !important;      /* Allargato! (La sidebar è 240px, resta un po' di margine) */
    height: auto !important; 
    max-height: 65px !important;  /* Evita che sbordi dalla topbar che è alta 70px */
    max-width: none !important; 
    object-fit: contain !important; 
    vertical-align: middle !important;
    display: inline-block !important;
    margin-left: 0 !important;    /* Rimuove margini che potrebbero spingerlo fuori */
    transform: none !important;   /* Annulla lo zoom del 140% della sezione 03 che sgranava l'immagine */
}

/* Logo Piccolo - Visibile SOLO quando il menu è CHIUSO */
a.logo img.logo-sm-img { 
    width: auto !important;
    height: 40px !important; 
    max-height: none !important;
    vertical-align: middle !important;
}

a.logo img.logo-sm-img { 
    width: auto !important;
    height: 40px !important; 
    max-height: none !important;
    vertical-align: middle !important;
    /* Non metto "display" qui, così il tuo framework è libero di nasconderlo/mostrarlo quando apri e chiudi il menu */
}


/* Fase 5.80.5.2 - allineamento shell Hydro: wrapper full-width, logo e avatar fallback. */
.topbar .topbar-left .logo {
    display: block;
    height: var(--topbar-height);
    text-align: center;
}

.logo-sm-text,
.logo-hydro-fallback {
    color: var(--brand-color) !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: var(--sidebar-mini-width);
    height: var(--topbar-height);
    line-height: var(--topbar-height);
    font-size: 24px;
}

.logo-hydro-fallback i {
    line-height: 1;
}

.topbar-avatar-placeholder,
.sidebar-avatar-placeholder {
    background: #d6d6d6;
    color: #343a40;
    border: none;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.topbar-avatar-placeholder {
    width: 36px;
    height: 36px;
    vertical-align: middle;
    font-size: 23px;
}

.sidebar-avatar-placeholder {
    width: 48px !important;
    height: 48px !important;
    font-size: 32px;
}

.topbar-avatar-placeholder i,
.sidebar-avatar-placeholder i {
    line-height: 1;
}

body.forced-left-mini .user-details {
    min-height: 102px;
    padding: 22px 0 18px 0;
}

body.forced-left-mini .user-details .pull-left {
    width: var(--sidebar-mini-width) !important;
    text-align: center !important;
    float: none !important;
}

body.forced-left-mini .sidebar-avatar,
body.forced-left-mini .sidebar-avatar-placeholder {
    margin: 0 auto !important;
}

body.forced-left-mini #side-menu > li > a {
    min-height: 55px;
    display: flex !important;
    align-items: center;
    justify-content: center;
}

/* ============================================================================
   MOBILE OVERRIDE DEFINITIVO — va messo ULTIMO nel file
   ============================================================================ */

@media (max-width: 991px) {

    /* Sidebar completamente nascosta */
    .sidebar-navigation,
    body.forced-left-mini .sidebar-navigation {
        margin-left: -2200px !important;
        width: var(--sidebar-width) !important;
    }

    /* Sidebar visibile solo quando menu aperto */
    body.nav-collapse .sidebar-navigation {
        margin-left: 0 !important;
        z-index: 999 !important;
    }

    /* Contenuto occupa tutta la larghezza */
    #page-right-content,
    body.forced-left-mini #page-right-content {
        margin-left: 0 !important;
        padding-left: 8px !important;
        padding-right: 8px !important;
    }

    /* Navbar occupa tutta la larghezza */
    .navbar-default,
    body.forced-left-mini .navbar-default {
        margin-left: 0 !important;
    }

    /* Topbar sinistra: solo larghezza icona hamburger */
    .topbar .topbar-left,
    body.forced-left-mini .topbar .topbar-left {
        width: var(--sidebar-mini-width) !important;
    }

    /* Overlay scuro quando sidebar aperta */
    body.nav-collapse::before {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 998;
        pointer-events: none;
    }
}

.badge-tipo-installazione {
    background-color: rgba(25, 173, 241, 0.15);
    color: #0e8fcc;
    border: 1px solid rgba(25, 173, 241, 0.3);
}

/* ── CI: Foto upload ────────────────────────────────── */
.foto-upload-area {
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 16px;
    background: #f9fafb;
    cursor: pointer;
    transition: border-color .2s;
}
.foto-upload-area:hover,
.foto-upload-area.dragover { border-color: #19ADF1; background: #f0f9ff; }
.foto-placeholder { text-align: center; padding: 10px 0; }
.foto-preview-list { display: flex; flex-wrap: wrap; gap: 10px; }
.foto-preview-item {
    position: relative; width: 90px; height: 90px;
    border-radius: 6px; overflow: hidden;
    border: 2px solid #e5e7eb;
}
.foto-preview-item img {
    width: 100%; height: 100%; object-fit: cover; display: block;
}
.foto-preview-item .btn-remove-foto {
    position: absolute; top: 2px; right: 2px;
    background: rgba(0,0,0,.55); color: #fff;
    border: none; border-radius: 50%;
    width: 20px; height: 20px; line-height: 18px;
    text-align: center; cursor: pointer; font-size: 12px;
    padding: 0;
}

/* ── Rapportino: griglia foto ───────────────────────────────── */
.rapp-foto-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
}
.rapp-foto-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.rapp-foto-item img {
    width: 160px;
    height: 120px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}
.rapp-foto-nome {
    font-size: 10px;
    color: #94a3b8;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rapp-footer-azienda {
  text-align: center;
  font-size: 10px;
  color: #94a3b8;
  margin-top: 4px;
}

/* Fase 5.80.5.3 - allineamento verticale /home Hydro live.
   La sidebar/topbar sono gia' ancorate; il contenuto desktop non deve
   aggiungere altri 90px sotto la topbar, altrimenti la dashboard parte
   troppo in basso rispetto alla home Hydrometalservice originale. */
@media (min-width: 992px) {
    #page-right-content {
        padding-top: 20px !important;
    }
}


/* Fase 5.80.5.4 - asset shell Hydro e mini sidebar.
   Usa immagini reali/provvisorie target per logo e avatar invece dei fallback
   a icona font, e allinea le misure mini alla home Hydrometalservice live. */
.topbar .logo .logo-sm-img {
    width: 34px !important;
    height: 34px !important;
    max-width: 34px !important;
    max-height: 34px !important;
    object-fit: contain !important;
    margin: 18px auto 0 auto !important;
    display: block !important;
}

.topbar .profile img,
.topbar-avatar-placeholder {
    width: 42px !important;
    height: 42px !important;
    object-fit: cover !important;
    vertical-align: middle !important;
}

.sidebar-avatar,
.sidebar-avatar-placeholder {
    width: 50px !important;
    height: 50px !important;
    object-fit: cover !important;
}

body.forced-left-mini .user-details {
    min-height: 106px !important;
    padding: 24px 0 18px 0 !important;
}

body.forced-left-mini .sidebar-navigation,
body.forced-left-mini .topbar .topbar-left,
body.forced-left-mini .topbar-left {
    background-color: #ffffff !important;
}

body.forced-left-mini #page-right-content {
    border-left-color: #f5f5f5 !important;
}


/* Fase 5.80.5.5 - rifinitura mini sidebar chiusa.
   La sidebar mini Hydro non deve generare una seconda fascia verticale chiara
   tra menu e contenuto: la separazione e' gia' data dalla sidebar da 70px.
   Inoltre il profilo laterale usa lo stesso avatar immagine della topbar. */
@media (min-width: 992px) {
    body.forced-left-mini #page-right-content {
        border-left: 0 !important;
        margin-left: var(--sidebar-mini-width) !important;
    }

    body.forced-left-mini .sidebar-navigation {
        border-right: 0 !important;
        box-shadow: none !important;
    }

    body.forced-left-mini .user-details img.sidebar-avatar {
        display: block !important;
        width: 50px !important;
        height: 50px !important;
        margin: 0 auto !important;
        object-fit: cover !important;
        border-radius: 50% !important;
    }
}

/* Fase 5.80.5.6 - parity mini sidebar con shell Hydro live.
   Dal confronto con il live Hydro: la sidebar resta un blocco fixed autonomo,
   mentre il contenitore pagina non deve dipingere una seconda fascia sotto/accanto
   al menu mini. Nel DOM target #page-wrapper avvolge sidebar + contenuto; in mini
   lo spostiamo dopo la colonna da 70px e azzeriamo il margin-left interno. */
@media (min-width: 992px) {
    body.forced-left-mini #page-wrapper {
        width: calc(100% - var(--sidebar-mini-width)) !important;
        margin-left: var(--sidebar-mini-width) !important;
        margin-right: 0 !important;
        background-color: var(--page-content-bg) !important;
    }

    body.forced-left-mini #page-right-content {
        margin-left: 0 !important;
        border-left: 6px solid var(--border-page) !important;
    }

    body.forced-left-mini .sidebar-navigation {
        left: 0 !important;
        margin-left: 0 !important;
        width: var(--sidebar-mini-width) !important;
        background-color: var(--sidebar-bg) !important;
    }

    body.forced-left-mini .navbar-default,
    body.forced-left-mini .topbar .topbar-left,
    body.forced-left-mini .topbar-left {
        margin-left: 0 !important;
    }

    body.forced-left-mini .navbar-default {
        margin-left: var(--sidebar-mini-width) !important;
    }
}

/* Fase 5.80.5.7 - allineamento DOM shell mini al live Hydro.
   Il live non usa un wrapper pagina offsettato attorno a sidebar+content:
   la sidebar fixed occupa 70px/240px e il contenuto si sposta con margin-left.
   Questo evita che #page-wrapper generi una fascia bianca aggiuntiva in mini. */
@media (min-width: 992px) {
    body.forced-left-mini #page-wrapper {
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        background: transparent !important;
        padding-top: 0 !important;
    }

    body.forced-left-mini .page-contentbar {
        margin-left: 0 !important;
        background: transparent !important;
    }

    body.forced-left-mini #page-right-content {
        margin-left: var(--sidebar-mini-width) !important;
        padding-top: 90px !important;
        border-left: 6px solid var(--border-page) !important;
    }

    body.forced-left-mini .sidebar-navigation {
        left: 0 !important;
        margin-left: 0 !important;
        width: var(--sidebar-mini-width) !important;
    }

    body.forced-left-mini .navbar-default {
        margin-left: var(--sidebar-mini-width) !important;
    }
}

@media (min-width: 992px) {
    body:not(.forced-left-mini) #page-wrapper {
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        background: transparent !important;
        padding-top: 0 !important;
    }

    body:not(.forced-left-mini) #page-right-content {
        margin-left: var(--sidebar-width) !important;
        padding-top: 90px !important;
        border-left: 6px solid var(--border-page) !important;
    }
}

/* ==========================================================================
   Fase 5.80.5.9 - Sidebar/logo runtime parity Hydro
   Note:
   - patch validata con probe runtime menu aperto/chiuso
   - non tocca #page-wrapper
   - non tocca #page-right-content
   - non tocca user-details/avatar
   ========================================================================== */

@media (min-width: 992px) {
    /* Menu aperto: logo grande visibile, logo piccolo nascosto */
    body:not(.forced-left-mini) .topbar .logo .logo-sm,
    body:not(.forced-left-mini) .topbar .logo .logo-sm-img,
    body:not(.forced-left-mini) .topbar .logo .logo-sm-text,
    body:not(.forced-left-mini) .topbar .logo .logo-hydro-fallback {
        display: none !important;
    }

    body:not(.forced-left-mini) .topbar .logo .logo-lg,
    body:not(.forced-left-mini) .topbar .logo .logo-lg-img,
    body:not(.forced-left-mini) .topbar .logo .logo-lg-text {
        display: inline-block !important;
    }

    /* Menu chiuso: logo grande nascosto */
    body.forced-left-mini .topbar .logo .logo-lg,
    body.forced-left-mini .topbar .logo .logo-lg-img,
    body.forced-left-mini .topbar .logo .logo-lg-text {
        display: none !important;
    }

    /* Menu chiuso: topbar mini allineata a Hydro */
    body.forced-left-mini .topbar {
        height: 70px !important;
    }

    body.forced-left-mini .topbar-left {
        width: 70px !important;
        height: 55px !important;
        min-height: 55px !important;
        overflow: hidden !important;
        padding-left: 15px !important;
    }

    body.forced-left-mini .topbar-left .logo {
        display: inline !important;
        width: 55px !important;
        height: 40px !important;
        line-height: 40px !important;
        margin: 0 !important;
        padding: 0 !important;
        background: transparent !important;
        background-color: transparent !important;
        box-shadow: none !important;
    }

    body.forced-left-mini .topbar .logo img.logo-sm-img {
        display: block !important;
        width: 40px !important;
        height: 40px !important;
        max-width: 40px !important;
        max-height: 40px !important;
        margin: 15px auto 0 auto !important;
        object-fit: contain !important;
        background: transparent !important;
        background-color: transparent !important;
        box-shadow: none !important;
    }

    body.forced-left-mini .navbar-default {
        height: 70px !important;
        min-height: 70px !important;
    }

    /* Override forte: neutralizza il background bianco forzato dai blocchi 5.80.5.4 */
    html body.forced-left-mini .topbar .topbar-left,
    html body.forced-left-mini div.topbar div.topbar-left,
    html body.forced-left-mini .navbar .topbar-left,
    html body.forced-left-mini .navbar-default .topbar-left {
        background: transparent !important;
        background-color: transparent !important;
        box-shadow: none !important;
    }

    html body.forced-left-mini .topbar .topbar-left .logo,
    html body.forced-left-mini .topbar .topbar-left .logo-sm,
    html body.forced-left-mini .topbar .topbar-left .logo-sm-img {
        background: transparent !important;
        background-color: transparent !important;
        box-shadow: none !important;
    }
}

/* ============================================================================
   Fase 5.80.10 - Mobile parity Hydro: logo mini topbar + lista installazioni
   ----------------------------------------------------------------------------
   Correzioni mirate:
   - su mobile il blocco topbar-left non deve restare bianco in forced-left-mini;
     deve fondersi con la topbar Hydro (#f5f5f5), come nel live.
   - la lista installazioni deve avere overflow orizzontale controllato e colonne
     stabili, senza tagliare la tabella dentro la card.
   ============================================================================ */
@media (max-width: 991px) {
    html body.forced-left-mini .topbar .topbar-left,
    html body.forced-left-mini div.topbar div.topbar-left,
    html body.forced-left-mini .topbar-left {
        background: var(--topbar-bg, #f5f5f5) !important;
        background-color: var(--topbar-bg, #f5f5f5) !important;
        width: var(--sidebar-mini-width, 70px) !important;
        height: var(--topbar-height, 70px) !important;
        min-height: var(--topbar-height, 70px) !important;
        overflow: hidden !important;
        padding: 0 !important;
        box-shadow: none !important;
    }

    html body.forced-left-mini .topbar .topbar-left .logo {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: var(--sidebar-mini-width, 70px) !important;
        height: var(--topbar-height, 70px) !important;
        line-height: var(--topbar-height, 70px) !important;
        margin: 0 !important;
        padding: 0 !important;
        background: transparent !important;
        background-color: transparent !important;
        box-shadow: none !important;
    }

    html body.forced-left-mini .topbar .logo .logo-lg,
    html body.forced-left-mini .topbar .logo .logo-lg-img,
    html body.forced-left-mini .topbar .logo .logo-lg-text {
        display: none !important;
    }

    html body.forced-left-mini .topbar .logo .logo-sm,
    html body.forced-left-mini .topbar .logo .logo-sm-img,
    html body.forced-left-mini .topbar .logo .logo-sm-text {
        display: block !important;
    }

    html body.forced-left-mini .topbar .logo img.logo-sm-img {
        width: 34px !important;
        height: 34px !important;
        max-width: 34px !important;
        max-height: 34px !important;
        margin: 0 !important;
        object-fit: contain !important;
        background: transparent !important;
        background-color: transparent !important;
        box-shadow: none !important;
    }
}

.installazioni-lista-page .table-responsive {
    width: 100%;
    overflow-x: auto !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch;
}

.installazioni-lista-page #dt-installazioni {
    width: 100% !important;
}

@media (max-width: 767px) {
    .installazioni-lista-page {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    .installazioni-lista-page .card-box {
        overflow: visible !important;
    }

    .installazioni-lista-page #filtro-provincia,
    .installazioni-lista-page #filtro-citta,
    .installazioni-lista-page #filtro-scadenza,
    .installazioni-lista-page #filtro-stato {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }

    .installazioni-lista-page #installazioni-static-controls .col-sm-6 {
        width: 100% !important;
        float: none !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-bottom: 8px;
    }

    .installazioni-lista-page #installazioni-static-controls .dataTables_filter {
        text-align: right !important;
    }

    .installazioni-lista-page #installazioni-static-search {
        width: 200px !important;
        max-width: 100% !important;
    }

    .installazioni-lista-page #dt-installazioni {
        min-width: 710px !important;
        table-layout: fixed !important;
        margin-bottom: 8px !important;
    }

    .installazioni-lista-page #dt-installazioni th,
    .installazioni-lista-page #dt-installazioni td {
        padding: 9px 10px !important;
        font-size: 12.5px !important;
        vertical-align: middle !important;
    }

    .installazioni-lista-page #dt-installazioni th:nth-child(1),
    .installazioni-lista-page #dt-installazioni td:nth-child(1) { width: 120px !important; }
    .installazioni-lista-page #dt-installazioni th:nth-child(2),
    .installazioni-lista-page #dt-installazioni td:nth-child(2) { width: 90px !important; }
    .installazioni-lista-page #dt-installazioni th:nth-child(3),
    .installazioni-lista-page #dt-installazioni td:nth-child(3) { width: 150px !important; }
    .installazioni-lista-page #dt-installazioni th:nth-child(4),
    .installazioni-lista-page #dt-installazioni td:nth-child(4) { width: 90px !important; }
    .installazioni-lista-page #dt-installazioni th:nth-child(5),
    .installazioni-lista-page #dt-installazioni td:nth-child(5) { width: 80px !important; }
    .installazioni-lista-page #dt-installazioni th:nth-child(6),
    .installazioni-lista-page #dt-installazioni td:nth-child(6) { width: 70px !important; }
    .installazioni-lista-page #dt-installazioni th:nth-child(7),
    .installazioni-lista-page #dt-installazioni td:nth-child(7) { width: 50px !important; }

    .installazioni-lista-page .user-name-text {
        display: inline-block;
        max-width: 100%;
        overflow-wrap: anywhere;
    }
}

/* ============================================================================
   Fase 5.80.11 - Mobile drawer z-index definitivo
   ----------------------------------------------------------------------------
   Corregge il bug mobile visto anche nel live Hydrometal:
   - quando il menu laterale e' aperto, la topbar non deve restare sopra overlay;
   - la sidebar deve stare sopra overlay e topbar;
   - il backdrop deve coprire anche la topbar e bloccare i click sul contenuto;
   - il pulsante di chiusura deve restare sempre cliccabile.
   ============================================================================ */
@media (max-width: 991px) {
    html body.nav-collapse {
        overflow: hidden !important;
    }

    html body.nav-collapse .topbar {
        z-index: 1000 !important;
    }

    html body.nav-collapse::before {
        content: '' !important;
        position: fixed !important;
        top: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        left: 0 !important;
        background: rgba(0, 0, 0, 0.55) !important;
        z-index: 1090 !important;
        pointer-events: auto !important;
    }

    html body.nav-collapse .sidebar-navigation,
    html body.forced-left-mini.nav-collapse .sidebar-navigation {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        margin-left: 0 !important;
        width: var(--sidebar-width, 260px) !important;
        max-width: calc(100vw - 48px) !important;
        z-index: 1100 !important;
        box-shadow: 7px 8px 24px rgba(0, 0, 0, 0.24) !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    html body.nav-collapse .sidebar-navigation .btn-mobile-view,
    html body.nav-collapse .sidebar-navigation .close,
    html body.nav-collapse .sidebar-navigation [data-toggle="collapse"],
    html body.nav-collapse .sidebar-navigation button {
        position: relative;
        z-index: 1110 !important;
    }

    html body.nav-collapse #page-right-content,
    html body.nav-collapse .navbar-default,
    html body.nav-collapse .topbar .topbar-left {
        pointer-events: none !important;
    }

    html body.nav-collapse .sidebar-navigation,
    html body.nav-collapse .sidebar-navigation * {
        pointer-events: auto !important;
    }
}

/* ============================================================================
   41. LAYOUT SHELL + DETTAGLIO INSTALLAZIONI — normalizzazioni Hydro
   Fase 5.80.13.38
   ============================================================================ */

.page-contentbar-reset { margin-left: 0; }
.sidebar-mobile-close-icon { font-size: 20px; }
.topbar-sede-toggle { display: flex !important; align-items: center; gap: 6px; padding: 0 12px !important; }
.topbar-sede-icon { font-size: 18px !important; }
.topbar-sede-label { font-size: 12px; font-weight: 600; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-sede-chevron { font-size: 14px !important; }
.topbar-sede-menu { min-width: 200px; }
.footer-powered { font-size: 10px; }

@media (max-width: 991px) {
    .sidebar-navigation,
    body.forced-left-mini .sidebar-navigation {
        margin-left: -2200px !important;
        width: 240px !important;
        top: var(--topbar-height) !important;
        z-index: 99 !important;
    }

    body.nav-collapse .sidebar-navigation,
    body.nav-collapse.forced-left-mini .sidebar-navigation {
        margin-left: 0 !important;
    }

    #page-right-content,
    body.forced-left-mini #page-right-content {
        margin-left: 0 !important;
        padding: 70px 8px 20px 8px !important;
        border-left: none !important;
    }

    .navbar-default,
    body.forced-left-mini .navbar-default {
        margin-left: 0 !important;
    }

    .topbar .topbar-left,
    body.forced-left-mini .topbar .topbar-left {
        width: 55px !important;
        overflow: hidden !important;
    }

    .topbar .topbar-left .logo .logo-lg,
    .topbar .topbar-left .logo .logo-lg-img,
    body.forced-left-mini .topbar .topbar-left .logo .logo-lg,
    body.forced-left-mini .topbar .topbar-left .logo .logo-lg-img {
        display: none !important;
    }

    .topbar .topbar-left .logo .logo-sm,
    .topbar .topbar-left .logo .logo-sm-img {
        display: inline-block !important;
        width: 36px !important;
        height: 36px !important;
        object-fit: contain !important;
    }

    body.nav-collapse::after {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.45);
        z-index: 98;
        pointer-events: none;
    }
}

.installazioni-dettaglio-page .card-box {
    border: 0;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 20px;
}

.installazioni-dettaglio-page .panel-fill {
    border: 1px solid var(--border-light);
    box-shadow: none;
}

.installazioni-dettaglio-page .panel-heading {
    margin: 0;
    border-radius: var(--radius-card) var(--radius-card) 0 0;
}

.installazioni-dettaglio-page .detail-action-row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

@media (max-width: 767px) {
    .installazioni-dettaglio-page .card-box { padding: 12px; }
    .installazioni-dettaglio-page .detail-action-row { justify-content: stretch; }
    .installazioni-dettaglio-page .detail-action-row .btn { width: 100%; margin-left: 0 !important; }
}

/* ============================================================================
   43. IMPOSTAZIONI TEMA HYDRO - controlli colore comuni
   Fase 5.80.13.76: le classi sono comuni al sistema tema/preview e non sono
   un CSS page-only. La pagina /strumenti/impostazioni-tema le usa senza
   caricare asset dedicati.
   ============================================================================ */
:root {
    --color-secondary:       #0d8bc4;
    --color-accent:          #7c3aed;
    --link-color:            var(--brand-color);
    --link-hover-color:      var(--brand-hover);
    --btn-secondary-bg:      var(--btn-default-bg);
    --btn-secondary-border:  var(--btn-default-border);
    --sidebar-text:          var(--menu-text);
    --topbar-text:           var(--menu-text);
    --table-header-bg:       var(--bg-card);
    --table-row-hover-bg:    var(--bg-subtle);
    --badge-state-bg:        var(--color-success);
    --badge-state-light:     var(--color-success-light);
    --badge-state-text:      var(--color-success-text);
    --badge-state-border:    var(--color-success-border);
}

body { background-color: var(--body-bg); color: var(--text-body); }
a.link-brand,
.home-panel-link,
.filter-remove-link.link-brand { color: var(--link-color); }
a.link-brand:hover,
.home-panel-link:hover,
.filter-remove-link.link-brand:hover { color: var(--link-hover-color); }

.navbar-default .navbar-nav.top-navbar-items > li > a,
.topbar .menu-right-item,
.button-menu-mobile,
#btn-toggle-desktop { color: var(--topbar-text) !important; }

.sidebar-navigation,
.sidebar-navigation .user-details .user-info,
.sidebar-navigation .user-details .user-info a,
.sidebar-navigation #sidebar-menu > ul > li > a,
.sidebar-navigation #sidebar-menu ul ul a { color: var(--sidebar-text) !important; }

.btn-default { background-color: var(--btn-secondary-bg) !important; border-color: var(--btn-secondary-border) !important; }
.table-custom thead th { background: var(--table-header-bg) !important; }
.table-custom tbody tr:hover,
.table-custom tbody tr.tema-preview-row-hover { background-color: var(--table-row-hover-bg) !important; }
.badge-gray-style.tema-preview-badge-state { background: var(--badge-state-light); color: var(--badge-state-text); border-color: var(--badge-state-border); }
.alert-success { background-color: var(--color-success-light); border-color: var(--color-success-border); color: var(--color-success-text); }
.alert-warning { background-color: var(--color-warning-light); border-color: var(--color-warning-border); color: var(--color-warning-text); }
.alert-danger { background-color: var(--color-danger-light); border-color: var(--color-danger-border); color: var(--color-danger); }
.alert-info { background-color: var(--color-info-light); border-color: var(--color-info-border); color: var(--color-info); }

.impostazioni-tema-page .tema-control-panel { margin-bottom: 18px; }
.impostazioni-tema-page .tema-picker-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border-light); cursor: pointer; }
.impostazioni-tema-page .tema-picker-row:last-child { border-bottom: 0; }
.impostazioni-tema-page .tema-picker-row:hover { background: var(--bg-subtle); margin-left: -12px; margin-right: -12px; padding-left: 12px; padding-right: 12px; border-radius: var(--radius-card); }
.impostazioni-tema-page .tema-picker-swatch { width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; border: 3px solid rgba(0,0,0,0.08); transition: transform .2s, box-shadow .2s; background: var(--brand-color); }
.impostazioni-tema-page .tema-picker-row:hover .tema-picker-swatch { transform: scale(1.08); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.impostazioni-tema-page .tema-picker-info { flex: 1; min-width: 0; }
.impostazioni-tema-page .tema-picker-label { display: block; margin-bottom: 2px; font-weight: 700; font-size: 14px; color: var(--text-dark); }
.impostazioni-tema-page .tema-picker-desc { font-size: 11px; line-height: 1.35; color: var(--text-muted); }
.impostazioni-tema-page .tema-picker-right { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.impostazioni-tema-page .tema-color-input { width: 44px; height: 44px; border: 1px solid var(--input-border); border-radius: 8px; cursor: pointer; padding: 2px; background: var(--bg-card); outline: none; }
.impostazioni-tema-page .tema-color-input:focus { border-color: var(--input-focus-border); }
.impostazioni-tema-page .tema-hex-value { font-size: 11px; color: var(--text-muted); font-family: monospace; }
.impostazioni-tema-page .tema-actions-box { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.impostazioni-tema-page .preview-btn { pointer-events: none !important; margin: 0 6px 8px 0; }
.impostazioni-tema-page .tema-preview-shell { border: 1px solid var(--border-light); border-radius: var(--radius-card); overflow: hidden; background: var(--bg-page); }
.impostazioni-tema-page .tema-preview-topbar { min-height: 46px; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; background: var(--topbar-bg); color: var(--topbar-text); border-bottom: 1px solid var(--border-light); }
.impostazioni-tema-page .tema-preview-layout { display: grid; grid-template-columns: minmax(150px, 190px) minmax(0, 1fr); }
.impostazioni-tema-page .tema-preview-sidebar { background: var(--sidebar-bg); color: var(--sidebar-text); border-right: 1px solid var(--border-light); padding: 10px; }
.impostazioni-tema-page .tema-preview-menu-item { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 8px; font-size: 13px; color: var(--sidebar-text); }
.impostazioni-tema-page .tema-preview-menu-active { background: linear-gradient(90deg, var(--menu-active-from) 0%, var(--menu-active-to) 100%); color: var(--menu-text-hover) !important; }
.impostazioni-tema-page .tema-preview-menu-hover { background: var(--bg-subtle); }
.impostazioni-tema-page .tema-preview-content { padding: 16px; background: var(--bg-page); }
.impostazioni-tema-page .tema-preview-card { margin-bottom: 0; }
.impostazioni-tema-page .tema-preview-section { padding: 12px 0; border-bottom: 1px solid var(--border-light); }
.impostazioni-tema-page .tema-preview-section:last-child { border-bottom: 0; }
.impostazioni-tema-page .tema-preview-alerts .alert { margin-bottom: 8px; }
.impostazioni-tema-page .tema-preview-table { margin-bottom: 0; }
@media (max-width: 991px) {
    .impostazioni-tema-page .tema-preview-layout { grid-template-columns: 1fr; }
    .impostazioni-tema-page .tema-preview-sidebar { border-right: 0; border-bottom: 1px solid var(--border-light); }
    .impostazioni-tema-page .tema-actions-box .btn { width: 100%; margin-bottom: 4px; }
}

/* ============================================================================
   44. VOCI DI MENU HYDRO - componenti comuni gestione menu
   Fase 5.80.13.77: regole minime riutilizzabili per filtri, ruoli e drawer,
   senza caricare CSS dedicati di pagina.
   ============================================================================ */
.kpi-value-sm { font-size: 22px; line-height: 1.15; color: var(--text-dark); font-weight: 700; }
.menu-voci-page .btn-add-pro { border-radius: 50px !important; padding: 8px 24px !important; display: inline-flex !important; align-items: center; justify-content: center; }
.menu-voci-page .menu-url-code { display: inline-block; margin-top: 5px; color: var(--brand-color); word-break: break-word; }
.menu-voci-page .menu-voci-actions { align-items: center; }
.menu-voci-page .menu-voci-filters .form-control { min-width: 170px; }
.menu-voci-page .menu-voci-roles-box { border: 1px solid var(--border-light); border-radius: var(--radius-card); padding: 16px; margin: 10px 0 0; background: var(--bg-subtle); }
.menu-voci-page .menu-voci-roles-box legend { width: auto; margin: 0 0 10px; padding: 0 8px; border: 0; font-size: 13px; font-weight: 700; color: var(--text-dark); }
.hydro-role-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px 14px; }
.hydro-check-line { display: flex !important; align-items: center; gap: 8px; margin: 0; font-weight: 500 !important; color: var(--text-body); }
.hydro-check-line input[type="checkbox"] { margin: 0; flex-shrink: 0; }
@media (max-width: 767px) {
    .menu-voci-page .menu-voci-filters .form-control,
    .menu-voci-page .menu-voci-filters .btn { width: 100%; }
    .menu-voci-page .menu-voci-actions { justify-content: flex-start; }
    .hydro-role-grid { grid-template-columns: 1fr; }
}

/* ============================================================================
   45. AUTH WORKFLOW - componenti comuni per schermate auth gestionali
   Fase 5.80.13.88: estensioni riutilizzabili per pagine auth post-login
   come cambio password obbligatorio, senza CSS dedicati di singola pagina.
   ============================================================================ */
.auth-workflow-content { grid-template-columns: minmax(0, 1fr) minmax(360px, 470px); }
.auth-workflow-stack { max-width: 470px; }
.auth-workflow-panel { padding-top: 38px; }
.auth-workflow-kicker {
    margin: 0 0 14px;
    color: rgba(255, 255, 255, 0.78);
    text-transform: uppercase;
    letter-spacing: 0.13em;
    font-size: 12px;
    font-weight: 700;
    text-shadow: 0 6px 18px rgba(0,0,0,0.18);
}
.auth-help-text {
    margin: -12px 0 24px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 14px;
    line-height: 1.55;
    text-align: center;
}
.auth-help-text strong { color: var(--text-white); font-weight: 700; }
.auth-note { margin: 18px 0 0; color: rgba(255, 255, 255, 0.74); font-size: 14px; line-height: 1.5; }
.auth-note-center { text-align: center; }
.auth-brand-configurable {
    margin: -24px auto -22px;
    padding: 0 10px;
    color: var(--text-white);
}
.auth-brand-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 18px;
    background: var(--brand-color);
    color: var(--text-white);
    font-size: 24px;
    line-height: 1;
    font-weight: 800;
    box-shadow: 0 16px 34px var(--brand-glow);
}
.auth-brand-title {
    max-width: 260px;
    color: rgba(255, 255, 255, 0.86);
    font-size: 12px;
    line-height: 1.25;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-align: center;
    text-transform: uppercase;
    text-shadow: 0 4px 16px rgba(0,0,0,0.22);
}
button.btn-show-pass { font: inherit; }
.btn-show-pass.is-visible { color: #07111f; background: rgba(255,255,255,0.86); }

@media (max-width: 991px) {
    .auth-workflow-content { grid-template-columns: 1fr; }
    .auth-workflow-panel { padding-top: 34px; }
}
@media (max-width: 575px) {
    .auth-brand-title { max-width: 220px; font-size: 11px; }
    .auth-brand-badge { width: 48px; height: 48px; border-radius: 16px; font-size: 21px; }
    .auth-help-text { margin-bottom: 20px; }
}

/* ============================================================================
   46. INTERVENTI - selezione multipla tipi condivisa
   Fase 5.80.13.125: pill checkbox accessibili, senza varianti tenant.
   ============================================================================ */
.tipo-pill-list { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 0; }
.tipo-pill-edit { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border: 1px solid var(--border-light); border-radius: 50px; background: var(--bg-subtle); cursor: pointer; font-weight: 400; margin: 0; transition: background .15s, border-color .15s, color .15s; }
.tipo-pill-edit input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.tipo-pill-edit.is-selected { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.tipo-pill-edit:focus-within { box-shadow: 0 0 0 2px rgba(25, 173, 241, .18); }
