/* ================================================================
   SGI Notify / Vercel Toast — Clean Design System (Modo Claro)
   Inspirado en Vercel / Sonner / Geist UI
   ================================================================ */

#sgi-notify-root {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 999999;
    width: 360px;
    max-width: calc(100vw - 32px);
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

/* En layout administrativo con navbar superior */
html.sgi-layout-main #sgi-notify-root,
body:has(.top-navbar) #sgi-notify-root {
    top: 72px;
}

/* ── Card base estilo Vercel ── */
.sgi-notify,
.vercel-toast {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.08),
        0 2px 4px rgba(0, 0, 0, 0.03);
    pointer-events: auto;
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
    transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    box-sizing: border-box;
}

.sgi-notify--entering,
.vercel-toast--entering {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.sgi-notify--entering:hover,
.vercel-toast--entering:hover {
    box-shadow:
        0 6px 18px rgba(0, 0, 0, 0.1),
        0 2px 6px rgba(0, 0, 0, 0.04);
}

.sgi-notify--leaving,
.vercel-toast--leaving {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
    pointer-events: none;
}

/* ── Icono limpio sin contenedor rosado ni fondos ── */
.sgi-notify__icon,
.vercel-toast__icon {
    width: 20px;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin-top: 1px;
    flex-shrink: 0;
}

.sgi-notify__icon svg,
.vercel-toast__icon svg {
    width: 20px !important;
    height: 20px !important;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ── Variantes de Color por Tipo (Vercel Style) ── */

/* Error: Círculo con X (Rojo Vercel limpio) */
.sgi-notify--error .sgi-notify__icon,
.vercel-toast--error .vercel-toast__icon {
    color: #ef4444;
}

/* Success: Círculo con Check (Verde Vercel limpio) */
.sgi-notify--success .sgi-notify__icon,
.vercel-toast--success .vercel-toast__icon {
    color: #10b981;
}

/* Warning: Triángulo de Alerta (#f5a623 Vercel Orange) */
.sgi-notify--warning .sgi-notify__icon,
.vercel-toast--warning .vercel-toast__icon {
    color: #f5a623;
}

/* Info: Círculo con i (#0070f3 Vercel Blue) */
.sgi-notify--info .sgi-notify__icon,
.vercel-toast--info .vercel-toast__icon {
    color: #0070f3;
}

/* Loading / Progress: Spinner (#0070f3 Vercel Blue) */
.sgi-notify--loading .sgi-notify__icon,
.sgi-notify--progress .sgi-notify__icon,
.vercel-toast--loading .vercel-toast__icon,
.vercel-toast--progress .vercel-toast__icon {
    color: #0070f3;
}

.sgi-notify__spinner {
    animation: sgi-notify-spin 0.8s linear infinite;
}

@keyframes sgi-notify-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ── Body (Título + Descripción) ── */
.sgi-notify__body,
.vercel-toast__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.sgi-notify__title,
.vercel-toast__title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
    line-height: 1.35;
    word-break: break-word;
}

.sgi-notify__desc,
.vercel-toast__desc {
    margin-top: 3px;
    color: #6b7280;
    font-size: 0.8125rem;
    font-weight: 400;
    line-height: 1.4;
    word-break: break-word;
}

/* ── Botón de cierre discreto ── */
.sgi-notify__close,
.vercel-toast__close {
    border: none;
    background: transparent;
    cursor: pointer;
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    min-width: 18px;
    padding: 0;
    margin-top: 1px;
    margin-left: auto;
    flex-shrink: 0;
    border-radius: 4px;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.sgi-notify__close svg,
.vercel-toast__close svg {
    width: 14px !important;
    height: 14px !important;
    stroke-width: 2;
    stroke-linecap: round;
}

.sgi-notify__close:hover,
.vercel-toast__close:hover {
    color: #111827;
    background: #f3f4f6;
}

/* ── Barra de progreso limpia para Exportación Excel ── */
.sgi-notify__progress-wrap {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sgi-notify__progress-track {
    width: 100%;
    height: 5px;
    background: #f1f5f9;
    border-radius: 9999px;
    overflow: hidden;
    position: relative;
}

.sgi-notify__progress-fill {
    height: 100%;
    width: 0%;
    background: #0070f3;
    border-radius: 9999px;
    transition: width 0.24s cubic-bezier(0.4, 0, 0.2, 1);
}

.sgi-notify--success .sgi-notify__progress-fill {
    background: #10b981;
}

.sgi-notify--error .sgi-notify__progress-fill {
    background: #ef4444;
}

.sgi-notify__progress-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.sgi-notify__progress-status {
    font-size: 11px;
    font-weight: 500;
    color: #64748b;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.sgi-notify__progress-pct {
    font-size: 11px;
    font-weight: 600;
    color: #0070f3;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

.sgi-notify--success .sgi-notify__progress-pct {
    color: #10b981;
}

.sgi-notify--error .sgi-notify__progress-pct {
    color: #ef4444;
}

/* ── Responsive ── */
@media (max-width: 640px) {
    #sgi-notify-root {
        top: 16px !important;
        right: 16px !important;
        left: 16px !important;
        width: auto !important;
        max-width: 100% !important;
    }
}
