/* 📋 Đơn đặt hàng — mockup 09A / spec Màn 6: 4 numbers, status chips with counts, a table with actions on each row.
   Loaded after layout.css; rem scales with the screen (ui-shell sets the root size). */

/* one slim row of numbers so the list starts high on the screen */
.oh-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; padding: .6rem 1.2rem 0; }
.oh-kpi { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; padding: .45rem .8rem; border: 1px solid #e5e7eb; border-radius: .6rem; background: #fff; }
.oh-kpi span { color: #6b7280; font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.oh-kpi b { font-size: 1.1rem; font-weight: 700; color: #1f2937; white-space: nowrap; }
.oh-kpi-warn b { color: #b45309; }
/* phones: 2 per row so the labels are readable (4 columns cut them to 'Do…') */
@media (max-width: 768px) { .oh-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: .6rem .8rem 0; } }

.oh-chips button[data-status="unconfirmed"]:not(.on) i { background: #fee2e2; color: #b91c1c; }

/* table: one grid for the header and every row */
.oh-thead, .card-v2.card-v2-order {
  grid-template-columns: 2rem minmax(9.5rem, 12rem) minmax(11rem, 15rem) minmax(12rem, 1fr) minmax(8.5rem, 11rem) 6.5rem minmax(8rem, 11rem) minmax(11rem, 12.5rem);
}
.card-v2.card-v2-order { font-size: .9rem; }
.card-v2.card-v2-order .card-cell-actions { flex-wrap: wrap; } /* 3 buttons on a waiting order wrap instead of widening the column */
.card-v2-order .card-cell-source { font-size: .85rem; white-space: nowrap; }

@media (max-width: 1400px) {
  .oh-thead, .card-v2.card-v2-order { grid-template-columns: 2rem minmax(9.5rem, 10.5rem) minmax(9rem, 12rem) minmax(9rem, 1fr) minmax(7.5rem, 9.5rem) 5.5rem minmax(7rem, 9rem) minmax(11rem, 12.5rem); }
}

.oh-thead { margin-top: .2rem; }
/* phones: no column grid (it needed ~54rem and scrolled sideways); each order is a stacked card:
   code + total / customer + source / products / status / actions. Shared look for the other lists in oh-v2.css */
@media (max-width: 768px) {
  .oh-thead { display: none; }
  .card-v2.card-v2-order {
    grid-template-columns: 2rem minmax(0, 1fr) auto;
    grid-template-areas: "chk order fin" "chk cust src" "chk prod prod" "chk status status" "chk act act";
  }
  .card-v2-order > .card-v2-check { grid-area: chk; }
  .card-v2-order > .card-cell-order { grid-area: order; }
  .card-v2-order > .card-cell-financials { grid-area: fin; }
  .card-v2-order > .card-cell-customer { grid-area: cust; }
  .card-v2-order > .card-cell-source { grid-area: src; text-align: right; color: #6b7280; }
  .card-v2-order > .card-cell-products { grid-area: prod; }
  .card-v2-order > .card-cell-status { grid-area: status; }
  .card-v2-order > .card-cell-actions { grid-area: act; }
}
