:root {
  --bs-primary-light: #D6DCD2 !important;
  /* Light primary color */
  --bs-primary: #198754 !important;
  --sidebar-width-desktop: 250px;
  --mobile-nav-height-total: 90px;
  /* Altezza stimata della barra di navigazione mobile combinata */
  --bs-pagination-active-bg: #198754 !important;
  /* Colore di sfondo attivo della paginazione */
  --bs-pagination-active-color: #ffffff !important;
  /* Colore del testo attivo della paginazione */
  --bs-pagination-bg: #D6DCD2 !important;
  /* Colore di sfondo della paginazione */
  --bs-pagination-active-border-color: #198754 !important;
  /* Colore del bordo attivo della paginazione */
  --bs-primary-rgb: #198754 !important;
  --nude: #EAD8C8;
  /* colore nude */
  --nude-ink: #5A3E36;
}

.text.primary {
  color: var(--bs-primary) !important;
}

.bg-primary {
  background-color: var(--bs-primary) !important;
}

.input-group-text.nude-addon {
  background-color: var(--bs-primary) !important;
  border-color: var(--bs-primary) !important;
  color: var(--bs-primary) !important;
}


.sfn-text {
  font-family: 'Roboto', Arial, sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: white;
  line-height: 1;
  width: 120 px;
}


.text-primary-custom {
  color: var(--bs-primary) !important;
}

.text-primary-light-custom {
  color: var(--bs-primary-light) !important;
}

.dataTables_processing::after {
  display: none !important;
  content: none !important;
}

.table-custom {
  color: var(--bs-pagination-active-color) !important;
  background-color: var(--bs-pagination-active-bg) !important;
  border-color: none !important;
}

.dataTables_paginate a {
  color: var(--bs-primary) !important;
}

.dataTables_paginate .paginate_button.current {
  color: blue;
}

.dataTables_wrapper .dataTables_paginate .page-item:not(.previous):not(.next) .page-link {
  color: black;
}

.dataTables_length label,
.dataTables_filter label {
  color: var(--bs-primary) !important;
}

.pagination .page-item.active .page-link {
  background-color: var(--bs-primary-light) !important;
  border: 2px solid var(--bs-primary) !important;
}

.pagination {
  justify-content: flex-end !important;
}

.dataTables_filter {
  text-align: right !important;
}

div.dataTables_processing {
  visibility: hidden !important;
  height: 0 !important;
}


th {
  text-align: center !important;
}

#campioniTable td,
#campioniTable th {
  text-align: center;
  /* centramento orizzontale */
  vertical-align: middle;
  /* centramento verticale */
}

.dataTables_processing {
  display: none !important;
}

.loading-row td {
  background-color: #f9f9f9;
  font-weight: bold;
  color: var(--bs-primary);
  font-size: 1rem;
}

#connection-status {
  border-top: 1px solid #dee2e6;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

/* Sposta il pannello di Street View da sinistra a destra */
.gmnoprint[style*="left: 0px"] {
  left: auto !important;
  right: 10px !important;
}

/* Sposta anche il pulsante “Visualizza su Google Maps” se presente */
.gmnoprint[style*="bottom: 0px"][style*="left: 0px"] {
  left: auto !important;
  right: 10px !important;
}

.table-centered td,
.table-centered th {
  text-align: center !important;
  vertical-align: middle !important;
  justify-content: center;
  align-items: center;
}

#map-wrapper {
  position: relative;
}

/* il wrapper deve essere relativo */
#map {
  position: relative;
  z-index: 1;
}

/* la mappa resta sotto */
#geoloc-filters {
  position: absolute;
  top: 12px;
  /* regolalo se hai una topbar */
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  /* sopra al canvas di Google */
}

#exportToast {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  animation: dropIn 0.4s ease-out;
}

.show-error {
  background: rgba(220, 53, 69, 0.9);
  /* rosso Bootstrap */
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 12px 16px;
  color: white;
  font-size: 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  animation: dropIn 0.4s ease-out;
}

