/* Global toast notifications — top right, matches admin theme (root.css variables) */

.app-toast-container {
    position: fixed;
    top: calc(var(--header-height, 56px) + 12px);
    right: 16px;
    z-index: 1090;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: min(380px, calc(100vw - 32px));
    pointer-events: none;
}

.app-toast-container .app-toast {
    pointer-events: auto;
}

.app-toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(30, 41, 59, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.04);
    background: var(--bg-color-card, #fff);
    border-left: 4px solid var(--border-color, #e2e8f0);
    animation: app-toast-in 0.28s ease-out;
    opacity: 1;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.app-toast.is-hiding {
    opacity: 0;
    transform: translateX(12px);
}

@keyframes app-toast-in {
    from {
        opacity: 0;
        transform: translateX(16px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.app-toast__icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
}

.app-toast__body {
    flex: 1;
    min-width: 0;
    padding-top: 2px;
}

.app-toast__message {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.45;
    color: var(--text-dark, #1e293b);
    word-break: break-word;
}

.app-toast__close {
    flex-shrink: 0;
    border: none;
    background: transparent;
    padding: 4px;
    margin: -4px -4px -4px 0;
    line-height: 1;
    color: var(--text-dim-color, #94a3b8);
    border-radius: 6px;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
}

.app-toast__close:hover {
    color: var(--text-dark, #1e293b);
    background: var(--bg-color-dim, #f1f5f9);
}

/* Types */
.app-toast--success {
    border-left-color: var(--success-color, #10b981);
}

.app-toast--success .app-toast__icon {
    background: var(--stat-success-bg, #d1fae5);
    color: var(--stat-success-text, #10b981);
}

.app-toast--error {
    border-left-color: var(--danger-color, #ef4444);
}

.app-toast--error .app-toast__icon {
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger-color, #ef4444);
}

.app-toast--warning {
    border-left-color: var(--warning-color, #f59e0b);
}

.app-toast--warning .app-toast__icon {
    background: var(--stat-warning-bg, #fef3c7);
    color: var(--stat-warning-text, #f59e0b);
}

.app-toast--info {
    border-left-color: var(--info-color, #0ea5e9);
}

.app-toast--info .app-toast__icon {
    background: var(--stat-info-bg, #dbeafe);
    color: var(--stat-info-text, #0ea5e9);
}

/* Login page: no admin header variable */
body.login-page .app-toast-container {
    top: 16px;
}
