/* Shared toast notifications used by public and CRM layouts. */
.app-toast-region {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 20000;
    width: min(390px, calc(100vw - 28px));
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.app-toast {
    --toast-accent: #2563eb;
    --toast-bg: #ffffff;
    --toast-text: #172033;
    --toast-muted: #657086;
    position: relative;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 28px;
    gap: 10px;
    align-items: start;
    overflow: hidden;
    padding: 12px 12px 13px;
    border: 1px solid rgba(15, 23, 42, .12);
    border-left: 4px solid var(--toast-accent);
    border-radius: 10px;
    background: var(--toast-bg);
    color: var(--toast-text);
    box-shadow: 0 14px 38px rgba(15, 23, 42, .18), 0 2px 8px rgba(15, 23, 42, .08);
    pointer-events: auto;
    transform: translateX(18px);
    opacity: 0;
    transition: transform .2s ease, opacity .2s ease;
    font-family: inherit;
}

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

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

.app-toast--success { --toast-accent: #17864b; }
.app-toast--error { --toast-accent: #c8323c; }
.app-toast--warning { --toast-accent: #c08313; }
.app-toast--info { --toast-accent: var(--site-primary, #2563eb); }

.app-toast__icon {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #fff;
    background: var(--toast-accent);
    font-size: 15px;
    font-weight: 800;
    line-height: 1;
}

.app-toast__content {
    min-width: 0;
    padding-top: 1px;
}

.app-toast__title {
    display: block;
    margin: 0 0 2px;
    color: var(--toast-text);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
}

.app-toast__message {
    margin: 0;
    color: var(--toast-muted);
    font-size: 13px;
    line-height: 1.45;
    overflow-wrap: anywhere;
    white-space: pre-line;
}

.app-toast__close {
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    font-size: 19px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.app-toast__close:hover,
.app-toast__close:focus-visible {
    background: rgba(15, 23, 42, .07);
    color: #111827;
    outline: none;
}

.app-toast__progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: color-mix(in srgb, var(--toast-accent) 80%, transparent 20%);
    transform-origin: left center;
    animation: app-toast-progress var(--toast-duration, 4500ms) linear forwards;
}

.app-toast.is-paused .app-toast__progress {
    animation-play-state: paused;
}

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

@media (max-width: 575.98px) {
    .app-toast-region {
        top: 10px;
        right: 10px;
        left: 10px;
        width: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-toast { transition: none; }
    .app-toast__progress { animation: none; }
}
