/* Tooltips custom para el Panel Macro-Fiscal Chile */

/* Contenedor del ícono ⓘ */
.tip-icon {
  position: relative;
  display: inline-block;
  cursor: help;
  color: #9CA3AF;
  font-size: 0.78rem;
  line-height: 1;
  user-select: none;
}

/* Caja del tooltip — oculta por defecto */
.tip-icon::after {
  content: attr(data-tip);
  position: absolute;
  left: 120%;
  top: 50%;
  transform: translateY(-50%);
  background: #1E3A5F;
  color: #fff;
  font-size: 0.74rem;
  font-weight: 400;
  line-height: 1.55;
  padding: 10px 14px;
  border-radius: 8px;
  width: 270px;
  white-space: normal;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s ease;
}

/* Flechita a la izquierda del tooltip */
.tip-icon::before {
  content: "";
  position: absolute;
  left: calc(120% - 6px);
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-right-color: #1E3A5F;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.tip-icon:hover::after,
.tip-icon:hover::before {
  opacity: 1;
}

/* Para tooltips en KPI cards: aparecen arriba */
.tip-icon-top::after {
  left: 50%;
  top: auto;
  bottom: 130%;
  transform: translateX(-50%);
}

.tip-icon-top::before {
  left: 50%;
  top: auto;
  bottom: calc(130% - 6px);
  transform: translateX(-50%) rotate(90deg);
  border-right-color: #1E3A5F;
}
