/* РНП по артикулам: Стили пастельной таблицы и агрегационных контролов */

/* 1. Шапка таблицы РНП */
.rnp-table thead tr.rnp-columns-header th {
  padding: 6px 6px;
  font-size: 12px;
  font-weight: 600;
  background-color: #f1f4f9;
  color: #334155;
  border-top: 1px solid #dce2ee;
  border-right: 1px solid #dce2ee;
  border-bottom: 2px solid #cbd5e1;
  /* разрешаем перенос отдельных слов на новую строку для компактности таблицы */
  white-space: normal;
  word-break: normal;
  overflow-wrap: normal;
  text-align: center;
  vertical-align: middle;
  line-height: 1.25;
}

/* 2. Тело таблицы и ячейки */
.rnp-table tbody td {
  padding: 5px 8px;
  font-size: 13px;
  line-height: 1.25;
  border-right: 1px solid #eef2f6;
  border-bottom: 1px solid #eef2f6;
  white-space: nowrap;
}

.rnp-table tbody td.text-left { text-align: left; }
.rnp-table tbody td.text-center { text-align: center; }
.rnp-table tbody td.text-right { text-align: right; }

/* 3.1. Компактный фон подсветки цен и долей вокруг значений ячеек */
.rnp-value-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 600;
  line-height: 1.35;
  box-sizing: border-box;
}

.rnp-value-badge.rnp-value-positive {
  background-color: #e6f4ea;
  color: #137333;
}

.rnp-value-badge.rnp-value-negative {
  background-color: #fce8e6;
  color: #c5221f;
}

/* 4. Закрепленная строка «Итого по выборке» */
.rnp-table tr.rnp-totals-row {
  background-color: #f8fafc;
  font-weight: 700;
  border-bottom: 2px solid #cbd5e1;
}

.rnp-table tr.rnp-totals-row td {
  padding: 8px 8px;
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  border-bottom: 2px solid #cbd5e1;
}

/* 4.1. Размеры колонок для выравнивания шапки, строки итогов и строк данных */
.rnp-col-product {
  width: 250px;
  min-width: 220px;
  max-width: 280px;
}

.rnp-col-title {
  width: 220px;
  min-width: 180px;
  max-width: 260px;
}

.rnp-col-metric {
  min-width: 75px;
}

/* 5. Товарная ячейка (фото + название + ссылка) */
.rnp-product-cell {
  vertical-align: middle;
}

.rnp-product-content {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}

.rnp-product-cell img {
  width: 32px;
  height: 42px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  background-color: #f1f5f9;
}

.rnp-product-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}

.rnp-product-title {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: none;
}

.rnp-product-title:hover {
  color: #4f46e5;
  text-decoration: underline;
}

.rnp-product-vendor {
  font-size: 11px;
  color: #64748b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 6. Категорийная ячейка для группировок */
/* Было:
.rnp-category-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: #1e293b;
  max-width: 300px;
}
Причина: свойство display: flex на td заменено внутренним блоком .rnp-category-content */
.rnp-category-cell {
  vertical-align: middle;
  font-weight: 600;
  color: #1e293b;
}

.rnp-category-content {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}

.rnp-category-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background-color: #f1f5f9;
  color: #64748b;
  flex-shrink: 0;
}

/* 7. Статус товара (пастельный бейдж) */
.rnp-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  background-color: #f1f5f9;
  color: #475569;
}

.rnp-status-badge.status-pause {
  background-color: #fef3c7;
  color: #92400e;
}

.rnp-status-badge.status-illiquid {
  background-color: #fee2e2;
  color: #991b1b;
}

.rnp-status-badge.status-active {
  background-color: #dcfce7;
  color: #166534;
}

/* 8. Подвал таблицы */
.rnp-footer-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 4px 4px;
  font-size: 12px;
  color: #64748b;
}

.rnp-footer-counts {
  font-weight: 500;
}

.rnp-footer-note {
  font-style: normal;
  color: #94a3b8;
}

