/* ==========================================================================
   Единый вид выпадашек и галочек CRM (lk и sale) — пользователь 15.11.2026: «стрелка прилеплена прямо к правому краю…
   выпадающее меню выглядит как системное… то же касается чекбоксов». Подключается сразу после style-new.css:
   у модульных css (подключены ниже) при равной специфичности последнее слово, у общих правил style-new.css — нет.

   1. Закрытый <select> — без системного вида: шеврон Iconsax (arrow-down) в 12px от правого края, место под него
      padding-right 32px. Свойства шеврона и отступа — с !important: в CRM сотни селектов со своими классами
      и shorthand `background:`, который иначе стирал бы шеврон. Высота, ширина, рамки, цвета — свои у каждого селекта.
   2. Открытое меню — .uisel-* (рисует ui-select.js, вид из lk2 .csel-*).
   3. Чекбоксы и радио — рисованные: галочка, точка, «частично» (indeterminate), hover / focus / disabled.
      Цвет — --uicb-accent (рядом с прежним accent-color в правилах модулей), иначе --primary-color.
      Размер по умолчанию 16px, свой размер в правилах разделов сохраняется (кроме общих правил style-new.css
      той же специфичности); max 20px — защита от общих `input { width: 100% }`.
      Не трогаем: data-native, скрытые input тумблеров (.xxx-switch input), свои рисованные (#parserLaunchModal).
   ========================================================================== */

:root {
    --uisel-chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M19.92 8.95l-6.52 6.52c-.77.77-2.03.77-2.8 0L4.08 8.95' stroke='%236b7280' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' stroke-miterlimit='10'/%3E%3C/svg%3E");
    --uisel-chev-open: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M19.92 15.05l-6.52-6.52c-.77-.77-2.03-.77-2.8 0L4.08 15.05' stroke='%23074783' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' stroke-miterlimit='10'/%3E%3C/svg%3E");
    --uicb-tick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='5 5 14 14' fill='none'%3E%3Cpath d='m7.75 12 2.83 2.83 5.67-5.66' stroke='%23fff' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    --uicb-dash: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='5 5 14 14' fill='none'%3E%3Cpath d='M8.25 12h7.5' stroke='%23fff' stroke-width='2.3' stroke-linecap='round'/%3E%3C/svg%3E");
    --uicb-bd: #b6bdc8;
    --uicb-bd-hover: #8d96a5;
}
body[data-theme="dark"] {
    --uisel-chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M19.92 8.95l-6.52 6.52c-.77.77-2.03.77-2.8 0L4.08 8.95' stroke='%239ca3af' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' stroke-miterlimit='10'/%3E%3C/svg%3E");
    --uisel-chev-open: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M19.92 15.05l-6.52-6.52c-.77-.77-2.03-.77-2.8 0L4.08 15.05' stroke='%234a9eff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' stroke-miterlimit='10'/%3E%3C/svg%3E");
    --uicb-bd: #5b6576;
    --uicb-bd-hover: #8792a4;
}
/* Продажи: акцент — чернила раздела, а не синий CRM */
#salesTab { --uicb-accent: var(--s-acc, var(--primary-color)); }

