/*
 * IMMGO — Écrans de la vente sur plan (équipe) : programme et plan de paiement (01), chantier 3D (03), photos et
 * preuves, calculs, prévu / réel (10), listes de lots (préfixe vsp-)
 * Auteur : Jacks Ngalangala
 */
.vsp-pile-ecran {
  display: flex;
  flex-direction: column;
  gap: var(--e-6);
}
.vsp-carte-tete-actions {
  display: flex;
  align-items: center;
  gap: var(--e-2);
}

/* ---------- 01 : frise du plan de paiement et jalons du chantier ---------- */
.vsp-frise {
  display: grid;
  grid-template-columns: var(--colonnes);
  gap: 6px;
}
.vsp-frise-segment {
  display: flex;
  flex-direction: column;
  gap: var(--e-2);
  min-width: 0;
}
.vsp-frise-barre {
  height: 14px;
  border-radius: var(--r-pilule);
  background: var(--trait);
}
.vsp-frise-segment[data-etat='payee'] .vsp-frise-barre {
  background: var(--or);
}
.vsp-frise-segment[data-etat='appelee'] .vsp-frise-barre {
  background: repeating-linear-gradient(135deg, var(--or) 0 8px, var(--vsp-hachure) 8px 16px);
}
.vsp-frise-pct {
  font-size: var(--taille-titre-3);
  font-weight: var(--graisse-titre);
  font-variant-numeric: tabular-nums;
  margin-top: var(--e-2);
}
.vsp-frise-libelle {
  font-weight: var(--graisse-forte);
  line-height: 1.3;
}
.vsp-frise-detail {
  font-size: var(--taille-petit);
  color: var(--texte-second);
}
.vsp-frise-declencheur {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--taille-legende);
  color: var(--texte-faible);
}
.vsp-frise-declencheur svg {
  width: 16px;
  height: 16px;
  flex: none;
}
.vsp-frise-segment .badge {
  align-self: flex-start;
}
.vsp-jalons-tete {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--e-3);
  margin-top: var(--e-6);
}
.vsp-jalons {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--nb, 10), minmax(0, 1fr));
  padding-top: var(--e-2);
}
.vsp-jalons::before,
.vsp-jalons::after {
  content: '';
  position: absolute;
  left: calc(50% / var(--nb, 10));
  top: calc(var(--e-2) + 9px);
  height: 2px;
}
.vsp-jalons::before {
  right: calc(50% / var(--nb, 10));
  background: var(--trait);
}
.vsp-jalons::after {
  width: calc((100% - 100% / var(--nb, 10)) * var(--fait) / 100);
  background: var(--or);
}
.vsp-jalon {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  padding: 0 2px;
}
.vsp-jalon-point {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--trait-fort);
  background: var(--surface);
  display: grid;
  place-items: center;
}
.vsp-jalon-point svg {
  width: 12px;
  height: 12px;
}
.vsp-jalon[data-etat='validee'] .vsp-jalon-point {
  background: var(--or);
  border-color: var(--or);
  color: var(--surface);
}
.vsp-jalon[data-etat='declaree'] .vsp-jalon-point,
.vsp-jalon[data-etat='en_cours'] .vsp-jalon-point {
  border-color: var(--or);
  box-shadow: 0 0 0 5px var(--or-pale);
}
.vsp-jalon[data-tranche] .vsp-jalon-point {
  border-radius: 6px;
}
.vsp-jalon-libelle {
  font-size: var(--taille-legende);
  font-weight: var(--graisse-forte);
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.vsp-jalon-date {
  font-size: var(--taille-legende);
  color: var(--texte-faible);
}
.vsp-retard {
  color: var(--attention);
  font-size: var(--taille-legende);
  font-weight: var(--graisse-forte);
}
.vsp-legende i.vsp-c-carre,
.vsp-legende i.vsp-c-rond {
  --puce: var(--surface);
  border: 2px solid var(--trait-fort);
}
.vsp-legende i.vsp-c-rond {
  border-radius: 50%;
}

/* ---------- 03 : chantier 3D et étape à valider ---------- */
.vsp-scene-promoteur {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: var(--e-6);
  align-items: start;
}
.vsp-3d-grand {
  height: calc(100vh - var(--hauteur-entete) - 2 * var(--e-8) - 56px);
  min-height: 560px;
}
.vsp-photos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--e-2);
}
.vsp-photo {
  position: relative;
  margin: 0;
  overflow: hidden;
  border-radius: var(--r-moyen);
  aspect-ratio: 4 / 3;
  background: var(--surface-douce);
}
.vsp-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.vsp-photo-tampon {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--r-petit);
  background: rgba(22, 22, 22, 0.72);
  color: var(--surface);
  font-size: 12px;
  font-weight: var(--graisse-moyenne);
  font-variant-numeric: tabular-nums;
}
.vsp-photo-tampon svg {
  width: 12px;
  height: 12px;
  flex: none;
  color: var(--or);
}
.vsp-preuve {
  display: flex;
  gap: var(--e-3);
  align-items: flex-start;
  padding: var(--e-3) var(--e-4);
  border-radius: var(--r-moyen);
  background: var(--succes-pale);
  color: var(--succes);
  font-size: var(--taille-petit);
}
.vsp-preuve svg {
  flex: none;
  width: 20px;
  height: 20px;
}
.vsp-preuve p {
  color: var(--texte);
}
.vsp-calcul {
  display: flex;
  flex-direction: column;
  gap: var(--e-2);
  font-size: var(--taille-petit);
}
.vsp-calcul div {
  display: flex;
  justify-content: space-between;
  gap: var(--e-3);
}
.vsp-calcul span:last-child {
  font-weight: var(--graisse-forte);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.vsp-calcul .vsp-total {
  padding-top: var(--e-3);
  border-top: 1px solid var(--trait);
  font-size: var(--taille-corps);
}
.vsp-photos-defilantes {
  display: flex;
  gap: var(--e-2);
  overflow-x: auto;
  scrollbar-width: none;
}
.vsp-photos-defilantes .vsp-photo {
  flex: none;
  width: 150px;
}

/* ---------- Fiche d'un lot, mini-listes ---------- */
.vsp-fiche-lot {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--e-4);
  margin: 0;
}
.vsp-fiche-lot dt {
  font-size: var(--taille-legende);
  color: var(--texte-faible);
}
.vsp-fiche-lot dd {
  margin: 2px 0 0;
  font-weight: var(--graisse-forte);
  font-variant-numeric: tabular-nums;
}
.vsp-separateur {
  height: 1px;
  background: var(--trait);
  border: 0;
  margin: 0;
}
.vsp-mini-ligne {
  display: flex;
  align-items: center;
  gap: var(--e-3);
  padding: var(--e-3) 0;
  border-top: 1px solid var(--trait);
  font-size: var(--taille-petit);
}
.vsp-mini-ligne:first-child {
  border-top: 0;
}
.vsp-mini-ligne strong {
  min-width: 56px;
}
.vsp-mini-ligne .vsp-fin {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--succes);
  font-weight: var(--graisse-forte);
}
.vsp-mini-ligne .vsp-fin svg {
  width: 18px;
  height: 18px;
}
.vsp-mini-ligne .vsp-fin-attente {
  color: var(--texte-faible);
}
.vsp-note-cadenas {
  display: flex;
  gap: var(--e-2);
  align-items: flex-start;
  color: var(--texte-second);
  font-size: var(--taille-petit);
}
.vsp-note-cadenas svg {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

@media (max-width: 1279px) {
  .vsp-scene-promoteur {
    grid-template-columns: 1fr;
  }
  .vsp-jalons {
    grid-template-columns: repeat(var(--nb, 10), minmax(84px, 1fr));
    overflow-x: auto;
  }
}
@media (max-width: 599px) {
  .vsp-3d-grand {
    height: 420px;
    min-height: 0;
  }
  .vsp-masque-mobile {
    display: none;
  }
  .vsp-frise {
    grid-template-columns: 1fr;
  }
}
