@charset "UTF-8";

/* ═══════════════════════════════════════════════════════════════════
   cruscotto.css
   SEZIONE 1 — Classi condivise (tabelle, titoli)
   SEZIONE 2 — Cruscotto (2 colonne, griglia, sidebar)
   ═══════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════════
   SEZIONE 1 — Classi condivise
   ═══════════════════════════════════════════════════════════════════ */

.table_dettaglio {
  width: 100%;
  margin-bottom: 5px;
  font-size: 10px;
  background-color: #fff;
}
.table_dettaglio i {
  font-size: 1.4em;
  color: #233a6b;
  cursor: pointer;
}
.table_dettaglio td {
  padding: 2px;
  line-height: 1.2;
}
.table_dettaglio .btn {
  padding: 2px;
  line-height: 1.2;
}
.table_dettaglio tr {
  border-bottom: 1px solid #ddd;
}
.table_dettaglio a {
  cursor: pointer;
}
.table_dettaglio a:hover i {
  opacity: 0.7;
}
.table_dettaglio tr:hover:not(:first-child) {
  background-color: #eef2fb;
}

.titolo_tabella_dettaglio {
  background-color: #233a6b;
  font-weight: bold;
  color: #fff;
  line-height: 1.4 !important;
  padding: 6px 2px !important;
}

.titolo_color1 {
  background-color: #233a6b !important;
  color: #fff !important;
}
.titolo_color2 {
  background-color: #1771ba !important;
  color: #fff !important;
}
.titolo_color3 {
  background-color: #4caf50 !important;
  color: #fff !important;
}
.titolo_color4 {
  background-color: #3d8a40 !important;
  color: #fff !important;
}
.titolo_color5 {
  background-color: #fd5f26 !important;
  color: #fff !important;
}
.titolo_color6 {
  background-color: #e73e00 !important;
  color: #fff !important;
}
.titolo_color7 {
  background-color: #c7c7c7 !important;
  color: #fff !important;
}
.titolo_color8 {
  background-color: #eaeaea !important;
  color: #5f6e7e !important;
}
.titolo_color9 {
  background-color: #2b323a !important;
  color: #fff !important;
}

/* ═══════════════════════════════════════════════════════════════════
   SEZIONE 2 — Cruscotto
   ═══════════════════════════════════════════════════════════════════ */

#content_cruscotto {
  position: fixed;
  left: 67px;
  right: 5px;
  bottom: 6px;
  top: 68px;
}

#cru_new {
  display: flex;
  gap: 6px;
  width: 100%;
  height: 100%;
}

/* --- Area principale --- */
.cru_main {
  flex: 1;
  min-width: 0;
  position: relative;
  display: grid;
  gap: 6px;
  transition: all 0.25s ease;
}
.cru_main[data-view="grid"] {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}
.cru_main[data-view="full"] {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
}

/* --- Pannelli --- */
.cru_panel {
  display: flex;
  flex-direction: column;
  border: 2px solid #89a4de;
  border-radius: 3px;
  background-color: #f5f5f5;
  overflow: hidden;
  transition: all 0.25s ease;
}
.cru_panel.cru_hidden {
  display: none;
}
.cru_panel.cru_full {
  border-color: #233a6b;
}

.cru_panel_header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  min-height: 30px;
}
.cru_panel_num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  font-size: 11px;
  font-weight: 800;
  background-color: rgba(255, 255, 255, 0.25);
  border-radius: 3px;
  flex-shrink: 0;
}
.cru_panel_title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cru_panel_actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.cru_panel_actions a {
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  font-size: 14px;
  transition: color 0.15s;
}
.cru_panel_actions a:hover {
  color: #fff;
}
.cru_main[data-view="grid"] .cru_panel_actions a:last-child {
  display: none;
}
.cru_main[data-view="full"] .cru_panel_actions a:first-child {
  display: none;
}

.cru_panel_body {
  flex: 1;
  padding: 10px;
  overflow: auto;
}

/* --- Spinner e errore (stati di caricamento AJAX) --- */
.cru_spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 100%;
  min-height: 60px;
  color: #8a9cc4;
  font-size: 12px;
  font-weight: 600;
}
.cru_spinner i {
  font-size: 18px;
}

