.sales-navigation { width: 100%; padding: 8px; margin-bottom: 22px; border-radius: 15px; }
.sales-navigation button { min-height: 46px; padding: 0 18px; font-size: 14px; color: var(--plum-strong); background: var(--pink-soft); }
.sales-navigation button.active { color: #fff; background: linear-gradient(135deg, var(--plum-strong), #8b4772); }
.purchase-product-filters { display: grid; grid-template-columns: repeat(3, minmax(150px, 1fr)); gap: 10px; }
.purchase-product-filters select:nth-of-type(4) { grid-column: span 2; }
.purchase-product-filters .button { width: 100%; }
.sales-history-hidden { display: none !important; }
.embedded-sale-card { padding: 24px; overflow: visible; }
.embedded-sale-form h2 { margin: 0 0 14px; color: var(--plum-strong); font-size: 20px; }
.sale-filter-grid { display: grid; grid-template-columns: repeat(3, minmax(160px, 1fr)); gap: 12px; }
.sale-filter-grid select, .sale-filter-grid input, .sale-price-grid input, .sale-footer-grid input, .sale-footer-grid select {
  width: 100%; min-height: 46px; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 0 14px;
}
.sale-selection-note { margin: 14px 0; padding: 16px 20px; border: 1px dashed #efd6dc; border-radius: 12px; background: var(--pink-pale); color: var(--plum-strong); }
.sale-price-grid { display: grid; grid-template-columns: repeat(3, minmax(180px, 1fr)); gap: 24px; align-items: end; }
.sale-price-grid label { display: grid; grid-template-columns: auto minmax(120px, 1fr); align-items: center; gap: 10px; }
.embedded-sale-form > .button-secondary { width: min(470px, 100%); margin-bottom: 18px; }
.sale-empty { color: var(--muted); margin: 14px 0 28px; }
.sale-lines { margin: 14px 0 22px; border: 1px solid var(--line); border-radius: 10px; }
.sale-footer-grid { display: grid; grid-template-columns: 1fr 1fr 1fr minmax(280px, 1fr); gap: 12px; align-items: center; }
.embedded-sale-total { margin-top: 16px; text-align: right; color: var(--plum-strong); font-size: 16px; }
.embedded-sale-total strong { font-size: 22px; }
.balance-table .exercise-row td,
.balance-table .equal-totals-row td {
  border-top: 1px solid var(--plum-strong);
  background: #f8e4ee;
  color: var(--plum);
  font-weight: 800;
}
.balance-table .equal-totals-row td {
  border-top-width: 2px;
  border-bottom: 2px solid var(--plum-strong);
}
.balance-table .total-row td:first-child,
.balance-table .exercise-row td:first-child,
.balance-table .equal-totals-row td:first-child {
  text-transform: uppercase;
  letter-spacing: .02em;
}
.table-scroll .book-total-row td {
  border-top: 2px solid var(--plum-strong);
  background: #f8e4ee;
  color: var(--plum);
  font-weight: 800;
}
.table-scroll .book-total-row td:first-child {
  text-transform: uppercase;
  letter-spacing: .03em;
}
@media (max-width: 860px) {
  .purchase-product-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .purchase-product-filters select:nth-of-type(4) { grid-column: span 1; }
  .sale-filter-grid, .sale-price-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sale-footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .sales-navigation { overflow-x: auto; }
  .sales-navigation button { white-space: nowrap; }
  .purchase-product-filters { grid-template-columns: 1fr; }
  .embedded-sale-card { padding: 16px; }
  .sale-filter-grid, .sale-price-grid, .sale-footer-grid { grid-template-columns: 1fr; }
  .sale-price-grid label { grid-template-columns: 1fr; }
}

/* V16.1 - precio manual en ventas */
.sale-line-price {
  min-width: 105px;
  width: 120px;
  text-align: right;
}

/* V17 - precios de venta realmente editables */
.sale-price-grid input:not(:disabled),
.sale-lines input[type="number"] {
  background: #fff;
  border: 2px solid var(--pink);
  font-weight: 700;
  color: var(--plum-strong);
  cursor: text;
}
.sale-price-grid input:disabled {
  background: #f4f1f2;
  color: var(--muted);
  cursor: not-allowed;
}
.reset-list-price {
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--pink);
  border-radius: 10px;
  background: var(--pink-pale);
  color: var(--plum-strong);
  font-weight: 700;
  cursor: pointer;
}
.reset-list-price:disabled { opacity: .45; cursor: not-allowed; }
.sale-line-list-price, .sale-line-price { min-width: 118px; width: 130px; text-align: right; }
.sale-price-help { margin: 8px 0 16px; color: var(--muted); font-size: 12px; }
