/* ==========================================================================
   OIMAP - Composants Réutilisables (components.css)
   Complète custom.css avec les styles de composants modulaires.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Palette de couleurs OIMAP (variables de référence)
   --marine:           #0C1B33
   --bleu-oimap:       #1A3A6B
   --bleu-clair:       #4A90D9
   --bleu-pale:        #E8F0FE
   --or:               #B8860B
   --or-clair:         #D4A843
   --or-pale:          #FDF6E3
   --ivoire:           #FAFAF8
   --gris-100:         #F5F5F3
   --gris-200:         #E8E6E1
   --gris-600:         #4A4840
   --gris-700:         #333130
   --vert-succes:      #1B7D46
   --rouge-alerte:     #B91C1C
   --orange-attention:  #C27519
   -------------------------------------------------------------------------- */


/* ==========================================================================
   1. COMPOSANTS CARTE (Card)
   ========================================================================== */

/* --- Carte de base --- */
.card-base {
  background-color: #FFFFFF;
  border: 1px solid #E8E6E1;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(12, 27, 51, 0.06), 0 1px 2px rgba(12, 27, 51, 0.04);
  transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
  overflow: hidden;
}

/* --- Carte avec survol --- */
.card-hover:hover {
  box-shadow: 0 8px 24px rgba(12, 27, 51, 0.10), 0 4px 8px rgba(12, 27, 51, 0.06);
  transform: translateY(-2px);
  border-color: #4A90D9;
}

/* --- Carte article (image + contenu) --- */
.card-article {
  display: flex;
  flex-direction: column;
}

.card-article .card-article-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-bottom: 1px solid #E8E6E1;
}

.card-article .card-article-body {
  padding: 1.25rem;
}

.card-article .card-article-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.125rem;
  font-weight: 700;
  color: #0C1B33;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.card-article .card-article-excerpt {
  font-size: 0.875rem;
  color: #4A4840;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.card-article .card-article-meta {
  font-size: 0.75rem;
  color: #4A4840;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* --- Carte publication (disposition horizontale) --- */
.card-publication {
  display: flex;
  flex-direction: row;
  align-items: stretch;
}

.card-publication .card-publication-image {
  width: 180px;
  min-height: 140px;
  flex-shrink: 0;
  object-fit: cover;
}

.card-publication .card-publication-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
}

.card-publication .card-publication-title {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 700;
  color: #0C1B33;
  margin-bottom: 0.375rem;
}

.card-publication .card-publication-authors {
  font-size: 0.8125rem;
  color: #4A4840;
  margin-bottom: 0.5rem;
}

.card-publication .card-publication-abstract {
  font-size: 0.8125rem;
  color: #333130;
  line-height: 1.5;
}

@media (max-width: 640px) {
  .card-publication {
    flex-direction: column;
  }
  .card-publication .card-publication-image {
    width: 100%;
    height: 160px;
  }
}

/* --- Carte événement (avec badge de date) --- */
.card-event {
  position: relative;
}

.card-event .card-event-date-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background-color: #1A3A6B;
  color: #FFFFFF;
  border-radius: 0.375rem;
  padding: 0.5rem 0.625rem;
  text-align: center;
  line-height: 1.2;
  z-index: 2;
  box-shadow: 0 2px 6px rgba(12, 27, 51, 0.15);
}

.card-event .card-event-date-badge .event-day {
  display: block;
  font-family: 'Playfair Display', serif;
  font-size: 1.375rem;
  font-weight: 700;
}

.card-event .card-event-date-badge .event-month {
  display: block;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.card-event .card-event-body {
  padding: 1.25rem;
}

.card-event .card-event-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.0625rem;
  font-weight: 700;
  color: #0C1B33;
  margin-bottom: 0.375rem;
}

.card-event .card-event-location {
  font-size: 0.8125rem;
  color: #4A4840;
}

/* --- Carte BIOP (avec bande de statut) --- */
.card-biop {
  position: relative;
  border-left: 4px solid #E8E6E1;
}

