/* Номенклатура — адаптивная таблица товаров */
.nom-table-shell {
  margin-top: 0.45rem;
  min-width: 0;
  max-width: 100%;
}

.nom-table-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 0.45rem;
}

.nom-dims-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.84rem;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.nom-dims-toggle input {
  accent-color: var(--green);
}

.nom-table-scroll {
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  max-width: 100%;
}

.nom-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-size: 0.84rem;
}

.nom-table th,
.nom-table td {
  padding: 0.42rem 0.5rem;
  border-bottom: 1px solid rgba(13, 31, 23, 0.08);
  vertical-align: middle;
  background: #fff;
}

.nom-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg-soft);
  font-weight: 650;
  color: var(--green-deep);
  white-space: nowrap;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  border-bottom: 1px solid var(--line);
}

.nom-table tbody tr:last-child td {
  border-bottom: 0;
}

.nom-table tbody tr:hover td {
  background: #f7fcf9;
}

.nom-col-name {
  width: 16rem;
  min-width: 12rem;
  max-width: 18rem;
  position: sticky;
  left: 0;
  z-index: 3;
  box-shadow: 4px 0 8px -6px rgba(13, 31, 23, 0.18);
}

.nom-table thead .nom-col-name {
  z-index: 4;
  background: var(--bg-soft);
}

.nom-table tbody .nom-col-name {
  background: #fff;
}

.nom-table tbody tr:hover .nom-col-name {
  background: #f7fcf9;
}

.nom-col-meta {
  width: 13rem;
  min-width: 11rem;
  max-width: 15rem;
}

.nom-col-t1 {
  width: 4.6rem;
  min-width: 4.4rem;
}

.nom-col-t2 {
  width: 5.2rem;
  min-width: 4.8rem;
  background: #fbfcfb;
}

.nom-table thead .nom-col-t2 {
  background: #eef6f1;
  color: var(--muted);
  font-weight: 600;
}

.nom-table-scroll[data-nom-show-dims='0'] .nom-col-t2 {
  display: none;
}

.nom-col-g {
  width: 4.4rem;
  min-width: 3.6rem;
  background: #f7f8fc;
}

.nom-table thead .nom-col-g {
  background: #eef0f8;
  color: var(--muted);
  font-weight: 600;
}

.nom-table-scroll[data-nom-show-grad='0'] .nom-col-g {
  display: none;
}

.nom-table .markup-gradation-input:focus {
  outline: 2px solid #c5d4ea;
}

.nom-table .markup-gradation-input.is-saving {
  opacity: 0.65;
}

.nom-table .markup-gradation-input.is-saved {
  border-color: #3d8a5c;
}

.nom-table .markup-gradation-input.is-error {
  border-color: #b42318;
}

.nom-name-link {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
  word-break: break-word;
  white-space: normal;
}

.nom-name-link:hover {
  color: var(--green-deep);
}

.nom-price-line {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.nom-source-line {
  font-size: 0.74rem;
  line-height: 1.3;
  white-space: normal;
  word-break: break-word;
}

.nom-cell-field {
  display: block;
  margin: 0;
}

.nom-cell-field input {
  width: 100%;
  max-width: 4.4rem;
  box-sizing: border-box;
  padding: 0.32rem 0.35rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: 0.84rem;
  text-align: right;
  background: #fff;
}

.nom-cell-field-t2 input {
  max-width: 4.6rem;
  background: #fafcfb;
  border-style: dashed;
}

.nom-cell-field input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-glow);
  border-style: solid;
}

.nom-cell-field input.is-saving {
  opacity: 0.65;
}

.nom-cell-field input.is-saved {
  border-color: var(--green-bright);
}

.nom-cell-field input.is-error {
  border-color: #b42318;
}

/* Карточки на узких экранах — без горизонтального «ломания» layout */
@media (max-width: 820px) {
  .nom-table-scroll {
    border: 0;
    background: transparent;
    overflow: visible;
  }

  .nom-table,
  .nom-table thead,
  .nom-table tbody,
  .nom-table tr,
  .nom-table th,
  .nom-table td {
    display: block;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
  }

  .nom-table {
    border-spacing: 0;
  }

  .nom-table thead {
    display: none;
  }

  .nom-table tbody tr {
    margin-bottom: 0.55rem;
    padding: 0.7rem 0.75rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.45rem 0.5rem;
  }

  .nom-table tbody tr:hover td {
    background: transparent;
  }

  .nom-col-name,
  .nom-col-meta {
    grid-column: 1 / -1;
    position: static;
    box-shadow: none;
    padding: 0;
    border: 0;
    background: transparent !important;
  }

  .nom-col-t1,
  .nom-col-t2 {
    padding: 0;
    border: 0;
    background: transparent !important;
  }

  .nom-col-t1::before,
  .nom-col-t2::before {
    content: attr(data-label);
    display: block;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--muted);
    margin-bottom: 0.15rem;
  }

  .nom-table-scroll[data-nom-show-dims='0'] .nom-col-t2 {
    display: none;
  }

  .nom-cell-field input,
  .nom-cell-field-t2 input {
    max-width: none;
    width: 100%;
    text-align: left;
  }

  .nom-price-line {
    white-space: normal;
  }
}

.markup-products {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.markup-node-body {
  min-width: 0;
}
