/* ==============================================================
   TOAST — notificações flutuantes (sucesso/erro/info/warning)
   ============================================================== */

.toast-stack {
    position: fixed;
    top: calc(var(--topbar-height) + 16px);
    right: 16px;
    z-index: 9000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    max-width: calc(100vw - 32px);
    width: 380px;
}

.toast {
    pointer-events: auto;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 14px 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 0.88rem;
    color: var(--text-primary);
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.32s cubic-bezier(0.2, 0.9, 0.3, 1.2),
                opacity 0.18s ease;
    position: relative;
    overflow: hidden;
}
.toast.toast-show {
    transform: translateX(0);
    opacity: 1;
}
.toast.toast-leaving {
    transform: translateX(120%);
    opacity: 0;
}

.toast-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: #fff;
}

.toast.toast-success .toast-icon { background: var(--color-success); }
.toast.toast-error   .toast-icon { background: var(--color-danger);  }
.toast.toast-info    .toast-icon { background: var(--color-primary); }
.toast.toast-warning .toast-icon { background: var(--color-warning); }

.toast-body {
    flex: 1;
    min-width: 0;
    line-height: 1.4;
}
.toast-title {
    font-weight: 600;
    margin: 0 0 2px 0;
    color: var(--text-primary);
}
.toast-text {
    color: var(--text-secondary);
    font-size: 0.84rem;
    word-wrap: break-word;
}

.toast-close {
    background: none;
    border: 0;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.95rem;
    padding: 2px 4px;
    flex-shrink: 0;
    line-height: 1;
}
.toast-close:hover { color: var(--text-primary); }

/* Barra de progresso (auto-dismiss) */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background: currentColor;
    opacity: 0.3;
    width: 100%;
    transform-origin: left;
    animation: toast-countdown linear forwards;
}
.toast.toast-success .toast-progress { color: var(--color-success); }
.toast.toast-error   .toast-progress { color: var(--color-danger);  }
.toast.toast-info    .toast-progress { color: var(--color-primary); }
.toast.toast-warning .toast-progress { color: var(--color-warning); }

@keyframes toast-countdown {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}

/* Mobile */
@media (max-width: 600px) {
    .toast-stack {
        right: 8px;
        left: 8px;
        width: auto;
        max-width: none;
        top: 8px;
    }
    .toast { font-size: 0.85rem; }
}
