/* ── Toast container ── */
.sae-toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: 420px;
  width: 100%;
}

@media (max-width: 640px) {
  .sae-toast-container {
    right: 8px;
    left: 8px;
    max-width: none;
    width: auto;
  }
}

/* ── Toast item ── */
.sae-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .12);
  font-size: 0.8125rem;
  line-height: 1.4;
  color: #1f2937;
  background: #fff;
  border-left: 4px solid #9ca3af;
  animation: sae-toast-in .3s ease forwards;
}

.sae-toast.sae-toast-out {
  animation: sae-toast-out .25s ease forwards;
}

.sae-toast-icon {
  flex-shrink: 0;
  font-size: 20px;
  line-height: 1;
}

.sae-toast-msg {
  flex: 1;
  word-break: break-word;
}

.sae-toast-close {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: #9ca3af;
  padding: 0;
  line-height: 1;
  font-size: 18px;
  transition: color .15s;
}

.sae-toast-close:hover {
  color: #374151;
}

/* Types */
.sae-toast-exito  { border-left-color: #16a34a; background: #f0fdf4; }
.sae-toast-exito .sae-toast-icon { color: #16a34a; }

.sae-toast-info   { border-left-color: #2563eb; background: #eff6ff; }
.sae-toast-info .sae-toast-icon { color: #2563eb; }

.sae-toast-advertencia { border-left-color: #d97706; background: #fffbeb; }
.sae-toast-advertencia .sae-toast-icon { color: #d97706; }

.sae-toast-error  { border-left-color: #dc2626; background: #fef2f2; }
.sae-toast-error .sae-toast-icon { color: #dc2626; }

/* Animations */
@keyframes sae-toast-in {
  from { opacity: 0; transform: translateX(80px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes sae-toast-out {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(80px); }
}

/* ── Dialog overlay ── */
.sae-dialog-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(0, 0, 0, .45);
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.sae-dialog-overlay.visible {
  display: flex;
}

/* ── Dialog card ── */
.sae-dialog-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .18);
  max-width: 440px;
  width: 100%;
  padding: 24px;
  animation: sae-dialog-in .2s ease;
}

.sae-dialog-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 8px 0;
}

.sae-dialog-msg {
  font-size: 0.875rem;
  color: #4b5563;
  line-height: 1.5;
  margin: 0 0 20px 0;
  white-space: pre-line;
}

.sae-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.sae-dialog-btn {
  padding: 8px 20px;
  border-radius: 10px;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background .15s, box-shadow .15s;
}

.sae-dialog-btn-cancel {
  background: #f3f4f6;
  color: #374151;
}

.sae-dialog-btn-cancel:hover {
  background: #e5e7eb;
}

.sae-dialog-btn-primary {
  background: #1F2E74;
  color: #fff;
}

.sae-dialog-btn-primary:hover {
  background: #162257;
}

@keyframes sae-dialog-in {
  from { opacity: 0; transform: scale(.95); }
  to   { opacity: 1; transform: scale(1); }
}