.card-biop.card-biop--actif {
  border-left-color: #1B7D46;
}

.card-biop.card-biop--en-cours {
  border-left-color: #C27519;
}

.card-biop.card-biop--termine {
  border-left-color: #4A4840;
}

.card-biop.card-biop--alerte {
  border-left-color: #B91C1C;
}

.card-biop .card-biop-body {
  padding: 1.25rem;
}

.card-biop .card-biop-title {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 700;
  color: #0C1B33;
  margin-bottom: 0.375rem;
}

.card-biop .card-biop-status {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}

.card-biop .card-biop-description {
  font-size: 0.875rem;
  color: #4A4840;
  line-height: 1.5;
}

/* --- Carte équipe (photo + informations) --- */
.card-team {
  text-align: center;
  padding: 1.5rem 1.25rem;
}

.card-team .card-team-photo {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #E8F0FE;
  margin: 0 auto 1rem;
  display: block;
}

.card-team .card-team-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.0625rem;
  font-weight: 700;
  color: #0C1B33;
  margin-bottom: 0.25rem;
}

.card-team .card-team-role {
  font-size: 0.8125rem;
  color: #B8860B;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.card-team .card-team-bio {
  font-size: 0.8125rem;
  color: #4A4840;
  line-height: 1.5;
}

.card-team .card-team-links {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.card-team .card-team-links a {
  color: #1A3A6B;
  transition: color 0.2s ease;
}

.card-team .card-team-links a:hover {
  color: #4A90D9;
}


/* ==========================================================================
   2. COMPOSANTS BADGE
   ========================================================================== */

/* --- Badge de base --- */
.badge-base {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.4;
  white-space: nowrap;
}

/* --- Taille petite --- */
.badge-sm {
  padding: 0.125rem 0.5rem;
  font-size: 0.6875rem;
}

/* --- Taille grande --- */
.badge-lg {
  padding: 0.375rem 1rem;
  font-size: 0.8125rem;
}

/* --- Badge contour uniquement --- */
.badge-outline {
  background-color: transparent;
  border: 1.5px solid currentColor;
}

/* --- Badge tendance hausse (flèche verte vers le haut) --- */
.badge-tendance-hausse {
  background-color: rgba(27, 125, 70, 0.1);
  color: #1B7D46;
}

.badge-tendance-hausse::before {
  content: "\2191";
  margin-right: 0.25rem;
  font-weight: 700;
}

/* --- Badge tendance baisse (flèche rouge vers le bas) --- */
.badge-tendance-baisse {
  background-color: rgba(185, 28, 28, 0.1);
  color: #B91C1C;
}

.badge-tendance-baisse::before {
  content: "\2193";
  margin-right: 0.25rem;
  font-weight: 700;
}

/* --- Badge tendance stable (flèche grise vers la droite) --- */
.badge-tendance-stable {
  background-color: rgba(74, 72, 64, 0.1);
  color: #4A4840;
}

.badge-tendance-stable::before {
  content: "\2192";
  margin-right: 0.25rem;
  font-weight: 700;
}


/* ==========================================================================
   3. COMPOSANTS TIMELINE (Frise chronologique)
   ========================================================================== */

/* --- Conteneur principal --- */
.timeline-container {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 0;
}

/* Ligne centrale verticale */
.timeline-container::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background-color: #E8E6E1;
  transform: translateX(-50%);
}

/* --- Élément de la timeline --- */
.timeline-item {
  position: relative;
  width: 50%;
  padding: 0 2.5rem 2rem;
  box-sizing: border-box;
}

/* Alternance gauche/droite */
.timeline-item:nth-child(odd) {
  left: 0;
  text-align: right;
  padding-right: 2.5rem;
  padding-left: 0;
}

.timeline-item:nth-child(even) {
  left: 50%;
  text-align: left;
  padding-left: 2.5rem;
  padding-right: 0;
}