.cru_error {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 100%;
  min-height: 60px;
  color: #d32f2f;
  font-size: 12px;
  font-weight: 600;
}
.cru_error i {
  font-size: 16px;
}

/* --- Sidebar --- */
.cru_sidebar {
  width: 220px;
  flex-shrink: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 5px;
}

.cru_sbtn {
  width: 200px;
  height: 70px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 2px;
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  transition:
    box-shadow 0.15s ease,
    opacity 0.15s ease;
  flex-shrink: 0;
  opacity: 0.8;
}
.cru_sbtn:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  opacity: 1;
  text-decoration: none;
  color: #fff;
}
.cru_sbtn.cru_sbtn_active {
  opacity: 1;
  box-shadow:
    0 0 0 3px #fff,
    0 0 0 5px #233a6b;
}

.cru_sbtn_num {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  font-size: 13px;
  font-weight: 800;
}
.cru_sbtn i {
  font-size: 24px;
  opacity: 0.9;
}
.cru_sbtn_label {
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  padding: 0 10px;
  line-height: 1.3;
}

.cru_sbtn_grid {
  background-color: #233a6b;
}
.cru_sbtn_grid i {
  font-size: 22px;
}

/* --- Badge, bottoni scadenze --- */
.cru_badge {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 7px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
  color: #fff;
  background-color: #556b9b;
  border-radius: 10px;
  vertical-align: middle;
}

.cru_title_actions {
  float: right;
  margin-bottom: 4px;
}
.cru_btn_sm {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  margin-left: 4px;
  color: #fff;
  background-color: #556b9b;
  border: none;
  border-radius: 3px;
  cursor: pointer;
}
.cru_btn_sm:hover {
  background-color: #233a6b;
}

/* --- Scrollbar --- */
.cru_panel_body::-webkit-scrollbar {
  width: 6px;
}
.cru_panel_body::-webkit-scrollbar-track {
  background: #f0f0f0;
  border-radius: 3px;
}
.cru_panel_body::-webkit-scrollbar-thumb {
  background: #89a4de;
  border-radius: 3px;
}
.cru_panel_body::-webkit-scrollbar-thumb:hover {
  background: #556b9b;
}
.cru_sidebar::-webkit-scrollbar {
  width: 4px;
}
.cru_sidebar::-webkit-scrollbar-track {
  background: transparent;
}
.cru_sidebar::-webkit-scrollbar-thumb {
  background: #89a4de;
  border-radius: 2px;
}

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════ */

@media (max-width: 1200px) {
  .cru_sbtn {
    width: 160px;
    height: 60px;
  }
  .cru_sidebar {
    width: 180px;
  }
}

@media (max-width: 960px) {
  #content_cruscotto {
    left: 0;
  }
  #cru_new {
    flex-direction: column;
  }
  .cru_sidebar {
    width: 100%;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 6px;
    gap: 6px;
  }
  .cru_sbtn {
    width: 100px;
    height: 50px;
    flex-shrink: 0;
  }
  .cru_sbtn_num {
    width: 20px;
    height: 20px;
    font-size: 10px;
    top: 4px;
    left: 4px;
  }
  .cru_sbtn i {
    font-size: 22px;
  }
  .cru_sbtn_label {
    font-size: 9px;
  }
}

@media (max-width: 768px) {
  #content_cruscotto {
    top: 128px;
    left: 0;
  }
  .cru_main[data-view="grid"] {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(4, 1fr);
  }
}

/* ═══════════════════════════════════════════════════════════════════
   SEZIONE 4 — Dashboard Legale (card + tabella)
   ═══════════════════════════════════════════════════════════════════ */

/* ── Layout righe proporzionate ── */
.dl_riga {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
  align-items: stretch;
}
.dl_riga_4_4_4 {
  grid-template-columns: 1fr 1fr 1fr;
}
.dl_riga_3_3_3_3 {
  grid-template-columns: 1fr 1fr 1fr 1fr;
}
.dl_riga_3_3_6 {
  grid-template-columns: 1fr 1fr 2fr;
}
.dl_riga_1_3 {
  grid-template-columns: 1fr 3fr;
}
.dl_riga_full {
  display: block;
  margin-bottom: 14px;
}
/* Riga "Atti": allineata alla riga 2 (che è divisa in 4 colonne uguali).
   5 card su 4 colonne virtuali: atti | media+media | atti_prod | annullati.
   Le 2 medie giornaliere sono contigue al centro e più strette (1fr ciascuna),
   così insieme occupano la stessa larghezza di una colonna normale (2fr). */
