/* Zone globale */
.toast-stack {
    position: fixed;
    top: 88px;
    right: 24px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: min(420px, calc(100vw - 32px));
    pointer-events: none;
}

/* Toast */
.premium-toast {
    position: relative;
    display: grid;
    grid-template-columns: 48px 1fr 40px;
    align-items: start;
    gap: 14px;
    padding: 16px 16px 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow:
        0 10px 30px rgba(15, 23, 42, 0.10),
        0 2px 10px rgba(15, 23, 42, 0.06);
    border: 1px solid rgba(226, 232, 240, 0.95);
    overflow: hidden;
    pointer-events: auto;
    transform: translateY(-12px) scale(0.98);
    opacity: 0;
    animation: toastIn 0.35s ease forwards;
}

/* Variantes */
.premium-toast--success {
    border-left: 4px solid #16a34a;
}

.premium-toast--error {
    border-left: 4px solid #dc2626;
}

.premium-toast--warning {
    border-left: 4px solid #f59e0b;
}

.premium-toast--info {
    border-left: 4px solid #2563eb;
}

/* Icône */
.premium-toast__icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    color: #0f172a;
    flex-shrink: 0;
}

.premium-toast--success .premium-toast__icon {
    background: rgba(22, 163, 74, 0.10);
    color: #15803d;
}

.premium-toast--error .premium-toast__icon {
    background: rgba(220, 38, 38, 0.10);
    color: #b91c1c;
}

.premium-toast--warning .premium-toast__icon {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
}

.premium-toast--info .premium-toast__icon {
    background: rgba(37, 99, 235, 0.10);
    color: #1d4ed8;
}

.premium-toast__icon i {
    font-size: 22px;
}

/* Contenu */
.premium-toast__content {
    min-width: 0;
}

.premium-toast__title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 4px;
    line-height: 1.2;
}

.premium-toast__text {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #475569;
    word-break: break-word;
}

/* Bouton fermer */
.premium-toast__close {
    border: none;
    background: transparent;
    color: #94a3b8;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: -2px;
}

.premium-toast__close:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.premium-toast__close i {
    font-size: 20px;
}

/* Barre de progression */
.premium-toast__progress {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 100%;
    background: rgba(148, 163, 184, 0.18);
    transform-origin: left center;
}

.premium-toast--success .premium-toast__progress {
    background: linear-gradient(90deg, #22c55e 0%, #16a34a 100%);
}

.premium-toast--error .premium-toast__progress {
    background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
}

.premium-toast--warning .premium-toast__progress {
    background: linear-gradient(90deg, #fbbf24 0%, #f59e0b 100%);
}

.premium-toast--info .premium-toast__progress {
    background: linear-gradient(90deg, #60a5fa 0%, #2563eb 100%);
}

/* Sortie */
.premium-toast.is-closing {
    animation: toastOut 0.28s ease forwards;
}

/* Animations */
@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(-12px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
        max-height: 220px;
        margin-bottom: 0;
    }
    to {
        opacity: 0;
        transform: translateY(-10px) scale(0.98);
        max-height: 0;
        margin-bottom: -8px;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .toast-stack {
        top: 76px;
        right: 12px;
        left: 12px;
        width: auto;
    }

    .premium-toast {
        grid-template-columns: 42px 1fr 36px;
        gap: 12px;
        padding: 14px 14px 12px;
        border-radius: 16px;
    }

    .premium-toast__icon {
        width: 42px;
        height: 42px;
        border-radius: 12px;
    }
}
/* =========================================================
   PREMIUM TOASTS — DARK MODE FINAL
   Compatible html[data-theme], body.dark-mode, body.dark-theme
   ========================================================= */

html[data-theme="dark"] .premium-toast,
body.dark-mode .premium-toast,
body.dark-theme .premium-toast,
.dark-theme .premium-toast {
  background:
    radial-gradient(circle at top left, rgba(250, 204, 21, 0.10), transparent 34%),
    #111c31 !important;
  border-color: #29405f !important;
  color: #f8fafc !important;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42) !important;
}

html[data-theme="dark"] .premium-toast__title,
body.dark-mode .premium-toast__title,
body.dark-theme .premium-toast__title,
.dark-theme .premium-toast__title {
  color: #f8fafc !important;
}

html[data-theme="dark"] .premium-toast__text,
body.dark-mode .premium-toast__text,
body.dark-theme .premium-toast__text,
.dark-theme .premium-toast__text {
  color: #cbd5e1 !important;
}

html[data-theme="dark"] .premium-toast__close,
body.dark-mode .premium-toast__close,
body.dark-theme .premium-toast__close,
.dark-theme .premium-toast__close {
  color: #94a3b8 !important;
}

html[data-theme="dark"] .premium-toast__close:hover,
body.dark-mode .premium-toast__close:hover,
body.dark-theme .premium-toast__close:hover,
.dark-theme .premium-toast__close:hover {
  background: rgba(148, 163, 184, 0.12) !important;
  color: #f8fafc !important;
}

/* Icônes par type */

html[data-theme="dark"] .premium-toast--success .premium-toast__icon,
body.dark-mode .premium-toast--success .premium-toast__icon,
body.dark-theme .premium-toast--success .premium-toast__icon,
.dark-theme .premium-toast--success .premium-toast__icon {
  background: rgba(34, 197, 94, 0.14) !important;
  color: #86efac !important;
}

html[data-theme="dark"] .premium-toast--error .premium-toast__icon,
html[data-theme="dark"] .premium-toast--danger .premium-toast__icon,
body.dark-mode .premium-toast--error .premium-toast__icon,
body.dark-mode .premium-toast--danger .premium-toast__icon,
body.dark-theme .premium-toast--error .premium-toast__icon,
body.dark-theme .premium-toast--danger .premium-toast__icon,
.dark-theme .premium-toast--error .premium-toast__icon,
.dark-theme .premium-toast--danger .premium-toast__icon {
  background: rgba(244, 63, 94, 0.14) !important;
  color: #fecdd3 !important;
}

html[data-theme="dark"] .premium-toast--warning .premium-toast__icon,
body.dark-mode .premium-toast--warning .premium-toast__icon,
body.dark-theme .premium-toast--warning .premium-toast__icon,
.dark-theme .premium-toast--warning .premium-toast__icon {
  background: rgba(250, 204, 21, 0.14) !important;
  color: #facc15 !important;
}

html[data-theme="dark"] .premium-toast--info .premium-toast__icon,
body.dark-mode .premium-toast--info .premium-toast__icon,
body.dark-theme .premium-toast--info .premium-toast__icon,
.dark-theme .premium-toast--info .premium-toast__icon {
  background: rgba(96, 165, 250, 0.14) !important;
  color: #93c5fd !important;
}