/*
 * 供应链 / 菜品定价宽表规范（第 148 稿）
 *
 * 原则：业务数据优先于装饰；超过 8 列的台账统一横向滚动、固定表头、
 * 紧凑行高和非悬浮操作列。避免右侧按钮覆盖金额、日期和备注。
 */

.supplyLedgerToolbar,
.supplierOverviewToolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffaf5;
}

.supplyLedgerToolbar .filters,
.supplierOverviewToolbar > div {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.supplyLedgerToolbar label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.supplyLedgerToolbar select { min-width: 188px; }
.supplierOverviewToolbar b { font-size: 14px; }
.supplierOverviewToolbar span { color: var(--muted); font-size: 13px; }

.supplyLedgerTable,
.menuPricingTable {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffdf9;
  box-shadow: 0 7px 20px rgba(72, 48, 32, .035);
}

.supplyLedgerTable table,
.menuPricingTable table {
  width: 100%;
  min-width: 1420px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}

.supplyLedgerTable th,
.supplyLedgerTable td,
.menuPricingTable th,
.menuPricingTable td {
  padding: 9px 11px !important;
  line-height: 1.35 !important;
  vertical-align: middle;
  border-bottom: 1px solid #eadfd5;
  overflow-wrap: anywhere;
}

.supplyLedgerTable th,
.menuPricingTable th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #f5eee7;
  color: #4b4037;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  box-shadow: inset 0 -1px 0 #eadfd5;
}

.supplyLedgerTable tbody tr:nth-child(even),
.menuPricingTable tbody tr:nth-child(even) { background: #fffaf6; }

.supplyLedgerTable tbody tr:hover,
.menuPricingTable tbody tr:hover { background: #fff5eb; }

.supplyLedgerTable tbody tr:last-child td,
.menuPricingTable tbody tr:last-child td { border-bottom: 0; }

.supplyLedgerTable td small,
.menuPricingTable td small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.supplyLedgerTable .bulkCheckCell { width: 42px; text-align: center; }
.supplyLedgerTable .noteCell { white-space: normal; }

/* 操作列始终在业务数据之后，不采用 sticky，以免遮挡最后几列。 */
.supplyLedgerTable th.operationCell,
.supplyLedgerTable td.operationCell,
.menuPricingTable th.operationCell,
.menuPricingTable td.operationCell {
  position: static !important;
  right: auto !important;
  z-index: auto !important;
  min-width: 178px;
  max-width: none;
  white-space: normal;
  box-shadow: none !important;
  background: inherit !important;
}

.supplyLedgerTable .operationCell .mini,
.menuPricingTable .operationCell .mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  margin: 2px 4px 2px 0;
  padding: 5px 8px;
  font-size: 12px;
  line-height: 1.1;
}

/* 供应商台账列宽：备注不挤压联系方式和操作区。 */
.supplySupplierTable th:nth-child(1) { width: 42px; }
.supplySupplierTable th:nth-child(2) { width: 100px; }
.supplySupplierTable th:nth-child(3) { width: 180px; }
.supplySupplierTable th:nth-child(4) { width: 156px; }
.supplySupplierTable th:nth-child(5) { width: 156px; }
.supplySupplierTable th:nth-child(6) { width: 118px; }
.supplySupplierTable th:nth-child(7) { width: 88px; }
.supplySupplierTable th:nth-child(8) { width: 74px; }
.supplySupplierTable th:nth-child(9) { width: 230px; }
.supplySupplierTable th:nth-child(10) { width: 198px; }

/* 货品台账列宽：规格与价格保持可读，避免行高被长规格拉得很大。 */
.supplyItemsTable { min-width: 0; }
.supplyItemsTable table { min-width: 1590px; }
.supplyItemsTable th:nth-child(1) { width: 42px; }
.supplyItemsTable th:nth-child(2) { width: 52px; }
.supplyItemsTable th:nth-child(3) { width: 150px; }
.supplyItemsTable th:nth-child(4) { width: 76px; }
.supplyItemsTable th:nth-child(5) { width: 84px; }
.supplyItemsTable th:nth-child(6) { width: 150px; }
.supplyItemsTable th:nth-child(7) { width: 210px; }
.supplyItemsTable th:nth-child(8),
.supplyItemsTable th:nth-child(9) { width: 92px; }
.supplyItemsTable th:nth-child(10),
.supplyItemsTable th:nth-child(11) { width: 112px; }
.supplyItemsTable th:nth-child(12),
.supplyItemsTable th:nth-child(13) { width: 70px; }
.supplyItemsTable th:nth-child(14) { width: 100px; }
.supplyItemsTable th:nth-child(15) { width: 78px; }
.supplyItemsTable th:nth-child(16) { width: 150px; }
.supplyItemsTable td:nth-child(7) { max-height: 62px; overflow: hidden; }

/* 菜品定价台账：金额与操作分组清晰，SOP/备注不影响核心数值。 */
.menuPricingTable table { min-width: 1450px; }
.menuPricingTable th:nth-child(1) { width: 168px; }
.menuPricingTable th:nth-child(2) { width: 160px; }
.menuPricingTable th:nth-child(3) { width: 260px; }
.menuPricingTable th:nth-child(4),
.menuPricingTable th:nth-child(5),
.menuPricingTable th:nth-child(6) { width: 88px; }
.menuPricingTable th:nth-child(7) { width: 76px; }
.menuPricingTable th:nth-child(8) { width: 128px; }
.menuPricingTable th:nth-child(9) { width: 160px; }
.menuPricingTable th:nth-child(10) { width: 226px; }
.menuPricingTable .menuIngredientCell,
.menuPricingTable td:nth-child(9) { white-space: normal; }

@media (max-width: 900px) {
  .supplyLedgerToolbar,
  .supplierOverviewToolbar { align-items: flex-start; flex-direction: column; }
  .supplyLedgerToolbar > div,
  .supplierOverviewToolbar > div { width: 100%; }
  .supplyLedgerToolbar > div:last-child,
  .supplierOverviewToolbar > div:last-child { justify-content: flex-start; }
}

@media (max-width: 760px) {
  .supplyLedgerTable,
  .menuPricingTable { margin-inline: -2px; border-radius: 10px; }
  .supplyLedgerTable table { min-width: 1260px; }
  .supplyItemsTable table { min-width: 1510px; }
  .menuPricingTable table { min-width: 1320px; }
  .supplyLedgerTable th,
  .supplyLedgerTable td,
  .menuPricingTable th,
  .menuPricingTable td { padding: 8px 9px !important; }
  .supplyLedgerTable th.operationCell,
  .supplyLedgerTable td.operationCell { min-width: 165px; }
  .menuPricingTable th.operationCell,
  .menuPricingTable td.operationCell { min-width: 198px; }
}