.dl_riga_full .dl_cards_grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 2fr 2fr;
  gap: 10px;
}
.dl_riga_full .dl_card {
  flex: initial;
  min-width: 0;
}
/* Riga finale: Tempi (1/2) | Copertura (1/4) | PUNTEGGIO (1/4) */
.dl_riga_tempi_punteggio {
  grid-template-columns: 2fr 1fr 1fr;
}

/* Box SP Ricalcola ieri accanto al dropdown (solo admin) */
/* .dl_sp_box è stato rimosso dalla UI (il suo contenuto è stato inline-ato
 * nel .dl_sel_wrap). La classe è mantenuta qui per retrocompatibilità nel
 * caso venisse usata altrove nel codice. Non ha più stili decorativi. */
.dl_sp_box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.dl_sp_title {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.6px;
  color: #c0392b;
  text-transform: uppercase;
  white-space: nowrap;
}
.dl_sp_title i {
  margin-right: 3px;
}
.dl_sp_btn {
  background: #c0392b;
  color: #fff;
  border: none;
  padding: 5px 12px;
  border-radius: 3px;
  font-weight: 700;
  font-size: 11px;
  cursor: pointer;
}
.dl_sp_btn:hover {
  background: #a93226;
}
.dl_sp_btn i {
  margin-right: 4px;
}
/* Bottone "Esporta XLSX" — variante verde (azione non distruttiva) */
.dl_sp_btn.dl_export_btn {
  background: #1e8449;
}
.dl_sp_btn.dl_export_btn:hover {
  background: #196f3d;
}
/* Bottone "Confronta" — variante blu (analisi/comparazione) */
.dl_sp_btn.dl_cmp_btn {
  background: #2471a3;
}
.dl_sp_btn.dl_cmp_btn:hover {
  background: #1b4f72;
}
.dl_sp_btn.dl_cmp_btn:disabled {
  background: #aab7b8;
  cursor: not-allowed;
}
.dl_sp_btn.dl_cmp_btn:disabled:hover {
  background: #aab7b8;
}
#dl_cmp_count {
  font-size: 10px;
  font-weight: 500;
  margin-left: 3px;
  opacity: 0.9;
}

/* Separatore verticale fra i blocchi del toolbar admin/CdG. Il parent
 * .dl_sp_box ha già gap:8px, quindi qui non serve margin aggiuntivo.
 * Il separatore appare fra due gap (totale ~16px visivi) che distinguono
 * i gruppi logici senza strappare troppo il layout. */
.dl_sp_sep {
  display: inline-block;
  width: 1px;
  height: 22px;
  background: rgba(192, 57, 43, 0.35);
  vertical-align: middle;
}

/* ═══════════════════════════════════════════════════════════
 * Widget "Filtro legali" — pulsante + pannello a discesa
 * ═══════════════════════════════════════════════════════════ */
