/* ---------- KPI (cartes chiffres clés) ---------- */
.kpi-card .card-body{
  min-height: 190px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.kpi-card i { line-height: 1; }

/* ---------- Header visuel ---------- */
header.afpihead {
  padding-top: 10rem;
  padding-bottom: calc(10rem - 4.5rem);
  background: linear-gradient(to bottom, rgba(92, 77, 66, 0.8) 0%, rgba(92, 77, 66, 0.8) 100%), url("../assets/img/afpi.jpg");
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: scroll;
  background-size: cover;
}
header.afpihead h1, header.afpihead .h1 { font-size: 2.25rem; }

/* ---------- ORGANIGRAMME HTML PUR (ultra-minimal, centré, avec traits) ---------- */
.tree-wrap {
  overflow-x: auto;
  padding-bottom: 6px;
}
.tree {
  display: inline-block;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,.05);
  padding: 10px 14px;
  min-width: 480px;
}

/* Centrage des niveaux (parent au centre, enfants sur 1 ligne centrée) */
.tree ul {
  padding-top: 12px;
  position: relative;
  margin: 0;
  list-style: none;
  text-align: center;        /* <-- centre la ligne des enfants */
  white-space: normal;
}

/* Chaque enfant sur une seule ligne, centré sous son parent */
.tree li {
  display: inline-block;     /* <-- met les enfants sur UNE ligne */
  vertical-align: top;
  position: relative;
  padding: 10px 6px 0 6px;
  text-align: center;
}

/* Traits de liaison horizontaux de part et d’autre du milieu */
.tree li::before,
.tree li::after {
  content: '';
  position: absolute;
  top: 0;
  width: 50%;
  height: 12px;
  border-top: 1px solid #d9dde3;
}
.tree li::before { right: 50%; }
.tree li::after  { left: 50%;  border-left: 1px solid #d9dde3; }

/* Pas de traits si enfant unique / extrémités */
.tree li:only-child::before,
.tree li:only-child::after { display: none; }
.tree li:first-child::before { border: 0 none; }
.tree li:last-child::after  { border: 0 none; }

/* Trait vertical du parent jusqu’à la barre horizontale des enfants */
.tree ul ul::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 12px;
  border-left: 1px solid #d9dde3;
}

/* --- Cases ultra-minimales (uniquement le nom) --- */
.tree .node {
  background: #fff;
  border: 1px solid #d9dde3;
  padding: 2px 4px;
  display: inline-block;
  border-radius: 4px;
  min-width: 60px;
  max-width: 80px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
  transition: all 0.2s ease;
}
.tree .node:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(0,0,0,.08);
  border-color: #cfd6de;
}
.tree .name {
  font-weight: 600;
  font-size: 0.6rem;       /* très petit */
  white-space: normal;     /* autorise un retour à la ligne si besoin */
}
.tree .title { display: none; }  /* on cache le titre pour gagner de la place */
.tree .root .node {
  border: 2px solid #2563eb;
  font-size: 0.65rem;
}

/* Responsive : empiler si écran trop étroit */
@media (max-width: 900px) {
  .tree { min-width: auto; }
  .tree ul { text-align: left; }
  .tree li { display: block; }
  .tree li::before,
  .tree li::after,
  .tree ul ul::before { display: none; }
}


/* ---------- Réseaux sociaux dans Coordonnées ---------- */
.social-icons {
  display: flex;
  justify-content: flex-start; /* aligné à gauche avec le texte */
  gap: 15px;
  font-size: 1.6rem;
  margin-top: 10px;
}

.social-icons .social-icon {
  color: #fd7e14; /* orange DA */
  transition: color 0.2s ease, transform 0.2s ease;
}

.social-icons .social-icon:hover {
  color: #e96b00; /* orange foncé au survol */
  transform: translateY(-2px);
}
