/* B-PIM: оформление по токенам нового макета (new.besfo.ru, tokens.css): серый фон, линии #E0E0E0, Inter, без цветной обводки полей */
html, body, button, input, select, textarea { font-family: var(--font-main, 'Inter', Arial, sans-serif) !important; }
body { background: var(--color-gray-light, #F5F5F5) !important; color: var(--color-text, #1A1A1A); font-size: var(--text-body, 14px); }
/* линии — тонкие, цвета макета */
table, th, td, hr, fieldset, [class*="border"] { border-color: var(--color-border, #E0E0E0) !important; }
#result_list tbody tr td, #result_list tbody tr th { border-color: var(--color-divider, #F2F2F2) !important; }
/* поля: без красной обводки и свечения при фокусе, рамка темнее */
input:focus, select:focus, textarea:focus, button:focus, a:focus,
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
  outline: none !important; box-shadow: none !important;
  --tw-ring-shadow: 0 0 #0000 !important; --tw-ring-offset-shadow: 0 0 #0000 !important; --tw-ring-color: transparent !important;
}
input:focus, select:focus, textarea:focus { border-color: var(--color-separator, #949494) !important; }
input:not([type=checkbox]):not([type=radio]), select, textarea { border-radius: 8px !important; }
/* лишнее: кнопка сворачивания меню */
[\@click*="sidebarDesktopOpen"], [x-on\:click*="sidebarDesktopOpen"] { display: none !important; }
/* список: компактные строки, строка целиком кликабельна */
#result_list td, #result_list th { padding-top: 6px !important; padding-bottom: 6px !important; white-space: nowrap; }
#result_list td.field-title, #result_list th.field-title { white-space: normal; min-width: 320px; }
#result_list tbody tr { cursor: pointer; }
#result_list tbody tr:hover td, #result_list tbody tr:hover th { background: var(--color-gray-light, #F5F5F5) !important; }
#result_list img { width: 40px !important; height: 40px !important; object-fit: contain; }

/* B-PIM: убрать значок сворачивания меню (dock_to_right) и черту за ним — на компьютере */
#header-inner [x-on\:click*="sidebarDesktopOpen"] { display: none !important; }
@media (min-width: 1280px) {
  #header-inner .cursor-pointer:has(> [x-on\:click*="sidebarDesktopOpen"]),
  #header-inner .cursor-pointer:has(> [x-on\:click*="sidebarDesktopOpen"]) + span.w-px { display: none !important; }
}

/* B-PIM: заголовок раздела крупно вместо крошек; без разделительной линии под шапкой */
h1:has(> .b-title) { line-height: 32px !important; }
.b-title { font-size: 24px; font-weight: 600; line-height: 32px; letter-spacing: -0.01em; color: #1A1A1A; }
div:has(> div > #header-inner) { border-bottom: 0 !important; }
#nav-sidebar-inner > div:first-child, nav > div.h-\[65px\], div.h-\[65px\].border-b { border-bottom: 0 !important; }

/* B-PIM: содержимое на всю ширину, без центрирования — отступ от меню 16px */
#main .container { max-width: none !important; margin-left: 0 !important; margin-right: 0 !important; }

/* B-PIM: галочки — вся ячейка 48px кликабельна, сама галочка 18px */
#result_list td.action-checkbox, #result_list th.action-checkbox-column { width: 48px !important; min-width: 48px; padding: 0 !important; text-align: center; cursor: pointer; }
#result_list input.action-select, #result_list #action-toggle { width: 18px !important; height: 18px !important; cursor: pointer; margin: 0; vertical-align: middle; }

/* B-PIM: пока не загружен шрифт значков — значки скрыты, названия-слова не показываются */
html.b-icons-wait .material-symbols-outlined { visibility: hidden !important; }
html.b-icons-wait input[type=checkbox]::after, html.b-icons-wait input[type=radio]::after { visibility: hidden !important; }

/* B-PIM: галочки не прижаты к краю — отступ слева как у остальных колонок */
#result_list td.action-checkbox, #result_list th.action-checkbox-column { padding: 0 8px 0 16px !important; width: 42px !important; min-width: 42px !important; }
#result_list input.action-select, #result_list #action-toggle { display: block !important; position: static !important; margin: 0 !important; transform: none !important; }

/* B-PIM: ячейка с галочкой — курсор-рука во всю высоту строки */
#result_list td.action-checkbox, #result_list th.action-checkbox-column { cursor: pointer; }

/* B-PIM: галочки — серые, ровная птичка линией (без значка шрифта) */
#result_list input[type=checkbox] {
  -webkit-appearance: none !important; appearance: none !important;
  width: 18px !important; height: 18px !important; margin: 0 !important;
  border-radius: 4px !important;
  background-color: #fff; box-shadow: none !important; outline: none !important;
  display: block !important; position: relative !important; cursor: pointer;
}
#result_list input[type=checkbox]::after, #result_list input[type=checkbox]::before { content: none !important; display: none !important; }
#result_list input[type=checkbox]:checked {
  border-color: #929292 !important;
  background: #929292 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px 14px no-repeat !important;
}
#result_list input[type=checkbox]:indeterminate {
  border-color: #929292 !important;
  background: #929292 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8h8' fill='none' stroke='white' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center / 14px 14px no-repeat !important;
}

/* B-PIM: названия колонок закреплены при прокрутке таблицы */
#result_list thead th { position: sticky; top: 0; z-index: 5; background: #fff; }

/* B-PIM: лента фото в карточке */
.b-photos { display: flex; flex-wrap: wrap; gap: 8px; }
.b-ph { width: 96px; height: 96px; border: 1px solid #E0E0E0; border-radius: 8px; background: #fff; overflow: hidden; position: relative; cursor: grab; }
.b-ph a, .b-ph img { display: block; width: 100%; height: 100%; object-fit: contain; }
.b-ph:first-child::after { content: 'главное'; position: absolute; left: 4px; bottom: 4px; font-size: 11px; line-height: 16px; padding: 0 4px; border-radius: 4px; background: rgba(255,255,255,.9); color: #1A1A1A; }
.b-ph.b-drag { opacity: .4; }
.b-photos-hint { font-size: 12px; color: #929292; margin-top: 6px; }

/* B-PIM: добавление и удаление фото */
.b-ph-add { width: 96px; height: 96px; border: 1px dashed #929292; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 32px; color: #929292; cursor: pointer; background: #fff; }
.b-ph-add:hover { color: #1A1A1A; border-color: #1A1A1A; }
.b-ph-del { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border-radius: 50%; border: 1px solid #E0E0E0; background: #fff; color: #1A1A1A; font-size: 14px; line-height: 18px; text-align: center; padding: 0; cursor: pointer; opacity: 0; }
.b-ph:hover .b-ph-del { opacity: 1; }
.b-photos.b-drop { outline: 2px dashed #929292; outline-offset: 4px; border-radius: 8px; }

/* B-PIM: блок фото без подписи и рамки, лента на всю ширину */
.form-rows:has(.field-photos) { border: 0 !important; box-shadow: none !important; overflow: visible !important; background: transparent !important; }
.field-photos { padding: 0 0 8px 0 !important; }
.field-photos > div:first-child { display: none !important; }
.field-photos .readonly { max-width: none !important; }
/* крестик удаления — квадрат со скруглением, явный */
.b-ph-del { width: 24px !important; height: 24px !important; border-radius: 8px !important; border: 1px solid #E0E0E0 !important; background: #fff !important; color: #1A1A1A !important; font-size: 18px !important; font-weight: 600; line-height: 22px !important; box-shadow: 0 1px 4px rgba(0,0,0,.18); }
.b-ph-del:hover { background: #1A1A1A !important; color: #fff !important; border-color: #1A1A1A !important; }

/* B-PIM: блок фото без подписи и рамки, лента на всю ширину (привязка к самой ленте) */
.form-rows:has(.b-photos) { border: 0 !important; box-shadow: none !important; overflow: visible !important; background: transparent !important; }
.field-line:has(.b-photos) { padding: 0 0 8px 0 !important; }
.field-line:has(.b-photos) > div:first-child { display: none !important; }
.readonly:has(.b-photos) { max-width: none !important; }

/* B-PIM: поле «Название» — на всю ширину, текст крупный и жирный */
#id_name_site { width: 100% !important; max-width: none !important; height: 48px !important; font-size: 16px !important; font-weight: 600 !important; color: #1A1A1A !important; }
/* B-PIM: простой редактор описания */
.b-trix-bar { display: flex; gap: 8px; padding: 6px 8px; border: 1px solid #E0E0E0; border-bottom: 0; border-radius: 8px 8px 0 0; background: #F5F5F5; }
.b-trix-group { display: flex; border: 1px solid #E0E0E0; border-radius: 8px; background: #fff; overflow: hidden; }
.b-trix-group button { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; color: #6B6B6B; border-right: 1px solid #E0E0E0; cursor: pointer; }
.b-trix-group button:last-child { border-right: 0; }
.b-trix-group button:hover, .b-trix-group button.trix-active { color: #1A1A1A; background: #F2F2F2; }
trix-editor { min-height: 220px; border: 1px solid #E0E0E0 !important; border-radius: 0 0 8px 8px !important; padding: 10px 12px !important; font-size: 14px; line-height: 1.5; background: #fff; }
trix-editor ul { list-style: disc; padding-left: 20px; } trix-editor ol { list-style: decimal; padding-left: 20px; }

/* B-PIM: «Название» на всю ширину (снять ограничение обёртки Unfold) */
div:has(> #id_name_site) { max-width: none !important; }
/* B-PIM: строка из нескольких полей — подпись над значением, без пустот */
.form-row:has(> .field-line + .field-line) > .field-line { flex-direction: column !important; align-items: stretch !important; gap: 4px; }
.form-row:has(> .field-line + .field-line) > .field-line > div:first-child { width: auto !important; min-width: 0 !important; height: auto !important; line-height: 20px !important; }

/* B-PIM: на странице списка прокручивается только таблица */
html.b-cl, html.b-cl body { overflow: hidden !important; height: 100%; }


/* B-PIM: карточка товара — одна колонка полей, без общих рамок, подпись внутри поля */
#product_form .form-rows { border: 0 !important; box-shadow: none !important; background: transparent !important; overflow: visible !important; }
#product_form .form-row { border: 0 !important; }
#product_form .form-rows .field-line { position: relative; flex-direction: column !important; padding: 0 0 12px 0 !important; max-width: 960px; }
#product_form .form-rows .field-line > div:first-child { position: absolute; top: 7px; left: 13px; z-index: 2; width: auto !important; min-width: 0 !important; height: auto !important; line-height: 14px !important; pointer-events: none; }
#product_form .form-rows .field-line > div:first-child label { font-size: 12px !important; font-weight: 400 !important; color: #929292 !important; margin: 0 !important; }
#product_form .form-rows .max-w-2xl, #product_form .form-rows .max-w-4xl { max-width: none !important; }
#product_form .form-rows input[type=text], #product_form .form-rows select { width: 100% !important; height: 56px !important; padding: 20px 12px 6px !important; border: 1px solid #E0E0E0 !important; border-radius: 8px !important; box-shadow: none !important; }
#product_form .form-rows .readonly { min-height: 56px; padding: 24px 12px 8px; border: 1px solid #E0E0E0; border-radius: 8px; background: #F5F5F5; max-width: none !important; }
#product_form #id_name_site { font-size: 16px !important; font-weight: 600 !important; }
/* описание: подпись над редактором, а не поверх кнопок; фото — без рамки */
#product_form .field-line:has(trix-editor) > div:first-child { position: static; margin: 0 0 4px; }
#product_form .readonly:has(.b-photos) { border: 0; padding: 0; background: none; min-height: 0; }

/* B-PIM: карточка — поля на всю ширину колонки, без пунктирных линий; подпись внутри поля */
#product_form .form-rows .field-line { align-items: stretch !important; border: 0 !important; min-height: 0 !important; padding: 0 0 12px 0 !important; }
#product_form .form-rows .field-line > .grow { width: 100%; }
#product_form .form-rows .readonly { display: flex; align-items: flex-end; font-size: 14px; color: #1A1A1A; }
#product_form .form-rows .readonly:has(.b-photos) { display: block; }
#product_form .form-rows .related-widget-wrapper, #product_form .form-rows .related-widget-wrapper > div { width: 100%; max-width: none !important; }
#product_form .form-rows .field-line:has(select) .related-widget-wrapper { flex-grow: 1; }
/* редактор описания: только жирный, курсив, списки, отменить/повторить; подпись над редактором */
#product_form [data-trix-button-group="block-headings"],
#product_form [data-trix-attribute="p"], #product_form [data-trix-attribute="underlined"], #product_form [data-trix-attribute="strike"],
#product_form [data-trix-attribute="href"], #product_form [data-trix-attribute="quote"], #product_form [data-trix-attribute="code"],
#product_form [data-trix-action="increaseNestingLevel"], #product_form [data-trix-action="decreaseNestingLevel"] { display: none !important; }
#product_form .field-line:has(trix-editor) .max-w-4xl { max-width: none !important; }
#product_form .form-rows .field-line:has(trix-editor) > div:first-child { position: static !important; margin: 0 0 6px 13px !important; }

/* B-PIM: вес и габариты — 4 коротких поля в одну строку */
#product_form .form-rows .form-row:has(> .field-line + .field-line) { display: flex !important; gap: 8px; }
#product_form .form-rows .form-row:has(> .field-line + .field-line) > .field-line { flex: 0 0 160px !important; min-width: 0 !important; }

/* B-PIM: текст в редактируемых полях — основной тёмный цвет, обычный шрифт */
#product_form input[type=text], #product_form input[type=number], #product_form select, #product_form textarea, #product_form trix-editor { color: #1A1A1A !important; font-family: 'Inter', Arial, sans-serif !important; font-size: 14px !important; font-weight: 400 !important; }
#product_form #id_name_site { font-size: 16px !important; font-weight: 600 !important; }
#product_form trix-editor * { color: #1A1A1A !important; }

/* B-PIM: общая лента медиа — метка видео, метка «низкое качество» */
.b-ph-vid { position: absolute; left: 4px; bottom: 4px; display: flex; align-items: center; gap: 2px; padding: 0 5px 0 3px; height: 20px; border-radius: 6px; background: rgba(26,26,26,.75); color: #fff; font-size: 11px; line-height: 20px; }
.b-ph-vid .material-symbols-outlined { font-size: 16px; }
.b-ph-low { position: absolute; left: 4px; top: 4px; padding: 0 5px; height: 18px; border-radius: 6px; background: #FFF4E5; color: #8A4B00; font-size: 11px; line-height: 18px; }
.b-ph[data-kind="video"]:first-child::after { content: none; }

/* B-PIM: редактор описания — набор кнопок: Ж, К, зачёркнутый, H2, H3, списки, очистить, HTML, отменить/повторить */
#product_form [data-trix-button-group="block-headings"] { display: flex !important; }
#product_form [data-trix-attribute="strike"] { display: flex !important; }
#product_form [data-trix-attribute="heading1"], #product_form [data-trix-attribute="heading4"] { display: none !important; }
#product_form .b-trix-extra { display: flex; border: 1px solid #E0E0E0; border-radius: 8px; background: #fff; overflow: hidden; }
#product_form .b-trix-extra button { height: 32px; padding: 0 10px; font-size: 13px; color: #1A1A1A; border-right: 1px solid #E0E0E0; cursor: pointer; display: flex; align-items: center; gap: 4px; }
#product_form .b-trix-extra button:last-child { border-right: 0; }
#product_form .b-trix-extra button:hover, #product_form .b-trix-extra button.b-on { background: #F2F2F2; }
#product_form .b-html { width: 100%; min-height: 220px; font: 13px/1.5 ui-monospace, Menlo, Consolas, monospace !important; color: #1A1A1A; border: 1px solid #E0E0E0; border-radius: 0 0 8px 8px; padding: 10px 12px; }
#product_form .b-count { font-size: 12px; color: #929292; margin-top: 4px; }
#product_form trix-editor h2 { font-size: 18px; font-weight: 600; margin: 8px 0 4px; }
#product_form trix-editor h3 { font-size: 16px; font-weight: 600; margin: 8px 0 4px; }
#product_form trix-editor del { text-decoration: line-through; }

/* B-PIM: отступ от меню до содержимого — 32 px (шкала макета 8-16-24-32), шапка с заголовком на той же линии */
#main > .px-4, #main > div:has(> #content) { padding-left: 32px !important; padding-right: 32px !important; }
#main div:has(> div > #header-inner) { padding-left: 32px !important; padding-right: 32px !important; }

/* B-PIM: описание растёт по тексту, без своей прокрутки */
#product_form trix-editor { height: auto !important; max-height: none !important; overflow: visible !important; }
#product_form .b-html { overflow: hidden !important; resize: none !important; }

/* B-PIM: выпадающие списки во всём PIM — один стиль: серый контур 1 px, скругление 8, без красной обводки, тёмный текст */
.select2-container { outline: none !important; box-shadow: none !important; border: 0 !important; }
.select2-container .select2-selection { border: 1px solid #E0E0E0 !important; border-radius: 8px !important; box-shadow: none !important; outline: none !important; background: #fff !important; }
.select2-container--focus .select2-selection, .select2-container--open .select2-selection { border-color: #929292 !important; }
.select2-selection__rendered, .select2-selection__placeholder { color: #1A1A1A !important; font-size: 14px !important; }
.select2-selection__placeholder { color: #929292 !important; }
.select2-selection__choice { background: #F5F5F5 !important; border: 1px solid #E0E0E0 !important; border-radius: 6px !important; color: #1A1A1A !important; }
.select2-dropdown { border: 1px solid #E0E0E0 !important; border-radius: 8px !important; box-shadow: 0 4px 16px rgba(0,0,0,.08) !important; overflow: hidden; background: #fff !important; }
.select2-search__field { outline: none !important; box-shadow: none !important; border: 0 !important; background: #F5F5F5 !important; border-radius: 8px !important; color: #1A1A1A !important; }
.select2-results__option { color: #1A1A1A !important; font-size: 14px !important; border-radius: 6px; }
.select2-results__option--highlighted, .select2-results__option[aria-selected=true], .select2-results__option--selected { background: #F5F5F5 !important; color: #1A1A1A !important; }
.select2-results__option::after, .select2-results__option .material-symbols-outlined { color: #1A1A1A !important; }
/* в карточке товара — высота 48 px и подпись внутри, как у остальных полей */
#product_form .form-rows .field-line:has(.select2-container) .select2-container { width: 100% !important; max-width: none !important; }
#product_form .form-rows .field-line:has(.select2-container) .select2-selection { display: block !important; height: 48px !important; min-height: 48px !important; padding: 0 12px !important; }
#product_form .form-rows .field-line:has(.select2-container) .select2-selection__rendered { display: block !important; padding: 21px 24px 0 0 !important; line-height: 20px !important; }
#product_form .form-rows .field-line:has(.select2-container) .select2-selection__arrow { top: 0 !important; height: 48px !important; display: flex; align-items: center; }

/* B-PIM: описание — компактный текст: абзацы 8 px, пункты списка вплотную, межстрочный 1.45 */
#product_form trix-editor { line-height: 1.45 !important; }
#product_form trix-editor p, #product_form trix-editor div { margin: 0 0 8px !important; }
#product_form trix-editor ul, #product_form trix-editor ol { margin: 0 0 8px !important; padding-left: 20px !important; }
#product_form trix-editor li { margin: 0 !important; padding: 0 !important; }
#product_form trix-editor li p, #product_form trix-editor li div { margin: 0 !important; }
#product_form trix-editor h2, #product_form trix-editor h3 { margin: 4px 0 4px !important; }
#product_form trix-editor > :last-child { margin-bottom: 0 !important; }

/* B-PIM: панель кнопок редактора не закрепляется при прокрутке — стоит над текстом */
#product_form trix-toolbar, #product_form trix-toolbar > div, #product_form .field-line:has(trix-editor) [class*="sticky"] { position: static !important; top: auto !important; }

/* B-PIM: список — артикул и код в одной ячейке, название и категория в одной ячейке (как в кабинете Маркета) */
#result_list .b-c2 { display: flex; flex-direction: column; gap: 2px; white-space: normal; line-height: 18px; }
#result_list .b-c2-main { color: #1A1A1A; font-weight: 500; display: inline-flex; align-items: center; gap: 4px; }
#result_list .b-c2-sub { color: #929292; font-size: 12px; line-height: 16px; }
#result_list td.field-ids { white-space: nowrap; }
#result_list td.field-title a { color: inherit !important; text-decoration: none !important; }
#result_list .b-copy { display: inline-flex; padding: 0; border: 0; background: none; color: #929292; cursor: pointer; }
#result_list .b-copy:hover { color: #1A1A1A; }
#result_list .b-copy .material-symbols-outlined { font-size: 16px; }

/* B-PIM: список — все строки белые, серым только строка под мышкой (отмеченные галочкой — как были) */
#result_list tbody tr:not(.selected), #result_list tbody tr:not(.selected) > td, #result_list tbody tr:not(.selected) > th { background: #fff !important; }
#result_list tbody tr:not(.selected):hover > td, #result_list tbody tr:not(.selected):hover > th { background: #F5F5F5 !important; }
