/* Shared office shell; driver keeps the task-first mobile workspace. */
.app-sidebar[hidden], .sidebar-backdrop[hidden], #sidebar-menu[hidden] { display: none !important; }
.workspace-v2:not(.driver-mode) { --sidebar-expanded-width: 176px; --sidebar-width: var(--sidebar-expanded-width); }
.workspace-v2.sidebar-collapsed:not(.driver-mode) { --sidebar-width: 64px; }
.workspace-v2:not(.driver-mode) .shell { max-width: none; width: 100%; margin: 0; }
.workspace-v2:not(.driver-mode) .topbar, .workspace-v2:not(.driver-mode) footer { display: none; }
.workspace-v2:not(.driver-mode) #main-content { margin-left: var(--sidebar-width); padding: 0 var(--app-gutter,24px) 24px; min-width: 0; }
.workspace-v2:not(.driver-mode) .hero { max-width: none; min-height: 104px; margin: 0 -24px 24px; padding: 20px 24px; background: var(--ui-surface); border-bottom: 1px solid var(--ui-border); align-items: center; }
.workspace-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.workspace-v2:not(.driver-mode) .hero-controls > button { min-height: var(--ui-control); }
.workspace-v2 .workspace-title h1 { margin: 0; }
.workspace-v2 #workspace-description:empty { display: none; }
.workspace-v2 #refresh-status { margin: 6px 0 0; min-height: 18px; line-height: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-width); background: var(--ui-sidebar); border-right: 1px solid var(--ui-border); padding: 16px 12px; display: flex; flex-direction: column; gap: 18px; z-index: 30; overflow-y: auto; overscroll-behavior: contain; }
.sidebar-brand { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.sidebar-brand .brand-logo { width: 34px; }
.sidebar-brand-name { display: flex; flex-direction: column; flex: 1; gap: 3px; }
.sidebar-brand-name strong { font-size: 14px; letter-spacing: .02em; color: var(--ui-ink); }
.sidebar-brand-name small { font-size: 10px; letter-spacing: .09em; color: var(--ui-muted); }
.workspace-v2 .icon-button { padding: 10px; border: 0; border-radius: 8px; background: transparent; color: var(--ui-ink); width: 44px; height: 44px; min-width: 44px; min-height: 44px; display: grid; place-items: center; flex: 0 0 auto; }
.workspace-v2 .icon-button:hover { background: var(--ui-surface-muted); }
.app-sidebar svg, .workspace-title svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.workspace-v2 .app-sidebar .workspace-nav { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; border: 0; max-width: none; }
.workspace-v2 .app-sidebar .workspace-link, .workspace-v2 .app-sidebar #logout { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; min-width: 44px; border: 0; border-radius: 8px; padding: 12px; background: transparent; color: var(--ui-muted); text-align: left; font-size: 14px; font-weight: 500; }
.workspace-v2 .app-sidebar .workspace-link[hidden] { display: none; }
.workspace-v2 .app-sidebar .workspace-link[aria-pressed=true] { color: var(--ui-accent); background: var(--ui-surface-muted); font-weight: 600; }
.workspace-v2 .app-sidebar .workspace-link:hover, .workspace-v2 .app-sidebar #logout:hover { background: var(--ui-surface-muted); color: var(--ui-accent); }
.workspace-v2 .app-sidebar .sidebar-create { background: var(--ui-primary); color: var(--ui-on-primary); margin-bottom: 12px; }
.workspace-v2 .app-sidebar .sidebar-create:hover, .workspace-v2 .app-sidebar .sidebar-create[aria-pressed=true] { background: var(--ui-primary); color: var(--ui-on-primary); }
.sidebar-label { min-width: 0; }
.sidebar-session { margin-top: auto; border-top: 1px solid var(--ui-border); padding-top: 16px; }
.sidebar-account { display: flex; gap: 12px; padding: 0 12px 10px; align-items: center; }
.account-icon { width: 20px; color: var(--ui-muted); text-align: center; }
.sidebar-account strong, .sidebar-account small { display: block; overflow-wrap: anywhere; }
.sidebar-account strong { font-size: 13px; font-weight: 600; }
.sidebar-account small { font-size: 12px; color: var(--ui-muted); margin-top: 4px; }
.sidebar-collapsed .app-sidebar .sidebar-label, .sidebar-collapsed .sidebar-brand-name { display: none; }
/* Collapsed: the mark alone, centred, with the button that opens the sidebar under it. */
.sidebar-collapsed .sidebar-brand { flex-direction: column; justify-content: center; }
.sidebar-collapsed .app-sidebar .workspace-link, .sidebar-collapsed .app-sidebar #logout { justify-content: center; padding: 12px; }
.sidebar-collapsed .app-sidebar .sidebar-account { display: none; }
.workspace-v2:not(.driver-mode) .stats, .workspace-v2:not(.driver-mode) #order-list-panel > .order-toolbar > .view-tabs { display: none; }
.workspace-v2:not(.driver-mode) .workspace { max-width: none; gap: 20px; grid-template-columns: 220px minmax(0, 1fr) 220px; }
/* Every office department uses the same order detail/history layout. */



.workspace-v2 .order-detail-main, .workspace-v2 .order-detail-history { min-width: 0; }
.workspace-v2 .order-detail-history { padding: 24px; }
.workspace-v2 .order-detail-history { position: static; max-height: none; }
.workspace-v2 #order-detail-panel { padding: 0; border: 0; background: transparent; box-shadow: none; }
.workspace-v2:not(.driver-mode)[data-order-view=detail] #order-detail-panel { grid-column: 1; min-width: 0; padding: 0; }
.workspace-v2:not(.driver-mode)[data-order-view=detail] #order-status-history-panel { grid-column: 2; min-width: 0; padding: 24px; position: static; max-height: none; }
.workspace-v2:not(.driver-mode) #order-information-panel:has(.compact-order-card) > .order-timeline-header { display: none; }
.order-detail-stack { display: grid; gap: 20px; min-width: 0; }
.workspace-v2 .order-detail-stack > .action-panel { margin: 0; padding: 24px; }
.order-detail-stack > .detail-shortcut:has(.work-shortcut[hidden]) { display: none; }
.workspace-v2 .order-information { padding: 24px; min-width: 0; }
.workspace-v2:not(.driver-mode) #order-list-panel { grid-column: 1 / -1; min-width: 0; max-width: none; margin: 0; padding: 0; border: 0; background: transparent; }
.workspace-v2:not(.driver-mode) #order-list-panel > .order-toolbar > .panel-head { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); margin: 0; }

.workspace-v2:not(.driver-mode) #orders-heading { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.workspace-v2:not(.driver-mode) :is(#master-data-workspace, #dispatch-catalog-workspace) { max-width: none; margin: 0; width: 100%; }
.workspace-v2:not(.driver-mode)[data-order-view=list] .workspace { display: block; }
.workspace-v2 .order-table-scroll { max-width: 100%; overflow-x: auto; border: 1px solid var(--ui-border); border-radius: 12px; background: var(--ui-surface); }
.workspace-v2 .sales-work-table { display: table; width: 100%; min-width: 760px; table-layout: fixed; border: 0; border-collapse: collapse; }
.workspace-v2 .sales-work-table thead { display: table-header-group; position: static; width: auto; height: auto; overflow: visible; clip-path: none; }
.workspace-v2 .sales-work-table tbody { display: table-row-group; }
.workspace-v2 .sales-work-table tr { display: table-row; padding: 0; border: 0; background: transparent; }
.workspace-v2 .sales-work-table th, .workspace-v2 .sales-work-table td { display: table-cell; vertical-align: top; padding: 16px; border: 0; border-bottom: 1px solid var(--ui-border); text-align: left; }
.workspace-v2 .sales-work-table th { font-size: 13px; font-weight: 600; color: var(--ui-muted); background: var(--ui-surface); padding: 12px 16px; }
.workspace-v2 .list-table th:nth-child(1) { width: 20%; }
.workspace-v2 .list-table th:nth-child(2) { width: 20%; }
.workspace-v2 .list-table th:nth-child(3) { width: 20%; }
.workspace-v2 .list-table th:nth-child(4) { width: 20%; }
.workspace-v2 .list-table th:nth-child(5) { width: 20%; }
.workspace-v2 .sales-work-table td:last-child { display: table-cell; grid-column: auto; }
.workspace-v2 .sales-work-table tr:last-child td { border-bottom: 0; }
.workspace-v2 .sales-work-row { cursor: pointer; }
/* Row hover: list-rows.css (19/11/2026). */
.workspace-v2 .sales-work-row:has(.selected) { background: var(--ui-surface-muted); }
.workspace-v2 .sales-work-table .order-code-line { margin-bottom: 6px; }
.workspace-v2 .sales-work-table .order-card { display: inline-flex; width: auto; min-width: 44px; max-width: 100%; padding: 0; margin: 0; border: 0; border-radius: 5px; box-shadow: none; min-height: 44px; background: transparent; color: var(--ui-accent); }
.workspace-v2 .sales-work-table .order-card:hover, .workspace-v2 .sales-work-table .order-card.selected { background: transparent; border: 0; }
.workspace-v2 .sales-work-table .order-code { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; white-space: normal; }
.workspace-v2 .sales-work-table .workflow-badge { display: inline-block; max-width: 100%; font-size: 12px; white-space: normal; }
.workspace-v2 .sales-work-table .order-date { white-space: nowrap; }
.created-date, .queue-wait { display: block; }
.queue-wait { margin-top: 5px; }
.workspace-v2 .list-table .order-parties-line { display:grid; gap:2px; min-width:0; }
.workspace-v2 .list-table .order-parties-line .customer-name, .workspace-v2 .list-table .order-parties-line .project-name { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; min-width:0; margin:0; overflow:hidden; overflow-wrap:anywhere; }
.workspace-v2 .list-table .party-separator { display:none; }
.product-line { margin-bottom: 6px; overflow-wrap: anywhere; }
.product-line strong { font-weight: 500; }
.workspace-v2 .balanced-empty { min-height: 320px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; background: var(--ui-surface); border: 1px solid var(--ui-border); border-radius: 12px; padding: 32px 20px; }
.balanced-empty strong { font-size: 18px; font-weight: 600; }
.balanced-empty p { margin: 0; color: var(--ui-muted); max-width: 400px; }
.empty-state-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; background: var(--ui-surface-muted); color: var(--ui-muted); font-size: 24px; }
.empty-inbox-icon { background-color:var(--ui-muted); mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 4h16l2 10v6H2v-6L4 4Z'/%3E%3Cpath d='M2 14h6l2 3h4l2-3h6'/%3E%3C/svg%3E"); mask-position:center; mask-repeat:no-repeat; mask-size:28px; mask-mode:alpha; }
.workspace-v2:is(.driver-mode, .dashboard-denied) .driver-session { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.workspace-v2:is(.driver-mode, .dashboard-denied) .driver-session .sidebar-account { padding: 0; }
.workspace-v2:is(.driver-mode, .dashboard-denied) .driver-session small { display: none; }
.workspace-v2:is(.driver-mode, .dashboard-denied) .driver-session #logout { min-height: 60px; }
@media (max-width: 1200px) { .workspace-v2:not(.driver-mode) .workspace { grid-template-columns: 190px minmax(0, 1fr); } }
@media (max-width: 900px) {
  .workspace-v2:not(.driver-mode) #main-content { margin-left: 0; padding: 0 16px 20px; }
  .workspace-v2:not(.driver-mode) .hero { margin: 0 -16px 20px; padding: 16px; min-height: 104px; flex-wrap: nowrap; flex-direction: row; }
  .workspace-v2:not(.driver-mode) .workspace-title { flex: 1; }
  .workspace-v2:not(.driver-mode) .workspace-title > div { min-width: 0; }
  .workspace-v2:not(.driver-mode) .workspace-title h1 { min-height: 30px; line-height: 30px; }
  .workspace-v2:not(.driver-mode) .hero-controls { width: auto; }
  .workspace-v2:not(.driver-mode) .hero-controls > button { min-height: 48px; }
  .workspace-v2 .hero h1 { font-size: 24px; }
  .workspace-v2:not(.driver-mode) .app-sidebar { width: var(--sidebar-expanded-width); max-width: calc(100vw - 32px); transform: translateX(-100%); visibility: hidden; }
  .workspace-v2.sidebar-open .app-sidebar { transform: none; visibility: visible; }
  .sidebar-collapsed .app-sidebar .sidebar-label, .sidebar-collapsed .sidebar-brand-name { display: block; }
  .sidebar-collapsed .sidebar-brand { flex-direction: row; justify-content: flex-start; }
  .sidebar-collapsed .sidebar-account { display: flex; }
  .sidebar-collapsed .app-sidebar .workspace-link, .sidebar-collapsed .app-sidebar #logout { justify-content: flex-start; }
  .workspace-v2 .app-sidebar .workspace-link, .workspace-v2 .app-sidebar #logout, .workspace-v2 .icon-button { min-height: 48px; }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 29; background: var(--ui-shadow); border: 0; border-radius: 0; width: 100%; height: 100%; }
  .workspace-v2:not(.driver-mode) .workspace { display: flex; flex-direction: column; }
  .workspace-v2:not(.driver-mode)[data-order-view=detail] .order-sidebar { padding: 16px; width: 100%; }
  .workspace-v2:not(.driver-mode)[data-order-view=detail] #order-detail-panel { padding: 0; width: 100%; }
  .workspace-v2 .order-detail-main { width: 100%; }
  .workspace-v2 .order-information, .workspace-v2 .order-detail-history { padding: 16px; width: 100%; }
  .workspace-v2 .order-detail-stack > .action-panel { padding: 16px; }
  .workspace-v2:not(.driver-mode) .hero-controls { flex: 0 0 auto; }
  .workspace-v2 #reload { padding: 10px 12px; }
}
@media (max-width: 600px) {
  .workspace-v2:not(.driver-mode) .hero { display: flex; flex-wrap: nowrap; gap: 12px; }
  .workspace-v2:not(.driver-mode) .hero-controls { margin-left: auto; }
  .workspace-v2 .sales-work-table td::before { display: none; }
  .workspace-v2 .balanced-empty { min-height: 280px; }
}

.workspace-v2:not(.driver-mode) #order-list-panel > .orders-list { display: block; max-height: none; overflow: visible; padding: 0; }
.workspace-v2:not(.driver-mode) .hero { position: sticky; top: 0; z-index: 10; }
.workspace-title { flex: 1; }
.workspace-title > div { min-width: 0; }
.workspace-v2 .workspace-title h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.25; }
.workspace-v2:is(.driver-mode, .dashboard-denied) .driver-session svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.workspace-v2:is(.driver-mode, .dashboard-denied) .driver-session #logout { display: flex; gap: 8px; align-items: center; }
@media (max-width: 600px) {
  .workspace-v2:not(.driver-mode) .hero { min-height: 104px; }
  .workspace-v2:not(.driver-mode) .workspace-title { flex-basis: 0; }
  .workspace-v2:not(.driver-mode) .hero-controls { width: auto; }
}

.workspace-v2:is(.driver-mode, .dashboard-denied) .driver-session { border: 0; padding: 0; margin: 0; }
@media (max-width: 600px) {
  .workspace-v2.driver-mode .topbar { display: grid; grid-template-columns: minmax(0, 1fr) 60px; gap: 8px; height: auto; min-height: 0; padding: 12px 16px; }
  .workspace-v2.driver-mode .topbar .brand { grid-column: 1; grid-row: 1; }
  .workspace-v2:is(.driver-mode, .dashboard-denied) .driver-session { display: contents; }
  .workspace-v2:is(.driver-mode, .dashboard-denied) .driver-session .sidebar-account { grid-column: 1 / -1; grid-row: 2; }
  .workspace-v2:is(.driver-mode, .dashboard-denied) .driver-session #logout { grid-column: 2; grid-row: 1; width: 60px; height: 60px; min-width: 60px; justify-content: center; padding: 12px; }
  .workspace-v2:is(.driver-mode, .dashboard-denied) .driver-session #logout .sidebar-label { display: none; }
}

.workspace-v2:not(.driver-mode) .hero-controls { min-width: 0; max-width: 100%; }
.workspace-v2:not(.driver-mode) .hero-controls .work-shortcut { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }

.detail-shortcut:has(.work-shortcut:not([hidden])) { margin: 12px 0 20px; }
.detail-shortcut .work-shortcut { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }

.workspace-v2.dashboard-denied .topbar { display: flex; width: 100%; max-width: none; margin: 0; }
.workspace-v2.dashboard-denied #main-content { margin-left: 0; padding: 24px; }

.workspace-v2 .sales-work-table th:first-child { font-variant-numeric: tabular-nums; }
.workspace-v2 .empty-order-table { overflow: hidden; border: 1px solid var(--ui-border); border-radius: var(--ui-radius); background: var(--ui-surface); }
.workspace-v2 .empty-order-table .order-table-scroll { border: 0; border-radius: 0; }
.workspace-v2 .empty-order-table .balanced-empty { border: 0; border-radius: 0; }
.workspace-v2 .list-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; margin-top: 16px; min-width: 0; }
.workspace-v2 .list-footer .pager { margin: 0 0 0 auto; min-width: 0; max-width: 100%; }
@media (max-width: 600px) { .workspace-v2 .list-footer .pager { width: 100%; justify-content: center; } }

