/**
 * Dashboard humanitaire — UI/UX orientée coordination humanitaire
 * Widgets interactifs, glassmorphism, animations
 */

/* === Variables humanitaires === */
:root {
  --hum-blue: #0B3C5D;
  --hum-blue-light: #1e5a8a;
  --hum-green: #047857;
  --hum-orange: #ea580c;
  --hum-red: #dc2626;
  --hum-amber: #d97706;
  --hum-glass: rgba(255,255,255,0.85);
  --hum-glass-border: rgba(255,255,255,0.5);
  --hum-shadow: 0 4px 20px rgba(11,60,93,0.12);
  --hum-shadow-hover: 0 8px 32px rgba(11,60,93,0.18);
}

/* === Widgets humanitaires — carte glassmorphism === */
.page-home .dj-widget-hum {
  background: linear-gradient(135deg, var(--hum-glass) 0%, rgba(255,255,255,0.75) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--hum-glass-border);
  border-radius: 12px;
  box-shadow: var(--hum-shadow);
  padding: 8px 10px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  position: relative;
  overflow: hidden;
  min-height: 0;
}
.page-home .dj-widget-hum .dj-widget-stats {
  overflow: hidden;
  min-height: 0;
  flex: 1;
}
.page-home .dj-widget-hum::before { display: none; }
.page-home .dj-widget-hum:hover {
  transform: translateY(-2px);
  box-shadow: var(--hum-shadow-hover);
  border-color: rgba(255,255,255,0.8);
}

