/* ═══════════════════════════════════════════════════════════════════════════
   CLASSES EXTRAITES DES STYLES INLINE — Refactoring v3
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Stats dashboard ─────────────────────────────────────────────────────── */
.stats-kpi-grid { display:grid; grid-template-columns:repeat(4, 1fr); gap:12px; margin-bottom:16px; }
@media (max-width: 1100px) { .stats-kpi-grid { grid-template-columns:repeat(2, 1fr); } }

.stats-kpi-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg); padding:16px 18px; box-shadow:var(--shadow-sm); }
.stats-kpi-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; }
.stats-kpi-icon { width:32px; height:32px; border-radius:8px; display:flex; align-items:center; justify-content:center; }
.stats-kpi-val { font-size:26px; font-weight:700; color:var(--text); letter-spacing:-0.5px; line-height:1; }
.stats-kpi-label { font-size:13px; font-weight:500; color:var(--text); margin-top:4px; }
.stats-kpi-sub { font-size:11px; color:var(--text3); margin-top:2px; }

.stats-dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: start;
  margin-bottom: 12px;
}
.stats-card-full {
  grid-column: 1 / -1;
}
@media (max-width: 960px) {
  .stats-dashboard-grid {
    grid-template-columns: 1fr;
  }
  .stats-dashboard-grid > * {
    grid-column: 1 !important;
    grid-row: auto !important;
  }
}

.stats-main-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-bottom:12px; }
@media (max-width: 960px) { .stats-main-grid { grid-template-columns:1fr; } }
.stats-secondary-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-bottom:12px; }
@media (max-width: 900px) { .stats-secondary-grid { grid-template-columns:1fr; } }

.stats-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg); box-shadow:var(--shadow-sm); overflow:hidden; }
.stats-card-inner { padding:14px 16px; }

/* ══════════════════════════════════════════════════════════════════════════════
   GITHUB CONTRIBUTION HEATMAP (Style Authentique GitHub — Compact)
   ══════════════════════════════════════════════════════════════════════════════ */
.gh-card,
.stats-card.gh-card {
  position: relative;
  overflow: visible !important;
  z-index: 30;
}
.gh-card.dropdown-open,
.gh-card:has(.gh-tech-dropdown-menu.open) {
  z-index: 100;
}
.gh-card .card-header {
  position: relative;
  z-index: 40;
}
.gh-card .stats-card-inner {
  padding: 12px 14px;
}
.gh-calendar-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 2px 0;
  scrollbar-width: thin;
}
.gh-calendar-scroll::-webkit-scrollbar {
  height: 5px;
}
.gh-calendar-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.gh-calendar-scroll::-webkit-scrollbar-thumb {
  background: var(--surface3);
  border-radius: 4px;
}
.gh-svg {
  display: block;
  width: 100%;
  height: auto;
}
@media (max-width: 480px) {
  .gh-svg {
    min-width: 420px;
  }
}
.gh-cell {
  shape-rendering: geometricPrecision;
  outline: none;
  transition: transform 0.12s ease, stroke 0.12s ease;
  cursor: pointer;
}
.gh-cell:hover {
  stroke: var(--text);
  stroke-width: 1.5px;
}
.gh-cell.is-future {
  display: none;
}
.gh-level-0 { fill: var(--gh-empty); }
.gh-level-1 { fill: var(--gh-l1); }
.gh-level-2 { fill: var(--gh-l2); }
.gh-level-3 { fill: var(--gh-l3); }
.gh-level-4 { fill: var(--gh-l4); }

.gh-label {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 9px;
  fill: var(--gh-text);
  user-select: none;
  font-weight: 500;
}

.gh-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--text3);
  flex-wrap: wrap;
  gap: 10px;
}
.gh-legend {
  display: flex;
  align-items: center;
  gap: 4px;
}
.gh-legend-label {
  font-size: 10.5px;
  color: var(--text3);
  margin: 0 3px;
}
.gh-legend-cell {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
}

