.db-page-title {
  margin: 0;
  color: #413c94;
  font-size: 34px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.db-table {
  --db-table-sticky-top: 0px;
  display: flex;
  width: calc(100vw - 130px);
  gap: 12px;
}

.db-table .white-box {
  margin-top: 0;
  min-width: 0;
  height: auto;
  overflow: visible;
}

.db-table .data-picker button {
  justify-content: space-evenly;
}

.db-table thead th {
  padding: 4px 6px;
}

.db-table tbody td:not(:first-child) {
  text-align: center;
}

.db-table .datatable table {
  border-collapse: separate;
  border-spacing: 0;
}

.db-table .datatable thead th {
  padding: 4px 6px;
  border-right: 1px solid #d0d8e6;
}

.db-table .datatable tbody td {
  padding-top: 4px;
  padding-bottom: 4px;
  padding-right: 6px;
  border-right: 1px solid #dce2ee;
  border-bottom: 1px solid #eef0f6;
  line-height: 1.25;
}

.db-table .datatable tbody td:not(:first-child) {
  padding-left: 6px;
}

.db-table .datatable tbody tr.table-custom-subtitle td, 
.db-table .datatable tbody tr.table-custom-title-small td {
  border-bottom: none;
}

.db-table .datatable tbody tr:last-child td {
  border-bottom: 1px solid #dce2ee;
}

.db-table .datatable thead th:first-child,
.db-table .datatable tbody td:first-child {
  border-left: 1px solid #dce2ee;
}

.db-table .datatable thead th.column-sticky,
.db-table .datatable tbody td.column-sticky {
  background-clip: padding-box;
}

.db-table .datatable thead th.column-sticky {
  position: sticky;
  z-index: 4;
  background-color: #e5ebf4;
  box-shadow:
    inset 0 1px 0 #eff1f6,
    inset 0 -1px 0 #eff1f6;
}

.db-table .datatable tbody td.column-sticky {
  z-index: 2;
  background-color: #fff;
}

.db-table .datatable tbody tr:nth-child(even) td.column-sticky {
  background-color: #f9fafb;
}

.db-table .datatable thead th:has(.db-table-groups-toggle) {
  overflow: visible;
}

.db-table .white-box,
.db-table .tabs,
.db-table .tabs-content,
.db-table .tab-pane.active {
  height: auto;
  max-height: none;
  overflow: visible;
}

.db-table .datatable,
.db-table .datatable-scroll {
  height: auto;
  max-height: none;
}

.db-table .datatable-scroll {
  overflow-x: auto;
  overflow-y: clip;
  scrollbar-width: thin;
}

.db-table .datatable-scroll::-webkit-scrollbar {
  height: 4px;
  width: 4px;
}

.db-table .db-sticky-scroll-cover {
  position: sticky;
  left: 0;
  z-index: 6;
  height: 4px;
  margin-top: -4px;
  background: #fff;
  pointer-events: none;
}

.db-table .datatable table {
  width: 100%;
  min-width: 100%;
}

.db-table .db-table-head-sticky {
  position: sticky;
  top: var(--db-table-sticky-top, 12px);
  z-index: 40;
  margin: 0;
  padding: 0;
  background: #fff;
}

.db-table .db-table-head-sticky::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: 12px;
  background: #fff;
  pointer-events: none;
}

.db-table .db-table-head-scroll {
  overflow: hidden;
  margin: 0;
  padding: 0;
  scrollbar-width: none;
}

.db-table .db-table-head-sticky table {
  margin: 0;
}

.db-table .db-table-head-sticky + .datatable-scroll {
  margin-top: 0;
}

.db-table .datatable thead th:first-child {
  border-bottom-left-radius: 0;
}

.db-table .datatable thead th:last-child {
  border-bottom-right-radius: 0;
}

.db-table .db-table-head-scroll::-webkit-scrollbar {
  display: none;
  height: 0;
}

.db-table .db-table-head-sticky thead {
  position: static;
  top: auto;
  left: auto;
  z-index: auto;
}

.db-table .db-table-head-sticky thead th {
  line-height: 1.25;
  font-size: 14px;
}

.db-table .db-table-head-sticky table,
.db-table table.table-columns-locked {
  table-layout: fixed;
}

.db-table table.table-columns-locked th:not(:first-child),
.db-table table.table-columns-locked td:not(:first-child) {
  padding-left: 4px;
  padding-right: 4px;
}

.db-table .datatable thead th {
  max-width: none;
  background-color: #e5ebf4;
}

.db-table .tab-pane {
  animation-name: db-tab-fade;
}