/* 9. Сортировка заголовков */
.rnp-sort-link {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  /* разрешаем адаптивный перенос слов названия метрики */
  white-space: normal;
  text-align: center;
  line-height: 1.2;
}

.rnp-sort-link:hover {
  color: #1e293b;
}

.rnp-sort-arrow {
  font-size: 10px;
  opacity: 0.6;
  /* Причина: стрелка сортировки не должна переноситься отдельно на новую строку */
  white-space: nowrap;
  flex-shrink: 0;
}

.rnp-sort-arrow.active {
  opacity: 1;
  font-weight: 700;
}

/* 10. Шапка и строка контролов РНП */
.rnp-header-title {
  flex-shrink: 0;
}

.rnp-header-title .rnp-title {
  white-space: nowrap;
}

.rnp-header-title .rnp-subtitle {
  font-size: 13px;
  color: #64748b;
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 2px 8px;
}

.rnp-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  flex-shrink: 0;
  justify-content: flex-end;
}

.rnp-search-form {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  margin: 0 !important;
}

.rnp-search-form .label-search {
  width: auto !important;
  margin: 0 !important;
}

.rnp-search-form input[type="search"] {
  width: 220px !important;
  padding: 0 12px !important;
  background-color: #ffffff !important;
  border: 1px solid #d8dce9 !important;
  border-radius: 8px !important;
  color: #333333 !important;
  outline: none !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

.rnp-search-form input[type="search"]:focus {
  border-color: #5068a5 !important;
  box-shadow: 0 0 0 2px rgba(80, 104, 165, 0.15) !important;
}

.rnp-search-form .button-primary {
  padding: 0 16px !important;
  min-width: 0 !important;
  max-width: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.main-container[data-controller*="rnp-table"] .table-filters,
.table-filters:has(.rnp-control-bar) {
  display: flex !important;
  justify-content: flex-start !important;
  align-items: center !important;
  gap: 8px !important;
  flex-wrap: wrap !important;
  width: 100% !important;
}

.table-filters .rnp-control-bar {
  display: contents;
}

/* выравнивание высоты перенесенного селектора товаров до 52px в одну линию со всеми смежными фильтрами */
.table-filters .rnp-product-selector {
  min-width: 220px;
}

/* выравнивание выпадающего окна селектора товаров по правому краю, чтобы оно открывалось внутрь экрана и не вылезало за правый край */
.table-filters .product-dropdown-menu,
.table-filters .rnp-product-dropdown-menu {
  right: 0 !important;
  left: auto !important;
  max-width: min(400px, calc(100vw - 24px)) !important;
}

.table-filters .rnp-product-input-wrapper,
.table-filters .product-input-wrapper {
  height: 52px !important;
  min-height: 52px !important;
  max-height: 52px !important;
  border-radius: 8px !important;
  border: 1px solid #e0e3ee !important;
  box-sizing: border-box !important;
}

/* 11. Мультиселект с чекбоксами (Multiselect Dropdown) */
.rnp-multiselect-dropdown {
  position: relative;
  display: inline-block;
  width: 100%;
}

.rnp-multiselect-button {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  height: 52px !important;
  min-height: 52px !important;
  max-height: 52px !important;
  padding: 0 14px !important;
  background-color: #ffffff !important;
  border: 1px solid #e0e3ee !important;
  border-radius: 8px !important;
  font-size: 14px !important;
  color: #333333 !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  width: 100% !important;
  box-shadow: none !important;
  box-sizing: border-box !important;
}

.rnp-multiselect-button:hover {
  border-color: #b0b7cb !important;
}

.rnp-multiselect-button:focus-visible {
  outline: none !important;
  border-color: #5068A5 !important;
}

.rnp-multiselect-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  color: #333333;
  line-height: 1.2;
}

.rnp-multiselect-dropdown .arrow-icon {
  width: 14px;
  height: 14px;
  fill: #64748b;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.rnp-multiselect-dropdown.is-open .arrow-icon {
  transform: rotate(180deg);
}

.rnp-multiselect-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 260px;
  max-width: 340px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  padding: 12px;
  z-index: 1050;
}

