/* =========================
   Mask
========================= */
.dialog-mask {
   position: fixed;
   inset: 0;
   background: rgba(0, 0, 0, 0.45);
   display: flex;
   align-items: center;
   justify-content: center;
   z-index: 9999;
}

/* =========================
   Dialog
========================= */
.dialog {
   background: var(--color-surface);
   color: var(--color-text);
   border-radius: var(--radius-md);
   box-shadow: var(--shadow-lg);
   font-family: var(--font-base);
   font-size: var(--font-size-base);
   border: var(--border-base);
   width: 100%;
   max-width: 520px;
   animation: dialogFade 0.25s ease;
}

/* =========================
   Header
========================= */
.dialog-header {
   display: flex;
   align-items: center;
   justify-content: space-between;
   padding: 12px 18px;
}

.dialog-header h3 {
   margin: 0;
   font-size: 16px;
   font-weight: 600;
   color: #222;
}

.dialog-close {
   border: none;
   background: none;
   font-size: 20px;
   cursor: pointer;
   color: #666;
}

.dialog-close:hover {
   color: #000;
}

/* =========================
   Body
========================= */
.dialog-body {
   padding: 18px;
   font-size: 14px;
   line-height: 1.5;
   color: #444;
   max-height: 400px;
   overflow-y: auto;
}

/* =========================
   Footer
========================= */
.dialog-footer {
   display: flex;
   justify-content: flex-end;
   gap: 10px;
   padding: 12px 18px;
}

/* =========================
   Buttons
========================= */
.dialog-footer button {
   padding: 7px 14px;
   font-size: 13px;
   border-radius: 4px;
   border: 1px solid transparent;
   cursor: pointer;
   font-weight: 500;
}

.dialog-footer .btn-confirm {
   background: #1a73e8;
   color: #fff;
}

.dialog-footer .btn-confirm:hover {
   background: #1558b0;
}

.dialog-footer .btn-cancel {
   background: #e4e6eb;
   color: #333;
}

.dialog-footer .btn-cancel:hover {
   background: #d8dadf;
}

/* =========================
   Loading
========================= */
.dialog-loading {
   padding: 30px;
   text-align: center;
}

.dialog-loading p {
   margin-top: 12px;
   font-size: 14px;
   color: #555;
}

.spinner {
   width: 32px;
   height: 32px;
   border: 3px solid #ddd;
   border-top-color: #1a73e8;
   border-radius: 50%;
   animation: spin 1s linear infinite;
}

/* =========================
   Animations
========================= */
@keyframes dialogFade {
   from {
      opacity: 0;
      transform: translateY(-10px);
   }
   to {
      opacity: 1;
      transform: translateY(0);
   }
}

@keyframes spin {
   to {
      transform: rotate(360deg);
   }
}
/* =========================
   Toast container
========================= */
.dialog-toast-container {
   position: fixed;
   z-index: 10000;
   display: flex;
   flex-direction: column;
   gap: 10px;
   pointer-events: none;
}

/* Posiciones */
.toast-top-right { top: 20px; right: 20px; }
.toast-top-left { top: 20px; left: 20px; }
.toast-bottom-right { bottom: 20px; right: 20px; }
.toast-bottom-left { bottom: 20px; left: 20px; }

/* =========================
   Toast
========================= */
.dialog-toast {
   min-width: 260px;
   max-width: 360px;
   background: var(--color-surface);
   color: var(--color-text);
   border-radius: var(--radius-sm);
   box-shadow: var(--shadow-md);
   border-left: 4px solid var(--color-primary);
   padding: 12px 14px;
   font-family: var(--font-base);
   font-size: var(--font-size-sm);
   animation: toastIn 0.25s ease;
   pointer-events: auto;
}

/* Tipos */
.dialog-toast.success { border-color: var(--color-success); }
.dialog-toast.danger { border-color: var(--color-danger); }
.dialog-toast.info { border-color: var(--color-info); }
.dialog-toast.warning { border-color: var(--color-warning); }

/* Header */
.dialog-toast h4 {
   margin: 0 0 4px;
   font-size: 13px;
   font-weight: var(--font-weight-bold);
}

/* Animaciones */
@keyframes toastIn {
   from {
      opacity: 0;
      transform: translateY(-8px);
   }
   to {
      opacity: 1;
      transform: translateY(0);
   }
}

@keyframes toastOut {
   to {
      opacity: 0;
      transform: translateY(-6px);
   }
}