/* ===== TOAST V2 ===== */
#toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
    pointer-events: none;
}

.toast-v2 {
    pointer-events: all;
    display: grid;
    grid-template-columns: 36px 1fr auto;
    align-items: start;
    gap: 0 10px;
    min-width: 320px;
    max-width: 380px;
    background: #ffffff;
    border: 0.5px solid rgba(0,0,0,0.12);
    border-radius: 14px;
    padding: 14px;
    overflow: hidden;
    position: relative;
    animation: tv2-in 0.35s cubic-bezier(.34,1.56,.64,1) forwards;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.05);
}

.toast-v2.dismissing {
    animation: tv2-out 0.3s ease forwards;
}

@keyframes tv2-in {
    from { opacity: 0; transform: translateX(60px) scale(0.96); }
    to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes tv2-out {
    from { opacity: 1; transform: translateX(0) scale(1); max-height: 120px; }
    to   { opacity: 0; transform: translateX(60px) scale(0.94); max-height: 0; padding: 0; }
}

/* Icon */
.toast-v2-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}

/* Body */
.toast-v2-body { min-width: 0; }
.toast-v2-title {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    line-height: 1.3;
    margin: 0 0 3px;
}
.toast-v2-msg {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.5;
    margin: 0;
}

/* Close button */
.toast-v2-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    padding: 2px 4px;
    border-radius: 6px;
    font-size: 16px;
    line-height: 1;
    transition: color 0.15s, background 0.15s;
    margin-top: -2px;
}
.toast-v2-close:hover { color: #374151; background: #f3f4f6; }

/* Progress bar */
.toast-v2-track {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 3px;
    overflow: hidden;
    border-radius: 0 0 14px 14px;
}
.toast-v2-bar {
    height: 100%;
    width: 100%;
    transform-origin: left;
    animation: tv2-shrink linear forwards;
}
@keyframes tv2-shrink {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}

/* ===== TYPE THEMES ===== */
.toast-v2.success { border-left: 3px solid #22c55e; }
.toast-v2.success .toast-v2-icon { background: #dcfce7; color: #16a34a; }
.toast-v2.success .toast-v2-bar  { background: #22c55e; }

.toast-v2.error { border-left: 3px solid #ef4444; }
.toast-v2.error .toast-v2-icon { background: #fee2e2; color: #dc2626; }
.toast-v2.error .toast-v2-bar  { background: #ef4444; }

.toast-v2.warning { border-left: 3px solid #f59e0b; }
.toast-v2.warning .toast-v2-icon { background: #fef3c7; color: #d97706; }
.toast-v2.warning .toast-v2-bar  { background: #f59e0b; }

.toast-v2.info { border-left: 3px solid #3b82f6; }
.toast-v2.info .toast-v2-icon { background: #dbeafe; color: #2563eb; }
.toast-v2.info .toast-v2-bar  { background: #3b82f6; }

.toast-v2.purple { border-left: 3px solid #8b5cf6; }
.toast-v2.purple .toast-v2-icon { background: #ede9fe; color: #7c3aed; }
.toast-v2.purple .toast-v2-bar  { background: #8b5cf6; }

.toast-v2.loading { border-left: 3px solid #9ca3af; }
.toast-v2.loading .toast-v2-icon { background: #f3f4f6; color: #6b7280; }

/* Spinner dùng cho loading */
.toast-spinner {
    width: 17px; height: 17px;
    border: 2px solid #d1d5db;
    border-top-color: #6b7280;
    border-radius: 50%;
    animation: tv2-spin 0.7s linear infinite;
    display: inline-block;
}
@keyframes tv2-spin { to { transform: rotate(360deg); } }