/* Sổ Công Trình (nguyenhongthoi). Layout glue only: the kit draws every component.
   Colours come from tokens.css; no colour literal here. */

/* ---------- top bar: the one project switcher ---------- */
/* KIT_GAPS gap 1. Kit .topbar-center: the combo is 256px and has no icon slot; here 288px with a muted icon.
   Delete when the kit has a top bar switcher. */
.nht-site { display: flex; align-items: center; gap: var(--sp-2); }
.nht-site > .icon { color: var(--muted); flex: none; }
.nht-site > .combo { width: 18rem; max-width: 100%; }

/* ---------- page layout ---------- */
/* KIT_GAPS gap 4. No least width for a name column. Measured at 1280: S6 253px without the rule, 270px with it;
   S10 gia binh quan 153px without, 192px with. Delete when the kit has a least column width. */
.nht-name { min-width: 10rem; }
.tbl-compact .nht-name { min-width: 12rem; }
.nht-code { white-space: nowrap; }
/* KIT_GAPS gap 4. S10 gia binh quan keeps the sheet's twelve columns and the voucher comparison: with a 12rem name column the table is
   17px wider than its 1100px frame at 1440, with 9.5rem it fits. At 1280 it scrolls in its own frame. */
.nht-gbq .nht-name { min-width: 9.5rem; }

/* ---------- forms ---------- */
/* KIT_GAPS gap 2. Kit .form-grid at 1280: three columns of 303px, so the contract head of S13 is 507px tall; four columns of
   224px make it 414px. Delete when .form-grid has four columns and field spans. */
.nht-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: var(--sp-4); }
@media (min-width: 64rem) {
  .nht-form4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .nht-span2 { grid-column: span 2; }
  .nht-span3 { grid-column: span 3; }
}
/* KIT_GAPS gap 3. Kit .cell-input is 88px at least. Measured at 1280 without these rules: values clipped in 2 of 10 inputs
   on S4 (by 17px) and S7 (by 47px), 2 of 4 on S16 (by 130px), 3 of 15 on S15; with them none.
   Delete when .tbl-grid takes a least width per column. */
.nht-grid th[scope="row"] { min-width: 12rem; }
.nht-grid .cell-input { min-width: 4.5rem; }
.nht-grid .cell-input[data-field="description"] { min-width: 14rem; }
.nht-grid .cell-input[data-field="reason"] { min-width: 12rem; }
.nht-grid .cell-input[data-money] { min-width: 7rem; }
.nht-grid .cell-input[data-field="amount"][data-money] { min-width: 8rem; }
.nht-grid .cell-input[data-field="sourceDocNo"] { min-width: 7.5rem; }
.nht-grid td > .combo { min-width: 12rem; }
.nht-grid td > .stack:has(> div > .combo) { min-width: 16.25rem; }
/* KIT_GAPS gap 3. The purchase forms (S34): at 1440 without these rules "NO:0000336" and the line notes are cut in their cells. */
.nht-grid .cell-input[data-field="documentNo"] { min-width: 7.5rem; }
.nht-grid .cell-input[data-field="documentDate"] { min-width: 6.5rem; }
.nht-grid .cell-input[data-field="note"] { min-width: 6rem; }
.nht-buyform th .cell-input[data-field="description"] { min-width: 17rem; }
.nht-buyform td .cell-input[data-field="description"] { min-width: 8rem; }
.nht-buyform td > .combo { min-width: 11rem; }
.nht-buyform .cell-input[data-money] { min-width: 7rem; }
.nht-buyform .cell-input[data-field="note"] { min-width: 5.75rem; }
.nht-buyform .cell-input[data-field="documentDate"] { min-width: 6rem; }
.nht-buyform .cell-input[data-field="documentRef"] { min-width: 6.5rem; }
.nht-buyprint thead tr:first-child th:nth-child(n+5), .nht-buyprint td[data-field="categoryCode"], .nht-buyprint td[data-field="note"] { white-space: nowrap; }
/* KIT_GAPS gap 5. Kit lays each statement picker as a full-width .field (942px at 1280); here 192 to 416px in one row.
   Delete when the kit has a parameter bar. */
.nht-params { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--sp-4); }
.nht-params > .field { width: var(--field-w, auto); max-width: 100%; }
.nht-filter-note { align-self: center; margin: 0; }
/* KIT_GAPS gap 6. Kit .dl stacks the stock card head: 137px tall on S10 at 1280, 104px in columns.
   Delete when .dl has a column variant. */
.nht-cardhead .dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); column-gap: var(--sp-6); }

