/* OngVietPOS Fix263 - straighten invoice line row
   Goal: all primary controls on one horizontal line.
   Loaded after Fix262 and overrides its vertical-middle rule.
*/

/* Keep header labels centered */
.invoice-line-table thead th{
  vertical-align:middle !important;
}

.invoice-line-table thead th:nth-child(2),
.invoice-line-table thead th:nth-child(3),
.invoice-line-table thead th:nth-child(4),
.invoice-line-table thead th:nth-child(5),
.invoice-line-table thead th:nth-child(6){
  text-align:center !important;
}

/* IMPORTANT:
   The product-name cell can contain SKU + stock warning below the input.
   Therefore every body cell must align to the TOP, not to the middle of
   the total row height. This keeps all primary controls straight. */
.invoice-line-table tbody tr:not(.invoice-empty-row) > td{
  vertical-align:top !important;
}

/* Same top offset for every primary control */
.invoice-line-table tbody tr:not(.invoice-empty-row) > td{
  padding-top:8px !important;
}

/* Product combobox */
.invoice-line-table tbody tr:not(.invoice-empty-row) > td:nth-child(1) .invoice-name-combobox{
  margin-top:0 !important;
}

/* Unit / Length / Width / Qty / Area stay horizontally centered */
.invoice-line-table tbody tr:not(.invoice-empty-row) > td:nth-child(2),
.invoice-line-table tbody tr:not(.invoice-empty-row) > td:nth-child(3),
.invoice-line-table tbody tr:not(.invoice-empty-row) > td:nth-child(4),
.invoice-line-table tbody tr:not(.invoice-empty-row) > td:nth-child(5),
.invoice-line-table tbody tr:not(.invoice-empty-row) > td:nth-child(6){
  text-align:center !important;
}

.invoice-line-table tbody tr:not(.invoice-empty-row) > td:nth-child(2) > *,
.invoice-line-table tbody tr:not(.invoice-empty-row) > td:nth-child(3) > *,
.invoice-line-table tbody tr:not(.invoice-empty-row) > td:nth-child(4) > *,
.invoice-line-table tbody tr:not(.invoice-empty-row) > td:nth-child(5) > *{
  margin-top:0 !important;
  margin-left:auto !important;
  margin-right:auto !important;
}

/* Normalize main control heights so their top/bottom edges line up */
.invoice-line-table tbody tr:not(.invoice-empty-row) > td:nth-child(2) select,
.invoice-line-table tbody tr:not(.invoice-empty-row) > td:nth-child(3) input,
.invoice-line-table tbody tr:not(.invoice-empty-row) > td:nth-child(4) input,
.invoice-line-table tbody tr:not(.invoice-empty-row) > td:nth-child(7) input{
  min-height:34px !important;
  height:34px !important;
  box-sizing:border-box !important;
}

/* Qty group stays on the same top line; retain Fix261 wider input */
.invoice-line-table tbody tr:not(.invoice-empty-row) > td:nth-child(5) .invoice-qty-stepper{
  min-height:34px !important;
  height:34px !important;
  margin-top:0 !important;
  align-items:center !important;
  justify-content:center !important;
}

.invoice-line-table tbody tr:not(.invoice-empty-row) > td:nth-child(5) .invoice-qty-stepper input,
.invoice-line-table tbody tr:not(.invoice-empty-row) > td:nth-child(5) .invoice-qty-stepper button{
  height:34px !important;
  box-sizing:border-box !important;
}

/* Area and total are text, so give them the same 34px visual row height */
.invoice-line-table tbody tr:not(.invoice-empty-row) > td:nth-child(6) > strong{
  display:flex !important;
  min-height:34px !important;
  height:34px !important;
  align-items:center !important;
  justify-content:center !important;
  margin:0 auto !important;
}

.invoice-line-table tbody tr:not(.invoice-empty-row) > td:nth-child(8) > b{
  display:flex !important;
  min-height:34px !important;
  height:34px !important;
  align-items:center !important;
  justify-content:flex-end !important;
  margin:0 !important;
}

/* Delete button also lines up with the same control row */
.invoice-line-table tbody tr:not(.invoice-empty-row) > td:nth-child(9) .invoice-row-delete{
  margin-top:0 !important;
  min-height:34px !important;
  height:34px !important;
  box-sizing:border-box !important;
}

/* Do not disturb helper lines under product name */
.invoice-line-table tbody tr:not(.invoice-empty-row) > td:nth-child(1) small{
  display:block;
}
