/* ============================================================
   BKS — редизайн левого accordion-меню (модуль sb-am)
   Чистый CSS поверх существующей разметки. Скоуп: #column-left
   ============================================================ */

:root {
  --bksmenu-accent: #1F857F;
  --bksmenu-accent-dark: #156b66;
  --bksmenu-accent-soft: #e7f4f3;
  --bksmenu-ink: #1d2b2e;
  --bksmenu-muted: #6a7b7e;
  --bksmenu-line: #e1eae9;
  --bksmenu-radius: 14px;
}

#column-left [id^="sb-"] {
  background: #fff;
  border: 1px solid var(--bksmenu-line);
  border-radius: var(--bksmenu-radius);
  box-shadow: 0 4px 18px rgba(20, 70, 66, 0.07);
  overflow: hidden;
  margin-bottom: 24px;
}

/* Заголовок «Меню» */
#column-left [id^="sb-"] .toggle-title {
  display: flex; align-items: center; gap: 10px;
  background: var(--bksmenu-accent);
  color: #fff;
  font-size: 15px; font-weight: 700;
  padding: 14px 18px;
  margin: 0;
  cursor: pointer;
  position: relative;
}
#column-left [id^="sb-"] .toggle-title::before {
  content: ""; width: 20px; height: 14px; flex: 0 0 auto;
  background:
    linear-gradient(#fff,#fff) top/100% 2px no-repeat,
    linear-gradient(#fff,#fff) center/100% 2px no-repeat,
    linear-gradient(#fff,#fff) bottom/100% 2px no-repeat;
}
#column-left [id^="sb-"] .toggle-title::after {
  content: ""; width: 9px; height: 9px; margin-left: auto; flex: 0 0 auto;
  border-right: 2px solid #fff; border-bottom: 2px solid #fff;
  transform: rotate(45deg); transition: transform .2s;
}
#column-left [id^="sb-"] .toggle-title.menu-collapsed::after { transform: rotate(-45deg); }

/* Список */
#column-left [id^="sb-"] ul.sb-am,
#column-left [id^="sb-"] ul { list-style: none; margin: 0; padding: 0; }
#column-left [id^="sb-"] > div > ul.sb-am { padding: 8px; }

#column-left [id^="sb-"] li { position: relative; }

/* Вертикальные зазоры между пунктами, чтобы не слипались */
#column-left [id^="sb-"] .sb-am > li + li { margin-top: 5px; }
#column-left [id^="sb-"] li ul > li { margin-top: 3px; }
#column-left [id^="sb-"] li ul { padding-top: 3px; }

/* Пункты */
#column-left [id^="sb-"] .item-wrapper {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 12px; border-radius: 10px;
  color: var(--bksmenu-ink); text-decoration: none;
  font-size: 14px; line-height: 1.3;
  transition: background .15s, color .15s;
  position: relative;
}
#column-left [id^="sb-"] .item-wrapper:hover {
  background: var(--bksmenu-accent-soft);
  color: var(--bksmenu-accent-dark);
}
#column-left [id^="sb-"] li.active > .item-wrapper,
#column-left [id^="sb-"] .item-wrapper.item-current {
  background: var(--bksmenu-accent-soft);
  color: var(--bksmenu-accent-dark);
  font-weight: 600;
}
/* левая акцентная полоса у активного */
#column-left [id^="sb-"] li.active > .item-wrapper::before,
#column-left [id^="sb-"] .item-wrapper.item-current::before {
  content: ""; position: absolute; left: 0; top: 8px; bottom: 8px;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--bksmenu-accent);
}

#column-left [id^="sb-"] .item-title { flex: 1 1 auto; min-width: 0; }
#column-left [id^="sb-"] .item-icon img { max-width: 22px; height: auto; }

/* Счётчики-пилюли */
#column-left [id^="sb-"] [class*="item-count"] {
  flex: 0 0 auto;
}
#column-left [id^="sb-"] [class*="item-count"] span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 20px; padding: 0 7px;
  border-radius: 999px;
  background: var(--bksmenu-accent-soft); color: var(--bksmenu-accent-dark);
  font-size: 12px; font-weight: 600;
}
#column-left [id^="sb-"] li.active > .item-wrapper [class*="item-count"] span,
#column-left [id^="sb-"] .item-wrapper.item-current [class*="item-count"] span {
  background: var(--bksmenu-accent); color: #fff;
}

/* Кнопка-раскрытие подменю */
#column-left [id^="sb-"] .btn-toggle {
  flex: 0 0 auto; width: 22px; height: 22px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
#column-left [id^="sb-"] .btn-toggle span {
  width: 8px; height: 8px; border-right: 2px solid var(--bksmenu-muted); border-bottom: 2px solid var(--bksmenu-muted);
  transform: rotate(45deg); transition: transform .2s; display: block;
}
#column-left [id^="sb-"] li.active > .item-wrapper .btn-toggle span { transform: rotate(-135deg); border-color: var(--bksmenu-accent-dark); }

/* Дочерние уровни — отступ + буллеты */
#column-left [id^="sb-"] li ul { padding-left: 10px; overflow: hidden; }
#column-left [id^="sb-"] li ul .item-wrapper { font-size: 13.5px; padding-left: 22px; }
#column-left [id^="sb-"] li ul .item-wrapper .item-arrow::before,
#column-left [id^="sb-"] li ul .item-title.item-arrow::before { content: none; display: none; }

/* Картинка раздела внутри подменю */
#column-left [id^="sb-"] li.item-image img { border-radius: 8px; max-width: 100%; height: auto; margin: 4px 0 8px; }

/* Мобильная адаптация */
@media (max-width: 991px) {
  #column-left [id^="sb-"] { margin-bottom: 16px; }
  #column-left [id^="sb-"] .item-wrapper { padding: 11px 12px; }
}

/* ============================================================
   Нейтрализация базовых правил sb-am.css (table-layout, линии,
   старые svg-стрелки, фиксированные em-ширины), которые ломают
   модерн-вёрстку при совместной загрузке стилей.
   ============================================================ */
/* Убираем разделительные полосы между пунктами — у нас пилюли */
#column-left [id^="sb-"] .sb-am li + li,
#column-left [id^="sb-"] .sb-am li li { border-top: none; }

/* Сбрасываем table-cell вёрстку ячеек пункта */
#column-left [id^="sb-"] .item-wrapper {
  display: flex; table-layout: auto; overflow: visible;
}
#column-left [id^="sb-"] .item-wrapper > div {
  display: block; padding: 0; width: auto; vertical-align: middle;
}
#column-left [id^="sb-"] .item-wrapper .item-icon { width: auto; text-align: left; }
#column-left [id^="sb-"] .item-wrapper .item-title { width: auto; }
#column-left [id^="sb-"] .item-wrapper [class*="item-count"] {
  width: auto; padding: 0; text-align: left;
}

/* Прячем старую svg-стрелку, оставляем свой chevron */
#column-left [id^="sb-"] .btn-toggle {
  width: 22px; padding: 0; border-left: none !important;
}
#column-left [id^="sb-"] .btn-toggle span { width: 8px; height: 8px; line-height: 0; }
#column-left [id^="sb-"] .btn-toggle span:before { content: none; display: none; background: none; }

/* Старый буллет '•' у дочерних — заменён нашей точкой */
#column-left [id^="sb-"] li li .item-wrapper .item-arrow:before { content: ""; }
