#products-view {
  --catalog-ink: var(--ink, #172033);
  --catalog-line: rgba(36, 28, 66, 0.1);
  --catalog-soft: #f7f5fb;
}

.catalog-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 150px auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
}

.catalog-search {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 15px;
  border: 1px solid var(--catalog-line);
  border-radius: 14px;
  background: #fff;
}

.catalog-search span { color: #6c47a9; font-size: 23px; line-height: 1; }
.catalog-search input { width: 100%; border: 0; outline: 0; background: transparent; }

.catalog-toolbar select {
  min-height: 44px;
  border: 1px solid var(--catalog-line);
  border-radius: 14px;
  padding: 0 12px;
  background: #fff;
}

.catalog-summary {
  display: flex;
  justify-content: space-between;
  margin: 0 4px 10px;
  color: #746f7e;
  font-size: 13px;
}

.catalog-summary p { margin: 0; }
.catalog-summary strong { color: var(--catalog-ink); }

.catalog-table-wrap {
  background: #fff;
  border: 1px solid var(--catalog-line);
  border-radius: 18px;
  box-shadow: 0 18px 45px rgba(29, 19, 49, 0.06);
}

.catalog-table td:first-child strong,
.catalog-table td:first-child small { display: block; }

.catalog-table td:first-child small {
  max-width: 320px;
  margin-top: 4px;
  color: #85808d;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-type,
.catalog-state {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.product-type.service { background: #f0eafa; color: #694199; }
.product-type.product { background: #e9f4f1; color: #23715f; }
.catalog-state.active { background: #eaf7ee; color: #24723c; }
.catalog-state.inactive { background: #f1eff2; color: #77717c; }
.inactive-row { opacity: 0.58; }

.catalog-empty { padding: 54px 20px; text-align: center; color: #7d7784; }
.catalog-empty strong { display: block; margin-bottom: 8px; color: var(--catalog-ink); font-size: 18px; }
.product-dialog-card { width: min(720px, calc(100vw - 32px)); }

.product-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.product-form-grid .wide { grid-column: 1 / -1; }

.checkbox-field {
  align-self: end;
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 9px;
  min-height: 44px;
}

.checkbox-field input { width: auto !important; }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; }

.dialog-close {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: var(--catalog-soft);
  color: #5e5769;
  font-size: 24px;
  cursor: pointer;
}

.price-history {
  display: grid;
  gap: 7px;
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--catalog-soft);
  font-size: 13px;
}

.price-history > strong { margin-bottom: 3px; }
.price-history span { display: flex; justify-content: space-between; color: #77717e; }
.price-history b { color: var(--catalog-ink); }
.price-history.hidden { display: none; }

.catalog-invoice-picker {
  grid-column: 1 / -1;
  padding: 12px;
  border: 1px dashed rgba(106, 68, 160, 0.34);
  border-radius: 13px;
  background: #faf8fd;
}

@media (max-width: 760px) {
  .catalog-toolbar { grid-template-columns: 1fr; }
  .catalog-toolbar .primary-button { width: 100%; }
  .product-form-grid { grid-template-columns: 1fr; }
  .product-form-grid .wide { grid-column: auto; }
  .catalog-summary span { display: none; }
  .catalog-table th:nth-child(3), .catalog-table td:nth-child(3),
  .catalog-table th:nth-child(4), .catalog-table td:nth-child(4),
  .catalog-table th:nth-child(6), .catalog-table td:nth-child(6) { display: none; }
}
