/* ============================================================================
   Démo « Le pointage bancaire » — styles propres à cette démo.

   Deux colonnes alignées : à gauche les lignes du tableau de suivi, à droite
   les opérations des relevés. Une paire occupe la MÊME rangée — si bien qu'un
   trou d'un côté se voit sans avoir à le chercher. Le trait qui les relie est
   dessiné en SVG par-dessus.
   ========================================================================== */

.demo__scene { display: grid; gap: var(--sp-2); align-content: start; }

/* -------------------------------------------------------------- Dépôt --- */
.depot__aide { font-size: var(--t-md); color: var(--ardoise); line-height: 1.55; max-width: 68ch; }
.depot {
  margin-top: var(--sp-2); padding: var(--sp-3);
  border: 2px dashed var(--ligne); border-radius: var(--r-lg);
  text-align: center; background: var(--voile);
  transition: border-color var(--moyen) linear, background var(--moyen) linear;
}
.depot.est-survole { border-color: var(--bleu); background: var(--bleu-ciel); }
.depot__fleche { display: block; font-size: var(--t-2xl); color: var(--acier); }
.depot__texte { display: block; margin-top: 4px; font-size: var(--t-md); color: var(--acier); }
.depot__choix { margin-top: var(--sp-2); display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.releve-carte {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 15px; border: 1px solid var(--ligne); border-radius: var(--r-md);
  background: var(--blanc); box-shadow: var(--ombre-s); text-align: left;
  transition: transform var(--vite) linear, border-color var(--vite) linear, opacity var(--moyen) linear;
}
.releve-carte:hover { border-color: var(--bleu); transform: translateY(-2px); }
.releve-carte[disabled] { opacity: .35; transform: none; }
.releve-carte__icone { font-size: var(--t-xl); }
.releve-carte__nom { display: block; font-family: var(--mono); font-size: var(--t-sm); color: var(--encre); }
.releve-carte__quoi { display: block; font-size: var(--t-xs); color: var(--acier); }

.depot__liste { margin-top: var(--sp-2); display: grid; gap: 6px; }
.depot__liste li {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--r-md); background: var(--bleu-ciel);
  font-size: var(--t-sm); color: var(--bleu-fonce);
  animation: kit-entre .3s var(--sortie) both;
}
.depot__liste .taille { margin-left: auto; font-family: var(--mono); font-size: var(--t-xs); }
.depot__lancer { margin-top: var(--sp-2); }
.depot__note {
  margin-top: var(--sp-2); padding: 11px 13px; background: var(--valide-fond);
  border-radius: var(--r-md); font-size: var(--t-sm); color: var(--valide); line-height: 1.55;
  animation: kit-entre .35s var(--sortie) both;
}

/* ------------------------------------------------------------ Rapport --- */
.rapport { animation: kit-entre .45s var(--sortie) both; }
.rapport__tete {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--sp-2); flex-wrap: wrap; margin-bottom: var(--sp-2);
}
.rapport__titre { font-family: var(--titre); font-size: var(--t-2xl); font-weight: 700; color: var(--encre); }
.rapport__periode {
  margin-top: 4px; font-family: var(--mono); font-size: var(--t-xs);
  letter-spacing: .06em; text-transform: uppercase; color: var(--acier);
}
.rapport__mention { font-size: var(--t-xs); color: var(--acier); max-width: 34ch; line-height: 1.5; text-align: right; }

.compteurs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.compteur {
  padding: 15px 16px; border-radius: var(--r-lg); text-align: left;
  border: 1px solid transparent; background: var(--brume);
  transition: transform var(--vite) linear, box-shadow var(--moyen) linear, border-color var(--vite) linear;
}
.compteur:hover { transform: translateY(-2px); box-shadow: var(--ombre-m); }
.compteur.est-actif { border-color: currentColor; box-shadow: var(--ombre-m); }
.compteur__n {
  display: block; font-family: var(--titre); font-size: var(--t-3xl); font-weight: 700;
  line-height: 1; font-variant-numeric: tabular-nums;
}
.compteur__l { display: block; margin-top: 5px; font-size: var(--t-sm); font-weight: 500; }
.compteur--valide    { background: var(--valide-fond);    color: var(--valide); }
.compteur--attention { background: var(--attention-fond); color: var(--attention); }
.compteur--neutre    { background: var(--brume);          color: var(--ardoise); }
/* Volontairement bleu-informatif, pas rouge-alerte : c'est le registre que le
   produit a choisi pour cette liste, et il a raison. */
