/* =========================================================================
   Dashboard unifie (Priorite 2, audit GED 2026-05-06)
   Hero unique remplacant les 5 zones concurrentes du dashboard d'origine.
   100% additif via la classe body.gd-unified-dashboard.
   Sans la classe : ZERO effet, l'ancien dashboard reste intact.
   ========================================================================= */

/* ---- Masquage des 5 zones concurrentes en mode unifie ---- */
body.gd-unified-dashboard #decision-hero { display: none !important; }
body.gd-unified-dashboard #decision-hub-bandeau-wrapper { display: none !important; }
body.gd-unified-dashboard .decision-hub-detail { display: none !important; }
body.gd-unified-dashboard #dashboard-hero { display: none !important; }
/* kpi-grid : on garde mais en strip compact discret juste sous le hero */
body.gd-unified-dashboard #kpi-grid {
  margin-top: 8px;
  margin-bottom: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
}
body.gd-unified-dashboard #kpi-grid .kpi-card {
  padding: 10px 12px !important;
  font-size: .82rem !important;
  border-radius: 10px !important;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
body.gd-unified-dashboard #kpi-grid .kpi-icon {
  width: 28px !important;
  height: 28px !important;
  font-size: .85rem !important;
}
body.gd-unified-dashboard #kpi-grid .kpi-value {
  font-size: 1.1rem !important;
  font-weight: 700 !important;
}
body.gd-unified-dashboard #kpi-grid .kpi-label {
  font-size: .72rem !important;
  color: #64748b !important;
}

/* ---- Hero unifie ---- */

#gd-unified-hero {
  position: relative;
  margin: 0 0 18px;
  padding: 28px 32px;
  border-radius: 18px;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #2563eb 100%);
  color: #ffffff;
  box-shadow: 0 16px 32px rgba(15, 23, 42, .14);
  overflow: hidden;
  isolation: isolate;
}

/* Halo decoratif animee (subtil, premium) */
#gd-unified-hero::before {
  content: "";
  position: absolute;
  top: -40%;
  right: -10%;
  width: 460px;
  height: 460px;
  background: radial-gradient(closest-side, rgba(96, 165, 250, .35), transparent 70%);
  filter: blur(8px);
  z-index: -1;
  animation: gd-uh-halo 18s linear infinite;
}
@keyframes gd-uh-halo {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(-30px, 20px) scale(1.05); }
  100% { transform: translate(0, 0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  #gd-unified-hero::before { animation: none; }
}

#gd-unified-hero[data-tone="success"] {
  background: linear-gradient(135deg, #064e3b 0%, #047857 60%, #10b981 100%);
}
#gd-unified-hero[data-tone="success"]::before {
  background: radial-gradient(closest-side, rgba(110, 231, 183, .35), transparent 70%);
}

/* Layout interne */
.gd-uh-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.gd-uh-greet { font-size: .9rem; opacity: .8; margin: 0 0 6px; letter-spacing: .02em; font-weight: 500; }
.gd-uh-headline { font-size: 1.55rem; font-weight: 700; margin: 0 0 6px; letter-spacing: -.01em; line-height: 1.2; }
.gd-uh-headline .gd-uh-count {
  display: inline-block;
  font-size: 2.4rem;
  font-weight: 800;
  background: rgba(255, 255, 255, .14);
  padding: 0 14px;
  border-radius: 12px;
  margin-right: 6px;
  vertical-align: middle;
  min-width: 64px;
  text-align: center;
}
.gd-uh-sub { font-size: .92rem; color: rgba(255, 255, 255, .82); margin: 0 0 18px; max-width: 60ch; }