.rnp-multiselect-menu.active {
  display: block !important;
}

.rnp-multiselect-search-box {
  margin-bottom: 8px;
}

.rnp-multiselect-search {
  width: 100% !important;
  height: 34px !important;
  padding: 0 10px !important;
  border: 1px solid #dcdfe6 !important;
  border-radius: 6px !important;
  font-size: 13px !important;
  outline: none !important;
  background-color: #ffffff !important;
  margin: 0 !important;
}

.rnp-multiselect-search:focus {
  border-color: #3b82f6 !important;
}

.rnp-multiselect-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding: 0 2px;
}

.rnp-multiselect-action-btn {
  background: none !important;
  border: none !important;
  padding: 0 !important;
  color: #3b82f6 !important;
  font-size: 12px !important;
  cursor: pointer !important;
  text-decoration: none !important;
  height: auto !important;
  width: auto !important;
}

.rnp-multiselect-action-btn:hover {
  text-decoration: underline !important;
}

.rnp-multiselect-options {
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rnp-multiselect-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #334155;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  margin: 0;
  user-select: none;
}

.rnp-multiselect-option:hover {
  background-color: #f1f5f9;
}

.rnp-multiselect-checkbox {
  width: 16px !important;
  height: 16px !important;
  margin: 0 !important;
  cursor: pointer !important;
  border-radius: 4px !important;
  flex-shrink: 0;
}

.rnp-multiselect-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rnp-multiselect-footer {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #f1f5f9;
}

.rnp-multiselect-footer .button {
  height: 32px !important;
  font-size: 13px !important;
}

/* 8. Боковая панель-шторка «Настроить KPI» */
.rnp-kpi-drawer-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.45);
  z-index: 1100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.rnp-kpi-drawer-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.rnp-kpi-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 480px;
  max-width: 90vw;
  background-color: #ffffff;
  z-index: 1150;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.rnp-kpi-drawer.is-open {
  transform: translateX(0);
}

.rnp-kpi-drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 24px 16px 24px;
  border-bottom: 1px solid #f1f5f9;
}

.rnp-kpi-drawer-title {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  line-height: 1.3;
}

.rnp-kpi-drawer-subtitle {
  font-size: 13px;
  color: #64748b;
  margin: 4px 0 0 0;
  line-height: 1.4;
}

.rnp-kpi-drawer-close {
  border: none;
  background: transparent;
  font-size: 18px;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  line-height: 1;
  transition: all 0.15s ease;
}

.rnp-kpi-drawer-close:hover {
  color: #0f172a;
  background-color: #f1f5f9;
}

.rnp-kpi-drawer-search {
  padding: 16px 24px 12px 24px;
}

.rnp-kpi-search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.rnp-kpi-search-icon {
  position: absolute;
  left: 12px;
  color: #94a3b8;
  pointer-events: none;
  display: flex;
  align-items: center;
}

.rnp-kpi-search-input {
  width: 100% !important;
  height: 38px !important;
  padding-left: 36px !important;
  padding-right: 12px !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
  font-size: 14px !important;
  color: #0f172a !important;
  outline: none !important;
  background-color: #f8fafc !important;
  transition: all 0.2s ease !important;
  margin: 0 !important;
}

.rnp-kpi-search-input:focus {
  background-color: #ffffff !important;
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
}

.rnp-kpi-drawer-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 8px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rnp-kpi-metric-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: 8px;
  background-color: #ffffff;
  transition: background-color 0.15s ease, opacity 0.15s ease;
  user-select: none;
  cursor: default;
}

.rnp-kpi-metric-item:hover {
  background-color: #f8fafc;
}

.rnp-kpi-metric-item.dragging {
  opacity: 0.35;
  background-color: #eff6ff;
}

.rnp-kpi-metric-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
}

.rnp-kpi-drag-handle {
  color: #94a3b8;
  font-size: 15px;
  line-height: 1;
  cursor: grab;
  padding: 2px 4px;
  border-radius: 4px;
}

