/*
 * IMMGO — Écrans alignés sur le cahier Vol. 2, sections 07 à 10 et 15 : syndic, utilités, credit score, reporting,
 * fiscalité IRL (grilles de cartes, lignes libellé / valeur, graphiques SVG, bandeaux, choix de période, reçus)
 * Auteur : Jacks Ngalangala
 */

/* ─── Grilles de cartes ─── */
.fb-grille {
  display: grid;
  gap: var(--e-5);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}
.fb-grille-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.fb-grille-large {
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
}
.fb-grille-gauche {
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
}
@media (max-width: 1023px) {
  .fb-grille,
  .fb-grille-3,
  .fb-grille-large,
  .fb-grille-gauche {
    grid-template-columns: 1fr;
  }
}
.fb-grille > .carte {
  min-width: 0;
}

/* ─── Lignes libellé / valeur (charges, comptes, logistique) ─── */
.fb-lignes {
  display: flex;
  flex-direction: column;
}
.fb-ligne {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--e-4);
  padding: var(--e-3) 0;
  border-bottom: 1px solid var(--trait);
}
.fb-ligne-libelle {
  color: var(--texte-second);
  min-width: 0;
}
.fb-ligne-valeur {
  text-align: right;
  color: var(--texte);
}
.fb-ligne-forte .fb-ligne-libelle,
.fb-ligne-forte .fb-ligne-valeur {
  font-weight: var(--graisse-titre);
  color: var(--texte);
}
.fb-ligne[data-ton='succes'] .fb-ligne-valeur {
  color: var(--succes);
}
.fb-ligne[data-ton='danger'] .fb-ligne-valeur {
  color: var(--danger);
}
.fb-ligne[data-ton='attention'] .fb-ligne-valeur {
  color: var(--attention);
}
.fb-pied {
  padding-top: var(--e-3);
  color: var(--texte-second);
  font-size: var(--taille-petit);
}

/* ─── Carte filetée de couleur (utilités, exports, bilan) ─── */
.fb-filet {
  border-left: 4px solid var(--fb-teinte, var(--or));
}
.fb-teinte-info {
  --fb-teinte: var(--info);
}
.fb-teinte-succes {
  --fb-teinte: var(--succes);
}
.fb-teinte-attention {
  --fb-teinte: var(--attention);
}
.fb-teinte-danger {
  --fb-teinte: var(--danger);
}
.fb-teinte-or {
  --fb-teinte: var(--or);
}
.fb-teinte-neutre {
  --fb-teinte: var(--neutre);
}

/* ─── Chiffres d'un bilan (rangée de valeurs colorées) ─── */
.fb-chiffres {
  display: grid;
  gap: var(--e-4);
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.fb-chiffre-libelle {
  color: var(--texte-second);
  font-size: var(--taille-petit);
}
.fb-chiffre-valeur {
  font-size: 26px;
  font-weight: var(--graisse-titre);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--fb-teinte, var(--texte));
}

/* ─── Graphiques SVG (barres verticales et horizontales) ─── */
.fb-graphique {
  width: 100%;
  padding: var(--e-4);
  background: var(--surface-douce);
  border-radius: var(--r-moyen);
}
.fb-graphique svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.fb-barre {
  fill: var(--or-trait);
}
.fb-barre-forte {
  fill: var(--or);
}
.fb-barre-etiquette {
  fill: var(--texte);
  font-size: 13px;
  font-weight: var(--graisse-forte);
  text-anchor: middle;
}
.fb-barre-axe {
  fill: var(--texte-second);
  font-size: 13px;
  text-anchor: middle;
}
.fb-repartition {
  display: flex;
  flex-direction: column;
  gap: var(--e-4);
}
.fb-repartition-tete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--e-3);
  margin-bottom: var(--e-2);
}
.fb-repartition-nom {
  display: inline-flex;
  align-items: center;
  gap: var(--e-2);
  color: var(--texte);
  font-weight: var(--graisse-moyenne);
}
.fb-repartition-nom::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--fb-teinte, var(--or));
}
.fb-repartition-valeur {
  font-variant-numeric: tabular-nums;
  color: var(--texte-second);
}
.fb-piste {
  fill: var(--neutre-pale);
}
.fb-remplie {
  fill: var(--fb-teinte, var(--or));
}

/* ─── Bandeaux (anomalie, information, recommandation) ─── */
.fb-bandeau {
  display: flex;
  align-items: flex-start;
  gap: var(--e-3);
  padding: var(--e-4) var(--e-5);
  border-radius: var(--r-moyen);
  background: var(--info-pale);
  color: var(--texte);
}
.fb-bandeau svg {
  flex: none;
  width: 22px;
  height: 22px;
  color: var(--info);
}
.fb-bandeau-attention {
  background: var(--attention-pale);
}
.fb-bandeau-attention svg {
  color: var(--attention);
}
.fb-bandeau-succes {
  background: var(--succes-pale);
}
.fb-bandeau-succes svg {
  color: var(--succes);
}
.fb-bandeau-titre {
  font-weight: var(--graisse-titre);
}
.fb-bandeau-corps {
  display: flex;
  flex-direction: column;
  gap: var(--e-2);
  flex: 1;
  min-width: 0;
}
.fb-bandeau-corps > .btn {
  align-self: flex-start;
}
/* Liste paginée posée bord à bord dans une carte : le compte et « voir plus » gardent la marge de la carte. */
.carte-corps-plein > .resultats > .resultats-compte,
.carte-corps-plein > .resultats > .resultats-plus {
  padding: 0 var(--e-6) var(--e-3);
}
@media (max-width: 599px) {
  .contenu .tuiles.fb-tuiles-pile {
    grid-template-columns: 1fr;
  }
}
