/* HLB Excel-first visual system — single shared stylesheet (design tokens + components).
   Used by layouts/app and layouts/portal; views must not carry their own colour CSS. */
:root {
    --hlb-primary: #217346; --hlb-primary-dark: #185C37; --hlb-active: #107C41;
    --hlb-select-bg: #E8F3EC; --hlb-workspace-bg: #F7F9F7; --hlb-table-bg: #FFFFFF;
    --hlb-grid-border: #D5DDD8; --hlb-text: #202820; --hlb-muted: #5d6b62; --hlb-header-bg: #EEF3EF;
    /* status colours stay distinct from the brand green */
    --hlb-error: #B3261E; --hlb-error-bg: #FDECEA;
    --hlb-warn: #8A5A00; --hlb-warn-bg: #FFF4CC; --hlb-warn-border: #E0C36A;
    --hlb-draft: #6B4A00; --hlb-draft-bg: #FFF0C2;
    --hlb-locked: #4A555C; --hlb-locked-bg: #E4E8EA;
    --hlb-confirmed: #0B4F8A; --hlb-confirmed-bg: #DCEBF9;
    --hlb-editable-bg: #FFFEF0;
    --hlb-row-h: 1.9rem;
    font-family: "Segoe UI", Calibri, Arial, sans-serif; font-size: 14px; color: var(--hlb-text); background: var(--hlb-workspace-bg);
}
body { margin: 0; line-height: 1.35; }
a { color: var(--hlb-primary-dark); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 2px solid var(--hlb-active); outline-offset: 1px; }
h1 { font-size: 1.25rem; margin: .4rem 0 .5rem; } h2 { font-size: 1.1rem; margin: .3rem 0; } h3 { font-size: 1rem; margin: .4rem 0; color: var(--hlb-primary-dark); }
[hidden] { display: none !important; }

