/* ============================================================================
   Lightweight toast notifications - replaces SweetAlert (swal) across the app.
   No dependency. Loaded from every layout; js/toast.js provides window.toast()
   and a window.swal() compatibility shim so existing swal(...) calls keep working.
   ============================================================================ */
#ndwToastHost {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 360px;
    width: calc(100vw - 32px);
    pointer-events: none;
}

.ndw-toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 8px;
    background: #ffffff;
    color: #1f2937;
    box-shadow: 0 8px 24px rgba(16, 24, 40, .16), 0 2px 6px rgba(16, 24, 40, .08);
    border-left: 4px solid #2b6cb0;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    font-size: .86rem;
    line-height: 1.35;
    opacity: 0;
    transform: translateX(120%);
    transition: transform .28s cubic-bezier(.2, .8, .2, 1), opacity .28s ease;
}

    .ndw-toast.ndw-show {
        opacity: 1;
        transform: translateX(0);
    }

    .ndw-toast.ndw-hide {
        opacity: 0;
        transform: translateX(120%);
    }

.ndw-toast-icon {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: .8rem;
    line-height: 1;
    margin-top: 1px;
}

.ndw-toast-body {
    flex: 1 1 auto;
    min-width: 0;
    word-wrap: break-word;
}

.ndw-toast-title {
    font-weight: 600;
    margin-bottom: 2px;
    text-transform: capitalize;
}

.ndw-toast-close {
    flex: 0 0 auto;
    cursor: pointer;
    border: 0;
    background: transparent;
    color: #9ca3af;
    font-size: 1rem;
    line-height: 1;
    padding: 0 2px;
}

    .ndw-toast-close:hover {
        color: #4b5563;
    }

/* ---- types ---- */
.ndw-toast.ndw-success {
    border-left-color: #12855b;
}

    .ndw-toast.ndw-success .ndw-toast-icon {
        background: #12855b;
    }

.ndw-toast.ndw-error {
    border-left-color: #c0392b;
}

    .ndw-toast.ndw-error .ndw-toast-icon {
        background: #c0392b;
    }

.ndw-toast.ndw-warning {
    border-left-color: #b7791f;
}

    .ndw-toast.ndw-warning .ndw-toast-icon {
        background: #b7791f;
    }

.ndw-toast.ndw-info {
    border-left-color: #2b6cb0;
}

    .ndw-toast.ndw-info .ndw-toast-icon {
        background: #2b6cb0;
    }

@media (prefers-color-scheme: dark) {
    .ndw-toast {
        background: #1f2733;
        color: #e5e7eb;
        box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
    }

        .ndw-toast .ndw-toast-close {
            color: #6b7280;
        }
}