/* Titres avec icônes */
.page-home .dj-widget-title-split {
  justify-content: space-between !important;
}
.page-home .dj-title-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  color: #047857;
  background: rgba(4,120,87,0.08);
  border: 1px solid rgba(4,120,87,0.2);
  border-radius: 999px;
  padding: 1px 8px;
  white-space: nowrap;
  flex-shrink: 0;
}
.page-home .dj-title-badge i { font-size: 0.7rem; }
.page-home .dj-widget-hum .dj-widget-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--hum-blue);
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.page-home .dj-widget-hum .dj-widget-title i {
  font-size: 0.9rem;
  opacity: 0.9;
  flex-shrink: 0;
}
.page-home .dj-widget-hum.dj-widget-3 .dj-widget-title { color: #b91c1c; }
.page-home .dj-widget-hum.dj-widget-2 .dj-widget-title { color: #047857; }
.page-home .dj-widget-hum.dj-widget-5 .dj-widget-title { color: #1d4ed8; }
.page-home .dj-widget-hum.dj-widget-6 .dj-widget-title { color: #b45309; }

/* === Chips interactifs — style carte cliquable === */
.page-home .dj-chip-interactive {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 8px 12px;
  padding-left: 14px;
  border-left: 4px solid var(--chip-color, var(--hum-blue));
  background: rgba(255,255,255,0.9);
  border-radius: 8px;
  font-size: 0.75rem;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.page-home .dj-chip-interactive::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: calc(var(--chip-pct, 0) * 1%);
  height: 2px;
  background: var(--chip-color, var(--hum-blue));
  opacity: 0.4;
  transition: width 0.3s ease;
}
.page-home .dj-chip-interactive:hover {
  background: #fff;
  transform: translateX(4px);
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
.page-home .dj-chip-interactive:focus-visible {
  outline: 2px solid var(--chip-color);
  outline-offset: 2px;
}
.page-home .dj-chip-interactive .dj-chip-label {
  font-weight: 700;
  color: #1e293b;
  flex: 1;
  min-width: 0;
}
.page-home .dj-chip-interactive .dj-chip-badge {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--chip-color);
  background: color-mix(in srgb, var(--chip-color) 15%, transparent);
  padding: 2px 8px;
  border-radius: 999px;
  flex-shrink: 0;
}
.page-home .dj-chip-interactive .dj-chip-value {
  font-weight: 600;
  color: #64748b;
  font-size: 0.72rem;
  white-space: nowrap;
}

/* Chips inline (profil) */
.page-home .dj-chip-list-inline .dj-chip-interactive {
  padding: 5px 10px;
  padding-left: 12px;
  font-size: 0.68rem;
}
.page-home .dj-chip-list-inline .dj-chip-interactive .dj-chip-badge {
  font-size: 0.62rem;
  padding: 1px 6px;
}

/* === Stat mini interactifs (urgence) === */
.page-home .dj-stat-interactive {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.95);
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  transition: all 0.25s ease;
  position: relative;
}
.page-home .dj-stat-interactive:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  border-color: rgba(220,38,38,0.3);
  background: #fff;
}
.page-home .dj-stat-interactive:focus-visible {
  outline: 2px solid #dc2626;
  outline-offset: 2px;
}
.page-home .dj-widget-urgence .dj-stat-interactive:hover {
  border-color: rgba(220,38,38,0.4);
}
.page-home .dj-stat-icon {
  font-size: 1.1rem;
  color: #64748b;
  margin-bottom: 2px;
}
.page-home .dj-widget-urgence .dj-stat-icon {
  color: #dc2626;
  opacity: 0.9;
}
.page-home .dj-stat-interactive:hover .dj-stat-icon {
  color: #dc2626;
  transform: scale(1.1);
  transition: transform 0.2s ease;
}

/* === Boutons widgets === */
.page-home .dj-widget-hum .dj-widget-btn {
  padding: 6px 14px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.2s ease;
}
.page-home .dj-widget-hum .dj-widget-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* === Animation d'entrée (stagger) === */
@keyframes dj-fade-in-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.page-home .dj-widget-hum {
  animation: dj-fade-in-up 0.5s ease backwards;
}
.page-home .dj-widget-hum[style*="order: 1"] { animation-delay: 0.05s; }
.page-home .dj-widget-hum[style*="order: 2"] { animation-delay: 0.1s; }
.page-home .dj-widget-hum[style*="order: 3"] { animation-delay: 0.15s; }
.page-home .dj-widget-hum[style*="order: 4"] { animation-delay: 0.2s; }
.page-home .dj-widget-hum[style*="order: 5"] { animation-delay: 0.25s; }
.page-home .dj-widget-hum[style*="order: 6"] { animation-delay: 0.3s; }
.page-home .dj-widget-hum[style*="order: 7"] { animation-delay: 0.35s; }
.page-home .dj-widget-hum[style*="order: 8"] { animation-delay: 0.4s; }

/* === Hero KPIs améliorés === */
.page-home .dj-hero-kpi {
  transition: transform 0.2s ease;
}
.page-home .dj-hero-kpi:hover {
  transform: scale(1.05);
}

/* === Bandeau alerte === */
.page-home .dj-alert-urgent {
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(220,38,38,0.15);
  transition: box-shadow 0.2s ease;
}
.page-home .dj-alert-urgent:hover {
  box-shadow: 0 4px 20px rgba(220,38,38,0.2);
}

/* === Urgence — indicateur pulse subtil === */
@keyframes dj-pulse-soft {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.85; }
}
.page-home .dj-widget-urgence .dj-widget-stat-alert {
  animation: dj-pulse-soft 2s ease-in-out infinite;
}

/* === Chart widget — fond dégradé léger === */
.page-home .dj-widget-chart.dj-widget-hum {
  background: linear-gradient(160deg, rgba(255,255,255,0.95) 0%, rgba(236,254,255,0.9) 100%);
}

/* ========== WIDGETS VARIÉS ========== */

/* Donut charts */
.page-home .dj-donut-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.page-home .dj-donut-container canvas {
  max-height: 80px;
  max-width: 80px;
  flex-shrink: 0;
}
.page-home .dj-donut-small canvas {
  max-height: 60px;
  max-width: 60px;
}
.page-home .dj-donut-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  justify-content: center;
  font-size: 0.55rem;
  color: #475569;
  overflow: hidden;
  line-height: 1.2;
}
.page-home .dj-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.page-home .dj-legend-item i {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}
.page-home .dj-widget-donut-wrap {
  align-items: center;
}

