#erp-toast-root {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 99999;
}
.erp-toast-container {
    position: fixed;
    bottom: 20px;
    left: 20px;    /* hoặc left */
    z-index: 99999999;
}
.erp-toast {
    position: absolute;
    z-index: 99999999;
    min-width: 320px;
    padding: 6px 12px;
    border-radius: 3px;
    border-left: 5px solid var(--erp-color-5);
    font-size: 13px;
    color: #fff;
    background: #333;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    opacity: 0;
    transform: scale(0.95);
    transition: all 0.2s ease;
    pointer-events: none;
}

/* Thanh timeline */
.erp-toast-progress {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 100%;
    background: currentColor; /* ăn theo màu toast */

    transform-origin: left;
    animation: erpToastProgress linear forwards;
}

.erp-toast.show {
    opacity: 1;
    transform: scale(1.15);
}

.erp-toast {
    animation: fadeOut 0.3s ease forwards;
    animation-delay: var(--duration);
}

/* màu */
.erp-toast-error { background: var(--erp-color-4); }
.erp-toast-success { background: var(--erp-color-3); }
.erp-toast-warning { background: #ffc107; color: #000; }

/* arrow */
.erp-toast-arrow {
    position: absolute;
    width: 8px;
    height: 8px;
    background: inherit;
    transform: rotate(45deg);
}

/* position arrow */
.erp-toast-right .erp-toast-arrow {
    left: 0px;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
}

.erp-toast-left .erp-toast-arrow {
    right: 0px;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
}

.erp-toast-top .erp-toast-arrow {
    bottom: 0px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
}

.erp-toast-bottom .erp-toast-arrow {
    top: 0px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
}
.erp-toast-content{
    padding: 5px;
}

@keyframes erpToastProgress {
    from {
        transform: scaleX(0);
    }
    to {
        transform: scaleX(1);
    }
}

/* ============================================================
   ERP PROGRESS TOAST STYLES
   ============================================================ */

/* Container fixed at the top-right corner */
.erp-progress-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 360px;
    width: 100%;
    pointer-events: none;
    /* Allows clicks to pass through empty space */
}

/* Individual Toast Card */
.erp-progress-toast {
    pointer-events: auto;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    /* Animation defaults */
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.erp-progress-toast.show {
    opacity: 1;
    transform: translateX(0);
}

/* Header Section */
.erp-progress-toast-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.erp-progress-toast-icon {
    font-size: 20px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}

/* State Colors & Icon Styling */
.erp-progress-toast.loading .erp-progress-toast-icon {
    color: #2563eb;
    /* Primary Blue */
}

.erp-progress-toast.success .erp-progress-toast-icon {
    color: #10b981;
    /* Success Green */
}

.erp-progress-toast.error .erp-progress-toast-icon {
    color: #ef4444;
    /* Danger Red */
}

/* Text Content */
.erp-progress-toast-content {
    flex: 1;
    min-width: 0;
    /* Prevents text overflow issues */
}

.erp-progress-toast-title {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    line-height: 1.3;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.erp-progress-toast-message {
    font-size: 13px;
    color: #4b5563;
    line-height: 1.4;
    word-break: break-word;
}

/* Close Button */
.erp-progress-toast-close {
    background: transparent;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 2px;
    margin: -2px -2px 0 0;
    border-radius: 4px;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.erp-progress-toast-close:hover {
    color: #374151;
    background-color: #f3f4f6;
}

/* Progress Track */
.erp-progress-toast-progress {
    height: 6px;
    width: 100%;
    background-color: #f3f4f6;
    border-radius: 9999px;
    overflow: hidden;
    position: relative;
}

/* Progress Bar */
.erp-progress-toast-bar {
    height: 100%;
    background-color: #2563eb;
    border-radius: 9999px;
    transition: width 0.2s ease;
}

.erp-progress-toast.success .erp-progress-toast-bar {
    background-color: #10b981;
}

.erp-progress-toast.error .erp-progress-toast-bar {
    background-color: #ef4444;
}

/* Footer & Percent Indicator */
.erp-progress-toast-footer {
    display: flex;
    justify-content: flex-end;
}

.erp-progress-toast-percent {
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
}

/* Indeterminate / Endless Loading Mode */
.erp-progress-toast.indeterminate .erp-progress-toast-bar {
    width: 40% !important;
    position: absolute;
    animation: erp-toast-indeterminate 1.5s infinite linear;
}

.erp-progress-toast.indeterminate .erp-progress-toast-footer {
    display: none;
}

/* Keyframes for Indeterminate Bar */
@keyframes erp-toast-indeterminate {
    0% {
        left: -40%;
    }

    100% {
        left: 100%;
    }
}