/* --- Point central sur la ligne --- */
.timeline-dot {
  position: absolute;
  top: 0.25rem;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: #1A3A6B;
  border: 3px solid #B8860B;
  z-index: 2;
  box-shadow: 0 0 0 4px #FAFAF8;
}

.timeline-item:nth-child(odd) .timeline-dot {
  right: -8px;
}

.timeline-item:nth-child(even) .timeline-dot {
  left: -8px;
}

/* --- Contenu de l'élément --- */
.timeline-content {
  background-color: #FFFFFF;
  border: 1px solid #E8E6E1;
  border-radius: 0.5rem;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(12, 27, 51, 0.06);
}

.timeline-content h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 700;
  color: #0C1B33;
  margin-bottom: 0.375rem;
}

.timeline-content p {
  font-size: 0.875rem;
  color: #4A4840;
  line-height: 1.5;
}

/* --- Date de la timeline --- */
.timeline-date {
  font-family: 'Playfair Display', serif;
  font-size: 0.875rem;
  font-weight: 700;
  color: #B8860B;
  margin-bottom: 0.5rem;
  display: block;
}

/* --- Responsive : empilement sur mobile --- */
@media (max-width: 768px) {
  .timeline-container::before {
    left: 20px;
  }

  .timeline-item,
  .timeline-item:nth-child(odd),
  .timeline-item:nth-child(even) {
    width: 100%;
    left: 0;
    text-align: left;
    padding-left: 3rem;
    padding-right: 0;
  }

  .timeline-item:nth-child(odd) .timeline-dot,
  .timeline-item:nth-child(even) .timeline-dot {
    left: 12px;
    right: auto;
  }
}


/* ==========================================================================
   4. ORGANIGRAMME (Org chart)
   ========================================================================== */

/* --- Conteneur de l'organigramme --- */
.org-chart {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 2rem 1rem;
}

.org-chart-row {
  display: flex;
  justify-content: center;
  gap: 2rem;
  position: relative;
}

/* --- Noeud de l'organigramme --- */
.org-node {
  background-color: #FFFFFF;
  border: 1px solid #E8E6E1;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(12, 27, 51, 0.06);
  padding: 1.25rem;
  text-align: center;
  min-width: 160px;
  max-width: 220px;
  position: relative;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.org-node:hover {
  box-shadow: 0 4px 12px rgba(12, 27, 51, 0.10);
  border-color: #4A90D9;
}

.org-node .org-node-photo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #E8F0FE;
  margin: 0 auto 0.75rem;
  display: block;
}

.org-node .org-node-name {
  font-family: 'Playfair Display', serif;
  font-size: 0.9375rem;
  font-weight: 700;
  color: #0C1B33;
  margin-bottom: 0.125rem;
}

.org-node .org-node-title {
  font-size: 0.75rem;
  color: #B8860B;
  font-weight: 600;
}

/* --- Connecteur entre les noeuds --- */
.org-connector {
  display: flex;
  justify-content: center;
  align-items: stretch;
  height: 2rem;
  position: relative;
}

/* Ligne verticale descendante depuis le parent */
.org-connector::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 2px;
  height: 100%;
  background-color: #E8E6E1;
  transform: translateX(-50%);
}

/* Ligne horizontale reliant les enfants */
.org-connector-horizontal {
  position: relative;
  height: 2px;
  background-color: #E8E6E1;
  margin: 0 auto;
}

/* Lignes verticales montantes vers chaque enfant */
.org-connector-vertical {
  width: 2px;
  height: 1.5rem;
  background-color: #E8E6E1;
  margin: 0 auto;
}


/* ==========================================================================
   5. COMPOSANTS TABLEAU (Table)
   ========================================================================== */

/* --- Conteneur responsive --- */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid #E8E6E1;
  border-radius: 0.5rem;
}

/* --- Tableau principal --- */
.table-oimap {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  line-height: 1.5;
}

.table-oimap thead th {
  background-color: #0C1B33;
  color: #FFFFFF;
  font-weight: 600;
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  border-bottom: 2px solid #B8860B;
}

