/* Excel-style column filters — versione LIGHT (allineata tema gestionale v1.0) */
.filters th { padding: 4px 5px !important; background: #f7f8fc; position: relative; border-bottom: 1px solid #e5e8f0; }
.filter-input {
  width: 100%; box-sizing: border-box;
  background: #fff; border: 1px solid #c8cee0; color: #1a2747;
  padding: 4px 8px; font-size: 11px; border-radius: 6px;
}
.filter-input::placeholder { color: #94a0bd; }
.filter-input:focus { outline: none; border-color: #3b82f6; box-shadow: 0 0 0 2px rgba(59,130,246,0.15); }
.filter-num { text-align: right; }
.filter-btn {
  width: 100%; box-sizing: border-box; cursor: pointer;
  background: #fff; border: 1px solid #c8cee0; color: #1a2747;
  padding: 4px 8px; font-size: 11px; border-radius: 6px; text-align: left;
  transition: border-color 0.15s, background 0.15s;
}
/* v1.49.1: filtro attivo MOLTO più evidente — bottone blu con glow + icona imbuto,
   e l'intera cella del filtro (th) evidenziata di azzurro. */
.filter-btn.active {
  background: #2563eb; color: #fff; border-color: #1d4ed8; font-weight: 700;
  box-shadow: 0 0 0 2px rgba(37,99,235,0.35), 0 1px 4px rgba(37,99,235,0.4);
}
.filters th:has(.filter-btn.active) { background: #dbeafe; box-shadow: inset 0 -2px 0 #2563eb; }
.filter-btn:hover { border-color: #3b82f6; }
/* v1.49.44: evidenzia in BLU la cella del filtro quando è ATTIVO (input di
   testo/numero con un valore inserito), come già per i dropdown attivi — così
   si vede a colpo d'occhio dove è stato messo un filtro. */
.filters th:has(.filter-input:not(:placeholder-shown)) { background: #dbeafe; box-shadow: inset 0 -2px 0 #2563eb; }
.filter-input:not(:placeholder-shown) { background: #eff6ff; border-color: #2563eb; font-weight: 600; }
.filter-pop {
  position: absolute; top: 100%; left: 0; z-index: 9999;
  min-width: 360px; max-width: 520px; width: max-content;
  background: #fff; border: 1px solid #e5e8f0; border-radius: 10px;
  box-shadow: 0 8px 24px rgba(15,29,61,0.15);
  padding: 10px; margin-top: 4px;
}
.filters th:last-child .filter-pop,
.filters th:nth-last-child(-n+2) .filter-pop { left: auto; right: 0; }
.filter-pop .search {
  width: 100%; box-sizing: border-box;
  background: #f7f8fc; border: 1px solid #c8cee0; color: #1a2747;
  padding: 5px 10px; font-size: 11px; border-radius: 6px; margin-bottom: 8px;
}
.filter-pop .search:focus { outline: none; border-color: #3b82f6; }
.filter-pop .all-toggle {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: #1d4ed8; padding: 4px 2px;
  border-bottom: 1px solid #e5e8f0; margin-bottom: 4px; cursor: pointer;
  font-weight: 600;
}
.filter-pop .opts { max-height: 260px; overflow-y: auto; }
.filter-pop .opt {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 2px; font-size: 11px; cursor: pointer; border-radius: 3px;
  color: #1a2747;
}
.filter-pop .opt:hover { background: #f4f6fb; }
.filter-pop .opt input { cursor: pointer; }
.filter-pop .opt span {
  flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.filter-pop .opt .count { color: #94a0bd; font-size: 10px; }
/* v1.49.0/1: dropdown ad albero Anno → Mese (colonne data) */
.filter-pop .tree .tree-year {
  display: flex; align-items: center; gap: 6px;
  padding: 3px 2px; border-radius: 4px;
}
.filter-pop .tree .tree-year:hover { background: #f4f6fb; }
.filter-pop .tree .tree-tog {
  cursor: pointer; width: 16px; text-align: center; color: #2563eb;
  font-size: 12px; user-select: none; flex: 0 0 auto;
}
.filter-pop .tree .tree-ycb { cursor: pointer; flex: 0 0 auto; }
.filter-pop .tree .tree-ylabel {
  flex: 1; min-width: 0; cursor: pointer; user-select: none;
  font-weight: 700; font-size: 12px; color: #1a2747;
  display: flex; align-items: center; gap: 6px;
}
.filter-pop .tree .tree-ylabel .count { color: #94a0bd; font-size: 10px; font-weight: 400; }
.filter-pop .tree .tree-months { margin-left: 24px; }
.filter-pop .tree .tree-months .opt { font-weight: 400; }
.filter-pop .actions {
  display: flex; justify-content: space-between; gap: 6px;
  margin-top: 8px; padding-top: 8px; border-top: 1px solid #e5e8f0;
}
.filter-pop .actions button {
  flex: 1; padding: 6px 10px; font-size: 11px; border-radius: 6px;
  background: #fff; border: 1px solid #c8cee0; color: #1a2747; cursor: pointer;
}
.filter-pop .actions button:hover { background: #f4f6fb; }
.filter-pop .actions button.primary { background: #3b82f6; color: #fff; border-color: #3b82f6; font-weight: 600; }
.filter-pop .actions button.primary:hover { filter: brightness(1.05); }