.show-warning {
  background: rgba(2, 33, 170, 0.9);
  /* giallo Bootstrap */
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 12px 16px;
  color: white;
  font-size: 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  animation: dropIn 0.4s ease-out;
}

.show-success {
  background: rgba(25, 135, 84, 0.9);
  /* verde Bootstrap */
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 12px 16px;
  color: white;
  font-size: 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  animation: dropIn 0.4s ease-out;
}

@keyframes dropIn {
  0% {
    transform: translateY(-20px) scale(0.8);
    opacity: 0;
  }

  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes dropOut {
  0% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }

  100% {
    transform: translateY(-20px) scale(0.8);
    opacity: 0;
  }
}

/* === Select2 (bootstrap-5) -> look "modern-form-control" (trasparente) === */
.select2-container--bootstrap-5 .select2-selection {
  background: rgba(255, 255, 255, 0.25) !important;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border: 1px solid rgba(0, 0, 0, 0.15) !important;
  border-radius: 5px !important;
  color: var(--bs-dark, #212529) !important;
  box-shadow: none !important;
}

/* altezza coerente con i tuoi input */
.select2-container--bootstrap-5 .select2-selection--single {
  min-height: 38px; /* se vuoi, metti la stessa altezza dei form-control */
  padding: 6px 12px;
}

.select2-container--bootstrap-5 .select2-selection--multiple {
  min-height: 38px;
  padding: 4px 8px;
}

/* placeholder */
.select2-container--bootstrap-5 .select2-selection__placeholder {
  color: rgba(0,0,0,.45) !important;
}

/* X / freccia */
.select2-container--bootstrap-5 .select2-selection__clear,
.select2-container--bootstrap-5 .select2-selection__arrow {
  color: rgba(0,0,0,.6) !important;
}

/* chips (multiple) */
.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice {
  background: rgba(255,255,255,.25) !important;
  border: 1px solid rgba(0,0,0,.15) !important;
  border-radius: 5px !important;
}

/* dropdown */
.select2-container--bootstrap-5 .select2-dropdown {
  background: rgba(255,255,255,.90) !important;
  border: 1px solid rgba(0,0,0,.15) !important;
}


.btn-morg-warning {
  background-color: #dc3545 !important;
  border-color: #dc3545 !important;
  color: white !important;
}
.btn-morg-warning:hover {
  background-color: white !important;
  border-color: #dc3545 !important;
  color: #dc3545 !important;
}

.btn-morg-success-strong {
  background-color: #198754 !important;
  border-color: #198754 !important;
  color: white !important;
}
.btn-morg-success-strong:hover {
  background-color: white !important;
  border-color: #198754 !important;
  color: #198754 !important;
}

 /* Riutilizzo lo stile che già hai nel filtroRicerca.php (versione compatta) */
        .modern-filter-tabs {
          display: inline-flex;
          background: rgba(255, 255, 255, 0.1);
          backdrop-filter: blur(5px);
          -webkit-backdrop-filter: blur(5px);
          border-radius: 8px;
          border: 1px solid rgba(255, 255, 255, 0.2);
          box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
          overflow: hidden;
          cursor: pointer;
        }

        .modern-tab-card {
          flex: 1;
          padding: 10px 30px;
          text-align: center;
          transition: background-color .3s ease, color .3s ease, box-shadow .3s ease;
          color: var(--bs-dark, #212529);
          font-weight: 500;
          position: relative;
          cursor: pointer;
          min-width: 150px;
        }

        .modern-tab-card:hover:not(.active) {
          background-color: rgba(255, 255, 255, .15);
          color: var(--bs-primary, #007bff);
        }

        .modern-tab-card.active {
          background-color: var(--bs-primary, #007bff);
          color: #fff;
          box-shadow: 0 2px 5px rgba(0, 123, 255, .2);
        }

        .modern-tab-title {
          margin: 0;
          font-size: 1em;
          font-weight: inherit;
        }

        .modern-filter-section {
          background: rgba(255, 255, 255, 0.1);
          backdrop-filter: blur(5px);
          -webkit-backdrop-filter: blur(5px);
          border-radius: 8px;
          padding: 20px;
          box-shadow: 0 4px 20px rgba(0, 0, 0, .08);
          border: 1px solid rgba(0, 0, 0, .1);
        }

        .modern-form-label {
          color: var(--bs-dark, #212529);
          font-weight: 500;
          margin-bottom: 5px;
        }

        .modern-form-control {
          background: rgba(255, 255, 255, .25);
          border: 1px solid rgba(0, 0, 0, .15);
          border-radius: 5px;
          padding: 8px 12px;
        }

        .hidden {
          display: none !important;
        }

        .modern-filter-buttons-group.split-50 {
          display: flex;
          width: 100%;
          gap: 10px;
        }

        .modern-filter-buttons-group.split-50 .btn {
          flex: 1 1 0;
          min-width: 0;
          border-radius: 0 !important;
        }

        .modern-filter-buttons-group .btn.modern-filter-btn {
          background-color: rgba(255, 255, 255, 0.1);
          border: none !important;
          border-left: 3px solid transparent;
          color: var(--bs-dark, #212529);
        }

        .modern-filter-buttons-group .btn.modern-btn-danger {
          color: #dc3545 !important;
          border-left-color: #dc3545 !important;
        }

        .modern-filter-buttons-group .btn.modern-btn-primary {
          color: var(--bs-primary) !important;
          border-left-color: var(--bs-primary) !important;
        }

        .modern-filter-buttons-group .btn.modern-btn-danger:hover {
          background: #dc3545 !important;
          color: #fff !important;
          border-left-color: #dc3545 !important;
        }

        .modern-filter-buttons-group .btn.modern-btn-primary:hover {
          background: var(--bs-primary) !important;
          color: #fff !important;
          border-left-color: var(--bs-primary) !important;
        }

        @media (max-width:576px) {
          .modern-filter-buttons-group.split-50 {
            flex-direction: column;
          }
        }


        :root {
  --bs-primary-light: #D6DCD2 !important;
  /* Light primary color */
  --bs-primary: #198754 !important;
  --sidebar-width-desktop: 250px;
  --mobile-nav-height-total: 90px;
  /* Altezza stimata della barra di navigazione mobile combinata */
  --bs-pagination-active-bg: #198754 !important;
  /* Colore di sfondo attivo della paginazione */
  --bs-pagination-active-color: #ffffff !important;
  /* Colore del testo attivo della paginazione */
  --bs-pagination-bg: #D6DCD2 !important;
  /* Colore di sfondo della paginazione */
  --bs-pagination-active-border-color: #198754 !important;
  /* Colore del bordo attivo della paginazione */
  --bs-primary-rgb: #198754 !important;
  --nude: #EAD8C8;
  /* colore nude */
  --nude-ink: #5A3E36;
}

.text.primary {
  color: var(--bs-primary) !important;
}

.bg-primary {
  background-color: var(--bs-primary) !important;
}

.input-group-text.nude-addon {
  background-color: var(--bs-primary) !important;
  border-color: var(--bs-primary) !important;
  color: var(--bs-primary) !important;
}


.sfn-text {
  font-family: 'Roboto', Arial, sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: white;
  line-height: 1;
  width: 120 px;
}


.text-primary-custom {
  color: var(--bs-primary) !important;
}

.text-primary-light-custom {
  color: var(--bs-primary-light) !important;
}

.dataTables_processing::after {
  display: none !important;
  content: none !important;
}

.table-custom {
  color: var(--bs-pagination-active-color) !important;
  background-color: var(--bs-pagination-active-bg) !important;
  border-color: none !important;
}

.dataTables_paginate a {
  color: var(--bs-primary) !important;
}

.dataTables_paginate .paginate_button.current {
  color: blue;
}

.dataTables_wrapper .dataTables_paginate .page-item:not(.previous):not(.next) .page-link {
  color: black;
}

.dataTables_length label,
.dataTables_filter label {
  color: var(--bs-primary) !important;
}

.pagination .page-item.active .page-link {
  background-color: var(--bs-primary-light) !important;
  border: 2px solid var(--bs-primary) !important;
}

.pagination {
  justify-content: flex-end !important;
}

.dataTables_filter {
  text-align: right !important;
}

div.dataTables_processing {
  visibility: hidden !important;
  height: 0 !important;
}


th {
  text-align: center !important;
}

#campioniTable td,
#campioniTable th {
  text-align: center;
  /* centramento orizzontale */
  vertical-align: middle;
  /* centramento verticale */
}

.dataTables_processing {
  display: none !important;
}

.loading-row td {
  background-color: #f9f9f9;
  font-weight: bold;
  color: var(--bs-primary);
  font-size: 1rem;
}

#connection-status {
  border-top: 1px solid #dee2e6;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

/* Sposta il pannello di Street View da sinistra a destra */
.gmnoprint[style*="left: 0px"] {
  left: auto !important;
  right: 10px !important;
}

/* Sposta anche il pulsante "Visualizza su Google Maps" se presente */
.gmnoprint[style*="bottom: 0px"][style*="left: 0px"] {
  left: auto !important;
  right: 10px !important;
}

.table-centered td,
.table-centered th {
  text-align: center !important;
  vertical-align: middle !important;
  justify-content: center;
  align-items: center;
}

#map-wrapper {
  position: relative;
}

/* il wrapper deve essere relativo */
#map {
  position: relative;
  z-index: 1;
}

/* la mappa resta sotto */
#geoloc-filters {
  position: absolute;
  top: 12px;
  /* regolalo se hai una topbar */
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  /* sopra al canvas di Google */
}

#exportToast {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  animation: dropIn 0.4s ease-out;
}

.show-error {
  background: rgba(220, 53, 69, 0.9);
  /* rosso Bootstrap */
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 12px 16px;
  color: white;
  font-size: 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  animation: dropIn 0.4s ease-out;
}

.show-warning {
  background: rgba(2, 33, 170, 0.9);
  /* giallo Bootstrap */
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 12px 16px;
  color: white;
  font-size: 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  animation: dropIn 0.4s ease-out;
}

.show-success {
  background: rgba(25, 135, 84, 0.9);
  /* verde Bootstrap */
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 12px 16px;
  color: white;
  font-size: 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  animation: dropIn 0.4s ease-out;
}

@keyframes dropIn {
  0% {
    transform: translateY(-20px) scale(0.8);
    opacity: 0;
  }

  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes dropOut {
  0% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }

  100% {
    transform: translateY(-20px) scale(0.8);
    opacity: 0;
  }
}

/* === Select2 (bootstrap-5) -> look "modern-form-control" (trasparente) === */
.select2-container--bootstrap-5 .select2-selection {
  background: rgba(255, 255, 255, 0.25) !important;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border: 1px solid rgba(0, 0, 0, 0.15) !important;
  border-radius: 5px !important;
  color: var(--bs-dark, #212529) !important;
  box-shadow: none !important;
}

/* altezza coerente con i tuoi input */
.select2-container--bootstrap-5 .select2-selection--single {
  min-height: 38px;
  padding: 6px 12px;
}

.select2-container--bootstrap-5 .select2-selection--multiple {
  min-height: 38px;
  padding: 4px 8px;
}

/* placeholder */
.select2-container--bootstrap-5 .select2-selection__placeholder {
  color: rgba(0,0,0,.45) !important;
}

/* X / freccia */
.select2-container--bootstrap-5 .select2-selection__clear,
.select2-container--bootstrap-5 .select2-selection__arrow {
  color: rgba(0,0,0,.6) !important;
}

/* chips (multiple) */
.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice {
  background: rgba(255,255,255,.25) !important;
  border: 1px solid rgba(0,0,0,.15) !important;
  border-radius: 5px !important;
}

/* dropdown */
.select2-container--bootstrap-5 .select2-dropdown {
  background: rgba(255,255,255,.90) !important;
  border: 1px solid rgba(0,0,0,.15) !important;
}


.btn-morg-warning {
  background-color: #dc3545 !important;
  border-color: #dc3545 !important;
  color: white !important;
}
.btn-morg-warning:hover {
  background-color: white !important;
  border-color: #dc3545 !important;
  color: #dc3545 !important;
}

.btn-morg-success-strong {
  background-color: #198754 !important;
  border-color: #198754 !important;
  color: white !important;
}
.btn-morg-success-strong:hover {
  background-color: white !important;
  border-color: #198754 !important;
  color: #198754 !important;
}

/* Riutilizzo lo stile che già hai nel filtroRicerca.php (versione compatta) */
.modern-filter-tabs {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  cursor: pointer;
}

.modern-tab-card {
  flex: 1;
  padding: 10px 30px;
  text-align: center;
  transition: background-color .3s ease, color .3s ease, box-shadow .3s ease;
  color: var(--bs-dark, #212529);
  font-weight: 500;
  position: relative;
  cursor: pointer;
  min-width: 150px;
}

.modern-tab-card:hover:not(.active) {
  background-color: rgba(255, 255, 255, .15);
  color: var(--bs-primary, #007bff);
}

.modern-tab-card.active {
  background-color: var(--bs-primary, #007bff);
  color: #fff;
  box-shadow: 0 2px 5px rgba(0, 123, 255, .2);
}

.modern-tab-title {
  margin: 0;
  font-size: 1em;
  font-weight: inherit;
}

.modern-filter-section {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .08);
  border: 1px solid rgba(0, 0, 0, .1);
}

.modern-form-label {
  color: var(--bs-dark, #212529);
  font-weight: 500;
  margin-bottom: 5px;
}

.modern-form-control {
  background: rgba(255, 255, 255, .25);
  border: 1px solid rgba(0, 0, 0, .15);
  border-radius: 5px;
  padding: 8px 12px;
}

.hidden {
  display: none !important;
}

.modern-filter-buttons-group.split-50 {
  display: flex;
  width: 100%;
  gap: 10px;
}

.modern-filter-buttons-group.split-50 .btn {
  flex: 1 1 0;
  min-width: 0;
  border-radius: 0 !important;
}

.modern-filter-buttons-group .btn.modern-filter-btn {
  background-color: rgba(255, 255, 255, 0.1);
  border: none !important;
  border-left: 3px solid transparent;
  color: var(--bs-dark, #212529);
}

.modern-filter-buttons-group .btn.modern-btn-danger {
  color: #dc3545 !important;
  border-left-color: #dc3545 !important;
}

.modern-filter-buttons-group .btn.modern-btn-primary {
  color: var(--bs-primary) !important;
  border-left-color: var(--bs-primary) !important;
}

.modern-filter-buttons-group .btn.modern-btn-danger:hover {
  background: #dc3545 !important;
  color: #fff !important;
  border-left-color: #dc3545 !important;
}

.modern-filter-buttons-group .btn.modern-btn-primary:hover {
  background: var(--bs-primary) !important;
  color: #fff !important;
  border-left-color: var(--bs-primary) !important;
}

@media (max-width:576px) {
  .modern-filter-buttons-group.split-50 {
    flex-direction: column;
  }
}


/* =====================================================
   DARK MODE — stile Dark Reader
   Inverte tutto via filter su <html>, re-inverte media
   ===================================================== */

/* Applica il filtro sull'elemento html.
   min-height + background nero eliminano il "gap bianco"
   che si vede quando html/body non coprono tutto lo schermo. */
html.dark-mode {
  filter: invert(1) hue-rotate(180deg);
  background-color: #000 !important;
  min-height: 100vh !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* body deve essere nero e coprire tutto per non far vedere
   buchi bianchi ai lati/in basso quando il contenuto è corto */
html.dark-mode body {
  background-color: #000 !important;
  min-height: 100vh !important;
  margin: 0 !important;
  padding-left: 0 !important;   /* reset eventuali padding laterali */
  padding-right: 0 !important;
}

/* Re-inverte immagini, video, canvas, iframe e mappe Google
   così tornano visivamente "normali" (non negativi/invertiti) */
html.dark-mode img,
html.dark-mode video,
html.dark-mode iframe,
html.dark-mode canvas,
html.dark-mode svg image,
html.dark-mode .gm-style img,
html.dark-mode .gm-style canvas,
html.dark-mode [style*="background-image"] {
  filter: invert(1) hue-rotate(180deg);
}

/* Transizione fluida su cambio tema */
/* html {
  transition: filter 0.25s ease, background-color 0.25s ease;
} */

/* =====================================================
   DARK MODE — Fix Modal Backdrop
   ===================================================== */

/* Re-inverti backdrop modali */
html.dark-mode .modal-backdrop {
  filter: invert(1) hue-rotate(180deg) !important;
  background: rgba(0,0,0,0.5) !important; /* Forza nero originale */
}

/* Fix anche backdrop show */
html.dark-mode .modal-backdrop.show {
  opacity: 0.5 !important;
  filter: invert(1) hue-rotate(180deg) !important;
}

/* =====================================================
   DARK MODE — reset margini/padding globali
   ===================================================== */

html.dark-mode,
html.dark-mode body {
  margin: 0 !important;
  padding: 0 !important;
}

/* Se usi una topbar fissa solo su mobile, sposta il padding-top nel main */
@media (max-width: 991.98px) {
  html.dark-mode body {
    padding-top: 0 !important;  /* niente padding sul body in dark */
  }

  html.dark-mode main {
    padding-top: 56px !important; /* al posto di body */
  }
}

/* ══════════════════════════════════════════
   MODAL — stile moderno coerente col sito
   Verde primario: #198754
   ══════════════════════════════════════════ */

/* ── Container ── */
.modal-mat,
.modal-notifica {
  border: none;
  border-radius: 20px;
  padding: 1.75rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.13);
  background: #ffffff;
}

/* ── Header: posizione relativa per il btn chiudi ── */
.modal-mat .modal-header,
.modal-notifica .modal-header {
  position: relative;
  align-items: flex-start;
}

/* ── Icona colorata in alto ── */
.mat-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, #198754, #0f5132);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.05rem;
  box-shadow: 0 6px 18px rgba(25, 135, 84, 0.32);
  flex-shrink: 0;
}

.mat-icon-wrap--sm {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  font-size: 0.85rem;
}

/* ── Bottone ✕ ── */
.btn-close-custom {
  position: absolute;
  top: 0;
  right: 0;
  width: 34px;
  height: 34px;
  border: none;
  background: #f4f4f6;
  border-radius: 50%;
  color: #888;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  transition: background 0.2s, color 0.2s;
}
.btn-close-custom:hover {
  background: #e2e2e5;
  color: #333;
}

/* ── Testi ── */
.modal-titolo {
  font-size: 1.2rem;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0.9rem 0 0.2rem;
  letter-spacing: -0.02em;
}
.modal-sottotitolo {
  font-size: 0.82rem;
  color: #9ca3af;
  margin-bottom: 1.4rem;
}

/* ── Gruppi campo ── */
.campo-gruppo {
  margin-bottom: 1.2rem;
}

.campo-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: #374151;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

/* ── Input / Select / Textarea ── */
.campo-input,
.campo-select,
.campo-textarea {
  width: 100%;
  border: 1.5px solid #e5e7eb;
  border-radius: 11px;
  padding: 0.68rem 1rem;
  font-size: 0.9rem;
  color: #1f2937;
  background: #f9fafb;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  outline: none;
  font-family: inherit;
  resize: none;
  -webkit-appearance: none;
  appearance: none;
}

.campo-input:focus,
.campo-select:focus,
.campo-textarea:focus {
  border-color: #198754;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(25, 135, 84, 0.1);
}

/* freccia select custom */
.campo-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239ca3af' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-color: #f9fafb;
  padding-right: 2.5rem;
  cursor: pointer;
}

/* ── Footer ── */
.modal-mat .modal-footer,
.modal-notifica .modal-footer {
  gap: 0.75rem;
  padding-top: 0.4rem;
}

/* ── Bottone Annulla ── */
.btn-annulla {
  flex: 1;
  padding: 0.68rem 1.2rem;
  border: 1.5px solid #e5e7eb;
  border-radius: 11px;
  background: transparent;
  color: #6b7280;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.btn-annulla:hover {
  background: #f3f4f6;
  color: #374151;
  border-color: #d1d5db;
}

/* ── Bottone Salva / Primario ── */
.btn-salva {
  flex: 2;
  padding: 0.68rem 1.5rem;
  border: none;
  border-radius: 11px;
  background: linear-gradient(135deg, #198754, #0f5132);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 5px 16px rgba(25, 135, 84, 0.32);
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn-salva:hover {
  transform: translateY(-1px);
  box-shadow: 0 9px 22px rgba(25, 135, 84, 0.42);
}
.btn-salva:active {
  transform: translateY(0);
  box-shadow: 0 3px 10px rgba(25, 135, 84, 0.25);
}

/* ── Dropzone ── */
.upload-dropzone {
  display: block;
  border: 2px dashed #a3cfbb;
  border-radius: 14px;
  background: #f0fdf4;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.upload-dropzone:hover {
  border-color: #198754;
  background: #d1fae5;
}

.dropzone-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1rem;
  gap: 0.3rem;
  pointer-events: none;
}

.dropzone-icon {
  font-size: 2rem;
  color: #198754;
  margin-bottom: 0.2rem;
}

.dropzone-text {
  font-size: 0.875rem;
  font-weight: 600;
  color: #0f5132;
}

.dropzone-hint {
  font-size: 0.75rem;
  color: #6db993;
}

.upload-dropzone.has-file {
  border-style: solid;
  border-color: #198754;
  background: #d1fae5;
}
.upload-dropzone.has-file .dropzone-icon {
  color: #0f5132;
}

/* ── Sezione Materiali (card laterale) ── */
.mat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
  border-bottom: 1.5px solid #d1e7dd;
}

.mat-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.mat-titolo {
  font-size: 1rem;
  font-weight: 700;
  color: #1a1a2e;
  letter-spacing: -0.01em;
  margin: 0 0 0.1rem;
}

.mat-sottotitolo {
  font-size: 0.75rem;
  color: #9ca3af;
  margin: 0;
}

.mat-add-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.48rem 1rem;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #198754, #0f5132);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(25, 135, 84, 0.28);
  transition: transform 0.15s, box-shadow 0.15s;
}
.mat-add-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 7px 18px rgba(25, 135, 84, 0.38);
}
.mat-add-btn:active {
  transform: translateY(0);
}

.mat-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  padding: 2.5rem 0;
  color: #9ca3af;
  font-size: 0.85rem;
}
.mat-loading i {
  font-size: 1.5rem;
  color: #198754;
  opacity: 0.55;
}

/* ── Editor contenteditable (stile campo-textarea) ── */
.campo-editor {
  width: 100%;
  min-height: 120px;
  border: 1.5px solid #e5e7eb;
  border-radius: 11px;
  padding: 0.68rem 1rem;
  font-size: 0.9rem;
  color: #1f2937;
  background: #f9fafb;
  font-family: inherit;
  white-space: pre-wrap;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.campo-editor:focus {
  border-color: #198754;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(25, 135, 84, 0.1);
}