/* ==========================================================================
   SELACV GRH — Tableau de bord visuel de l'onglet « Analyses RH » (V9.6)
   Couleurs reprises des variables du site (--accent, --surface, --ink…) :
   le thème sombre s'applique automatiquement ; quelques réglages en fin de fichier.
   ========================================================================== */
.gd { --gd-navy: #22356f; margin: 6px 0 18px; }
.gd h3 { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; color: var(--accent); font-size: 15px; }
.gd h3 > span { font-size: 17px; }
.gd h3 small { margin-left: auto; color: var(--ink-soft); font-size: 11.5px; font-weight: 700; }
.gd-detail-title { margin: 22px 0 6px; padding-top: 16px; border-top: 2px dashed var(--line); color: var(--accent); font-size: 17px; }

/* Bandeau */
.gd-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  overflow: hidden;
  margin-bottom: 14px;
  padding: 22px 26px;
  border-radius: 16px;
  background: linear-gradient(120deg, #182753 0%, #22356f 45%, #3f67c4 100%);
  color: #fff;
  box-shadow: 0 16px 36px rgba(24, 39, 83, .28);
}
.gd-hero::before, .gd-hero::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .08); pointer-events: none; }
.gd-hero::before { width: 280px; height: 280px; right: -70px; top: -140px; }
.gd-hero::after { width: 150px; height: 150px; right: 210px; bottom: -100px; }
.gd-hero-text { position: relative; z-index: 1; }
.gd-eyebrow { margin: 0 0 6px; color: #c9d8ff; font-size: 11px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.gd-hero h3 { display: block; margin: 0 0 8px; color: #fff; font-size: clamp(19px, 2.2vw, 27px); line-height: 1.2; }
.gd-hero p { margin: 0; color: #e6edff; font-size: 14px; line-height: 1.55; }
.gd-hero p b { color: #fff; }
.gd-hero-badge {
  position: relative;
  z-index: 1;
  display: grid;
  place-content: center;
  flex: none;
  width: 116px;
  height: 116px;
  border: 3px solid rgba(255, 255, 255, .45);
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  text-align: center;
}
.gd-hero-badge b { font-size: 32px; line-height: 1; }
.gd-hero-badge b small { font-size: 16px; }
.gd-hero-badge span { margin-top: 4px; color: #dbe5ff; font-size: 11px; font-weight: 800; }

/* Chiffres clés */
.gd-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.gd-kpi {
  position: relative;
  overflow: hidden;
  padding: 15px 15px 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
}
.gd-kpi:hover { transform: translateY(-3px); box-shadow: 0 14px 28px rgba(34, 53, 111, .14); }
.gd-kpi::after { content: ""; position: absolute; inset: auto 0 0; height: 4px; background: linear-gradient(90deg, #22356f, #3f67c4); }
.gd-kpi:nth-child(2)::after { background: linear-gradient(90deg, #2f9a60, #7fd1a1); }
.gd-kpi:nth-child(3)::after { background: linear-gradient(90deg, #c2578a, #f0a3c4); }
.gd-kpi:nth-child(4)::after { background: linear-gradient(90deg, #e0a800, #ffd666); }
.gd-kpi:nth-child(5)::after { background: linear-gradient(90deg, #1f9bb3, #7fd6e6); }
.gd-kpi:nth-child(6)::after { background: linear-gradient(90deg, #7c5cd6, #b9a6f2); }
.gd-kpi-icon { position: absolute; top: 11px; right: 11px; font-size: 21px; }
.gd-kpi b { display: block; color: var(--accent); font-size: 26px; font-weight: 900; line-height: 1.1; }
.gd-kpi h4 { margin: 5px 0 2px; color: var(--ink); font-size: 13px; }
.gd-kpi p { margin: 0; color: var(--ink-soft); font-size: 11.5px; line-height: 1.35; }

/* Grille */
.gd-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.gd-card { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: var(--shadow); }
.gd-wide { grid-column: span 2; }
.gd-full { grid-column: 1 / -1; }
.gd-note { margin: 12px 0 0; padding: 9px 12px; border-radius: 10px; background: var(--accent-soft); color: var(--ink); font-size: 12.5px; line-height: 1.45; }
.gd-note b { color: var(--accent); }
.gd-empty { margin: 4px 0 0; padding: 16px; border: 1px dashed var(--line); border-radius: 10px; color: var(--ink-soft); font-size: 12.5px; text-align: center; }
.gd-mini-title { margin: 14px 0 8px; color: var(--ink-soft); font-size: 11px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }

/* Colonnes mensuelles */
.gd-columns { display: grid; grid-template-columns: repeat(var(--n, 12), minmax(0, 1fr)); gap: 6px; align-items: end; height: 220px; }
.gd-col { display: grid; grid-template-rows: auto 1fr auto; height: 100%; min-width: 0; text-align: center; }
.gd-col-value { min-height: 17px; color: var(--accent); font-size: 11.5px; font-weight: 900; }
.gd-col-bar { display: flex; flex-direction: column-reverse; overflow: hidden; border-radius: 7px 7px 3px 3px; background: var(--surface-alt); }
.gd-col-bar i { display: block; width: 100%; transform-origin: bottom; }
.gd-col-bar i + i { box-shadow: 0 -1px 0 rgba(255, 255, 255, .7); }
.gd-col.is-best .gd-col-bar { outline: 2px solid #2f9a60; outline-offset: 2px; }
.gd-col-label { padding-top: 5px; color: var(--ink-soft); font-size: 10.5px; font-weight: 800; }
.gd-col-label small { display: block; color: var(--accent); font-size: 9.5px; }
.gd-legend-inline { display: flex; flex-wrap: wrap; gap: 5px 14px; margin-top: 10px; color: var(--ink); font-size: 12px; font-weight: 700; }
.gd-legend-inline span { display: inline-flex; align-items: center; gap: 6px; }
.gd-legend-inline i { width: 11px; height: 11px; border-radius: 3px; }

/* Jauges */
.gd-gauges { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 10px; }
.gd-gauge { display: grid; justify-items: center; gap: 4px; text-align: center; }
.gd-gauge-ring {
  display: grid;
  place-content: center;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--surface) 73%, transparent 74% 100%), conic-gradient(var(--c) calc(var(--p) * 1%), var(--surface-alt) 0);
}
.gd-gauge-ring span { font-size: 19px; line-height: 1; }
.gd-gauge-ring b { color: var(--ink); font-size: 15px; }
.gd-gauge h4 { margin: 4px 0 0; color: var(--ink); font-size: 12.5px; }
.gd-gauge small { color: var(--ink-soft); font-size: 11px; line-height: 1.3; }

/* Rythme de la semaine */
.gd-week { display: grid; gap: 8px; }
.gd-week-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) 40px; gap: 8px; align-items: center; font-size: 12px; }
.gd-week-row span { color: var(--ink-soft); font-weight: 800; }
.gd-week-row b { color: #2f9a60; text-align: right; }
.gd-week-bar { display: flex; overflow: hidden; height: 20px; border-radius: 6px; background: var(--surface-alt); }
.gd-week-bar i { display: block; min-width: 2px; transform-origin: left; }
.gd-week-hint { margin: 8px 0 0; color: var(--ink-soft); font-size: 11px; }

/* Barres horizontales */
.gd-hbars { display: grid; gap: 9px; }
.gd-hbar { display: grid; grid-template-columns: minmax(100px, 44%) minmax(0, 1fr) auto; gap: 9px; align-items: center; font-size: 12.5px; }
.gd-hbar-label { display: flex; align-items: center; gap: 6px; overflow: hidden; color: var(--ink); font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.gd-hbar-label em { flex: none; width: 22px; font-style: normal; text-align: center; }
.gd-hbar-label em small { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--surface-alt); color: var(--ink-soft); font-size: 10px; font-weight: 900; }
.gd-hbar-track { height: 12px; overflow: hidden; border-radius: 999px; background: var(--surface-alt); }
.gd-hbar-track i { display: block; width: var(--w); height: 100%; border-radius: inherit; transform-origin: left; }
.gd-hbar b { min-width: 26px; color: var(--accent); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Anneau */
.gd-donut-wrap { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 14px; align-items: center; }
.gd-donut { width: 132px; height: 132px; }
.gd-donut circle { transition: stroke-width .2s; }
.gd-donut circle:hover { stroke-width: 26; }
.gd-donut-num { fill: var(--accent); font-size: 25px; font-weight: 900; }
.gd-donut-lbl { fill: var(--ink-soft); font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.gd-legend { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.gd-legend li { display: grid; grid-template-columns: 11px minmax(0, 1fr) auto auto; gap: 7px; align-items: center; font-size: 12px; }
.gd-legend i { width: 11px; height: 11px; border-radius: 3px; }
.gd-legend span { overflow: hidden; color: var(--ink); font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.gd-legend b { color: var(--accent); }
.gd-legend small { min-width: 20px; color: var(--ink-soft); text-align: right; }

/* Catégories A / B / C */
.gd-cats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.gd-cat { display: grid; gap: 1px; justify-items: center; padding: 9px 6px; border-radius: 11px; background: color-mix(in srgb, var(--cc) 11%, var(--surface)); border: 1px solid color-mix(in srgb, var(--cc) 35%, transparent); }
.gd-cat-a { --cc: #5d3aa8; } .gd-cat-b { --cc: #184f86; } .gd-cat-c { --cc: #18864b; }
.gd-cat b { color: var(--cc); font-size: 20px; line-height: 1; }
.gd-cat span { color: var(--ink); font-size: 14px; font-weight: 900; }
.gd-cat small { color: var(--ink-soft); font-size: 10.5px; }

/* Marches d'ancienneté */
.gd-steps { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; align-items: end; }
.gd-step { display: grid; gap: 3px; justify-items: center; text-align: center; }
.gd-step-value { color: var(--accent); font-size: 13px; font-weight: 900; }
.gd-step-bar { display: flex; align-items: flex-end; width: 100%; height: 100px; overflow: hidden; border-radius: 8px 8px 3px 3px; background: var(--surface-alt); }
.gd-step-bar i { display: block; width: 100%; height: var(--h); border-radius: inherit; background: linear-gradient(180deg, #3f67c4, #22356f); transform-origin: bottom; }
.gd-step-icon { margin-top: 3px; font-size: 18px; }
.gd-step small { color: var(--ink-soft); font-size: 10px; line-height: 1.2; }

/* Gros chiffre */
.gd-big { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.gd-big b { color: #1f9bb3; font-size: 32px; font-weight: 900; line-height: 1; }
.gd-big span { color: var(--ink-soft); font-size: 12px; font-weight: 700; }

/* Anniversaires */
.gd-cakes { display: flex; flex-wrap: wrap; gap: 8px; }
.gd-cakes span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px 7px 8px;
  border: 1px solid #f3c6da;
  border-radius: 999px;
  background: linear-gradient(135deg, #fff5fa, #fffaf0);
  color: #4b2a3a;
  font-size: 12.5px;
  font-weight: 700;
  transition: transform .2s;
}
.gd-cakes span:hover { transform: translateY(-2px) rotate(-1deg); }
.gd-cakes span em { font-style: normal; font-size: 16px; }
.gd-cakes span b { display: grid; place-items: center; min-width: 26px; height: 22px; border-radius: 7px; background: #c2578a; color: #fff; font-size: 11px; }
.gd-cakes span.is-today { border-color: #e0a800; background: linear-gradient(135deg, #fff7d6, #ffe9f3); box-shadow: 0 6px 16px rgba(224, 168, 0, .25); }
.gd-cakes span.is-past { opacity: .62; }

/* Palmarès */
.gd-trophies { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.gd-trophy { position: relative; display: grid; gap: 3px; padding: 15px 14px 13px 60px; border: 1px solid #f0dca8; border-radius: 13px; background: linear-gradient(150deg, #fffaf0, #f4f7ff); transition: transform .2s; }
.gd-trophy:hover { transform: translateY(-3px); }
.gd-trophy > span { position: absolute; top: 13px; left: 13px; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: #fff; box-shadow: 0 5px 12px rgba(34, 53, 111, .15); font-size: 19px; }
.gd-trophy h4 { margin: 0; color: #6b5a2e; font-size: 10.5px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.gd-trophy b { display: -webkit-box; overflow: hidden; color: #182753; font-size: 14.5px; line-height: 1.25; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.gd-trophy small { color: #5a6680; font-size: 11.5px; }

/* Animations (rejouées à chaque ouverture de l'onglet) */
@keyframes gdRise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes gdGrowX { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes gdGrowY { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes gdDraw { from { stroke-dasharray: 0 400; } }
.gd-play .gd-hero, .gd-play .gd-kpi, .gd-play .gd-card { animation: gdRise .5s cubic-bezier(.2, .8, .2, 1) both; animation-delay: var(--d, 0ms); }
.gd-play .gd-hbar-track i, .gd-play .gd-week-bar i { animation: gdGrowX .8s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(.15s + var(--d, 0ms)); }
.gd-play .gd-col-bar i, .gd-play .gd-step-bar i { animation: gdGrowY .8s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(.15s + var(--d, 0ms)); }
.gd-play .gd-arc { animation: gdDraw 1s ease both; animation-delay: calc(.1s + var(--d, 0ms)); }
.gd-play .gd-trophy, .gd-play .gd-cakes span { animation: gdRise .45s ease both; animation-delay: calc(.2s + var(--d, 0ms)); }
@media (prefers-reduced-motion: reduce) { .gd-play * { animation: none !important; } }

/* Thème sombre */
html[data-theme="dark"] .gd-hero { background: linear-gradient(120deg, #0b1d44 0%, #173a7a 50%, #2d5fc0 100%); }
html[data-theme="dark"] .gd-col-bar i + i { box-shadow: 0 -1px 0 rgba(7, 21, 47, .8); }
html[data-theme="dark"] .gd-cakes span { border-color: rgba(240, 163, 196, .35); background: rgba(194, 87, 138, .14); color: var(--ink); }
html[data-theme="dark"] .gd-trophy { border-color: rgba(244, 207, 113, .3); background: linear-gradient(150deg, rgba(244, 207, 113, .1), rgba(94, 148, 236, .1)); }
html[data-theme="dark"] .gd-trophy > span { background: rgba(255, 255, 255, .1); }
html[data-theme="dark"] .gd-trophy h4 { color: #f4cf71; }
html[data-theme="dark"] .gd-trophy b { color: var(--ink); }
html[data-theme="dark"] .gd-trophy small { color: var(--ink-soft); }
html[data-theme="dark"] .gd-week-row b { color: #6fe0a2; }
html[data-theme="dark"] .gd { --gd-navy: #8fb6ff; }
html[data-theme="dark"] .gd-cat-a { --cc: #b9a2ff; }
html[data-theme="dark"] .gd-cat-b { --cc: #7daeff; }
html[data-theme="dark"] .gd-cat-c { --cc: #6fe0a2; }
html[data-theme="dark"] .gd-step-bar i { background: linear-gradient(180deg, #8fb6ff, #3f67c4); }
html[data-theme="dark"] .gd-kpi:first-child::after { background: linear-gradient(90deg, #3f67c4, #8fb6ff); }

/* Adaptations */
@media (max-width: 1350px) { .gd-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } .gd-trophies { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .gd-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .gd-wide { grid-column: 1 / -1; } .gd-trophies { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .gd-grid, .gd-trophies { grid-template-columns: 1fr; }
  .gd-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gd-hero { flex-direction: column; align-items: flex-start; padding: 18px; }
  .gd-columns { gap: 3px; height: 180px; }
  .gd-col-value { font-size: 9.5px; }
  .gd-col-label { font-size: 9px; }
  .gd-donut-wrap { grid-template-columns: 1fr; justify-items: center; }
  .gd-steps { gap: 3px; }
}
