/* ===============================
   GENERALE E CONTAINER
   =============================== */
.tableRank-container {
  margin: 20px auto;
  padding: 15px;
  background: var(--white);
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

/* ===============================
   TABELLE
   =============================== */
table, th, td {
  border: 1px solid #ddd;
  border-collapse: collapse;
  text-align: center;
  color: #000;
  overflow: hidden;
  text-overflow: ellipsis;
}
th, td {
  padding: 8px 12px;
  text-align: left;
}

th {
  background: #1f4765;
  color: #fff;
  text-align: center;
}

tr:nth-child(even) {
  background: #f9f9f9;
}

/* Celle cliccabili */
td.nom {
  color: #1f4765;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.2s, text-decoration 0.2s;
}
td.nom:hover {
  color: #0056b3;
  text-decoration: underline;
}

.noNom, .noNom:hover {
  color: #1f4765 !important;
  text-decoration: none !important;
  transition: color 0.2s, text-decoration 0.2s !important;
}
.form-row label.after {
    display: block;
    font-size: 1rem;
    opacity: 1;
    font-weight: 800;
    margin-top: 5px;
    font-variant: all-small-caps;
}
.form-buttons{
    text-align: center;
}
/* Stato annullato */
.annullato {
  color: #ffffff !important;
  background-color: #ff0000 !important;
}
.eliminazione {
  color: #ffffff !important;
  background-color: #ff0000 !important;
}
.eliminazione td {
  color: #ffffff !important;
  background-color: #ff0000 !important;
}
.badge-annullato {
  background-color: var(--danger);
  color: #fff;
  font-size: 0.75rem;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 6px;
  margin-left: 8px;
  vertical-align: middle;
}

/* ===============================
   FILTRI E BOTTONI
   =============================== */
.filter-container {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 15px;
  background: #f0f0f0;
  padding: 15px;
  border-radius: 8px;
  align-items: center;
}
.filter-item label.active {
	background-color: #007bff;
	color: white;
	padding: 2px 6px;
	border-radius: 5px;
	transition: background-color 0.2s;
}
.filter-item {
  display: flex;
  flex-direction: column;
  font-size: 14px;
}
.filter-item label {
  font-weight: bold;
  margin-bottom: 4px;
}
.filter-item input {
  padding: 6px 10px;
  border-radius: 4px;
  border: 1px solid #ccc;
}

.btnAdd {
  background-color: #1c5d99;
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.2s;
}
.btnAdd:hover {
  background-color: #14446f;
}

/* ===============================
   ICONE
   =============================== */
.iconListEdit, .iconListDel, .iconList {
  cursor: pointer;
  margin: 0 6px;
  font-size: 1.2rem;
  color: var(--primary);
  transition: color 0.2s;
}
.iconListEdit:hover { color: #007bff; }
.iconListDel:hover { color: var(--danger); }

.labelTVerde { color: #076702; font-weight: bold; }
.labelTArancio { color: #ff6113; font-weight: bold; }

/* ===============================
   CARDS MOBILE
   =============================== */
.mobile-cards { display: none; }
.uscita-card { display: none; }

.fade-in-row { animation: fadeInRow 0.4s ease forwards; }

.data-card {
  background: var(--white);
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.25s ease;
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
}
.data-card.fade-in { animation: fadeInUp 0.4s ease forwards; }

.data-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}
.data-card.highlight-delete {
  border: 2px solid var(--danger);
  background: #ff000026;
  box-shadow: 0 0 10px rgba(220, 53, 69, 0.3);
}

/* ===============================
   POPUP QUOTA / CONFERMA
   =============================== */
.popupConfirm {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.55);
  z-index: 9000;
  justify-content: center;
  align-items: flex-start;
  overflow-y: auto;
  padding: 40px 0;
}
.popupConfirm-content {
  background: var(--white);
  border-radius: 12px;
  padding: 20px 30px;
  margin: auto;
  max-width: 800px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  animation: fadeInScale 0.25s ease;
  color: #444;
  font-size: 14px;
}
.popupConfirm-content h3 {
  margin-top: 0;
  color: #1c5d99;
}
.saved-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.55);
  z-index: 9000;
  justify-content: center;
  align-items: flex-start;
  overflow-y: auto;
  padding: 40px 0;
}
.saved-overlay-content {
  background: var(--white);
  border-radius: 12px;
  padding: 20px 30px;
  margin: auto;
  max-width: 800px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  animation: fadeInScale 0.25s ease;
  color: var(--success);
  font-size: 14px;
}
.saved-overlay-content h3 {
  margin-top: 0;
  color: var(--success);
}
.popup-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 20px;
}
.btnPopup {
  padding: 8px 18px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: bold;
  transition: 0.2s;
}
.btnPopup.primary {
  background-color: var(--success);
  color: #fff;
}
.btnPopup.primary:hover {
  background-color: #218838;
}
.btnPopup.secondary {
  background-color: var(--gray);
  color: #333;
}
.btnPopup.secondary:hover {
  background-color: #d6d6d6;
}
.btnPopup.danger {
  background-color: var(--danger);
  color: #fff;
}
.btnPopup.danger:hover {
  background-color: #b02a37;
}