@keyframes db-tab-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

#article-statistics-table table,
.article-statistics-table table {
  width: 100%;
  min-width: 100%;
}

#article-statistics-table thead th:not(:first-child),
#article-statistics-table tbody td:not(:first-child),
.article-statistics-table thead th:not(:first-child),
.article-statistics-table tbody td:not(:first-child) {
  padding-left: 3px;
  padding-right: 3px;
  width: 1%;
  white-space: nowrap;
}

#article-statistics-table .db-cell-text,
.article-statistics-table .db-cell-text {
  min-width: 0;
  padding: 2px 4px;
}

.db-fix {
  position: sticky;
  top: 6px;
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-shrink: 0;
  max-width: 350px;
  width: 100%;
}

.db-fix .w-full {
  margin-bottom: 0;
}

.db-fix .white-box {
  min-height: unset;
  padding: 12px;
}

.db-fix-product {
  display: flex;
  gap: 12px;
}

.db-product-head {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.db-product-head img {
  border-radius: 16px;
  width: 70px;
  height: auto;
}

.db-product-head .button {
  max-width: 150px;
  padding: 12px;
}

/* =============== Карточка товара =============== */

.db-product-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #e6e9f2;
  border-radius: 12px;
  background: #fff;
  flex: 1;
  box-shadow: 0 1px 2px rgba(34, 32, 70, 0.04);
}

.db-product-top {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  min-width: 0;
}

.db-product-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.db-product-head img {
  border-radius: 10px;
  width: 64px !important;
  height: 86px !important;
  object-fit: cover;
  background: #f5f6fb;
}

.db-product-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
  padding-top: 0;
}

.db-product-name {
  color: #2d2a5c;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.db-product-article {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.db-product-title {
  color: #9aa0b8;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  margin-bottom: auto;
}

.db-product-nm-id {
  color: #5c6bc0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
}

.db-product-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #5c6bc0;
  cursor: pointer;
  flex-shrink: 0;
}

.db-product-copy svg {
  width: 16px;
  height: 16px;
  display: block;
}

.db-product-copy:hover {
  color: #465687;
}

.db-product-copy-check {
  display: none;
}

.db-product-copy-check svg path {
  stroke: currentColor;
}

.db-product-copy.is-copied {
  color: #3e9c68;
}

.db-product-copy.is-copied .db-product-copy-icon {
  display: none;
}

.db-product-copy.is-copied .db-product-copy-check {
  display: block;
}

.db-product-status {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  max-width: 100%;
  padding: 4px 10px;
  border-radius: 8px;
  background: #ece9fb;
  color: #5c6bc0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.db-product-bottom {
  display: flex;
  align-items: stretch;
  min-width: 0;
}

.db-product-metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
  padding: 0 8px;
}

.db-product-metric:first-child {
  padding-left: 0;
}

.db-product-metric:last-child {
  padding-right: 0;
}

.db-product-metric + .db-product-metric {
  border-left: 1px solid #e6e9f2;
}