.table-oimap thead th:first-child {
  border-top-left-radius: 0.5rem;
}

.table-oimap thead th:last-child {
  border-top-right-radius: 0.5rem;
}

.table-oimap tbody td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #E8E6E1;
  color: #333130;
  vertical-align: middle;
}

.table-oimap tbody tr:last-child td {
  border-bottom: none;
}

/* --- Tableau rayé --- */
.table-striped tbody tr:nth-child(even) {
  background-color: #F5F5F3;
}

/* --- Tableau avec survol de ligne --- */
.table-hover tbody tr {
  transition: background-color 0.15s ease;
}

.table-hover tbody tr:hover {
  background-color: #E8F0FE;
}

/* --- En-têtes triables --- */
.table-oimap thead th.sortable {
  cursor: pointer;
  user-select: none;
  position: relative;
  padding-right: 1.75rem;
}

.table-oimap thead th.sortable::after {
  content: "\2195";
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.5;
  font-size: 0.75rem;
}

.table-oimap thead th.sortable.sort-asc::after {
  content: "\2191";
  opacity: 1;
}

.table-oimap thead th.sortable.sort-desc::after {
  content: "\2193";
  opacity: 1;
}


/* ==========================================================================
   6. ACCORDÉON
   ========================================================================== */

/* --- Élément d'accordéon --- */
.accordion-item {
  border: 1px solid #E8E6E1;
  border-radius: 0.5rem;
  margin-bottom: 0.5rem;
  overflow: hidden;
  background-color: #FFFFFF;
  transition: border-color 0.2s ease;
}

.accordion-item.active {
  border-color: #4A90D9;
}

/* --- En-tête cliquable --- */
.accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background-color: #FFFFFF;
  cursor: pointer;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #0C1B33;
  transition: background-color 0.2s ease, color 0.2s ease;
  border: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}

.accordion-header:hover {
  background-color: #F5F5F3;
}

.accordion-item.active .accordion-header {
  background-color: #E8F0FE;
  color: #1A3A6B;
}

/* Chevron indicateur */
.accordion-header::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.25s ease;
  flex-shrink: 0;
  margin-left: 1rem;
}

.accordion-item.active .accordion-header::after {
  transform: rotate(-135deg);
}

/* --- Contenu dépliable --- */
.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.accordion-item.active .accordion-content {
  max-height: 1000px;
}

.accordion-content-inner {
  padding: 1rem 1.25rem 1.25rem;
  font-size: 0.875rem;
  color: #4A4840;
  line-height: 1.6;
  border-top: 1px solid #E8E6E1;
}


/* ==========================================================================
   7. ONGLETS (Tabs)
   ========================================================================== */

/* --- Conteneur d'onglets --- */
.tabs-container {
  width: 100%;
}

/* --- Liste des onglets --- */
.tab-list {
  display: flex;
  border-bottom: 2px solid #E8E6E1;
  gap: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* --- Bouton d'onglet --- */
.tab-button {
  padding: 0.75rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #4A4840;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s ease, border-color 0.2s ease;
  font-family: inherit;
}

.tab-button:hover {
  color: #1A3A6B;
}

/* --- Onglet actif --- */
.tab-button.active {
  color: #1A3A6B;
  font-weight: 700;
  border-bottom-color: #1A3A6B;
}

/* --- Panneau d'onglet --- */
.tab-panel {
  display: none;
  padding: 1.5rem 0;
}

.tab-panel.active {
  display: block;
}


/* ==========================================================================
   8. COMPTEUR / STATISTIQUE (Counter / Stat)
   ========================================================================== */

/* --- Grille responsive de compteurs --- */
.counter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
}

/* --- Boîte compteur --- */
.counter-box {
  text-align: center;
  padding: 1.5rem 1rem;
  background-color: #FFFFFF;
  border: 1px solid #E8E6E1;
  border-radius: 0.5rem;
  transition: box-shadow 0.2s ease;
}

.counter-box:hover {
  box-shadow: 0 4px 12px rgba(12, 27, 51, 0.08);
}