/* Catalog uses the list page's content edges and 12/20 px section spacing. */
.workspace-v2:not(.driver-mode) :is(#master-data-workspace, #dispatch-catalog-workspace) { padding: 0; border: 0; background: transparent; }
.workspace-v2:not(.driver-mode) .master-data-details { margin: 0; }
.workspace-v2:not(.driver-mode) .master-data-details > .section-heading { font-size: var(--ui-section-title); line-height: 24px; min-height: var(--ui-control); padding: 10px 0; margin: 0 0 12px; border: 0; border-radius: 0; background: transparent; }
.workspace-v2:not(.driver-mode) .master-data-content { padding-top: 0; }
.workspace-v2:not(.driver-mode) .master-data-content > .view-tabs { padding: 0; margin: 0; gap: 8px; background: transparent; flex-wrap: wrap; }
.workspace-v2:not(.driver-mode) .master-data-content > .view-tabs button { flex: 0 0 auto; white-space: nowrap; }
.workspace-v2:not(.driver-mode) .master-data-content > .view-tabs button[aria-pressed=true] { background: var(--ui-surface-muted); border-color: var(--ui-accent); }
.workspace-v2:not(.driver-mode) .master-data-content > .action-buttons { margin: 12px 0 0; gap: 8px; }
.workspace-v2:not(.driver-mode) .master-data-grid { margin-top: var(--ui-space); gap: var(--ui-space); }
.workspace-v2:not(.driver-mode) .master-data-grid > section { padding: 16px; border: 1px solid var(--ui-border); border-radius: var(--ui-radius); background: var(--ui-surface); }
.workspace-v2:not(.driver-mode) .master-data-grid h3 { margin: 0 0 12px; padding: 0; border: 0; }


.order-state .compact-progress, .order-identity .work-name { display: block; margin-top: 6px; font-size: 13px; }

/* Section content is always visible; only data-entry controls are interactive. */
.workspace-v2 .section-heading { line-height:1.5; margin:0 0 16px; padding:0; font-size:var(--ui-section-title); font-weight:600; border:0; border-radius:0; background:transparent; cursor:default; }
.workspace-v2 .order-history { margin:0; }
.workspace-v2 .order-history>.section-heading { padding-bottom:16px; border-bottom:1px solid var(--ui-border); }

.workspace-v2 { --list-control-size:44px; }
.workspace-v2 .catalog-navigation { margin:-4px 0 0 16px; padding-left:8px; border-left:1px solid var(--ui-border); }
.catalog-links { display:grid; gap:2px; }
#master-catalog-navigation:not([hidden]) + #dispatch-catalog-navigation > .catalog-links { margin-top:2px; }
.catalog-list-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:12px; flex-wrap:wrap; }
.workspace-v2:not(.driver-mode) .catalog-list-heading h3 { margin:0; }
.catalog-list-heading button { flex:0 0 auto; }
.workspace-v2 .icon-add { display:inline-grid; place-items:center; padding:0; width:var(--ui-control); min-width:var(--ui-control); height:var(--ui-control); font-size:26px; line-height:1; }
.workspace-v2 .master-data-editor > button { margin:0 0 12px; }
.catalog-record { display:block; width:100%; margin:0 0 8px; padding:14px 16px; border:1px solid var(--ui-border); border-radius:8px; background:var(--ui-surface); color:var(--ui-ink); text-align:left; font:inherit; cursor:pointer; }
.catalog-record[aria-pressed=true] { border-color:var(--ui-input-border); }
.catalog-record:focus-visible { outline:2px solid var(--ui-accent); outline-offset:2px; }
.catalog-record-name { display:block; font-size:14px; line-height:1.5; font-weight:600; overflow-wrap:anywhere; }
.catalog-record-summary { display:flex; flex-wrap:wrap; justify-content:space-between; gap:6px 12px; margin-top:8px; font-size:12px; line-height:1.5; }
.catalog-record-status { color:var(--ui-success-ink); }
.catalog-record-status.inactive, .catalog-record-date { color:var(--ui-muted); }
.workspace-v2:not(.driver-mode) .master-data-grid { margin-top:0; align-items:start; }
.workspace-v2:not(.driver-mode) .contract-catalog .master-data-grid { margin-top:0; }
.workspace-v2 .app-sidebar .catalog-link { min-height:44px; padding:10px 12px; font-size:13px; }
.workspace-v2 .app-sidebar .catalog-link > svg { width:16px; height:16px; }
.workspace-v2 .app-sidebar #catalog-view[aria-pressed=true] { background:transparent; }
.workspace-v2:not(.driver-mode) .hero-controls { position:relative; }
.workspace-v2:not(.driver-mode) #refresh-status { position:absolute; top:100%; right:0; margin:4px 0 0; max-width:min(70vw,420px); }
.workspace-v2 .list-toolbar { min-height:var(--list-control-size); margin:0 0 12px; padding:0; }
.workspace-v2 .list-toolbar:not(:has(.order-filter-form)) { min-height:0; margin:0; }
/* Việc của tôi hides the filters a visit to Đơn hàng left behind: no room is kept for them. */
.workspace-v2 .list-toolbar:has(> #order-filters[hidden]) { min-height:0; margin:0; }

.workspace-v2 .list-toolbar .order-filter-form { display:grid; grid-template-columns:minmax(0,1.7fr) minmax(0,1fr) minmax(0,1fr) var(--list-control-size); gap:10px; margin:0; align-items:start; }
.workspace-v2 .list-toolbar .action-label, .workspace-v2 .list-toolbar .action-buttons { margin:0; }
.workspace-v2 .list-toolbar .search-hint { position:absolute; width:1px; height:1px; margin:0; overflow:hidden; clip-path:inset(50%); }
.workspace-v2 .filter-clear { display:grid; place-items:center; width:var(--list-control-size); min-width:var(--list-control-size); max-width:var(--list-control-size); padding:0; }
.filter-clear svg { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.workspace-v2 .list-table { min-width:1100px; font-size:var(--ui-text); line-height:1.5; }
.workspace-v2 .list-table th { padding:16px; background:var(--ui-surface); color:var(--ui-muted); font-size:13px; font-weight:600; text-align:left; white-space:nowrap; line-height:1.5; }
.workspace-v2 .list-table td { padding:16px; vertical-align:middle; font-size:var(--ui-text); }
.workspace-v2 .list-table th, .workspace-v2 .list-table td { border:0; border-bottom:1px solid var(--ui-border); }
.workspace-v2 .tracking-table .tracking-item-row:not(.tracking-order-end) td:not([rowspan]) { border-bottom:0; }
.workspace-v2 .tracking-table .tracking-last-order td { border-bottom:0; }
/* Row hover: list-rows.css (19/11/2026). */
.workspace-v2 .sales-work-row, .workspace-v2 .tracking-table td[rowspan], .list-loading-row { height:84px; }

@media(min-width:901px) {
  .workspace-v2.sidebar-collapsed .catalog-navigation { margin:0; padding:0; border:0; }
}
@media(max-width:1100px) {
  .workspace-v2 .list-toolbar { min-height:calc(2 * var(--list-control-size) + 10px); }
  .workspace-v2 .list-toolbar:not(:has(.order-filter-form)), .workspace-v2 .list-toolbar:has(> #order-filters[hidden]) { min-height:0; }
  .workspace-v2 .list-toolbar .order-filter-form { grid-template-columns:minmax(0,1fr) minmax(0,1fr) var(--list-control-size); }
  .workspace-v2 .list-toolbar .order-filter-form>.action-label:first-child { grid-column:1/3; grid-row:1; }
  .workspace-v2 .list-toolbar .order-filter-form>.action-label:nth-child(2) { grid-column:1; grid-row:2; }
  .workspace-v2 .list-toolbar .date-filter-group { grid-column:2/4; grid-row:2; }
  .workspace-v2 .list-toolbar .action-buttons { grid-column:3; grid-row:1; }
}
@media(max-width:900px) { .workspace-v2 { --list-control-size:48px; } }
.workspace-v2.field-mode { --list-control-size:60px; }
@media(max-width:900px) { .workspace-v2 .list-toolbar select { font-size:var(--ui-text); } }

/* Order history: compact entries in a scrolling list capped at about five typical events; few events shrink the frame, long text wraps. */
.workspace-v2 .order-history-content { padding: 8px 0 0; }
.workspace-v2 .order-history-list { max-height: var(--order-history-max, 380px); overflow-y: auto; overscroll-behavior-x: contain; overscroll-behavior-y: auto; padding-right: 6px; scrollbar-gutter: stable; }
.workspace-v2 .order-sidebar .order-history .history-entry { padding: 8px 0; }
.workspace-v2 .order-sidebar .order-history .history-entry:last-child { border-bottom: 0; }
.workspace-v2 .order-sidebar .order-history .history-entry .history-time { margin: 0 0 2px; font-size: 12px; line-height: 1.3; }
.workspace-v2 .order-sidebar .order-history .history-entry .history-actor { margin: 0 0 3px; font-size: 13px; line-height: 1.35; }
.workspace-v2 .order-sidebar .order-history .history-entry .history-content { margin: 0; font-size: 13px; line-height: 1.4; white-space: normal; overflow-wrap: anywhere; }
.workspace-v2 .order-sidebar .order-history .history-entry .history-details { margin: 4px 0 0; padding-left: 16px; font-size: 13px; line-height: 1.4; }
.workspace-v2 .order-history .pager { margin-top: 8px; }
/* "Việc của tôi" by contract item: one card per item, facts in a wrapping grid (no horizontal scroll). */
.item-work { display: grid; gap: 20px; margin-bottom: 20px; }
.item-work-search { display: flex; gap: 8px; max-width: 560px; }
.item-work-search input { flex: 1; min-width: 0; }
.item-work-section h3, .order-work-title { margin: 0 0 10px; font-size: 16px; font-weight: 600; }
.order-work { margin-bottom: 20px; }
.item-work-count { color: var(--ui-muted); font-weight: 500; }
.item-work-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.item-work-card { background: var(--ui-surface); border: 1px solid var(--ui-border); border-radius: 12px; padding: 14px 16px; display: grid; gap: 8px; }
.item-work-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.item-work-head strong { font-size: 15px; overflow-wrap: anywhere; }
.item-work-step { border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 600; background: var(--ui-info-surface); color: var(--ui-info-ink); }
.item-work-step[data-step="ACCEPT"] { background: var(--ui-warning-surface); color: var(--ui-warning-ink); }
.item-work-step[data-step="REQUIREMENT_CHANGED"], .item-work-step[data-step="BLOCKED"] { background: var(--ui-danger-surface); color: var(--ui-danger-ink); }
.item-work-step[data-step="READY"] { background: var(--ui-success-surface); color: var(--ui-success-ink); }
.item-work-parties { margin: 0; color: var(--ui-muted); overflow-wrap: anywhere; }
.item-work-facts { margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px 16px; }
.item-work-facts div { min-width: 0; }
.item-work-facts dt { font-size: 12px; color: var(--ui-muted); }
.item-work-facts dd { margin: 0; overflow-wrap: anywhere; }
.item-work-reason { margin: 0; padding: 8px 12px; border-radius: 8px; background: var(--ui-warning-surface); color: var(--ui-warning-ink); text-align: left; }
.item-work-actions { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 640px) { .item-work-facts { grid-template-columns: 1fr 1fr; } .item-work-actions button { flex: 1 1 auto; } }

/* Luồng Báo giá–Hợp đồng (0031) */
.quote-form .quote-line-list { display:grid; gap:12px; }
.quote-line { display:grid; grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); gap:10px 12px; margin:0; padding:12px; border:1px solid var(--ui-border); border-radius:10px; min-width:0; }
.quote-line legend { padding:0 4px; font-weight:600; }
.quote-line .quote-line-unit { align-self:end; margin:0; }
.quote-line > button { justify-self:start; align-self:end; }
.quote-lines { overflow-x:auto; max-width:100%; }
.quote-lines-table, .contract-mix-table { width:100%; border-collapse:collapse; font-size:14px; }
.quote-lines-table th, .quote-lines-table td, .contract-mix-table th, .contract-mix-table td { padding:8px 10px; border-bottom:1px solid var(--ui-border); text-align:left; vertical-align:middle; }
.quote-lines-table th, .contract-mix-table th { font-weight:600; white-space:nowrap; }
.quote-lines-table td:last-child { white-space:nowrap; }
.contract-mix-table select { min-width:160px; }
/* Yêu cầu cấp phối: header card, then the table in its own frame with even columns; Hạng mục
   selector about 200px on desktop, narrower with its column. */
.mix-request { display:grid; gap:16px; }
.mix-request .order-business-card { margin:0; padding:20px 24px; border:1px solid var(--ui-border); border-radius:12px; background:var(--ui-surface); min-width:0; }
.mix-request-title { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.mix-request .mix-request-head h3 { margin:0; }
.mix-request .mix-request-facts { margin:12px 0 0; }
.mix-request .contract-mix-table { table-layout:fixed; min-width:760px; }
.mix-request .contract-mix-table th, .mix-request .contract-mix-table td { width:20%; white-space:normal; overflow-wrap:anywhere; }
.mix-request .contract-mix-table select { min-width:0; width:min(200px, 100%); }
@media(max-width:720px) { .mix-request .order-business-card { padding:16px; } }
.contract-mix-table .mix-status.done { font-weight:600; }
.contract-mix-table .trial-passed { font-weight:600; }
.contract-mix-dialog { width:min(820px,calc(100vw - 32px)); margin:96px auto 16px; max-height:calc(100dvh - 112px); padding:20px; box-sizing:border-box; border:1px solid var(--ui-border); border-radius:12px; color:var(--ui-ink); background:var(--ui-surface); overflow:auto; }
.contract-mix-dialog::backdrop { background:var(--ui-overlay); }
@media(max-width:600px) { .contract-mix-dialog { width:calc(100vw - 16px); margin:72px auto 8px; max-height:calc(100dvh - 80px); padding:12px; } .quote-line { grid-template-columns:1fr; } }
/* Tạo báo giá: two-column general information, then the full-width table of lines */
.quote-catalog .quote-form { display:grid; gap:16px; min-width:0; }
.quote-catalog .quote-info { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); max-width:36rem; gap:10px 20px; align-items:start; }
.quote-catalog .quote-info select { width:100%; max-width:17rem; }
.quote-catalog .quote-info-cell { display:grid; gap:2px; min-width:0; margin:0; align-content:start; }
.quote-catalog .quote-creator { grid-column:1; }
.quote-catalog .quote-info-cell .field-caption { font-weight:600; font-size:13px; }
/* Read-only values take their text height only; the Công trình select keeps the standard control size. */
.quote-catalog .quote-info-value { overflow-wrap:anywhere; color:var(--ui-muted); line-height:1.4; }
/* The quote form stays in the right pane; wide tables scroll inside their own containers.
   Phone (one column, as before): the form comes above the list. */
@media(max-width:720px) {
  .workspace-v2 .quote-catalog .master-data-grid:has(.quote-entry) > .master-data-editor { order:-1; }
}
.quote-catalog .quote-entry-area { display:grid; gap:8px; min-width:0; }
.quote-catalog .quote-entry { overflow-x:auto; max-width:100%; border:1px solid var(--ui-border); border-radius:10px; }
.quote-catalog .quote-entry-table { width:100%; min-width:1120px; border-collapse:collapse; font-size:14px; table-layout:fixed; }
.quote-catalog .quote-entry-table th, .quote-catalog .quote-entry-table td { padding:6px 8px; border-bottom:1px solid var(--ui-border); text-align:left; vertical-align:middle; }
.quote-catalog .quote-entry-table tbody tr:last-child td { border-bottom:0; }
.quote-catalog .quote-entry-table th { font-weight:600; white-space:nowrap; background:var(--ui-surface); }
.quote-catalog .quote-entry-table th:nth-child(1) { width:48px; }
.quote-catalog .quote-entry-table th:is(:nth-child(3), :nth-child(4)) { width:9%; }
.quote-catalog .quote-entry-table th:nth-child(5) { width:7%; } .quote-catalog .quote-entry-table th:nth-child(6) { width:6%; }
.quote-catalog .quote-entry-table th:nth-child(7) { width:11%; } .quote-catalog .quote-entry-table th:nth-child(8) { width:7%; }
.quote-catalog .quote-entry-table th:nth-child(9) { width:14%; }
.quote-catalog .quote-entry-table th:nth-child(10) { width:112px; } .quote-catalog .quote-entry-table th:nth-child(11) { width:52px; }
.quote-catalog .quote-after-vat { display:block; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.quote-catalog .quote-entry-table .action-input { width:100%; min-width:0; box-sizing:border-box; }
.quote-catalog .quote-entry-index { text-align:center; }
.quote-catalog .quote-entry-tools { display:flex; gap:8px; }
.quote-catalog .quote-header-actions { display:flex; align-items:center; justify-content:flex-end; gap:8px; flex-wrap:wrap; }
.quote-catalog .quote-default-editor:empty { display:none; }
.quote-catalog .quote-default-editor { min-width:0; }
.quote-catalog .quote-default-form { display:grid; gap:12px; margin:0; min-width:0; }
.quote-catalog .quote-default-form > section { min-width:0; }
/* Tạo báo giá: Dùng đơn giá trước VAT / sau VAT, under Người tạo báo giá. */
.quote-catalog .quote-price-mode { border:0; margin:0; padding:0; min-width:0; display:flex; flex-wrap:wrap; gap:8px 20px; align-items:center; }
.quote-catalog .quote-price-mode > legend { float:left; width:100%; margin-bottom:6px; }
.quote-catalog .quote-price-mode-option { display:inline-flex; align-items:center; gap:8px; min-height:44px; cursor:pointer; }
.quote-catalog .quote-price-mode-option input { width:18px; height:18px; margin:0; flex:0 0 auto; }
.quote-catalog .quote-net-price { display:block; text-align:right; font-variant-numeric:tabular-nums; }
/* Đơn giá mặc định (14/11/2026): three cards opened or folded by their title. */
.quote-catalog .quote-default-card { min-width:0; border:1px solid var(--ui-border); border-radius:10px; background:var(--ui-surface); }
.quote-catalog .quote-default-card > summary { display:flex; align-items:center; gap:8px; min-height:48px; padding:10px 14px; cursor:pointer; font-weight:600; list-style:none; }
.quote-catalog .quote-default-card > summary::-webkit-details-marker { display:none; }
.quote-catalog .quote-default-card > summary::before { content:''; width:8px; height:8px; border-right:2px solid currentColor; border-bottom:2px solid currentColor; transform:rotate(-45deg); transition:transform .15s; }
.quote-catalog .quote-default-card[open] > summary::before { transform:rotate(45deg); }
.quote-catalog .quote-default-card > :not(summary) { margin:0 14px 14px; min-width:0; }
.quote-catalog .quote-default-card output { font-variant-numeric:tabular-nums; }
.quote-catalog .quote-default-scroll { overflow-x:auto; max-width:100%; min-width:0; }
.quote-catalog .quote-default-form h3, .quote-catalog .quote-default-form p { margin:0; }
.quote-catalog .quote-default-table { width:100%; min-width:760px; table-layout:fixed; border-collapse:collapse; }
.quote-catalog .quote-default-table :is(th,td) { padding:8px; border-bottom:1px solid var(--ui-border); text-align:left; vertical-align:middle; overflow-wrap:anywhere; }
.quote-catalog .quote-default-table th { white-space:normal; font-size:13px; color:var(--ui-muted); }
.quote-catalog .quote-default-table th:nth-child(1) { width:5%; }
.quote-catalog .quote-default-table th:nth-child(2) { width:23%; }
.quote-catalog .quote-default-table th:is(:nth-child(3),:nth-child(4),:nth-child(5)) { width:8%; }
.quote-catalog .quote-default-table th:nth-child(6) { width:17%; }
.quote-catalog .quote-default-table th:nth-child(7) { width:14%; }
.quote-catalog .quote-default-table th:nth-child(8) { width:17%; }
.quote-catalog .quote-default-table input { box-sizing:border-box; width:100%; min-width:0; }
.commercial-catalog { min-width:0; max-width:100%; }
.commercial-catalog .commercial-controls { display:flex; align-items:flex-end; flex-wrap:wrap; gap:16px; margin:16px 0; }
.commercial-catalog .commercial-controls > input { width:min(100%,360px); min-width:0; }
.commercial-catalog .commercial-controls .date-filter-group { margin:0; }
.commercial-catalog .commercial-controls .date-filter-group select { width:auto; max-width:100%; }
.commercial-catalog .commercial-back { width:auto; margin:0 0 16px; }
.commercial-catalog .commercial-detail { min-width:0; max-width:100%; }
.commercial-catalog .commercial-table-scroll { min-width:0; max-width:100%; overflow-x:auto; }
.commercial-catalog .commercial-table { width:100%; min-width:900px; table-layout:fixed; border-collapse:collapse; }
.commercial-catalog .commercial-table :is(th,td) { text-align:left; padding:12px; border-bottom:1px solid var(--ui-border); vertical-align:middle; overflow-wrap:anywhere; }
.commercial-catalog .commercial-table th { font-size:13px; white-space:normal; background:var(--ui-surface-muted); }
.commercial-catalog .commercial-table th:first-child { width:5%; white-space:nowrap; }
.commercial-catalog .commercial-table th:nth-child(2) { width:17%; }
.commercial-catalog .commercial-table th:is(:nth-child(3),:nth-child(4)) { width:23%; }
.commercial-catalog .commercial-table th:is(:nth-child(5),:nth-child(6)) { width:16%; }
/* Báo giá: Hợp đồng after Người tạo — a compact centred icon column; the other columns share the rest. */
.commercial-catalog .commercial-table.has-contract-column th:nth-child(2) { width:16%; }
.commercial-catalog .commercial-table.has-contract-column th:is(:nth-child(3),:nth-child(4)) { width:21%; }
.commercial-catalog .commercial-table.has-contract-column th:is(:nth-child(5),:nth-child(6)) { width:15%; }
.commercial-catalog .commercial-table.has-contract-column th:nth-child(7) { width:9%; text-align:center; }
.commercial-catalog .commercial-table td.commercial-contract-cell { text-align:center; }
.commercial-contract-mark { display:inline-grid; place-items:center; width:24px; height:24px; border-radius:50%; font-weight:700; line-height:1; }
.commercial-contract-mark.is-linked { color:var(--ui-success-ink); background:var(--ui-success-surface); }
.commercial-contract-mark.is-missing { color:var(--ui-danger-ink); background:var(--ui-danger-surface); }
.commercial-catalog .commercial-table tbody tr[data-catalog-record] { cursor:pointer; }
/* Row hover: list-rows.css (19/11/2026). */
.commercial-catalog .commercial-table tbody tr:focus-visible { outline:2px solid var(--ui-focus); outline-offset:-2px; }
.commercial-catalog .commercial-record-actions { display:flex; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:8px; margin-left:auto; }
.commercial-catalog .commercial-detail .catalog-detail-heading h3 { margin:0; min-width:0; overflow-wrap:anywhere; }
.commercial-catalog .commercial-record-actions > button { width:auto; flex:0 0 auto; }
.commercial-catalog :is(.commercial-list,.commercial-detail,.commercial-controls,.commercial-back)[hidden] { display:none; }
@media(max-width:600px){.commercial-catalog .commercial-controls > input { width:100%; }.commercial-catalog .commercial-table :is(th,td){padding:10px;}}
.quote-catalog .quote-standard-table { min-width:760px; font-size:13px; }
.quote-catalog .quote-standard-table :is(th,td) { padding:6px 4px; overflow-wrap:anywhere; }
.quote-catalog .quote-standard-table th { white-space:normal; }
.quote-catalog .quote-standard-table th:nth-child(1) { width:4%; }
.quote-catalog .quote-standard-table th:nth-child(2) { width:17%; }
.quote-catalog .quote-standard-table th:nth-child(3) { width:8%; }
.quote-catalog .quote-standard-table th:nth-child(4) { width:6%; }
.quote-catalog .quote-standard-table th:nth-child(5) { width:7%; }
.quote-catalog .quote-standard-table th:nth-child(6) { width:15%; }
.quote-catalog .quote-standard-table th:nth-child(7) { width:6%; }
.quote-catalog .quote-standard-table th:nth-child(8) { width:15%; }
.quote-catalog .quote-standard-table th:nth-child(9) { width:14%; }
.quote-catalog .quote-standard-table th:nth-child(10) { width:8%; }
.quote-catalog .quote-standard-table input[readonly] { background:transparent; border-color:transparent; padding-inline:1px; }
/* Commercial filters share the same control box; retain its accessible caption. */
.commercial-catalog .commercial-controls { align-items:flex-start; }
.commercial-catalog .commercial-date-label { gap:0; }
.commercial-catalog .commercial-date-label > .field-caption { position:absolute; width:1px; height:1px; margin:-1px; padding:0; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.commercial-catalog .commercial-controls :is(input,select) { box-sizing:border-box; height:44px; }
.quote-catalog .unit-price-table { width:100%; border-collapse:collapse; border:0; font-family:inherit; font-size:14px; color:var(--ui-ink); background:transparent; }
.quote-catalog .unit-price-table :is(th,td) { border:0; border-bottom:1px solid var(--ui-border); padding:8px; line-height:1.4; vertical-align:middle; overflow-wrap:anywhere; }
@media screen {
  .unit-price-table :is(th,td):not(:last-child) {
    border-inline-end:1px solid color-mix(in srgb, var(--ui-border) 75%, transparent);
  }
}
.quote-catalog .unit-price-table th { font-size:13px; font-weight:600; color:var(--ui-muted); background:var(--ui-surface-muted); white-space:normal; }
/* Match the pre-VAT editor on the UAT quote form at desktop and phone widths. */
.quote-catalog { --quote-unit-price-width:104px; }
.quote-catalog .unit-price-table .unit-price-input {
  width:var(--quote-unit-price-width); max-width:100%; min-width:0; box-sizing:border-box; font:inherit; text-align:right;
}
@media (max-width:600px) {
  .quote-catalog { --quote-unit-price-width:83px; }
}
.quote-catalog .pump-price-editable { min-width:840px; }
.quote-catalog .pump-price-editable thead tr:first-child th:nth-child(2) { width:28%; }
.quote-catalog .pump-price-editable thead tr:first-child th:nth-child(3) { width:13%; }
.quote-catalog .pump-price-editable thead tr:first-child th:nth-child(4) { width:12%; }
.quote-catalog .pump-price-editable thead tr:first-child th:nth-child(5) { width:8%; }
.quote-catalog .pump-price-editable thead tr:last-child th { text-wrap:balance; }
.quote-catalog .pump-price-table tbody td:nth-last-child(-n+2) {
  text-align:center; font-variant-numeric:tabular-nums;
}
.quote-catalog .unit-price-table caption { font:inherit; font-weight:600; }
.quote-catalog :is(.quote-entry,.quote-default-scroll,.quote-lines,.pump-price-scroll) { max-width:100%; min-width:0; overflow-x:auto; }
.workspace-v2[data-workspace-view="catalog"]:has(.commercial-catalog[data-record-view="detail"]) #reload { display:none; }
.workspace-v2[data-workspace-view="catalog"] #workspace-panel .commercial-catalog[data-record-view="detail"] .catalog-list-heading { margin-inline-end:0; }
.commercial-catalog :is(.commercial-top-actions,.commercial-detail-back)[hidden] { display:none; }
.commercial-catalog[data-record-view="detail"] .catalog-list-heading { flex-wrap:nowrap; align-items:flex-start; gap:8px; }
.commercial-catalog .commercial-top-actions { min-width:0; }
.commercial-catalog .commercial-detail :is(.catalog-header-card,.catalog-section-card,.order-section) { border:0; border-radius:0; background:transparent; box-shadow:none; padding:0; }
.commercial-catalog .commercial-detail > :is(.catalog-section-card,.order-sections,.order-section) { border-top:1px solid var(--ui-border); margin-top:20px; padding-top:16px; }
.commercial-catalog .commercial-detail .order-section-toggle { background:transparent; }
.commercial-catalog .commercial-detail { padding:0; border:0; border-radius:0; background:transparent; box-shadow:none; }
.commercial-catalog .commercial-record-info { min-width:0; container-type:inline-size; }
.commercial-catalog .commercial-summary-grid { display:grid; grid-template-columns:minmax(0,2fr) minmax(0,1fr); gap:16px 32px; align-items:start; }
.commercial-catalog .commercial-record-info > .contract-summary { display:grid; grid-template-columns:minmax(0,1fr); gap:16px; margin:0; min-width:0; }
.commercial-catalog .commercial-history-side { min-width:0; padding-left:24px; border-left:1px solid var(--ui-border); }
.commercial-catalog .commercial-history-side > .order-section { display:flex; flex-direction:column; height:100%; }
.commercial-catalog .commercial-history-side .order-section-head { margin:0; }
.commercial-catalog .commercial-history-side .order-section-toggle { padding:0 24px 12px 0; font-size:14px; }
.commercial-catalog .commercial-history-side .order-section-body { padding:0 8px 0 0; min-height:0; overflow:auto; align-content:start; overscroll-behavior-x:contain; overscroll-behavior-y:auto; }
.commercial-catalog .commercial-history-entry { font-size:13px; line-height:1.5; }
.commercial-catalog .commercial-detail .catalog-contract-heading { flex-wrap:nowrap; align-items:flex-start; }
.commercial-catalog .commercial-detail .catalog-contract-heading h3 { flex:0 1 auto; }
.commercial-catalog .commercial-detail .catalog-contract-heading .tag { flex:0 0 auto; }
@media(min-width:801px) {
 /* The title and the information groups down to Khách hàng (with Bên bán since 18/11/2026) set the history's height.
    Contract terms and the history's own content do not size those rows. */
 .commercial-catalog .commercial-record-info,
 .commercial-catalog .commercial-record-info > .contract-summary { display:contents; }
 .commercial-catalog .commercial-record-info > .catalog-detail-heading { grid-column:1; grid-row:1; margin-bottom:0; }
 .commercial-catalog .commercial-record-info > .contract-summary > * { grid-column:1; }
 .commercial-catalog .commercial-history-side { grid-column:2; grid-row:1 / 6; align-self:stretch; contain:size; min-height:0; }
}
@media(max-width:800px) {
 .commercial-catalog .commercial-summary-grid { grid-template-columns:minmax(0,1fr); gap:20px; }
 .commercial-catalog .commercial-history-side { border-left:0; padding:16px 0 0; border-top:1px solid var(--ui-border); }
 .commercial-catalog .commercial-history-side .order-section-body { max-height:min(320px,50vh); }
}
@media(max-width:600px) { .commercial-catalog .commercial-controls :is(input,select) { height:48px; } }
.workspace-v2 input.quote-planning-checkbox { width:18px; height:18px; min-height:18px; padding:0; margin:0; vertical-align:middle; }
.quote-catalog .quote-form > .action-buttons { justify-content:flex-start; }
@media (max-width: 720px) { .quote-catalog .quote-info { grid-template-columns:minmax(0, 1fr); } }
.mix-request-head h3 { margin:0 0 8px; }
.mix-request-facts { display:flex; flex-wrap:wrap; gap:8px 24px; margin:0 0 12px; }
.mix-request-facts dt { font-size:12px; color:var(--ui-muted, var(--ui-muted)); }
.mix-request-facts dd { margin:0; font-weight:600; }
.project-mix-report { margin-top:16px; }
.project-mix-report .project-mix-report-table { min-width: 960px; }
.project-mix-report .project-mix-report-table th { white-space: nowrap; }
.project-mix-report .project-mix-report-table th:first-child { min-width: 180px; }
.project-mix-report .project-mix-report-table th:nth-child(2) { min-width: 110px; }

/* Art and wordmark are separate: the mask must never clip the text. */
.sidebar-art { margin-top:auto; padding-top:12px; flex:0 0 auto; text-align:left; pointer-events:none; }
.sidebar-art-image { display:block; height:68px; background:var(--ui-sidebar-art); mask:url('/app/sidebar-construction-art.svg') center / contain no-repeat; }
.sidebar-art strong { display:block; margin:8px 0 0 8px; font-size:15px; color:var(--ui-muted); }
.sidebar-collapsed .sidebar-art strong { display:none; }
.sidebar-collapsed .sidebar-art-image { height:48px; }
.app-sidebar > * { flex-shrink:0; }
.sidebar-session:has(#branch-switch-label[hidden]) { display:none; }
.sidebar-session { margin-top:0; }
@media(max-width:900px) { .sidebar-collapsed .sidebar-art strong { display:block; } .sidebar-collapsed .sidebar-art-image { height:68px; } }

/* Sidebar fit: the menu scrolls vertically with a thin scrollbar when the window is short (or zoomed in);
   nothing sticks out sideways when that scrollbar takes its gutter, and labels stay on one line.
   Items of one level sit closer; tap targets stay 44 px. */
.workspace-v2:not(.driver-mode) .app-sidebar { gap: 12px; padding-inline: 10px; scrollbar-width: thin; scrollbar-color: var(--ui-border) transparent; }
.workspace-v2:not(.driver-mode) .sidebar-brand-name { min-width: 0; }
.workspace-v2:not(.driver-mode) .app-sidebar .workspace-nav { gap: 2px; }
.workspace-v2:not(.driver-mode) .app-sidebar .sidebar-create { margin-bottom: 0; }
.workspace-v2:not(.driver-mode) .app-sidebar .sidebar-create + .sidebar-create { margin-top: 4px; }
.workspace-v2:not(.driver-mode) .app-sidebar .sidebar-create + .workspace-link:not(.sidebar-create) { margin-top: 10px; }
.workspace-v2:not(.driver-mode) .app-sidebar .sidebar-label { min-width: 0; overflow-wrap: anywhere; }
.workspace-v2:not(.driver-mode) .app-sidebar .workspace-link { gap: 8px; padding-inline: 8px; }
.workspace-v2:not(.driver-mode) .catalog-navigation { margin: 0 0 0 14px; padding-left: 6px; }
.workspace-v2:not(.driver-mode) .app-sidebar .catalog-link { padding-inline: 8px; }
@media (min-width: 901px) {
  .workspace-v2.sidebar-collapsed:not(.driver-mode) .app-sidebar { padding-inline: 6px; }
  .workspace-v2.sidebar-collapsed:not(.driver-mode) .catalog-navigation { margin: 0; padding: 0; border: 0; }
}

/* The company logo opens and closes the sidebar (no separate collapse button). 44 px tap target; the
   collapsed rail keeps the same column for every row, whether or not Danh mục is open or the rail scrolls. */
.workspace-v2 .sidebar-logo-toggle {
  display: grid; place-items: center; flex: 0 0 auto; width: 44px; height: 44px; min-width: 44px; min-height: 44px;
  padding: 0; border: 0; border-radius: 10px; background: transparent; cursor: pointer;
}
.workspace-v2 .sidebar-logo-toggle:hover { background: var(--ui-surface-muted); }
.workspace-v2 .sidebar-logo-toggle:focus-visible { outline: 2px solid var(--ui-focus); outline-offset: 2px; }
.workspace-v2 .sidebar-logo-toggle .brand-logo { width: 34px; height: auto; display: block; }
@media (min-width: 901px) {
  .workspace-v2.sidebar-collapsed:not(.driver-mode) .app-sidebar { padding-inline: 4px; scrollbar-gutter: stable both-edges; }
  .workspace-v2.sidebar-collapsed:not(.driver-mode) .sidebar-brand { align-items: center; }
  .workspace-v2.sidebar-collapsed:not(.driver-mode) .app-sidebar .workspace-nav { gap: 4px; }
  .workspace-v2.sidebar-collapsed:not(.driver-mode) .app-sidebar .sidebar-create + .workspace-link:not(.sidebar-create) { margin-top: 8px; }
  .workspace-v2.sidebar-collapsed:not(.driver-mode) .catalog-links { gap: 4px; }
  .workspace-v2.sidebar-collapsed:not(.driver-mode) .catalog-navigation:not([hidden]) { margin-top: 4px; }
}
/* Sales customer group uses the existing navigation controls and selection colors. */
.workspace-v2 .sales-customer-navigation:not([hidden]) { display:grid; grid-template-columns:minmax(0,1fr) 36px; align-items:center; }
.workspace-v2 .sales-customer-navigation > div { min-width:0; }
.workspace-v2 .app-sidebar #sales-customer-toggle { display:grid; place-items:center; width:36px; min-width:36px; min-height:44px; padding:6px; border:0; border-radius:8px; background:transparent; color:inherit; }
.workspace-v2 .app-sidebar #sales-customer-toggle:hover { background:var(--ui-hover); }
#sales-customer-toggle svg { width:16px; height:16px; fill:none; stroke:currentColor; stroke-width:1.7; }
#sales-customer-toggle[aria-expanded=false] svg { transform:rotate(-90deg); }
@media (min-width:901px) {
  .workspace-v2.sidebar-collapsed .sales-customer-navigation:not([hidden]) { grid-template-columns:minmax(0,1fr); }
  .workspace-v2.sidebar-collapsed .app-sidebar #sales-customer-toggle { width:100%; min-height:24px; }
}

.project-documents { margin-block:16px; min-width:0; }
.project-document-row { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:12px 0; border-bottom:1px solid var(--ui-border); }
.project-document-row > div { min-width:0; }
.workspace-v2 .project-document-row .project-document-link { white-space:normal; overflow-wrap:anywhere; text-align:left; border:0; background:transparent; padding:4px 0; min-height:44px; width:auto; font:inherit; color:var(--ui-primary); text-decoration:underline; }
.project-documents iframe { width:100%; height: min(65vh,640px); border:1px solid var(--ui-border); }
.project-documents input[type=file] { max-width:100%; }
/* Báo giá form: the VAT rate and the price after VAT sit in boxes with the border, radius, height and
   alignment of the other fields of the row; the VAT rate shows its "%". The unit price before VAT takes
   about 30% less width than before (its column gives the room to the content/note columns) and keeps
   its height; long amounts stay readable and the table scrolls inside its frame on narrow screens. */
.quote-catalog .quote-entry-table:not(.quote-standard-table) th:nth-child(7) { width:8%; }
.quote-catalog .quote-standard-table th:nth-child(6) { width:11%; }
.quote-catalog .quote-standard-table th:nth-child(9) { width:18%; }
.quote-catalog .quote-entry-table .unit-price-input { padding-inline:6px; font-variant-numeric:tabular-nums; }
.quote-catalog .quote-entry-table .quote-vat-field { position:relative; display:block; min-width:0; }
.quote-catalog .quote-entry-table .quote-vat-field > .quote-vat-input { padding-inline:6px 20px; text-align:right; font-variant-numeric:tabular-nums; }
.quote-catalog .quote-entry-table .quote-vat-unit { position:absolute; inset-block:0; inset-inline-end:7px; display:flex; align-items:center; color:var(--ui-muted); pointer-events:none; }
.quote-catalog .quote-standard-table .quote-vat-field > input[readonly] { background:var(--ui-surface-muted); border-color:var(--ui-border); padding-inline:6px 20px; }
.quote-catalog .quote-entry-table .quote-after-vat {
  display:flex; align-items:center; justify-content:flex-end; box-sizing:border-box; width:100%; min-width:0;
  min-height:var(--ui-control, 44px); padding:0 8px; border:1px solid var(--ui-border); border-radius:var(--ui-control-radius, 10px);
  background:var(--ui-surface-muted); color:var(--ui-ink); overflow-wrap:normal; white-space:nowrap;
}
.quote-catalog .quote-standard-table.quote-edit-table th:nth-child(8) { width:11%; }
.quote-catalog .quote-edit-table:not(.quote-standard-table) th:nth-child(9) { width:8%; }
.quote-catalog .quote-edit-table .quote-after-vat {
  width:var(--quote-unit-price-width); max-width:100%; font-variant-numeric:tabular-nums;
}
/* Narrow screens: the quote tables keep a minimum width (they scroll inside their frame) so the narrower
   unit price field still shows a 7-digit amount in full. */
.quote-catalog .quote-standard-table { min-width:900px; }
.quote-catalog .quote-entry-table:not(.quote-standard-table) { min-width:1200px; }