/* Tooltip interactif style GitHub */
.gh-tooltip {
  position: fixed;
  z-index: 999999;
  background: rgba(20, 24, 30, 0.94);
  color: #FFFFFF;
  padding: 7px 11px;
  border-radius: 7px;
  font-size: 11.5px;
  pointer-events: none;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
  transform: translate(-50%, -100%);
  margin-top: -10px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.12s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.gh-tooltip.visible {
  opacity: 1;
}
.gh-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px;
  border-style: solid;
  border-color: rgba(20, 24, 30, 0.94) transparent transparent transparent;
}
.gh-tooltip-title {
  font-weight: 600;
  color: #FFFFFF;
}
.gh-tooltip-sub {
  font-size: 10px;
  color: #9CA3AF;
  margin-top: 2px;
}

/* Stack de heatmaps par technicien (Scrollable et compact) */
.gh-techs-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 640px;
  overflow-y: auto;
  padding-right: 4px;
}
.gh-techs-container::-webkit-scrollbar {
  width: 5px;
}
.gh-techs-container::-webkit-scrollbar-thumb {
  background: var(--surface3);
  border-radius: 4px;
}
.gh-tech-row-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  transition: all 0.15s ease;
}
.gh-tech-row-card:hover {
  border-color: var(--border2);
  box-shadow: var(--shadow-sm);
}
.gh-tech-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.gh-tech-avatar {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 11.5px;
  color: #FFFFFF;
  flex-shrink: 0;
}
.gh-tech-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.gh-tech-total {
  font-size: 11px;
  color: var(--text3);
  margin-top: 1px;
}