/* Campo input quota */
.inputQuota {
  width: 80%;
  padding: 10px 12px;
  font-size: 1rem;
  border-radius: 10px;
  border: 2px solid #ccc;
  transition: border-color 0.2s, box-shadow 0.2s;
  text-align: center;
}
.inputQuota:focus {
  border-color: var(--primary);
  box-shadow: 0 0 6px rgba(28,65,92,0.4);
  outline: none;
}
.inputQuota.error {
  border-color: var(--danger);
  background-color: #ffecec;
}
.error-msg {
  color: var(--danger);
  font-size: 0.9rem;
  margin-top: 6px;
}
.error-msg.hidden { display: none; }

/* Popup quota box */
.quota-box {
  max-width: 380px;
  width: 90%;
  text-align: center;
  background: var(--white);
  border-radius: 18px;
  padding: 25px 20px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
  animation: popIn 0.25s ease-out;
}

/* ===============================
   TOAST
   =============================== */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--primary);
  color: var(--white);
  padding: 10px 20px;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  display: none;
  z-index: 9000;
}

/* ===============================
   PILL SELECT
   =============================== */
.pill-select {
  position: relative;
  width: 100%;
  max-width: 250px;
}
.pill-input {
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
}
.pill-dropdown {
  display: none;
  position: absolute;
  left: 0;
  width: 100%;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.pill-option {
  padding: 6px 10px;
  cursor: pointer;
}
.pill-option:hover,
.pill-option[aria-selected="true"] {
  background: #1f4765;
  color: #fff;
}
.pill-container {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 5px;
  z-index:1;
}
.pill {
  background: #1f4765;
  color: #fff;
  padding: 3px 8px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  font-size: 13px;
}
.pill .remove {
  margin-left: 5px;
  cursor: pointer;
  font-weight: bold;
}
.download-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9000; /* sempre davanti */
  backdrop-filter: blur(3px);
}

/* 🔹 Finestra popup principale */
.download-popup {
  background: #ffffff;
  color: #1c1c1c;
  padding: 20px 25px;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  max-width: 420px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  animation: popupFadeIn 0.25s ease;
  outline: none;
}

/* Titolo */
.download-popup h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: #1f4765;
  margin-bottom: 12px;
  text-align: center;
  border-bottom: 2px solid #1f4765;
  padding-bottom: 6px;
}

/* 🔹 Lista file */
.download-popup .file-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0 18px;
}

.download-popup .file-list a {
  color: #1f4765;
  text-decoration: none;
  padding: 8px 10px;
  background: #f3f8fb;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.2s ease;
  word-break: break-all;
}

.download-popup .file-list a:hover {
  background: #1f4765;
  color: #fff;
}