.counter-box .counter-value {
  font-family: 'Playfair Display', serif;
  font-size: 2.5rem;
  font-weight: 700;
  color: #1A3A6B;
  line-height: 1.2;
  margin-bottom: 0.375rem;
}

.counter-box .counter-label {
  font-size: 0.8125rem;
  color: #4A4840;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.counter-box .counter-sublabel {
  font-size: 0.75rem;
  color: #4A4840;
  margin-top: 0.25rem;
}

@media (max-width: 480px) {
  .counter-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  .counter-box .counter-value {
    font-size: 1.75rem;
  }
}


/* ==========================================================================
   9. ALERTES / NOTIFICATIONS
   ========================================================================== */

/* --- Alerte générique --- */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-radius: 0.5rem;
  border: 1px solid transparent;
  font-size: 0.875rem;
  line-height: 1.5;
  margin-bottom: 1rem;
  position: relative;
}

/* Zone d'icône */
.alert .alert-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
  margin-top: 0.0625rem;
}

/* Corps du message */
.alert .alert-message {
  flex: 1;
  color: inherit;
}

.alert .alert-message strong {
  display: block;
  margin-bottom: 0.125rem;
}

/* Bouton de fermeture */
.alert .alert-close {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.125rem;
  line-height: 1;
  opacity: 0.6;
  transition: opacity 0.2s ease;
  color: inherit;
  padding: 0;
  margin-left: 0.5rem;
}

.alert .alert-close:hover {
  opacity: 1;
}

/* --- Information (bleu pâle) --- */
.alert-info {
  background-color: #E8F0FE;
  border-color: #4A90D9;
  color: #1A3A6B;
}

/* --- Succès (vert) --- */
.alert-success {
  background-color: rgba(27, 125, 70, 0.08);
  border-color: #1B7D46;
  color: #1B7D46;
}

/* --- Avertissement (orange) --- */
.alert-warning {
  background-color: #FDF6E3;
  border-color: #C27519;
  color: #C27519;
}

/* --- Danger (rouge) --- */
.alert-danger {
  background-color: rgba(185, 28, 28, 0.08);
  border-color: #B91C1C;
  color: #B91C1C;
}


/* ==========================================================================
   10. COMPOSANTS CARTE GÉOGRAPHIQUE (Map)
   ========================================================================== */

/* --- Conteneur de carte --- */
.map-container {
  width: 100%;
  border: 1px solid #E8E6E1;
  border-radius: 0.5rem;
  overflow: hidden;
  position: relative;
  background-color: #F5F5F3;
}

.map-container iframe,
.map-container .leaflet-container,
.map-container canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* --- Légende de carte --- */
.map-legend {
  background-color: rgba(255, 255, 255, 0.95);
  border: 1px solid #E8E6E1;
  border-radius: 0.375rem;
  padding: 0.75rem 1rem;
  font-size: 0.8125rem;
  color: #333130;
  box-shadow: 0 1px 4px rgba(12, 27, 51, 0.08);
}

.map-legend h4 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #0C1B33;
  margin-bottom: 0.5rem;
}

.map-legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.375rem;
}

.map-legend-item:last-child {
  margin-bottom: 0;
}