.rnp-kpi-drag-handle:active {
  cursor: grabbing;
}

.rnp-kpi-checkbox {
  width: 18px !important;
  height: 18px !important;
  margin: 0 !important;
  border-radius: 4px !important;
  border: 1px solid #cbd5e1 !important;
  cursor: pointer !important;
  flex-shrink: 0;
  accent-color: #9333ea;
}

.rnp-kpi-checkbox:disabled {
  cursor: not-allowed !important;
  opacity: 0.35;
}

.rnp-kpi-metric-title {
  font-size: 14px;
  color: #1e293b;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rnp-kpi-metric-right {
  flex-shrink: 0;
  margin-left: 12px;
}

.rnp-kpi-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.3;
}

.rnp-kpi-badge.badge-sales {
  background-color: #e0f2fe;
  color: #0284c7;
}

.rnp-kpi-badge.badge-main {
  background-color: #f1f5f9;
  color: #475569;
}

.rnp-kpi-badge.badge-cost {
  background-color: #fef3c7;
  color: #d97706;
}

.rnp-kpi-badge.badge-adv {
  background-color: #f3e8ff;
  color: #9333ea;
}

.rnp-kpi-badge.badge-stock {
  background-color: #e0f7fa;
  color: #00838f;
}

.rnp-kpi-badge.badge-share-cp {
  background-color: #e0e7ff;
  color: #4338ca;
}

.rnp-kpi-badge.badge-share-cvb {
  background-color: #d1fae5;
  color: #059669;
}

.rnp-kpi-drawer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-top: 1px solid #f1f5f9;
  background-color: #ffffff;
}

.rnp-kpi-drawer-reset {
  background: none !important;
  border: none !important;
  font-size: 14px !important;
  color: #64748b !important;
  cursor: pointer !important;
  padding: 6px 0 !important;
  text-decoration: none !important;
  height: auto !important;
  width: auto !important;
}

.rnp-kpi-drawer-reset:hover {
  color: #0f172a !important;
  text-decoration: underline !important;
}

.rnp-kpi-drawer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rnp-kpi-drawer-cancel {
  height: 38px !important;
  padding: 0 16px !important;
  font-size: 14px !important;
}

.rnp-kpi-drawer-apply {
  height: 38px !important;
  padding: 0 18px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
}

/* 15. Компактные отступы между карточками и группами показателей (табами) в РНП */
.main-container[data-controller*="rnp-table"] .db-fix-top {
  margin-bottom: 0px !important;
  padding-bottom: 0px !important;
}

.main-container[data-controller*="rnp-table"] .product-stock-wrapper {
  padding-bottom: 4px;
  margin-bottom: 8px;
}

.main-container[data-controller*="rnp-table"] .tabs-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 6px;
  background: #f1f4f9;
  border-radius: 10px;
  margin-top: 0 !important;
  margin-bottom: 8px !important;
}

/* 15.1. Табы групп показателей: отсутствие подчеркиваний и адаптивность */
.main-container[data-controller*="rnp-table"] .tab-btn,
.tabs-header .tab-btn {
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none !important;
}

.main-container[data-controller*="rnp-table"] .tab-btn:hover,
.main-container[data-controller*="rnp-table"] .tab-btn.active,
.tabs-header .tab-btn:hover,
.tabs-header .tab-btn.active {
  text-decoration: none !important;
}

/* 15.2. Карточки KPI в стиле ДБ Артикула с плавным ховер-эффектом */
.product-stock-wrapper .db-kpi-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.product-stock-wrapper .db-kpi-card:hover {
  box-shadow: 0 4px 12px rgba(34, 32, 70, 0.08);
  transform: translateY(-1px);
}

/* 16. Стики-шапка: группы показателей (табы), двухуровневая шапка и строка «Итого по выборке» */
.rnp-sticky-head-wrapper {
  position: sticky;
  top: var(--rnp-table-sticky-top, 0px);
  z-index: 30;
  background: #ffffff;
  padding-top: 6px;
  box-shadow: 0 3px 6px -2px rgba(0, 0, 0, 0.08);
}