/* 🔹 Pulsanti in basso */
.download-popup .popup-buttons {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

.download-popup .popup-buttons .btn {
  background: #1f4765;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 18px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.25s ease;
}
/* 🔹 Stile paginazione */
.pagination-container {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin: 10px 0;
}
.pagination-controls {
	display: flex;
	align-items: center;
	gap: 10px;
}
.pagination-controls button {
	padding: 4px 10px;
	border: 1px solid #ccc;
	border-radius: 4px;
	background: #f9f9f9;
	cursor: pointer;
}
.pagination-controls button:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}
.download-popup .popup-buttons .btn:hover {
  background: #2a5e85;
}

/* ------ ✅ BOX DELLE VIE ------ */
.vieListContainer {
    padding: 10px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Ogni riga della via */
.viaItem {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    border: 1px solid #e7e7e7;
    border-radius: 10px;
    padding: 10px 14px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.25s ease;
}

/* Hover + animazione */
.viaItem:hover {
    background: #f7f7f7;
    transform: translateX(2px);
}

/* Parrocchia e via */
.viaPar {
    font-weight: 600;
    color: #444;
    display: block;
}

.viaNome {
    font-size: 14px;
    color: #666;
}

/* Civici */
.viaCiv {
    font-size: 14px;
    font-weight: 500;
    background: #eee;
    padding: 4px 8px;
    border-radius: 6px;
    color: #444;
}

/* Nessun dato */
.no-data {
    padding: 12px;
    text-align: center;
    font-size: 14px;
    color: #666;
}

/* ------ ✅ Animazione slide-down ------ */
.vie-container {
    animation: slideDown 0.25s ease;
}

/* ------ ✅ Bottone Mostra/Nascondi ------ */
.btnlista {
    padding: 4px 10px;
    border: none;
    background: #dfe6ff;
    color: #2a3ba7;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all .2s ease;
}

.btnlista:hover {
    background: #c7d4ff;
}
.uscita-card {
    background: #dfe6ff;
    border-radius: 14px;
    padding: 16px 18px;
    margin-bottom: 14px;

    /* Ombra morbida e diffusa */
    box-shadow:
        0 1px 3px rgba(0,0,0,0.06),
        0 4px 10px rgba(0,0,0,0.05);

    /* Bordo sottilissimo quasi impercettibile */
    border: 1px solid rgba(0,0,0,0.05);

    transition: transform 0.15s ease, box-shadow 0.15s ease;
    cursor: pointer;
}

.uscita-card:hover {
    transform: translateY(-2px);
    box-shadow:
        0 3px 6px rgba(0,0,0,0.10),
        0 8px 20px rgba(0,0,0,0.08);
}

.uscita-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.uscita-codice {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1a2950;
}

.uscita-info {
    font-size: 0.92rem;
    color: #606060;
}
.info {
	color: #000000;
}
.uscita-operatore {
    font-size: 0.92rem;
    color: #2e2e2e;
    font-weight: 600;
}

.uscita-vie {
    margin-top: 12px;
    padding-top: 12px;

    /* Separatore morbido */
    border-top: 1px solid rgba(0,0,0,0.07);
}

.uscita-vie .vieContent {
    font-size: 0.92rem;
    color: #444;
    line-height: 1.4;
}
@media screen and (max-width: 768px) {

  /* Nasconde tabelle grandi */
  .responsive-table, .CTeamTable {
    display: none;
  }

  /* Permette testo a capo */
  th, td {
    white-space: normal !important;
  }

  /* Colonne opzionali nascoste */
  .hide-col-mobile {
    display: none;
  }
  
  .mobile-cards {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
  }

  .uscita-card {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
  }
  .uscita-card .actions {
    align-self: flex-end;
  }
  .data-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 1.25rem;
    border: solid 0.5px var(--gray);
    border-radius: 8px;
    background-color: var(--white);
  }

  .data-card .actions {
    align-self: flex-end;
  }
}
