/* Global BOT CRM toast notifications */
#botCrmToastRoot {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: min(380px, calc(100vw - 2rem));
    pointer-events: none;
}

.bot-crm-toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow:
        0 4px 6px -1px rgba(15, 23, 42, 0.06),
        0 16px 32px -8px rgba(15, 23, 42, 0.12);
    border-left-width: 4px;
    animation: botCrmToastIn 0.35s cubic-bezier(0.21, 1.02, 0.73, 1);
    overflow: hidden;
}

.bot-crm-toast--leaving {
    animation: botCrmToastOut 0.25s ease forwards;
}

.bot-crm-toast--success {
    border-left-color: #22c55e;
}

.bot-crm-toast--error {
    border-left-color: #ef4444;
}

.bot-crm-toast--warning {
    border-left-color: #f59e0b;
}

.bot-crm-toast--info {
    border-left-color: #2563eb;
}

.bot-crm-toast__icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    font-size: 0.875rem;
}

.bot-crm-toast--success .bot-crm-toast__icon {
    background: #dcfce7;
    color: #16a34a;
}

.bot-crm-toast--error .bot-crm-toast__icon {
    background: #fee2e2;
    color: #dc2626;
}

.bot-crm-toast--warning .bot-crm-toast__icon {
    background: #fef3c7;
    color: #d97706;
}

.bot-crm-toast--info .bot-crm-toast__icon {
    background: #dbeafe;
    color: #2563eb;
}

.bot-crm-toast__body {
    flex: 1;
    min-width: 0;
    padding-top: 0.125rem;
}

.bot-crm-toast__title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 0.125rem;
    line-height: 1.3;
}

.bot-crm-toast__message {
    font-size: 0.8125rem;
    color: #475569;
    margin: 0;
    line-height: 1.45;
    word-break: break-word;
}

.bot-crm-toast__close {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    margin: -0.25rem -0.25rem 0 0;
    padding: 0;
    border: none;
    background: transparent;
    color: #94a3b8;
    border-radius: 6px;
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
}

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

.bot-crm-toast__progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: currentColor;
    opacity: 0.35;
    animation: botCrmToastProgress linear forwards;
}

.bot-crm-toast {
    position: relative;
}

.bot-crm-toast--success .bot-crm-toast__progress {
    color: #22c55e;
}

.bot-crm-toast--error .bot-crm-toast__progress {
    color: #ef4444;
}

.bot-crm-toast--warning .bot-crm-toast__progress {
    color: #f59e0b;
}

.bot-crm-toast--info .bot-crm-toast__progress {
    color: #2563eb;
}

@keyframes botCrmToastIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes botCrmToastOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

@keyframes botCrmToastProgress {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

@media (max-width: 480px) {
    #botCrmToastRoot {
        top: 0.75rem;
        right: 0.75rem;
        left: 0.75rem;
        width: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bot-crm-toast {
        animation: none;
    }

    .bot-crm-toast__progress {
        display: none;
    }
}