.map-legend-color {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

/* --- Popup personnalisée pour carte --- */
.map-popup-custom {
  background-color: #FFFFFF;
  border: 1px solid #E8E6E1;
  border-radius: 0.5rem;
  padding: 1rem;
  box-shadow: 0 4px 12px rgba(12, 27, 51, 0.12);
  max-width: 280px;
  font-size: 0.8125rem;
  color: #333130;
  line-height: 1.5;
}

.map-popup-custom h5 {
  font-family: 'Playfair Display', serif;
  font-size: 0.9375rem;
  font-weight: 700;
  color: #0C1B33;
  margin-bottom: 0.375rem;
}


/* ==========================================================================
   11. CONTENEUR DE GRAPHIQUE (Chart)
   ========================================================================== */

/* --- Conteneur responsive pour graphique --- */
.chart-container {
  position: relative;
  width: 100%;
  background-color: #FFFFFF;
  border: 1px solid #E8E6E1;
  border-radius: 0.5rem;
  padding: 1.25rem;
  overflow: hidden;
}

/* Maintien du ratio d'aspect (16:9 par défaut) */
.chart-container::before {
  content: "";
  display: block;
  padding-top: 56.25%;
}

.chart-container > canvas,
.chart-container > svg,
.chart-container > div {
  position: absolute;
  top: 1.25rem;
  left: 1.25rem;
  right: 1.25rem;
  bottom: 1.25rem;
}

/* Variante sans ratio forcé (contenu détermine la hauteur) */
.chart-container.chart-container--auto {
  padding: 1.25rem;
}

.chart-container.chart-container--auto::before {
  display: none;
}

.chart-container.chart-container--auto > canvas,
.chart-container.chart-container--auto > svg,
.chart-container.chart-container--auto > div {
  position: relative;
  top: auto;
  left: auto;
  right: auto;
  bottom: auto;
}

/* --- Légende personnalisée pour graphique --- */
.chart-legend-custom {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0.75rem 0 0;
  font-size: 0.8125rem;
  color: #4A4840;
  justify-content: center;
}

.chart-legend-custom-item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.chart-legend-custom-swatch {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  flex-shrink: 0;
}


/* ==========================================================================
   12. CHARGEMENT SQUELETTE (Skeleton loading)
   ========================================================================== */

/* --- Animation de pulsation --- */
@keyframes skeleton-pulse {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
  100% {
    opacity: 1;
  }
}

/* --- Élément squelette de base --- */
.skeleton {
  background-color: #E8E6E1;
  border-radius: 0.25rem;
  animation: skeleton-pulse 1.8s ease-in-out infinite;
}

/* --- Ligne de texte --- */
.skeleton-text {
  height: 0.875rem;
  margin-bottom: 0.625rem;
  border-radius: 0.25rem;
}

.skeleton-text:last-child {
  width: 60%;
}

/* --- Image placeholder --- */
.skeleton-image {
  width: 100%;
  height: 200px;
  border-radius: 0.5rem 0.5rem 0 0;
}

/* --- Carte squelette complète --- */
.skeleton-card {
  background-color: #FFFFFF;
  border: 1px solid #E8E6E1;
  border-radius: 0.5rem;
  overflow: hidden;
}

.skeleton-card .skeleton-card-image {
  width: 100%;
  height: 180px;
  background-color: #E8E6E1;
  animation: skeleton-pulse 1.8s ease-in-out infinite;
}

.skeleton-card .skeleton-card-body {
  padding: 1.25rem;
}

.skeleton-card .skeleton-card-body .skeleton-text {
  background-color: #E8E6E1;
  animation: skeleton-pulse 1.8s ease-in-out infinite;
}

/* --- Avatar squelette --- */
.skeleton-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}


/* ==========================================================================
   13. INFOBULLE (Tooltip)
   ========================================================================== */

/* --- Élément déclencheur --- */
.tooltip {
  position: relative;
  display: inline-block;
  cursor: help;
}

/* --- Texte de l'infobulle --- */
.tooltip .tooltip-text {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background-color: #0C1B33;
  color: #FFFFFF;
  font-size: 0.75rem;
  line-height: 1.4;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  white-space: nowrap;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(12, 27, 51, 0.2);
  transition: opacity 0.2s ease, visibility 0.2s ease;
  pointer-events: none;
}

/* Flèche vers le bas */
.tooltip .tooltip-text::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px;
  border-style: solid;
  border-color: #0C1B33 transparent transparent transparent;
}

/* Affichage au survol */
.tooltip:hover .tooltip-text,
.tooltip:focus .tooltip-text {
  visibility: visible;
  opacity: 1;
}

/* Variante positionnée en bas */
.tooltip .tooltip-text.tooltip-bottom {
  bottom: auto;
  top: calc(100% + 8px);
}