.db-product-metric > span:not(.db-product-title) {
  color: #5c6bc0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

/* =============^^====^^================ */

.db-product-row {
  font-size: 16px;
  line-height: 1;
}

.db-product-row td {
  font-size: 16px;
  line-height: 1;
  padding: 12px 0;
}

.db-product-row:last-child td {
  border: none;
}

.db-product-left {
  font-weight: 600;
  color: #5068A5;
}

.db-product-right {
  text-align: end;
}

.db-not-found {
  display: flex;
  flex-direction: column;
  gap: 16px;
  justify-content: center;
  align-items: center;
}

.db-not-found-text {
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
  color: rgba(51, 51, 51, 0.5);
}

.db-table .db-previous-year-cell,
.db-table th.db-previous-year-header-cell {
  color: #9AA9CD;
}

.db-popup-type {
  display: inline-block;
  min-width: 85px;
  padding: 16px;
  border-radius: 4px;
}

.db-popup-cell {
  position: relative;
  cursor: pointer;
}

.db-popup-cell:hover .db-popup-window {
  opacity: 1;
  visibility: visible;
}

.db-cell-text {
  padding: 6px 8px;
  min-width: 60px;
  border-radius: 4px;
}

.db-popup-cell  .db-popup-window {
  display: flex;
  opacity: 0;
  visibility: hidden;
  flex-direction: column;
  gap: 6px;
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 100px;
  background: #fff;
  padding: 8px;
  border-radius: 8px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
  z-index: 999;
  white-space: nowrap;
  transition: opacity 0.3s ease;
}

.db-popup-cell  .db-popup-window  .db-popup-row {
  font-size: 13px;
  border-radius: 4px;
  padding: 6px 0;
}


/* =============== Шапка-стики ================= */

.db-fix-top {
  position: static;
  top: 0;
  z-index: 200;
  background: #fff !important;
  margin-bottom: 30px;
  padding-bottom: 4px;
  min-width: 0;
}

.db-fix-top.is-pinned {
  position: sticky;
  top: 0;
  z-index: 200;
  padding-top: 12px;
  padding-bottom: 16px;
  margin-bottom: 8px;
  box-shadow: 0 12px 16px #fff;
}

.db-fix-top .white-box {
  border: none;
  padding: 0;
  background: #ffffff !important;
  box-shadow: none;
}

.db-fix-top .table-filters {
  margin-bottom: 24px;
  gap: 12px;
}

.db-fix-top .table-filters .flex-center-gap {
  gap: 10px;
  flex-wrap: wrap;
}

.db-fix-top .table-filters .ts-control {
  height: 52px;
  min-height: 52px;
  max-height: 52px;
  border-radius: 8px;
  border: 1px solid #e0e3ee;
  background: #fff;
  box-shadow: none;
}

.db-fix-top .table-filters .ts-control {
  padding-top: 0;
  padding-bottom: 0;
}

.db-fix-top .table-filters > .button-secondary {
  border-radius: 8px;
}

.db-sticky-filter {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.db-sticky-filter-title {
  color: #333;
  font-size: 14px;
  line-height: 1.2;
}

.db-sticky-filter .label-wrapper {
  flex-shrink: 0;
}

.product-stock-wrapper {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  background: #fff;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}

.db-product-card {
  flex: 1 0 360px;
  min-width: 360px;
  max-width: 360px;
}

.db-not-found,
.db-stock,
.db-kpi-card {
  flex: 1 0 188px;
  min-width: 188px;
  max-width: 360px;
}

.db-not-found,
.db-stock,
.db-kpi-card {
  border: 1px solid #e6e9f2;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(34, 32, 70, 0.04);
}

.db-not-found,
.db-stock {
  padding: 14px 16px;
}

#chartTitle {
  font-weight: 600;
}

.db-chart-block .table-filters {
  align-items: center;
  margin-bottom: 12px;
}

.db-chart-block.is-collapsed > .table-filters {
  margin-bottom: 0;
}

.db-chart-toggle {
  --pico-background-color: #faf9ff;
  --pico-border-color: #c4b5e0;
  --pico-color: #6d28d9;
  border: 1px solid #c4b5e0;
  border-radius: 6px;
  background: #faf9ff;
  color: #6d28d9;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  padding: 8px 12px;
  cursor: pointer;
  white-space: nowrap;
}

.db-chart-toggle:hover,
.db-chart-toggle:focus,
.db-chart-toggle:focus-visible {
  --pico-background-color: #ede9fe;
  --pico-border-color: #8d6dad;
  --pico-color: #6d28d9;
  background: #ede9fe;
  border-color: #8d6dad;
  color: #6d28d9;
}

.db-chart-block.is-collapsed .db-chart-body {
  display: none;
}

.db-total-column {
  font-weight: 700;
}


/* ========== карточки остатков, оборачиваемости и капитализации ========= */

.db-stock {
  font-size: 13px;
  display: flex;
  flex-direction: column;
}

.db-stock-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.db-stock-title {
  font-weight: 600;
  color: #2d2a5c;
  font-size: 13px;
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.3;
}

.db-stock table {
  width: 100%;
  font-size: 13px;
  margin-bottom: 0;
}

.db-stock table thead th {
  font-weight: 600;
  color: #2d2a5c;
  font-size: 13px;
  text-transform: none;
  letter-spacing: 0;
  text-align: left;
  padding: 0 0 10px;
  border: none;
}

.db-stock table tbody td {
  padding: 3px 6px;
  font-size: 12px;
  line-height: 1.25;
  border: none;
}

.db-stock table tbody td:first-child {
  font-weight: 400;
  color: #9aa0b8;
  padding-left: 0;
  padding-right: 8px;
}

.db-stock table tbody td:last-child {
  text-align: right;
  font-weight: 600;
  color: #2d2a5c;
  white-space: nowrap;
  padding-right: 0;
}

.db-stock .db-product-row td {
  font-size: 12px;
  line-height: 1.25;
  padding: 3px 6px;
}


/* ========== KPI карточки ========= */

.db-kpi-card {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.db-kpi-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  min-height: 34px;
}

.db-card-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
}

.db-kpi-header-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding-top: 2px;
}