.dl_cmp_filter_wrap {
  position: relative;
  display: inline-block;
  margin-right: 4px;
}
.dl_sp_btn.dl_cmp_filter_btn {
  background: #2c3e50;
}
.dl_sp_btn.dl_cmp_filter_btn:hover {
  background: #1b2631;
}
.dl_sp_btn.dl_cmp_filter_btn i.fa-caret-down {
  margin-left: 4px;
  margin-right: 0;
}
#dl_cmp_filter_count {
  font-size: 10px;
  font-weight: 500;
  opacity: 0.9;
}
.dl_cmp_filter_panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 2147483000;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  min-width: 320px;
  max-height: 420px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-size: 12px;
}
.dl_cmp_filter_actions {
  padding: 6px 8px;
  border-bottom: 1px solid #e5e7e9;
  background: #f4f6f7;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.dl_cmp_filter_small_btn {
  background: #fff;
  border: 1px solid #aab7b8;
  border-radius: 3px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  color: #2c3e50;
}
.dl_cmp_filter_small_btn:hover {
  background: #eaf2f8;
  border-color: #2471a3;
  color: #2471a3;
}
.dl_cmp_filter_small_btn i {
  margin-right: 4px;
}
.dl_cmp_filter_list {
  overflow-y: auto;
  max-height: 360px;
  padding: 4px 0;
}
.dl_cmp_filter_item {
  display: flex;
  align-items: center;
  padding: 5px 10px;
  cursor: pointer;
  gap: 8px;
  border-bottom: 1px solid #f2f4f4;
  margin: 0;
  font-weight: 400;
  color: #2c3e50;
}
.dl_cmp_filter_item:hover {
  background: #eaf2f8;
}
.dl_cmp_filter_item:last-child {
  border-bottom: none;
}
.dl_cmp_filter_chk {
  width: 14px;
  height: 14px;
  margin: 0;
  cursor: pointer;
  accent-color: #2471a3;
  flex: 0 0 auto;
}
.dl_cmp_filter_name {
  font-weight: 600;
  flex: 0 0 auto;
  white-space: nowrap;
}
.dl_cmp_filter_mail {
  color: #7b8a8b;
  font-size: 11px;
  margin-left: auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════
 * Checkbox di selezione card (feature "Confronta legali")
 * ═══════════════════════════════════════════════════════════ */
.dl_card {
  position: relative; /* ancoraggio per il checkbox absolute */
}
.dl_card_chk_wrap {
  position: absolute;
  top: 4px;
  right: 6px;
  z-index: 2;
  cursor: pointer;
  padding: 2px;
  margin: 0;
  line-height: 1;
}
.dl_card_chk {
  width: 14px;
  height: 14px;
  cursor: pointer;
  margin: 0;
  accent-color: #2471a3;
}

/* ═══════════════════════════════════════════════════════════
 * Modale "Confronta legali"
 * ═══════════════════════════════════════════════════════════ */
.dl_cmp_modal_backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 2147483000; /* sopra la barra applicativa superiore */
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 100px 20px 20px 20px; /* 100px top per non finire sotto la barra */
}
.dl_cmp_modal {
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  max-width: 96vw;
  max-height: calc(100vh - 140px); /* 100 top + 20 bottom + 20 safety */
  width: 96vw;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.dl_cmp_modal_hdr {
  background: #2471a3;
  color: #fff;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
}
.dl_cmp_modal_hdr h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}
.dl_cmp_modal_hdr h4 i {
  margin-right: 6px;
}
.dl_cmp_nsel {
  font-size: 11px;
  font-weight: 500;
  opacity: 0.85;
  margin-left: 8px;
}
.dl_cmp_close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 0 6px;
}
.dl_cmp_close:hover {
  color: #f1b0b7;
}
.dl_cmp_modal_body {
  overflow: auto;
  flex: 1 1 auto;
  padding: 0;
}
.dl_cmp_table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  font-family: Arial, Helvetica, sans-serif;
}
.dl_cmp_table thead th {
  position: sticky;
  top: 0;
  background: #34495e;
  color: #fff;
  font-weight: 700;
  padding: 6px 8px;
  text-align: center;
  border: 1px solid #2c3e50;
  white-space: nowrap;
  z-index: 1;
}
.dl_cmp_table tr.dl_cmp_thead_cols th {
  top: 32px; /* seconda riga sotto alla prima sticky */
  background: #5d6d7e;
  font-weight: 600;
  font-size: 11px;
}
.dl_cmp_table th.dl_cmp_group_hdr {
  background: #2c3e50;
  font-size: 11px;
  letter-spacing: 0.3px;
}
.dl_cmp_table th.dl_cmp_sortable {
  cursor: pointer;
  user-select: none;
}
.dl_cmp_table th.dl_cmp_sortable:hover {
  background: #4a5f77;
}
.dl_cmp_table th.dl_cmp_sortable i.fa {
  margin-left: 4px;
  font-size: 10px;
  opacity: 0.7;
}
.dl_cmp_table tbody td {
  padding: 5px 8px;
  border: 1px solid #e0e6ea;
  text-align: center;
}
.dl_cmp_table tbody td.dl_cmp_td_name {
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
  background: #f8f9fa;
}
.dl_cmp_table tbody td.dl_cmp_td_mail {
  text-align: left;
  white-space: nowrap;
  color: #566573;
  background: #f8f9fa;
  font-size: 11px;
}
.dl_cmp_table tbody tr:hover td {
  background: #eaf2f8;
}
.dl_cmp_table tbody tr:hover td.dl_cmp_td_name,
.dl_cmp_table tbody tr:hover td.dl_cmp_td_mail {
  background: #d4e6f1;
}
.dl_gruppo_spacer {
  min-height: 1px;
  background: transparent;
  border: none;
  box-shadow: none;
}