.rnp-sticky-head-scroll {
  width: 100%;
  overflow-x: hidden;
}

.rnp-sticky-head-table {
  width: 100%;
  margin-bottom: 0 !important;
  border-collapse: collapse;
  /* Причина: фиксированная табличная модель по colgroup */
  table-layout: fixed;
}

.rnp-table-scroll {
  width: 100%;
  height: auto !important;
  max-height: none !important;
  overflow-x: auto !important;
  overflow-y: visible;
  scrollbar-width: thin;
}

/* 17. Кнопка «Группы показателей» в шапке табов (сохранено для обратной совместимости) */
.rnp-groups-label-btn {
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  background: transparent;
  border: 1px dashed transparent;
  cursor: pointer;
  padding: 6px 12px;
  margin-right: 4px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  line-height: 1.4;
  flex-shrink: 0;
}

.rnp-groups-label-btn:hover {
  color: #4f46e5;
  background-color: #f5f3ff;
  border-color: #c7d2fe;
}

.rnp-groups-btn-icon {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  flex-shrink: 0;
}

/* 17.1. Кнопка-дропдаун «Настройки таблицы» в шапке табов */
.rnp-table-settings-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-right: 4px;
  flex-shrink: 0;
  z-index: 105;
}

.rnp-table-settings-btn {
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  color: #ffffff;
  background-color: #5068A5;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  padding: 8px 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  min-width: unset;
  box-sizing: border-box;
}

.rnp-table-settings-btn:hover {
  background-color: #465687;
  color: #ffffff;
}

.rnp-table-settings-btn:active {
  box-shadow: 0 0 8px 0 rgba(51, 51, 51, 0.4);
}

.rnp-settings-btn-icon {
  width: 16px;
  height: 16px;
  color: #ffffff;
  stroke: currentColor;
  flex-shrink: 0;
}

.rnp-settings-arrow-icon {
  width: 12px;
  height: 12px;
  color: #ffffff;
  stroke: currentColor;
  flex-shrink: 0;
  margin-left: 2px;
  transition: transform 0.2s ease;
}

.rnp-table-settings-dropdown:has(.dropdown-menu.active) .rnp-settings-arrow-icon {
  transform: rotate(180deg);
}

.rnp-table-settings-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 250px;
  width: max-content;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  border: 1px solid #e2e8f0;
  padding: 6px;
  z-index: 110;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rnp-table-settings-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  color: #334155;
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.rnp-table-settings-item:hover {
  background-color: #f1f5f9;
  color: #0f172a;
}

.rnp-settings-item-icon {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  color: #64748b;
  flex-shrink: 0;
}

/* 17.1. Плавающий горизонтальный скроллбар внизу экрана (Sticky Bottom Horizontal Scrollbar) */
.rnp-floating-scrollbar {
  position: fixed;
  bottom: 0;
  z-index: 25;
  height: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  background: rgba(241, 244, 249, 0.95);
  backdrop-filter: blur(4px);
  border-top: 1px solid #dce2ee;
  scrollbar-width: thin;
}

.rnp-floating-scrollbar::-webkit-scrollbar {
  height: 10px;
}

.rnp-floating-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}

.rnp-floating-scrollbar::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 5px;
}

.rnp-floating-scrollbar::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

.rnp-floating-scrollbar-content {
  height: 1px;
}

/* 18. Шторка «Настроить таблицу» (Column Customizer) */
.rnp-table-drawer-backdrop,
.rnp-groups-drawer-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  z-index: 1040;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.rnp-table-drawer-backdrop.is-open,
.rnp-groups-drawer-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.rnp-table-drawer,
.rnp-groups-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 490px;
  max-width: 92vw;
  background-color: #ffffff;
  z-index: 1050;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.rnp-table-drawer.is-open,
.rnp-groups-drawer.is-open {
  transform: translateX(0);
}