.db-kpi-title {
  font-weight: 600;
  color: #2d2a5c;
  font-size: 13px;
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.3;
}

.db-kpi-subtitle {
  font-size: 11px;
  color: #9aa0b8;
  font-weight: 400;
}

.db-kpi-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 22px;
  margin: 2px 0 4px;
}

.db-kpi-tab {
  padding: 2px 8px;
  border: 1px solid #e6e9f2;
  border-radius: 999px;
  background: #f5f6fb;
  font-size: 10px;
  font-weight: 500;
  color: #6b728a;
  cursor: pointer;
  transition: all 0.2s;
}

.db-kpi-tab:hover {
  background: #eceff8;
}

.db-kpi-tab.active {
  background: #5c6bc0;
  color: #fff;
  border-color: #5c6bc0;
}

.db-kpi-value {
  display: none;
  font-size: 22px;
  font-weight: 700;
  color: #2d2a5c;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.db-kpi-value.active {
  display: block;
}

.db-kpi-value-large {
  font-size: 22px;
  font-weight: 700;
  color: #2d2a5c;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.db-kpi-secondary {
  font-size: 13px;
  font-weight: 600;
  color: #5c6bc0;
}

.db-kpi-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 6px;
  font-size: 12px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid #eef0f6;
}

.db-kpi-footer-header {
  color: #9aa0b8;
  font-weight: 400;
}

.db-kpi-footer-value {
  font-weight: 600;
  color: #2d2a5c;
}

.db-kpi-footer-value.article-statistics-cell-more-zero {
  color: #3e9c68 !important;
}

.db-kpi-footer-value.article-statistics-cell-less-zero {
  color: #bc4040 !important;
}


.th-with-groups-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.th-with-groups-toggle > span:first-child {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

button.db-table-groups-toggle {
  --pico-background-color: #6d28d9;
  --pico-border-color: #4c1d95;
  --pico-color: #fff;
  --pico-box-shadow: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  min-height: 26px;
  max-height: 26px;
  padding: 0;
  margin: 0 0 0 auto;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  border: 2px solid #4c1d95;
  border-radius: 4px;
  background-color: #6d28d9;
  color: #fff;
  cursor: pointer;
  font-size: 0;
  line-height: 0;
  box-shadow: none;
}

button.db-table-groups-toggle:hover,
button.db-table-groups-toggle:focus,
button.db-table-groups-toggle:focus-visible,
button.db-table-groups-toggle:active {
  --pico-background-color: #5b21b6;
  --pico-border-color: #4c1d95;
  --pico-color: #fff;
  --pico-box-shadow: none;
  background-color: #5b21b6;
  border-color: #4c1d95;
  color: #fff;
  box-shadow: none;
}

.db-table-groups-toggle-icon {
  display: none;
  align-items: center;
  justify-content: center;
}

.db-table-groups-toggle-collapse {
  display: inline-flex;
}

.db-table-groups-toggle.is-collapsed .db-table-groups-toggle-collapse {
  display: none;
}

.db-table-groups-toggle.is-collapsed .db-table-groups-toggle-expand {
  display: inline-flex;
}

.db-table-groups-toggle svg {
  display: block;
  width: 14px;
  height: 14px;
}

.tabs {
  margin-top: 20px;
}

.tabs-header {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: #f1f4f9;
  border-radius: 10px;
  margin-bottom: 16px;
}

.tab-btn {
  padding: 8px 20px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  color: #6b7a8f;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.tab-btn:hover {
  color: #333;
  background: rgba(255, 255, 255, 0.5);
}

.tab-btn.active {
  background: #ffffff;
  color: #333;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.tab-btn .tab-count {
  display: inline-block;
  background: #e5ebf4;
  color: #5068a5;
  font-size: 11px;
  font-weight: 600;
  padding: 0 8px;
  border-radius: 12px;
  margin-left: 6px;
}

.tab-btn.active .tab-count {
  background: #5068a5;
  color: #fff;
}

.tabs-content {
  position: relative;
}

.tab-pane {
  display: none;
  animation: fadeIn 0.25s ease;
}

.tab-pane.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ======== бэйджик со ссылкой на артикул на ВБ ================ */

.db-wb-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 6px;
  background: #faf9ff;
  color: #8d6dad;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
  width: fit-content;
  max-width: 100%;
  align-self: flex-start;
}

.db-wb-link:hover {
  background: #ede9fe;
  color: #6d28d9;
  text-decoration: none;
}