/* ---- app shell ---------------------------------------------------------------------------------------------- */
header.hlb-bar { background: var(--hlb-primary); color: #fff; padding: .35rem 1rem; position: sticky; top: 0; z-index: 40; box-shadow: 0 1px 0 var(--hlb-primary-dark); }
header.hlb-bar nav { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; } header.hlb-bar nav a { color: #fff; text-decoration: none; padding: .15rem .35rem; border-radius: 3px; }
header.hlb-bar nav a:hover { background: var(--hlb-primary-dark); } header.hlb-bar nav form { margin-left: auto; } header.hlb-bar nav strong { margin-right: .4rem; }
header.hlb-bar nav a.nav-primary { font-weight: 600; background: var(--hlb-primary-dark); padding: .25rem .7rem; } header.hlb-bar nav a.nav-primary.current { background: #fff; color: var(--hlb-primary-dark); }
header.hlb-bar button { background: transparent; border: 1px solid rgba(255,255,255,.55); padding: .2rem .6rem; } header.hlb-bar button:hover { background: var(--hlb-primary-dark); }
details.nav-more { position: relative; } details.nav-more summary { cursor: pointer; color: #fff; list-style: none; padding: .2rem .6rem; border: 1px solid rgba(255,255,255,.55); border-radius: 3px; } details.nav-more summary::-webkit-details-marker { display: none; }
details.nav-more .nav-menu { position: absolute; z-index: 50; top: 1.9rem; left: 0; min-width: 17rem; background: var(--hlb-primary-dark); border: 1px solid var(--hlb-primary); border-radius: 3px; padding: .4rem .6rem; display: flex; flex-direction: column; gap: .25rem; }
main { max-width: 1280px; margin: .6rem auto; padding: 0 .75rem 2rem; }
main.hlb-wide { max-width: none; }
section, .card { background: var(--hlb-table-bg); border: 1px solid var(--hlb-grid-border); border-radius: 3px; padding: .6rem .75rem; margin: .5rem 0; }

/* ---- grid / tables (spreadsheet density) -------------------------------------------------------------------- */
table { width: 100%; border-collapse: collapse; background: var(--hlb-table-bg); }
th, td { border: 1px solid var(--hlb-grid-border); padding: .22rem .5rem; text-align: left; vertical-align: top; }
th { background: var(--hlb-header-bg); font-weight: 600; color: var(--hlb-primary-dark); }
td.num, th.num, td.money, .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tbody tr:hover td { background: #F3F8F4; }
.ws-scroll { overflow: auto; max-height: calc(100vh - 14rem); border: 1px solid var(--hlb-grid-border); background: var(--hlb-table-bg); }
table.ws { font-size: .9rem; border: 0; min-width: max-content; }
table.ws thead th { position: sticky; top: 0; z-index: 3; white-space: nowrap; }
table.ws thead tr:nth-child(2) th { top: var(--hlb-row-h); }
table.ws th.group { text-align: center; background: var(--hlb-primary); color: #fff; }
table.ws td { white-space: nowrap; max-width: 24rem; overflow: hidden; text-overflow: ellipsis; height: var(--hlb-row-h); }
table.ws td[data-field=display_name], table.ws td[data-field=legal_name], table.ws td[data-field=internal_notes] { white-space: normal; min-width: 14rem; }
/* frozen identity area: expand toggle + actions + first data column stay visible on horizontal scroll */
table.ws thead tr:first-child th:nth-child(1), table.ws tbody tr[data-row] > td:nth-child(1) { position: sticky; left: 0; z-index: 4; min-width: 2.2rem; width: 2.2rem; background: var(--hlb-header-bg); }
table.ws thead tr:first-child th:nth-child(2), table.ws tbody tr[data-row] > td:nth-child(2) { position: sticky; left: 2.2rem; z-index: 4; min-width: 10.5rem; background: var(--hlb-header-bg); box-shadow: 1px 0 0 var(--hlb-grid-border); }
table.ws tbody tr[data-row] > td:nth-child(3) { position: sticky; left: 12.7rem; z-index: 2; background: var(--hlb-table-bg); box-shadow: 1px 0 0 var(--hlb-grid-border); font-weight: 600; }
table.ws tbody tr[data-row] > td:nth-child(1), table.ws tbody tr[data-row] > td:nth-child(2) { background: var(--hlb-table-bg); }
table.ws tr.selected > td { background: var(--hlb-select-bg) !important; box-shadow: inset 0 2px 0 var(--hlb-active), inset 0 -2px 0 var(--hlb-active); }
table.ws td[data-mode=edit] { cursor: text; background: var(--hlb-editable-bg); }
table.ws td[data-mode=edit]:hover { outline: 2px solid var(--hlb-active); outline-offset: -2px; }
table.ws td[data-mode=read] { color: var(--hlb-muted); }
table.ws td.saving { opacity: .55; } table.ws td.failed { outline: 2px solid var(--hlb-error); outline-offset: -2px; }
table.ws td input, table.ws td select { max-width: none; min-width: 9rem; width: 100%; }
table.ws td:focus-within { outline: 2px solid var(--hlb-active); outline-offset: -2px; }
table.ws td.pick-col { white-space: nowrap; } table.ws td.pick-col button { margin: 0 .15rem 0 0; padding: .1rem .45rem; font-size: .82rem; }
table.ws th.sortable { cursor: pointer; user-select: none; } table.ws th.sortable:hover { background: var(--hlb-select-bg); }
table.ws th[aria-sort=ascending]::after { content: " ▲"; font-size: .7em; } table.ws th[aria-sort=descending]::after { content: " ▼"; font-size: .7em; }
.ws-detail td { background: #F8FAF8; white-space: normal; }
.ws-toggle { padding: 0 .35rem; }
.ws-tabs { display: flex; gap: .25rem; margin: 0 0 .5rem; border-bottom: 2px solid var(--hlb-primary); }
.ws-tabs a { padding: .3rem .9rem; border: 1px solid var(--hlb-grid-border); border-bottom: 0; border-radius: 3px 3px 0 0; text-decoration: none; color: var(--hlb-primary-dark); background: var(--hlb-header-bg); }
.ws-tabs a.active { background: var(--hlb-primary); color: #fff; border-color: var(--hlb-primary); }
.ws-toolbar { display: flex; gap: .5rem .9rem; align-items: end; flex-wrap: wrap; }
.ws-toolbar label { display: inline-flex; flex-direction: column; margin: 0; font-size: .8rem; color: var(--hlb-muted); }
.ws-toolbar input, .ws-toolbar select { max-width: 14rem; width: auto; }
.ws-flash { min-height: 1.2rem; margin: .2rem 0; color: var(--hlb-error); }
.ws-new { background: var(--hlb-select-bg); } .ws-new input, .ws-new select { max-width: 13rem; display: inline-block; width: auto; }
.ws-warn { color: var(--hlb-warn); font-weight: 600; }
.ws-accounts { margin-top: .4rem; padding: .5rem; border: 1px solid var(--hlb-grid-border); background: #fff; } .ws-account { margin: .3rem 0; }
.ws-inline-form { margin: .3rem 0; } .ws-inline-form label { display: inline-block; margin: 0 .5rem 0 0; } .ws-inline-form input { width: 11rem; }
.ws-accounts .ws-inline-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .3rem .7rem; align-items: end; } .ws-accounts .ws-inline-form label { display: block; margin: 0; } .ws-accounts .ws-inline-form input { width: 100%; min-width: 0; } .ws-accounts .ws-inline-form em { grid-column: 1 / -1; }
details.cw-collapsible > summary { cursor: pointer; font-weight: 600; color: var(--hlb-primary-dark); padding: .15rem 0; }

/* ---- selected customer panel -------------------------------------------------------------------------------- */
.cw-detail { border: 2px solid var(--hlb-active); background: #fff; }
.cw-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; } .cw-head h2 { margin: 0 0 .1rem; } .cw-head-actions { display: flex; gap: .6rem; align-items: center; }
.cw-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: .6rem; }
.cw-card { border: 1px solid var(--hlb-grid-border); border-radius: 3px; padding: .5rem .75rem; background: #fff; margin: .4rem 0; }
dl.cw-dl { display: grid; grid-template-columns: 10rem 1fr; gap: .15rem .7rem; margin: 0; } dl.cw-dl dt { color: var(--hlb-muted); } dl.cw-dl dd { margin: 0; }
.cw-chip, .ord-tag { display: inline-block; padding: .05rem .55rem; border-radius: 999px; font-size: .8rem; background: var(--hlb-locked-bg); color: var(--hlb-locked); }
.cw-chip.active, .cw-chip.visible, .ord-tag.confirmed { background: var(--hlb-confirmed-bg); color: var(--hlb-confirmed); }
.cw-chip.none, .cw-chip.draft, .ord-tag.draft { background: var(--hlb-draft-bg); color: var(--hlb-draft); }
.cw-chip.locked, .cw-chip.hidden-void { background: var(--hlb-locked-bg); color: var(--hlb-locked); }
.cw-alert { background: var(--hlb-warn-bg); border: 1px solid var(--hlb-warn-border); padding: .35rem .6rem; margin: .4rem 0; } .cw-alert:empty { display: none; }
.cw-orders-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; } .cw-orders-head h3 { margin: 0; }
table.cw-orders td.num { text-align: right; white-space: nowrap; } .cw-legend { font-size: .85rem; } .ws-subnav { display: flex; gap: .5rem; align-items: baseline; flex-wrap: wrap; }

/* ---- direct-order editor ------------------------------------------------------------------------------------ */
.ord-editor { background: #fff; border: 2px solid var(--hlb-active); } .ord-editor[hidden] { display: none; }
.ord-head { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .1rem .8rem; } .ord-head label { margin: .2rem 0; font-size: .85rem; color: var(--hlb-muted); }
.ord-head input, .ord-head select, .ord-head textarea { max-width: none; width: 100%; color: var(--hlb-text); } .ord-head textarea { min-height: 2.6rem; }
.ord-lines-wrap { overflow: auto; max-height: 60vh; border: 1px solid var(--hlb-grid-border); }
table.ord-lines thead th { position: sticky; top: 0; z-index: 2; }
table.ord-lines input { max-width: none; width: 100%; min-width: 4.5rem; border: 0; border-radius: 0; background: transparent; padding: .2rem .35rem; }
table.ord-lines input:focus { outline: 2px solid var(--hlb-active); outline-offset: -2px; background: var(--hlb-select-bg); }
table.ord-lines td { padding: 0; } table.ord-lines td.line-no, table.ord-lines td.num, table.ord-lines td:last-child { padding: .2rem .4rem; } table.ord-lines td.line-no { color: var(--hlb-muted); text-align: center; background: var(--hlb-header-bg); }
table.ord-lines td:nth-child(4) input, table.ord-lines td:nth-child(5) input { text-align: right; font-variant-numeric: tabular-nums; }
table.ord-lines input.bad, .ord-head .bad { outline: 2px solid var(--hlb-error); background: var(--hlb-error-bg); }
table.ord-lines tbody tr:hover td { background: transparent; } table.ord-lines tbody tr:focus-within td.line-no { background: var(--hlb-select-bg); font-weight: 700; }
.ord-sum { text-align: right; font-size: 1rem; padding: .35rem .6rem; background: var(--hlb-header-bg); border: 1px solid var(--hlb-grid-border); border-top: 0; position: sticky; bottom: 0; }
.ord-sum #s-tot { color: var(--hlb-primary-dark); font-size: 1.15rem; }
.ord-errors { color: var(--hlb-error); background: var(--hlb-error-bg); padding: .45rem; margin: .4rem 0; } .ord-errors:empty { display: none; }
.ord-flash { min-height: 1.2rem; margin: .2rem 0; } .ord-actions button { margin-right: .35rem; }
.ord-lock { background: var(--hlb-warn-bg); padding: .4rem .6rem; border: 1px solid var(--hlb-warn-border); margin: .3rem 0; }
.ord-state { display: inline-block; margin-left: .5rem; padding: .05rem .55rem; border-radius: 3px; font-size: .8rem; font-weight: 600; }
.ord-state.draft { background: var(--hlb-draft-bg); color: var(--hlb-draft); } .ord-state.locked { background: var(--hlb-locked-bg); color: var(--hlb-locked); } .ord-state.confirmed { background: var(--hlb-confirmed-bg); color: var(--hlb-confirmed); }
table.ord-list td.num { text-align: right; white-space: nowrap; }

/* ---- forms, buttons, status --------------------------------------------------------------------------------- */
label { display: block; margin: .4rem 0; }
input, select, textarea { width: 100%; max-width: 34rem; padding: .22rem .4rem; box-sizing: border-box; border: 1px solid var(--hlb-grid-border); border-radius: 2px; background: #fff; color: var(--hlb-text); font: inherit; }
input[type=checkbox], input[type=radio] { width: auto; }
button, .button { display: inline-block; padding: .25rem .7rem; background: var(--hlb-primary); color: #fff; border: 1px solid var(--hlb-primary-dark); border-radius: 3px; text-decoration: none; cursor: pointer; font: inherit; }
button:hover, .button:hover { background: var(--hlb-active); } button:disabled { opacity: .5; cursor: not-allowed; }
button.secondary { background: #fff; color: var(--hlb-primary-dark); border-color: var(--hlb-primary); }
button.danger, .danger { background: var(--hlb-error); border-color: #8c1d18; color: #fff; }
.muted { color: var(--hlb-muted); } .inline { display: inline; } .pagination { margin-top: .6rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: .75rem; }
.errors { color: var(--hlb-error); background: var(--hlb-error-bg); padding: .5rem .75rem; border: 1px solid #f0b9b4; } .status { color: var(--hlb-confirmed); background: var(--hlb-confirmed-bg); padding: .5rem .75rem; }

/* ---- customer portal (own layout, shared brand only) ---------------------------------------------------------- */
.portal-bar { background: var(--hlb-primary-dark); color: #fff; padding: .9rem 1.25rem; }
.portal-bar nav { display: flex; gap: 1.25rem; align-items: center; flex-wrap: wrap; } .portal-bar nav a { color: #fff; } .portal-bar nav form { margin-left: auto; }
.portal-bar button { background: transparent; border: 1px solid rgba(255,255,255,.6); }
/* long order lists (30-100 rows): the column headings stay visible while the list scrolls */
.portal-scroll { overflow: auto; max-height: 70vh; border: 1px solid var(--hlb-grid-border); }
.portal-scroll table { min-width: 40rem; } .portal-scroll thead th { position: sticky; top: 0; z-index: 2; white-space: nowrap; }

/* ---- narrow viewports --------------------------------------------------------------------------------------- */
@media (max-width: 720px) {
    :root { font-size: 15px; }
    main { padding: 0 .4rem 2rem; }
    header.hlb-bar nav { gap: .3rem; } header.hlb-bar nav form { margin-left: 0; }
    .ws-scroll { max-height: 70vh; }
    table.ws thead tr:first-child th:nth-child(2), table.ws tbody tr[data-row] > td:nth-child(2) { position: static; box-shadow: none; }
    table.ws tbody tr[data-row] > td:nth-child(3) { position: static; box-shadow: none; }
    dl.cw-dl { grid-template-columns: 1fr; } .cw-cols { grid-template-columns: 1fr; }
    .ord-sum { text-align: left; }
}

/* ---- shared Order Workspace: cross-role status chips and line grid ---------------------------------------------- */
.op-chip { display: inline-block; padding: .05rem .5rem; border-radius: 3px; font-size: .8rem; background: var(--hlb-locked-bg); color: var(--hlb-locked); }
.op-chip.partial { background: var(--hlb-warn-bg); color: var(--hlb-warn); } .op-chip.done { background: var(--hlb-confirmed-bg); color: var(--hlb-confirmed); }
table.ord-linegrid { min-width: 0; width: auto; } table.ord-linegrid td, table.ord-linegrid th { white-space: normal; }
table.ws td a.button { padding: .1rem .5rem; font-size: .82rem; margin: 0 .15rem .15rem 0; }

/* ---- quick-edit drawer (shared Order Workspace) ---- */
dialog.qe { width: min(960px, 96vw); max-height: 90vh; padding: 0; border: 2px solid var(--hlb-active); border-radius: 4px; background: var(--hlb-workspace-bg); }
dialog.qe::backdrop { background: rgba(32, 40, 32, .45); }
.qe-head { display: flex; gap: .75rem; align-items: center; padding: .4rem .75rem; background: var(--hlb-primary); color: #fff; position: sticky; top: 0; z-index: 2; } .qe-head .muted { color: #dfeee5; flex: 1; font-size: .8rem; } .qe-head button { background: transparent; color: #fff; border-color: rgba(255,255,255,.6); }
.qe-body { padding: .5rem .75rem 1rem; overflow: auto; max-height: calc(90vh - 3rem); }
/* G4 drawer: validation next to the field; the order row the drawer was opened from, after the grid reloads. */
.qe-field-error { display: block; color: #9b1c1c; font-size: .8rem; margin: .1rem 0 .4rem; }
.qe-body [aria-invalid="true"] { border-color: #9b1c1c; outline: 1px solid #9b1c1c; }
.qe-alert a[data-full] { display: inline-block; margin-top: .3rem; font-weight: 600; }
tr.qe-focus > td { background: #fff7d6; }

/* ---- mobile-first UAT 09/11/2026: sign-in, order filters vs. order entry, line cards, open-in-browser note ---------------- */
body.auth-page { background: var(--hlb-workspace-bg); }
.auth-bar { background: var(--hlb-primary); color: #fff; padding: .8rem 1rem; font-size: 1.1rem; }
main.auth-main { max-width: 26rem; margin: 1.5rem auto; padding: 0 1rem 2rem; }
.auth-card { background: var(--hlb-table-bg); border: 1px solid var(--hlb-grid-border); border-top: 4px solid var(--hlb-primary); border-radius: 4px; padding: 1rem 1.1rem 1.25rem; }
.auth-card h1 { font-size: 1.4rem; color: var(--hlb-primary-dark); margin-top: 0; }
.auth-form label { display: flex; flex-direction: column; gap: .35rem; margin: 0 0 1rem; font-weight: 600; color: var(--hlb-text); }
.auth-form input { max-width: none; width: 100%; min-height: 48px; font-size: 16px; padding: .6rem .75rem; border-radius: 4px; border-color: #9fb3a6; }
.auth-form button { display: block; width: 100%; min-height: 48px; font-size: 16px; font-weight: 600; border-radius: 4px; margin-top: .25rem; }
.auth-card .errors { margin: 0 0 1rem; border-radius: 4px; } .auth-card .errors p { margin: .15rem 0; font-weight: 600; }

fieldset.filter-box { border: 1px solid var(--hlb-grid-border); border-radius: 3px; background: var(--hlb-table-bg); margin: .6rem 0; padding: .4rem .75rem .6rem; }
fieldset.filter-box legend { font-weight: 700; color: var(--hlb-primary-dark); padding: 0 .3rem; }
.filter-help { margin: .1rem 0 .4rem; font-size: .85rem; }
.filter-actions { display: flex; flex-wrap: wrap; gap: .5rem .9rem; align-items: center; }
.ws-toolbar .filter-title { align-self: center; color: var(--hlb-primary-dark); }
.create-box { display: flex; flex-wrap: wrap; gap: .3rem .8rem; align-items: center; margin: .5rem 0; padding: .55rem .75rem; background: var(--hlb-select-bg); border: 2px solid var(--hlb-active); border-radius: 3px; }
.create-box .create-button { font-weight: 700; padding: .4rem 1rem; }
.lines-help { font-size: .85rem; margin: .2rem 0 .35rem; }

.open-external { background: var(--hlb-warn-bg); border-bottom: 2px solid var(--hlb-warn-border); padding: .7rem 1rem; font-size: 15px; }
.open-external p { margin: .3rem 0; } .open-external .button, .open-external button { min-height: 44px; margin: .2rem .5rem .2rem 0; font-size: 16px; }

@media (max-width: 720px) {
    /* the app bar scrolls away instead of covering a third of a phone screen */
    header.hlb-bar { position: static; }
    /* 16px stops phone browsers zooming into a field; 44px+ is a finger-sized target */
    main input:not([type=checkbox]):not([type=radio]), main select, main textarea, dialog input:not([type=checkbox]):not([type=radio]), dialog select, dialog textarea { font-size: 16px; min-height: 44px; }
    main button, main .button, dialog button, dialog .button { min-height: 44px; font-size: 15px; }
    .auth-main .auth-form input:not([type=checkbox]):not([type=radio]), .auth-main .auth-form button { min-height: 48px; font-size: 16px; }
    .ws-toolbar { flex-direction: column; align-items: stretch; } .ws-toolbar input, .ws-toolbar select { max-width: none; width: 100%; } .ws-toolbar .muted { margin-left: 0 !important; }
    .create-box .create-button { width: 100%; text-align: center; }
    /* plain record tables scroll sideways inside the page instead of widening it */
    main table:not(.ws):not(.line-cards):not(.ord-linegrid), dialog table { display: block; overflow-x: auto; max-width: 100%; }
    /* an order line becomes a card: one labelled field per row, Tên hàng full width; Excel paste keeps the column order */
    table.line-cards, table.line-cards tbody { display: block; width: 100%; border: 0; }
    table.line-cards thead { display: none; }
    table.line-cards tr { display: grid; grid-template-columns: 1fr 1fr; gap: .35rem .6rem; padding: .55rem .6rem; margin: 0 0 .6rem; border: 1px solid var(--hlb-grid-border); border-left: 4px solid var(--hlb-primary); background: #fff; }
    table.line-cards td { display: block; border: 0; padding: 0 !important; background: transparent !important; text-align: left; }
    table.line-cards td[data-label]::before { content: attr(data-label); display: block; font-size: .8rem; color: var(--hlb-muted); margin-bottom: .1rem; }
    table.line-cards td.line-no { grid-column: 1 / -1; text-align: left; font-weight: 700; color: var(--hlb-primary-dark); }
    table.line-cards td.line-no::before { display: inline; margin-right: .3rem; font-size: inherit; color: inherit; }
    table.line-cards td.line-desc, table.ord-lines td:nth-child(2) { grid-column: 1 / -1; }
    table.line-cards input, table.line-cards select { width: 100%; max-width: none; border: 1px solid #9fb3a6; border-radius: 3px; background: #fff; padding: .4rem .5rem; }
    table.ord-lines td.amount { align-self: end; font-weight: 700; padding-bottom: .5rem !important; }
    table.ord-lines td:last-child { align-self: end; text-align: right; }
    .ord-lines-wrap { max-height: none; overflow: visible; border: 0; }
    .ord-head { grid-template-columns: 1fr; }
    .ord-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
    /* G4 drawer fills the phone screen */
    dialog.qe { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; border-width: 0; }
    .qe-head { flex-wrap: wrap; } .qe-head .muted { flex-basis: 100%; order: 3; }
    .qe-body { max-height: calc(100dvh - 5.5rem); }
}
@media (max-width: 720px) {
    /* the Order list: one card per Order, the code and the customer on full rows */
    table.order-cards td.line-desc { grid-column: 1 / -1; font-weight: 600; }
    table.order-cards tbody tr:hover td { background: transparent; }
}

/* ---- order line image + notes (Customer First) ---- */
img.line-thumb { display: block; max-width: 72px; max-height: 72px; border: 1px solid var(--hlb-grid-border); margin-bottom: .2rem; object-fit: contain; background: #fff; }
td.img-cell { min-width: 8rem; } td.img-cell .img-state { display: block; font-size: .75rem; }
table.portal-lines img.line-img, table.ord-linegrid img.line-img { max-width: 80px; max-height: 80px; object-fit: contain; border: 1px solid var(--hlb-grid-border); background: #fff; }

@media (max-width: 720px) { table.ord-lines td:nth-child(6), table.ord-lines td.img-cell { grid-column: 1 / -1; } }

.who { margin-left: .5rem; padding: .1rem .6rem; border: 1px solid rgba(255,255,255,.55); border-radius: 3px; font-size: .85rem; } .who-role { opacity: .85; margin-left: .35rem; padding-left: .35rem; border-left: 1px solid rgba(255,255,255,.5); }

.ord-ambiguous { margin: .3rem 0; } .ord-ambiguous button { margin: .15rem .25rem .15rem 0; }
@media (max-width: 720px) {
  /* phone: Lưu nháp / Xác nhận stay on screen while the long line cards scroll */
  .ord-editor .ord-actions { position: sticky; bottom: 0; z-index: 6; background: #fff; border-top: 2px solid var(--hlb-active); padding: .45rem .3rem; margin: .5rem -.3rem 0; box-shadow: 0 -2px 6px rgba(0,0,0,.12); }
  .ord-editor .ord-sum { position: static; }
  .ord-editor .ord-actions button { min-height: 2.6rem; }
}

/* ---- show / hide password (public/js/hlb-password-toggle.js) ---- */
.pw-wrap { display: flex; align-items: stretch; gap: .35rem; max-width: 100%; }
.pw-wrap input { flex: 1 1 auto; min-width: 0; }
button.pw-toggle, .auth-form button.pw-toggle { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: auto; min-width: 3.4rem; min-height: 44px; margin: 0; padding: 0 .7rem; font-size: .95rem; font-weight: 600; }
.auth-form button.pw-toggle { min-height: 48px; }

/* ---- order editor: keep the destructive "Hủy bản nháp…" apart from Lưu nháp / Xác nhận ---- */
.ord-actions #ord-void-open { margin-left: auto; }
.ord-actions #ord-void-open:not([hidden]) + #ord-close { margin-left: 1rem; }
#ord-voidbox { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
#ord-voidbox[hidden] { display: none; }
#ord-voidbox label { flex-basis: 100%; }
#ord-voidbox #ord-void-cancel { margin-left: auto; }

/* ---- order line image: a refused or failed image is an error, not a hint ---- */
td.img-cell .img-state.img-error { color: var(--hlb-error); background: var(--hlb-error-bg); font-weight: 600; padding: .15rem .3rem; border-radius: 3px; }
.ord-flash.ord-flash-warn { color: var(--hlb-error); background: var(--hlb-error-bg); padding: .3rem .5rem; border-left: 4px solid var(--hlb-error); }

/* ---- bare admin account pages (users, customer accounts) on a phone ---- */
body.admin-bare { padding: .6rem; max-width: 60rem; }
body.admin-bare form { max-width: 100%; }
body.admin-bare input:not([type=checkbox]):not([type=radio]), body.admin-bare select { max-width: 100%; }
@media (max-width: 720px) { body.admin-bare label { display: block; margin: .35rem 0; } body.admin-bare table { display: block; overflow-x: auto; } }
/* Customer portal tracking table (Sheet14 §2): 15 columns on desktop, cards on a phone; same numbers in both. */
.portal-cards { display: none; }
table.portal-track { min-width: 72rem; } table.portal-track td.order-level { vertical-align: top; background: #fafafa; }
@media (max-width: 1180px) {
  #portal-tracking .portal-scroll { display: none; }
  .portal-cards { display: block; }
  .portal-card { border: 1px solid var(--hlb-grid-border); border-radius: 6px; padding: .6rem .8rem; margin-bottom: .8rem; background: #fff; }
  .portal-card h3 { margin: 0 0 .4rem; font-size: 1rem; } .portal-card img.line-img { max-width: 120px; max-height: 120px; object-fit: contain; display: block; margin-bottom: .4rem; }
  .portal-card dl { display: grid; grid-template-columns: auto 1fr; gap: .2rem .8rem; margin: 0; } .portal-card dt { color: #555; } .portal-card dd { margin: 0; text-align: right; }
}
/* The tracking table needs the full desktop width (15 columns); the page narrows again on phones where cards are used. */
main:has(#portal-tracking) { max-width: min(1600px, 98vw); }
table.portal-track { min-width: 0; width: 100%; font-size: .88rem; } table.portal-track th, table.portal-track td { padding: .4rem .45rem; }
table.portal-track td:nth-child(2) { min-width: 9rem; } table.portal-track td:nth-child(15) { min-width: 8rem; }
table.portal-track thead th { white-space: normal; } table.portal-track td:nth-child(2) { min-width: 7rem; } table.portal-track td:nth-child(15) { min-width: 6rem; }
table.portal-track img.line-img { max-width: 64px; max-height: 64px; }

/* R0 (UAT 12/11): visible home button, compact admin lists, wide order-name column, narrow unit / quantity. */
.nav-home { background: #fff; color: var(--hlb-primary-dark, #14532d) !important; border: 1px solid #fff; border-radius: 4px; padding: .15rem .65rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
.nav-home:hover { background: var(--hlb-select-bg, #e8f3ec); }
details.compact-reset > summary { cursor: pointer; color: var(--hlb-primary-dark, #14532d); font-size: .9rem; }
details.compact-reset form { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; margin-top: .3rem; }
/* order editor (UAT 12/11): long product names shown in full, name column first, unit / quantity narrow */
textarea.ord-name { width: 100%; min-height: 2.1rem; resize: none; overflow: hidden; border: 0; background: transparent; padding: .2rem .35rem; font: inherit; line-height: 1.3; }
textarea.ord-name:focus { outline: 2px solid var(--hlb-active); outline-offset: -2px; background: var(--hlb-select-bg); }
.ord-plan { margin: .4rem 0; font-weight: 600; color: var(--hlb-primary-dark); } .ord-plan:empty { display: none; }
.pct { display: inline-block; margin-left: .35rem; padding: .05rem .5rem; border-radius: 999px; background: var(--hlb-select-bg); font-weight: 700; }
.img-hint { display: block; font-size: .75rem; margin-top: .15rem; }
.img-cell:focus { outline: 2px solid var(--hlb-active); outline-offset: -2px; }
@media (min-width: 761px) {
  table.ord-lines { table-layout: fixed; }
  table.ord-lines th:nth-child(1) { width: 2.6rem; }
  table.ord-lines th:nth-child(2) { width: auto; }                 /* Tên hàng takes whatever is left */
  table.ord-lines th:nth-child(3) { width: 5.5rem; }               /* Đơn vị */
  table.ord-lines th:nth-child(4) { width: 6.5rem; }               /* Số lượng */
  table.ord-lines th:nth-child(5) { width: 9rem; }                 /* Đơn giá */
  table.ord-lines th:nth-child(6) { width: 12rem; }                /* Ghi chú dòng */
  table.ord-lines th:nth-child(7) { width: 9.5rem; }               /* Ảnh */
  table.ord-lines th:nth-child(8) { width: 8.5rem; }               /* Thành tiền */
  table.ord-lines th:last-child { width: 3.2rem; }
  table.ord-lines td { vertical-align: top; } table.ord-lines input { min-width: 0; }
}
@media (max-width: 760px) { table.line-cards textarea.ord-name { width: 100%; border: 1px solid #9fb3a6; border-radius: 3px; background: #fff; padding: .4rem .5rem; } }
/* portal tracking table: fit a 1280 px laptop without sideways scrolling (UAT 12/11: it scrolled) */
@media (min-width: 1181px) and (max-width: 1500px) {
  table.portal-track { font-size: .78rem; } table.portal-track th, table.portal-track td { padding: .3rem .28rem; }
  table.portal-track td:nth-child(2) { min-width: 6rem; } table.portal-track td:nth-child(15) { min-width: 5rem; }
  table.portal-track img.line-img { max-width: 52px; max-height: 52px; }
}

/* P2-A / P2-B: payment accounting block and the correction of a confirmed order */
.ord-pay { margin: .6rem 0; padding: .5rem .8rem; background: #f6fbf8; border: 1px solid var(--hlb-grid-border); border-radius: 4px; }
.ord-pay h3 { margin: .1rem 0 .4rem; font-size: 1rem; }
table.ord-pay-table { width: 100%; border-collapse: collapse; background: transparent; }
table.ord-pay-table th, table.ord-pay-table td { padding: .22rem .45rem; border: 0; border-bottom: 1px solid #e3ece6; text-align: left; font-weight: normal; }
table.ord-pay-table td.num { text-align: right; white-space: nowrap; font-weight: 600; width: 11rem; }
table.ord-pay-table td.muted { width: 14rem; font-size: .82rem; }
table.ord-pay-table tr.pay-head th { background: #e9f3ec; font-weight: 700; color: var(--hlb-primary-dark); }
table.ord-pay-table tr.pay-total th, table.ord-pay-table tr.pay-total td { font-weight: 700; font-size: 1.05rem; }
table.ord-pay-table tr.pay-paid td.num { color: var(--hlb-primary-dark); }
table.ord-pay-table tr.pay-due td.num, table.ord-pay-table tr.pay-excess td.num, table.ord-pay-table tr.pay-excess th { color: var(--hlb-error); }
.ord-revise { margin: .8rem 0; padding: .6rem .8rem; border: 2px solid var(--hlb-active); border-radius: 4px; background: #fffdf3; }
.ord-revise h3 { margin: .1rem 0 .3rem; }
.ord-revise label { display: block; margin: .3rem 0; } .ord-revise input[type=text], .ord-revise input:not([type]) { width: 100%; max-width: none; }
.ord-revise-preview ul { margin: .2rem 0 .4rem 1.1rem; padding: 0; } .ord-revise-preview .impact { margin: .25rem 0; padding: .3rem .5rem; border-radius: 3px; }
.ord-revise-preview .impact-ack { background: #fff1d6; border: 1px solid #e0b252; } .ord-revise-preview .impact-info { background: #eef4f0; }
.ord-history { margin: .6rem 0; } .ord-history summary { cursor: pointer; font-weight: 700; color: var(--hlb-primary-dark); }
.ord-history-item { margin: .4rem 0; padding: .4rem .6rem; border-left: 3px solid var(--hlb-active); background: #f8fbf9; } .ord-history-item ul { margin: .2rem 0 0 1.1rem; padding: 0; }
@media (max-width: 760px) { table.ord-pay-table td.num { width: auto; } table.ord-pay-table td.muted { display: none; } }
#ord-revise-preview { white-space: pre-line; }
.money-after table { margin: .3rem 0; border-collapse: collapse; }
.money-after th { text-align: left; font-weight: 600; padding: .15rem .6rem .15rem 0; }
.money-after td { padding: .15rem 0; }
.ord-revise-actions { margin: .5rem 0 0; display: flex; gap: .5rem; flex-wrap: wrap; }

table.portal-lines video.line-video, .portal-card video.line-video { display: block; width: 100%; max-width: 280px; max-height: 200px; margin: .25rem 0; background: #000; border-radius: 3px; }
table.portal-lines td img.line-img { margin: 0 .25rem .25rem 0; }

/* ---- U1: order entry — larger grid, calmer header, media tiles ---- */
.ord-editor { padding: .9rem 1.1rem; font-size: 1rem; }
.ord-editor h2 { margin: .1rem 0 .4rem; }
.ord-head { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: .7rem; align-items: start; }
.ord-group { border: 1px solid var(--hlb-grid-border); border-radius: 4px; padding: .4rem .8rem .6rem; margin: 0; min-width: 0; background: #fcfdfc; }
.ord-group legend { font-weight: 700; color: var(--hlb-primary-dark); padding: 0 .35rem; font-size: .95rem; }
.ord-group label { display: block; margin: .35rem 0; font-size: .92rem; }
.ord-head input, .ord-head select, .ord-head textarea { font-size: 1rem; padding: .45rem .55rem; }
.ord-head textarea { min-height: 3.2rem; }
.ord-lines-wrap { max-height: 78vh; }
table.ord-lines { font-size: 1rem; }
table.ord-lines thead th { font-size: .9rem; padding: .5rem .4rem; }
table.ord-lines input, textarea.ord-name { font-size: 1rem; padding: .55rem .5rem; }
table.ord-lines td { vertical-align: top; }
@media (min-width: 981px) {
  table.ord-lines th:nth-child(2) { width: auto; min-width: 16rem; }
  table.ord-lines th:nth-child(3) { width: 5.5rem; }
  table.ord-lines th:nth-child(4) { width: 6.5rem; }
  table.ord-lines th:nth-child(5) { width: 9rem; }
  table.ord-lines th:nth-child(6) { width: 13rem; }
  table.ord-lines th:nth-child(7) { width: 12rem; }
  table.ord-lines th:nth-child(8) { width: 8.5rem; }
}
.media-list { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .3rem; }
.media-tile { position: relative; width: 6.2rem; border: 1px solid var(--hlb-grid-border); border-radius: 4px; background: #fff; padding: .15rem; }
.media-tile.pending { border-style: dashed; }
.media-tile img.line-thumb, .media-tile video.line-video { display: block; width: 100%; height: 4.6rem; object-fit: cover; background: #000; border-radius: 3px; }
.media-tile .media-name { display: block; font-size: .72rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-tile .media-del { position: absolute; top: 2px; right: 2px; padding: 0 .35rem; min-height: 0; line-height: 1.3; font-size: .8rem; }
td.img-cell.media-drop, .ord-media.media-drop { outline: 2px dashed var(--hlb-active); outline-offset: -2px; background: var(--hlb-select-bg); }
.ord-media { margin: .6rem 0; padding: .5rem .8rem; border: 1px solid var(--hlb-grid-border); border-radius: 4px; background: #f6fbf8; }
.ord-media h3 { margin: .1rem 0 .4rem; font-size: 1rem; }
@media (max-width: 760px) { .media-tile { width: 5.2rem; } }

.ord-pay-history { margin-top: .6rem; } .ord-pay-history h4 { margin: .2rem 0; }
table.ord-pay-list { width: 100%; border-collapse: collapse; } table.ord-pay-list th, table.ord-pay-list td { text-align: left; padding: .3rem .5rem; border-bottom: 1px solid var(--hlb-grid-border); } table.ord-pay-list td.num, table.ord-pay-list th.num { text-align: right; }
tr.pay-reversed td { color: var(--hlb-muted); text-decoration: line-through; } tr.pay-reversed td:last-child { text-decoration: none; }
.ord-pay-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .4rem .8rem; margin: .5rem 0; padding: .6rem; background: #fff; border: 1px solid var(--hlb-grid-border); border-radius: 4px; } .ord-pay-form p { grid-column: 1 / -1; margin: .2rem 0; }

/* Gate 4: the money block — three figures first, then A / B / C; the plan is never styled like money received */
.ord-pay h3 { font-size: 1.05rem; }
.pay-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; margin: .2rem 0 .6rem; }
.pay-kpis .kpi { background: #fff; border: 1px solid var(--hlb-grid-border); border-radius: 6px; padding: .55rem .8rem; display: flex; flex-direction: column; gap: .1rem; }
.pay-kpis .kpi[hidden] { display: none; }
.kpi-label { text-transform: uppercase; letter-spacing: .03em; font-size: .78rem; font-weight: 700; color: var(--hlb-muted); }
.pay-kpis .kpi strong { font-size: 1.55rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.pay-kpis .kpi small { color: var(--hlb-muted); font-size: .8rem; min-height: 1em; }
.kpi-paid strong { color: var(--hlb-primary-dark); } .kpi-due.is-due strong { color: var(--hlb-error); }
.pay-excess { margin: 0 0 .5rem; padding: .3rem .6rem; background: var(--hlb-error-bg); color: var(--hlb-error); border-radius: 4px; }
.pay-group { margin: .4rem 0; border-top: 1px solid #e3ece6; padding-top: .3rem; }
.pay-group > summary { cursor: pointer; font-weight: 700; color: var(--hlb-primary-dark); padding: .2rem 0; }
.pay-tag { font-weight: normal; font-size: .78rem; background: #eef2ee; border-radius: 999px; padding: .05rem .5rem; color: var(--hlb-muted); margin-left: .4rem; }
.pay-actual-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; } .pay-actual-head h4 { margin: .1rem 0; font-size: 1rem; color: var(--hlb-primary-dark); }
.pay-list-wrap { max-height: 16rem; overflow: auto; border: 1px solid var(--hlb-grid-border); border-radius: 4px; background: #fff; }
.pay-list-wrap thead th { position: sticky; top: 0; background: var(--hlb-header-bg); }
label.pay-confirm { grid-column: 1 / -1; display: flex; align-items: center; gap: .5rem; }
@media (max-width: 760px) { .pay-kpis { grid-template-columns: 1fr; } .pay-kpis .kpi strong { font-size: 1.3rem; } }
/* ===== Release 1 ===== */
/* Laravel's default pagination view draws its arrows as <svg class="w-5 h-5"> and lays out with Tailwind utility classes; HLB loads no Tailwind, so the arrows had no size.
   Scoped to the pagination component only (never a global svg rule). */
nav[role="navigation"][aria-label] { margin: .6rem 0; }
nav[role="navigation"][aria-label] svg { width: 1.25rem; height: 1.25rem; flex: none; vertical-align: middle; }
nav[role="navigation"][aria-label] > div:first-child { display: none; }
nav[role="navigation"][aria-label] > div:last-child { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; }
nav[role="navigation"][aria-label] > div:last-child > div:last-child > span { display: inline-flex; flex-wrap: wrap; gap: .25rem; align-items: center; }
nav[role="navigation"][aria-label] a, nav[role="navigation"][aria-label] span[aria-disabled="true"] > span, nav[role="navigation"][aria-label] span[aria-current="page"] > span { display: inline-flex; align-items: center; min-width: 2rem; justify-content: center; padding: .2rem .55rem; border: 1px solid var(--hlb-grid-border); border-radius: 4px; text-decoration: none; background: #fff; line-height: 1.3; }
nav[role="navigation"][aria-label] span[aria-current="page"] > span { background: var(--hlb-primary); color: #fff; border-color: var(--hlb-primary); }
nav[role="navigation"][aria-label] span[aria-disabled="true"] > span { color: var(--hlb-muted); background: #f4f6f4; }
@media (max-width: 639px) {
  nav[role="navigation"][aria-label] > div:first-child { display: flex; justify-content: space-between; gap: .5rem; }
  nav[role="navigation"][aria-label] > div:first-child a, nav[role="navigation"][aria-label] > div:first-child > span { display: inline-flex; align-items: center; padding: .35rem .8rem; border: 1px solid var(--hlb-grid-border); border-radius: 4px; background: #fff; text-decoration: none; }
  nav[role="navigation"][aria-label] > div:last-child { display: none; }
}
.chip-excess { display: inline-block; margin: .1rem 0; padding: .05rem .5rem; border-radius: 999px; background: var(--hlb-error-bg); color: var(--hlb-error); font-weight: 700; font-size: .8rem; white-space: nowrap; }
.line-note { white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; }
table.portal-lines td { white-space: normal; }
textarea.ord-note { min-height: 2.1rem; }
.ord-created { margin-left: .5rem; font-size: .85rem; color: var(--hlb-muted); }
label.pay-over { grid-column: 1 / -1; display: flex; gap: .5rem; align-items: flex-start; padding: .45rem .6rem; background: var(--hlb-error-bg); color: var(--hlb-error); border: 1px solid var(--hlb-error); border-radius: 4px; }
label.pay-over[hidden] { display: none; }
.home-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .8rem; margin: .6rem 0 1rem; }
.home-tile { display: flex; flex-direction: column; gap: .3rem; padding: 1rem 1.1rem; background: #fff; border: 1px solid var(--hlb-grid-border); border-radius: 8px; text-decoration: none; color: inherit; min-height: 6.5rem; }
.home-tile strong { font-size: 1.15rem; color: var(--hlb-primary-dark); } .home-tile:hover, .home-tile:focus { border-color: var(--hlb-primary); box-shadow: 0 0 0 2px var(--hlb-select-bg); }
.home-more { margin-top: 1rem; } .home-more > summary { cursor: pointer; font-weight: 700; color: var(--hlb-primary-dark); margin-bottom: .5rem; }
.lookup-note { margin: .2rem 0 .6rem; } a.ws-lookup { white-space: nowrap; font-weight: 700; }
/* ===== R2: Excel-like order list (/workspace/orders) — scoped to table.ord-list ===== */
.ws-scroll-top { overflow-x: scroll; overflow-y: hidden; height: 17px; margin: .3rem 0 0; border: 1px solid var(--hlb-grid-border); border-bottom: 0; background: #e3ece5; scrollbar-color: var(--hlb-primary) #cfdcd2; }
.ws-scroll-top[hidden] { display: none; }
.ws-scroll-top > div { height: 1px; }
.ws-scroll-top::-webkit-scrollbar, #ord-scroll::-webkit-scrollbar { height: 14px; width: 14px; }
.ws-scroll-top::-webkit-scrollbar-track, #ord-scroll::-webkit-scrollbar-track { background: #cfdcd2; }
.ws-scroll-top::-webkit-scrollbar-thumb, #ord-scroll::-webkit-scrollbar-thumb { background: var(--hlb-primary); border-radius: 7px; border: 2px solid #cfdcd2; }
button.ord-cols-reset { display: block; margin: .1rem 0 .2rem auto; padding: .1rem .6rem; font-size: .82rem; }
table.ord-list.ord-fixed { table-layout: fixed; min-width: 0; }
table.ord-list.ord-fixed th, table.ord-list.ord-fixed td { overflow: hidden; text-overflow: ellipsis; }
table.ord-list.ord-fixed tr.ws-detail > td { overflow-x: auto; max-width: none; text-overflow: clip; }
table.ord-list thead th { position: sticky; }
span.col-resizer { position: absolute; top: 0; right: 0; width: 9px; height: 100%; cursor: col-resize; touch-action: none; user-select: none; z-index: 8; }
span.col-resizer::after { content: ""; position: absolute; top: 18%; bottom: 18%; right: 3px; width: 2px; border-radius: 1px; background: rgba(0, 0, 0, .28); }
span.col-resizer:hover::after, span.col-resizer.dragging::after, span.col-resizer:focus::after { background: var(--hlb-active); width: 3px; right: 2px; }
span.col-resizer:focus { outline: none; }
body.col-resizing { cursor: col-resize; user-select: none; }
@media (min-width: 761px) {
  /* Mã đơn and Khách hàng stay in view while the rest of the row scrolls: sticky, opaque, above their neighbours */
  table.ord-list th.frz, table.ord-list td.frz { position: sticky; }
  table.ord-list td.frz { z-index: 4; background: var(--hlb-table-bg); }
  table.ord-list th.frz { z-index: 6; }
  table.ord-list .frz-code { left: 0; }
  table.ord-list .frz-customer { left: var(--ord-code-w, 8rem); box-shadow: 3px 0 4px -2px rgba(0, 0, 0, .28); }
  table.ord-list .frz-code { box-shadow: 1px 0 0 var(--hlb-grid-border); }
}
@media (max-width: 760px) {
  /* small screens: nothing is frozen and nothing is resized by hand, the table just scrolls inside its frame */
  span.col-resizer, button.ord-cols-reset { display: none; }
  table.ord-list th.frz, table.ord-list td.frz { position: static; }
}/* the customer grid's rules for the first two header cells (sticky, widths) must not leak into the order list: only Mã đơn and Khách hàng are frozen here */
table.ord-list thead tr:first-child th:nth-child(1), table.ord-list thead tr:first-child th:nth-child(2) { left: auto; z-index: 3; min-width: 0; width: auto; box-shadow: none; background: var(--hlb-header-bg); }
table.ord-list thead tr:first-child th.frz-code { left: 0; z-index: 6; }
table.ord-list thead tr:first-child th.frz-customer { left: var(--ord-code-w, 8rem); z-index: 6; }