/* ── Gruppo tematico ── */
.dl_gruppo {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.dl_gruppo_hdr {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 5px 5px 0 0;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #fff;
  margin-bottom: 8px;
  flex-shrink: 0;
}
.dl_gruppo_hdr i {
  font-size: 13px;
}

/* ── Grid card dentro un gruppo ── */
.dl_cards_grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  flex: 1;
}

/* ── Singola card ── */
.dl_card {
  border-radius: 6px;
  padding: 14px 18px;
  flex: 1 1 140px;
  min-width: 130px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.dl_card_val {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.1;
}
.dl_card_pct {
  font-size: 14px;
  font-weight: 600;
  opacity: 0.75;
  margin-left: 3px;
}
.dl_card_lbl {
  font-size: 11px;
  font-weight: 700;
  margin-top: 6px;
  line-height: 1.4;
  word-wrap: break-word;
}
.dl_card_leg {
  font-size: 9px;
  margin-top: 5px;
  opacity: 0.6;
  line-height: 1.4;
}
/* Striscia punteggio: riga piena, ancorata al fondo della card */
.dl_card_punt {
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.3px;
  color: #1e8449;
  background: rgba(39, 174, 96, 0.15);
  border-top: 1px solid rgba(39, 174, 96, 0.35);
  /* spinge verso il fondo nel flex column */
  margin-top: auto;
  /* rompe il padding della card (14px 18px) per occupare la larghezza piena */
  margin-left: -18px;
  margin-right: -18px;
  margin-bottom: -14px;
  padding: 6px 18px;
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
}

/* ── Colori card ── */
.dl_card_alert {
  background: #fdecea;
  color: #c0392b;
  border-left: 5px solid #e74c3c;
}
.dl_card_ok {
  background: #eafaf1;
  color: #1e8449;
  border-left: 5px solid #27ae60;
}
.dl_card_blu {
  background: #eaf0fb;
  color: #1a2f6b;
  border-left: 5px solid #2980b9;
}
.dl_card_verde {
  background: #e8f8f0;
  color: #1a5c38;
  border-left: 5px solid #27ae60;
}
.dl_card_azzurro {
  background: #e8f6f9;
  color: #1a5276;
  border-left: 5px solid #2e86c1;
}
.dl_card_viola {
  background: #fef5e7;
  color: #784212;
  border-left: 5px solid #e67e22;
}
.dl_card_arancione {
  background: #fef5e7;
  color: #784212;
  border-left: 5px solid #e67e22;
}

/* ── Selettore legale ── */
.dl_sel_legale {
  font-size: 12px;
  padding: 5px 10px;
  border: 1px solid #bbc6db;
  border-radius: 4px;
  color: #233a6b;
  background: #fff;
  cursor: pointer;
}
.dl_sel_wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 8px 12px;
  background: #f0f4fb;
  border-radius: 5px;
  border: 1px solid #d5ddf0;
  flex-wrap: wrap;
}
/* Wrap con colorazione Admin/CdG: gradient arancio + bordo rosso
 * (colori ereditati dal vecchio .dl_sp_box che è stato inline-ato). */