.compteur--info      { background: var(--bleu-ciel);      color: var(--bleu-fonce); }
.compteur.vient-de-changer .compteur__n { animation: pb-compte 1.1s var(--sortie); }
@keyframes pb-compte { 0% { transform: scale(1.35); } 100% { transform: none; } }

.rapport__aide {
  margin: var(--sp-2) 0; padding: 11px 13px; background: var(--voile);
  border-radius: var(--r-md); font-size: var(--t-sm); color: var(--ardoise); line-height: 1.55;
}
.rapport__corps { position: relative; }

/* ---------------------------------------------------- Les deux colonnes -- */
.deux-colonnes {
  position: relative;
  background: var(--blanc); border-radius: var(--r-lg); box-shadow: var(--ombre-s);
  border: 1px solid var(--ligne); overflow: hidden;
}
.deux-colonnes__tete {
  display: grid; grid-template-columns: minmax(0, 1fr) 92px minmax(0, 1fr);
  gap: 0; padding: 10px 14px; border-bottom: 1px solid var(--ligne); background: var(--voile);
  font-size: var(--t-xs); text-transform: uppercase; letter-spacing: .05em; color: var(--acier);
}
.deux-colonnes__tete span:last-child { text-align: right; }
.deux-colonnes__tete span:nth-child(2) { text-align: center; }
.deux-colonnes__defile { position: relative; max-height: 460px; overflow-y: auto; }
.liens { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.liens path {
  fill: none; stroke: var(--valide); stroke-width: 1.6; opacity: .55;
  stroke-dasharray: 120; stroke-dashoffset: 120;
  animation: pb-trace .55s var(--sortie) forwards;
}
.liens path.est-rattrapage { stroke: var(--attention); stroke-dasharray: 4 3; animation: none; opacity: .8; }
@keyframes pb-trace { to { stroke-dashoffset: 0; } }
/* Les extrémités du trait pointent vers les deux cartes qu'il relie. */
.liens path { stroke-linecap: round; }

.rangee {
  display: grid; grid-template-columns: minmax(0, 1fr) 92px minmax(0, 1fr);
  align-items: stretch; border-bottom: 1px solid var(--ligne);
  min-height: 54px; position: relative; z-index: 2;
}
.rangee:last-child { border-bottom: 0; }
.rangee.est-appariee .cote { background: var(--valide-fond); }
.rangee.est-doublon .cote { background: var(--attention-fond); }
.rangee.est-seule-gauche .cote--gauche { background: var(--brume); }
.rangee.est-seule-droite .cote--droite { background: var(--bleu-ciel); }
.rangee.vient-de-s-apparier .cote { animation: pb-apparie 1s var(--sortie); }
@keyframes pb-apparie {
  0% { background: var(--bleu-ciel); }
  100% { background: var(--valide-fond); }
}

.cote { padding: 8px 14px; display: grid; align-content: center; gap: 2px; min-width: 0; }
.cote--droite { text-align: right; }
.cote__principal {
  font-size: var(--t-sm); font-weight: 600; color: var(--encre);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cote__second { font-size: var(--t-xs); color: var(--acier); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cote__montant { font-family: var(--mono); font-size: var(--t-sm); font-weight: 700; color: var(--encre); }
.cote__vide { color: var(--acier); font-style: italic; font-size: var(--t-xs); align-self: center; }

.jointure {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  font-family: var(--mono); font-size: 10px; color: var(--acier);
}
.jointure__pastille {
  padding: 2px 6px; border-radius: var(--r-pill); background: var(--valide-fond); color: var(--valide);
  font-weight: 700; white-space: nowrap;
}
.jointure__pastille--rattrapage { background: var(--attention-fond); color: var(--attention); }
.jointure__manque { color: var(--alerte); font-size: 15px; }

/* --------------------------------------------------------- Les doublons -- */
.groupe {
  border: 1px solid var(--attention); border-radius: var(--r-lg);
  background: var(--attention-fond); margin-bottom: var(--sp-2); overflow: hidden;
}
.groupe__tete {
  padding: 11px 15px; font-size: var(--t-sm); font-weight: 600; color: var(--attention);
  border-bottom: 1px solid rgba(154, 91, 0, .22);
}
.groupe__corps { padding: 13px 15px; display: grid; gap: 9px; background: var(--blanc); }
.groupe__ligne {
  display: grid; grid-template-columns: minmax(0, 1fr) auto 190px;
  gap: 12px; align-items: center;
  padding: 10px 12px; border: 1px solid var(--ligne); border-radius: var(--r-md);
  font-size: var(--t-sm);
}
.groupe__ligne.est-choisie { border-color: var(--valide); background: var(--valide-fond); }
.groupe__ligne.est-orpheline { border-color: var(--acier); background: var(--brume); opacity: .8; }
.groupe__nom { font-weight: 600; color: var(--encre); }
.groupe__meta { font-size: var(--t-xs); color: var(--acier); }
.groupe__prix { font-family: var(--mono); font-weight: 700; color: var(--encre); }
.groupe__ligne select {
  width: 100%; padding: 7px 9px; border: 1px solid var(--ligne); border-radius: var(--r-sm);
  font-size: var(--t-sm); background: var(--blanc); color: var(--ardoise);
}
.groupe__ligne select:focus { outline: none; border-color: var(--bleu); box-shadow: var(--ombre-focus); }
.groupe__verdict { font-size: var(--t-xs); font-weight: 600; }
.groupe__pied { padding: 0 15px 14px; background: var(--blanc); }

/* --------------------------------------------------- Les débits orphelins */
.orphelin {
  display: grid; grid-template-columns: 96px minmax(0, 1fr) 120px auto;
  gap: 14px; align-items: center;
  padding: 14px 16px; border: 1px solid var(--bleu); border-radius: var(--r-lg);
  background: var(--bleu-ciel); margin-bottom: 10px;
  animation: kit-entre .4s var(--sortie) both;
}
.orphelin.est-ignore { animation: kit-part .45s var(--sortie) forwards; }
.orphelin__date { font-family: var(--mono); font-size: var(--t-sm); color: var(--bleu-fonce); }
.orphelin__motif { min-width: 0; }
.orphelin__motif b { display: block; font-size: var(--t-md); color: var(--encre); }
.orphelin__motif span { font-family: var(--mono); font-size: var(--t-xs); color: var(--acier); }
.orphelin__montant {
  font-family: var(--mono); font-size: var(--t-xl); font-weight: 700;
  color: var(--bleu-fonce); text-align: right;
}
.orphelin__ignorer {
  padding: 8px 14px; border: 1px solid var(--ligne); border-radius: var(--r-md);
  background: var(--blanc); font-size: var(--t-sm); color: var(--ardoise); white-space: nowrap;
}
.orphelin__ignorer:hover { border-color: var(--alerte); color: var(--alerte); }

/* ------------------------------------------------------------ Écriture --- */
.ecriture { display: grid; gap: 10px; }
.ecriture__ligne {
  display: grid; grid-template-columns: 26px minmax(0, 1fr) auto;
  gap: 12px; align-items: center;
  padding: 12px 15px; border-radius: var(--r-md); background: var(--voile);
  font-size: var(--t-md); color: var(--ardoise);
  animation: kit-entre .4s var(--sortie) both;
}
.ecriture__ligne b { font-family: var(--mono); color: var(--encre); }
.ecriture__ligne--valide { background: var(--valide-fond); color: var(--valide); }
.ecriture__ligne--valide b { color: var(--valide); }
.ecriture__ligne--garde { background: var(--attention-fond); color: var(--attention); }
.ecriture__ligne--garde b { color: var(--attention); }

.note-fin {
  margin-top: var(--sp-2); padding: 13px 15px; background: var(--bleu-ciel);
  border-radius: var(--r-md); font-size: var(--t-sm); color: var(--bleu-fonce); line-height: 1.6;
}
.vide-joyeux { padding: var(--sp-4); text-align: center; color: var(--acier); font-size: var(--t-lg); }

/* ---------------------------------------------------------- Responsive --- */
@media (max-width: 900px) {
  .compteurs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rapport__mention { text-align: left; max-width: none; }
}
@media (max-width: 620px) {
  .compteurs { grid-template-columns: minmax(0, 1fr); }
  .deux-colonnes__tete, .rangee { grid-template-columns: minmax(0, 1fr) 62px minmax(0, 1fr); }
  .cote { padding: 7px 9px; }
  .liens { display: none; }
  .groupe__ligne { grid-template-columns: minmax(0, 1fr); }
  .orphelin { grid-template-columns: minmax(0, 1fr); text-align: left; }
  .orphelin__montant { text-align: left; }
}