.rnp-table-drawer-header,
.rnp-groups-drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 24px 16px 24px;
  border-bottom: 1px solid #f1f5f9;
}

.rnp-table-drawer-title,
.rnp-groups-drawer-title {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  line-height: 1.3;
}

.rnp-table-drawer-subtitle,
.rnp-groups-drawer-subtitle {
  font-size: 13px;
  color: #64748b;
  margin: 4px 0 0 0;
  line-height: 1.4;
}

.rnp-table-drawer-close,
.rnp-groups-drawer-close {
  border: none;
  background: transparent;
  font-size: 18px;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  line-height: 1;
  transition: all 0.15s ease;
}

.rnp-table-drawer-close:hover,
.rnp-groups-drawer-close:hover {
  color: #0f172a;
  background-color: #f1f5f9;
}

.rnp-table-drawer-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  border-bottom: 1px solid #f1f5f9;
}

.rnp-link-btn {
  background: transparent;
  border: none;
  padding: 0;
  font-size: 13px;
  font-weight: 600;
  color: #4f46e5;
  cursor: pointer;
  transition: color 0.15s ease;
}

.rnp-link-btn:hover {
  color: #4338ca;
  text-decoration: underline;
}

.rnp-table-drawer-list {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 12px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rnp-drawer-col-item {
  display: flex;
  flex-direction: column;
  padding: 10px 14px;
  border: 1px solid #f1f5f9;
  border-radius: 8px;
  background-color: #ffffff;
  transition: all 0.15s ease;
}

.rnp-drawer-col-item:hover {
  border-color: #e2e8f0;
  background-color: #f8fafc;
}

.rnp-drawer-col-item.dragging {
  opacity: 0.4;
  border-color: #4f46e5;
  background-color: #f5f3ff;
}

.rnp-drawer-col-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.rnp-drawer-col-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rnp-col-checkbox,
.rnp-checkbox {
  width: 18px !important;
  height: 18px !important;
  accent-color: #4f46e5 !important;
  cursor: pointer;
  margin: 0 !important;
}

.rnp-drawer-col-title {
  font-size: 14px;
  font-weight: 500;
  color: #1e293b;
}

.rnp-col-category-badge {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 400;
}

.rnp-drawer-col-color-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed #e2e8f0;
}

.rnp-color-swatch-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rnp-color-swatch-preview {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background-color: #f8fafc;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.rnp-hidden-color-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
}

.rnp-color-hex-text {
  font-size: 12px;
  font-family: monospace;
  font-weight: 600;
  color: #475569;
}

.rnp-color-presets {
  display: flex;
  align-items: center;
  gap: 5px;
}

.rnp-preset-color-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.15);
  cursor: pointer;
  padding: 0;
  transition: transform 0.1s ease;
}

.rnp-preset-color-dot:hover {
  transform: scale(1.25);
}

.rnp-color-scope-box {
  margin-left: auto;
}

.rnp-scope-select {
  height: 30px;
  padding: 0 8px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 12px;
  color: #334155;
  background-color: #ffffff;
  cursor: pointer;
}

.rnp-color-reset-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  background-color: #f8fafc;
  color: #64748b;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.rnp-color-reset-btn:hover {
  background-color: #fee2e2;
  color: #ef4444;
  border-color: #fca5a5;
}

/* 23.1. Чекбокс включения подсветки цен и долей под строкой цвета в шторке колонок */
.rnp-drawer-col-highlight-row {
  display: flex;
  align-items: center;
  padding: 6px 0 2px 34px;
}

.rnp-highlight-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.rnp-highlight-checkbox {
  width: 15px;
  height: 15px;
  cursor: pointer;
  accent-color: #5068a5;
  margin: 0;
}

.rnp-highlight-checkbox-text {
  font-size: 12px;
  color: #475569;
  font-weight: 500;
}

.rnp-highlight-checkbox-label:hover .rnp-highlight-checkbox-text {
  color: #1e293b;
}