.dl_sel_wrap.dl_sel_wrap_admin {
  background: linear-gradient(90deg, #fff5e6, #ffe0b2);
  border: 1px solid #e67e22;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.dl_sel_lbl {
  font-size: 11px;
  font-weight: 700;
  color: #233a6b;
  white-space: nowrap;
}

/* ── Tabella riepilogo ── */
.dl_tbl_wrap {
  overflow-x: auto;
  margin-bottom: 4px;
}
.dl_tbl_wrap table {
  min-width: 1280px;
  font-size: 10px;
}
.dl_tbl_wrap td {
  white-space: nowrap;
}
.dl_alert_td {
  color: #c0392b;
  font-weight: 700;
}
.dl_ok_td {
  color: #27ae60;
}

/* ── Pulsanti periodo ── */
.dl_periodo_wrap {
  display: flex;
  align-items: center;
  gap: 16px;
}
.dl_periodo_btns {
  display: flex;
  gap: 4px;
}
.dl_periodo_btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid #bbc6db;
  border-radius: 4px;
  background: #fff;
  color: #233a6b;
  cursor: pointer;
  min-width: 70px;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.dl_periodo_btn:hover {
  background: #e8edf5;
  border-color: #8a9bc0;
}
.dl_periodo_active {
  font-weight: 800;
  background: #233a6b;
  color: #fff;
  border-color: #233a6b;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}
.dl_periodo_active:hover {
  background: #1a2d55;
}
.dl_refresh_btn {
  min-width: 36px;
  padding: 6px 10px;
  color: #888;
  border-color: #ccc;
}
.dl_refresh_btn:hover {
  color: #c0392b;
  border-color: #c0392b;
  background: #fef5f5;
}
.dl_csv_btn {
  min-width: 60px;
  padding: 6px 12px;
  color: #1a5276;
  border-color: #2e86c1;
  margin-left: 8px;
  gap: 6px;
}
.dl_csv_btn:hover {
  color: #fff;
  background: #2e86c1;
  border-color: #2e86c1;
}

/* ────────────────────────────────────────────────────────────────
   BADGE SORGENTE DATI + CHECKBOX TEMPO REALE
   ──────────────────────────────────────────────────────────────── */

/* Badge "ieri" / "live" accanto ai pulsanti periodo */
.dl_src_badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 10px;
  white-space: nowrap;
  cursor: default;
}
.dl_src_table {
  background: #e8f5e9;
  color: #1b5e20;
  border: 1px solid #a5d6a7;
}
.dl_src_live {
  background: #fff3e0;
  color: #bf360c;
  border: 1px solid #ffcc80;
}

/* Label checkbox "Tempo reale" */
.dl_tr_label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #555;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}
.dl_tr_label input[type="checkbox"] {
  cursor: pointer;
  accent-color: #c0392b;
}
.dl_tr_label:hover {
  color: #c0392b;
}

/* ════════════════════════════════════════════════════════════════
   GUIDA DASHBOARD LEGALE — pulsante "?" e modale pop-up
   ════════════════════════════════════════════════════════════════ */

/* ── Pulsante "?" circolare blu ── */
.dl_btn_guida {
  position: absolute;
  top: 8px;
  right: 10px;
  background: #2980b9;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  transition: background 0.2s;
  z-index: 10;
}
.dl_btn_guida:hover {
  background: #5dade2;
}

/* ── Pulsante guida grande (inline dopo il refresh) ── */
.dl_btn_guida_big {
  background: #2980b9;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  transition: background 0.2s;
  margin-left: 8px;
  padding: 0;
}
.dl_btn_guida_big:hover {
  background: #5dade2;
}

/* ── Overlay scuro dietro la modale ── */
.guida-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 99999;
  align-items: center;
  justify-content: center;
}
.guida-overlay.aperto {
  display: flex;
}