/* Age cards — 2 lignes */
.page-home .dj-age-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 4px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.page-home .dj-age-card {
  display: flex;
  flex-direction: column;
  padding: 4px 6px;
  background: rgba(255,255,255,0.9);
  border-radius: 6px;
  border: 1px solid rgba(0,0,0,0.08);
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
  min-height: 0;
  overflow: hidden;
}
.page-home .dj-age-card:hover {
  background: #fff;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  border-color: rgba(0,0,0,0.14);
}
.page-home .dj-age-label { font-size: 0.58rem; font-weight: 600; color: #64748b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page-home .dj-age-val { font-size: 0.85rem; font-weight: 800; color: #1e293b; }
.page-home .dj-age-pct { font-size: 0.6rem; font-weight: 600; color: var(--age-color); }
.page-home .dj-age-sub { font-size: 0.52rem; color: #94a3b8; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page-home .dj-age-card-total { background: rgba(11,60,93,0.06); border-color: rgba(11,60,93,0.15); }
.page-home .dj-age-card-total .dj-age-label { font-weight: 700; color: #0B3C5D; margin-bottom: 4px; }
.page-home .dj-age-card-total .dj-total-breakdown {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.55rem;
  font-weight: 600;
  color: #334155;
  line-height: 1.2;
}
.page-home .dj-age-card-total .dj-total-item {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Stat cards — 2 lignes par région */
.page-home .dj-stat-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 1fr;
  gap: 4px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.page-home .dj-stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px 6px;
  background: rgba(255,255,255,0.9);
  border-radius: 6px;
  border: 1px solid rgba(0,0,0,0.08);
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
  min-height: 0;
  overflow: hidden;
}
.page-home .dj-stat-card:hover {
  background: #fff;
  transform: scale(1.02);
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}
.page-home .dj-stat-card-val { font-size: 0.9rem; font-weight: 800; color: var(--stat-color); }
.page-home .dj-stat-card-label { font-size: 0.55rem; font-weight: 600; color: #64748b; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

/* Icon badges — PBS avec icônes */
.page-home .dj-icon-badges {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.page-home .dj-icon-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 6px;
  background: rgba(255,255,255,0.95);
  border-radius: 6px;
  border: 2px solid color-mix(in srgb, var(--badge-color) 30%, transparent);
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
  min-height: 0;
  overflow: hidden;
}
.page-home .dj-icon-badge:hover {
  background: #fff;
  border-color: var(--badge-color);
  transform: scale(1.02);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.page-home .dj-icon-badge i {
  font-size: 1rem;
  color: var(--badge-color);
  margin-bottom: 2px;
  flex-shrink: 0;
}
.page-home .dj-icon-badge-val { font-size: 0.85rem; font-weight: 800; color: #1e293b; }
.page-home .dj-icon-badge-lbl { font-size: 0.52rem; font-weight: 600; color: #64748b; text-align: center; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

/* Tag cloud — PBS en tags */
.page-home .dj-tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 4px;
  flex: 1;
  min-height: 0;
  align-content: flex-start;
  overflow: hidden;
}
.page-home .dj-tag {
  display: inline-block;
  padding: 2px 6px;
  background: color-mix(in srgb, var(--tag-color) 15%, white);
  border: 1px solid color-mix(in srgb, var(--tag-color) 40%, transparent);
  border-radius: 999px;
  font-size: 0.58rem;
  font-weight: 600;
  color: #334155;
  text-decoration: none;
  transition: all 0.2s ease;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.page-home .dj-tag:hover {
  background: var(--tag-color);
  color: #fff;
  transform: scale(1.05);
}

/* Profil 3 colonnes — cartes avec barres */
.page-home .dj-profil3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.page-home .dj-profil3-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 0;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.07);
  background: rgba(255,255,255,0.7);
}
.page-home .dj-profil3-head {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #fff;
  border-radius: 7px 7px 0 0;
  flex-shrink: 0;
}
.page-home .dj-profil3-head i { font-size: 0.7rem; }
.page-home .dj-profil3-edu .dj-profil3-head { background: linear-gradient(90deg, #1d4ed8, #3b82f6); }
.page-home .dj-profil3-occ .dj-profil3-head { background: linear-gradient(90deg, #047857, #10b981); }
.page-home .dj-profil3-eth .dj-profil3-head { background: linear-gradient(90deg, #b45309, #f59e0b); }
.page-home .dj-profil3-body {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 4px 5px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.page-home .dj-p3-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 2px;
  text-decoration: none;
  color: inherit;
  border-radius: 4px;
  transition: background 0.15s ease;
}
.page-home .dj-p3-row:hover { background: rgba(0,0,0,0.04); }
.page-home .dj-p3-lbl {
  font-size: 0.55rem;
  font-weight: 600;
  color: #334155;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.page-home .dj-p3-bar {
  flex: 0 0 40%;
  height: 4px;
  background: rgba(0,0,0,0.08);
  border-radius: 99px;
  overflow: hidden;
}
.page-home .dj-p3-fill {
  display: block;
  height: 100%;
  width: var(--p3-pct, 0%);
  background: var(--p3-color, #0B3C5D);
  border-radius: 99px;
  transition: width 0.5s ease;
}
.page-home .dj-p3-val {
  font-size: 0.55rem;
  font-weight: 700;
  color: var(--p3-color, #0B3C5D);
  white-space: nowrap;
  min-width: 22px;
  text-align: right;
}
@media (max-width: 767px) {
  .page-home .dj-profil3 { grid-template-columns: 1fr; }
}

/* Profil tags — sections empilées, tags en wrap */
.page-home .dj-profil-tags-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.page-home .dj-profil-section {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: 0;
  overflow: hidden;
}
.page-home .dj-profil-section-title {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  flex-shrink: 0;
}
.page-home .dj-profil-section-title i {
  font-size: 0.65rem;
  opacity: 0.85;
}
.page-home .dj-profil-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 4px;
  overflow: hidden;
  min-height: 0;
}
.page-home .dj-tag-profil {
  font-size: 0.58rem;
  padding: 2px 6px;
}

/* Profil grid — 3 colonnes (legacy) */
.page-home .dj-profil-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px 8px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.page-home .dj-profil-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 0;
  overflow: hidden;
  padding: 4px 0;
}
.page-home .dj-profil-col-title {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  flex-shrink: 0;
  margin: 0;
}
.page-home .dj-profil-col-title i {
  font-size: 0.7rem;
  opacity: 0.85;
}
.page-home .dj-profil-chips {
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: hidden;
  min-height: 0;
}
.page-home .dj-profil-chips .dj-chip-interactive {
  padding: 4px 8px;
  padding-left: 10px;
  font-size: 0.62rem;
}
.page-home .dj-profil-chips .dj-chip-interactive .dj-chip-label {
  font-size: 0.62rem;
}
.page-home .dj-profil-chips .dj-chip-interactive .dj-chip-badge {
  font-size: 0.58rem;
  padding: 1px 5px;
}
@media (max-width: 767px) {
  .page-home .dj-profil-grid {
    grid-template-columns: 1fr;
  }
}

/* Pill grid — Profil (legacy) */
.page-home .dj-pill-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.page-home .dj-pill-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 0;
  overflow: hidden;
}
.page-home .dj-pill-label {
  font-size: 0.52rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  flex-shrink: 0;
}
.page-home .dj-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 4px;
  overflow: hidden;
}
.page-home .dj-pill {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 5px;
  background: color-mix(in srgb, var(--pill-color) 12%, white);
  border-radius: 4px;
  font-size: 0.58rem;
  text-decoration: none;
  color: #334155;
  transition: all 0.2s ease;
  max-width: 100%;
  overflow: hidden;
}
.page-home .dj-pill .dj-pill-lbl,
.page-home .dj-pill .dj-pill-val {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.page-home .dj-pill:hover {
  background: var(--pill-color);
  color: #fff;
  transform: translateY(-1px);
}
.page-home .dj-pill-lbl { font-weight: 600; }
.page-home .dj-pill-val { font-weight: 800; color: var(--pill-color); }
.page-home .dj-pill:hover .dj-pill-val { color: rgba(255,255,255,0.95); }

/* Flux par point d'entrée — conteneur + résumé bas */
.page-home .dj-flux-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.page-home .dj-flux-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  flex-shrink: 0;
  border-top: 1px solid rgba(0,0,0,0.07);
  padding-top: 5px;
}
.page-home .dj-flux-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  text-decoration: none;
  padding: 4px 3px;
  border-radius: 6px;
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(0,0,0,0.06);
  transition: background 0.15s ease;
}
.page-home .dj-flux-stat:hover { background: rgba(255,255,255,0.95); }
.page-home .dj-flux-stat i {
  font-size: 0.7rem;
  color: #0B3C5D;
  opacity: 0.7;
}
.page-home .dj-flux-stat-val {
  font-size: 0.78rem;
  font-weight: 800;
  color: #0B3C5D;
  line-height: 1;
}
.page-home .dj-flux-stat-lbl {
  font-size: 0.48rem;
  font-weight: 600;
  color: #64748b;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Flux par point d'entrée — barres horizontales */
.page-home .dj-flux-bars {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.page-home .dj-flux-row {
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: inherit;
  padding: 3px 4px;
  border-radius: 5px;
  background: color-mix(in srgb, var(--flux-color) 5%, white);
  transition: background 0.15s ease, transform 0.15s ease;
}
.page-home .dj-flux-row:hover {
  background: color-mix(in srgb, var(--flux-color) 12%, white);
  transform: translateX(3px);
}
.page-home .dj-flux-lbl {
  font-size: 0.58rem;
  font-weight: 600;
  color: #334155;
  flex: 0 0 52px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.page-home .dj-flux-bar {
  flex: 1;
  height: 5px;
  background: rgba(0,0,0,0.07);
  border-radius: 99px;
  overflow: hidden;
}
.page-home .dj-flux-fill {
  display: block;
  height: 100%;
  width: var(--flux-pct, 0%);
  background: var(--flux-color, #0B3C5D);
  border-radius: 99px;
  transition: width 0.6s ease;
}
.page-home .dj-flux-val {
  font-size: 0.58rem;
  font-weight: 700;
  color: var(--flux-color, #0B3C5D);
  white-space: nowrap;
  min-width: 24px;
  text-align: right;
}

/* PBS par région — liste avec barres */
.page-home .dj-spn-region-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.page-home .dj-spn-row {
  display: flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  color: inherit;
  padding: 2px 3px;
  border-radius: 4px;
  transition: background 0.15s ease;
}
.page-home .dj-spn-row:hover { background: rgba(220,38,38,0.06); }
.page-home .dj-spn-region {
  font-size: 0.56rem;
  font-weight: 600;
  color: #334155;
  flex: 0 0 52px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.page-home .dj-spn-bar {
  flex: 1;
  height: 4px;
  background: rgba(220,38,38,0.12);
  border-radius: 99px;
  overflow: hidden;
}
.page-home .dj-spn-fill {
  display: block;
  height: 100%;
  width: var(--spn-pct, 0%);
  background: linear-gradient(90deg, #dc2626, #f87171);
  border-radius: 99px;
  transition: width 0.5s ease;
}
.page-home .dj-spn-val {
  font-size: 0.56rem;
  font-weight: 700;
  color: #dc2626;
  white-space: nowrap;
  min-width: 20px;
  text-align: right;
}

/* Split layout pour Répartition */
.page-home .dj-split-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 0;
  overflow: hidden;
}
.page-home .dj-split-title {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  flex-shrink: 0;
  padding-bottom: 2px;
  border-bottom: 1px solid rgba(0,0,0,0.07);
}
.page-home .dj-split-title i { font-size: 0.65rem; opacity: 0.85; }
.page-home .dj-widget-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 14px;
  min-height: 0;
  overflow: hidden;
}
.page-home .dj-widget-split > * {
  min-height: 0;
  overflow: hidden;
}
/* Séparateur vertical entre les deux sections */
.page-home .dj-widget-split .dj-split-section:first-child {
  box-shadow: inset -1px 0 0 rgba(100,116,139,0.28);
  padding-right: 10px;
}
.page-home .dj-widget-split .dj-split-section:last-child {
  padding-left: 4px;
}
@media (max-width: 600px) {
  .page-home .dj-widget-split { grid-template-columns: 1fr; }
}

/* Stat mini urgence — compact */
.page-home .dj-widget-stat-row-compact {
  gap: 4px;
}
.page-home .dj-stat-interactive {
  padding: 4px 6px;
  min-height: 0;
}
.page-home .dj-stat-interactive .dj-widget-stat-value {
  font-size: 0.85rem;
}
.page-home .dj-stat-interactive .dj-widget-stat-label {
  font-size: 0.55rem;
}
.page-home .dj-stat-icon {
  font-size: 0.9rem;
}
.page-home .dj-widget-stat-row-pbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin-top: 4px;
}
.page-home .dj-widget-stat-row-pbs:empty {
  display: none;
}
.page-home .dj-stat-pbs .dj-widget-stat-label {
  font-size: 0.5rem;
  line-height: 1.1;
}
.page-home .dj-stat-pbs .dj-widget-stat-value {
  font-size: 0.75rem;
}
.page-home .dj-stat-pbs .dj-stat-icon {
  font-size: 0.75rem;
}

/* Boutons widgets — compact */
.page-home .dj-widget-hum .dj-widget-actions {
  padding-top: 4px;
  gap: 3px;
  flex-shrink: 0;
}
.page-home .dj-widget-hum .dj-widget-btn {
  padding: 3px 8px;
  font-size: 0.65rem;
}

/* ============================================================
   LISIBILITÉ & COLORATION THÉMATIQUE PAR WIDGET
   ============================================================ */

/* --- Régions (order 1, dj-widget-4) : bleu ardoise --- */
.page-home .dj-widget-regions {
  background: linear-gradient(145deg, rgba(255,255,255,0.92) 0%, rgba(241,245,249,0.88) 100%);
}
.page-home .dj-widget-regions .dj-stat-card {
  border: 1px solid rgba(0,0,0,0.08);
}
.page-home .dj-stat-card-val {
  font-size: 1rem;
  font-weight: 800;
}
.page-home .dj-stat-card-label {
  font-size: 0.6rem;
  font-weight: 600;
  color: #475569;
}
.page-home .dj-widget-regions .dj-widget-btn {
  background: #1e3a5f;
  color: #fff;
}
.page-home .dj-widget-regions .dj-widget-btn:hover {
  background: #2d4f7c;
}

/* --- Âge & genre (order 2, dj-widget-2) : vert émeraude --- */
.page-home .dj-widget-hum.dj-widget-2:not(.dj-widget-profil) {
  background: linear-gradient(145deg, rgba(255,255,255,0.92) 0%, rgba(240,253,244,0.88) 100%);
}
.page-home .dj-widget-hum.dj-widget-2:not(.dj-widget-profil) .dj-widget-btn {
  background: #047857;
  color: #fff;
}
.page-home .dj-widget-hum.dj-widget-2:not(.dj-widget-profil) .dj-widget-btn:hover {
  background: #065f46;
}
.page-home .dj-age-label {
  font-size: 0.62rem;
  font-weight: 700;
  color: #374151;
}
.page-home .dj-age-val {
  font-size: 0.92rem;
  font-weight: 800;
}
.page-home .dj-age-gender {
  font-size: 0.56rem;
  font-weight: 600;
}
.page-home .dj-age-gender .dj-age-f { color: #db2777; }
.page-home .dj-age-gender .dj-age-m { color: #1d4ed8; }

/* --- Flux (order 3, dj-widget-5) : indigo --- */
.page-home .dj-widget-points-entree {
  background: linear-gradient(145deg, rgba(255,255,255,0.92) 0%, rgba(238,242,255,0.88) 100%);
}
.page-home .dj-flux-lbl {
  font-size: 0.62rem;
  font-weight: 700;
  color: #1e293b;
}
.page-home .dj-flux-val {
  font-size: 0.62rem;
  font-weight: 800;
}
.page-home .dj-flux-stat-val {
  font-size: 0.85rem;
  font-weight: 800;
  color: #1d4ed8;
}
.page-home .dj-flux-stat i { color: #1d4ed8; font-size: 0.8rem; }
.page-home .dj-flux-stat { border-top: 2px solid rgba(29,78,216,0.15); }
.page-home .dj-flux-stat-lbl { font-size: 0.55rem; font-weight: 700; color: #475569; }
.page-home .dj-widget-points-entree .dj-widget-btn {
  background: #1d4ed8;
  color: #fff;
}
.page-home .dj-widget-points-entree .dj-widget-btn:hover {
  background: #1e40af;
}

/* --- Urgence (order 4, dj-widget-3) : rouge --- */
.page-home .dj-widget-urgence {
  background: linear-gradient(145deg, #fff7f7 0%, #fef2f2 100%) !important;
}
.page-home .dj-widget-urgence .dj-widget-stat-label {
  font-size: 0.62rem;
  font-weight: 700;
  color: #6b1818;
}
.page-home .dj-widget-urgence .dj-widget-stat-value {
  font-size: 0.95rem;
  font-weight: 800;
}
.page-home .dj-widget-urgence .dj-widget-btn {
  background: #b91c1c;
  color: #fff;
}
.page-home .dj-widget-urgence .dj-widget-btn:hover {
  background: #991b1b;
}
.page-home .dj-widget-urgence .dj-widget-stat-mini {
  background: rgba(254,242,242,0.8);
  border-color: rgba(220,38,38,0.15);
}

/* --- Profil réfugiés (order 5, dj-widget-profil) --- */
.page-home .dj-widget-profil {
  background: linear-gradient(145deg, rgba(255,255,255,0.92) 0%, rgba(245,243,255,0.88) 100%);
}
.page-home .dj-p3-lbl {
  font-size: 0.62rem;
  font-weight: 700;
  color: #1e293b;
}
.page-home .dj-p3-val {
  font-size: 0.62rem;
  font-weight: 800;
}
.page-home .dj-widget-profil .dj-widget-btn {
  background: #6d28d9;
  color: #fff;
}
.page-home .dj-widget-profil .dj-widget-btn:hover {
  background: #5b21b6;
}

/* --- Tendance (order 6, dj-widget-1 / chart) --- */
.page-home .dj-widget-chart.dj-widget-hum {
  background: linear-gradient(145deg, rgba(255,255,255,0.92) 0%, rgba(236,254,255,0.88) 100%);
}
.page-home .dj-widget-chart .dj-widget-btn {
  background: #0c4a6e;
  color: #fff;
}
.page-home .dj-widget-chart .dj-widget-btn:hover {
  background: #0e7490;
}

/* --- Répartition (order 7, dj-widget-4 + split) --- */
.page-home .dj-split-title {
  font-size: 0.62rem;
  font-weight: 800;
  color: #334155;
  letter-spacing: 0.05em;
}
.page-home .dj-spn-region {
  font-size: 0.62rem;
  font-weight: 700;
  color: #1e293b;
}
.page-home .dj-spn-val {
  font-size: 0.62rem;
  font-weight: 800;
}

/* --- Âge & genre — couleurs et lisibilité --- */
.page-home .dj-age-label {
  font-size: 0.63rem;
  font-weight: 700;
  color: #374151;
}
.page-home .dj-age-val {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--age-color);
}
.page-home .dj-age-pct {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--age-color);
  opacity: 0.8;
}
.page-home .dj-age-sub {
  font-size: 0.54rem;
  color: #64748b;
}
/* Carte total : Hommes/Femmes/Enfants colorés */
.page-home .dj-total-breakdown { font-size: 0.57rem; font-weight: 600; gap: 3px; }
.page-home .dj-total-item:nth-child(1) { color: #1d4ed8; }
.page-home .dj-total-item:nth-child(2) { color: #db2777; }
.page-home .dj-total-item:nth-child(3) { color: #d97706; }

/* --- Légende donut --- */
.page-home .dj-donut-legend {
  font-size: 0.6rem;
  color: #374151;
}
.page-home .dj-legend-item i {
  width: 6px;
  height: 6px;
}

/* --- PBS breakdown (Urgence widget) --- */
.page-home .dj-stat-pbs .dj-widget-stat-label {
  font-size: 0.56rem;
  line-height: 1.2;
  font-weight: 700;
  color: #7f1d1d;
}
.page-home .dj-stat-pbs .dj-widget-stat-value {
  font-size: 0.82rem;
  font-weight: 800;
  color: #b91c1c;
}
.page-home .dj-stat-pbs .dj-stat-icon {
  font-size: 0.78rem;
  color: #dc2626;
}
.page-home .dj-stat-pbs {
  background: rgba(254,242,242,0.6);
  border: 1px solid rgba(220,38,38,0.12);
}

/* --- Amélioration globale des boutons actions --- */
.page-home .dj-widget-hum .dj-widget-actions {
  border-top: 1px solid rgba(0,0,0,0.06);
  margin-top: 2px;
}
.page-home .dj-widget-hum .dj-widget-btn {
  font-size: 0.62rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 6px;
  letter-spacing: 0.02em;
  text-transform: none;
  opacity: 0.92;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.page-home .dj-widget-hum .dj-widget-btn:hover {
  opacity: 1;
  transform: translateY(-1px);
}


/* ============================================================
   RESPONSIVE MOBILE — Page d'accueil
   Breakpoints : 1024px (tablet), 768px (petite tablette), 480px (mobile)
   ============================================================ */

/* ── Header : indicateurs masqués sous 640px (page accueil) ─── */
@media (max-width: 640px) {
  .dj-header-indicators {
    display: none;
  }
  .dj-header-bar {
    padding: 6px 12px;
  }
}

/* ── Hero strip : KPIs en grille 3×2 sur mobile ─────────────── */
@media (max-width: 640px) {
  .page-home .dj-hero-strip-content {
    padding: 8px 10px 6px;
  }
  .page-home .dj-hero-title {
    font-size: 0.88rem;
    margin-bottom: 6px;
  }
  .page-home .dj-hero-kpis {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px 8px;
  }
  .page-home .dj-hero-kpi {
    flex-direction: column;
    gap: 1px;
  }
  .page-home .dj-hero-kpi-val {
    font-size: 1rem;
  }
  .page-home .dj-hero-kpi-lbl {
    font-size: 0.56rem;
    line-height: 1.2;
  }
}

/* ── Désactiver le zoom auto JS (< 1280px) ──────────────────────── */
/* Supprime la contrainte hauteur + overflow cachée du body */
@media (max-width: 1279px) {
  body.page-home {
    height: auto !important;
    min-height: 100vh;
    overflow: auto !important;
  }
  .page-home .dj-dashboard {
    zoom: 1 !important;
  }
  .page-home .site-main {
    zoom: 1 !important;
    height: auto !important;
    min-height: 0;
    overflow: visible !important;
    flex: none !important;
    padding: 4px 12px 32px;
  }
  .page-home .dj-dashboard-fit {
    overflow: visible !important;
    height: auto !important;
    align-items: flex-start;
    flex: none;
  }
  .page-home .dj-dashboard {
    flex: none !important;
    height: auto !important;
    overflow: visible !important;
    gap: 10px;
  }
}

/* ── Grille des widgets : 2 colonnes de 640px à 1279px ──────────── */
@media (min-width: 640px) and (max-width: 1279px) {
  .page-home .dj-cards-grid.dj-cards-grid-4x2 {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
    gap: 12px;
  }
  .page-home .dj-cards-grid.dj-cards-grid-4x2 > article {
    grid-column: span 1 !important;
    height: auto !important;
    min-height: 220px;
  }
}

/* ── Grille des widgets : 1 colonne sous 640px ───────────────────── */
@media (max-width: 639px) {
  .page-home .dj-cards-grid.dj-cards-grid-4x2 {
    display: flex !important;
    flex-direction: column;
    gap: 10px;
    padding: 0 0 16px;
  }
  .page-home .dj-cards-grid.dj-cards-grid-4x2 > article {
    width: 100%;
    height: auto !important;
    min-height: 180px;
  }
}

/* ── Hauteurs et overflow des widgets (< 1280px) ──────────────── */
@media (max-width: 1279px) {
  .page-home .dj-widget-hum {
    overflow: visible;
    flex-shrink: 0;
  }
  .page-home .dj-widget-hum .dj-widget-stats {
    overflow: visible;
    min-height: 0;
  }
  /* Graphique tendance : hauteur fixe */
  .page-home .dj-widget-chart-wrap {
    height: 220px !important;
    min-height: 220px;
  }
  /* Widget donut : hauteur pour le canvas */
  .page-home .dj-donut-container {
    min-height: 120px;
  }
  /* KPIs stat mini : flex-wrap autorisé */
  .page-home .dj-widget-stat-row {
    flex-wrap: wrap;
  }
  .page-home .dj-widget-stat-row-compact {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* ── Bandeau d'urgence : plus compact sur mobile ─────────────── */
@media (max-width: 640px) {
  .page-home .dj-alert-urgent {
    padding: 3px 10px;
    font-size: 0.72rem;
  }
  .page-home .dj-alert-urgent-badge {
    font-size: 0.6rem;
    padding: 2px 6px;
  }
}

/* ── Profil 3 colonnes : 1 colonne sur mobile ─────────────────── */
@media (max-width: 640px) {
  .page-home .dj-profil3 {
    grid-template-columns: 1fr;
  }
}

/* ── Grille régions / age cards : scroll horizontal ─────────── */
@media (max-width: 639px) {
  .page-home .dj-stat-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  .page-home .dj-stat-card {
    min-width: 70px;
    flex: 1 1 70px;
  }
  .page-home .dj-age-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
  }
}

/* ── Badge bas de page ─────────────────────────────────────── */
@media (max-width: 480px) {
  .page-home .text-center.pt-2 .badge {
    font-size: 0.68rem;
    padding: 6px 8px;
    border-radius: 6px;
  }
}