/* Một nền chung trong panel chính (16/11/2026, quy tắc chung toàn hệ thống). Các phần bên trong panel chính không có nền,
   viền hay bo góc riêng; tách nhau bằng khoảng cách hoặc đường kẻ mảnh. Bảng dữ liệu giữ khung bảng của chúng. */
.workspace-v2:not(.driver-mode) #workspace-panel :is(.roster-panel, .master-data-grid > section, .quote-default-card, .empty-order-table,
  .order-section, .dispatch-closeout, .order-business-card, .item-order-mix-card, .appearance-card, .leader-card, .it-connection,
  .contract-plan-facts, .order-delivery-overview .trip-board-columns, .order-note) {
  background: transparent; border: 0; border-radius: 0; box-shadow: none;
}
.workspace-v2:not(.driver-mode) #workspace-panel :is(.contract-plan-facts, .order-business-card, .appearance-card, .leader-card, .it-connection, .order-note) { padding-inline: 0; }
.workspace-v2:not(.driver-mode) #workspace-panel :is(.order-section, .order-business-card, .leader-card) + :is(.order-section, .order-business-card, .leader-card) { border-top: 1px solid var(--ui-border); }
.workspace-v2:not(.driver-mode) #workspace-panel :is(.roster-panel, .master-data-grid > section) { padding-inline: 0; }
.workspace-v2:not(.driver-mode) #workspace-panel .roster-panel + .roster-panel,
.workspace-v2:not(.driver-mode) #workspace-panel .master-data-grid > section + section { border-top: 1px solid var(--ui-border); padding-top: 16px; }
/* Đơn giá mặc định: three titled sections, a thin line between them. */
.workspace-v2:not(.driver-mode) #workspace-panel .quote-default-card + .quote-default-card { border-top: 1px solid var(--ui-border); }
.workspace-v2:not(.driver-mode) #workspace-panel .quote-default-card > summary { padding-inline: 0; }
.workspace-v2:not(.driver-mode) #workspace-panel .quote-default-card > :not(summary) { margin-inline: 0; }

/* Tạo kế hoạch: Thông tin hợp đồng, bảng tổng theo ngày, Lập kế hoạch sản xuất on the panel's own background. */
#plan-create-workspace .plan-create { gap: 0; }
#plan-create-workspace .plan-create > * { padding-block: 16px; }
#plan-create-workspace .plan-create > :first-child { padding-top: 0; }
.workspace-v2:not(.driver-mode) #workspace-panel #plan-create-workspace .plan-create > * + * { border-top: 1px solid var(--ui-border); }
#plan-create-workspace .plan-create .roster-panel { padding-block: 16px; }
#plan-create-workspace .plan-create > :first-child.roster-panel { padding-top: 0; }
/* The day summary keeps one divider: the section line above it, none of its own. */
#plan-create-workspace .plan-create-summary .contract-plan-summary { border-block: 0; padding-block: 0; }
/* "Kế hoạch ngày …" centred right above the summary table. */
#plan-create-workspace .contract-plan-day-title { text-align: center; margin: 4px 0 10px; }
/* Ngày bắt đầu: no visible caption (its accessible name stays), the field about 70% of its former width. */
#plan-create-workspace .plan-create-date { max-width: 184px; }
/* Thông tin hợp đồng: Khách hàng · Công trình · Mã hợp đồng on one row, captions level, the code centred on the pickers' text,
   both dividers the full height of the row. */
#plan-create-workspace .plan-create-facts { align-items: stretch; }
#plan-create-workspace .plan-create-facts > :is(.plan-contract-field, .plan-create-fact) { display: grid; grid-template-rows: auto var(--ui-control, 44px); gap: 6px; align-content: start; }
#plan-create-workspace .plan-create-fact > .field-caption { color: inherit; font-size: inherit; }
#plan-create-workspace .plan-create-fact-value { display: flex; align-items: center; min-height: var(--ui-control, 44px); font-weight: 600; }
#plan-create-workspace .plan-create-date .field-caption { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---- Bảng dữ liệu (16/11/2026) ---- */
/* Chung: tiêu đề xuống dòng khi dài, căn thẳng với ô dữ liệu, khoảng đệm đồng bộ. */
.workspace-v2:not(.driver-mode) #workspace-panel :is(.list-table, .commercial-table, .quote-lines-table, .contract-plan-table, .sales-work-table, .quote-default-table) :is(th, td) { vertical-align: middle; }
.workspace-v2:not(.driver-mode) #workspace-panel :is(.list-table, .commercial-table, .quote-lines-table, .contract-plan-table, .quote-default-table) th { white-space: normal; overflow-wrap: normal; word-break: normal; line-height: 1.35; }

