/* Поставки Ozon — матрица по кластерам */

.supplies-page .supplies-controls {
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: center;
}

.supplies-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin: 0.35rem 0 0.75rem;
}

.supplies-meta {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted, #64748b);
  flex: 1 1 auto;
}

.supplies-table-wrap {
  overflow: auto;
  max-height: calc(100vh - 220px);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 10px;
  background: #fff;
}

#suppliesTable {
  border-collapse: separate;
  border-spacing: 0;
  width: max-content;
  min-width: 100%;
  font-size: 0.82rem;
}

#suppliesTable thead th {
  position: sticky;
  z-index: 3;
  padding: 0.4rem 0.5rem;
  white-space: nowrap;
  font-weight: 600;
  text-align: center;
  vertical-align: middle;
  border-bottom: 1px solid rgba(15, 23, 42, 0.1);
}

/* Два ряда шапки без наслоения */
#suppliesTable thead tr.supplies-cluster-row th {
  top: 0;
  z-index: 5;
  height: 2.4rem;
  background: #e8eefc;
  border-bottom: 1px solid rgba(37, 99, 235, 0.2);
  font-size: 0.78rem;
}

#suppliesTable thead tr.supplies-subhead-row th {
  top: 2.4rem;
  z-index: 4;
  background: #f8fafc;
  font-size: 0.72rem;
  font-weight: 500;
  color: #64748b;
}

#suppliesTable th.supplies-sticky,
#suppliesTable td.supplies-sticky {
  position: sticky;
  z-index: 2;
  background: #fff;
}

#suppliesTable thead th.supplies-sticky {
  z-index: 6;
  background: #e8eefc;
}

#suppliesTable thead tr.supplies-subhead-row th.supplies-sticky {
  background: #f8fafc;
}

/* Липкие колонки слева: артикул / название / Σ */
#suppliesTable .supplies-sticky-art {
  left: 0;
  min-width: 9.5rem;
  box-shadow: none;
}
#suppliesTable .supplies-sticky-name {
  left: 9.5rem;
  min-width: 11rem;
  max-width: 14rem;
}
#suppliesTable .supplies-sticky-sum {
  left: 20.5rem;
  min-width: 3.2rem;
  box-shadow: 3px 0 0 rgba(15, 23, 42, 0.12);
  border-right: 1px solid rgba(15, 23, 42, 0.12);
}

/* Без колонки «Название» — Σ сразу после артикула */
.supplies-table-wrap.supplies-hide-name #suppliesTable .supplies-sticky-sum {
  left: 9.5rem;
}

.supplies-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #0f172a;
  user-select: none;
  white-space: nowrap;
  padding: 0.25rem 0.55rem;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 6px;
  background: #f8fafc;
  flex: 0 0 auto;
}
.supplies-toggle input {
  margin: 0;
  width: 1rem;
  height: 1rem;
}

#suppliesTable td {
  padding: 0.35rem 0.45rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  white-space: nowrap;
  vertical-align: middle;
}

#suppliesTable td.num,
#suppliesTable th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Чередование кластеров + жёсткая граница между ними */
#suppliesTable .supplies-band-a {
  background: #ffffff;
}
#suppliesTable .supplies-band-b {
  background: #f1f5f9;
}
#suppliesTable thead .supplies-band-a {
  background: #e8eefc;
}
#suppliesTable thead .supplies-band-b {
  background: #dde7f8;
}
#suppliesTable thead tr.supplies-subhead-row .supplies-band-a {
  background: #f8fafc;
}
#suppliesTable thead tr.supplies-subhead-row .supplies-band-b {
  background: #eef2f7;
}

#suppliesTable .supplies-cluster-start,
#suppliesTable th.supplies-cluster-head {
  border-left: 2px solid rgba(37, 99, 235, 0.35);
}

#suppliesTable .supplies-cluster-title {
  font-weight: 700;
  color: #1e3a8a;
}

#suppliesTable tbody tr.supplies-row {
  cursor: grab;
}

#suppliesTable tbody tr.supplies-row:hover td.supplies-band-a {
  background: #f8fafc;
}
#suppliesTable tbody tr.supplies-row:hover td.supplies-band-b {
  background: #e2e8f0;
}
#suppliesTable tbody tr.supplies-row:hover td.supplies-sticky {
  background: #f8fafc;
}

#suppliesTable tbody tr.supplies-row.dragging {
  opacity: 0.55;
}

#suppliesTable tbody tr.supplies-row.drag-over {
  outline: 2px solid rgba(37, 99, 235, 0.45);
  outline-offset: -2px;
}

.supplies-drag-handle {
  display: inline-flex;
  width: 1.1rem;
  color: #94a3b8;
  cursor: grab;
  user-select: none;
  margin-right: 0.35rem;
}

.supplies-offer {
  font-weight: 600;
  color: #0f172a;
}

.supplies-name {
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #475569;
}

.supplies-need {
  font-weight: 700;
  color: #b45309;
}

.supplies-need.zero {
  color: #94a3b8;
  font-weight: 500;
}

.supplies-need.grow {
  color: #047857;
}

.supplies-need.drop {
  color: #c2410c;
}

.supplies-cluster-coeff {
  width: 3.2rem;
  padding: 0.12rem 0.2rem;
  font-size: 0.72rem;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 4px;
  text-align: right;
  background: #fff;
}

.supplies-days-btn.active {
  background: #0f172a;
  color: #fff;
  border-color: #0f172a;
}