.rnp-table-drawer-footer,
.rnp-groups-drawer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-top: 1px solid #f1f5f9;
  background-color: #ffffff;
}

.rnp-table-drawer-footer-actions,
.rnp-groups-drawer-footer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rnp-table-drawer-apply,
.rnp-groups-drawer-apply {
  background-color: #4f46e5 !important;
  color: #ffffff !important;
  border: none !important;
  padding: 9px 18px !important;
  border-radius: 8px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
}

.rnp-table-drawer-apply:hover,
.rnp-groups-drawer-apply:hover {
  background-color: #4338ca !important;
}

/* 19. Шторка «Группы показателей» (Column Groups Manager) */
.rnp-groups-drawer-scrollable {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.rnp-groups-section {
  display: flex;
  flex-direction: column;
}

.rnp-groups-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rnp-group-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  border: 1px solid #f1f5f9;
  border-radius: 8px;
  background-color: #ffffff;
  transition: all 0.15s ease;
}

.rnp-group-item:hover {
  border-color: #e2e8f0;
  background-color: #f8fafc;
}

.rnp-group-item.dragging {
  opacity: 0.4;
  border-color: #4f46e5;
}

.rnp-group-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rnp-group-title-text {
  font-size: 14px;
  font-weight: 500;
  color: #1e293b;
}

.rnp-group-item-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rnp-group-count-pill {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  border: none;
  background-color: #f1f5f9;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
}

.rnp-group-count-pill.active {
  background-color: #ede9fe;
  color: #6d28d9;
  font-weight: 600;
}

.rnp-group-delete-btn {
  background: transparent;
  border: none;
  font-size: 14px;
  cursor: pointer;
  color: #94a3b8;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.15s ease;
}

.rnp-group-delete-btn:hover {
  color: #ef4444;
  background-color: #fee2e2;
}

.rnp-groups-columns-section {
  border-top: 1px solid #f1f5f9;
  padding-top: 16px;
}

.rnp-groups-columns-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rnp-groups-columns-title {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.rnp-groups-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.rnp-groups-search-input {
  width: 100% !important;
  height: 36px !important;
  padding-left: 36px !important;
  padding-right: 12px !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
  font-size: 13px !important;
  color: #0f172a !important;
  background-color: #f8fafc !important;
  outline: none !important;
  margin: 0 !important;
}

.rnp-groups-search-input:focus {
  background-color: #ffffff !important;
  border-color: #4f46e5 !important;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1) !important;
}

.rnp-groups-columns-hint {
  font-size: 12px;
  color: #64748b;
  margin: 8px 0 10px 0;
}

.rnp-groups-columns-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 4px;
}

.rnp-group-col-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 6px;
  background-color: #ffffff;
  border: 1px solid #f1f5f9;
  transition: background-color 0.15s ease;
}

.rnp-group-col-row:hover {
  background-color: #f8fafc;
}

.rnp-group-col-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rnp-group-col-name {
  font-size: 13px;
  color: #1e293b;
}

.rnp-col-order-arrows {
  display: flex;
  align-items: center;
  gap: 4px;
}

.rnp-arrow-btn {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
  background-color: #ffffff;
  font-size: 12px;
  color: #64748b;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all 0.15s ease;
}

.rnp-arrow-btn:hover {
  background-color: #eff6ff;
  color: #2563eb;
  border-color: #bfdbfe;
}

.rnp-groups-create-section {
  border-top: 1px solid #f1f5f9;
  padding-top: 16px;
}

.rnp-groups-create-title {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 10px 0;
}

.rnp-groups-create-form {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rnp-group-name-input {
  flex: 1 1 auto;
  height: 38px !important;
  padding: 0 12px !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
  font-size: 13px !important;
  outline: none !important;
  margin: 0 !important;
}

.rnp-group-name-input:focus {
  border-color: #4f46e5 !important;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1) !important;
}

.rnp-group-create-btn {
  white-space: nowrap !important;
  height: 38px !important;
  padding: 0 14px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
}