.gd-uh-controls {
  display: flex;
  gap: 6px;
  align-items: center;
}
.gd-uh-toggle {
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .18);
  color: rgba(255, 255, 255, .85);
  padding: 6px 11px;
  border-radius: 8px;
  font-size: .76rem;
  cursor: pointer;
  font: inherit;
  font-size: .76rem;
  font-weight: 500;
  transition: background .15s ease, color .15s ease;
}
.gd-uh-toggle:hover { background: rgba(255, 255, 255, .18); color: #fff; }

/* Liste des actions */
.gd-uh-actions { display: grid; gap: 10px; margin: 0 0 18px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .gd-uh-actions { grid-template-columns: repeat(3, 1fr); } }

.gd-uh-action {
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: background .15s ease, transform .12s ease, border-color .15s ease;
  text-align: left;
  color: inherit;
  font: inherit;
  width: 100%;
}
.gd-uh-action:hover {
  background: rgba(255, 255, 255, .14);
  border-color: rgba(255, 255, 255, .25);
  transform: translateY(-1px);
}
.gd-uh-action:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.gd-uh-action-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  flex-shrink: 0;
}
.gd-uh-action-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.gd-uh-action[data-severity="danger"] .gd-uh-action-icon  { background: rgba(248, 113, 113, .25); color: #fecaca; }
.gd-uh-action[data-severity="warn"]   .gd-uh-action-icon  { background: rgba(251, 191, 36, .22); color: #fde68a; }
.gd-uh-action[data-severity="info"]   .gd-uh-action-icon  { background: rgba(96, 165, 250, .22); color: #bfdbfe; }

.gd-uh-action-text { min-width: 0; flex: 1; }
.gd-uh-action-title { font-size: .92rem; font-weight: 600; color: #fff; line-height: 1.2; margin: 0 0 2px; }
.gd-uh-action-sub { font-size: .77rem; color: rgba(255, 255, 255, .72); line-height: 1.3; margin: 0; }
.gd-uh-action-arrow { color: rgba(255, 255, 255, .55); flex-shrink: 0; transition: transform .15s ease, color .15s ease; }
.gd-uh-action-arrow svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.gd-uh-action:hover .gd-uh-action-arrow { transform: translateX(2px); color: #fff; }

/* Bouton primaire CTA "Tout voir" */
.gd-uh-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  color: #0f172a;
  padding: 9px 16px;
  border-radius: 9px;
  font-weight: 600;
  font-size: .85rem;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .15s ease;
}
.gd-uh-cta:hover { transform: translateY(-1px); box-shadow: 0 6px 14px rgba(255, 255, 255, .25); }
.gd-uh-cta-secondary {
  background: transparent;
  color: rgba(255, 255, 255, .9);
  border: 1px solid rgba(255, 255, 255, .25);
  padding: 9px 14px;
  border-radius: 9px;
  font-weight: 500;
  font-size: .85rem;
  cursor: pointer;
}
.gd-uh-cta-secondary:hover { background: rgba(255, 255, 255, .12); }

.gd-uh-footer { display: flex; gap: 10px; flex-wrap: wrap; }

/* Etat vide (zen) */
.gd-uh-zen { text-align: left; padding: 6px 0 4px; }
.gd-uh-zen .gd-uh-zen-icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  margin-bottom: 12px;
}
.gd-uh-zen .gd-uh-zen-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; }

/* Skeleton initial */
.gd-uh-skel { display: flex; flex-direction: column; gap: 10px; }
.gd-uh-skel-line {
  height: 14px;
  border-radius: 7px;
  background: rgba(255, 255, 255, .14);
  background-image: linear-gradient(90deg, rgba(255,255,255,.08) 0%, rgba(255,255,255,.22) 50%, rgba(255,255,255,.08) 100%);
  background-size: 200% 100%;
  animation: gd-uh-shim 1.4s linear infinite;
}
.gd-uh-skel-line.lg { height: 22px; width: 50%; }
.gd-uh-skel-line.sm { height: 10px; width: 35%; }
@keyframes gd-uh-shim { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .gd-uh-skel-line { animation: none; } }

/* Compteur anime "count up" */
.gd-uh-count[data-animating="true"] { transition: opacity .25s ease; opacity: .9; }

/* Responsive : compact mobile */
@media (max-width: 640px) {
  #gd-unified-hero { padding: 22px 18px; border-radius: 14px; }
  .gd-uh-headline { font-size: 1.2rem; }
  .gd-uh-headline .gd-uh-count { font-size: 1.7rem; padding: 0 10px; min-width: 50px; }
  .gd-uh-action { padding: 10px 12px; }
  .gd-uh-controls { position: absolute; top: 14px; right: 14px; }
}
