/* Real-time notification toast stack — newest on top, older pushed down */
.realtime-notification-stack {
    position: fixed;
    top: 4.5rem;
    right: 1rem;
    z-index: 1105;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    width: min(22rem, calc(100vw - 2rem));
    pointer-events: none;
}

html[dir="RTL"] .realtime-notification-stack {
    right: auto;
    left: 1rem;
}

.realtime-notification-toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.75rem 0.85rem;
    background: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.14);
    border-inline-start: 4px solid #0d6efd;
    animation: rt-notif-slide-in 0.28s ease-out;
    max-width: 100%;
}

.realtime-notification-toast.toast-hiding {
    animation: rt-notif-fade-out 0.22s ease-in forwards;
}

.realtime-notification-toast.type-info {
    border-inline-start-color: #0dcaf0;
}

.realtime-notification-toast.type-warning {
    border-inline-start-color: #ffc107;
}

.realtime-notification-toast.type-success {
    border-inline-start-color: #198754;
}

.realtime-notification-toast.type-error,
.realtime-notification-toast.type-urgent {
    border-inline-start-color: #dc3545;
}

.realtime-notification-toast .toast-icon {
    flex: 0 0 auto;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
}

.realtime-notification-toast.type-info .toast-icon {
    background: rgba(13, 202, 240, 0.15);
    color: #0aa2c0;
}

.realtime-notification-toast.type-warning .toast-icon {
    background: rgba(255, 193, 7, 0.2);
    color: #997404;
}

.realtime-notification-toast.type-success .toast-icon {
    background: rgba(25, 135, 84, 0.15);
    color: #198754;
}

.realtime-notification-toast.type-error .toast-icon,
.realtime-notification-toast.type-urgent .toast-icon {
    background: rgba(220, 53, 69, 0.12);
    color: #dc3545;
}

.realtime-notification-toast .toast-content {
    flex: 1 1 auto;
    min-width: 0;
    cursor: pointer;
}

.realtime-notification-toast .toast-title {
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.3;
    color: #212529;
    margin-bottom: 0.15rem;
    word-break: break-word;
}

.realtime-notification-toast .toast-message {
    font-size: 0.82rem;
    line-height: 1.35;
    color: #6c757d;
    word-break: break-word;
}

.realtime-notification-toast .toast-close {
    flex: 0 0 auto;
    border: none;
    background: transparent;
    color: #6c757d;
    font-size: 1.25rem;
    line-height: 1;
    padding: 0 0.15rem;
    cursor: pointer;
    opacity: 0.75;
}

.realtime-notification-toast .toast-close:hover {
    opacity: 1;
    color: #212529;
}

@keyframes rt-notif-slide-in {
    from {
        opacity: 0;
        transform: translateY(-12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes rt-notif-fade-out {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-8px);
    }
}