/* ── Finestra modale ── */
.guida-modale {
  background: #fff;
  border-radius: 10px;
  max-width: 90%;
  width: 90%;
  /* altezza body gestita via JS: guida_apri() setta max-height */
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

/* ── Header blu (non comprimibile) ── */
.guida-header {
  background: linear-gradient(135deg, #1f618d, #2980b9);
  color: #fff;
  padding: 16px 20px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex-shrink: 0;
}
.guida-header h2 {
  font-size: 16px;
  font-weight: 700;
  flex: 1;
  margin: 0;
  padding: 0;
  min-height: 0;
  line-height: 1.3;
  background-color: transparent !important;
  background: transparent !important;
  color: #fff !important;
  margin-bottom: 0 !important;
}
.guida-header p {
  font-size: 11px;
  opacity: 0.85;
  margin-top: 3px;
  padding: 0 !important;
  margin-bottom: 0 !important;
}

/* ── Bottone chiudi ✕ ── */
.guida-chiudi {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #fff;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s;
}
.guida-chiudi:hover {
  background: rgba(255, 255, 255, 0.4);
}

/* ── Corpo scrollabile ── */
.guida-body {
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  /* max-height impostato in px da guida_apri() per scroll affidabile */
}

/* ── Testo introduttivo ── */
.guida-intro {
  background: #eaf2f8;
  border-left: 4px solid #2980b9;
  padding: 12px 14px;
  border-radius: 0 6px 6px 0;
  font-size: 12.5px;
  line-height: 1.6;
  color: #444;
}

/* ── Nota gialla ── */
.guida-nota {
  font-size: 11px;
  color: #666;
  background: #fffde7;
  border: 1px solid #f9ca24;
  border-radius: 5px;
  padding: 8px 12px;
  line-height: 1.5;
}

/* ── Sezione con intestazione colorata ── */
.guida-sezione {
  border-radius: 8px;
  border: 1px solid #e0e0e0;
}
.guida-sezione-header {
  padding: 9px 14px;
  font-weight: 700;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.guida-sezione-header .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Palette sezioni */
.sez-grigio .guida-sezione-header {
  background: #ecf0f1;
  color: #555;
}
.sez-grigio .dot {
  background: #7f8c8d;
}
.sez-blu .guida-sezione-header {
  background: #d6eaf8;
  color: #1a5276;
}
.sez-blu .dot {
  background: #2980b9;
}
.sez-azzurro .guida-sezione-header {
  background: #d0e8f7;
  color: #1a5276;
}
.sez-azzurro .dot {
  background: #2e86c1;
}
.sez-rosso .guida-sezione-header {
  background: #fadbd8;
  color: #922b21;
}
.sez-rosso .dot {
  background: #e74c3c;
}
.sez-arancio .guida-sezione-header {
  background: #fdebd0;
  color: #7e5109;
}
.sez-arancio .dot {
  background: #e67e22;
}
.sez-giallo .guida-sezione-header {
  background: #fef9e7;
  color: #7d6608;
}
.sez-giallo .dot {
  background: #f1c40f;
}
.sez-verde .guida-sezione-header {
  background: #d5f5e3;
  color: #1e8449;
}
.sez-verde .dot {
  background: #27ae60;
}
.sez-viola .guida-sezione-header {
  background: #d6eaf8;
  color: #1a5276;
}
.sez-viola .dot {
  background: #2980b9;
}
.sez-navy .guida-sezione-header {
  background: #d6eaf8;
  color: #1a5276;
}
.sez-navy .dot {
  background: #1a5276;
}

/* ── Righe descrittive campo/valore ── */
.guida-col-lista {
  padding: 0;
}
.guida-col-item {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 8px;
  padding: 9px 14px;
  border-top: 1px solid #f0f0f0;
  line-height: 1.5;
  align-items: start;
}
.guida-col-item:first-child {
  border-top: none;
}
.guida-col-item:nth-child(even) {
  background: #fafafa;
}
.guida-col-nome {
  font-weight: 700;
  font-size: 11.5px;
  color: #222;
  word-break: break-word;
}
.guida-col-desc {
  font-size: 12px;
  color: #555;
  line-height: 1.55;
}
.guida-col-desc strong {
  color: #c0392b;
}
.guida-col-desc em {
  color: #1e8449;
  font-style: normal;
  font-weight: 600;
}

/* ── Leggenda colori card ── */
.guida-leggenda {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: #f5f5f5;
}
.leg-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #444;
}
.leg-box {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
}
.leg-box-verde {
  background: #27ae60;
}
.leg-box-rosso {
  background: #e74c3c;
}
.leg-box-blu {
  background: #2980b9;
}
.leg-box-azzurro {
  background: #2e86c1;
}
.leg-box-viola {
  background: #e67e22;
}
.leg-box-arancione {
  background: #e67e22;
}

/* ── Badge inline ── */
.badge-n {
  display: inline-block;
  background: #e74c3c;
  color: #fff;
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 10px;
  font-weight: 700;
  margin-right: 3px;
}
.badge-pct {
  display: inline-block;
  background: #2980b9;
  color: #fff;
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 10px;
  font-weight: 700;
  margin-right: 3px;
}
.badge-verde {
  display: inline-block;
  background: #27ae60;
  color: #fff;
  border-radius: 3px;
  padding: 1px 6px;
  font-size: 10px;
  fo