/* Cấp phối áp dụng (Chi tiết đơn hàng): bảng chia đều theo chiều rộng; các cột vật liệu cùng chiều rộng, ô nhập vừa cột. */
#workspace-panel .plan-recipe-content .plan-recipe-grid .recipe-horizontal { width: 100%; min-width: 60rem; table-layout: fixed; }
#workspace-panel .plan-recipe-content .plan-recipe-grid .recipe-horizontal :is(th, td) { padding: 8px 6px; text-align: center; vertical-align: middle; }
#workspace-panel .plan-recipe-content .plan-recipe-grid .recipe-horizontal :is(th, td):first-child { text-align: left; padding-inline: 8px; }
#workspace-panel .plan-recipe-content .plan-recipe-grid .recipe-horizontal th { white-space: pre-line; overflow-wrap: normal; line-height: 1.35; }
#workspace-panel .plan-recipe-content .plan-recipe-grid .recipe-horizontal th:nth-child(1) { width: 10%; }
#workspace-panel .plan-recipe-content .plan-recipe-grid .recipe-horizontal th:nth-child(2) { width: 6.5%; }
#workspace-panel .plan-recipe-content .plan-recipe-grid .recipe-horizontal th:is(:nth-child(3), :nth-child(4)) { width: 9%; }
#workspace-panel .plan-recipe-content .plan-recipe-grid .recipe-horizontal input { box-sizing: border-box; width: 100%; min-width: 0; padding-inline: 4px; text-align: center; }

/* Cấp phối model (lập mới, xem và Sửa ở Công trình): Mác, Độ sụt rồi các cột vật liệu cùng chiều rộng. */
#workspace-panel .contract-model-grid .recipe-horizontal { width: 100%; min-width: 52rem; table-layout: fixed; }
#workspace-panel .contract-model-grid .recipe-horizontal :is(th, td) { padding: 8px 6px; text-align: center; vertical-align: middle; }
#workspace-panel .contract-model-grid .recipe-horizontal th { white-space: pre-line; overflow-wrap: normal; line-height: 1.35; }
#workspace-panel .contract-model-grid .recipe-horizontal th:is(:nth-child(1), :nth-child(2)) { width: 9%; }
#workspace-panel .contract-model-grid .recipe-horizontal input { box-sizing: border-box; width: 100%; min-width: 0; padding-inline: 4px; text-align: center; }
/* Nguồn tiêu chuẩn của dòng cần chọn: ngoài bảng, ngay trên bảng. */
.model-source-choosers { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 0 0 12px; }
.model-source-choosers .action-label { min-width: 240px; max-width: 360px; }

/* Tạo báo giá (16/11/2026): the same table for both ways of typing prices — the two price columns keep their width and
   their boxes keep one size; amounts right-aligned; the worked-out price on a light background. */
#workspace-panel .quote-catalog .quote-entry-table .quote-price-box {
  box-sizing: border-box; width: 100%; max-width: none; min-width: 0; min-height: var(--ui-control, 44px);
  padding-inline: 8px; text-align: right; justify-content: flex-end; font-variant-numeric: tabular-nums;
}
#workspace-panel .quote-catalog .quote-entry-table .quote-computed-price { background: var(--ui-surface-muted); border: 1px solid var(--ui-border); }
/* Báo giá chuẩn (tạo/sửa): mọi cột chia theo bảng; cột thao tác không còn nội dung (bỏ tick) thu gọn, Ghi chú lấp phần còn lại. */
#workspace-panel .quote-catalog .quote-standard-table th:nth-child(1) { width: 4%; }
#workspace-panel .quote-catalog .quote-standard-table th:nth-child(2) { width: 18%; }
#workspace-panel .quote-catalog .quote-standard-table th:nth-child(3) { width: 8%; }
#workspace-panel .quote-catalog .quote-standard-table th:nth-child(4) { width: 7%; }
#workspace-panel .quote-catalog .quote-standard-table th:nth-child(5) { width: 6%; }
#workspace-panel .quote-catalog .quote-standard-table th:nth-child(6) { width: 11.5%; }
#workspace-panel .quote-catalog .quote-standard-table th:nth-child(7) { width: 7%; }
#workspace-panel .quote-catalog .quote-standard-table th:nth-child(8) { width: 11.5%; }
#workspace-panel .quote-catalog .quote-standard-table th:nth-child(9) { width: 26%; }
#workspace-panel .quote-catalog .quote-standard-table th:nth-child(10) { width: 1%; }
#workspace-panel .quote-catalog .quote-standard-table :is(th, td):last-child { padding-inline: 0; }
#workspace-panel .quote-catalog .quote-entry-table td input[aria-label^="Ghi chú"] { box-sizing: border-box; width: 100%; }
#workspace-panel .quote-catalog .quote-entry-table:not(.quote-standard-table) th:is(:nth-child(7), :nth-child(9)) { width: 10%; }

/* Ghi chú yêu cầu khách hàng (16/11/2026): its own line under Khách hàng · Công trình · Mã hợp đồng / the contract facts. */
#plan-create-workspace .plan-create-facts > .plan-create-note { grid-template-rows: auto minmax(var(--ui-control, 44px), auto); }
#plan-create-workspace .plan-create-note-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.contract-plan-facts > .contract-requirement-note { grid-column: 1 / -1; }
.contract-plan-facts > .contract-requirement-note dd { white-space: pre-wrap; }
