#stats-reclutamiento-modulo {
  width: 100%;
}

.stats-wrap {
  width: 100%;
  max-width: 1200px;
}

.stats-shell {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 3px;
  padding: 20px;
}

.stats-head {
  margin-bottom: 22px;
}

.stats-title {
  margin: 0 0 14px;
  font-size: 22px;
  line-height: 1.2;
  color: #111827;
}

#stats-loading,
#stats-error {
  margin-bottom: 16px;
}

#stats-loading {
  color: #6b7280;
}

#stats-error {
  color: #b00020;
}

#stats-rango {
  margin-top: 12px;
  font-size: 14px;
  color: #6b7280;
}

.stats-filtros {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

#filtro-fecha,
#filtro-origen {
  font-size: 15px !important;
  line-height: 1.4 !important;
  padding: 10px 12px !important;
  height: 42px !important;
  min-height: 42px !important;
  border: 1px solid #d1d5db !important;
  border-radius: 3px !important;
  background: #ffffff !important;
  color: #111827 !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
}

#stats-groups {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.stage-group {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-left-width: 4px;
  border-radius: 3px;
  padding: 18px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stage-group:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.06);
}

.stage-group-visitas {
  border-left-color: #475569;
}

.stage-group-leads {
  border-left-color: #7dd3fc;
}

.stage-group-pagos {
  border-left-color: #86efac;
}

.stage-group-citas {
  border-left-color: #fcd34d;
}

.stage-group-distribuidores {
  border-left-color: #d8b4fe;
}

.stage-card {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 1fr) minmax(260px, 1fr);
  gap: 14px;
  align-items: stretch;
}

.stage-main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  min-height: 132px;
  width: 100%;
  padding: 4px 2px;
}

.stage-label {
  margin-bottom: 12px;
  font-size: 13px;
  line-height: 1.3;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #6b7280;
}

.stage-number {
  display: none;
}

.stage-bar-track {
  width: 100%;
  height: 46px;
  background: #e5e7eb;
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.stage-bar {
  width: 0%;
  height: 100%;
  min-width: 44px;
  max-width: 100%;
  border-radius: 2px;
  position: relative;
  transition: width 0.6s ease;
}

.stage-bar::after {
  content: attr(data-value);
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 22px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0.2px;
  color: #ffffff;
  white-space: nowrap;
  z-index: 2;
}

.stage-bar-visitas {
  background: #475569;
}

.stage-bar-leads {
  background: #38bdf8;
}

.stage-bar-pagos {
  background: #4f7d75;
}

.stage-bar-citas {
  background: #d1a663;
}

.stage-bar-distribuidores {
  background: #8b5cf6;
}

.stage-side {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 3px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 132px;
}

.stage-side-soft {
  background: #ffffff;
}

.stage-side-title {
  margin-bottom: 6px;
  font-size: 12px;
  line-height: 1.3;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6b7280;
}

.stage-line {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  line-height: 1.4;
  color: #374151;
}

.stage-line strong {
  color: #111827;
  font-weight: 800;
  white-space: nowrap;
}

.stage-group-distribuidores .stage-card {
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 1fr) minmax(260px, 1fr) !important;
}

.stage-group-distribuidores #stats-insights {
  grid-column: 2 / 4 !important;
  min-height: 132px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.stage-group-distribuidores #stats-insights .stage-line {
  margin-bottom: 12px;
}

.stage-group-distribuidores #stats-insights .stage-line:last-child {
  margin-bottom: 0;
}

@media (max-width: 1100px) {
  .stage-card,
  .stage-group-distribuidores .stage-card {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .stage-main,
  .stage-side,
  .stage-group-distribuidores #stats-insights {
    min-height: auto;
    height: auto;
  }

  .stage-group-distribuidores #stats-insights {
    grid-column: auto !important;
    width: 100% !important;
    min-width: 0 !important;
  }
}

@media (max-width: 640px) {
  .stats-shell {
    padding: 14px;
  }

  .stage-group {
    padding: 14px;
  }

  .stage-card {
    gap: 10px;
  }

  .stage-side {
    padding: 14px;
  }

  .stage-bar-track {
    height: 40px;
  }

  .stage-bar::after {
    right: 12px;
    font-size: 18px;
  }

  .stage-line {
    font-size: 13px;
    gap: 10px;
  }

  .stage-line strong {
    font-size: 13px;
  }
}
.stage-group,
.evolucion-shell {
  border: 1px solid #e2e8f0;

  .stage-group:hover {
  box-shadow: 0 6px 14px rgba(0,0,0,0.05);
}