/* ============================================================================
 * PAC STATS — tableau de bord (stats-pac.php). Suit la méthode dataviz :
 * couleur séquentielle (une teinte) pour le classement par marque, couleur de
 * statut (bon/attention/critique) pour l'appariement EPREL, libellés directs
 * partout (jamais la couleur seule). Se greffe sur home-2026.css.
 * ========================================================================== */

.home-2026 .pac-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-bottom: 8px; }
.home-2026 .pac-kpi {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 22px 22px 20px;
  box-shadow: var(--shadow-sm);
}
.home-2026 .pac-kpi__label { font-size: .82rem; font-weight: 600; color: var(--ink-soft); }
.home-2026 .pac-kpi__value { font-family: var(--font-display); font-size: clamp(1.9rem, 3vw, 2.4rem); font-weight: 800; color: var(--ink); margin-top: 6px; line-height: 1; }
.home-2026 .pac-kpi__value small { font-size: .5em; font-weight: 700; color: var(--ink-soft); margin-left: 4px; }
.home-2026 .pac-kpi__sub { font-size: .8rem; color: var(--ink-soft); margin-top: 8px; }
.home-2026 .pac-kpi--good .pac-kpi__value { color: var(--green-800); }

.home-2026 .pac-chart-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: clamp(22px, 3vw, 32px);
  box-shadow: var(--shadow-sm);
}
.home-2026 .pac-chart-card h3 { font-size: 1.15rem; margin: 0 0 4px; }
.home-2026 .pac-chart-card > p.pac-chart-sub { color: var(--ink-soft); font-size: .88rem; margin: 0 0 24px; }
.home-2026 .pac-charts-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 900px) { .home-2026 .pac-charts-grid { grid-template-columns: 1fr; } }
.home-2026 .pac-donuts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 640px) { .home-2026 .pac-donuts-grid { grid-template-columns: 1fr; } }

/* ---------- Bar chart (classement par marque) ---------- */
.home-2026 .pac-bars { display: flex; flex-direction: column; gap: 10px; }
.home-2026 .pac-bar-row { display: flex; align-items: center; gap: 12px; }
.home-2026 .pac-bar-label {
  flex: 0 0 132px;
  font-size: .82rem;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.home-2026 .pac-bar-track {
  flex: 1;
  height: 24px;
  background: var(--paper-2);
  border-radius: 6px;
  position: relative;
}
.home-2026 .pac-bar-fill {
  height: 24px;
  background: var(--green-500);
  border-radius: 0 6px 6px 0;
  min-width: 3px;
  transition: filter .15s;
  cursor: default;
}
.home-2026 .pac-bar-row:hover .pac-bar-fill,
.home-2026 .pac-bar-fill:focus-visible { filter: brightness(0.88); outline: none; }
.home-2026 .pac-bar-row.is-other .pac-bar-fill { background: var(--ink-soft); opacity: .55; }
.home-2026 .pac-bar-value {
  flex: 0 0 76px;
  text-align: right;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .84rem;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.home-2026 .pac-bar-value span { color: var(--ink-soft); font-weight: 600; font-size: .82em; }

/* ---------- Table repli (accessibilité) ---------- */
.home-2026 .pac-table-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 16px;
  background: none; border: 0; padding: 0;
  font: inherit; font-weight: 700; font-size: .84rem; color: var(--green-800);
  cursor: pointer;
}
.home-2026 .pac-table-toggle svg { width: 14px; height: 14px; transition: transform .25s; }
.home-2026 .pac-table-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.home-2026 .pac-table-wrap { display: none; margin-top: 14px; overflow-x: auto; }
.home-2026 .pac-table-wrap.is-open { display: block; }
.home-2026 .pac-table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.home-2026 .pac-table th, .home-2026 .pac-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.home-2026 .pac-table td:last-child, .home-2026 .pac-table th:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.home-2026 .pac-table th { color: var(--ink-soft); font-size: .74rem; text-transform: uppercase; letter-spacing: .03em; }

/* ---------- Donut ---------- */
.home-2026 .pac-donut { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.home-2026 .pac-donut__ring { position: relative; width: 160px; height: 160px; flex: none; }
.home-2026 .pac-donut__ring svg { transform: rotate(-90deg); }
.home-2026 .pac-donut__ring svg circle { transition: filter .15s; }
.home-2026 .pac-donut__ring svg circle:hover,
.home-2026 .pac-donut__ring svg circle:focus-visible { filter: brightness(0.9); outline: none; }
.home-2026 .pac-donut__center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  pointer-events: none;
}
.home-2026 .pac-donut__center strong { font-family: var(--font-display); font-size: 1.7rem; font-weight: 800; color: var(--ink); line-height: 1; }
.home-2026 .pac-donut__center span { font-size: .72rem; color: var(--ink-soft); font-weight: 600; margin-top: 4px; max-width: 90px; }
.home-2026 .pac-legend { width: 100%; display: flex; flex-direction: column; gap: 10px; }
.home-2026 .pac-legend__row { display: flex; align-items: center; gap: 9px; font-size: .86rem; }
.home-2026 .pac-legend__key { flex: none; width: 12px; height: 12px; border-radius: 3px; }
.home-2026 .pac-legend__label { flex: 1; color: var(--ink); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.home-2026 .pac-legend__label i { font-size: .8em; }
.home-2026 .pac-legend__value { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.home-2026 .pac-legend__value span { color: var(--ink-soft); font-weight: 600; font-size: .88em; margin-left: 3px; }

/* ---------- Tooltip (survol barres/donut) ---------- */
.pac-tooltip {
  position: fixed;
  z-index: 3000;
  pointer-events: none;
  background: var(--ink);
  color: #fff;
  font-size: .78rem;
  font-weight: 600;
  padding: 7px 11px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translate(-50%, -8px);
  transition: opacity .12s;
  white-space: nowrap;
}
.pac-tooltip.is-visible { opacity: 1; }
.pac-tooltip b { color: var(--green-300); }