.tooltip .tooltip-text.tooltip-bottom::after {
  top: auto;
  bottom: 100%;
  border-color: transparent transparent #0C1B33 transparent;
}


/* ==========================================================================
   14. BARRE DE PROGRESSION (Progress bar)
   ========================================================================== */

/* --- Conteneur de la barre --- */
.progress-bar {
  width: 100%;
  height: 8px;
  background-color: #E8E6E1;
  border-radius: 9999px;
  overflow: hidden;
  position: relative;
}

/* --- Remplissage de la barre --- */
.progress-fill {
  height: 100%;
  background-color: #1A3A6B;
  border-radius: 9999px;
  transition: width 0.5s ease;
  min-width: 0;
}

/* Variante plus épaisse */
.progress-bar.progress-bar--lg {
  height: 14px;
}

/* Variante fine */
.progress-bar.progress-bar--sm {
  height: 4px;
}

/* Variante avec étiquette */
.progress-bar.progress-bar--labeled {
  height: 22px;
}

.progress-bar.progress-bar--labeled .progress-fill {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 0.5rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #FFFFFF;
}


/* ==========================================================================
   15. ÉTIQUETTE / CHIP (Tag)
   ========================================================================== */

/* --- Étiquette de base --- */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: #4A4840;
  background-color: #F5F5F3;
  border: 1px solid #E8E6E1;
  border-radius: 9999px;
  line-height: 1.4;
  white-space: nowrap;
}

/* --- Étiquette cliquable --- */
.tag-clickable {
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.tag-clickable:hover {
  background-color: #E8E6E1;
  border-color: #4A90D9;
  color: #1A3A6B;
}

/* --- Étiquette active --- */
.tag-active {
  background-color: #1A3A6B;
  border-color: #1A3A6B;
  color: #FFFFFF;
}

/* Bouton de suppression dans l'étiquette */
.tag .tag-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  margin-left: 0.375rem;
  font-size: 0.625rem;
  line-height: 1;
  border-radius: 50%;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  opacity: 0.6;
  transition: opacity 0.2s ease;
  padding: 0;
}

.tag .tag-remove:hover {
  opacity: 1;
}


/* ==========================================================================
   16. FIL D'ARIANE (Breadcrumb)
   ========================================================================== */

/* --- Liste de navigation --- */
.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.8125rem;
  gap: 0;
}

/* --- Élément du fil --- */
.breadcrumb-item {
  display: flex;
  align-items: center;
  color: #4A4840;
}

.breadcrumb-item a {
  color: #1A3A6B;
  text-decoration: none;
  transition: color 0.2s ease;
}

.breadcrumb-item a:hover {
  color: #4A90D9;
  text-decoration: underline;
}

/* Séparateur entre les éléments */
.breadcrumb-item + .breadcrumb-item::before {
  content: "/";
  margin: 0 0.5rem;
  color: #E8E6E1;
  font-weight: 400;
}

/* --- Élément courant (non cliquable) --- */
.breadcrumb-current {
  color: #333130;
  font-weight: 600;
}


/* ==========================================================================
   17. CITATION (Blockquote)
   ========================================================================== */

/* --- Citation OIMAP --- */
.blockquote-oimap {
  border-left: 4px solid #B8860B;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  background-color: #FDF6E3;
  border-radius: 0 0.5rem 0.5rem 0;
}

.blockquote-oimap p {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 1.0625rem;
  color: #0C1B33;
  line-height: 1.6;
  margin: 0 0 0.75rem;
}

.blockquote-oimap p:last-of-type {
  margin-bottom: 0.75rem;
}

/* --- Attribution de la citation --- */
.blockquote-oimap cite,
.blockquote-oimap .blockquote-attribution {
  display: block;
  font-family: inherit;
  font-style: normal;
  font-size: 0.8125rem;
  color: #4A4840;
  font-weight: 500;
}

.blockquote-oimap .blockquote-attribution::before {
  content: "\2014\00A0";
}
