/*
 * Wizard di importazione. Solo quello che il tema Ynex non dà già: l'indicatore dei
 * passi, la zona di trascinamento e la griglia della mappatura. Tutto il resto
 * (modale, tabelle, badge, alert) resta quello dell'applicazione, perché una modale
 * che assomiglia a un'altra applicazione si nota subito.
 */

/* ── Indicatore dei passi ─────────────────────────────────────────────── */
.yr-wz-passi {
  display: flex;
  align-items: center;
  gap: .25rem;
  margin: 0;
  padding: 0;
  list-style: none;
  width: 100%;
}

.yr-wz-passi li {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex: 1 1 0;
  min-width: 0;
  font-size: .75rem;
  color: var(--text-muted, #8c9097);
}

/* La linea di collegamento è un ::after e non un bordo: con il bordo il primo passo
   avrebbe un trattino a sinistra che parte dal nulla. */
.yr-wz-passi li:not(:last-child)::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: var(--default-border, #e9edf6);
  margin: 0 .25rem;
}

.yr-wz-num {
  flex: 0 0 auto;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: .75rem;
  background: var(--default-background, #f5f6f8);
  color: var(--text-muted, #8c9097);
  border: 1px solid var(--default-border, #e9edf6);
}

.yr-wz-etichetta {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.yr-wz-passi li.attivo {
  color: rgb(var(--primary-rgb));
  font-weight: 600;
}

.yr-wz-passi li.attivo .yr-wz-num {
  background: rgb(var(--primary-rgb));
  border-color: rgb(var(--primary-rgb));
  color: rgb(var(--primary-text-rgb, 255, 255, 255));
}

.yr-wz-passi li.fatto .yr-wz-num {
  background: rgba(var(--primary-rgb), .12);
  border-color: rgba(var(--primary-rgb), .3);
  color: rgb(var(--primary-rgb));
}

/* Sotto i 576px le tre etichette non ci stanno: restano i numeri, che bastano a
   dire a che punto si è. */
@media (max-width: 575.98px) {
  .yr-wz-etichetta { display: none; }
  .yr-wz-passi li { flex: 0 0 auto; }
  .yr-wz-passi li:not(:last-child)::after { flex: 0 0 1.5rem; }
}

/* ── Zona di trascinamento ────────────────────────────────────────────── */
.yr-wz-zona {
  border: 2px dashed var(--default-border, #e9edf6);
  border-radius: .5rem;
  padding: 2rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease;
  background: var(--default-background, #f5f6f8);
}

.yr-wz-zona:hover,
.yr-wz-zona:focus-visible {
  border-color: rgba(var(--primary-rgb), .6);
  background: rgba(var(--primary-rgb), .04);
  outline: none;
}

/* `sopra` la mette il JavaScript su dragenter: senza un cambiamento visibile non si
   capisce se il file è stato preso al volo o rilasciato accanto. */
.yr-wz-zona.sopra {
  border-color: rgb(var(--primary-rgb));
  background: rgba(var(--primary-rgb), .08);
}

.yr-wz-zona-icona {
  display: block;
  font-size: 2rem;
  line-height: 1;
  margin-bottom: .5rem;
  color: rgb(var(--primary-rgb));
}

.yr-wz-scelto {
  margin-top: .85rem;
  padding: .5rem .75rem;
  border-radius: .35rem;
  background: var(--custom-white, #fff);
  border: 1px solid var(--default-border, #e9edf6);
  font-size: .8125rem;
  display: inline-block;
}

/* ── Numeri dell'anteprima e dell'esito ───────────────────────────────── */
.yr-wz-numeri {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: .75rem;
}

.yr-wz-numero {
  padding: .65rem .75rem;
  border: 1px solid var(--default-border, #e9edf6);
  border-radius: .5rem;
  background: var(--default-background, #f5f6f8);
}

/* ── Mappatura colonna → campo ────────────────────────────────────────── */
.yr-wz-mappe {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: .5rem .75rem;
}

.yr-wz-mappa-nome {
  font-size: .6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted, #8c9097);
  margin-bottom: .2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Tabella dell'anteprima ───────────────────────────────────────────── */
.yr-wz-tabella {
  border: 1px solid var(--default-border, #e9edf6);
  border-radius: .5rem;
  max-height: 18rem;
  overflow: auto;
}

.yr-wz-tabella table {
  margin: 0;
  white-space: nowrap;
}

.yr-wz-tabella thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--default-background, #f5f6f8);
  font-size: .6875rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* La riga saltata resta leggibile ma smette di somigliare a un dato che verrà
   importato: il rosso pieno la farebbe sembrare un errore dell'applicazione. */
.yr-wz-saltata td {
  background: rgba(var(--danger-rgb, 230, 83, 60), .05);
  opacity: .85;
}
