/**
 * CRM: крестик очистки для полей с <datalist> (input[list]).
 * Ручная разметка: обёртка .crm-input-with-clear + .crm-input-clear-btn (как у контрагента в документах).
 */

.crm-input-with-clear .crm-input-clear-btn {
    z-index: 3;
    line-height: 1;
    border: 0;
    text-decoration: none;
}

.crm-input-with-clear .crm-input-clear-btn:hover,
.crm-input-with-clear .crm-input-clear-btn:focus {
    color: var(--bs-danger, #dc3545) !important;
    text-decoration: none;
}

.crm-input-with-clear .crm-input-clear-btn:focus-visible {
    outline: 2px solid var(--bs-primary, #0d6efd);
    outline-offset: 2px;
    border-radius: 0.2rem;
}

/* iOS рисует нативную стрелку datalist поверх текста; оставляем ей место справа. */
.funnel-quick-add__entity-input[list] {
    padding-right: 2.85rem;
    text-overflow: ellipsis;
}

.funnel-quick-add__entity-input[list]::-webkit-calendar-picker-indicator {
    margin-right: -0.25rem;
    padding-left: 0.5rem;
    cursor: pointer;
}

.funnel-quick-add__entity-input.is-entity-selected::-webkit-calendar-picker-indicator {
    display: none;
    opacity: 0;
    pointer-events: none;
}

/* Центрированные уведомления (Сделка добавлена и т.д.) — flex вместо transform, чтобы на мобилке не съезжали */
#global-notifications {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    min-height: 100vh;
    z-index: 1060;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: calc(1rem + env(safe-area-inset-top, 0px)) calc(1rem + env(safe-area-inset-right, 0px)) calc(1rem + env(safe-area-inset-bottom, 0px)) calc(1rem + env(safe-area-inset-left, 0px));
    pointer-events: none;
    box-sizing: border-box;
}

@supports (height: 100dvh) {
    #global-notifications {
        height: 100dvh;
        min-height: 100dvh;
    }
}

#global-notifications .alert {
    pointer-events: auto;
    width: min(100%, 360px);
    max-width: 100%;
    margin: 0;
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.15);
}
