/* Toast notifications — fixed top-right stack */
.toast-stack {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: .75rem;
    width: min(420px, calc(100vw - 2rem));
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .9375rem 1rem .9375rem .875rem;
    background: #fff;
    border-radius: .875rem;
    border: 1px solid #e2e8f0;
    box-shadow:
        0 16px 40px rgba(15, 23, 42, .14),
        0 4px 12px rgba(15, 23, 42, .08);
    transform: translateX(calc(100% + 2rem));
    opacity: 0;
    transition: transform .4s cubic-bezier(.22, 1, .36, 1), opacity .35s ease;
    position: relative;
    overflow: hidden;
}

.toast.is-visible {
    transform: translateX(0);
    opacity: 1;
}

.toast.is-leaving {
    transform: translateX(calc(100% + 2rem));
    opacity: 0;
}

.toast__icon {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
}

.toast__body {
    flex: 1;
    min-width: 0;
    padding-top: .125rem;
}

.toast__title {
    margin: 0 0 .125rem;
    font-size: .8125rem;
    font-weight: 700;
    letter-spacing: .01em;
    text-transform: uppercase;
}

.toast__message {
    margin: 0;
    font-size: .9375rem;
    line-height: 1.45;
    color: #334155;
}

.toast__message ul {
    margin: .25rem 0 0;
    padding-left: 1.125rem;
}

.toast__message li + li {
    margin-top: .25rem;
}

.toast__close {
    flex-shrink: 0;
    width: 1.75rem;
    height: 1.75rem;
    margin: -.125rem -.125rem 0 0;
    border: none;
    border-radius: .5rem;
    background: transparent;
    color: #94a3b8;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}

.toast__close:hover {
    background: #f1f5f9;
    color: #475569;
}

.toast__progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: rgba(15, 23, 42, .08);
    transform-origin: left center;
    transform: scaleX(1);
}

.toast--success {
    border-left: 4px solid #22c55e;
}

.toast--success .toast__icon {
    background: #dcfce7;
    color: #15803d;
}

.toast--success .toast__title {
    color: #15803d;
}

.toast--success .toast__progress {
    background: linear-gradient(90deg, #22c55e, #4ade80);
}

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

.toast--error .toast__icon {
    background: #fee2e2;
    color: #b91c1c;
}

.toast--error .toast__title {
    color: #b91c1c;
}

.toast--error .toast__progress {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

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

.toast--warning .toast__icon {
    background: #fef3c7;
    color: #b45309;
}

.toast--warning .toast__title {
    color: #b45309;
}

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

.toast--info {
    border-left: 4px solid #3b82f6;
}

.toast--info .toast__icon {
    background: #dbeafe;
    color: #1d4ed8;
}

.toast--info .toast__title {
    color: #1d4ed8;
}

.toast--info .toast__progress {
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

/* Inline alerts (in-page, not fixed) */
.alert--inline,
.notice--inline {
    padding: .875rem 1rem;
    border-radius: .625rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    font-size: .9375rem;
    line-height: 1.5;
}

.alert--inline.alert-success,
.notice--inline.notice-success {
    background: #ecfdf5;
    color: #166534;
    border-color: #bbf7d0;
}

.alert--inline.alert-error,
.notice--inline.notice-error {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}

.alert--inline.alert-warning,
.notice--inline.notice-warning {
    background: #fffbeb;
    color: #92400e;
    border-color: #fde68a;
}

.alert--inline.alert-info,
.notice--inline.notice-info {
    background: #eff6ff;
    color: #1e40af;
    border-color: #bfdbfe;
}

@media (max-width: 768px) {
    .toast-stack {
        top: .875rem;
        right: .875rem;
        left: .875rem;
        width: auto;
    }

    body:has(.admin-mobile-bar) .toast-stack {
        top: 4.25rem;
    }
}