/* Menu Déroulant Multi-sélection Techniciens */
.gh-tech-dropdown-wrap {
  position: relative;
  display: inline-block;
  z-index: 60;
}
.gh-tech-dropdown-wrap-legacy {
  position: relative;
  display: inline-block;
}
.gh-tech-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.gh-tech-dropdown-trigger:hover {
  background: var(--surface3);
  border-color: var(--border2);
}
.gh-tech-dropdown-trigger.has-filter {
  background: var(--blue-light);
  border-color: var(--blue);
  color: var(--blue);
  font-weight: 600;
}
.gh-tech-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 320px;
  max-width: 90vw;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.25), 0 2px 8px rgba(0, 0, 0, 0.08);
  z-index: 1000;
  padding: 10px;
  display: none;
  animation: ghDropdownFadeIn 0.14s ease-out;
}
.gh-tech-dropdown-menu.open {
  display: block;
}
@keyframes ghDropdownFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.gh-dropdown-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.gh-dropdown-head-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}
.gh-dropdown-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.gh-dropdown-link {
  background: none;
  border: none;
  padding: 2px 6px;
  font-size: 11px;
  color: var(--blue);
  cursor: pointer;
  border-radius: 4px;
}
.gh-dropdown-link:hover {
  background: var(--surface2);
  text-decoration: underline;
}
.gh-dropdown-search-wrap {
  margin-bottom: 8px;
}
.gh-dropdown-search {
  width: 100%;
  box-sizing: border-box;
  font-size: 11.5px;
  padding: 5px 8px;
}
.gh-dropdown-list {
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-right: 2px;
}
.gh-dropdown-list::-webkit-scrollbar {
  width: 4px;
}
.gh-dropdown-list::-webkit-scrollbar-thumb {
  background: var(--surface3);
  border-radius: 4px;
}
.gh-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s ease;
  user-select: none;
}
.gh-dropdown-item:hover {
  background: var(--surface2);
}
.gh-dropdown-item input[type="checkbox"] {
  cursor: pointer;
  width: 15px;
  height: 15px;
  accent-color: var(--blue);
  flex-shrink: 0;
}
.gh-dropdown-avatar {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 10px;
  color: #fff;
  flex-shrink: 0;
}
.gh-dropdown-info {
  flex: 1;
  min-width: 0;
}
.gh-dropdown-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}
.gh-dropdown-meta {
  font-size: 10.5px;
  color: var(--text3);
}
.gh-dropdown-only-btn {
  opacity: 0;
  font-size: 10px;
  padding: 2px 6px;
  color: var(--text3);
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.12s ease;
}
.gh-dropdown-item:hover .gh-dropdown-only-btn {
  opacity: 1;
}
.gh-dropdown-only-btn:hover {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

/* Donut & Légende (Flex pour carte équilibrée 1fr) */
.stats-donut-flex {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 8px 4px;
}
.stats-donut-wrap { display:flex; justify-content:center; align-items:center; margin:0; }
.stats-donut-legend-wrap { flex:1; max-width:210px; }
.stats-legend-row { display:flex; align-items:center; gap:8px; padding:5px 0; border-bottom:1px solid var(--border); }
.stats-legend-row:last-child { border-bottom:none; }
.stats-legend-dot { width:7px; height:7px; border-radius:50%; flex-shrink:0; }
.stats-legend-label { font-size:12px; color:var(--text); flex:1; }
.stats-legend-val { font-size:12px; font-weight:600; color:var(--text); min-width:20px; text-align:right; }
.stats-legend-pct { font-size:11px; color:var(--text3); min-width:32px; text-align:right; }

/* Top Workflow Banner */
.stats-top-banner { display:flex; align-items:center; gap:14px; padding:12px 14px; background:var(--blue-light); border-radius:10px; margin-bottom:14px; cursor:pointer; transition:opacity .15s; }
.stats-top-banner:hover { opacity:0.92; }
.stats-top-banner-icon { width:38px; height:38px; border-radius:10px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.stats-top-banner-eyebrow { font-size:10px; font-weight:600; color:var(--blue); text-transform:uppercase; letter-spacing:.06em; margin-bottom:2px; }
.stats-top-banner-title { font-size:13px; font-weight:600; color:var(--text); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.stats-top-banner-sub { font-size:11px; color:var(--text3); margin-top:1px; }
.stats-top-banner-count { font-size:24px; font-weight:700; color:var(--blue); letter-spacing:-0.5px; flex-shrink:0; }

/* Barres de progression workflow */
.stats-bar-row { margin-bottom:12px; cursor:pointer; border-radius:6px; padding:2px 4px; transition:background .15s; }
.stats-bar-row:hover { background:var(--surface2); }
.stats-bar-header { display:flex; align-items:center; gap:8px; margin-bottom:4px; }
.stats-bar-dot { width:6px; height:6px; border-radius:50%; flex-shrink:0; }
.stats-bar-name { font-size:12.5px; font-weight:500; color:var(--text); flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.stats-bar-track { height:4px; background:var(--surface3); border-radius:4px; overflow:hidden; }
.stats-bar-fill { height:100%; border-radius:4px; }

/* Points d'attention / Alertes */
.stats-attention-row { display:flex; align-items:center; gap:12px; padding:9px 0; border-bottom:1px solid var(--border); cursor:pointer; }
.stats-attention-row:last-child { border-bottom:none; }
.stats-attention-score { width:34px; height:34px; border-radius:8px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.stats-attention-title { font-size:12.5px; font-weight:600; color:var(--text); margin-bottom:2px; }
.stats-attention-issues { font-size:11px; color:var(--text3); }

/* Activité technicien */
.stats-user-row { display:flex; align-items:center; gap:12px; padding:9px 0; border-bottom:1px solid var(--border); }
.stats-user-row:last-child { border-bottom:none; }
.stats-user-avatar { width:32px; height:32px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:11px; font-weight:700; color:#fff; flex-shrink:0; }
.stats-user-name-row { display:flex; align-items:center; justify-content:space-between; margin-bottom:4px; }
.stats-user-name { font-size:12.5px; font-weight:500; color:var(--text); }
.stats-user-count { font-size:12.5px; font-weight:600; color:var(--text); }
.stats-user-bar { height:3px; background:var(--surface3); border-radius:3px; overflow:hidden; margin-bottom:3px; }
.stats-user-bar-fill { height:100%; border-radius:3px; }
.stats-user-fav { font-size:11px; color:var(--text3); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

/* Table & Utilitaires */
.stats-table-td-wf { display:flex; align-items:center; gap:8px; }
.stats-table-wf-dot { width:6px; height:6px; border-radius:50%; flex-shrink:0; }
.stats-health-bar-wrap { display:flex; align-items:center; gap:7px; }
.stats-health-bar { width:40px; height:3px; background:var(--surface3); border-radius:2px; overflow:hidden; }
.stats-health-fill { height:100%; border-radius:2px; }
.stats-empty { color:var(--text3); font-size:13px; text-align:center; padding:24px 0; }
.stats-ok-banner { display:flex; align-items:center; gap:10px; color:var(--green); font-size:12.5px; padding:10px 12px; background:var(--green-light); border-radius:8px; }

/* Funnel dans la modal */
.stats-funnel-step { display:flex; align-items:center; gap:10px; margin-bottom:8px; }
.stats-funnel-num { width:20px; height:20px; border-radius:50%; background:var(--surface3); color:var(--text2); display:flex; align-items:center; justify-content:center; font-size:10px; font-weight:700; flex-shrink:0; }
.stats-funnel-bar-wrap { flex:1; height:6px; background:var(--surface3); border-radius:3px; overflow:hidden; }
.stats-funnel-bar-fill { height:100%; background:var(--blue); border-radius:3px; }

/* ── Tech / WF List ──────────────────────────────────────────────────────── */
.wf-onboarding { display:flex; flex-direction:column; align-items:center; justify-content:center; min-height:60vh; text-align:center; padding:40px 20px; }
.wf-onboarding-icon { width:64px; height:64px; border-radius:18px; background:var(--blue-light); display:flex; align-items:center; justify-content:center; margin-bottom:20px; }
.wf-onboarding-title { font-size:18px; font-weight:700; color:var(--text); margin-bottom:8px; letter-spacing:-.3px; }
.wf-onboarding-sub { font-size:13.5px; color:var(--text2); max-width:380px; line-height:1.6; margin-bottom:28px; }
.wf-onboarding-actions { display:flex; gap:10px; flex-wrap:wrap; justify-content:center; }
.wf-in-progress-badge { display:inline-flex; align-items:center; gap:4px; font-size:10px; font-weight:600; padding:2px 8px; border-radius:20px; background:var(--amber-light); color:var(--amber); }
.wf-in-progress-dot { width:6px; height:6px; border-radius:50%; background:var(--amber); animation:pulse 1.4s infinite; }
.wf-found-in-nodes { display:inline-flex; align-items:center; gap:4px; font-size:10px; color:var(--text3); margin-bottom:6px; }
.wf-list-in-progress-badge { display:inline-flex; align-items:center; gap:3px; font-size:10px; font-weight:600; padding:1px 7px; border-radius:20px; background:var(--amber-light); color:var(--amber); }
.wf-list-in-progress-dot { width:5px; height:5px; border-radius:50%; background:var(--amber); animation:pulse 1.4s infinite; }
.wf-list-found-in-nodes { display:inline-flex; align-items:center; gap:3px; font-size:10px; color:var(--text3); }

/* ── Runner ──────────────────────────────────────────────────────────────── */
.runner-done-banner { display:flex; align-items:center; gap:10px; padding:14px 16px; background:var(--green-light); border:1px solid rgba(40,205,65,0.22); border-radius:var(--radius-lg); color:#1A9130; font-size:13.5px; font-weight:500; margin-top:8px; }
.tree-in-progress-badge { display:inline-flex; align-items:center; gap:4px; background:var(--amber-light); color:var(--amber); font-size:11px; font-weight:500; padding:2px 9px; border-radius:6px; }
.tree-in-progress-dot { width:6px; height:6px; border-radius:50%; background:var(--amber); animation:pulse 1.4s infinite; }
.incident-card-resolved { border-color:rgba(40,205,65,0.35); background:var(--green-light); }
.incident-tag-resolved { color:var(--green); }

/* ── Backoffice — confirm resume dialog ──────────────────────────────────── */
.resume-dialog-icon { width:36px; height:36px; border-radius:10px; background:var(--amber-light); display:flex; align-items:center; justify-content:center; flex-shrink:0; }