/* ---------- phone ---------- */
.nht-big { margin: 0; font-family: var(--font-figure, var(--font-heading)); font-size: var(--fs-3xl); font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.nht-sheet-group { margin: 0; font-size: var(--fs-sm); color: var(--muted); }
.nht-stock { display: block; margin-bottom: var(--sp-1); text-align: end; white-space: nowrap; font-variant-numeric: tabular-nums; }
/* KIT_GAPS gap 8. Kit .work-end aligns a two-line quantity and tag to the start at 390; here to the end.
   Delete when .work-end has a stacked variant. */
.nht-stocklist .work-end { text-align: end; }
.nht-count-why { grid-column: 1 / -1; }
/* KIT_GAPS defect 9. Kit: three columns under 30rem, so a row of two tiles leaves 33% empty (about 110px at 360).
   Delete when look-app.css sizes .stat-row by the number of tiles. */
:root[data-look="app"] .stat-row:has(> .stat:nth-child(2):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
/* KIT_GAPS gap 23. At 360px a five-item tab bar gives each label 64px; "Công trường" needs 70px.
   Delete when .tabbar gives its labels the full item width on a 360px screen. */
@media (max-width: 22.5rem) { .tabbar > .tabbar-item { padding-inline: 0; } }

/* ---------- attendance grid and payroll ---------- */
.nht-att th[scope="row"] { min-width: 13rem; }
.nht-pay th[scope="row"] { min-width: 12rem; }
/* KIT_GAPS gap 4. Kit .cell-input is 88px in the payroll grid; 104px keeps room for amounts in the millions.
   Delete when .tbl-grid takes a least width per column. */
.nht-pay .cell-input { min-width: 6.5rem; }
/* KIT_GAPS gap 24. A pinned end column covers whatever lies under it when the table has not been scrolled yet. Without
   these widths "Tổng thu nhập" was cut at 1440 ("11.730.00"). The widths put a column edge at the pinned column's left
   edge at both office frames: 839px (1280) and 999px (1440). Delete when .tbl-pin-end snaps to a column edge. */
.nht-pay-nv thead th:nth-child(1) { width: 12.4375rem; min-width: 12.4375rem; }
.nht-pay-nv thead th:nth-child(2) { width: 9.5rem; min-width: 9.5rem; }
.nht-pay-nv thead th:nth-child(3) { width: 7.3125rem; min-width: 7.3125rem; }
.nht-pay-nv thead th:nth-child(4) { width: 9.75rem; min-width: 9.75rem; }
.nht-pay-nv thead th:nth-child(5) { width: 6.4375rem; min-width: 6.4375rem; }
.nht-pay-nv thead th:nth-child(6) { width: 7rem; min-width: 7rem; }
.nht-pay-nv thead th:nth-child(7) { width: 10rem; min-width: 10rem; }
.nht-pay-cn thead th:nth-child(2) { width: 6rem; min-width: 6rem; }
.nht-pay-cn thead th:nth-child(3) { width: 6.75rem; min-width: 6.75rem; }
.nht-pay-cn thead th:nth-child(4) { width: 6.375rem; min-width: 6.375rem; }
.nht-pay-cn thead th:nth-child(5) { width: 6.875rem; min-width: 6.875rem; }
.nht-pay-cn thead th:nth-child(6) { width: 6.1875rem; min-width: 6.1875rem; }
.nht-pay-cn thead th:nth-child(7) { width: 4.75rem; min-width: 4.75rem; }
.nht-pay-cn thead th:nth-child(8) { width: 10rem; min-width: 10rem; }

/* ---------- cost-item tree: the child level steps in ---------- */
/* KIT_GAPS gap 10. Kit .tbl-tree child rows look like parents: 16px start padding, weight 600; here 32px, weight 400.
   Delete when .tbl-tree has a level class. */
.tbl-tree th.nht-indent { padding-inline-start: var(--sp-7); font-weight: 400; }

/* ---------- guide ---------- */
.nht-steps { margin: 0; padding-inline-start: var(--sp-5); display: grid; gap: var(--sp-3); }
.nht-guide-narrow { max-width: 52rem; }

/* ---------- print previews ---------- */
.nht-print { display: block; }
.nht-paper-head { display: flex; justify-content: space-between; gap: var(--sp-6); align-items: flex-start; }
.nht-paper-form { text-align: center; max-width: 18rem; }
.nht-paper-form p, .nht-paper-meta p { margin: 0; }
.nht-paper-meta { display: grid; grid-template-columns: 1fr auto; gap: var(--sp-4); }
.nht-paper-lines p { margin: 0 0 var(--sp-1); }
.nht-paper-wide { font-size: 9pt; }
.nht-paper-preview { min-height: 0; }
