/* Contenedor fijo abajo-derecha */
.toast-root{
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none; /* para que no bloquee clicks detrás */
}

/* Toast */
.toast{
  pointer-events: auto;
  min-width: 280px;
  max-width: 360px;
  background: var(--card);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  box-shadow: 0 18px 45px rgba(0,0,0,0.35);
  overflow: hidden;
  transform: translateY(14px);
  opacity: 0;
  animation: toast-in 220ms ease-out forwards;
}

.toast.toast-hide{
  animation: toast-out 180ms ease-in forwards;
}

@keyframes toast-in{
  to { transform: translateY(0); opacity: 1; }
}
@keyframes toast-out{
  to { transform: translateY(10px); opacity: 0; }
}

/* Variantes */
.toast[data-type="success"]{ border-left: 6px solid #22c55e; }
.toast[data-type="error"]  { border-left: 6px solid #ef4444; }
.toast[data-type="info"]   { border-left: 6px solid #3b82f6; }
.toast[data-type="warn"]   { border-left: 6px solid #f59e0b; }

.toast__inner{
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 12px 12px;
}

.toast__title{
  font-weight: 700;
  font-size: 14px;
  margin: 0 0 2px 0;
}
.toast__msg{
  font-size: 13px;
  opacity: 0.92;
  margin: 0;
  line-height: 1.3;
}

.toast__close{
  border: 0;
  background: transparent;
  color: rgba(255,255,255,0.75);
  font-size: 18px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 10px;
}
.toast__close:hover{
  background: rgba(255,255,255,0.08);
  color: #fff;
}

/* Respeta accesibilidad */
@media (prefers-reduced-motion: reduce){
  .toast{ animation: none; transform: none; opacity: 1; }
  .toast.toast-hide{ animation: none; opacity: 0; }
}

/* =========================
   Toast estilo Notificación
   (compatible con tu CSS actual)
   ========================= */

/* Cuando usemos el layout notif */
.toast__inner--notif{
  display: flex;            /* en vez de grid */
  gap: 12px;
  align-items: flex-start;
}

/* Contenido principal */
.toast__content{
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Título igual que antes */
.toast__inner--notif .toast__title{
  margin: 0;
}

/* Principal y detalle como tu renderNotificaciones */
.toast__principal{
  color: var(--text);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toast__detalle{
  color: var(--muted, rgba(255,255,255,.75));
  font-size: 12px;
  line-height: 1.2;
  max-height: 2.4em; /* 2 líneas aprox */
  overflow: hidden;
}

/* Meta: badges (Nueva + fecha) */
.toast__meta{
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 4px;
  flex-wrap: wrap;
}

/* Badge dentro de toast (si tu .badge ya existe, esto solo lo ajusta) */
.toast .badge{
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: inherit;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1;
}

/* Close alineado a la derecha */
.toast__inner--notif .toast__close{
  margin-left: auto;
}