/* Notificaciones TibuMedic — toast + diálogo (estilo panel, standalone) */

/* Fallback de overlay/botones cuando no está tibumedic-panel.css */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--surface, #fff);
  border-radius: var(--radius, 10px);
  border: 1px solid var(--border, #E4E7EB);
  padding: 1.75rem;
  width: 100%;
  max-width: 520px;
  transform: translateY(10px);
  transition: transform 0.2s;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  font-family: 'Sora', system-ui, sans-serif;
}

.modal-overlay.open .modal {
  transform: translateY(0);
}

.modal-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text, #111827);
  margin-bottom: 0.25rem;
}

.modal-sub {
  font-size: 13px;
  color: var(--text3, #9CA3AF);
  margin-bottom: 1.5rem;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border, #E4E7EB);
}

.topbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.55rem 1rem;
  border-radius: 6px;
  font-family: 'Sora', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border2, #D1D5DB);
  background: var(--bg, #F4F5F7);
  color: var(--text2, #4B5563);
}

.topbar-btn.primary {
  background: var(--green, #00C060);
  border-color: var(--green, #00C060);
  color: #fff;
}

.topbar-btn.ghost {
  background: transparent;
}

.tm-toast-host {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 400;
  display: flex;
  flex-direction: column-reverse;
  gap: 0.5rem;
  pointer-events: none;
  max-width: min(420px, calc(100vw - 2rem));
}

.tm-toast {
  pointer-events: auto;
  background: var(--text, #111827);
  color: #fff;
  padding: 0.8rem 1.1rem;
  border-radius: var(--radius-sm, 6px);
  font-size: 13px;
  font-weight: 500;
  font-family: 'Sora', sans-serif;
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
  transform: translateY(12px);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
  line-height: 1.4;
}

.tm-toast.show {
  transform: translateY(0);
  opacity: 1;
}

.tm-toast.success { background: var(--green-mid, #00A050); }
.tm-toast.error { background: var(--red, #EF4444); }
.tm-toast.info { background: var(--text, #111827); }
.tm-toast.warn { background: #D97706; }

.tm-toast-icon {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  margin-top: 1px;
}

.tm-toast-body { flex: 1; min-width: 0; word-break: break-word; }

.tm-toast-close {
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: inherit;
  opacity: 0.75;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0 0 0 0.25rem;
}

.tm-toast-close:hover { opacity: 1; }

/* Diálogo modal */
.tm-dialog-overlay {
  z-index: 450;
}

.tm-dialog {
  max-width: 440px;
  text-align: center;
  padding: 1.75rem 1.75rem 1.35rem;
}

.tm-dialog-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin: 0 auto 1rem;
  font-weight: 700;
}

.tm-dialog-icon.error {
  background: var(--red-light, #FEF2F2);
  color: var(--red, #EF4444);
}

.tm-dialog-icon.success {
  background: var(--green-light, #E6F9F0);
  color: var(--green-mid, #00A050);
}

.tm-dialog-icon.info {
  background: #EFF6FF;
  color: #2563EB;
}

.tm-dialog-icon.warn {
  background: #FFFBEB;
  color: #D97706;
}

.tm-dialog .modal-title {
  margin-bottom: 0.4rem;
}

.tm-dialog-msg {
  margin-bottom: 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text2, #4B5563);
  font-size: 13.5px;
  line-height: 1.5;
  text-align: left;
}

.tm-dialog .modal-footer {
  justify-content: center;
  border-top: none;
  padding-top: 1.25rem;
  margin-top: 1.35rem;
}

.tm-dialog .tm-dialog-confirm.danger {
  background: var(--red, #EF4444);
  border-color: var(--red, #EF4444);
  color: #fff;
}

.tm-dialog .tm-dialog-confirm.danger:hover {
  filter: brightness(0.95);
}

@media (max-width: 640px) {
  .tm-toast-host {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    max-width: none;
  }
}
