/* Sổ Công Trình (thuyhang-v2): only what the kit does not carry, plus layout glue. Colours, spacing, radii and type come from tokens.css. */

/* ---------- small pieces ---------- */
.th2-today { font-size: var(--fs-sm); white-space: nowrap; }
.th2-strong { font-weight: 700; }
.th2-nowrap { white-space: nowrap; }
.th2-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }

/* the facts of one công trình under its title */
.th2-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: var(--sp-4); margin: 0; }
.th2-facts > div { display: grid; gap: var(--sp-1); min-width: 0; }
.th2-facts dt { color: var(--muted); font-size: var(--fs-sm); }
.th2-facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }

/* two panels side by side when there is room */
.th2-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 26rem), 1fr)); gap: var(--sp-5); align-items: start; }

/* entry grids: short figure columns stay narrow so the tables fit 1280 px beside the sidebar */
.th2-rooms { --cell-min: 4.5rem; }
.th2-rooms-wrap { max-width: 40rem; }
.th2-rooms td.actions { width: 1%; }
/* a KPI whose figure is not there yet says so in words, one step smaller than a figure so it stays inside the card */
.th2-kpi-words { font-size: var(--fs-xl); }
.th2-flags { flex-wrap: nowrap; }
#in-bg td:nth-child(2) { min-width: 6.5rem; }
.th2-rooms .th2-w-name { min-width: 11rem; }
.th2-vt { --cell-min: 5.5rem; }
.th2-bg { --cell-min: 3.5rem; }
.th2-bg .th2-w-hm { min-width: 8rem; }
.th2-bg .th2-w-expr { min-width: 8rem; }
.th2-bg .th2-w-note { min-width: 4.5rem; }
.th2-bg td, .th2-bg th, .th2-rooms td, .th2-rooms th, .th2-vt td, .th2-vt th { vertical-align: middle; }
.th2-bg tr.grp th, .th2-bg tr.grp td { font-weight: 700; }
.th2-bg .th2-grp-code { white-space: nowrap; }

/* the quantity of a material is a button that opens how it was worked out */
.th2-sl { font-variant-numeric: tabular-nums; font-weight: 700; gap: var(--sp-1); white-space: nowrap; }

/* how one material was worked out: one line per room */
.th2-calc { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-3); }
.th2-calc li { display: grid; gap: var(--sp-1); padding-block-end: var(--sp-3); border-block-end: 1px solid var(--panel-border); }
.th2-calc li:last-child { border-block-end: 0; padding-block-end: 0; }
.th2-calc-room { font-weight: 700; }
.th2-calc-pt { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.th2-calc-up { color: var(--muted); }
.th2-calc-up strong { color: var(--text); }
.th2-formula { font-weight: 600; overflow-wrap: anywhere; }

/* phone: the room cards and the material list */
.th2-room-name { font-weight: 700; }
.th2-room-res { margin: 0; color: var(--muted); font-size: var(--fs-sm); }
.th2-mat { list-style: none; margin: 0; padding: 0; }
.th2-mat li { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: var(--sp-1) var(--sp-3); padding-block: var(--sp-3); border-block-end: 1px solid var(--panel-border); }
.th2-mat li:last-child { border-block-end: 0; }
.th2-mat-name { font-weight: 600; }
.th2-mat-sub { grid-column: 1; color: var(--muted); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.th2-mat-amt { grid-column: 2; grid-row: 2; text-align: end; font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }

/* index page */
.th2-hub { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-3); }
.th2-hub a { font-weight: 600; }
.th2-hub p { margin: 0; color: var(--muted); font-size: var(--fs-sm); }

/* paper: a group row of the báo giá and the total lines under the order */
.th2-paper-grp td, .th2-paper-grp th { font-weight: 700; }
.th2-paper-total td, .th2-paper-total th { font-weight: 700; }
.th2-paper-meta { display: grid; gap: var(--sp-1); }
.th2-paper-meta p { margin: 0; }
.th2-paper-place { text-align: end; font-style: italic; }