/* ---------------------------------------------------------------- 1. select */
/* Голый <select> без своих стилей: после `* { padding: 0 }` и appearance:none текст лёг бы на рамку */
:where(select:not([multiple]):not([size])) {
    padding: 4px 10px;
    border: 1px solid var(--border-color, #dadce0);
    border-radius: 6px;
    background-color: var(--card-bg, #fff);
    color: var(--text-color, #202124);
    font-family: inherit;
    line-height: 1.35;
}
select:not([multiple]):not([size]):not([data-native]):not(.flatpickr-monthDropdown-months),
select[size="1"]:not([multiple]):not([data-native]),
select[size="0"]:not([multiple]):not([data-native]) {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    background-image: var(--uisel-chev) !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 12px 12px !important;
    padding-right: 32px !important;
    text-overflow: ellipsis;
    cursor: pointer;
}
select[data-uisel-open]:not([multiple]):not([size]):not([data-native]):not(.flatpickr-monthDropdown-months),
select[data-uisel-open][size="1"]:not([multiple]):not([data-native]) { background-image: var(--uisel-chev-open) !important; }
select:disabled { cursor: default; }
select::-ms-expand { display: none; }

/* -------------------------------------------------------- 2. меню ui-select.js */
.uisel-menu {
    position: fixed; top: 0; left: 0; z-index: 2147483000; box-sizing: border-box;
    padding: 6px; border: 1px solid var(--border-color, #dadce0); border-radius: 12px;
    background: var(--card-bg, #fff); color: var(--text-color, #202124);
    font-family: inherit; font-size: 13px; line-height: 1.35; text-align: left;
    box-shadow: 0 12px 36px rgba(18, 30, 55, .16), 0 2px 8px rgba(18, 30, 55, .06);
    animation: uisel-pop .14s cubic-bezier(.22, .9, .35, 1.15); transform-origin: top left;
    -webkit-user-select: none; user-select: none;
}
.uisel-menu.up { transform-origin: bottom left; animation-name: uisel-pop-up; }
@keyframes uisel-pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes uisel-pop-up { from { opacity: 0; transform: translateY(4px) scale(.98); } to { opacity: 1; transform: none; } }
.uisel-list { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.uisel-item {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 7px 10px; border-radius: 8px; cursor: pointer; white-space: nowrap; color: var(--text-color, #202124);
}
.uisel-item + .uisel-item { margin-top: 1px; }
.uisel-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.uisel-text.empty { color: var(--text-secondary, #9ca3af); }
.uisel-item.hl { background: var(--hover-bg, #f1f3f4); }
.uisel-item.sel { background: var(--primary-light, #e8f0f8); color: var(--primary-color, #074783); font-weight: 600; }
.uisel-item.sel.hl { background: color-mix(in srgb, var(--primary-color, #074783) 13%, var(--card-bg, #fff)); }
.uisel-item.dis { opacity: .45; cursor: default; }
.uisel-item.dis.hl { background: none; }
.uisel-item.in-group { padding-left: 16px; }
.uisel-tick { display: inline-flex; flex: none; margin-right: -2px; color: var(--primary-color, #074783); }
.uisel-group { padding: 8px 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-secondary, #9ca3af); }
.uisel-group:not(:first-child) { margin-top: 4px; border-top: 1px solid var(--border-light, #e8eaed); padding-top: 10px; }
.uisel-empty { padding: 10px 12px; color: var(--text-muted, #5f6368); }
.uisel-search {
    display: flex; align-items: center; gap: 8px; min-height: 30px; margin: 0 0 6px; padding: 2px 8px 7px;
    border-bottom: 1px solid var(--border-light, #e8eaed); color: var(--text-secondary, #9ca3af);
}
.uisel-field { display: flex; align-items: center; flex: 1; min-width: 0; overflow: hidden; white-space: pre; }
.uisel-q { color: var(--text-color, #202124); overflow: hidden; text-overflow: ellipsis; }
.uisel-caret { flex: none; width: 1.5px; height: 15px; margin: 0 1px; background: var(--primary-color, #074783); animation: uisel-blink 1.05s steps(1) infinite; }
.uisel-ph { color: var(--text-secondary, #9ca3af); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; }
.uisel-menu.has-q .uisel-ph { display: none; }
@keyframes uisel-blink { 50% { opacity: 0; } }
body[data-theme="dark"] .uisel-menu { box-shadow: 0 14px 38px rgba(0, 0, 0, .5), 0 2px 8px rgba(0, 0, 0, .3); }
/* меню селекта из Продаж — чернила раздела */
.uisel-menu.in-sales .uisel-item.sel { background: #f1f5f9; color: #0f172a; }
.uisel-menu.in-sales .uisel-item.sel.hl { background: #e2e8f0; }
.uisel-menu.in-sales .uisel-tick { color: #0f172a; }
.uisel-menu.in-sales .uisel-caret { background: #0f172a; }
body[data-theme="dark"] .uisel-menu.in-sales .uisel-item.sel { background: #263449; color: #e2e8f0; }
body[data-theme="dark"] .uisel-menu.in-sales .uisel-item.sel.hl { background: #2f3f57; }
body[data-theme="dark"] .uisel-menu.in-sales .uisel-tick { color: #e2e8f0; }
body[data-theme="dark"] .uisel-menu.in-sales .uisel-caret { background: #e2e8f0; }

/* ------------------------------------------------------- 3. чекбоксы и радио */
input:is([type="checkbox"], [type="radio"]):not(:where([data-native], #parserLaunchModal input, .ios-toggle input, .am-switch input, .acc-switch input, .dcb-switch input, .prc-switch input, .ctl-switch input, .cu-switch input, .trn-switch input, .rca-switch input, .usg-switch input, .wk-switch input, .wk-fc-msg input, .sapply input, .omni-toggle input, .cal-flt input, .cdg-pick input, .stmt-upload-label input, .bulk-parser-item input)) {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    box-sizing: border-box !important;
    width: 16px;
    height: 16px;
    max-width: 20px !important;
    max-height: 20px !important;
    padding: 0 !important;
    border: 1.5px solid var(--uicb-bd) !important;
    border-radius: 4px !important;
    background-color: var(--card-bg, #fff) !important;
    background-image: none !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: 100% 100% !important;
    box-shadow: none !important;
    outline: none;
    flex-shrink: 0;
    vertical-align: -3px;
    cursor: pointer;
    transition: background-color .12s ease, border-color .12s ease, box-shadow .12s ease;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
input[type="radio"]:not(:where([data-native], #parserLaunchModal input, .ios-toggle input, .am-switch input, .acc-switch input, .dcb-switch input, .prc-switch input, .ctl-switch input, .cu-switch input, .trn-switch input, .rca-switch input, .usg-switch input, .wk-switch input, .wk-fc-msg input, .sapply input, .omni-toggle input, .cal-flt input, .cdg-pick input, .stmt-upload-label input, .bulk-parser-item input)) {
    border-radius: 50% !important;
}
input:is([type="checkbox"], [type="radio"]):not(:where([data-native], #parserLaunchModal input, .ios-toggle input, .am-switch input, .acc-switch input, .dcb-switch input, .prc-switch input, .ctl-switch input, .cu-switch input, .trn-switch input, .rca-switch input, .usg-switch input, .wk-switch input, .wk-fc-msg input, .sapply input, .omni-toggle input, .cal-flt input, .cdg-pick input, .stmt-upload-label input, .bulk-parser-item input)):hover:not(:disabled) {
    border-color: var(--uicb-accent, var(--primary-color, #074783)) !important;
}
input[type="checkbox"]:not(:where([data-native], #parserLaunchModal input, .ios-toggle input, .am-switch input, .acc-switch input, .dcb-switch input, .prc-switch input, .ctl-switch input, .cu-switch input, .trn-switch input, .rca-switch input, .usg-switch input, .wk-switch input, .wk-fc-msg input, .sapply input, .omni-toggle input, .cal-flt input, .cdg-pick input, .stmt-upload-label input, .bulk-parser-item input)):is(:checked, :indeterminate) {
    border-color: var(--uicb-accent, var(--primary-color, #074783)) !important;
    background-color: var(--uicb-accent, var(--primary-color, #074783)) !important;
    background-image: var(--uicb-tick) !important;
}
input[type="checkbox"]:not(:where([data-native], #parserLaunchModal input, .ios-toggle input, .am-switch input, .acc-switch input, .dcb-switch input, .prc-switch input, .ctl-switch input, .cu-switch input, .trn-switch input, .rca-switch input, .usg-switch input, .wk-switch input, .wk-fc-msg input, .sapply input, .omni-toggle input, .cal-flt input, .cdg-pick input, .stmt-upload-label input, .bulk-parser-item input)):indeterminate {
    background-image: var(--uicb-dash) !important;
}
input[type="radio"]:not(:where([data-native], #parserLaunchModal input, .ios-toggle input, .am-switch input, .acc-switch input, .dcb-switch input, .prc-switch input, .ctl-switch input, .cu-switch input, .trn-switch input, .rca-switch input, .usg-switch input, .wk-switch input, .wk-fc-msg input, .sapply input, .omni-toggle input, .cal-flt input, .cdg-pick input, .stmt-upload-label input, .bulk-parser-item input)):checked {
    border-color: var(--uicb-accent, var(--primary-color, #074783)) !important;
    background-image: radial-gradient(circle closest-side, var(--uicb-accent, var(--primary-color, #074783)) 0 54%, transparent 60%) !important;
}
input:is([type="checkbox"], [type="radio"]):not(:where([data-native], #parserLaunchModal input, .ios-toggle input, .am-switch input, .acc-switch input, .dcb-switch input, .prc-switch input, .ctl-switch input, .cu-switch input, .trn-switch input, .rca-switch input, .usg-switch input, .wk-switch input, .wk-fc-msg input, .sapply input, .omni-toggle input, .cal-flt input, .cdg-pick input, .stmt-upload-label input, .bulk-parser-item input)):focus-visible {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--uicb-accent, var(--primary-color, #074783)) 22%, transparent) !important;
}
input:is([type="checkbox"], [type="radio"]):not(:where([data-native], #parserLaunchModal input, .ios-toggle input, .am-switch input, .acc-switch input, .dcb-switch input, .prc-switch input, .ctl-switch input, .cu-switch input, .trn-switch input, .rca-switch input, .usg-switch input, .wk-switch input, .wk-fc-msg input, .sapply input, .omni-toggle input, .cal-flt input, .cdg-pick input, .stmt-upload-label input, .bulk-parser-item input)):disabled {
    cursor: not-allowed;
    opacity: .5;
}
