/* cont-218: AUTO-GENERATED from styles.css by scripts/build_inline_css.py — DO NOT EDIT. */

@media (max-width: 640px) {
  .content { padding: .8rem; }
  .page-head h2 { font-size: 18px; }
  /* the head action row owns a full line; fixed-width inputs (the dashboard's
     style="width:360px" search) shrink to it instead of overflowing */
  .head-actions { width: 100%; margin-left: 0; flex-wrap: wrap; }
  .head-actions input, .head-actions select { width: 100% !important; flex: 1 1 160px; min-width: 0; }
  /* iOS zooms any focused input whose font is smaller than 16px — 16 everywhere */
  input, select, textarea, .combo-input { font-size: 16px; }
  /* tighter cells so more columns fit before the sideways scroll starts */
  th, td { padding: .45rem .5rem; font-size: 13px; }
  th { font-size: 11px; }
  /* comfortable tap targets */
  .btn { padding: .5rem .85rem; }
  .btn.small { padding: .45rem .7rem; }
  .nav-item { padding: .65rem 1rem .65rem 1.25rem; }
  /* filter rows: every control takes a comfortable width and wraps */
  .filters input, .filters select, .filters .combo { flex: 1 1 150px; min-width: 130px; }
  /* cont-220: wrapped pickers must size like every other field — the later
     desktop .filters .combo rule (flex:0 1 auto) otherwise lets the combo
     input's intrinsic width paint over the neighbouring field */
  .filters .combo.combo { flex: 1 1 150px; min-width: 150px; max-width: 100%; }
  .filters .combo.combo > .combo-input { width: 100%; max-width: 100%; min-width: 0; }
  /* the bill line stacks: the item picker owns row 1, qty · rate · amount · ✕
     share row 2 — no more 60px-wide selects on a 360px screen */
  .line { grid-template-columns: 1fr 1fr 1fr 32px; }
  .line > *:first-child { grid-column: 1 / -1; }
  .cost-line { grid-template-columns: 1fr 110px 32px; }
  .prod-mat { grid-template-columns: 1fr 1fr 32px; }
  /* the receive/production popups' fixed 130px qty column (page-scoped
     styles) — same stack: picker full row, qty + ✕ under it. The body
     prefix out-specifies the page-injected <style> blocks. */
  body #fr-modal .fr-line, body #mu-modal .mu-line,
  body #prod-modal .prod-line, body #sfr-modal .sfr-line { grid-template-columns: 1fr 110px 32px; }
  body #fr-modal .fr-line > *:first-child, body #mu-modal .mu-line > *:first-child,
  body #prod-modal .prod-line > *:first-child, body #sfr-modal .sfr-line > *:first-child { grid-column: 1 / -1; }
  body #fr-modal .fr-meta, body #mu-modal .mu-meta,
  body #prod-modal .prod-meta, body #sfr-modal .sfr-meta { grid-template-columns: 1fr; }
  .totals-bar { flex-wrap: wrap; gap: .5rem 1.2rem; }
  .combo-menu { max-width: min(92vw, 340px); }
  .cards { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); }
  .card-value { font-size: 19px; }
  /* slim topbar: the avatar carries the identity, the name text goes */
  #user-name { display: none; }
  /* toasts span the width instead of pinching in the middle */
  .toast { left: .6rem; right: .6rem; transform: none; max-width: none; text-align: center; }
}

@media (max-width: 640px) {
  /* cont-193/194: filter order on phones — search, status, date from, date
     to, then the remaining buttons; the Date from / Date to placeholders are
     the required+placeholder overlay from cont-209 */
  #page-bills .filters > #bill-search { order: 1; }
  #page-bills .filters > #bill-status { order: 2; }
  #page-bills .filters > #bill-from { order: 3; }
  #page-bills .filters > #bill-to { order: 4; }
  #page-bills .filters > #bill-today { order: 5; }
  #page-bills .filters > #bill-reset { order: 6; }
  #page-bills table.bills-list { display: block; }
  #page-bills table.bills-list thead { display: none; }
  #page-bills table.bills-list tbody { display: block; }
  #page-bills table.bills-list tbody tr {
    display: grid;
    /* col1 is min-content so the "Approved Modified" tip (which sits under the
       bill no) cannot widen the column and push the comma off the number;
       col4 caps at 46vw so a long button row wraps instead of clipping the
       net amount / buttons off the right edge */
    grid-template-columns: min-content max-content minmax(0, 1fr) minmax(auto, 46vw);
    gap: 2px 0;
    padding: 10px 12px;
  }
  #page-bills table.bills-list tbody tr + tr { border-top: 1px solid var(--line); }
  #page-bills table.bills-list tbody tr td { border: 0; padding: 0; background: none; }
  /* LEFT · line 1: bill no + comma + date (the comma rides in front of the
     date — after the number there may be the "Approved Modified" tip).
     nowrap on the number: min-content sizing must not break it at the
     hyphen (FB- / 0142). */
  #page-bills table.bills-list tbody tr td:nth-child(1) { grid-area: 1 / 1; }
  #page-bills table.bills-list tbody tr td:nth-child(1) strong { white-space: nowrap; }
  #page-bills table.bills-list tbody tr td:nth-child(2) { grid-area: 1 / 2; }
  #page-bills table.bills-list tbody tr td:nth-child(2)::before { content: ', '; font-weight: 400; }
  /* LEFT · line 2: customer name (cont-193: swapped with ordered-by — the
     owner wants customer | status on one line, ordered-by below) */
  #page-bills table.bills-list tbody tr td:nth-child(4) {
    grid-area: 2 / 1 / 3 / 4; font-weight: 600;
  }
  /* RIGHT · line 1: the net amount */
  #page-bills table.bills-list tbody tr td:nth-child(5) {
    grid-area: 1 / 4; justify-self: end;
    font-weight: 600; white-space: nowrap;
  }
  #page-bills table.bills-list tbody tr td:nth-child(3) {
    grid-area: 2 / 4; justify-self: end; text-align: right;
    font-size: 12.5px;
  }
  #page-bills table.bills-list tbody tr .badge {
    background: transparent; padding: 0; font-weight: 400;
    font-style: italic; font-size: 12.5px;
  }
  /* line 3: ordered by (quiet) */
  #page-bills table.bills-list tbody tr td:nth-child(6) {
    grid-area: 3 / 1 / 4 / 4;
    font-size: 11px; color: var(--muted); font-style: italic;
  }
  #page-bills table.bills-list tbody tr td:nth-child(6)::before { content: 'Ordered by '; }
  /* line 4: the buttons, one row, right aligned */
  #page-bills table.bills-list tbody tr td:nth-child(7) {
    grid-area: 4 / 1 / 5 / -1; text-align: right;
    white-space: normal;
  }
  #page-bills table.bills-list tbody tr td:nth-child(7) .btn { margin: 2px 0 2px .3rem; }
  /* full-width informational rows (empty list message, deleted-bill reason —
     row 2, directly under the no/date line, so no blank row in between).
     cont-193: the message cell IS the status cell positionally, so the
     status mapping's justify-self/text-align leak onto it — stretch it back
     and keep the deletion message LEFT aligned (owner request) */
  #page-bills table.bills-list tbody tr td[colspan] {
    grid-area: 2 / 1 / 3 / -1 !important;
    justify-self: stretch; text-align: left;
  }
}

@media (max-width: 640px) {
  .filters input[type="date"] { position: relative; }
  .filters input[type="date"]:not(:valid)::before {
    content: attr(placeholder); position: absolute; left: 12px; top: 50%;
    transform: translateY(-50%); color: var(--muted); pointer-events: none;
  }
  /* browsers that DO draw the native mm/dd/yyyy ghost (desktop Chrome,
     Android) must not double it up with the overlay */
  .filters input[type="date"]:not(:valid)::-webkit-datetime-edit { color: transparent; }
  #page-statement table, #page-ledger table, #page-mycustomerreport table { display: block; }
  #page-statement table thead, #page-ledger table thead,
  #page-mycustomerreport table thead { display: none; }
  #page-statement table tbody, #page-ledger table tbody,
  #page-mycustomerreport table tbody { display: block; }
  #page-statement table tbody tr, #page-ledger table tbody tr,
  #page-mycustomerreport table tbody tr {
    display: grid;
    grid-template-columns: max-content max-content minmax(0, 1fr) minmax(auto, 46vw);
    gap: 2px 0;
    padding: 10px 12px;
  }
  #page-statement table tbody tr + tr, #page-ledger table tbody tr + tr,
  #page-mycustomerreport table tbody tr + tr { border-top: 1px solid var(--line); }
  #page-statement table tbody tr td, #page-ledger table tbody tr td,
  #page-mycustomerreport table tbody tr td { border: 0; padding: 0; background: none; }
  /* LEFT · line 1: date · type */
  #page-statement table tbody tr td:nth-child(1), #page-ledger table tbody tr td:nth-child(1),
  #page-mycustomerreport table tbody tr td:nth-child(1) { grid-area: 1 / 1; font-weight: 600; white-space: nowrap; }
  #page-statement table tbody tr td:nth-child(2), #page-ledger table tbody tr td:nth-child(2),
  #page-mycustomerreport table tbody tr td:nth-child(2) { grid-area: 1 / 2; font-size: 12.5px; }
  #page-statement table tbody tr td:nth-child(2)::before, #page-ledger table tbody tr td:nth-child(2)::before,
  #page-mycustomerreport table tbody tr td:nth-child(2)::before { content: ' ·  '; }
  /* the type chip renders as plain italic text in its color (bills-status style) */
  #page-statement table tbody tr .chip, #page-ledger table tbody tr .chip,
  #page-mycustomerreport table tbody tr .chip {
    background: transparent; border: 0; padding: 0;
    font-weight: 400; font-style: italic; font-size: 12.5px;
  }
  /* LEFT · line 2: description, line 3: reference */
  #page-statement table tbody tr td:nth-child(4), #page-ledger table tbody tr td:nth-child(4),
  #page-mycustomerreport table tbody tr td:nth-child(4) { grid-area: 2 / 1 / 3 / 4; font-weight: 600; }
  #page-statement table tbody tr td:nth-child(3), #page-ledger table tbody tr td:nth-child(3),
  #page-mycustomerreport table tbody tr td:nth-child(3) {
    grid-area: 3 / 1 / 4 / 4;
    font-size: 11px; color: var(--muted); font-style: italic;
  }
  #page-statement table tbody tr td:nth-child(3)::before, #page-ledger table tbody tr td:nth-child(3)::before,
  #page-mycustomerreport table tbody tr td:nth-child(3)::before { content: 'Ref: '; }
  /* RIGHT · debit / credit / balance, tagged so the dashes stay meaningful */
  #page-statement table tbody tr td:nth-child(5), #page-ledger table tbody tr td:nth-child(5),
  #page-mycustomerreport table tbody tr td:nth-child(5),
  #page-statement table tbody tr td:nth-child(6), #page-ledger table tbody tr td:nth-child(6),
  #page-mycustomerreport table tbody tr td:nth-child(6),
  #page-statement table tbody tr td:nth-child(7), #page-ledger table tbody tr td:nth-child(7),
  #page-mycustomerreport table tbody tr td:nth-child(7) { font-weight: 600; white-space: nowrap; }
  #page-statement table tbody tr td:nth-child(5), #page-ledger table tbody tr td:nth-child(5),
  #page-mycustomerreport table tbody tr td:nth-child(5) { grid-area: 1 / 4; justify-self: end; }
  #page-statement table tbody tr td:nth-child(6), #page-ledger table tbody tr td:nth-child(6),
  #page-mycustomerreport table tbody tr td:nth-child(6) { grid-area: 2 / 4; justify-self: end; }
  #page-statement table tbody tr td:nth-child(7), #page-ledger table tbody tr td:nth-child(7),
  #page-mycustomerreport table tbody tr td:nth-child(7) { grid-area: 3 / 4; justify-self: end; }
  #page-statement table tbody tr td:nth-child(5)::before, #page-ledger table tbody tr td:nth-child(5)::before,
  #page-mycustomerreport table tbody tr td:nth-child(5)::before { content: 'Dr '; color: var(--muted); font-weight: 400; font-size: 11px; }
  #page-statement table tbody tr td:nth-child(6)::before, #page-ledger table tbody tr td:nth-child(6)::before,
  #page-mycustomerreport table tbody tr td:nth-child(6)::before { content: 'Cr '; color: var(--muted); font-weight: 400; font-size: 11px; }
  #page-statement table tbody tr td:nth-child(7)::before, #page-ledger table tbody tr td:nth-child(7)::before,
  #page-mycustomerreport table tbody tr td:nth-child(7)::before { content: 'Bal '; color: var(--muted); font-weight: 400; font-size: 11px; }
  /* full-width informational rows, should any appear */
  #page-statement table tbody tr td[colspan], #page-ledger table tbody tr td[colspan],
  #page-mycustomerreport table tbody tr td[colspan] { grid-column: 1 / -1 !important; }
}

@media (max-width: 640px) {
  #page-queue table.m-list, #page-returns table.m-list, #page-delivery table.m-list,
  #page-discounts table.m-list, #page-expenses table.m-list, #page-payments table.m-list,
  #page-transfers table.m-list { display: block; }
  #page-queue table.m-list thead, #page-returns table.m-list thead,
  #page-delivery table.m-list thead, #page-discounts table.m-list thead,
  #page-expenses table.m-list thead, #page-payments table.m-list thead,
  #page-transfers table.m-list thead { display: none; }
  #page-queue table.m-list tbody, #page-returns table.m-list tbody,
  #page-delivery table.m-list tbody, #page-discounts table.m-list tbody,
  #page-expenses table.m-list tbody, #page-payments table.m-list tbody,
  #page-transfers table.m-list tbody { display: block; }
  #page-queue table.m-list tbody tr, #page-returns table.m-list tbody tr,
  #page-delivery table.m-list tbody tr, #page-discounts table.m-list tbody tr,
  #page-expenses table.m-list tbody tr, #page-payments table.m-list tbody tr,
  #page-transfers table.m-list tbody tr {
    display: grid;
    grid-template-columns: min-content max-content minmax(0, 1fr) minmax(auto, 46vw);
    gap: 2px 0;
    padding: 10px 12px;
  }
  #page-queue table.m-list tbody tr + tr, #page-returns table.m-list tbody tr + tr,
  #page-delivery table.m-list tbody tr + tr, #page-discounts table.m-list tbody tr + tr,
  #page-expenses table.m-list tbody tr + tr, #page-payments table.m-list tbody tr + tr,
  #page-transfers table.m-list tbody tr + tr { border-top: 1px solid var(--line); }
  #page-queue table.m-list tbody tr td, #page-returns table.m-list tbody tr td,
  #page-delivery table.m-list tbody tr td, #page-discounts table.m-list tbody tr td,
  #page-expenses table.m-list tbody tr td, #page-payments table.m-list tbody tr td,
  #page-transfers table.m-list tbody tr td { border: 0; padding: 0; background: none; }
  /* cont-194: per-page filter order on phones — search/type first, then the
     dates, then the remaining controls */
  #page-returns .filters > #ret-search { order: 1; }
  #page-returns .filters > #ret-status { order: 2; }
  #page-returns .filters > #ret-from { order: 3; }
  #page-returns .filters > #ret-to { order: 4; }
  #page-returns .filters > #ret-today { order: 5; }
  #page-returns .filters > #ret-reset { order: 6; }
  #page-delivery .filters > #dlv-from { order: 1; }
  #page-delivery .filters > #dlv-to { order: 2; }
  #page-delivery .filters > #dlv-search { order: 3; }
  #page-delivery .filters > #dlv-today { order: 4; }
  #page-delivery .filters > #dlv-reset { order: 5; }
  #page-payments .filters > #pay-search { order: 1; }
  #page-payments .filters > #pay-account { order: 2; }
  #page-payments .filters > #pay-from { order: 3; }
  #page-payments .filters > #pay-to { order: 4; }
  #page-payments .filters > #pay-status { order: 5; }
  #page-payments .filters > #pay-today { order: 6; }
  #page-payments .filters > #pay-reset { order: 7; }
  #page-discounts .filters > #dis-search { order: 1; }
  #page-discounts .filters > #dis-type { order: 2; }
  #page-discounts .filters > #dis-from { order: 3; }
  #page-discounts .filters > #dis-to { order: 4; }
  #page-discounts .filters > #dis-status { order: 5; }
  #page-discounts .filters > #dis-today { order: 6; }
  #page-discounts .filters > #dis-reset { order: 7; }
  #page-expenses .filters > #exp-search { order: 1; }
  #page-expenses .filters > #exp-cat { order: 2; }
  #page-expenses .filters > #exp-from { order: 3; }
  #page-expenses .filters > #exp-to { order: 4; }
  #page-expenses .filters > #exp-status { order: 5; }
  #page-expenses .filters > #exp-acc { order: 6; }
  #page-expenses .filters > #exp-today { order: 7; }
  #page-expenses .filters > #exp-reset { order: 8; }
  #page-expenses .filters > #exp-print { order: 9; }
  #page-transfers .filters > #tr-search { order: 1; }
  #page-transfers .filters > #tr-account-filter { order: 2; }
  #page-transfers .filters > #tr-from { order: 3; }
  #page-transfers .filters > #tr-to { order: 4; }
  #page-transfers .filters > #tr-status { order: 5; }
  #page-transfers .filters > #tr-today { order: 6; }
  #page-transfers .filters > #tr-reset { order: 7; }
  /* status chips/badges → plain italic text in their color (bills style) */
  #page-queue table.m-list .badge, #page-returns table.m-list .badge,
  #page-delivery table.m-list .badge, #page-discounts table.m-list .badge,
  #page-expenses table.m-list .badge, #page-payments table.m-list .badge,
  #page-transfers table.m-list .badge, #page-purchases table.m-list .badge,
  #page-localpurchase table.m-list .badge, #page-supplierpayments table.m-list .badge,
  #page-users table.m-list .badge {
    background: transparent; border: 0; padding: 0;
    font-weight: 400; font-style: italic; font-size: 12.5px;
  }
  /* the queue's "limit exceeds" credit chip rides under the net amount */
  #page-queue table.m-list .over-chip {
    background: transparent; border: 0; padding: 0;
    font-weight: 400; font-style: italic; font-size: 11px;
  }
  /* buttons wrap under the amount instead of stretching the row */
  #page-queue table.m-list td.actions, #page-returns table.m-list td.actions,
  #page-delivery table.m-list td.actions, #page-discounts table.m-list td.actions,
  #page-expenses table.m-list td.actions, #page-payments table.m-list td.actions,
  #page-transfers table.m-list td.actions {
    white-space: normal; max-width: 46vw; text-align: right;
  }
  #page-queue table.m-list td.actions .btn, #page-returns table.m-list td.actions .btn,
  #page-delivery table.m-list td.actions .btn, #page-discounts table.m-list td.actions .btn,
  #page-expenses table.m-list td.actions .btn, #page-payments table.m-list td.actions .btn,
  #page-transfers table.m-list td.actions .btn { margin: 1px 0 1px .3rem; }
  /* full-width informational (deleted) rows */
  #page-queue table.m-list td[colspan], #page-returns table.m-list td[colspan],
  #page-delivery table.m-list td[colspan], #page-discounts table.m-list td[colspan],
  #page-expenses table.m-list td[colspan], #page-payments table.m-list td[colspan],
  #page-transfers table.m-list td[colspan] { grid-column: 1 / -1 !important; }

  /* ---- APPROVAL QUEUE (cont-194 re-map): line 1 = customer | net (the
     "limit exceeds" chip stacks BELOW the amount), line 2 = date with time,
     line 3 = ordered by, line 4 = notes (full width, left, quiet), line 5 =
     the buttons in ONE line right-aligned with the short View / Appr / Rej /
     Del labels ---- */
  #page-queue table.m-list tbody tr td:nth-child(2) { grid-area: 1 / 1 / 2 / 4; font-weight: 600; }
  #page-queue table.m-list tbody tr td:nth-child(4) {
    grid-area: 1 / 4; justify-self: end;
    font-weight: 600; white-space: nowrap;
    /* the amount text node and the over-chip stack vertically, right aligned */
    display: flex; flex-direction: column; align-items: flex-end; gap: 1px;
  }
  #page-queue table.m-list tbody tr td:nth-child(1) { grid-area: 2 / 1 / 3 / 5; white-space: nowrap; }
  /* ordered by + notes: the same quiet grey italics as the bills cards */
  #page-queue table.m-list tbody tr td:nth-child(3),
  #page-queue table.m-list tbody tr td:nth-child(5) {
    font-size: 11px; color: var(--muted); font-style: italic;
  }
  #page-queue table.m-list tbody tr td:nth-child(3) { grid-area: 3 / 1 / 4 / 5; }
  #page-queue table.m-list tbody tr td:nth-child(3)::before { content: 'Ordered by '; }
  #page-queue table.m-list tbody tr td:nth-child(5) { grid-area: 4 / 1 / 5 / -1; text-align: left; }
  #page-queue table.m-list tbody tr td:nth-child(5)::before { content: 'Notes: '; }
  /* the buttons: ONE line, left to right, right-aligned — the shared block's
     46vw cap and wrapping are undone for the queue only */
  #page-queue table.m-list td.actions { white-space: nowrap; max-width: none; }
  #page-queue table.m-list tbody tr td:nth-child(6) { grid-area: 5 / 1 / 6 / -1; }
  #page-queue .blong { display: none; }
  #page-queue .bmini { display: inline; }
  /* filters on phones: search → bill types → date from → date to → reset
     (the Date from / Date to placeholders are the cont-209 overlay) */
  #page-queue .filters > #q-search { order: 1; }
  #page-queue .filters > #q-credit { order: 2; }
  #page-queue .filters > #q-from { order: 3; }
  #page-queue .filters > #q-to { order: 4; }
  #page-queue .filters > #q-reset { order: 5; }

  /* ---- SALES RETURNS (cont-194 re-map): line 1 = no, date | total;
     line 2 = customer | status; line 3 = "Received by X against bill no Y"
     (the against-bill no rides in a data attribute; without a bill the line
     reads just "Received by X") — quiet grey italics; line 4 = buttons ---- */
  #page-returns table.m-list tbody tr td:nth-child(1) { grid-area: 1 / 1; font-weight: 600; }
  #page-returns table.m-list tbody tr td:nth-child(1) strong { white-space: nowrap; }
  /* pending returns carry a muted dash instead of a number — hide it so the
     date reads clean; the comma only appears when a number exists */
  #page-returns table.m-list tbody tr td:nth-child(1):not(:has(strong)) { visibility: hidden; }
  #page-returns table.m-list tbody tr td:nth-child(1):has(strong) ~ td:nth-child(2)::before { content: ', '; }
  #page-returns table.m-list tbody tr td:nth-child(2) { grid-area: 1 / 2; white-space: nowrap; }
  #page-returns table.m-list tbody tr td:nth-child(5) { grid-area: 1 / 4; justify-self: end; font-weight: 600; white-space: nowrap; }
  #page-returns table.m-list tbody tr td:nth-child(3) { grid-area: 2 / 1 / 3 / 4; font-weight: 600; }
  #page-returns table.m-list tbody tr td:nth-child(7) { grid-area: 2 / 4; justify-self: end; font-size: 12.5px; }
  #page-returns table.m-list tbody tr td:nth-child(6) {
    grid-area: 3 / 1 / 4 / -1; text-align: left;
    font-size: 11px; color: var(--muted); font-style: italic;
  }
  #page-returns table.m-list tbody tr td:nth-child(6)::before { content: 'Received by '; }
  #page-returns table.m-list tbody tr td:nth-child(6)[data-bill]::after { content: ' against bill no ' attr(data-bill); }
  /* the Against Bill No column is redundant on phones — its number is already
     woven into the received-by line */
  #page-returns table.m-list tbody tr td:nth-child(4) { display: none; }
  #page-returns table.m-list tbody tr td:nth-child(8) {
    grid-area: 4 / 1 / 5 / -1; max-width: none; white-space: nowrap; text-align: right;
  }

  /* ---- DELIVERY (cont-194 re-map): line 1 = no, date | total;
     line 2 = customer | "pending delivery"; line 3 = buttons right-aligned
     with the short mobile labels (View / Confirm) ---- */
  #page-delivery table.m-list tbody tr td:nth-child(1) { grid-area: 1 / 1; }
  #page-delivery table.m-list tbody tr td:nth-child(1) strong { white-space: nowrap; }
  #page-delivery table.m-list tbody tr td:nth-child(2) { grid-area: 1 / 2; }
  #page-delivery table.m-list tbody tr td:nth-child(2)::before { content: ', '; font-weight: 400; }
  #page-delivery table.m-list tbody tr td:nth-child(5) { grid-area: 1 / 4; justify-self: end; font-weight: 600; white-space: nowrap; }
  #page-delivery table.m-list tbody tr td:nth-child(4) { grid-area: 2 / 1 / 3 / 4; font-weight: 600; }
  #page-delivery table.m-list tbody tr td:nth-child(3) { grid-area: 2 / 4; justify-self: end; font-size: 12.5px; }
  #page-delivery table.m-list tbody tr td:nth-child(6) {
    grid-area: 3 / 1 / 4 / -1; max-width: none; white-space: nowrap; text-align: right;
  }
  #page-delivery .blong { display: none; }
  #page-delivery .bmini { display: inline; }

  /* ---- VOUCHERS shared: no, date | amount | main text · buttons | status |
     quiet facts (discounts: type · expenses: paid from + spent by ·
     payments: received in + collected by · transfers: from → to) ---- */
  #page-discounts table.m-list tbody tr td:nth-child(1),
  #page-expenses table.m-list tbody tr td:nth-child(1),
  #page-payments table.m-list tbody tr td:nth-child(1),
  #page-transfers table.m-list tbody tr td:nth-child(1) { grid-area: 1 / 1; font-weight: 600; }
  #page-discounts table.m-list tbody tr td:nth-child(1) strong,
  #page-expenses table.m-list tbody tr td:nth-child(1) strong,
  #page-payments table.m-list tbody tr td:nth-child(1) strong,
  #page-transfers table.m-list tbody tr td:nth-child(1) strong { white-space: nowrap; }
  /* draft vouchers carry a muted dash instead of a number — hide it; the
     comma only appears when the voucher has a number */
  #page-discounts table.m-list tbody tr td:nth-child(1):not(:has(strong)),
  #page-expenses table.m-list tbody tr td:nth-child(1):not(:has(strong)),
  #page-payments table.m-list tbody tr td:nth-child(1):not(:has(strong)),
  #page-transfers table.m-list tbody tr td:nth-child(1):not(:has(strong)) { visibility: hidden; }
  #page-discounts table.m-list tbody tr td:nth-child(1):has(strong) ~ td:nth-child(2)::before,
  #page-expenses table.m-list tbody tr td:nth-child(1):has(strong) ~ td:nth-child(2)::before,
  #page-payments table.m-list tbody tr td:nth-child(1):has(strong) ~ td:nth-child(2)::before,
  #page-transfers table.m-list tbody tr td:nth-child(1):has(strong) ~ td:nth-child(2)::before { content: ', '; }
  #page-discounts table.m-list tbody tr td:nth-child(2),
  #page-expenses table.m-list tbody tr td:nth-child(2),
  #page-payments table.m-list tbody tr td:nth-child(2),
  #page-transfers table.m-list tbody tr td:nth-child(2) { grid-area: 1 / 2; white-space: nowrap; }
  #page-discounts table.m-list tbody tr td:nth-child(5),
  #page-expenses table.m-list tbody tr td:nth-child(4),
  #page-payments table.m-list tbody tr td:nth-child(5),
  #page-transfers table.m-list tbody tr td:nth-child(5) {
    grid-area: 1 / 4; justify-self: end; white-space: nowrap;
  }
  #page-discounts table.m-list tbody tr td:nth-child(7),
  #page-expenses table.m-list tbody tr td:nth-child(8),
  #page-payments table.m-list tbody tr td:nth-child(8),
  #page-transfers table.m-list tbody tr td:nth-child(7) { grid-area: 2 / 4; justify-self: end; }
  #page-discounts table.m-list tbody tr td:nth-child(3),
  #page-payments table.m-list tbody tr td:nth-child(3) { grid-area: 2 / 1 / 3 / 4; font-weight: 600; }
  #page-expenses table.m-list tbody tr td:nth-child(3) { grid-area: 2 / 1 / 3 / 4; font-weight: 600; }
  /* cont-195 TRANSFERS (journal contra) re-map: line 2 = "from account →
     to account" with NO labels (the to-account rides in a data attribute —
     the To column is redundant on phones) | status right, line 3 = buttons */
  #page-transfers table.m-list tbody tr td:nth-child(3):not(.void-msg) {
    grid-area: 2 / 1 / 3 / 4; font-weight: 600; text-align: left;
  }
  #page-transfers table.m-list tbody tr td:nth-child(3):not(.void-msg)[data-to]::after {
    content: ' → ' attr(data-to);
  }
  #page-transfers table.m-list tbody tr td:nth-child(4) { display: none; }
  #page-transfers table.m-list tbody tr td:nth-child(6) {
    grid-area: 2 / 4; justify-self: end; font-size: 12.5px; font-style: italic;
  }
  #page-transfers table.m-list tbody tr td:nth-child(7) {
    grid-area: 3 / 1 / 4 / -1; max-width: none; white-space: nowrap; text-align: right;
  }
  /* status gets its own line, then the quiet facts (transfers: line 4 —
     its To-account occupies line 3) */
  #page-discounts table.m-list tbody tr td:nth-child(6),
  #page-expenses table.m-list tbody tr td:nth-child(7),
  #page-payments table.m-list tbody tr td:nth-child(7) {
    grid-area: 3 / 1 / 4 / 4; font-size: 12.5px; font-style: italic;
  }

  #page-discounts table.m-list tbody tr td:nth-child(4),
  #page-expenses table.m-list tbody tr td:nth-child(5),
  #page-payments table.m-list tbody tr td:nth-child(4),
  #page-expenses table.m-list tbody tr td:nth-child(6),
  #page-payments table.m-list tbody tr td:nth-child(6) {
    font-size: 11px; color: var(--muted); font-style: italic;
  }
  /* cont-194 DISCOUNT VOUCHERS re-map: line 2 = customer | status, line 3 =
     the type (as before), line 4 = buttons; the amount goes semi-bold */
  #page-discounts table.m-list tbody tr td:nth-child(5) { font-weight: 600; }
  #page-discounts table.m-list tbody tr td:nth-child(6) {
    grid-area: 2 / 4; justify-self: end; font-size: 12.5px;
  }
  #page-discounts table.m-list tbody tr td:nth-child(4) { grid-area: 3 / 1 / 4 / -1; text-align: left; }
  #page-discounts table.m-list tbody tr td:nth-child(4)::before { content: 'Type: '; }
  #page-discounts table.m-list tbody tr td:nth-child(7) { grid-area: 4 / 1 / 5 / -1; }
  /* cont-195 EXPENSES re-map: line 2 = category | status, line 3 = "Spent
     by X, <paid-from>" full width quiet italics (the account rides in a
     data attribute — the Paid From column is redundant on phones), line 4 =
     buttons; the amount keeps its bold */
  #page-expenses table.m-list tbody tr td:nth-child(7) {
    grid-area: 2 / 4; justify-self: end; font-size: 12.5px;
  }
  #page-expenses table.m-list tbody tr td:nth-child(8) { grid-area: 4 / 1 / 5 / -1; }
  #page-expenses table.m-list tbody tr td:nth-child(5) { display: none; }
  #page-expenses table.m-list tbody tr td:nth-child(6) {
    grid-area: 3 / 1 / 4 / -1; text-align: left;
    font-size: 11px; color: var(--muted); font-style: italic;
  }
  #page-expenses table.m-list tbody tr td:nth-child(6)::before { content: 'Spent by '; }
  #page-expenses table.m-list tbody tr td:nth-child(6)[data-acc]::after { content: ', ' attr(data-acc); }
  /* cont-194 RECEIVE PAYMENTS re-map: line 2 = customer | status, line 3 =
     "Collected by X, <account>" full width quiet italics (the account name
     rides in a data attribute — the Received-In column is redundant on
     phones), line 4 = buttons; the amount goes semi-bold like the others */
  #page-payments table.m-list tbody tr td:nth-child(5) { font-weight: 600; }
  #page-payments table.m-list tbody tr td:nth-child(7) {
    grid-area: 2 / 4; justify-self: end; font-size: 12.5px;
  }
  #page-payments table.m-list tbody tr td:nth-child(8) { grid-area: 4 / 1 / 5 / -1; }
  #page-payments table.m-list tbody tr td:nth-child(4) { display: none; }
  #page-payments table.m-list tbody tr td:nth-child(6) {
    grid-area: 3 / 1 / 4 / -1; text-align: left;
    font-size: 11px; color: var(--muted); font-style: italic;
  }
  #page-payments table.m-list tbody tr td:nth-child(6)::before { content: 'Collected by '; }
  #page-payments table.m-list tbody tr td:nth-child(6)[data-acc]::after { content: ', ' attr(data-acc); }

  /* deleted-row messages span the width and keep their regular weight — the
     main-text placement rules above also land on the message cell */
  #page-returns table.m-list td.void-msg, #page-discounts table.m-list td.void-msg,
  #page-expenses table.m-list td.void-msg, #page-payments table.m-list td.void-msg,
  #page-transfers table.m-list td.void-msg, #page-purchases table.m-list td.void-msg,
  #page-localpurchase table.m-list td.void-msg, #page-supplierpayments table.m-list td.void-msg {
    font-weight: 400;
  }
  /* deleted/empty rows must ALWAYS span the full width — re-asserted here so
     the per-page placement maps above (equal specificity, later order) can
     never squeeze the message into one column */
  #page-queue table.m-list tbody tr td[colspan], #page-returns table.m-list tbody tr td[colspan],
  #page-delivery table.m-list tbody tr td[colspan], #page-discounts table.m-list tbody tr td[colspan],
  #page-expenses table.m-list tbody tr td[colspan], #page-payments table.m-list tbody tr td[colspan],
  #page-transfers table.m-list tbody tr td[colspan], #page-purchases table.m-list tbody tr td[colspan],
  #page-localpurchase table.m-list tbody tr td[colspan], #page-supplierpayments table.m-list tbody tr td[colspan] {
    grid-area: 2 / 1 / 3 / -1 !important;
  }
  /* cont-223: the four voucher pages' action buttons sit on ONE merged row
     AND look exactly like the bills page's buttons — natural width, the
     default .btn.small mobile padding, right-aligned (no flex stretch, no
     padding override); nowrap keeps the row single-line */
  #page-payments table.m-list tbody tr td.actions,
  #page-expenses table.m-list tbody tr td.actions,
  #page-discounts table.m-list tbody tr td.actions,
  #page-transfers table.m-list tbody tr td.actions {
    max-width: none; white-space: nowrap; text-align: right; justify-self: stretch;
  }
  #page-payments table.m-list tbody tr td.actions .btn,
  #page-expenses table.m-list tbody tr td.actions .btn,
  #page-discounts table.m-list tbody tr td.actions .btn,
  #page-transfers table.m-list tbody tr td.actions .btn { margin: 2px 0 2px .3rem; vertical-align: top; }
}

@media (max-width: 640px) {
  #page-deletedbills table.m-list, #page-customers table.m-list, #page-zones table.m-list,
  #page-salespersons table.m-list, #page-customerpreference table.m-list { display: block; }
  #page-deletedbills table.m-list thead, #page-customers table.m-list thead,
  #page-zones table.m-list thead, #page-salespersons table.m-list thead,
  #page-customerpreference table.m-list thead { display: none; }
  #page-deletedbills table.m-list tbody, #page-customers table.m-list tbody,
  #page-zones table.m-list tbody, #page-salespersons table.m-list tbody,
  #page-customerpreference table.m-list tbody { display: block; }
  #page-deletedbills table.m-list tbody tr, #page-customers table.m-list tbody tr,
  #page-zones table.m-list tbody tr, #page-salespersons table.m-list tbody tr,
  #page-customerpreference table.m-list tbody tr {
    display: grid;
    grid-template-columns: min-content max-content minmax(0, 1fr) minmax(auto, 46vw);
    gap: 2px 0;
    padding: 10px 12px;
  }
  #page-deletedbills table.m-list tbody tr + tr, #page-customers table.m-list tbody tr + tr,
  #page-zones table.m-list tbody tr + tr, #page-salespersons table.m-list tbody tr + tr,
  #page-customerpreference table.m-list tbody tr + tr { border-top: 1px solid var(--line); }
  #page-deletedbills table.m-list tbody tr td, #page-customers table.m-list tbody tr td,
  #page-zones table.m-list tbody tr td, #page-salespersons table.m-list tbody tr td,
  #page-customerpreference table.m-list tbody tr td { border: 0; padding: 0; background: none; }
  #page-customers table.m-list td.actions, #page-zones table.m-list td.actions,
  #page-salespersons table.m-list td.actions, #page-customerpreference table.m-list td.actions {
    white-space: normal; max-width: 46vw; text-align: right;
  }
  #page-customers table.m-list td.actions .btn, #page-zones table.m-list td.actions .btn,
  #page-salespersons table.m-list td.actions .btn, #page-customerpreference table.m-list td.actions .btn {
    margin: 1px 0 1px .3rem;
  }
  #page-deletedbills table.m-list td[colspan], #page-customers table.m-list td[colspan],
  #page-zones table.m-list td[colspan], #page-salespersons table.m-list td[colspan],
  #page-customerpreference table.m-list td[colspan] { grid-column: 1 / -1 !important; }

  /* ---- DELETED BILLS: no, date | Details · reason (FULL width) · type · by ---- */
  #page-deletedbills table.m-list tbody tr td:nth-child(1) { grid-area: 1 / 1; font-weight: 600; }
  #page-deletedbills table.m-list tbody tr td:nth-child(1) strong { white-space: nowrap; }
  #page-deletedbills table.m-list tbody tr td:nth-child(3) { grid-area: 1 / 2; white-space: nowrap; }
  #page-deletedbills table.m-list tbody tr td:nth-child(3)::before { content: ', '; font-weight: 400; }
  #page-deletedbills table.m-list tbody tr td:nth-child(6) { grid-area: 1 / 4; justify-self: end; white-space: normal; }
  /* the reason merges BOTH columns — one full-width line under the no/date
     (the td carries an inline max-width for the desktop column — beat it) */
  #page-deletedbills table.m-list tbody tr td:nth-child(4) {
    grid-area: 2 / 1 / 3 / -1; font-size: 13px; max-width: none !important;
  }
  #page-deletedbills table.m-list tbody tr td:nth-child(4)::before {
    content: 'Reason: '; color: var(--muted); font-size: 11px;
  }
  #page-deletedbills table.m-list tbody tr td:nth-child(2),
  #page-deletedbills table.m-list tbody tr td:nth-child(5) {
    font-size: 11px; color: var(--muted); font-style: italic;
  }
  #page-deletedbills table.m-list tbody tr td:nth-child(2) { grid-area: 3 / 1 / 4 / 4; }
  #page-deletedbills table.m-list tbody tr td:nth-child(2)::before { content: 'Type: '; }
  #page-deletedbills table.m-list tbody tr td:nth-child(5) { grid-area: 4 / 1 / 5 / 4; }
  #page-deletedbills table.m-list tbody tr td:nth-child(5)::before { content: 'By: '; }

  /* ---- CUSTOMERS (cont-195 re-map): line 1 = name, line 2 = "Op: x,
     Limit: y", line 3 = "Sales by: z, Assigned: …" quiet italics (the
     assigned names ride in a data attribute; the Zone column stays
     desktop-only), line 4 = buttons right ---- */
  #page-customers table.m-list tbody tr td:nth-child(1) { grid-area: 1 / 1 / 2 / 4; font-weight: 600; }
  #page-customers table.m-list tbody tr td:nth-child(4) { grid-area: 2 / 1; white-space: nowrap; }
  #page-customers table.m-list tbody tr td:nth-child(4)::before { content: 'Op: '; color: var(--muted); font-weight: 400; font-size: 11px; }
  #page-customers table.m-list tbody tr td:nth-child(4)::after { content: ', '; }
  #page-customers table.m-list tbody tr td:nth-child(5) { grid-area: 2 / 2; white-space: nowrap; }
  #page-customers table.m-list tbody tr td:nth-child(5)::before { content: 'Limit: '; color: var(--muted); font-weight: 400; font-size: 11px; }
  #page-customers table.m-list tbody tr td:nth-child(3) {
    grid-area: 3 / 1 / 4 / -1; text-align: left;
    font-size: 11px; color: var(--muted); font-style: italic;
  }
  #page-customers table.m-list tbody tr td:nth-child(3)::before { content: 'Sales by: '; }
  #page-customers table.m-list tbody tr td:nth-child(3)[data-assigned]::after { content: ', Assigned: ' attr(data-assigned); }
  #page-customers table.m-list tbody tr td:nth-child(2),
  #page-customers table.m-list tbody tr td:nth-child(6) { display: none; }
  #page-customers table.m-list tbody tr td:nth-child(7) {
    grid-area: 4 / 1 / 5 / -1; max-width: none; white-space: nowrap; text-align: right;
  }

  /* ---- ZONES (cont-195): line 1 = name | customers count, line 2 =
     "Coverage area: …" quiet italics, line 3 = buttons right ---- */
  #page-zones table.m-list tbody tr td:nth-child(1) { grid-area: 1 / 1 / 2 / 3; font-weight: 600; }
  #page-zones table.m-list tbody tr td:nth-child(3) { grid-area: 1 / 4; justify-self: end; font-weight: 600; white-space: nowrap; }
  #page-zones table.m-list tbody tr td:nth-child(3)::before { content: 'Customers: '; color: var(--muted); font-weight: 400; font-size: 11px; }
  #page-zones table.m-list tbody tr td:nth-child(2) {
    grid-area: 2 / 1 / 3 / -1; text-align: left;
    font-size: 11px; color: var(--muted); font-style: italic;
  }
  #page-zones table.m-list tbody tr td:nth-child(2)::before { content: 'Coverage area: '; }
  #page-zones table.m-list tbody tr td:nth-child(4) {
    grid-area: 3 / 1 / 4 / -1; max-width: none; white-space: nowrap; text-align: right;
  }

  /* ---- SALES PERSONS list (cont-195): line 1 = name | customers count,
     line 2 = "Phone: x, Email: y" quiet italics (the email rides in a data
     attribute — it has no desktop column), line 3 = buttons right ---- */
  #page-salespersons table.m-list tbody tr td:nth-child(1) { grid-area: 1 / 1 / 2 / 3; font-weight: 600; }
  #page-salespersons table.m-list tbody tr td:nth-child(3) { grid-area: 1 / 4; justify-self: end; font-weight: 600; white-space: nowrap; }
  #page-salespersons table.m-list tbody tr td:nth-child(3)::before { content: 'Customers: '; color: var(--muted); font-weight: 400; font-size: 11px; }
  #page-salespersons table.m-list tbody tr td:nth-child(2) {
    grid-area: 2 / 1 / 3 / -1; text-align: left;
    font-size: 11px; color: var(--muted); font-style: italic;
  }
  #page-salespersons table.m-list tbody tr td:nth-child(2)::before { content: 'Phone: '; }
  #page-salespersons table.m-list tbody tr td:nth-child(2)[data-email]::after { content: ', Email: ' attr(data-email); }
  #page-salespersons table.m-list tbody tr td:nth-child(4) {
    grid-area: 3 / 1 / 4 / -1; max-width: none; white-space: normal; text-align: right;
  }

  /* ---- CUSTOMER PREFERENCE: ONE column — item name (unit right) ·
     sold/returned line · buttons (owner request: with a long item name the
     side-by-side layout pushed the Sold/Returned buttons outside the card,
     so the buttons get their own full-width row) ---- */
  #page-customerpreference table.m-list tbody tr {
    grid-template-columns: minmax(0, 1fr) max-content;
    gap: 2px 10px;
  }
  #page-customerpreference table.m-list tbody tr td:nth-child(1) { grid-area: 1 / 1 / 2 / 3; font-weight: 600; }
  #page-customerpreference table.m-list tbody tr td:nth-child(1) strong { white-space: normal; }
  /* cont-195 re-map: the unit column is hidden on phones; the Returned
     figure rides in a data attribute so Sold + Returned share ONE line with
     the buttons right */
  #page-customerpreference table.m-list tbody tr td:nth-child(2),
  #page-customerpreference table.m-list tbody tr td:nth-child(4) { display: none; }
  #page-customerpreference table.m-list tbody tr td:nth-child(3) { grid-area: 2 / 1; font-weight: 600; font-size: 12.5px; text-align: left; }
  #page-customerpreference table.m-list tbody tr td:nth-child(3)::before { content: 'Sold: '; color: var(--muted); font-weight: 400; font-size: 11px; }
  #page-customerpreference table.m-list tbody tr td:nth-child(3)[data-ret]::after {
    content: ', Returned: ' attr(data-ret); font-weight: 400; font-size: 12.5px;
  }
  #page-customerpreference table.m-list tbody tr td:nth-child(3) strong[data-unit]::after {
    content: ' ' attr(data-unit); font-weight: 400; font-size: 11px;
  }
  #page-customerpreference table.m-list tbody tr td:nth-child(5) {
    grid-area: 2 / 2; justify-self: end; text-align: right; max-width: none; white-space: nowrap;
  }
  #page-customerpreference table.m-list tbody tr td:nth-child(5) .btn { margin: 1px 0 1px .3rem; }
  /* group header rows keep their banded look */
  #page-customerpreference table.m-list tbody tr.type-head td {
    background: #e4e8ee; border-top: 2px solid var(--line);
    font-size: 12px; text-transform: uppercase; letter-spacing: .05em;
    color: var(--muted); padding: .55rem .6rem .2rem;
  }

  /* ---- numeric-panel machinery (n-list): sales report, my receivable,
          sales-persons report — 3 equal columns of tagged figures ---- */
  #page-salesreport table.n-list, #page-myreceivable table.n-list,
  #page-salespersons table.n-list, #page-receivable table.n-list { display: block; }
  #page-salesreport table.n-list thead, #page-myreceivable table.n-list thead,
  #page-salespersons table.n-list thead, #page-receivable table.n-list thead { display: none; }
  #page-salesreport table.n-list tbody, #page-myreceivable table.n-list tbody,
  #page-salespersons table.n-list tbody, #page-receivable table.n-list tbody { display: block; }
  #page-salesreport table.n-list tbody tr, #page-myreceivable table.n-list tbody tr,
  #page-salespersons table.n-list tbody tr, #page-receivable table.n-list tbody tr {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2px 4px;
    padding: 10px 12px;
  }
  #page-salesreport table.n-list tbody tr + tr, #page-myreceivable table.n-list tbody tr + tr,
  #page-salespersons table.n-list tbody tr + tr, #page-receivable table.n-list tbody tr + tr { border-top: 1px solid var(--line); }
  #page-salesreport table.n-list tbody tr td, #page-myreceivable table.n-list tbody tr td,
  #page-salespersons table.n-list tbody tr td, #page-receivable table.n-list tbody tr td { border: 0; padding: 0; background: none; }
  #page-salesreport table.n-list tbody tr td[colspan],
  #page-myreceivable table.n-list tbody tr td[colspan],
  #page-salespersons table.n-list tbody tr td[colspan], #page-receivable table.n-list tbody tr td[colspan] { grid-column: 1 / -1 !important; }
  /* the figures themselves */
  #page-salesreport table.n-list tbody tr td:nth-child(n+3),
  #page-myreceivable table.n-list tbody tr td:nth-child(n+2),
  #page-salespersons table.n-list tbody tr td:nth-child(n+2), #page-receivable table.n-list tbody tr td:nth-child(n+2) {
    font-size: 12.5px; font-weight: 600;
  }
  #page-salesreport table.n-list tbody tr td:nth-child(n+3)::before,
  #page-myreceivable table.n-list tbody tr td:nth-child(n+2)::before,
  #page-salespersons table.n-list tbody tr td:nth-child(n+2)::before, #page-receivable table.n-list tbody tr td:nth-child(n+2)::before {
    color: var(--muted); font-weight: 400; font-size: 11px;
  }
  /* banded subtotal rows (My Receivable) keep their background */
  #page-myreceivable table.n-list tbody tr.alt-row td { background: var(--gray-bg); }

  /* ---- SALES REPORT: customer | balance · zone · bills/gross/disc ·
          net/ret/paid ---- */
  #page-salesreport table.n-list tbody tr td:nth-child(1) { grid-area: 1 / 1 / 2 / 3; font-weight: 600; }
  #page-salesreport table.n-list tbody tr td:nth-child(9) { grid-area: 1 / 3; justify-self: end; white-space: nowrap; }
  #page-salesreport table.n-list tbody tr td:nth-child(2) { grid-area: 2 / 1 / 3 / 4; font-size: 11px; color: var(--muted); font-style: italic; }
  #page-salesreport table.n-list tbody tr td:nth-child(2)::before { content: 'Zone: '; }
  #page-salesreport table.n-list tbody tr td:nth-child(3) { grid-area: 3 / 1; }
  #page-salesreport table.n-list tbody tr td:nth-child(3)::before { content: 'Bills: '; }
  #page-salesreport table.n-list tbody tr td:nth-child(4) { grid-area: 3 / 2; }
  #page-salesreport table.n-list tbody tr td:nth-child(4)::before { content: 'Gross: '; }
  #page-salesreport table.n-list tbody tr td:nth-child(5) { grid-area: 3 / 3; }
  #page-salesreport table.n-list tbody tr td:nth-child(5)::before { content: 'Disc: '; }
  #page-salesreport table.n-list tbody tr td:nth-child(6) { grid-area: 4 / 1; }
  #page-salesreport table.n-list tbody tr td:nth-child(6)::before { content: 'Net: '; }
  #page-salesreport table.n-list tbody tr td:nth-child(7) { grid-area: 4 / 2; }
  #page-salesreport table.n-list tbody tr td:nth-child(7)::before { content: 'Ret: '; }
  #page-salesreport table.n-list tbody tr td:nth-child(8) { grid-area: 4 / 3; }
  #page-salesreport table.n-list tbody tr td:nth-child(8)::before { content: 'Paid: '; }

  /* ---- MY RECEIVABLE: customer | balance · opening/bills/rcvd · disc/ret
     (the same map covers the per-person subtotals and the grand total) ---- */
  #page-myreceivable table.n-list tbody tr td:nth-child(1) { grid-area: 1 / 1 / 2 / 3; font-weight: 600; }
  #page-myreceivable table.n-list tbody tr td:nth-child(7) { grid-area: 1 / 3; justify-self: end; white-space: nowrap; }
  #page-myreceivable table.n-list tbody tr td:nth-child(2) { grid-area: 2 / 1; }
  #page-myreceivable table.n-list tbody tr td:nth-child(2)::before { content: 'Opening: '; }
  #page-myreceivable table.n-list tbody tr td:nth-child(3) { grid-area: 2 / 2; }
  #page-myreceivable table.n-list tbody tr td:nth-child(3)::before { content: 'Bills: '; }
  #page-myreceivable table.n-list tbody tr td:nth-child(4) { grid-area: 2 / 3; }
  #page-myreceivable table.n-list tbody tr td:nth-child(4)::before { content: 'Rcvd: '; }
  #page-myreceivable table.n-list tbody tr td:nth-child(5) { grid-area: 3 / 1; }
  #page-myreceivable table.n-list tbody tr td:nth-child(5)::before { content: 'Disc: '; }
  #page-myreceivable table.n-list tbody tr td:nth-child(6) { grid-area: 3 / 2; }
  #page-myreceivable table.n-list tbody tr td:nth-child(6)::before { content: 'Ret: '; }

  /* ---- RECEIVABLE: same shape as My Receivable — customer | balance ·
     opening/bills/rcvd · disc/ret (the grand-total row shares the map) ---- */
  #page-receivable table.n-list tbody tr td:nth-child(1) { grid-area: 1 / 1 / 2 / 3; font-weight: 600; }
  #page-receivable table.n-list tbody tr td:nth-child(7) { grid-area: 1 / 3; justify-self: end; white-space: nowrap; }
  #page-receivable table.n-list tbody tr td:nth-child(2) { grid-area: 2 / 1; }
  #page-receivable table.n-list tbody tr td:nth-child(2)::before { content: 'Opening: '; }
  #page-receivable table.n-list tbody tr td:nth-child(3) { grid-area: 2 / 2; }
  #page-receivable table.n-list tbody tr td:nth-child(3)::before { content: 'Bills: '; }
  #page-receivable table.n-list tbody tr td:nth-child(4) { grid-area: 2 / 3; }
  #page-receivable table.n-list tbody tr td:nth-child(4)::before { content: 'Rcvd: '; }
  #page-receivable table.n-list tbody tr td:nth-child(5) { grid-area: 3 / 1; }
  #page-receivable table.n-list tbody tr td:nth-child(5)::before { content: 'Disc: '; }
  #page-receivable table.n-list tbody tr td:nth-child(6) { grid-area: 3 / 2; }
  #page-receivable table.n-list tbody tr td:nth-child(6)::before { content: 'Ret: '; }
  /* sales-person group headers keep their banded look */
  #page-myreceivable table.n-list tbody tr.type-head td {
    background: #e4e8ee; border-top: 2px solid var(--line);
    font-size: 12px; text-transform: uppercase; letter-spacing: .05em;
    color: var(--muted); padding: .55rem .6rem .2rem;
  }

  /* ---- SALES PERSONS report: person | Details · customers/sales/rcvd ·
          ret/disc (grand total row shares the map) ---- */
  #page-salespersons table.n-list tbody tr td:nth-child(1) { grid-area: 1 / 1 / 2 / 3; font-weight: 600; }
  #page-salespersons table.n-list tbody tr td:nth-child(7) { grid-area: 1 / 3; justify-self: end; white-space: normal; }
  #page-salespersons table.n-list tbody tr td:nth-child(7) .btn { margin: 0 0 0 .3rem; }
  #page-salespersons table.n-list tbody tr td:nth-child(2) { grid-area: 2 / 1; }
  #page-salespersons table.n-list tbody tr td:nth-child(2)::before { content: 'Customers: '; }
  #page-salespersons table.n-list tbody tr td:nth-child(3) { grid-area: 2 / 2; }
  #page-salespersons table.n-list tbody tr td:nth-child(3)::before { content: 'Sales: '; }
  #page-salespersons table.n-list tbody tr td:nth-child(4) { grid-area: 2 / 3; }
  #page-salespersons table.n-list tbody tr td:nth-child(4)::before { content: 'Rcvd: '; }
  #page-salespersons table.n-list tbody tr td:nth-child(5) { grid-area: 3 / 1; }
  #page-salespersons table.n-list tbody tr td:nth-child(5)::before { content: 'Ret: '; }
  #page-salespersons table.n-list tbody tr td:nth-child(6) { grid-area: 3 / 2; }
  #page-salespersons table.n-list tbody tr td:nth-child(6)::before { content: 'Disc: '; }
  /* group headers and empty-state rows must ALWAYS span the full width —
     re-asserted after the per-page maps (equal specificity, later order) */
  #page-deletedbills table.m-list tbody tr td[colspan], #page-customers table.m-list tbody tr td[colspan],
  #page-zones table.m-list tbody tr td[colspan], #page-salespersons table.m-list tbody tr td[colspan],
  #page-customerpreference table.m-list tbody tr td[colspan], #page-salesreport table.n-list tbody tr td[colspan],
  #page-myreceivable table.n-list tbody tr td[colspan], #page-salespersons table.n-list tbody tr td[colspan] {
    grid-area: 1 / 1 / 2 / -1 !important;
  }
}

@media (max-width: 640px) {
  #zone-preview table { display: block; }
  #zone-preview table thead { display: none; }
  #zone-preview table tbody { display: block; }
  #zone-preview table tbody tr {
    display: grid;
    /* the balance column is OPTIONAL (Balance toggle) — size it to its
       content so rows without it don't reserve a 46vw empty track */
    grid-template-columns: min-content max-content minmax(0, 1fr) minmax(0, max-content);
    gap: 2px 0;
    padding: 8px 12px;
  }
  #zone-preview table tbody tr + tr { border-top: 1px solid var(--line); }
  #zone-preview table tbody tr td { border: 0; padding: 0; background: none; }
  #zone-preview table tbody tr td:nth-child(1) { grid-area: 1 / 1; font-size: 11px; color: var(--muted); padding-right: 7px; }
  #zone-preview table tbody tr td:nth-child(1)::before { content: '#'; margin-right: 3px; }
  #zone-preview table tbody tr td:nth-child(2) { grid-area: 1 / 2 / 2 / 4; font-weight: 600; }
  /* the balance column — whatever position it lands at, it is the td.num */
  #zone-preview table tbody tr td.num { grid-area: 1 / 4; justify-self: end; font-weight: 600; white-space: nowrap; }
  #zone-preview table tbody tr td.num::before { content: 'Due: '; color: var(--muted); font-weight: 400; font-size: 11px; }
  #zone-preview table tbody tr td:nth-child(3):not(.num) { grid-area: 2 / 1 / 3 / 4; font-size: 11px; color: var(--muted); font-style: italic; }
  #zone-preview table tbody tr td:nth-child(3):not(.num)::before { content: 'Addr: '; }
  #zone-preview table tbody tr td:nth-child(4) { grid-area: 3 / 1 / 4 / 4; font-size: 11px; color: var(--muted); font-style: italic; }
  #zone-preview table tbody tr td:nth-child(4)::before { content: 'Contact: '; }
  #zone-preview table tbody tr td:nth-child(5):not(.num) { grid-area: 4 / 1 / 5 / 4; font-size: 11px; color: var(--muted); font-style: italic; }
  #zone-preview table tbody tr td:nth-child(5):not(.num)::before { content: 'Mobile: '; }
  #zone-preview table tbody tr td[colspan] { grid-column: 1 / -1 !important; }
}

@media (max-width: 640px) {
  #page-purchases table.m-list, #page-localpurchase table.m-list, #page-suppliers table.m-list,
  #page-supplierpayments table.m-list, #page-accounts table.m-list, #page-logs table.m-list,
  #page-users table.m-list, #page-modifiedbills table.m-list { display: block; }
  #page-purchases table.m-list thead, #page-localpurchase table.m-list thead,
  #page-suppliers table.m-list thead, #page-supplierpayments table.m-list thead,
  #page-accounts table.m-list thead, #page-logs table.m-list thead,
  #page-users table.m-list thead, #page-modifiedbills table.m-list thead { display: none; }
  #page-purchases table.m-list tbody, #page-localpurchase table.m-list tbody,
  #page-suppliers table.m-list tbody, #page-supplierpayments table.m-list tbody,
  #page-accounts table.m-list tbody, #page-logs table.m-list tbody,
  #page-users table.m-list tbody, #page-modifiedbills table.m-list tbody { display: block; }
  #page-purchases table.m-list tbody tr, #page-localpurchase table.m-list tbody tr,
  #page-suppliers table.m-list tbody tr, #page-supplierpayments table.m-list tbody tr,
  #page-accounts table.m-list tbody tr, #page-logs table.m-list tbody tr,
  #page-users table.m-list tbody tr, #page-modifiedbills table.m-list tbody tr {
    display: grid;
    grid-template-columns: min-content max-content minmax(0, 1fr) minmax(auto, 46vw);
    gap: 2px 0;
    padding: 10px 12px;
  }
  #page-purchases table.m-list tbody tr + tr, #page-localpurchase table.m-list tbody tr + tr,
  #page-suppliers table.m-list tbody tr + tr, #page-supplierpayments table.m-list tbody tr + tr,
  #page-accounts table.m-list tbody tr + tr, #page-logs table.m-list tbody tr + tr,
  #page-users table.m-list tbody tr + tr, #page-modifiedbills table.m-list tbody tr + tr {
    border-top: 1px solid var(--line);
  }
  #page-purchases table.m-list tbody tr td, #page-localpurchase table.m-list tbody tr td,
  #page-suppliers table.m-list tbody tr td, #page-supplierpayments table.m-list tbody tr td,
  #page-accounts table.m-list tbody tr td, #page-logs table.m-list tbody tr td,
  #page-users table.m-list tbody tr td, #page-modifiedbills table.m-list tbody tr td {
    border: 0; padding: 0; background: none;
  }
  #page-purchases table.m-list td.actions, #page-localpurchase table.m-list td.actions,
  #page-suppliers table.m-list td.actions, #page-supplierpayments table.m-list td.actions,
  #page-accounts table.m-list td.actions, #page-users table.m-list td.actions {
    white-space: normal; max-width: 46vw; text-align: right;
  }
  /* cont-221: the four card actions stay on ONE row — equal buttons that
     shrink instead of wrapping (large system fonts wrapped "Del" alone) */
  #page-accounts table.m-list tbody tr td.actions { display: flex; flex-wrap: nowrap; max-width: none; }
  #page-accounts table.m-list tbody tr td.actions .btn {
    flex: 1 1 0; min-width: 0; margin: 0 0 0 .3rem;
    justify-content: center; text-align: center;
  }
  #page-purchases table.m-list td.actions .btn, #page-localpurchase table.m-list td.actions .btn,
  #page-suppliers table.m-list td.actions .btn, #page-supplierpayments table.m-list td.actions .btn,
  #page-accounts table.m-list td.actions .btn, #page-users table.m-list td.actions .btn {
    margin: 1px 0 1px .3rem;
  }
  #page-suppliers table.m-list tbody tr td[colspan],
  #page-accounts table.m-list tbody tr td[colspan], #page-logs table.m-list tbody tr td[colspan],
  #page-users table.m-list tbody tr td[colspan], #page-modifiedbills table.m-list tbody tr td[colspan] {
    grid-area: 1 / 1 / 2 / -1 !important;
  }
  /* the LOCAL / FOREIGN section bands keep their banded look */
  #page-suppliers table.m-list tbody tr.type-head td {
    background: #e4e8ee; border-top: 2px solid var(--line);
    font-size: 12px; text-transform: uppercase; letter-spacing: .05em;
    color: var(--muted); padding: .55rem .6rem .2rem;
  }

  /* ---- PURCHASES + LOCAL PURCHASE ---- */
  #page-purchases table.m-list tbody tr td:nth-child(1),
  #page-localpurchase table.m-list tbody tr td:nth-child(1) { grid-area: 1 / 1; font-weight: 600; }
  #page-purchases table.m-list tbody tr td:nth-child(1) strong,
  #page-localpurchase table.m-list tbody tr td:nth-child(1) strong { white-space: nowrap; }
  #page-purchases table.m-list tbody tr td:nth-child(2),
  #page-localpurchase table.m-list tbody tr td:nth-child(2) { grid-area: 1 / 2; white-space: nowrap; }
  /* the ", " after the number only when the number is stamped (a <strong>
     in the FIRST cell — the row total is bold too, so the row-wide :has
     would always match) */
  #page-purchases table.m-list tbody tr:has(td:nth-child(1) strong) td:nth-child(2)::before,
  #page-localpurchase table.m-list tbody tr:has(td:nth-child(1) strong) td:nth-child(2)::before { content: ', '; font-weight: 400; }
  /* draft rows: the muted "— stamped at confirm" text is LONG — let it flow
     across the first two columns instead of wrapping in the narrow first
     one, with the date following it */
  #page-purchases table.m-list tbody tr td:nth-child(1):not(:has(strong)),
  #page-localpurchase table.m-list tbody tr td:nth-child(1):not(:has(strong)) { grid-area: 1 / 1 / 2 / 3; white-space: nowrap; padding-right: 8px; }
  #page-purchases table.m-list tbody tr:not(:has(td:nth-child(1) strong)) td:nth-child(2),
  #page-localpurchase table.m-list tbody tr:not(:has(td:nth-child(1) strong)) td:nth-child(2) { grid-area: 1 / 3; }
  #page-purchases table.m-list tbody tr td:nth-child(6),
  #page-localpurchase table.m-list tbody tr td:nth-child(6) { grid-area: 1 / 4; justify-self: end; white-space: nowrap; }
  #page-purchases table.m-list tbody tr td:nth-child(3),
  #page-localpurchase table.m-list tbody tr td:nth-child(3) { grid-area: 2 / 1 / 3 / 4; font-weight: 600; }
  /* cont-195 re-map: line 2 = supplier | status, line 3 = mode, line 4 =
     buttons right */
  #page-purchases table.m-list tbody tr td:nth-child(4),
  #page-localpurchase table.m-list tbody tr td:nth-child(4) {
    grid-area: 2 / 4; justify-self: end; font-size: 12.5px;
  }
  #page-purchases table.m-list tbody tr td:nth-child(5),
  #page-localpurchase table.m-list tbody tr td:nth-child(5) {
    grid-area: 3 / 1 / 4 / -1; text-align: left;
    font-size: 11px; color: var(--muted); font-style: italic;
  }
  #page-purchases table.m-list tbody tr td:nth-child(5)::before,
  #page-localpurchase table.m-list tbody tr td:nth-child(5)::before { content: 'Mode: '; }
  #page-purchases table.m-list tbody tr td:nth-child(7),
  #page-localpurchase table.m-list tbody tr td:nth-child(7) {
    grid-area: 4 / 1 / 5 / -1; max-width: none; white-space: nowrap; text-align: right;
  }
  /* filter order on phones: search → type → dates → the rest */
  #page-purchases .filters > #pur-search { order: 1; }
  #page-purchases .filters > #pur-type-filter { order: 2; }
  #page-purchases .filters > #pur-from { order: 3; }
  #page-purchases .filters > #pur-to { order: 4; }
  #page-purchases .filters > #pur-supplier-filter { order: 5; }
  #page-purchases .filters > #pur-status { order: 6; }
  #page-purchases .filters > #pur-today { order: 7; }
  #page-purchases .filters > #pur-reset { order: 8; }
  #page-localpurchase .filters > #lp-search { order: 1; }
  #page-localpurchase .filters > #lp-type-filter { order: 2; }
  #page-localpurchase .filters > #lp-from { order: 3; }
  #page-localpurchase .filters > #lp-to { order: 4; }
  #page-localpurchase .filters > #lp-supplier-filter { order: 5; }
  #page-localpurchase .filters > #lp-status { order: 6; }
  #page-localpurchase .filters > #lp-today { order: 7; }
  #page-localpurchase .filters > #lp-reset { order: 8; }

  /* ---- SUPPLIERS: 2 columns — name with country BELOW it (left) | due
     (right); row 2 merges both columns for the buttons (owner request) ---- */
  #page-suppliers table.m-list tbody tr {
    grid-template-columns: minmax(0, 1fr) minmax(auto, 46vw);
    gap: 2px 10px;
  }
  #page-suppliers table.m-list tbody tr td:nth-child(1) { grid-area: 1 / 1 / 2 / 2; font-weight: 600; }
  /* a lengthy supplier name WRAPS (no nowrap) — nowrap made it paint over the
     due amount on the right */
  #page-suppliers table.m-list tbody tr td:nth-child(1) strong { white-space: normal; }
  #page-suppliers table.m-list tbody tr td:nth-child(3) { grid-area: 1 / 2 / 3 / 3; justify-self: end; font-weight: 600; text-align: right; }
  #page-suppliers table.m-list tbody tr td:nth-child(2) { grid-area: 2 / 1 / 3 / 2; font-size: 11px; color: var(--muted); font-style: italic; }
  #page-suppliers table.m-list tbody tr td:nth-child(2)::before { content: 'Country: '; }
  #page-suppliers table.m-list tbody tr td:nth-child(4) {
    grid-area: 3 / 1 / 4 / 3; text-align: left; max-width: none; white-space: normal;
  }
  #page-suppliers table.m-list tbody tr td:nth-child(4) .btn { margin: 2px 6px 2px 0; }

  /* ---- SUPPLIER PAYMENTS ---- */
  #page-supplierpayments table.m-list tbody tr td:nth-child(1) { grid-area: 1 / 1; font-weight: 600; }
  #page-supplierpayments table.m-list tbody tr td:nth-child(1) strong { white-space: nowrap; }
  #page-supplierpayments table.m-list tbody tr td:nth-child(2) { grid-area: 1 / 2; white-space: nowrap; }
  #page-supplierpayments table.m-list tbody tr td:nth-child(2)::before { content: ', '; font-weight: 400; }
  #page-supplierpayments table.m-list tbody tr:not(:has(strong)) td:nth-child(2)::before { content: none; }
  /* cont-195 re-map: line 1 no+date | amount SEMI-BOLD, line 2 supplier |
     status, line 3 "Mode: x, Equivalent: y" (the equivalent rides in a data
     attribute — it only shows for foreign currencies), line 4 created by,
     line 5 buttons right */
  #page-supplierpayments table.m-list tbody tr td:nth-child(4) {
    grid-area: 1 / 4; justify-self: end; white-space: nowrap; font-weight: 600;
  }
  #page-supplierpayments table.m-list tbody tr td:nth-child(3) { grid-area: 2 / 1 / 3 / 4; font-weight: 600; }
  #page-supplierpayments table.m-list tbody tr td:nth-child(8) { grid-area: 2 / 4; justify-self: end; font-size: 12.5px; }
  #page-supplierpayments table.m-list tbody tr td:nth-child(6) {
    grid-area: 3 / 1 / 4 / -1; text-align: left;
    font-size: 11px; color: var(--muted); font-style: italic;
  }
  #page-supplierpayments table.m-list tbody tr td:nth-child(6)::before { content: 'Mode: '; }
  #page-supplierpayments table.m-list tbody tr td:nth-child(6)[data-eq]::after { content: ', Equivalent: ' attr(data-eq); }
  #page-supplierpayments table.m-list tbody tr td:nth-child(5) { display: none; }
  #page-supplierpayments table.m-list tbody tr td:nth-child(7) {
    grid-area: 4 / 1 / 5 / -1; text-align: left;
    font-size: 11px; color: var(--muted); font-style: italic;
  }
  #page-supplierpayments table.m-list tbody tr td:nth-child(7)::before { content: 'Created by: '; }
  #page-supplierpayments table.m-list tbody tr td:nth-child(9) {
    grid-area: 5 / 1 / 6 / -1; max-width: none; white-space: nowrap; text-align: right;
  }

  /* ---- ACCOUNTS: one card — name (account no) · balance right · branch line
     when present · Type · Op · In · Out; the buttons sit in a 2-per-line grid
     UNDER the card (owner request: the old right-hand button stack read as a
     second card inside the card and squeezed the figures). Buttons are
     renamed on phones via data-short (Stat / Edit / Deac / Act / Del). ---- */
  #page-accounts table.m-list tbody tr {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 3px 10px;
  }
  #page-accounts table.m-list tbody tr td:nth-child(1) { grid-area: 1 / 1 / 3 / 2; font-weight: 600; }
  #page-accounts table.m-list tbody tr td:nth-child(1) strong { white-space: normal; }
  #page-accounts table.m-list tbody tr td:nth-child(6) { grid-area: 1 / 2 / 2 / 3; justify-self: end; white-space: nowrap; }
  /* cont-195 re-map: line 2 = the details/branch line (rendered inside the
     name cell) with the TYPE right, line 3 = "Op: x, In: y, Out: z" ONE
     line (In/Out ride in data attributes — the columns are hidden), line 4
     = buttons right (real labels again — they have their own row now) */
  #page-accounts table.m-list tbody tr td:nth-child(2) {
    grid-area: 2 / 2; justify-self: end; align-self: end; text-align: right;
    font-size: 11px; font-style: italic;
  }
  #page-accounts table.m-list tbody tr td:nth-child(3) { grid-area: 3 / 1 / 4 / 3; font-size: 12.5px; font-weight: 600; text-align: left; }
  #page-accounts table.m-list tbody tr td:nth-child(3)::before { content: 'Op: '; color: var(--muted); font-weight: 400; font-size: 11px; }
  #page-accounts table.m-list tbody tr td:nth-child(3)::after {
    content: ', In: ' attr(data-in) ', Out: ' attr(data-out);
    font-weight: 400; font-size: 12.5px;
  }
  #page-accounts table.m-list tbody tr td:nth-child(4),
  #page-accounts table.m-list tbody tr td:nth-child(5) { display: none; }
  #page-accounts table.m-list tbody tr td:nth-child(7) {
    grid-area: 4 / 1 / 5 / 3; text-align: right;
    white-space: normal; max-width: none;
  }
  #page-accounts table.m-list tbody tr td:nth-child(7) .btn { margin: 1px 0 1px .3rem; }

  /* ---- MODIFIED BILLS ---- */
  #page-modifiedbills table.m-list tbody tr td:nth-child(1) { grid-area: 1 / 1; font-weight: 600; }
  #page-modifiedbills table.m-list tbody tr td:nth-child(1) strong { white-space: nowrap; }
  #page-modifiedbills table.m-list tbody tr td:nth-child(3) { grid-area: 1 / 2; white-space: nowrap; }
  #page-modifiedbills table.m-list tbody tr td:nth-child(3)::before { content: ', '; font-weight: 400; }
  #page-modifiedbills table.m-list tbody tr td:nth-child(7) { grid-area: 1 / 4; justify-self: end; white-space: normal; }
  #page-modifiedbills table.m-list tbody tr td:nth-child(7) .btn { margin: 0 0 0 .3rem; }
  /* the reason merges BOTH columns — one full-width line (beat the inline
     340px desktop cap) */
  #page-modifiedbills table.m-list tbody tr td:nth-child(5) {
    grid-area: 2 / 1 / 3 / -1; font-size: 13px; max-width: none !important;
  }
  #page-modifiedbills table.m-list tbody tr td:nth-child(5)::before { content: 'Reason: '; color: var(--muted); font-size: 11px; }
  #page-modifiedbills table.m-list tbody tr td:nth-child(2),
  #page-modifiedbills table.m-list tbody tr td:nth-child(4),
  #page-modifiedbills table.m-list tbody tr td:nth-child(6) { font-size: 11px; color: var(--muted); font-style: italic; text-align: left; }
  #page-modifiedbills table.m-list tbody tr td:nth-child(2) { grid-area: 3 / 1 / 4 / 4; }
  #page-modifiedbills table.m-list tbody tr td:nth-child(2)::before { content: 'Type: '; }
  #page-modifiedbills table.m-list tbody tr td:nth-child(4) { grid-area: 4 / 1 / 5 / 4; }
  #page-modifiedbills table.m-list tbody tr td:nth-child(4)::before { content: 'Modified: '; }
  #page-modifiedbills table.m-list tbody tr td:nth-child(6) { grid-area: 5 / 1 / 6 / 4; }
  #page-modifiedbills table.m-list tbody tr td:nth-child(6)::before { content: 'By: '; }

  /* ---- AUDIT LOG: "date time, user" (action right) · Entity + FULL
     details on the next line (the JS no longer truncates the details) ---- */
  #page-logs table.m-list tbody tr {
    grid-template-columns: minmax(0, auto) minmax(0, 1fr) minmax(0, auto);
    gap: 3px 8px;
  }
  #page-logs table.m-list tbody tr td:nth-child(1) { grid-area: 1 / 1; font-weight: 600; white-space: nowrap; }
  #page-logs table.m-list tbody tr td:nth-child(2) { grid-area: 1 / 2; white-space: nowrap; }
  #page-logs table.m-list tbody tr td:nth-child(2)::before { content: ', '; font-weight: 400; }
  #page-logs table.m-list tbody tr td:nth-child(3) { grid-area: 1 / 3; justify-self: end; }
  #page-logs table.m-list tbody tr td:nth-child(3) .chip {
    background: transparent; border: 0; padding: 0;
    font-weight: 400; font-style: italic; font-size: 12.5px;
  }
  #page-logs table.m-list tbody tr td:nth-child(4) { grid-area: 2 / 1 / 3 / 2; font-size: 11px; color: var(--muted); font-style: italic; }
  #page-logs table.m-list tbody tr td:nth-child(4)::before { content: 'Entity: '; }
  #page-logs table.m-list tbody tr td:nth-child(5) {
    grid-area: 2 / 2 / 3 / 4; font-size: 11px; color: var(--muted);
    word-break: break-all; max-width: none;
    display: block; -webkit-line-clamp: unset; -webkit-box-orient: unset;
    overflow: visible;
  }

  /* ---- USERS & PERMISSIONS: "Username: …, Full Name" flows as ONE line
     (no virtual middle column) with the perms count right; line 2 =
     Designation (left) | Status (right); line 3 = the buttons in one row,
     right aligned (owner request) ---- */
  #page-users table.m-list tbody tr {
    grid-template-columns: max-content minmax(0, 1fr) auto;
    gap: 3px 0; /* no column gap — the comma prefix carries its own spacing */
  }
  #page-users table.m-list tbody tr td:nth-child(1) { grid-area: 1 / 1 / 2 / 2; font-weight: 600; }
  #page-users table.m-list tbody tr td:nth-child(1)::before { content: 'Username: '; color: var(--muted); font-weight: 400; font-size: 11px; }
  #page-users table.m-list tbody tr td:nth-child(2) { grid-area: 1 / 2 / 2 / 3; font-size: 12.5px; }
  #page-users table.m-list tbody tr td:nth-child(2)::before { content: ', '; font-weight: 400; }
  #page-users table.m-list tbody tr td:nth-child(5) { grid-area: 1 / 3 / 2 / 4; justify-self: end; }
  #page-users table.m-list tbody tr td:nth-child(5) .chip {
    background: transparent; border: 0; padding: 0;
    font-weight: 400; font-style: italic; font-size: 12.5px; color: var(--muted);
  }
  #page-users table.m-list tbody tr td:nth-child(3) { grid-area: 2 / 1 / 3 / 3; font-size: 11px; color: var(--muted); font-style: italic; }
  #page-users table.m-list tbody tr td:nth-child(3)::before { content: 'Designation: '; }
  #page-users table.m-list tbody tr td:nth-child(4) {
    grid-area: 2 / 3 / 3 / 4; justify-self: end; text-align: right;
    font-size: 12.5px; white-space: nowrap;
  }
  #page-users table.m-list tbody tr td:nth-child(4)::before { content: 'Status: '; color: var(--muted); font-weight: 400; font-size: 11px; }
  /* the buttons: one row, right aligned */
  #page-users table.m-list tbody tr td:nth-child(6) {
    grid-area: 3 / 1 / 4 / 4; text-align: right;
    white-space: normal; max-width: none;
  }
  #page-users table.m-list tbody tr td:nth-child(6) .btn { margin: 2px 0 2px .3rem; }

  /* ---- ACCOUNT STATEMENT — statement rows with In / Out / Bal tags ---- */
  #page-account-statement table { display: block; }
  #page-account-statement table thead { display: none; }
  #page-account-statement table tbody { display: block; }
  #page-account-statement table tbody tr {
    display: grid;
    grid-template-columns: max-content max-content minmax(0, 1fr) minmax(auto, 46vw);
    gap: 2px 0;
    padding: 10px 12px;
  }
  #page-account-statement table tbody tr + tr { border-top: 1px solid var(--line); }
  #page-account-statement table tbody tr td { border: 0; padding: 0; background: none; }
  #page-account-statement table tbody tr td:nth-child(1) { grid-area: 1 / 1; font-weight: 600; white-space: nowrap; }
  #page-account-statement table tbody tr td:nth-child(2) { grid-area: 1 / 2; font-size: 12.5px; }
  #page-account-statement table tbody tr td:nth-child(2)::before { content: ' ·  '; }
  #page-account-statement table tbody tr .chip {
    background: transparent; border: 0; padding: 0;
    font-weight: 400; font-style: italic; font-size: 12.5px;
  }
  #page-account-statement table tbody tr td:nth-child(4) { grid-area: 2 / 1 / 3 / 4; font-weight: 600; }
  #page-account-statement table tbody tr td:nth-child(3) { grid-area: 3 / 1 / 4 / 4; font-size: 11px; color: var(--muted); font-style: italic; }
  #page-account-statement table tbody tr td:nth-child(3)::before { content: 'Ref: '; }
  #page-account-statement table tbody tr td:nth-child(5),
  #page-account-statement table tbody tr td:nth-child(6),
  #page-account-statement table tbody tr td:nth-child(7) { font-weight: 600; white-space: nowrap; }
  #page-account-statement table tbody tr td:nth-child(5) { grid-area: 1 / 4; justify-self: end; }
  #page-account-statement table tbody tr td:nth-child(6) { grid-area: 2 / 4; justify-self: end; }
  #page-account-statement table tbody tr td:nth-child(7) { grid-area: 3 / 4; justify-self: end; }
  #page-account-statement table tbody tr td:nth-child(5)::before { content: 'In '; color: var(--muted); font-weight: 400; font-size: 11px; }
  #page-account-statement table tbody tr td:nth-child(6)::before { content: 'Out '; color: var(--muted); font-weight: 400; font-size: 11px; }
  #page-account-statement table tbody tr td:nth-child(7)::before { content: 'Bal '; color: var(--muted); font-weight: 400; font-size: 11px; }
  #page-account-statement table tbody tr td[colspan] { grid-column: 1 / -1 !important; }

  /* ---- CUSTOMER PREFERENCE popups (Sold / Returned; dynamic customer
     column — quantity is the .num that is NOT last, rate/qty-only rows end
     with their .num) ---- */
  #cpf-sold-modal table, #cpf-ret-modal table { display: block; }
  #cpf-sold-modal table thead, #cpf-ret-modal table thead { display: none; }
  #cpf-sold-modal table tbody, #cpf-ret-modal table tbody { display: block; }
  #cpf-sold-modal table tbody tr, #cpf-ret-modal table tbody tr {
    display: grid;
    grid-template-columns: min-content max-content minmax(0, 1fr) minmax(auto, 46vw);
    gap: 2px 0;
    padding: 8px 12px;
  }
  #cpf-sold-modal table tbody tr + tr, #cpf-ret-modal table tbody tr + tr { border-top: 1px solid var(--line); }
  #cpf-sold-modal table tbody tr td, #cpf-ret-modal table tbody tr td { border: 0; padding: 0; background: none; }
  #cpf-sold-modal table tbody tr td:nth-child(1), #cpf-ret-modal table tbody tr td:nth-child(1) { grid-area: 1 / 1; font-weight: 600; }
  #cpf-sold-modal table tbody tr td:nth-child(1) strong, #cpf-ret-modal table tbody tr td:nth-child(1) strong { white-space: nowrap; }
  #cpf-sold-modal table tbody tr td:nth-child(2), #cpf-ret-modal table tbody tr td:nth-child(2) { grid-area: 1 / 2; white-space: nowrap; }
  #cpf-sold-modal table tbody tr td:nth-child(2)::before, #cpf-ret-modal table tbody tr td:nth-child(2)::before { content: ', '; font-weight: 400; }
  #cpf-sold-modal table tbody tr td.num:not(:last-child) { grid-area: 1 / 4; justify-self: end; white-space: nowrap; }
  #cpf-sold-modal table tbody tr td.num:not(:last-child)::before { content: 'Qty: '; color: var(--muted); font-weight: 400; font-size: 11px; }
  #cpf-ret-modal table tbody tr td.num:last-child { grid-area: 1 / 4; justify-self: end; white-space: nowrap; }
  #cpf-ret-modal table tbody tr td.num:last-child::before { content: 'Qty: '; color: var(--muted); font-weight: 400; font-size: 11px; }
  #cpf-sold-modal table tbody tr td.num:last-child { grid-area: 2 / 4; justify-self: end; white-space: nowrap; font-size: 12.5px; }
  #cpf-sold-modal table tbody tr td.num:last-child::before { content: 'Rate: '; color: var(--muted); font-weight: 400; font-size: 11px; }
  #cpf-sold-modal table tbody tr td:nth-child(3):not(.num),
  #cpf-ret-modal table tbody tr td:nth-child(3):not(.num) { grid-area: 2 / 1 / 3 / 4; font-size: 11px; color: var(--muted); font-style: italic; }
  #cpf-sold-modal table tbody tr td:nth-child(3):not(.num)::before,
  #cpf-ret-modal table tbody tr td:nth-child(3):not(.num)::before { content: 'Customer: '; }
  #cpf-sold-modal table tbody tr td[colspan], #cpf-ret-modal table tbody tr td[colspan] { grid-area: 1 / 1 / 2 / -1 !important; }
}

@media (max-width: 640px) {
  #db-result table { display: block; }
  #db-result table thead { display: none; }
  #db-result table tbody { display: block; }
  #db-result table tbody tr {
    display: grid;
    grid-template-columns: min-content max-content minmax(0, 1fr) minmax(0, max-content);
    gap: 2px 0;
    padding: 8px 12px;
  }
  #db-result table tbody tr + tr { border-top: 1px solid var(--line); }
  #db-result table tbody tr td { border: 0; padding: 0; background: none; }
  #db-result table tbody tr td:nth-child(1) { grid-area: 1 / 1; font-weight: 600; white-space: nowrap; }
  #db-result table tbody tr td:nth-child(2) { grid-area: 1 / 2; white-space: nowrap; }
  #db-result table tbody tr td:nth-child(2)::before { content: ', '; font-weight: 400; }
  #db-result table tbody tr td:nth-child(5) { grid-area: 1 / 4; justify-self: end; white-space: nowrap; font-weight: 600; }
  #db-result table tbody tr td:nth-child(3) { grid-area: 2 / 1 / 3 / 4; font-weight: 600; }
  #db-result table tbody tr td:nth-child(4) { grid-area: 3 / 1 / 4 / 4; font-size: 11px; color: var(--muted); font-style: italic; }
  #db-result table tbody tr td:nth-child(4):not(:empty)::before { content: 'Account: '; }
  /* group band rows ("RECEIPTS — 12 vouchers · total …") keep their band */
  #db-result table tbody tr.db-group td[colspan] {
    grid-area: 1 / 1 / 2 / -1 !important;
    background: #e4e8ee; border-top: 2px solid var(--line);
    font-size: 12px; text-transform: uppercase; letter-spacing: .05em;
    color: var(--muted); padding: .55rem .6rem .2rem;
  }
  /* cont-221: the band row must not let its one long line widen the
     max-content tracks past the viewport — single fluid track, text wraps */
  #db-result table tbody tr.db-group { grid-template-columns: minmax(0, 1fr); }
  #db-result table tbody tr.db-group td[colspan] { min-width: 0; overflow-wrap: anywhere; line-height: 1.5; }
  /* subtotal rows: label left, amount right — one line (no date comma) */
  #db-result table tbody tr.db-subtotal td[colspan] { grid-area: 1 / 1 / 2 / 4 !important; }
  #db-result table tbody tr.db-subtotal td:nth-child(2) { grid-area: 1 / 4; justify-self: end; white-space: nowrap; }
  #db-result table tbody tr.db-subtotal td:nth-child(2)::before { content: none; }
  /* empty-state row spans everything */
  #db-result table tbody tr td[colspan] { grid-area: 1 / 1 / 2 / -1 !important; }
}

@media (max-width: 640px) {
  /* ---- shared machinery: the bare tables of the group ---- */
  #page-items > table, #page-groups > table, #page-units > table,
  #page-materials > table, #page-bulkpricing > table, #page-cans #can-list > table,
  #page-production > table, #page-finishedreceive > table,
  #page-semifinishreceive > table, #page-materialsutilization > table,
  #page-semifinishstock #sfs-groups > table, #page-stockreport #stk-groups > table,
  #page-materialsreport #rmr-groups > table,
  #gitems-modal table, #bp-hist-table, #cm-out table,
  #sf-mv-body table, #sm-body table, #rm-body table { display: block; }
  #page-items > table thead, #page-groups > table thead, #page-units > table thead,
  #page-materials > table thead, #page-bulkpricing > table thead, #page-cans #can-list > table thead,
  #page-production > table thead, #page-finishedreceive > table thead,
  #page-semifinishreceive > table thead, #page-materialsutilization > table thead,
  #page-semifinishstock #sfs-groups > table thead, #page-stockreport #stk-groups > table thead,
  #page-materialsreport #rmr-groups > table thead,
  #gitems-modal table thead, #bp-hist-table thead, #cm-out table thead,
  #sf-mv-body table thead, #sm-body table thead, #rm-body table thead { display: none; }
  #page-items > table tbody, #page-groups > table tbody, #page-units > table tbody,
  #page-materials > table tbody, #page-bulkpricing > table tbody, #page-cans #can-list > table tbody,
  #page-production > table tbody, #page-finishedreceive > table tbody,
  #page-semifinishreceive > table tbody, #page-materialsutilization > table tbody,
  #page-semifinishstock #sfs-groups > table tbody, #page-stockreport #stk-groups > table tbody,
  #page-materialsreport #rmr-groups > table tbody,
  #gitems-modal table tbody, #bp-hist-table tbody, #cm-out table tbody,
  #sf-mv-body table tbody, #sm-body table tbody, #rm-body table tbody { display: block; }
  #page-items > table tbody tr, #page-groups > table tbody tr, #page-units > table tbody tr,
  #page-materials > table tbody tr, #page-bulkpricing > table tbody tr, #page-cans #can-list > table tbody tr,
  #page-production > table tbody tr, #page-finishedreceive > table tbody tr,
  #page-semifinishreceive > table tbody tr, #page-materialsutilization > table tbody tr,
  #page-semifinishstock #sfs-groups > table tbody tr, #page-stockreport #stk-groups > table tbody tr,
  #page-materialsreport #rmr-groups > table tbody tr,
  #gitems-modal table tbody tr, #bp-hist-table tbody tr, #cm-out table tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 2px 10px;
    padding: 10px 12px;
  }
  #page-items > table tbody tr + tr, #page-groups > table tbody tr + tr, #page-units > table tbody tr + tr,
  #page-materials > table tbody tr + tr, #page-bulkpricing > table tbody tr + tr, #page-cans #can-list > table tbody tr + tr,
  #page-production > table tbody tr + tr, #page-finishedreceive > table tbody tr + tr,
  #page-semifinishreceive > table tbody tr + tr, #page-materialsutilization > table tbody tr + tr,
  #page-semifinishstock #sfs-groups > table tbody tr + tr, #page-stockreport #stk-groups > table tbody tr + tr,
  #page-materialsreport #rmr-groups > table tbody tr + tr,
  #gitems-modal table tbody tr + tr, #bp-hist-table tbody tr + tr, #cm-out table tbody tr + tr {
    border-top: 1px solid var(--line);
  }
  #page-items > table tbody tr td, #page-groups > table tbody tr td, #page-units > table tbody tr td,
  #page-materials > table tbody tr td, #page-bulkpricing > table tbody tr td, #page-cans #can-list > table tbody tr td,
  #page-production > table tbody tr td, #page-finishedreceive > table tbody tr td,
  #page-semifinishreceive > table tbody tr td, #page-materialsutilization > table tbody tr td,
  #page-semifinishstock #sfs-groups > table tbody tr td, #page-stockreport #stk-groups > table tbody tr td,
  #page-materialsreport #rmr-groups > table tbody tr td,
  #gitems-modal table tbody tr td, #bp-hist-table tbody tr td, #cm-out table tbody tr td {
    border: 0; padding: 0; background: none;
  }
  /* action cells: buttons wrap inside the card */
  #page-items td.actions, #page-groups td.actions, #page-units td.actions,
  #page-materials td.actions, #page-bulkpricing td.actions, #page-cans td.actions,
  #page-production > table td.actions, #page-finishedreceive > table td.actions,
  #page-semifinishreceive > table td.actions, #page-materialsutilization > table td.actions,
  #page-semifinishstock #sfs-groups td.actions, #page-stockreport #stk-groups td.actions,
  #page-materialsreport #rmr-groups td.actions { white-space: normal; max-width: none; }
  #page-items td.actions .btn, #page-groups td.actions .btn, #page-units td.actions .btn,
  #page-materials td.actions .btn, #page-cans td.actions .btn,
  #page-production > table td.actions .btn, #page-finishedreceive > table td.actions .btn,
  #page-semifinishreceive > table td.actions .btn, #page-materialsutilization > table td.actions .btn,
  #page-semifinishstock #sfs-groups td.actions .btn, #page-stockreport #stk-groups td.actions .btn,
  #page-materialsreport #rmr-groups td.actions .btn { margin: 2px 0 2px .3rem; }
  /* banded group rows keep their look */
  #page-items tr.type-head td, #page-materials tr.type-head td, #page-cans tr.type-head td,
  #page-groups tr.type-head td, #page-semifinishstock #sfs-groups tr.type-head td,
  #page-stockreport #stk-groups tr.type-head td, #page-materialsreport #rmr-groups tr.type-head td {
    background: #e4e8ee; border-top: 2px solid var(--line);
    font-size: 12px; text-transform: uppercase; letter-spacing: .05em;
    color: var(--muted); padding: .55rem .6rem .2rem;
  }
  /* figure prefixes + values (the labelled metric cells) */
  #page-items td.num, #page-materials td.num, #page-cans td.num,
  #page-semifinishstock #sfs-groups td.num, #page-stockreport #stk-groups td.num,
  #page-materialsreport #rmr-groups td.num { font-size: 12.5px; font-weight: 600; }
  #page-items td.num::before, #page-materials td.num::before, #page-cans td.num::before,
  #page-semifinishstock #sfs-groups td.num::before, #page-stockreport #stk-groups td.num::before,
  #page-materialsreport #rmr-groups td.num::before {
    color: var(--muted); font-weight: 400; font-size: 11px;
  }
  /* cont-209: the group's record lists (production, receives, utilizations) —
     the first cell is the record's identity (strong) and the action buttons
     ALWAYS sit on their own last line, right-aligned, like the other cards */
  #page-production > table tbody tr td:first-child,
  #page-finishedreceive > table tbody tr td:first-child,
  #page-semifinishreceive > table tbody tr td:first-child,
  #page-materialsutilization > table tbody tr td:first-child,
  #page-finishedutilization > table tbody tr td:first-child,
  #page-semiutilization > table tbody tr td:first-child { font-weight: 600; }
  #page-production > table tbody tr td.actions,
  #page-finishedreceive > table tbody tr td.actions,
  #page-semifinishreceive > table tbody tr td.actions,
  #page-materialsutilization > table tbody tr td.actions,
  #page-finishedutilization > table tbody tr td.actions,
  #page-semiutilization > table tbody tr td.actions { grid-column: 1 / -1; text-align: right; }

  /* band rows and empty states span the whole card (bulk pricing handles its
     own — its band carries inputs, not a colspan) */
  #page-items td[colspan], #page-groups td[colspan], #page-units td[colspan],
  #page-materials td[colspan], #page-cans td[colspan],
  #page-semifinishstock #sfs-groups td[colspan], #page-stockreport #stk-groups td[colspan],
  #page-materialsreport #rmr-groups td[colspan] { grid-area: 1 / 1 / 2 / -1 !important; }

  /* ---- ITEMS (cont-209 re-map): line 1 = name | Stock right (semi-bold),
     line 2 = "Unit: u, Price: p, Ideal: i" full width (price/ideal ride in
     data attributes — those columns are hidden), line 3 = buttons right ---- */
  #page-items > table tbody tr { grid-template-columns: minmax(0, 1fr) auto; }
  #page-items td:nth-child(1) { grid-area: 1 / 1 / 2 / 2; font-weight: 600; }
  #page-items td:nth-child(1) strong { white-space: normal; }
  #page-items td:nth-child(4) { grid-area: 1 / 2 / 2 / 3; justify-self: end; text-align: right; font-size: 12.5px; }
  #page-items td:nth-child(4)::before { content: 'Stock: '; color: var(--muted); font-weight: 400; font-size: 11px; }
  #page-items td:nth-child(2) { grid-area: 2 / 1 / 3 / 3; font-size: 12.5px; }
  #page-items td:nth-child(2)::before { content: 'Unit: '; color: var(--muted); font-weight: 400; font-size: 11px; }
  #page-items td:nth-child(2)[data-price]::after {
    content: ', Price: ' attr(data-price) ', Ideal: ' attr(data-ideal);
    font-weight: 400; font-size: 12.5px;
  }
  #page-items td:nth-child(3), #page-items td:nth-child(5) { display: none; }
  #page-items td:nth-child(6) { grid-area: 3 / 1 / 4 / 3; text-align: right; }

  /* ---- GROUPS: name | Assigned · buttons ---- */
  #page-groups td:nth-child(1) { grid-area: 1 / 1 / 2 / 2; font-weight: 600; }
  #page-groups td:nth-child(2) { grid-area: 1 / 2 / 2 / 3; justify-self: end; font-size: 12.5px; font-weight: 600; }
  #page-groups td:nth-child(2)::before { content: 'Assigned: '; color: var(--muted); font-weight: 400; font-size: 11px; }
  #page-groups td:nth-child(3) { grid-area: 2 / 1 / 3 / 3; text-align: right; }

  /* ---- RAW MATERIALS (cont-209): line 1 = name | Stock w/ unit right,
     line 2 = Known as + Ideal, line 3 = buttons right ---- */
  #page-materials > table tbody tr { grid-template-columns: minmax(0, 1fr) auto; }
  #page-materials td:nth-child(1) { grid-area: 1 / 1 / 2 / 2; font-weight: 600; }
  #page-materials td:nth-child(1) strong { white-space: normal; }
  #page-materials td:nth-child(5) { grid-area: 1 / 2 / 2 / 3; justify-self: end; text-align: right; font-size: 12.5px; }
  #page-materials td:nth-child(5)::before { content: 'Stock: '; color: var(--muted); font-weight: 400; font-size: 11px; }
  #page-materials td:nth-child(5)[data-unit]::after { content: ' ' attr(data-unit); font-weight: 400; font-size: 11px; }
  #page-materials td:nth-child(5) div { display: none; }   /* the low-stock sub-line */
  #page-materials td:nth-child(2) { grid-area: 2 / 1 / 3 / 3; font-size: 12.5px; font-style: italic; color: var(--muted); overflow-wrap: anywhere; }
  #page-materials td:nth-child(2)::before { content: 'Known as: '; font-style: normal; color: var(--muted); font-weight: 400; font-size: 11px; }
  #page-materials td:nth-child(2)::after {
    content: ', Ideal: ' attr(data-ideal);   /* cont-210: one line left to right, like the customers card */
    font-style: normal; font-weight: 400; font-size: 12.5px;
  }
  #page-materials td:nth-child(3), #page-materials td:nth-child(4) { display: none; }
  #page-materials td:nth-child(6) { grid-area: 3 / 1 / 4 / 3; text-align: right; }

  /* ---- RAW MATERIALS REPORT (cont-209): line 1 = name | stock right,
     line 2 = "Opening: q, Purch: q, Prod: q, Used: q, Value: a" (rides on
     data attributes — the figure columns are hidden), line 3 = buttons ---- */
  #page-materialsreport #rmr-groups > table tbody tr { grid-template-columns: minmax(0, 1fr) auto; }
  #page-materialsreport #rmr-groups td:nth-child(1) { grid-area: 1 / 1 / 2 / 2; font-weight: 600; }
  #page-materialsreport .u-quiet { display: none; }
  #page-materialsreport #rmr-groups td:nth-child(6) { grid-area: 1 / 2 / 2 / 3; justify-self: end; text-align: right; font-size: 12.5px; }
  #page-materialsreport #rmr-groups td:nth-child(6)::before { content: 'Stock: '; color: var(--muted); font-weight: 400; font-size: 11px; }
  #page-materialsreport #rmr-groups td:nth-child(2) { grid-area: 2 / 1 / 3 / 3; font-size: 12.5px; }
  #page-materialsreport #rmr-groups td:nth-child(2)::before { content: 'Opening: '; color: var(--muted); font-weight: 400; font-size: 11px; }
  #page-materialsreport #rmr-groups td:nth-child(2)[data-purch]::after {
    content: ', Purch: ' attr(data-purch) ', Prod: ' attr(data-prod) ', Used: ' attr(data-used) ', Value: ' attr(data-value);
    font-weight: 400; font-size: 12.5px;
  }
  #page-materialsreport #rmr-groups td:nth-child(3), #page-materialsreport #rmr-groups td:nth-child(4),
  #page-materialsreport #rmr-groups td:nth-child(5), #page-materialsreport #rmr-groups td:nth-child(7) { display: none; }
  #page-materialsreport #rmr-groups td:nth-child(8) { grid-area: 3 / 1 / 4 / 3; text-align: right; }

  /* ---- STOCK REPORT (cont-209): line 1 = name | closing stock right,
     line 2 = the period's movements + value (data attributes), line 3 =
     Graph / View movements right ---- */
  #page-stockreport #stk-groups > table tbody tr { grid-template-columns: minmax(0, 1fr) auto; }
  #page-stockreport #stk-groups td:nth-child(1) { grid-area: 1 / 1 / 2 / 2; font-weight: 600; }
  #page-stockreport .u-quiet { display: none; }
  #page-stockreport #stk-groups td:nth-child(8) { grid-area: 1 / 2 / 2 / 3; justify-self: end; text-align: right; font-size: 12.5px; }
  #page-stockreport #stk-groups td:nth-child(8)::before { content: 'Stock: '; color: var(--muted); font-weight: 400; font-size: 11px; }
  #page-stockreport #stk-groups td:nth-child(2) { grid-area: 2 / 1 / 3 / 3; font-size: 12.5px; }
  #page-stockreport #stk-groups td:nth-child(2)::before { content: 'Opening: '; color: var(--muted); font-weight: 400; font-size: 11px; }
  #page-stockreport #stk-groups td:nth-child(2)[data-produced]::after {
    content: ', Produced: ' attr(data-produced) ', Purchased: ' attr(data-purchased) ', Sold: ' attr(data-sold) ', Returned: ' attr(data-returned) ', Adjusted: ' attr(data-adjusted) ', Value: ' attr(data-value);
    font-weight: 400; font-size: 12.5px;
  }
  #page-stockreport #stk-groups td:nth-child(3), #page-stockreport #stk-groups td:nth-child(4), #page-stockreport #stk-groups td:nth-child(5),
  #page-stockreport #stk-groups td:nth-child(6), #page-stockreport #stk-groups td:nth-child(7), #page-stockreport #stk-groups td:nth-child(9) { display: none; }
  #page-stockreport #stk-groups td:nth-child(10) { grid-area: 3 / 1 / 4 / 3; text-align: right; }

  /* ---- SEMI FINISH STOCK (cont-209): line 1 = name | stock right, line 2 =
     "Opening: q, Prod: q, Recv: q, Used: q" (data attributes), line 3 =
     Graph / View movements right ---- */
  #page-semifinishstock #sfs-groups > table tbody tr { grid-template-columns: minmax(0, 1fr) auto; }
  #page-semifinishstock #sfs-groups td:nth-child(1) { grid-area: 1 / 1 / 2 / 2; font-weight: 600; }
  #page-semifinishstock .u-quiet { display: none; }
  #page-semifinishstock #sfs-groups td:nth-child(6) { grid-area: 1 / 2 / 2 / 3; justify-self: end; text-align: right; font-size: 12.5px; }
  #page-semifinishstock #sfs-groups td:nth-child(6)::before { content: 'Stock: '; color: var(--muted); font-weight: 400; font-size: 11px; }
  #page-semifinishstock #sfs-groups td:nth-child(2) { grid-area: 2 / 1 / 3 / 3; font-size: 12.5px; }
  #page-semifinishstock #sfs-groups td:nth-child(2)::before { content: 'Opening: '; color: var(--muted); font-weight: 400; font-size: 11px; }
  #page-semifinishstock #sfs-groups td:nth-child(2)[data-prod]::after {
    content: ', Prod: ' attr(data-prod) ', Recv: ' attr(data-recv) ', Used: ' attr(data-used);
    font-weight: 400; font-size: 12.5px;
  }
  #page-semifinishstock #sfs-groups td:nth-child(3), #page-semifinishstock #sfs-groups td:nth-child(4),
  #page-semifinishstock #sfs-groups td:nth-child(5) { display: none; }
  #page-semifinishstock #sfs-groups td:nth-child(7) { grid-area: 3 / 1 / 4 / 3; text-align: right; }

  /* ---- CANS & CARTONS (cont-209): line 1 = name | In stock right, line 2 =
     "Unit: u, Opening: n, Ideal: n", line 3 = buttons right ---- */
  #page-cans #can-list > table tbody tr { grid-template-columns: minmax(0, 1fr) auto; }
  #page-cans #can-list > table tbody tr td:nth-child(1) { grid-area: 1 / 1 / 2 / 2; font-weight: 600; }
  #page-cans #can-list > table tbody tr td:nth-child(1) strong { white-space: normal; }
  #page-cans #can-list > table tbody tr td:nth-child(4) { grid-area: 1 / 2 / 2 / 3; justify-self: end; text-align: right; font-size: 12.5px; }
  #page-cans #can-list > table tbody tr td:nth-child(4)::before { content: 'In stock: '; color: var(--muted); font-weight: 400; font-size: 11px; }
  #page-cans #can-list > table tbody tr td:nth-child(4) div { display: none; }
  #page-cans #can-list > table tbody tr td:nth-child(2) { grid-area: 2 / 1 / 3 / 3; font-size: 12.5px; }
  #page-cans #can-list > table tbody tr td:nth-child(2)::before { content: 'Unit: '; color: var(--muted); font-weight: 400; font-size: 11px; }
  #page-cans #can-list > table tbody tr td:nth-child(2)[data-open]::after {
    content: ', Opening: ' attr(data-open) ', Ideal: ' attr(data-ideal);
    font-weight: 400; font-size: 12.5px;
  }
  #page-cans #can-list > table tbody tr td:nth-child(3),
  #page-cans #can-list > table tbody tr td:nth-child(5) { display: none; }
  #page-cans #can-list > table tbody tr td:nth-child(6) { grid-area: 3 / 1 / 4 / 3; text-align: right; }

  /* ---- UNITS: name | In use · buttons ---- */
  #page-units td:nth-child(1) { grid-area: 1 / 1 / 2 / 2; font-weight: 600; }
  #page-units td:nth-child(2) { grid-area: 1 / 2 / 2 / 3; justify-self: end; font-size: 12.5px; font-weight: 600; }
  #page-units td:nth-child(2)::before { content: 'In use: '; color: var(--muted); font-weight: 400; font-size: 11px; }
  #page-units td:nth-child(3) { grid-area: 2 / 1 / 3 / 3; }

  /* ---- MATERIALS: name | Stock · Known as · Unit/Ideal · buttons ---- */
  #page-materials > table tbody tr { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #page-materials td:nth-child(1) { grid-area: 1 / 1 / 2 / 2; font-weight: 600; }
  #page-materials td:nth-child(1) strong { white-space: normal; }
  #page-materials td:nth-child(5) { grid-area: 1 / 2 / 2 / 3; justify-self: end; text-align: right; }
  #page-materials td:nth-child(5)::before { content: 'Stock: '; }
  #page-materials td:nth-child(2) { grid-area: 2 / 1 / 3 / 3; font-size: 11px; color: var(--muted); font-style: italic; }
  #page-materials td:nth-child(2)::before { content: 'Known as: '; }
  #page-materials td:nth-child(3) { grid-area: 3 / 1 / 4 / 2; font-weight: 400; font-style: italic; color: var(--muted); }
  #page-materials td:nth-child(3)::before { content: 'Unit: '; }
  #page-materials td:nth-child(4) { grid-area: 3 / 2 / 4 / 3; justify-self: end; }
  #page-materials td:nth-child(4)::before { content: 'Ideal: '; }
  #page-materials td:nth-child(6) { grid-area: 4 / 1 / 5 / 3; }

  /* ---- BULK PRICING: item | unit | current price; new-price input +
     History below; the GROUP band keeps its input + Apply ---- */
  #page-bulkpricing > table tbody tr { grid-template-columns: minmax(0, 1fr) auto auto; }
  #page-bulkpricing td:nth-child(1) { grid-area: 1 / 1 / 2 / 2; font-weight: 600; }
  #page-bulkpricing td:nth-child(1) strong { white-space: normal; }
  #page-bulkpricing td:nth-child(2) { grid-area: 1 / 2 / 2 / 3; font-size: 11px; color: var(--muted); font-style: italic; }
  #page-bulkpricing td:nth-child(3) { grid-area: 1 / 3 / 2 / 4; justify-self: end; }
  #page-bulkpricing td:nth-child(3)::before { content: 'Current: '; color: var(--muted); font-weight: 400; font-size: 11px; }
  #page-bulkpricing td:nth-child(4) { grid-area: 2 / 1 / 3 / 3; }
  #page-bulkpricing td:nth-child(5) { grid-area: 2 / 3 / 3 / 4; justify-self: end; }
  /* the band row: same slots, but no metric prefixes; empty rows full width */
  #page-bulkpricing tr.type-head td::before { content: none !important; }
  #page-bulkpricing tr.type-head td:nth-child(1) { font-weight: 600; }
  #page-bulkpricing tr.type-head td:nth-child(2) { justify-self: end; }
  #page-bulkpricing tr.type-head td:nth-child(3) { justify-self: end; }
  #page-bulkpricing tr:not(.type-head) td[colspan] { grid-area: 1 / 1 / 2 / -1 !important; }

  /* ---- CANS & CARTONS: name | In stock · Unit/Ideal · Opening · buttons
     (the map works with AND without the Actions column) ---- */
  #page-cans > table tbody tr, #page-cans #can-list > table tbody tr {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  #page-cans #can-list td:nth-child(1) { grid-area: 1 / 1 / 2 / 2; font-weight: 600; }
  #page-cans #can-list td:nth-child(1) strong { white-space: normal; }
  #page-cans #can-list td:nth-child(4) { grid-area: 1 / 2 / 2 / 3; justify-self: end; text-align: right; }
  #page-cans #can-list td:nth-child(4)::before { content: 'In stock: '; }
  #page-cans #can-list td:nth-child(2) { grid-area: 2 / 1 / 3 / 2; font-weight: 400; font-style: italic; color: var(--muted); }
  #page-cans #can-list td:nth-child(2)::before { content: 'Unit: '; }
  #page-cans #can-list td:nth-child(5) { grid-area: 2 / 2 / 3 / 3; justify-self: end; }
  #page-cans #can-list td:nth-child(5)::before { content: 'Ideal: '; }
  #page-cans #can-list td:nth-child(3) { grid-area: 3 / 1 / 4 / 3; }
  #page-cans #can-list td:nth-child(3)::before { content: 'Opening: '; }
  #page-cans #can-list td:nth-child(6) { grid-area: 4 / 1 / 5 / 3; }

  /* ---- PRODUCTION / FINISHED / SEMI-FINISHED RECEIVE / MATERIALS
     UTILIZATION: "number, date" (status right) · items · by · buttons ---- */
  #page-production > table tbody tr,
  #page-finishedreceive > table tbody tr,
  #page-semifinishreceive > table tbody tr,
  #page-materialsutilization > table tbody tr {
    grid-template-columns: min-content max-content minmax(0, 1fr) auto;
    gap: 2px 0; /* no column gap — the comma prefix carries its own spacing */
  }
  #page-production > table td:nth-child(1), #page-finishedreceive > table td:nth-child(1),
  #page-semifinishreceive > table td:nth-child(1), #page-materialsutilization > table td:nth-child(1) {
    grid-area: 1 / 1 / 2 / 2; font-weight: 600;
  }
  #page-production > table td:nth-child(1) strong, #page-finishedreceive > table td:nth-child(1) strong,
  #page-semifinishreceive > table td:nth-child(1) strong, #page-materialsutilization > table td:nth-child(1) strong {
    white-space: nowrap;
  }
  #page-production > table td:nth-child(2), #page-finishedreceive > table td:nth-child(2),
  #page-semifinishreceive > table td:nth-child(2), #page-materialsutilization > table td:nth-child(2) {
    grid-area: 1 / 2 / 2 / 3; white-space: nowrap;
  }
  #page-production > table td:nth-child(2)::before, #page-finishedreceive > table td:nth-child(2)::before,
  #page-semifinishreceive > table td:nth-child(2)::before, #page-materialsutilization > table td:nth-child(2)::before {
    content: ', '; font-weight: 400;
  }
  #page-production > table td:nth-child(3), #page-finishedreceive > table td:nth-child(3),
  #page-semifinishreceive > table td:nth-child(3), #page-materialsutilization > table td:nth-child(3) {
    grid-area: 1 / 4 / 2 / 5; justify-self: end; text-align: right;
    font-size: 12.5px;
  }
  #page-production > table td:nth-child(3) .chip, #page-finishedreceive > table td:nth-child(3) .chip,
  #page-semifinishreceive > table td:nth-child(3) .chip, #page-materialsutilization > table td:nth-child(3) .chip {
    background: transparent; border: 0; padding: 0;
    font-weight: 400; font-style: italic;
  }
  #page-production > table td:nth-child(4), #page-finishedreceive > table td:nth-child(4),
  #page-semifinishreceive > table td:nth-child(4), #page-materialsutilization > table td:nth-child(4) {
    grid-area: 2 / 1 / 3 / 5; font-weight: 600;
  }
  #page-production > table td:nth-child(5), #page-finishedreceive > table td:nth-child(5),
  #page-semifinishreceive > table td:nth-child(5), #page-materialsutilization > table td:nth-child(5) {
    grid-area: 3 / 1 / 4 / 5; font-size: 11px; color: var(--muted); font-style: italic;
  }
  #page-production > table td:nth-child(5)::before { content: 'Produced by '; }
  #page-finishedreceive > table td:nth-child(5)::before,
  #page-semifinishreceive > table td:nth-child(5)::before { content: 'Delivered by '; }
  #page-materialsutilization > table td:nth-child(5)::before { content: 'Received by '; }
  #page-production > table td:nth-child(6), #page-finishedreceive > table td:nth-child(6),
  #page-semifinishreceive > table td:nth-child(6), #page-materialsutilization > table td:nth-child(6) {
    grid-area: 4 / 1 / 5 / 5; text-align: right;
  }
  /* deleted rows: the reason line spans the card, BELOW the number/date line
     (tr + class beats the generic td[colspan] rule below it) */
  #page-production > table tbody tr td.void-msg, #page-finishedreceive > table tbody tr td.void-msg,
  #page-semifinishreceive > table tbody tr td.void-msg, #page-materialsutilization > table tbody tr td.void-msg {
    grid-area: 2 / 1 / 3 / -1 !important;
  }
  /* empty-state rows */
  #page-production > table td[colspan], #page-finishedreceive > table td[colspan],
  #page-semifinishreceive > table td[colspan], #page-materialsutilization > table td[colspan] {
    grid-area: 1 / 1 / 2 / -1 !important;
  }

  /* cont-209: the old 3-column cards for SEMI STOCK / STOCK REPORT / RAW
     MATERIALS REPORT were replaced by the cont-209 one-line-figure cards
     mapped with the ITEMS block above (semi stock keeps its own map below) */

  /* ---- the small modal tables: name | value cards ---- */
  #gitems-modal table tbody tr td:nth-child(1) { grid-area: 1 / 1 / 2 / 2; font-weight: 600; }
  #gitems-modal table tbody tr td:nth-child(2) { grid-area: 1 / 2 / 2 / 3; justify-self: end; font-weight: 600; }
  #gitems-modal table tbody tr td[colspan] { grid-area: 1 / 1 / 2 / -1 !important; }
  #bp-hist-table tbody tr td:nth-child(1) { grid-area: 1 / 1 / 2 / 2; font-weight: 600; }
  #bp-hist-table tbody tr td:nth-child(3) { grid-area: 1 / 2 / 2 / 3; justify-self: end; font-weight: 600; }
  #bp-hist-table tbody tr td:nth-child(2) { grid-area: 2 / 1 / 3 / 3; font-size: 11px; color: var(--muted); font-style: italic; }
  #bp-hist-table tbody tr td[colspan] { grid-area: 1 / 1 / 2 / -1 !important; }
  /* can movements: date | qty · stock after · reason */
  #cm-out table tbody tr { grid-template-columns: minmax(0, 1fr) auto; }
  #cm-out table tbody tr td:nth-child(1) { grid-area: 1 / 1 / 2 / 2; font-weight: 600; }
  #cm-out table tbody tr td:nth-child(2) { grid-area: 1 / 2 / 2 / 3; justify-self: end; font-weight: 600; }
  #cm-out table tbody tr td:nth-child(3) { grid-area: 2 / 1 / 3 / 2; font-size: 12.5px; }
  #cm-out table tbody tr td:nth-child(3)::before { content: 'Stock after: '; color: var(--muted); font-weight: 400; font-size: 11px; }
  #cm-out table tbody tr td:nth-child(4) { grid-area: 3 / 1 / 4 / 3; font-size: 11px; color: var(--muted); font-style: italic; }

  /* ---- movements popups ( Produced/Received/Consumed/... sections ):
     each row reads as one wrapped inline line ---- */
  #sf-mv-body table tbody tr, #sm-body table tbody tr, #rm-body table tbody tr {
    display: block; padding: 8px 12px; border-top: 1px solid var(--line);
  }
  #sf-mv-body table tbody tr + tr, #sm-body table tbody tr + tr,
  #rm-body table tbody tr + tr { border-top: 1px solid var(--line); }
  #sf-mv-body td, #sm-body td, #rm-body td {
    display: inline; border: 0; padding: 0 8px 0 0; background: none;
  }
  #sf-mv-body td.num, #sm-body td.num, #rm-body td.num { font-weight: 600; }

  /* wide label/value tables inside details modals scroll, never clip */
  #prod-view-modal .modal-box, #fr-view-modal .modal-box, #sfr-view-modal .modal-box,
  #mu-view-modal .modal-box, #sfs-mv-modal .modal-box, #stk-mv-modal .modal-box,
  #rmr-mv-modal .modal-box, #can-move-modal .modal-box, #gitems-modal .modal-box,
  #bp-hist-modal .modal-box { overflow-x: auto; }
}

@media (max-width: 640px) {
  #page-finishedutilization > table,
  #page-semiutilization > table { display: block; }
  #page-finishedutilization > table thead,
  #page-semiutilization > table thead { display: none; }
  #page-finishedutilization > table tbody,
  #page-semiutilization > table tbody { display: block; }
  #page-finishedutilization > table tbody tr,
  #page-semiutilization > table tbody tr {
    display: grid;
    grid-template-columns: min-content max-content minmax(0, 1fr) auto;
    gap: 2px 0; /* no column gap — the comma prefix carries its own spacing */
    padding: 10px 12px;
  }
  #page-finishedutilization > table tbody tr + tr,
  #page-semiutilization > table tbody tr + tr { border-top: 1px solid var(--line); }
  #page-finishedutilization > table tbody tr td,
  #page-semiutilization > table tbody tr td { border: 0; padding: 0; background: none; }
  /* line 1: number + comma + date (status right) */
  #page-finishedutilization > table td:nth-child(1), #page-semiutilization > table td:nth-child(1) {
    grid-area: 1 / 1 / 2 / 2; font-weight: 600;
  }
  #page-finishedutilization > table td:nth-child(1) strong, #page-semiutilization > table td:nth-child(1) strong { white-space: nowrap; }
  #page-finishedutilization > table td:nth-child(2), #page-semiutilization > table td:nth-child(2) {
    grid-area: 1 / 2 / 2 / 3; white-space: nowrap;
  }
  #page-finishedutilization > table td:nth-child(2)::before, #page-semiutilization > table td:nth-child(2)::before {
    content: ', '; font-weight: 400;
  }
  #page-finishedutilization > table td:nth-child(3), #page-semiutilization > table td:nth-child(3) {
    grid-area: 1 / 4 / 2 / 5; justify-self: end; text-align: right; font-size: 12.5px;
  }
  #page-finishedutilization > table td:nth-child(3) .chip, #page-semiutilization > table td:nth-child(3) .chip {
    background: transparent; border: 0; padding: 0;
    font-weight: 400; font-style: italic;
  }
  /* line 2: the items list */
  #page-finishedutilization > table td:nth-child(4), #page-semiutilization > table td:nth-child(4) {
    grid-area: 2 / 1 / 3 / 5; font-weight: 600;
  }
  /* line 3: received by (quiet) */
  #page-finishedutilization > table td:nth-child(5), #page-semiutilization > table td:nth-child(5) {
    grid-area: 3 / 1 / 4 / 5; font-size: 11px; color: var(--muted); font-style: italic;
  }
  #page-finishedutilization > table td:nth-child(5)::before, #page-semiutilization > table td:nth-child(5)::before {
    content: 'Received by ';
  }
  /* line 4: the buttons, right aligned */
  #page-finishedutilization > table td:nth-child(6), #page-semiutilization > table td:nth-child(6) {
    grid-area: 4 / 1 / 5 / 5; text-align: right;
  }
  #page-finishedutilization > table td.actions .btn, #page-semiutilization > table td.actions .btn {
    white-space: normal; max-width: none; margin: 2px 0 2px .3rem;
  }
  /* deleted vouchers: the reason line spans the card, below the number/date */
  #page-finishedutilization > table tbody tr td.void-msg, #page-semiutilization > table tbody tr td.void-msg {
    grid-area: 2 / 1 / 3 / -1 !important;
  }
  /* empty-state rows */
  #page-finishedutilization > table td[colspan], #page-semiutilization > table td[colspan] {
    grid-area: 1 / 1 / 2 / -1 !important;
  }
  /* the details modal's label/value tables scroll, never clip */
  #fu-view-modal .modal-box, #su-view-modal .modal-box { overflow-x: auto; }
}

@media (max-width: 640px) {
  #sup-stmt-result table { display: block; }
  #sup-stmt-result table thead { display: none; }
  #sup-stmt-result table tbody { display: block; }
  #sup-stmt-result table tbody tr {
    display: grid;
    grid-template-columns: min-content max-content minmax(0, 1fr) minmax(auto, 46vw);
    gap: 2px 6px;
    padding: 10px 12px;
  }
  #sup-stmt-result table tbody tr + tr { border-top: 1px solid var(--line); }
  #sup-stmt-result table tbody tr td { border: 0; padding: 0; background: none; text-align: left; }
  #sup-stmt-result table tbody tr td:nth-child(1) { grid-area: 1 / 1; white-space: nowrap; }
  #sup-stmt-result table tbody tr td:nth-child(2) { grid-area: 1 / 2; }
  #sup-stmt-result table tbody tr td:nth-child(2) .chip {
    background: transparent; border: 0; padding: 0; font-weight: 400; font-size: 11px;
  }
  #sup-stmt-result table tbody tr td:nth-child(3) {
    grid-area: 1 / 3; font-size: 11px; color: var(--muted); font-style: italic;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  #sup-stmt-result table tbody tr td:nth-child(7) { grid-area: 1 / 4; justify-self: end; white-space: nowrap; }
  #sup-stmt-result table tbody tr td:nth-child(4) {
    grid-area: 2 / 1 / 3 / -1; text-align: left;
    font-size: 11px; color: var(--muted); font-style: italic;
  }
  #sup-stmt-result table tbody tr td:nth-child(4):empty { display: none; }
  #sup-stmt-result table tbody tr td:nth-child(5) { grid-area: 3 / 1 / 4 / -1; text-align: left; font-size: 12.5px; }
  /* the desktop "—" dash span is hidden here; the Debit/Credit labels are
     gated on it with :has so a credit-only row reads "Credit: x" */
  #sup-stmt-result table tbody tr td:nth-child(5) .dmuted { display: none; }
  #sup-stmt-result table tbody tr td:nth-child(5):not(:has(.dmuted))::before {
    content: 'Debit: '; color: var(--muted); font-weight: 400; font-size: 11px;
  }
  #sup-stmt-result table tbody tr td:nth-child(5):not(:has(.dmuted))[data-cr]::after {
    content: ', Credit: ' attr(data-cr); color: var(--muted); font-weight: 400; font-size: 11px;
  }
  #sup-stmt-result table tbody tr td:nth-child(5):has(.dmuted)[data-cr]::after {
    content: 'Credit: ' attr(data-cr); color: var(--muted); font-weight: 400; font-size: 11px;
  }
  #sup-stmt-result table tbody tr td:nth-child(5):has(.dmuted):not([data-cr]) { display: none; }
  #sup-stmt-result table tbody tr td:nth-child(6) { display: none; }
}

@media (max-width: 640px) {
  #page-items > table tbody tr, #page-groups > table tbody tr,
  #page-units > table tbody tr, #page-materials > table tbody tr {
    display: flex; flex-wrap: wrap; width: 100%; min-width: 100%; max-width: 100%;
    box-sizing: border-box; align-items: baseline; gap: 3px 0; padding: 10px 12px;
  }
  /* line 1: name takes the rest, the metric hugs the right edge */
  #page-items > table tbody tr td:nth-child(1),
  #page-groups > table tbody tr td:nth-child(1),
  #page-units > table tbody tr td:nth-child(1),
  #page-materials > table tbody tr td:nth-child(1) {
    order: 1; flex: 1 1 auto; min-width: 0; font-weight: 600;
  }
  #page-items > table tbody tr td:nth-child(1) strong,
  #page-materials > table tbody tr td:nth-child(1) strong { white-space: normal; }
  #page-items > table tbody tr td:nth-child(4),
  #page-groups > table tbody tr td:nth-child(2),
  #page-units > table tbody tr td:nth-child(2),
  #page-materials > table tbody tr td:nth-child(5) {
    order: 2; flex: 0 0 auto; text-align: right; font-size: 12.5px; font-weight: 600;
  }
  #page-groups > table tbody tr td:nth-child(2)::before { content: 'Assigned: '; }
  #page-units > table tbody tr td:nth-child(2)::before { content: 'In use: '; }
  /* line 2: the comma-separated figures, full width */
  #page-items > table tbody tr td:nth-child(2),
  #page-materials > table tbody tr td:nth-child(2) {
    order: 3; flex: 1 1 100%; min-width: 0; font-size: 12.5px;
  }
  /* line 3: the buttons — one row, right aligned */
  #page-items > table tbody tr td:nth-child(6),
  #page-groups > table tbody tr td:nth-child(3),
  #page-units > table tbody tr td:nth-child(3),
  #page-materials > table tbody tr td:nth-child(6) {
    order: 4; flex: 1 1 100%; min-width: 0;
    display: flex; flex-wrap: nowrap; justify-content: flex-end; gap: 6px;
  }
  #page-items > table tbody tr td:nth-child(6) .btn,
  #page-groups > table tbody tr td:nth-child(3) .btn,
  #page-units > table tbody tr td:nth-child(3) .btn,
  #page-materials > table tbody tr td:nth-child(6) .btn { margin: 2px 0; flex-shrink: 1; }
  /* hidden raw columns (values ride the line-2 data attributes) */
  #page-items > table tbody tr td:nth-child(3),
  #page-items > table tbody tr td:nth-child(5),
  #page-materials > table tbody tr td:nth-child(3),
  #page-materials > table tbody tr td:nth-child(4) { display: none; }
  /* band + empty rows stay full width */
  #page-items > table tbody tr td[colspan], #page-groups > table tbody tr td[colspan],
  #page-units > table tbody tr td[colspan], #page-materials > table tbody tr td[colspan] {
    flex: 1 1 100%; order: 0;
  }
  /* materials: stock with its unit; the low-stock sub-line stays hidden */
  #page-materials > table tbody tr td:nth-child(5)[data-unit]::after { content: ' ' attr(data-unit); font-weight: 400; font-size: 11px; }
  #page-materials > table tbody tr td:nth-child(5) div { display: none; }
  /* units/groups counts keep the muted label style */
  #page-groups > table tbody tr td:nth-child(2)::before,
  #page-units > table tbody tr td:nth-child(2)::before {
    color: var(--muted); font-weight: 400; font-size: 11px;
  }
}


/* ==== cont-218: JS-enforced duplicates of every mobile rule — active when core.js sets html.mob (covers phone browsers whose layout viewport exceeds 640px, e.g. "desktop site" mode) ==== */
html.mob .content{padding: .8rem;}
html.mob .page-head h2{font-size: 18px;}
html.mob /* the head action row owns a full line; fixed-width inputs (the dashboard's
     style="width:360px" search) shrink to it instead of overflowing */
  .head-actions{width: 100%; margin-left: 0; flex-wrap: wrap;}
html.mob .head-actions input, html.mob .head-actions select{width: 100% !important; flex: 1 1 160px; min-width: 0;}
html.mob /* iOS zooms any focused input whose font is smaller than 16px — 16 everywhere */
  input, html.mob select, html.mob textarea, html.mob .combo-input{font-size: 16px;}
html.mob /* tighter cells so more columns fit before the sideways scroll starts */
  th, html.mob td{padding: .45rem .5rem; font-size: 13px;}
html.mob th{font-size: 11px;}
html.mob /* comfortable tap targets */
  .btn{padding: .5rem .85rem;}
html.mob .btn.small{padding: .45rem .7rem;}
html.mob .nav-item{padding: .65rem 1rem .65rem 1.25rem;}
html.mob /* filter rows: every control takes a comfortable width and wraps */
  .filters input, html.mob .filters select, html.mob .filters .combo{flex: 1 1 150px; min-width: 130px;}
html.mob /* the bill line stacks: the item picker owns row 1, html.mob qty · rate · amount · ✕
     share row 2 — no more 60px-wide selects on a 360px screen */
  .line{grid-template-columns: 1fr 1fr 1fr 32px;}
html.mob .line > *:first-child{grid-column: 1 / -1;}
html.mob .cost-line{grid-template-columns: 1fr 110px 32px;}
html.mob .prod-mat{grid-template-columns: 1fr 1fr 32px;}
html.mob /* the receive/production popups' fixed 130px qty column (page-scoped
     styles) — same stack: picker full row, html.mob qty + ✕ under it. The body
     prefix out-specifies the page-injected <style> blocks. */
  body #fr-modal .fr-line, html.mob body #mu-modal .mu-line, html.mob body #prod-modal .prod-line, html.mob body #sfr-modal .sfr-line{grid-template-columns: 1fr 110px 32px;}
html.mob body #fr-modal .fr-line > *:first-child, html.mob body #mu-modal .mu-line > *:first-child, html.mob body #prod-modal .prod-line > *:first-child, html.mob body #sfr-modal .sfr-line > *:first-child{grid-column: 1 / -1;}
html.mob body #fr-modal .fr-meta, html.mob body #mu-modal .mu-meta, html.mob body #prod-modal .prod-meta, html.mob body #sfr-modal .sfr-meta{grid-template-columns: 1fr;}
html.mob .totals-bar{flex-wrap: wrap; gap: .5rem 1.2rem;}
html.mob .combo-menu{max-width: min(92vw, 340px);}
html.mob .cards{grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));}
html.mob .card-value{font-size: 19px;}
html.mob /* slim topbar: the avatar carries the identity, html.mob the name text goes */
  #user-name{display: none;}
html.mob /* toasts span the width instead of pinching in the middle */
  .toast{left: .6rem; right: .6rem; transform: none; max-width: none; text-align: center;}

html.mob /* cont-193/194: filter order on phones — search, html.mob status, html.mob date from, html.mob date
     to, html.mob then the remaining buttons; the Date from / Date to placeholders are
     the required+placeholder overlay from cont-209 */
  #page-bills .filters > #bill-search{order: 1;}
html.mob #page-bills .filters > #bill-status{order: 2;}
html.mob #page-bills .filters > #bill-from{order: 3;}
html.mob #page-bills .filters > #bill-to{order: 4;}
html.mob #page-bills .filters > #bill-today{order: 5;}
html.mob #page-bills .filters > #bill-reset{order: 6;}
html.mob #page-bills table.bills-list{display: block;}
html.mob #page-bills table.bills-list thead{display: none;}
html.mob #page-bills table.bills-list tbody{display: block;}
html.mob #page-bills table.bills-list tbody tr{display: grid;
    /* col1 is min-content so the "Approved Modified" tip (which sits under the
       bill no) cannot widen the column and push the comma off the number;
       col4 caps at 46vw so a long button row wraps instead of clipping the
       net amount / buttons off the right edge */
    grid-template-columns: min-content max-content minmax(0, 1fr) minmax(auto, 46vw);
    gap: 2px 0;
    padding: 10px 12px;}
html.mob #page-bills table.bills-list tbody tr + tr{border-top: 1px solid var(--line);}
html.mob #page-bills table.bills-list tbody tr td{border: 0; padding: 0; background: none;}
html.mob /* LEFT · line 1: bill no + comma + date (the comma rides in front of the
     date — after the number there may be the "Approved Modified" tip).
     nowrap on the number: min-content sizing must not break it at the
     hyphen (FB- / 0142). */
  #page-bills table.bills-list tbody tr td:nth-child(1){grid-area: 1 / 1;}
html.mob #page-bills table.bills-list tbody tr td:nth-child(1) strong{white-space: nowrap;}
html.mob #page-bills table.bills-list tbody tr td:nth-child(2){grid-area: 1 / 2;}
html.mob #page-bills table.bills-list tbody tr td:nth-child(2)::before{content: ', '; font-weight: 400;}
html.mob /* LEFT · line 2: customer name (cont-193: swapped with ordered-by — the
     owner wants customer | status on one line, html.mob ordered-by below) */
  #page-bills table.bills-list tbody tr td:nth-child(4){grid-area: 2 / 1 / 3 / 4; font-weight: 600;}
html.mob /* RIGHT · line 1: the net amount */
  #page-bills table.bills-list tbody tr td:nth-child(5){grid-area: 1 / 4; justify-self: end;
    font-weight: 600; white-space: nowrap;}
html.mob #page-bills table.bills-list tbody tr td:nth-child(3){grid-area: 2 / 4; justify-self: end; text-align: right;
    font-size: 12.5px;}
html.mob #page-bills table.bills-list tbody tr .badge{background: transparent; padding: 0; font-weight: 400;
    font-style: italic; font-size: 12.5px;}
html.mob /* line 3: ordered by (quiet) */
  #page-bills table.bills-list tbody tr td:nth-child(6){grid-area: 3 / 1 / 4 / 4;
    font-size: 11px; color: var(--muted); font-style: italic;}
html.mob #page-bills table.bills-list tbody tr td:nth-child(6)::before{content: 'Ordered by ';}
html.mob /* line 4: the buttons, html.mob one row, html.mob right aligned */
  #page-bills table.bills-list tbody tr td:nth-child(7){grid-area: 4 / 1 / 5 / -1; text-align: right;
    white-space: normal;}
html.mob #page-bills table.bills-list tbody tr td:nth-child(7) .btn{margin: 2px 0 2px .3rem;}
html.mob /* full-width informational rows (empty list message, html.mob deleted-bill reason —
     row 2, html.mob directly under the no/date line, html.mob so no blank row in between).
     cont-193: the message cell IS the status cell positionally, html.mob so the
     status mapping's justify-self/text-align leak onto it — stretch it back
     and keep the deletion message LEFT aligned (owner request) */
  #page-bills table.bills-list tbody tr td[colspan]{grid-area: 2 / 1 / 3 / -1 !important;
    justify-self: stretch; text-align: left;}

html.mob .filters input[type="date"]{position: relative;}
html.mob .filters input[type="date"]:not(:valid)::before{content: attr(placeholder); position: absolute; left: 12px; top: 50%;
    transform: translateY(-50%); color: var(--muted); pointer-events: none;}
html.mob /* browsers that DO draw the native mm/dd/yyyy ghost (desktop Chrome, html.mob Android) must not double it up with the overlay */
  .filters input[type="date"]:not(:valid)::-webkit-datetime-edit{color: transparent;}
html.mob #page-statement table, html.mob #page-ledger table, html.mob #page-mycustomerreport table{display: block;}
html.mob #page-statement table thead, html.mob #page-ledger table thead, html.mob #page-mycustomerreport table thead{display: none;}
html.mob #page-statement table tbody, html.mob #page-ledger table tbody, html.mob #page-mycustomerreport table tbody{display: block;}
html.mob #page-statement table tbody tr, html.mob #page-ledger table tbody tr, html.mob #page-mycustomerreport table tbody tr{display: grid;
    grid-template-columns: max-content max-content minmax(0, 1fr) minmax(auto, 46vw);
    gap: 2px 0;
    padding: 10px 12px;}
html.mob #page-statement table tbody tr + tr, html.mob #page-ledger table tbody tr + tr, html.mob #page-mycustomerreport table tbody tr + tr{border-top: 1px solid var(--line);}
html.mob #page-statement table tbody tr td, html.mob #page-ledger table tbody tr td, html.mob #page-mycustomerreport table tbody tr td{border: 0; padding: 0; background: none;}
html.mob /* LEFT · line 1: date · type */
  #page-statement table tbody tr td:nth-child(1), html.mob #page-ledger table tbody tr td:nth-child(1), html.mob #page-mycustomerreport table tbody tr td:nth-child(1){grid-area: 1 / 1; font-weight: 600; white-space: nowrap;}
html.mob #page-statement table tbody tr td:nth-child(2), html.mob #page-ledger table tbody tr td:nth-child(2), html.mob #page-mycustomerreport table tbody tr td:nth-child(2){grid-area: 1 / 2; font-size: 12.5px;}
html.mob #page-statement table tbody tr td:nth-child(2)::before, html.mob #page-ledger table tbody tr td:nth-child(2)::before, html.mob #page-mycustomerreport table tbody tr td:nth-child(2)::before{content: ' ·  ';}
html.mob /* the type chip renders as plain italic text in its color (bills-status style) */
  #page-statement table tbody tr .chip, html.mob #page-ledger table tbody tr .chip, html.mob #page-mycustomerreport table tbody tr .chip{background: transparent; border: 0; padding: 0;
    font-weight: 400; font-style: italic; font-size: 12.5px;}
html.mob /* LEFT · line 2: description, html.mob line 3: reference */
  #page-statement table tbody tr td:nth-child(4), html.mob #page-ledger table tbody tr td:nth-child(4), html.mob #page-mycustomerreport table tbody tr td:nth-child(4){grid-area: 2 / 1 / 3 / 4; font-weight: 600;}
html.mob #page-statement table tbody tr td:nth-child(3), html.mob #page-ledger table tbody tr td:nth-child(3), html.mob #page-mycustomerreport table tbody tr td:nth-child(3){grid-area: 3 / 1 / 4 / 4;
    font-size: 11px; color: var(--muted); font-style: italic;}
html.mob #page-statement table tbody tr td:nth-child(3)::before, html.mob #page-ledger table tbody tr td:nth-child(3)::before, html.mob #page-mycustomerreport table tbody tr td:nth-child(3)::before{content: 'Ref: ';}
html.mob /* RIGHT · debit / credit / balance, html.mob tagged so the dashes stay meaningful */
  #page-statement table tbody tr td:nth-child(5), html.mob #page-ledger table tbody tr td:nth-child(5), html.mob #page-mycustomerreport table tbody tr td:nth-child(5), html.mob #page-statement table tbody tr td:nth-child(6), html.mob #page-ledger table tbody tr td:nth-child(6), html.mob #page-mycustomerreport table tbody tr td:nth-child(6), html.mob #page-statement table tbody tr td:nth-child(7), html.mob #page-ledger table tbody tr td:nth-child(7), html.mob #page-mycustomerreport table tbody tr td:nth-child(7){font-weight: 600; white-space: nowrap;}
html.mob #page-statement table tbody tr td:nth-child(5), html.mob #page-ledger table tbody tr td:nth-child(5), html.mob #page-mycustomerreport table tbody tr td:nth-child(5){grid-area: 1 / 4; justify-self: end;}
html.mob #page-statement table tbody tr td:nth-child(6), html.mob #page-ledger table tbody tr td:nth-child(6), html.mob #page-mycustomerreport table tbody tr td:nth-child(6){grid-area: 2 / 4; justify-self: end;}
html.mob #page-statement table tbody tr td:nth-child(7), html.mob #page-ledger table tbody tr td:nth-child(7), html.mob #page-mycustomerreport table tbody tr td:nth-child(7){grid-area: 3 / 4; justify-self: end;}
html.mob #page-statement table tbody tr td:nth-child(5)::before, html.mob #page-ledger table tbody tr td:nth-child(5)::before, html.mob #page-mycustomerreport table tbody tr td:nth-child(5)::before{content: 'Dr '; color: var(--muted); font-weight: 400; font-size: 11px;}
html.mob #page-statement table tbody tr td:nth-child(6)::before, html.mob #page-ledger table tbody tr td:nth-child(6)::before, html.mob #page-mycustomerreport table tbody tr td:nth-child(6)::before{content: 'Cr '; color: var(--muted); font-weight: 400; font-size: 11px;}
html.mob #page-statement table tbody tr td:nth-child(7)::before, html.mob #page-ledger table tbody tr td:nth-child(7)::before, html.mob #page-mycustomerreport table tbody tr td:nth-child(7)::before{content: 'Bal '; color: var(--muted); font-weight: 400; font-size: 11px;}
html.mob /* full-width informational rows, html.mob should any appear */
  #page-statement table tbody tr td[colspan], html.mob #page-ledger table tbody tr td[colspan], html.mob #page-mycustomerreport table tbody tr td[colspan]{grid-column: 1 / -1 !important;}

html.mob #page-queue table.m-list, html.mob #page-returns table.m-list, html.mob #page-delivery table.m-list, html.mob #page-discounts table.m-list, html.mob #page-expenses table.m-list, html.mob #page-payments table.m-list, html.mob #page-transfers table.m-list{display: block;}
html.mob #page-queue table.m-list thead, html.mob #page-returns table.m-list thead, html.mob #page-delivery table.m-list thead, html.mob #page-discounts table.m-list thead, html.mob #page-expenses table.m-list thead, html.mob #page-payments table.m-list thead, html.mob #page-transfers table.m-list thead{display: none;}
html.mob #page-queue table.m-list tbody, html.mob #page-returns table.m-list tbody, html.mob #page-delivery table.m-list tbody, html.mob #page-discounts table.m-list tbody, html.mob #page-expenses table.m-list tbody, html.mob #page-payments table.m-list tbody, html.mob #page-transfers table.m-list tbody{display: block;}
html.mob #page-queue table.m-list tbody tr, html.mob #page-returns table.m-list tbody tr, html.mob #page-delivery table.m-list tbody tr, html.mob #page-discounts table.m-list tbody tr, html.mob #page-expenses table.m-list tbody tr, html.mob #page-payments table.m-list tbody tr, html.mob #page-transfers table.m-list tbody tr{display: grid;
    grid-template-columns: min-content max-content minmax(0, 1fr) minmax(auto, 46vw);
    gap: 2px 0;
    padding: 10px 12px;}
html.mob #page-queue table.m-list tbody tr + tr, html.mob #page-returns table.m-list tbody tr + tr, html.mob #page-delivery table.m-list tbody tr + tr, html.mob #page-discounts table.m-list tbody tr + tr, html.mob #page-expenses table.m-list tbody tr + tr, html.mob #page-payments table.m-list tbody tr + tr, html.mob #page-transfers table.m-list tbody tr + tr{border-top: 1px solid var(--line);}
html.mob #page-queue table.m-list tbody tr td, html.mob #page-returns table.m-list tbody tr td, html.mob #page-delivery table.m-list tbody tr td, html.mob #page-discounts table.m-list tbody tr td, html.mob #page-expenses table.m-list tbody tr td, html.mob #page-payments table.m-list tbody tr td, html.mob #page-transfers table.m-list tbody tr td{border: 0; padding: 0; background: none;}
html.mob /* cont-194: per-page filter order on phones — search/type first, html.mob then the
     dates, html.mob then the remaining controls */
  #page-returns .filters > #ret-search{order: 1;}
html.mob #page-returns .filters > #ret-status{order: 2;}
html.mob #page-returns .filters > #ret-from{order: 3;}
html.mob #page-returns .filters > #ret-to{order: 4;}
html.mob #page-returns .filters > #ret-today{order: 5;}
html.mob #page-returns .filters > #ret-reset{order: 6;}
html.mob #page-delivery .filters > #dlv-from{order: 1;}
html.mob #page-delivery .filters > #dlv-to{order: 2;}
html.mob #page-delivery .filters > #dlv-search{order: 3;}
html.mob #page-delivery .filters > #dlv-today{order: 4;}
html.mob #page-delivery .filters > #dlv-reset{order: 5;}
html.mob #page-payments .filters > #pay-search{order: 1;}
html.mob #page-payments .filters > #pay-account{order: 2;}
html.mob #page-payments .filters > #pay-from{order: 3;}
html.mob #page-payments .filters > #pay-to{order: 4;}
html.mob #page-payments .filters > #pay-status{order: 5;}
html.mob #page-payments .filters > #pay-today{order: 6;}
html.mob #page-payments .filters > #pay-reset{order: 7;}
html.mob #page-discounts .filters > #dis-search{order: 1;}
html.mob #page-discounts .filters > #dis-type{order: 2;}
html.mob #page-discounts .filters > #dis-from{order: 3;}
html.mob #page-discounts .filters > #dis-to{order: 4;}
html.mob #page-discounts .filters > #dis-status{order: 5;}
html.mob #page-discounts .filters > #dis-today{order: 6;}
html.mob #page-discounts .filters > #dis-reset{order: 7;}
html.mob #page-expenses .filters > #exp-search{order: 1;}
html.mob #page-expenses .filters > #exp-cat{order: 2;}
html.mob #page-expenses .filters > #exp-from{order: 3;}
html.mob #page-expenses .filters > #exp-to{order: 4;}
html.mob #page-expenses .filters > #exp-status{order: 5;}
html.mob #page-expenses .filters > #exp-acc{order: 6;}
html.mob #page-expenses .filters > #exp-today{order: 7;}
html.mob #page-expenses .filters > #exp-reset{order: 8;}
html.mob #page-expenses .filters > #exp-print{order: 9;}
html.mob #page-transfers .filters > #tr-search{order: 1;}
html.mob #page-transfers .filters > #tr-account-filter{order: 2;}
html.mob #page-transfers .filters > #tr-from{order: 3;}
html.mob #page-transfers .filters > #tr-to{order: 4;}
html.mob #page-transfers .filters > #tr-status{order: 5;}
html.mob #page-transfers .filters > #tr-today{order: 6;}
html.mob #page-transfers .filters > #tr-reset{order: 7;}
html.mob /* status chips/badges → plain italic text in their color (bills style) */
  #page-queue table.m-list .badge, html.mob #page-returns table.m-list .badge, html.mob #page-delivery table.m-list .badge, html.mob #page-discounts table.m-list .badge, html.mob #page-expenses table.m-list .badge, html.mob #page-payments table.m-list .badge, html.mob #page-transfers table.m-list .badge, html.mob #page-purchases table.m-list .badge, html.mob #page-localpurchase table.m-list .badge, html.mob #page-supplierpayments table.m-list .badge, html.mob #page-users table.m-list .badge{background: transparent; border: 0; padding: 0;
    font-weight: 400; font-style: italic; font-size: 12.5px;}
html.mob /* the queue's "limit exceeds" credit chip rides under the net amount */
  #page-queue table.m-list .over-chip{background: transparent; border: 0; padding: 0;
    font-weight: 400; font-style: italic; font-size: 11px;}
html.mob /* buttons wrap under the amount instead of stretching the row */
  #page-queue table.m-list td.actions, html.mob #page-returns table.m-list td.actions, html.mob #page-delivery table.m-list td.actions, html.mob #page-discounts table.m-list td.actions, html.mob #page-expenses table.m-list td.actions, html.mob #page-payments table.m-list td.actions, html.mob #page-transfers table.m-list td.actions{white-space: normal; max-width: 46vw; text-align: right;}
html.mob #page-queue table.m-list td.actions .btn, html.mob #page-returns table.m-list td.actions .btn, html.mob #page-delivery table.m-list td.actions .btn, html.mob #page-discounts table.m-list td.actions .btn, html.mob #page-expenses table.m-list td.actions .btn, html.mob #page-payments table.m-list td.actions .btn, html.mob #page-transfers table.m-list td.actions .btn{margin: 1px 0 1px .3rem;}
html.mob /* full-width informational (deleted) rows */
  #page-queue table.m-list td[colspan], html.mob #page-returns table.m-list td[colspan], html.mob #page-delivery table.m-list td[colspan], html.mob #page-discounts table.m-list td[colspan], html.mob #page-expenses table.m-list td[colspan], html.mob #page-payments table.m-list td[colspan], html.mob #page-transfers table.m-list td[colspan]{grid-column: 1 / -1 !important;}
html.mob /* ---- APPROVAL QUEUE (cont-194 re-map): line 1 = customer | net (the
     "limit exceeds" chip stacks BELOW the amount), html.mob line 2 = date with time, html.mob line 3 = ordered by, html.mob line 4 = notes (full width, html.mob left, html.mob quiet), html.mob line 5 =
     the buttons in ONE line right-aligned with the short View / Appr / Rej /
     Del labels ---- */
  #page-queue table.m-list tbody tr td:nth-child(2){grid-area: 1 / 1 / 2 / 4; font-weight: 600;}
html.mob #page-queue table.m-list tbody tr td:nth-child(4){grid-area: 1 / 4; justify-self: end;
    font-weight: 600; white-space: nowrap;
    /* the amount text node and the over-chip stack vertically, right aligned */
    display: flex; flex-direction: column; align-items: flex-end; gap: 1px;}
html.mob #page-queue table.m-list tbody tr td:nth-child(1){grid-area: 2 / 1 / 3 / 5; white-space: nowrap;}
html.mob /* ordered by + notes: the same quiet grey italics as the bills cards */
  #page-queue table.m-list tbody tr td:nth-child(3), html.mob #page-queue table.m-list tbody tr td:nth-child(5){font-size: 11px; color: var(--muted); font-style: italic;}
html.mob #page-queue table.m-list tbody tr td:nth-child(3){grid-area: 3 / 1 / 4 / 5;}
html.mob #page-queue table.m-list tbody tr td:nth-child(3)::before{content: 'Ordered by ';}
html.mob #page-queue table.m-list tbody tr td:nth-child(5){grid-area: 4 / 1 / 5 / -1; text-align: left;}
html.mob #page-queue table.m-list tbody tr td:nth-child(5)::before{content: 'Notes: ';}
html.mob /* the buttons: ONE line, html.mob left to right, html.mob right-aligned — the shared block's
     46vw cap and wrapping are undone for the queue only */
  #page-queue table.m-list td.actions{white-space: nowrap; max-width: none;}
html.mob #page-queue table.m-list tbody tr td:nth-child(6){grid-area: 5 / 1 / 6 / -1;}
html.mob #page-queue .blong{display: none;}
html.mob #page-queue .bmini{display: inline;}
html.mob /* filters on phones: search → bill types → date from → date to → reset
     (the Date from / Date to placeholders are the cont-209 overlay) */
  #page-queue .filters > #q-search{order: 1;}
html.mob #page-queue .filters > #q-credit{order: 2;}
html.mob #page-queue .filters > #q-from{order: 3;}
html.mob #page-queue .filters > #q-to{order: 4;}
html.mob #page-queue .filters > #q-reset{order: 5;}
html.mob /* ---- SALES RETURNS (cont-194 re-map): line 1 = no, html.mob date | total;
     line 2 = customer | status; line 3 = "Received by X against bill no Y"
     (the against-bill no rides in a data attribute; without a bill the line
     reads just "Received by X") — quiet grey italics; line 4 = buttons ---- */
  #page-returns table.m-list tbody tr td:nth-child(1){grid-area: 1 / 1; font-weight: 600;}
html.mob #page-returns table.m-list tbody tr td:nth-child(1) strong{white-space: nowrap;}
html.mob /* pending returns carry a muted dash instead of a number — hide it so the
     date reads clean; the comma only appears when a number exists */
  #page-returns table.m-list tbody tr td:nth-child(1):not(:has(strong)){visibility: hidden;}
html.mob #page-returns table.m-list tbody tr td:nth-child(1):has(strong) ~ td:nth-child(2)::before{content: ', ';}
html.mob #page-returns table.m-list tbody tr td:nth-child(2){grid-area: 1 / 2; white-space: nowrap;}
html.mob #page-returns table.m-list tbody tr td:nth-child(5){grid-area: 1 / 4; justify-self: end; font-weight: 600; white-space: nowrap;}
html.mob #page-returns table.m-list tbody tr td:nth-child(3){grid-area: 2 / 1 / 3 / 4; font-weight: 600;}
html.mob #page-returns table.m-list tbody tr td:nth-child(7){grid-area: 2 / 4; justify-self: end; font-size: 12.5px;}
html.mob #page-returns table.m-list tbody tr td:nth-child(6){grid-area: 3 / 1 / 4 / -1; text-align: left;
    font-size: 11px; color: var(--muted); font-style: italic;}
html.mob #page-returns table.m-list tbody tr td:nth-child(6)::before{content: 'Received by ';}
html.mob #page-returns table.m-list tbody tr td:nth-child(6)[data-bill]::after{content: ' against bill no ' attr(data-bill);}
html.mob /* the Against Bill No column is redundant on phones — its number is already
     woven into the received-by line */
  #page-returns table.m-list tbody tr td:nth-child(4){display: none;}
html.mob #page-returns table.m-list tbody tr td:nth-child(8){grid-area: 4 / 1 / 5 / -1; max-width: none; white-space: nowrap; text-align: right;}
html.mob /* ---- DELIVERY (cont-194 re-map): line 1 = no, html.mob date | total;
     line 2 = customer | "pending delivery"; line 3 = buttons right-aligned
     with the short mobile labels (View / Confirm) ---- */
  #page-delivery table.m-list tbody tr td:nth-child(1){grid-area: 1 / 1;}
html.mob #page-delivery table.m-list tbody tr td:nth-child(1) strong{white-space: nowrap;}
html.mob #page-delivery table.m-list tbody tr td:nth-child(2){grid-area: 1 / 2;}
html.mob #page-delivery table.m-list tbody tr td:nth-child(2)::before{content: ', '; font-weight: 400;}
html.mob #page-delivery table.m-list tbody tr td:nth-child(5){grid-area: 1 / 4; justify-self: end; font-weight: 600; white-space: nowrap;}
html.mob #page-delivery table.m-list tbody tr td:nth-child(4){grid-area: 2 / 1 / 3 / 4; font-weight: 600;}
html.mob #page-delivery table.m-list tbody tr td:nth-child(3){grid-area: 2 / 4; justify-self: end; font-size: 12.5px;}
html.mob #page-delivery table.m-list tbody tr td:nth-child(6){grid-area: 3 / 1 / 4 / -1; max-width: none; white-space: nowrap; text-align: right;}
html.mob #page-delivery .blong{display: none;}
html.mob #page-delivery .bmini{display: inline;}
html.mob /* ---- VOUCHERS shared: no, html.mob date | amount | main text · buttons | status |
     quiet facts (discounts: type · expenses: paid from + spent by ·
     payments: received in + collected by · transfers: from → to) ---- */
  #page-discounts table.m-list tbody tr td:nth-child(1), html.mob #page-expenses table.m-list tbody tr td:nth-child(1), html.mob #page-payments table.m-list tbody tr td:nth-child(1), html.mob #page-transfers table.m-list tbody tr td:nth-child(1){grid-area: 1 / 1; font-weight: 600;}
html.mob #page-discounts table.m-list tbody tr td:nth-child(1) strong, html.mob #page-expenses table.m-list tbody tr td:nth-child(1) strong, html.mob #page-payments table.m-list tbody tr td:nth-child(1) strong, html.mob #page-transfers table.m-list tbody tr td:nth-child(1) strong{white-space: nowrap;}
html.mob /* draft vouchers carry a muted dash instead of a number — hide it; the
     comma only appears when the voucher has a number */
  #page-discounts table.m-list tbody tr td:nth-child(1):not(:has(strong)), html.mob #page-expenses table.m-list tbody tr td:nth-child(1):not(:has(strong)), html.mob #page-payments table.m-list tbody tr td:nth-child(1):not(:has(strong)), html.mob #page-transfers table.m-list tbody tr td:nth-child(1):not(:has(strong)){visibility: hidden;}
html.mob #page-discounts table.m-list tbody tr td:nth-child(1):has(strong) ~ td:nth-child(2)::before, html.mob #page-expenses table.m-list tbody tr td:nth-child(1):has(strong) ~ td:nth-child(2)::before, html.mob #page-payments table.m-list tbody tr td:nth-child(1):has(strong) ~ td:nth-child(2)::before, html.mob #page-transfers table.m-list tbody tr td:nth-child(1):has(strong) ~ td:nth-child(2)::before{content: ', ';}
html.mob #page-discounts table.m-list tbody tr td:nth-child(2), html.mob #page-expenses table.m-list tbody tr td:nth-child(2), html.mob #page-payments table.m-list tbody tr td:nth-child(2), html.mob #page-transfers table.m-list tbody tr td:nth-child(2){grid-area: 1 / 2; white-space: nowrap;}
html.mob #page-discounts table.m-list tbody tr td:nth-child(5), html.mob #page-expenses table.m-list tbody tr td:nth-child(4), html.mob #page-payments table.m-list tbody tr td:nth-child(5), html.mob #page-transfers table.m-list tbody tr td:nth-child(5){grid-area: 1 / 4; justify-self: end; white-space: nowrap;}
html.mob #page-discounts table.m-list tbody tr td:nth-child(7), html.mob #page-expenses table.m-list tbody tr td:nth-child(8), html.mob #page-payments table.m-list tbody tr td:nth-child(8), html.mob #page-transfers table.m-list tbody tr td:nth-child(7){grid-area: 2 / 4; justify-self: end;}
html.mob #page-discounts table.m-list tbody tr td:nth-child(3), html.mob #page-payments table.m-list tbody tr td:nth-child(3){grid-area: 2 / 1 / 3 / 4; font-weight: 600;}
html.mob #page-expenses table.m-list tbody tr td:nth-child(3){grid-area: 2 / 1 / 3 / 4; font-weight: 600;}
html.mob /* cont-195 TRANSFERS (journal contra) re-map: line 2 = "from account →
     to account" with NO labels (the to-account rides in a data attribute —
     the To column is redundant on phones) | status right, html.mob line 3 = buttons */
  #page-transfers table.m-list tbody tr td:nth-child(3):not(.void-msg){grid-area: 2 / 1 / 3 / 4; font-weight: 600; text-align: left;}
html.mob #page-transfers table.m-list tbody tr td:nth-child(3):not(.void-msg)[data-to]::after{content: ' → ' attr(data-to);}
html.mob #page-transfers table.m-list tbody tr td:nth-child(4){display: none;}
html.mob #page-transfers table.m-list tbody tr td:nth-child(6){grid-area: 2 / 4; justify-self: end; font-size: 12.5px; font-style: italic;}
html.mob #page-transfers table.m-list tbody tr td:nth-child(7){grid-area: 3 / 1 / 4 / -1; max-width: none; white-space: nowrap; text-align: right;}
html.mob /* status gets its own line, html.mob then the quiet facts (transfers: line 4 —
     its To-account occupies line 3) */
  #page-discounts table.m-list tbody tr td:nth-child(6), html.mob #page-expenses table.m-list tbody tr td:nth-child(7), html.mob #page-payments table.m-list tbody tr td:nth-child(7){grid-area: 3 / 1 / 4 / 4; font-size: 12.5px; font-style: italic;}
html.mob #page-discounts table.m-list tbody tr td:nth-child(4), html.mob #page-expenses table.m-list tbody tr td:nth-child(5), html.mob #page-payments table.m-list tbody tr td:nth-child(4), html.mob #page-expenses table.m-list tbody tr td:nth-child(6), html.mob #page-payments table.m-list tbody tr td:nth-child(6){font-size: 11px; color: var(--muted); font-style: italic;}
html.mob /* cont-194 DISCOUNT VOUCHERS re-map: line 2 = customer | status, html.mob line 3 =
     the type (as before), html.mob line 4 = buttons; the amount goes semi-bold */
  #page-discounts table.m-list tbody tr td:nth-child(5){font-weight: 600;}
html.mob #page-discounts table.m-list tbody tr td:nth-child(6){grid-area: 2 / 4; justify-self: end; font-size: 12.5px;}
html.mob #page-discounts table.m-list tbody tr td:nth-child(4){grid-area: 3 / 1 / 4 / -1; text-align: left;}
html.mob #page-discounts table.m-list tbody tr td:nth-child(4)::before{content: 'Type: ';}
html.mob #page-discounts table.m-list tbody tr td:nth-child(7){grid-area: 4 / 1 / 5 / -1;}
html.mob /* cont-195 EXPENSES re-map: line 2 = category | status, html.mob line 3 = "Spent
     by X, html.mob <paid-from>" full width quiet italics (the account rides in a
     data attribute — the Paid From column is redundant on phones), html.mob line 4 =
     buttons; the amount keeps its bold */
  #page-expenses table.m-list tbody tr td:nth-child(7){grid-area: 2 / 4; justify-self: end; font-size: 12.5px;}
html.mob #page-expenses table.m-list tbody tr td:nth-child(8){grid-area: 4 / 1 / 5 / -1;}
html.mob #page-expenses table.m-list tbody tr td:nth-child(5){display: none;}
html.mob #page-expenses table.m-list tbody tr td:nth-child(6){grid-area: 3 / 1 / 4 / -1; text-align: left;
    font-size: 11px; color: var(--muted); font-style: italic;}
html.mob #page-expenses table.m-list tbody tr td:nth-child(6)::before{content: 'Spent by ';}
html.mob #page-expenses table.m-list tbody tr td:nth-child(6)[data-acc]::after{content: ', ' attr(data-acc);}
html.mob /* cont-194 RECEIVE PAYMENTS re-map: line 2 = customer | status, html.mob line 3 =
     "Collected by X, html.mob <account>" full width quiet italics (the account name
     rides in a data attribute — the Received-In column is redundant on
     phones), html.mob line 4 = buttons; the amount goes semi-bold like the others */
  #page-payments table.m-list tbody tr td:nth-child(5){font-weight: 600;}
html.mob #page-payments table.m-list tbody tr td:nth-child(7){grid-area: 2 / 4; justify-self: end; font-size: 12.5px;}
html.mob #page-payments table.m-list tbody tr td:nth-child(8){grid-area: 4 / 1 / 5 / -1;}
html.mob #page-payments table.m-list tbody tr td:nth-child(4){display: none;}
html.mob #page-payments table.m-list tbody tr td:nth-child(6){grid-area: 3 / 1 / 4 / -1; text-align: left;
    font-size: 11px; color: var(--muted); font-style: italic;}
html.mob #page-payments table.m-list tbody tr td:nth-child(6)::before{content: 'Collected by ';}
html.mob #page-payments table.m-list tbody tr td:nth-child(6)[data-acc]::after{content: ', ' attr(data-acc);}
html.mob /* deleted-row messages span the width and keep their regular weight — the
     main-text placement rules above also land on the message cell */
  #page-returns table.m-list td.void-msg, html.mob #page-discounts table.m-list td.void-msg, html.mob #page-expenses table.m-list td.void-msg, html.mob #page-payments table.m-list td.void-msg, html.mob #page-transfers table.m-list td.void-msg, html.mob #page-purchases table.m-list td.void-msg, html.mob #page-localpurchase table.m-list td.void-msg, html.mob #page-supplierpayments table.m-list td.void-msg{font-weight: 400;}
html.mob /* deleted/empty rows must ALWAYS span the full width — re-asserted here so
     the per-page placement maps above (equal specificity, html.mob later order) can
     never squeeze the message into one column */
  #page-queue table.m-list tbody tr td[colspan], html.mob #page-returns table.m-list tbody tr td[colspan], html.mob #page-delivery table.m-list tbody tr td[colspan], html.mob #page-discounts table.m-list tbody tr td[colspan], html.mob #page-expenses table.m-list tbody tr td[colspan], html.mob #page-payments table.m-list tbody tr td[colspan], html.mob #page-transfers table.m-list tbody tr td[colspan], html.mob #page-purchases table.m-list tbody tr td[colspan], html.mob #page-localpurchase table.m-list tbody tr td[colspan], html.mob #page-supplierpayments table.m-list tbody tr td[colspan]{grid-area: 2 / 1 / 3 / -1 !important;}

html.mob #page-deletedbills table.m-list, html.mob #page-customers table.m-list, html.mob #page-zones table.m-list, html.mob #page-salespersons table.m-list, html.mob #page-customerpreference table.m-list{display: block;}
html.mob #page-deletedbills table.m-list thead, html.mob #page-customers table.m-list thead, html.mob #page-zones table.m-list thead, html.mob #page-salespersons table.m-list thead, html.mob #page-customerpreference table.m-list thead{display: none;}
html.mob #page-deletedbills table.m-list tbody, html.mob #page-customers table.m-list tbody, html.mob #page-zones table.m-list tbody, html.mob #page-salespersons table.m-list tbody, html.mob #page-customerpreference table.m-list tbody{display: block;}
html.mob #page-deletedbills table.m-list tbody tr, html.mob #page-customers table.m-list tbody tr, html.mob #page-zones table.m-list tbody tr, html.mob #page-salespersons table.m-list tbody tr, html.mob #page-customerpreference table.m-list tbody tr{display: grid;
    grid-template-columns: min-content max-content minmax(0, 1fr) minmax(auto, 46vw);
    gap: 2px 0;
    padding: 10px 12px;}
html.mob #page-deletedbills table.m-list tbody tr + tr, html.mob #page-customers table.m-list tbody tr + tr, html.mob #page-zones table.m-list tbody tr + tr, html.mob #page-salespersons table.m-list tbody tr + tr, html.mob #page-customerpreference table.m-list tbody tr + tr{border-top: 1px solid var(--line);}
html.mob #page-deletedbills table.m-list tbody tr td, html.mob #page-customers table.m-list tbody tr td, html.mob #page-zones table.m-list tbody tr td, html.mob #page-salespersons table.m-list tbody tr td, html.mob #page-customerpreference table.m-list tbody tr td{border: 0; padding: 0; background: none;}
html.mob #page-customers table.m-list td.actions, html.mob #page-zones table.m-list td.actions, html.mob #page-salespersons table.m-list td.actions, html.mob #page-customerpreference table.m-list td.actions{white-space: normal; max-width: 46vw; text-align: right;}
html.mob #page-customers table.m-list td.actions .btn, html.mob #page-zones table.m-list td.actions .btn, html.mob #page-salespersons table.m-list td.actions .btn, html.mob #page-customerpreference table.m-list td.actions .btn{margin: 1px 0 1px .3rem;}
html.mob #page-deletedbills table.m-list td[colspan], html.mob #page-customers table.m-list td[colspan], html.mob #page-zones table.m-list td[colspan], html.mob #page-salespersons table.m-list td[colspan], html.mob #page-customerpreference table.m-list td[colspan]{grid-column: 1 / -1 !important;}
html.mob /* ---- DELETED BILLS: no, html.mob date | Details · reason (FULL width) · type · by ---- */
  #page-deletedbills table.m-list tbody tr td:nth-child(1){grid-area: 1 / 1; font-weight: 600;}
html.mob #page-deletedbills table.m-list tbody tr td:nth-child(1) strong{white-space: nowrap;}
html.mob #page-deletedbills table.m-list tbody tr td:nth-child(3){grid-area: 1 / 2; white-space: nowrap;}
html.mob #page-deletedbills table.m-list tbody tr td:nth-child(3)::before{content: ', '; font-weight: 400;}
html.mob #page-deletedbills table.m-list tbody tr td:nth-child(6){grid-area: 1 / 4; justify-self: end; white-space: normal;}
html.mob /* the reason merges BOTH columns — one full-width line under the no/date
     (the td carries an inline max-width for the desktop column — beat it) */
  #page-deletedbills table.m-list tbody tr td:nth-child(4){grid-area: 2 / 1 / 3 / -1; font-size: 13px; max-width: none !important;}
html.mob #page-deletedbills table.m-list tbody tr td:nth-child(4)::before{content: 'Reason: '; color: var(--muted); font-size: 11px;}
html.mob #page-deletedbills table.m-list tbody tr td:nth-child(2), html.mob #page-deletedbills table.m-list tbody tr td:nth-child(5){font-size: 11px; color: var(--muted); font-style: italic;}
html.mob #page-deletedbills table.m-list tbody tr td:nth-child(2){grid-area: 3 / 1 / 4 / 4;}
html.mob #page-deletedbills table.m-list tbody tr td:nth-child(2)::before{content: 'Type: ';}
html.mob #page-deletedbills table.m-list tbody tr td:nth-child(5){grid-area: 4 / 1 / 5 / 4;}
html.mob #page-deletedbills table.m-list tbody tr td:nth-child(5)::before{content: 'By: ';}
html.mob /* ---- CUSTOMERS (cont-195 re-map): line 1 = name, html.mob line 2 = "Op: x, html.mob Limit: y", html.mob line 3 = "Sales by: z, html.mob Assigned: …" quiet italics (the
     assigned names ride in a data attribute; the Zone column stays
     desktop-only), html.mob line 4 = buttons right ---- */
  #page-customers table.m-list tbody tr td:nth-child(1){grid-area: 1 / 1 / 2 / 4; font-weight: 600;}
html.mob #page-customers table.m-list tbody tr td:nth-child(4){grid-area: 2 / 1; white-space: nowrap;}
html.mob #page-customers table.m-list tbody tr td:nth-child(4)::before{content: 'Op: '; color: var(--muted); font-weight: 400; font-size: 11px;}
html.mob #page-customers table.m-list tbody tr td:nth-child(4)::after{content: ', ';}
html.mob #page-customers table.m-list tbody tr td:nth-child(5){grid-area: 2 / 2; white-space: nowrap;}
html.mob #page-customers table.m-list tbody tr td:nth-child(5)::before{content: 'Limit: '; color: var(--muted); font-weight: 400; font-size: 11px;}
html.mob #page-customers table.m-list tbody tr td:nth-child(3){grid-area: 3 / 1 / 4 / -1; text-align: left;
    font-size: 11px; color: var(--muted); font-style: italic;}
html.mob #page-customers table.m-list tbody tr td:nth-child(3)::before{content: 'Sales by: ';}
html.mob #page-customers table.m-list tbody tr td:nth-child(3)[data-assigned]::after{content: ', Assigned: ' attr(data-assigned);}
html.mob #page-customers table.m-list tbody tr td:nth-child(2), html.mob #page-customers table.m-list tbody tr td:nth-child(6){display: none;}
html.mob #page-customers table.m-list tbody tr td:nth-child(7){grid-area: 4 / 1 / 5 / -1; max-width: none; white-space: nowrap; text-align: right;}
html.mob /* ---- ZONES (cont-195): line 1 = name | customers count, html.mob line 2 =
     "Coverage area: …" quiet italics, html.mob line 3 = buttons right ---- */
  #page-zones table.m-list tbody tr td:nth-child(1){grid-area: 1 / 1 / 2 / 3; font-weight: 600;}
html.mob #page-zones table.m-list tbody tr td:nth-child(3){grid-area: 1 / 4; justify-self: end; font-weight: 600; white-space: nowrap;}
html.mob #page-zones table.m-list tbody tr td:nth-child(3)::before{content: 'Customers: '; color: var(--muted); font-weight: 400; font-size: 11px;}
html.mob #page-zones table.m-list tbody tr td:nth-child(2){grid-area: 2 / 1 / 3 / -1; text-align: left;
    font-size: 11px; color: var(--muted); font-style: italic;}
html.mob #page-zones table.m-list tbody tr td:nth-child(2)::before{content: 'Coverage area: ';}
html.mob #page-zones table.m-list tbody tr td:nth-child(4){grid-area: 3 / 1 / 4 / -1; max-width: none; white-space: nowrap; text-align: right;}
html.mob /* ---- SALES PERSONS list (cont-195): line 1 = name | customers count, html.mob line 2 = "Phone: x, html.mob Email: y" quiet italics (the email rides in a data
     attribute — it has no desktop column), html.mob line 3 = buttons right ---- */
  #page-salespersons table.m-list tbody tr td:nth-child(1){grid-area: 1 / 1 / 2 / 3; font-weight: 600;}
html.mob #page-salespersons table.m-list tbody tr td:nth-child(3){grid-area: 1 / 4; justify-self: end; font-weight: 600; white-space: nowrap;}
html.mob #page-salespersons table.m-list tbody tr td:nth-child(3)::before{content: 'Customers: '; color: var(--muted); font-weight: 400; font-size: 11px;}
html.mob #page-salespersons table.m-list tbody tr td:nth-child(2){grid-area: 2 / 1 / 3 / -1; text-align: left;
    font-size: 11px; color: var(--muted); font-style: italic;}
html.mob #page-salespersons table.m-list tbody tr td:nth-child(2)::before{content: 'Phone: ';}
html.mob #page-salespersons table.m-list tbody tr td:nth-child(2)[data-email]::after{content: ', Email: ' attr(data-email);}
html.mob #page-salespersons table.m-list tbody tr td:nth-child(4){grid-area: 3 / 1 / 4 / -1; max-width: none; white-space: normal; text-align: right;}
html.mob /* ---- CUSTOMER PREFERENCE: ONE column — item name (unit right) ·
     sold/returned line · buttons (owner request: with a long item name the
     side-by-side layout pushed the Sold/Returned buttons outside the card, html.mob so the buttons get their own full-width row) ---- */
  #page-customerpreference table.m-list tbody tr{grid-template-columns: minmax(0, 1fr) max-content;
    gap: 2px 10px;}
html.mob #page-customerpreference table.m-list tbody tr td:nth-child(1){grid-area: 1 / 1 / 2 / 3; font-weight: 600;}
html.mob #page-customerpreference table.m-list tbody tr td:nth-child(1) strong{white-space: normal;}
html.mob /* cont-195 re-map: the unit column is hidden on phones; the Returned
     figure rides in a data attribute so Sold + Returned share ONE line with
     the buttons right */
  #page-customerpreference table.m-list tbody tr td:nth-child(2), html.mob #page-customerpreference table.m-list tbody tr td:nth-child(4){display: none;}
html.mob #page-customerpreference table.m-list tbody tr td:nth-child(3){grid-area: 2 / 1; font-weight: 600; font-size: 12.5px; text-align: left;}
html.mob #page-customerpreference table.m-list tbody tr td:nth-child(3)::before{content: 'Sold: '; color: var(--muted); font-weight: 400; font-size: 11px;}
html.mob #page-customerpreference table.m-list tbody tr td:nth-child(3)[data-ret]::after{content: ', Returned: ' attr(data-ret); font-weight: 400; font-size: 12.5px;}
html.mob #page-customerpreference table.m-list tbody tr td:nth-child(3) strong[data-unit]::after{content: ' ' attr(data-unit); font-weight: 400; font-size: 11px;}
html.mob #page-customerpreference table.m-list tbody tr td:nth-child(5){grid-area: 2 / 2; justify-self: end; text-align: right; max-width: none; white-space: nowrap;}
html.mob #page-customerpreference table.m-list tbody tr td:nth-child(5) .btn{margin: 1px 0 1px .3rem;}
html.mob /* group header rows keep their banded look */
  #page-customerpreference table.m-list tbody tr.type-head td{background: #e4e8ee; border-top: 2px solid var(--line);
    font-size: 12px; text-transform: uppercase; letter-spacing: .05em;
    color: var(--muted); padding: .55rem .6rem .2rem;}
html.mob /* ---- numeric-panel machinery (n-list): sales report, html.mob my receivable, html.mob sales-persons report — 3 equal columns of tagged figures ---- */
  #page-salesreport table.n-list, html.mob #page-myreceivable table.n-list, html.mob #page-salespersons table.n-list, html.mob #page-receivable table.n-list{display: block;}
html.mob #page-salesreport table.n-list thead, html.mob #page-myreceivable table.n-list thead, html.mob #page-salespersons table.n-list thead, html.mob #page-receivable table.n-list thead{display: none;}
html.mob #page-salesreport table.n-list tbody, html.mob #page-myreceivable table.n-list tbody, html.mob #page-salespersons table.n-list tbody, html.mob #page-receivable table.n-list tbody{display: block;}
html.mob #page-salesreport table.n-list tbody tr, html.mob #page-myreceivable table.n-list tbody tr, html.mob #page-salespersons table.n-list tbody tr, html.mob #page-receivable table.n-list tbody tr{display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2px 4px;
    padding: 10px 12px;}
html.mob #page-salesreport table.n-list tbody tr + tr, html.mob #page-myreceivable table.n-list tbody tr + tr, html.mob #page-salespersons table.n-list tbody tr + tr, html.mob #page-receivable table.n-list tbody tr + tr{border-top: 1px solid var(--line);}
html.mob #page-salesreport table.n-list tbody tr td, html.mob #page-myreceivable table.n-list tbody tr td, html.mob #page-salespersons table.n-list tbody tr td, html.mob #page-receivable table.n-list tbody tr td{border: 0; padding: 0; background: none;}
html.mob #page-salesreport table.n-list tbody tr td[colspan], html.mob #page-myreceivable table.n-list tbody tr td[colspan], html.mob #page-salespersons table.n-list tbody tr td[colspan], html.mob #page-receivable table.n-list tbody tr td[colspan]{grid-column: 1 / -1 !important;}
html.mob /* the figures themselves */
  #page-salesreport table.n-list tbody tr td:nth-child(n+3), html.mob #page-myreceivable table.n-list tbody tr td:nth-child(n+2), html.mob #page-salespersons table.n-list tbody tr td:nth-child(n+2), html.mob #page-receivable table.n-list tbody tr td:nth-child(n+2){font-size: 12.5px; font-weight: 600;}
html.mob #page-salesreport table.n-list tbody tr td:nth-child(n+3)::before, html.mob #page-myreceivable table.n-list tbody tr td:nth-child(n+2)::before, html.mob #page-salespersons table.n-list tbody tr td:nth-child(n+2)::before, html.mob #page-receivable table.n-list tbody tr td:nth-child(n+2)::before{color: var(--muted); font-weight: 400; font-size: 11px;}
html.mob /* banded subtotal rows (My Receivable) keep their background */
  #page-myreceivable table.n-list tbody tr.alt-row td{background: var(--gray-bg);}
html.mob /* ---- SALES REPORT: customer | balance · zone · bills/gross/disc ·
          net/ret/paid ---- */
  #page-salesreport table.n-list tbody tr td:nth-child(1){grid-area: 1 / 1 / 2 / 3; font-weight: 600;}
html.mob #page-salesreport table.n-list tbody tr td:nth-child(9){grid-area: 1 / 3; justify-self: end; white-space: nowrap;}
html.mob #page-salesreport table.n-list tbody tr td:nth-child(2){grid-area: 2 / 1 / 3 / 4; font-size: 11px; color: var(--muted); font-style: italic;}
html.mob #page-salesreport table.n-list tbody tr td:nth-child(2)::before{content: 'Zone: ';}
html.mob #page-salesreport table.n-list tbody tr td:nth-child(3){grid-area: 3 / 1;}
html.mob #page-salesreport table.n-list tbody tr td:nth-child(3)::before{content: 'Bills: ';}
html.mob #page-salesreport table.n-list tbody tr td:nth-child(4){grid-area: 3 / 2;}
html.mob #page-salesreport table.n-list tbody tr td:nth-child(4)::before{content: 'Gross: ';}
html.mob #page-salesreport table.n-list tbody tr td:nth-child(5){grid-area: 3 / 3;}
html.mob #page-salesreport table.n-list tbody tr td:nth-child(5)::before{content: 'Disc: ';}
html.mob #page-salesreport table.n-list tbody tr td:nth-child(6){grid-area: 4 / 1;}
html.mob #page-salesreport table.n-list tbody tr td:nth-child(6)::before{content: 'Net: ';}
html.mob #page-salesreport table.n-list tbody tr td:nth-child(7){grid-area: 4 / 2;}
html.mob #page-salesreport table.n-list tbody tr td:nth-child(7)::before{content: 'Ret: ';}
html.mob #page-salesreport table.n-list tbody tr td:nth-child(8){grid-area: 4 / 3;}
html.mob #page-salesreport table.n-list tbody tr td:nth-child(8)::before{content: 'Paid: ';}
html.mob /* ---- MY RECEIVABLE: customer | balance · opening/bills/rcvd · disc/ret
     (the same map covers the per-person subtotals and the grand total) ---- */
  #page-myreceivable table.n-list tbody tr td:nth-child(1){grid-area: 1 / 1 / 2 / 3; font-weight: 600;}
html.mob #page-myreceivable table.n-list tbody tr td:nth-child(7){grid-area: 1 / 3; justify-self: end; white-space: nowrap;}
html.mob #page-myreceivable table.n-list tbody tr td:nth-child(2){grid-area: 2 / 1;}
html.mob #page-myreceivable table.n-list tbody tr td:nth-child(2)::before{content: 'Opening: ';}
html.mob #page-myreceivable table.n-list tbody tr td:nth-child(3){grid-area: 2 / 2;}
html.mob #page-myreceivable table.n-list tbody tr td:nth-child(3)::before{content: 'Bills: ';}
html.mob #page-myreceivable table.n-list tbody tr td:nth-child(4){grid-area: 2 / 3;}
html.mob #page-myreceivable table.n-list tbody tr td:nth-child(4)::before{content: 'Rcvd: ';}
html.mob #page-myreceivable table.n-list tbody tr td:nth-child(5){grid-area: 3 / 1;}
html.mob #page-myreceivable table.n-list tbody tr td:nth-child(5)::before{content: 'Disc: ';}
html.mob #page-myreceivable table.n-list tbody tr td:nth-child(6){grid-area: 3 / 2;}
html.mob #page-myreceivable table.n-list tbody tr td:nth-child(6)::before{content: 'Ret: ';}
html.mob /* ---- RECEIVABLE: same shape as My Receivable — customer | balance ·
     opening/bills/rcvd · disc/ret (the grand-total row shares the map) ---- */
  #page-receivable table.n-list tbody tr td:nth-child(1){grid-area: 1 / 1 / 2 / 3; font-weight: 600;}
html.mob #page-receivable table.n-list tbody tr td:nth-child(7){grid-area: 1 / 3; justify-self: end; white-space: nowrap;}
html.mob #page-receivable table.n-list tbody tr td:nth-child(2){grid-area: 2 / 1;}
html.mob #page-receivable table.n-list tbody tr td:nth-child(2)::before{content: 'Opening: ';}
html.mob #page-receivable table.n-list tbody tr td:nth-child(3){grid-area: 2 / 2;}
html.mob #page-receivable table.n-list tbody tr td:nth-child(3)::before{content: 'Bills: ';}
html.mob #page-receivable table.n-list tbody tr td:nth-child(4){grid-area: 2 / 3;}
html.mob #page-receivable table.n-list tbody tr td:nth-child(4)::before{content: 'Rcvd: ';}
html.mob #page-receivable table.n-list tbody tr td:nth-child(5){grid-area: 3 / 1;}
html.mob #page-receivable table.n-list tbody tr td:nth-child(5)::before{content: 'Disc: ';}
html.mob #page-receivable table.n-list tbody tr td:nth-child(6){grid-area: 3 / 2;}
html.mob #page-receivable table.n-list tbody tr td:nth-child(6)::before{content: 'Ret: ';}
html.mob /* sales-person group headers keep their banded look */
  #page-myreceivable table.n-list tbody tr.type-head td{background: #e4e8ee; border-top: 2px solid var(--line);
    font-size: 12px; text-transform: uppercase; letter-spacing: .05em;
    color: var(--muted); padding: .55rem .6rem .2rem;}
html.mob /* ---- SALES PERSONS report: person | Details · customers/sales/rcvd ·
          ret/disc (grand total row shares the map) ---- */
  #page-salespersons table.n-list tbody tr td:nth-child(1){grid-area: 1 / 1 / 2 / 3; font-weight: 600;}
html.mob #page-salespersons table.n-list tbody tr td:nth-child(7){grid-area: 1 / 3; justify-self: end; white-space: normal;}
html.mob #page-salespersons table.n-list tbody tr td:nth-child(7) .btn{margin: 0 0 0 .3rem;}
html.mob #page-salespersons table.n-list tbody tr td:nth-child(2){grid-area: 2 / 1;}
html.mob #page-salespersons table.n-list tbody tr td:nth-child(2)::before{content: 'Customers: ';}
html.mob #page-salespersons table.n-list tbody tr td:nth-child(3){grid-area: 2 / 2;}
html.mob #page-salespersons table.n-list tbody tr td:nth-child(3)::before{content: 'Sales: ';}
html.mob #page-salespersons table.n-list tbody tr td:nth-child(4){grid-area: 2 / 3;}
html.mob #page-salespersons table.n-list tbody tr td:nth-child(4)::before{content: 'Rcvd: ';}
html.mob #page-salespersons table.n-list tbody tr td:nth-child(5){grid-area: 3 / 1;}
html.mob #page-salespersons table.n-list tbody tr td:nth-child(5)::before{content: 'Ret: ';}
html.mob #page-salespersons table.n-list tbody tr td:nth-child(6){grid-area: 3 / 2;}
html.mob #page-salespersons table.n-list tbody tr td:nth-child(6)::before{content: 'Disc: ';}
html.mob /* group headers and empty-state rows must ALWAYS span the full width —
     re-asserted after the per-page maps (equal specificity, html.mob later order) */
  #page-deletedbills table.m-list tbody tr td[colspan], html.mob #page-customers table.m-list tbody tr td[colspan], html.mob #page-zones table.m-list tbody tr td[colspan], html.mob #page-salespersons table.m-list tbody tr td[colspan], html.mob #page-customerpreference table.m-list tbody tr td[colspan], html.mob #page-salesreport table.n-list tbody tr td[colspan], html.mob #page-myreceivable table.n-list tbody tr td[colspan], html.mob #page-salespersons table.n-list tbody tr td[colspan]{grid-area: 1 / 1 / 2 / -1 !important;}

html.mob #zone-preview table{display: block;}
html.mob #zone-preview table thead{display: none;}
html.mob #zone-preview table tbody{display: block;}
html.mob #zone-preview table tbody tr{display: grid;
    /* the balance column is OPTIONAL (Balance toggle) — size it to its
       content so rows without it don't reserve a 46vw empty track */
    grid-template-columns: min-content max-content minmax(0, 1fr) minmax(0, max-content);
    gap: 2px 0;
    padding: 8px 12px;}
html.mob #zone-preview table tbody tr + tr{border-top: 1px solid var(--line);}
html.mob #zone-preview table tbody tr td{border: 0; padding: 0; background: none;}
html.mob #zone-preview table tbody tr td:nth-child(1){grid-area: 1 / 1; font-size: 11px; color: var(--muted); padding-right: 7px;}
html.mob #zone-preview table tbody tr td:nth-child(1)::before{content: '#'; margin-right: 3px;}
html.mob #zone-preview table tbody tr td:nth-child(2){grid-area: 1 / 2 / 2 / 4; font-weight: 600;}
html.mob /* the balance column — whatever position it lands at, html.mob it is the td.num */
  #zone-preview table tbody tr td.num{grid-area: 1 / 4; justify-self: end; font-weight: 600; white-space: nowrap;}
html.mob #zone-preview table tbody tr td.num::before{content: 'Due: '; color: var(--muted); font-weight: 400; font-size: 11px;}
html.mob #zone-preview table tbody tr td:nth-child(3):not(.num){grid-area: 2 / 1 / 3 / 4; font-size: 11px; color: var(--muted); font-style: italic;}
html.mob #zone-preview table tbody tr td:nth-child(3):not(.num)::before{content: 'Addr: ';}
html.mob #zone-preview table tbody tr td:nth-child(4){grid-area: 3 / 1 / 4 / 4; font-size: 11px; color: var(--muted); font-style: italic;}
html.mob #zone-preview table tbody tr td:nth-child(4)::before{content: 'Contact: ';}
html.mob #zone-preview table tbody tr td:nth-child(5):not(.num){grid-area: 4 / 1 / 5 / 4; font-size: 11px; color: var(--muted); font-style: italic;}
html.mob #zone-preview table tbody tr td:nth-child(5):not(.num)::before{content: 'Mobile: ';}
html.mob #zone-preview table tbody tr td[colspan]{grid-column: 1 / -1 !important;}

html.mob #page-purchases table.m-list, html.mob #page-localpurchase table.m-list, html.mob #page-suppliers table.m-list, html.mob #page-supplierpayments table.m-list, html.mob #page-accounts table.m-list, html.mob #page-logs table.m-list, html.mob #page-users table.m-list, html.mob #page-modifiedbills table.m-list{display: block;}
html.mob #page-purchases table.m-list thead, html.mob #page-localpurchase table.m-list thead, html.mob #page-suppliers table.m-list thead, html.mob #page-supplierpayments table.m-list thead, html.mob #page-accounts table.m-list thead, html.mob #page-logs table.m-list thead, html.mob #page-users table.m-list thead, html.mob #page-modifiedbills table.m-list thead{display: none;}
html.mob #page-purchases table.m-list tbody, html.mob #page-localpurchase table.m-list tbody, html.mob #page-suppliers table.m-list tbody, html.mob #page-supplierpayments table.m-list tbody, html.mob #page-accounts table.m-list tbody, html.mob #page-logs table.m-list tbody, html.mob #page-users table.m-list tbody, html.mob #page-modifiedbills table.m-list tbody{display: block;}
html.mob #page-purchases table.m-list tbody tr, html.mob #page-localpurchase table.m-list tbody tr, html.mob #page-suppliers table.m-list tbody tr, html.mob #page-supplierpayments table.m-list tbody tr, html.mob #page-accounts table.m-list tbody tr, html.mob #page-logs table.m-list tbody tr, html.mob #page-users table.m-list tbody tr, html.mob #page-modifiedbills table.m-list tbody tr{display: grid;
    grid-template-columns: min-content max-content minmax(0, 1fr) minmax(auto, 46vw);
    gap: 2px 0;
    padding: 10px 12px;}
html.mob #page-purchases table.m-list tbody tr + tr, html.mob #page-localpurchase table.m-list tbody tr + tr, html.mob #page-suppliers table.m-list tbody tr + tr, html.mob #page-supplierpayments table.m-list tbody tr + tr, html.mob #page-accounts table.m-list tbody tr + tr, html.mob #page-logs table.m-list tbody tr + tr, html.mob #page-users table.m-list tbody tr + tr, html.mob #page-modifiedbills table.m-list tbody tr + tr{border-top: 1px solid var(--line);}
html.mob #page-purchases table.m-list tbody tr td, html.mob #page-localpurchase table.m-list tbody tr td, html.mob #page-suppliers table.m-list tbody tr td, html.mob #page-supplierpayments table.m-list tbody tr td, html.mob #page-accounts table.m-list tbody tr td, html.mob #page-logs table.m-list tbody tr td, html.mob #page-users table.m-list tbody tr td, html.mob #page-modifiedbills table.m-list tbody tr td{border: 0; padding: 0; background: none;}
html.mob #page-purchases table.m-list td.actions, html.mob #page-localpurchase table.m-list td.actions, html.mob #page-suppliers table.m-list td.actions, html.mob #page-supplierpayments table.m-list td.actions, html.mob #page-accounts table.m-list td.actions, html.mob #page-users table.m-list td.actions{white-space: normal; max-width: 46vw; text-align: right;}
html.mob #page-purchases table.m-list td.actions .btn, html.mob #page-localpurchase table.m-list td.actions .btn, html.mob #page-suppliers table.m-list td.actions .btn, html.mob #page-supplierpayments table.m-list td.actions .btn, html.mob #page-accounts table.m-list td.actions .btn, html.mob #page-users table.m-list td.actions .btn{margin: 1px 0 1px .3rem;}
html.mob #page-suppliers table.m-list tbody tr td[colspan], html.mob #page-accounts table.m-list tbody tr td[colspan], html.mob #page-logs table.m-list tbody tr td[colspan], html.mob #page-users table.m-list tbody tr td[colspan], html.mob #page-modifiedbills table.m-list tbody tr td[colspan]{grid-area: 1 / 1 / 2 / -1 !important;}
html.mob /* the LOCAL / FOREIGN section bands keep their banded look */
  #page-suppliers table.m-list tbody tr.type-head td{background: #e4e8ee; border-top: 2px solid var(--line);
    font-size: 12px; text-transform: uppercase; letter-spacing: .05em;
    color: var(--muted); padding: .55rem .6rem .2rem;}
html.mob /* ---- PURCHASES + LOCAL PURCHASE ---- */
  #page-purchases table.m-list tbody tr td:nth-child(1), html.mob #page-localpurchase table.m-list tbody tr td:nth-child(1){grid-area: 1 / 1; font-weight: 600;}
html.mob #page-purchases table.m-list tbody tr td:nth-child(1) strong, html.mob #page-localpurchase table.m-list tbody tr td:nth-child(1) strong{white-space: nowrap;}
html.mob #page-purchases table.m-list tbody tr td:nth-child(2), html.mob #page-localpurchase table.m-list tbody tr td:nth-child(2){grid-area: 1 / 2; white-space: nowrap;}
html.mob /* the ", html.mob " after the number only when the number is stamped (a <strong>
     in the FIRST cell — the row total is bold too, html.mob so the row-wide :has
     would always match) */
  #page-purchases table.m-list tbody tr:has(td:nth-child(1) strong) td:nth-child(2)::before, html.mob #page-localpurchase table.m-list tbody tr:has(td:nth-child(1) strong) td:nth-child(2)::before{content: ', '; font-weight: 400;}
html.mob /* draft rows: the muted "— stamped at confirm" text is LONG — let it flow
     across the first two columns instead of wrapping in the narrow first
     one, html.mob with the date following it */
  #page-purchases table.m-list tbody tr td:nth-child(1):not(:has(strong)), html.mob #page-localpurchase table.m-list tbody tr td:nth-child(1):not(:has(strong)){grid-area: 1 / 1 / 2 / 3; white-space: nowrap; padding-right: 8px;}
html.mob #page-purchases table.m-list tbody tr:not(:has(td:nth-child(1) strong)) td:nth-child(2), html.mob #page-localpurchase table.m-list tbody tr:not(:has(td:nth-child(1) strong)) td:nth-child(2){grid-area: 1 / 3;}
html.mob #page-purchases table.m-list tbody tr td:nth-child(6), html.mob #page-localpurchase table.m-list tbody tr td:nth-child(6){grid-area: 1 / 4; justify-self: end; white-space: nowrap;}
html.mob #page-purchases table.m-list tbody tr td:nth-child(3), html.mob #page-localpurchase table.m-list tbody tr td:nth-child(3){grid-area: 2 / 1 / 3 / 4; font-weight: 600;}
html.mob /* cont-195 re-map: line 2 = supplier | status, html.mob line 3 = mode, html.mob line 4 =
     buttons right */
  #page-purchases table.m-list tbody tr td:nth-child(4), html.mob #page-localpurchase table.m-list tbody tr td:nth-child(4){grid-area: 2 / 4; justify-self: end; font-size: 12.5px;}
html.mob #page-purchases table.m-list tbody tr td:nth-child(5), html.mob #page-localpurchase table.m-list tbody tr td:nth-child(5){grid-area: 3 / 1 / 4 / -1; text-align: left;
    font-size: 11px; color: var(--muted); font-style: italic;}
html.mob #page-purchases table.m-list tbody tr td:nth-child(5)::before, html.mob #page-localpurchase table.m-list tbody tr td:nth-child(5)::before{content: 'Mode: ';}
html.mob #page-purchases table.m-list tbody tr td:nth-child(7), html.mob #page-localpurchase table.m-list tbody tr td:nth-child(7){grid-area: 4 / 1 / 5 / -1; max-width: none; white-space: nowrap; text-align: right;}
html.mob /* filter order on phones: search → type → dates → the rest */
  #page-purchases .filters > #pur-search{order: 1;}
html.mob #page-purchases .filters > #pur-type-filter{order: 2;}
html.mob #page-purchases .filters > #pur-from{order: 3;}
html.mob #page-purchases .filters > #pur-to{order: 4;}
html.mob #page-purchases .filters > #pur-supplier-filter{order: 5;}
html.mob #page-purchases .filters > #pur-status{order: 6;}
html.mob #page-purchases .filters > #pur-today{order: 7;}
html.mob #page-purchases .filters > #pur-reset{order: 8;}
html.mob #page-localpurchase .filters > #lp-search{order: 1;}
html.mob #page-localpurchase .filters > #lp-type-filter{order: 2;}
html.mob #page-localpurchase .filters > #lp-from{order: 3;}
html.mob #page-localpurchase .filters > #lp-to{order: 4;}
html.mob #page-localpurchase .filters > #lp-supplier-filter{order: 5;}
html.mob #page-localpurchase .filters > #lp-status{order: 6;}
html.mob #page-localpurchase .filters > #lp-today{order: 7;}
html.mob #page-localpurchase .filters > #lp-reset{order: 8;}
html.mob /* ---- SUPPLIERS: 2 columns — name with country BELOW it (left) | due
     (right); row 2 merges both columns for the buttons (owner request) ---- */
  #page-suppliers table.m-list tbody tr{grid-template-columns: minmax(0, 1fr) minmax(auto, 46vw);
    gap: 2px 10px;}
html.mob #page-suppliers table.m-list tbody tr td:nth-child(1){grid-area: 1 / 1 / 2 / 2; font-weight: 600;}
html.mob /* a lengthy supplier name WRAPS (no nowrap) — nowrap made it paint over the
     due amount on the right */
  #page-suppliers table.m-list tbody tr td:nth-child(1) strong{white-space: normal;}
html.mob #page-suppliers table.m-list tbody tr td:nth-child(3){grid-area: 1 / 2 / 3 / 3; justify-self: end; font-weight: 600; text-align: right;}
html.mob #page-suppliers table.m-list tbody tr td:nth-child(2){grid-area: 2 / 1 / 3 / 2; font-size: 11px; color: var(--muted); font-style: italic;}
html.mob #page-suppliers table.m-list tbody tr td:nth-child(2)::before{content: 'Country: ';}
html.mob #page-suppliers table.m-list tbody tr td:nth-child(4){grid-area: 3 / 1 / 4 / 3; text-align: left; max-width: none; white-space: normal;}
html.mob #page-suppliers table.m-list tbody tr td:nth-child(4) .btn{margin: 2px 6px 2px 0;}
html.mob /* ---- SUPPLIER PAYMENTS ---- */
  #page-supplierpayments table.m-list tbody tr td:nth-child(1){grid-area: 1 / 1; font-weight: 600;}
html.mob #page-supplierpayments table.m-list tbody tr td:nth-child(1) strong{white-space: nowrap;}
html.mob #page-supplierpayments table.m-list tbody tr td:nth-child(2){grid-area: 1 / 2; white-space: nowrap;}
html.mob #page-supplierpayments table.m-list tbody tr td:nth-child(2)::before{content: ', '; font-weight: 400;}
html.mob #page-supplierpayments table.m-list tbody tr:not(:has(strong)) td:nth-child(2)::before{content: none;}
html.mob /* cont-195 re-map: line 1 no+date | amount SEMI-BOLD, html.mob line 2 supplier |
     status, html.mob line 3 "Mode: x, html.mob Equivalent: y" (the equivalent rides in a data
     attribute — it only shows for foreign currencies), html.mob line 4 created by, html.mob line 5 buttons right */
  #page-supplierpayments table.m-list tbody tr td:nth-child(4){grid-area: 1 / 4; justify-self: end; white-space: nowrap; font-weight: 600;}
html.mob #page-supplierpayments table.m-list tbody tr td:nth-child(3){grid-area: 2 / 1 / 3 / 4; font-weight: 600;}
html.mob #page-supplierpayments table.m-list tbody tr td:nth-child(8){grid-area: 2 / 4; justify-self: end; font-size: 12.5px;}
html.mob #page-supplierpayments table.m-list tbody tr td:nth-child(6){grid-area: 3 / 1 / 4 / -1; text-align: left;
    font-size: 11px; color: var(--muted); font-style: italic;}
html.mob #page-supplierpayments table.m-list tbody tr td:nth-child(6)::before{content: 'Mode: ';}
html.mob #page-supplierpayments table.m-list tbody tr td:nth-child(6)[data-eq]::after{content: ', Equivalent: ' attr(data-eq);}
html.mob #page-supplierpayments table.m-list tbody tr td:nth-child(5){display: none;}
html.mob #page-supplierpayments table.m-list tbody tr td:nth-child(7){grid-area: 4 / 1 / 5 / -1; text-align: left;
    font-size: 11px; color: var(--muted); font-style: italic;}
html.mob #page-supplierpayments table.m-list tbody tr td:nth-child(7)::before{content: 'Created by: ';}
html.mob #page-supplierpayments table.m-list tbody tr td:nth-child(9){grid-area: 5 / 1 / 6 / -1; max-width: none; white-space: nowrap; text-align: right;}
html.mob /* ---- ACCOUNTS: one card — name (account no) · balance right · branch line
     when present · Type · Op · In · Out; the buttons sit in a 2-per-line grid
     UNDER the card (owner request: the old right-hand button stack read as a
     second card inside the card and squeezed the figures). Buttons are
     renamed on phones via data-short (Stat / Edit / Deac / Act / Del). ---- */
  #page-accounts table.m-list tbody tr{grid-template-columns: minmax(0, 1fr) auto;
    gap: 3px 10px;}
html.mob #page-accounts table.m-list tbody tr td:nth-child(1){grid-area: 1 / 1 / 3 / 2; font-weight: 600;}
html.mob #page-accounts table.m-list tbody tr td:nth-child(1) strong{white-space: normal;}
html.mob #page-accounts table.m-list tbody tr td:nth-child(6){grid-area: 1 / 2 / 2 / 3; justify-self: end; white-space: nowrap;}
html.mob /* cont-195 re-map: line 2 = the details/branch line (rendered inside the
     name cell) with the TYPE right, html.mob line 3 = "Op: x, html.mob In: y, html.mob Out: z" ONE
     line (In/Out ride in data attributes — the columns are hidden), html.mob line 4
     = buttons right (real labels again — they have their own row now) */
  #page-accounts table.m-list tbody tr td:nth-child(2){grid-area: 2 / 2; justify-self: end; align-self: end; text-align: right;
    font-size: 11px; font-style: italic;}
html.mob #page-accounts table.m-list tbody tr td:nth-child(3){grid-area: 3 / 1 / 4 / 3; font-size: 12.5px; font-weight: 600; text-align: left;}
html.mob #page-accounts table.m-list tbody tr td:nth-child(3)::before{content: 'Op: '; color: var(--muted); font-weight: 400; font-size: 11px;}
html.mob #page-accounts table.m-list tbody tr td:nth-child(3)::after{content: ', In: ' attr(data-in) ', Out: ' attr(data-out);
    font-weight: 400; font-size: 12.5px;}
html.mob #page-accounts table.m-list tbody tr td:nth-child(4), html.mob #page-accounts table.m-list tbody tr td:nth-child(5){display: none;}
html.mob #page-accounts table.m-list tbody tr td:nth-child(7){grid-area: 4 / 1 / 5 / 3; text-align: right;
    white-space: normal; max-width: none;}
html.mob #page-accounts table.m-list tbody tr td:nth-child(7) .btn{margin: 1px 0 1px .3rem;}
html.mob /* ---- MODIFIED BILLS ---- */
  #page-modifiedbills table.m-list tbody tr td:nth-child(1){grid-area: 1 / 1; font-weight: 600;}
html.mob #page-modifiedbills table.m-list tbody tr td:nth-child(1) strong{white-space: nowrap;}
html.mob #page-modifiedbills table.m-list tbody tr td:nth-child(3){grid-area: 1 / 2; white-space: nowrap;}
html.mob #page-modifiedbills table.m-list tbody tr td:nth-child(3)::before{content: ', '; font-weight: 400;}
html.mob #page-modifiedbills table.m-list tbody tr td:nth-child(7){grid-area: 1 / 4; justify-self: end; white-space: normal;}
html.mob #page-modifiedbills table.m-list tbody tr td:nth-child(7) .btn{margin: 0 0 0 .3rem;}
html.mob /* the reason merges BOTH columns — one full-width line (beat the inline
     340px desktop cap) */
  #page-modifiedbills table.m-list tbody tr td:nth-child(5){grid-area: 2 / 1 / 3 / -1; font-size: 13px; max-width: none !important;}
html.mob #page-modifiedbills table.m-list tbody tr td:nth-child(5)::before{content: 'Reason: '; color: var(--muted); font-size: 11px;}
html.mob #page-modifiedbills table.m-list tbody tr td:nth-child(2), html.mob #page-modifiedbills table.m-list tbody tr td:nth-child(4), html.mob #page-modifiedbills table.m-list tbody tr td:nth-child(6){font-size: 11px; color: var(--muted); font-style: italic; text-align: left;}
html.mob #page-modifiedbills table.m-list tbody tr td:nth-child(2){grid-area: 3 / 1 / 4 / 4;}
html.mob #page-modifiedbills table.m-list tbody tr td:nth-child(2)::before{content: 'Type: ';}
html.mob #page-modifiedbills table.m-list tbody tr td:nth-child(4){grid-area: 4 / 1 / 5 / 4;}
html.mob #page-modifiedbills table.m-list tbody tr td:nth-child(4)::before{content: 'Modified: ';}
html.mob #page-modifiedbills table.m-list tbody tr td:nth-child(6){grid-area: 5 / 1 / 6 / 4;}
html.mob #page-modifiedbills table.m-list tbody tr td:nth-child(6)::before{content: 'By: ';}
html.mob /* ---- AUDIT LOG: "date time, html.mob user" (action right) · Entity + FULL
     details on the next line (the JS no longer truncates the details) ---- */
  #page-logs table.m-list tbody tr{grid-template-columns: minmax(0, auto) minmax(0, 1fr) minmax(0, auto);
    gap: 3px 8px;}
html.mob #page-logs table.m-list tbody tr td:nth-child(1){grid-area: 1 / 1; font-weight: 600; white-space: nowrap;}
html.mob #page-logs table.m-list tbody tr td:nth-child(2){grid-area: 1 / 2; white-space: nowrap;}
html.mob #page-logs table.m-list tbody tr td:nth-child(2)::before{content: ', '; font-weight: 400;}
html.mob #page-logs table.m-list tbody tr td:nth-child(3){grid-area: 1 / 3; justify-self: end;}
html.mob #page-logs table.m-list tbody tr td:nth-child(3) .chip{background: transparent; border: 0; padding: 0;
    font-weight: 400; font-style: italic; font-size: 12.5px;}
html.mob #page-logs table.m-list tbody tr td:nth-child(4){grid-area: 2 / 1 / 3 / 2; font-size: 11px; color: var(--muted); font-style: italic;}
html.mob #page-logs table.m-list tbody tr td:nth-child(4)::before{content: 'Entity: ';}
html.mob #page-logs table.m-list tbody tr td:nth-child(5){grid-area: 2 / 2 / 3 / 4; font-size: 11px; color: var(--muted);
    word-break: break-all; max-width: none;
    display: block; -webkit-line-clamp: unset; -webkit-box-orient: unset;
    overflow: visible;}
html.mob /* ---- USERS & PERMISSIONS: "Username: …, html.mob Full Name" flows as ONE line
     (no virtual middle column) with the perms count right; line 2 =
     Designation (left) | Status (right); line 3 = the buttons in one row, html.mob right aligned (owner request) ---- */
  #page-users table.m-list tbody tr{grid-template-columns: max-content minmax(0, 1fr) auto;
    gap: 3px 0; /* no column gap — the comma prefix carries its own spacing */}
html.mob #page-users table.m-list tbody tr td:nth-child(1){grid-area: 1 / 1 / 2 / 2; font-weight: 600;}
html.mob #page-users table.m-list tbody tr td:nth-child(1)::before{content: 'Username: '; color: var(--muted); font-weight: 400; font-size: 11px;}
html.mob #page-users table.m-list tbody tr td:nth-child(2){grid-area: 1 / 2 / 2 / 3; font-size: 12.5px;}
html.mob #page-users table.m-list tbody tr td:nth-child(2)::before{content: ', '; font-weight: 400;}
html.mob #page-users table.m-list tbody tr td:nth-child(5){grid-area: 1 / 3 / 2 / 4; justify-self: end;}
html.mob #page-users table.m-list tbody tr td:nth-child(5) .chip{background: transparent; border: 0; padding: 0;
    font-weight: 400; font-style: italic; font-size: 12.5px; color: var(--muted);}
html.mob #page-users table.m-list tbody tr td:nth-child(3){grid-area: 2 / 1 / 3 / 3; font-size: 11px; color: var(--muted); font-style: italic;}
html.mob #page-users table.m-list tbody tr td:nth-child(3)::before{content: 'Designation: ';}
html.mob #page-users table.m-list tbody tr td:nth-child(4){grid-area: 2 / 3 / 3 / 4; justify-self: end; text-align: right;
    font-size: 12.5px; white-space: nowrap;}
html.mob #page-users table.m-list tbody tr td:nth-child(4)::before{content: 'Status: '; color: var(--muted); font-weight: 400; font-size: 11px;}
html.mob /* the buttons: one row, html.mob right aligned */
  #page-users table.m-list tbody tr td:nth-child(6){grid-area: 3 / 1 / 4 / 4; text-align: right;
    white-space: normal; max-width: none;}
html.mob #page-users table.m-list tbody tr td:nth-child(6) .btn{margin: 2px 0 2px .3rem;}
html.mob /* ---- ACCOUNT STATEMENT — statement rows with In / Out / Bal tags ---- */
  #page-account-statement table{display: block;}
html.mob #page-account-statement table thead{display: none;}
html.mob #page-account-statement table tbody{display: block;}
html.mob #page-account-statement table tbody tr{display: grid;
    grid-template-columns: max-content max-content minmax(0, 1fr) minmax(auto, 46vw);
    gap: 2px 0;
    padding: 10px 12px;}
html.mob #page-account-statement table tbody tr + tr{border-top: 1px solid var(--line);}
html.mob #page-account-statement table tbody tr td{border: 0; padding: 0; background: none;}
html.mob #page-account-statement table tbody tr td:nth-child(1){grid-area: 1 / 1; font-weight: 600; white-space: nowrap;}
html.mob #page-account-statement table tbody tr td:nth-child(2){grid-area: 1 / 2; font-size: 12.5px;}
html.mob #page-account-statement table tbody tr td:nth-child(2)::before{content: ' ·  ';}
html.mob #page-account-statement table tbody tr .chip{background: transparent; border: 0; padding: 0;
    font-weight: 400; font-style: italic; font-size: 12.5px;}
html.mob #page-account-statement table tbody tr td:nth-child(4){grid-area: 2 / 1 / 3 / 4; font-weight: 600;}
html.mob #page-account-statement table tbody tr td:nth-child(3){grid-area: 3 / 1 / 4 / 4; font-size: 11px; color: var(--muted); font-style: italic;}
html.mob #page-account-statement table tbody tr td:nth-child(3)::before{content: 'Ref: ';}
html.mob #page-account-statement table tbody tr td:nth-child(5), html.mob #page-account-statement table tbody tr td:nth-child(6), html.mob #page-account-statement table tbody tr td:nth-child(7){font-weight: 600; white-space: nowrap;}
html.mob #page-account-statement table tbody tr td:nth-child(5){grid-area: 1 / 4; justify-self: end;}
html.mob #page-account-statement table tbody tr td:nth-child(6){grid-area: 2 / 4; justify-self: end;}
html.mob #page-account-statement table tbody tr td:nth-child(7){grid-area: 3 / 4; justify-self: end;}
html.mob #page-account-statement table tbody tr td:nth-child(5)::before{content: 'In '; color: var(--muted); font-weight: 400; font-size: 11px;}
html.mob #page-account-statement table tbody tr td:nth-child(6)::before{content: 'Out '; color: var(--muted); font-weight: 400; font-size: 11px;}
html.mob #page-account-statement table tbody tr td:nth-child(7)::before{content: 'Bal '; color: var(--muted); font-weight: 400; font-size: 11px;}
html.mob #page-account-statement table tbody tr td[colspan]{grid-column: 1 / -1 !important;}
html.mob /* ---- CUSTOMER PREFERENCE popups (Sold / Returned; dynamic customer
     column — quantity is the .num that is NOT last, html.mob rate/qty-only rows end
     with their .num) ---- */
  #cpf-sold-modal table, html.mob #cpf-ret-modal table{display: block;}
html.mob #cpf-sold-modal table thead, html.mob #cpf-ret-modal table thead{display: none;}
html.mob #cpf-sold-modal table tbody, html.mob #cpf-ret-modal table tbody{display: block;}
html.mob #cpf-sold-modal table tbody tr, html.mob #cpf-ret-modal table tbody tr{display: grid;
    grid-template-columns: min-content max-content minmax(0, 1fr) minmax(auto, 46vw);
    gap: 2px 0;
    padding: 8px 12px;}
html.mob #cpf-sold-modal table tbody tr + tr, html.mob #cpf-ret-modal table tbody tr + tr{border-top: 1px solid var(--line);}
html.mob #cpf-sold-modal table tbody tr td, html.mob #cpf-ret-modal table tbody tr td{border: 0; padding: 0; background: none;}
html.mob #cpf-sold-modal table tbody tr td:nth-child(1), html.mob #cpf-ret-modal table tbody tr td:nth-child(1){grid-area: 1 / 1; font-weight: 600;}
html.mob #cpf-sold-modal table tbody tr td:nth-child(1) strong, html.mob #cpf-ret-modal table tbody tr td:nth-child(1) strong{white-space: nowrap;}
html.mob #cpf-sold-modal table tbody tr td:nth-child(2), html.mob #cpf-ret-modal table tbody tr td:nth-child(2){grid-area: 1 / 2; white-space: nowrap;}
html.mob #cpf-sold-modal table tbody tr td:nth-child(2)::before, html.mob #cpf-ret-modal table tbody tr td:nth-child(2)::before{content: ', '; font-weight: 400;}
html.mob #cpf-sold-modal table tbody tr td.num:not(:last-child){grid-area: 1 / 4; justify-self: end; white-space: nowrap;}
html.mob #cpf-sold-modal table tbody tr td.num:not(:last-child)::before{content: 'Qty: '; color: var(--muted); font-weight: 400; font-size: 11px;}
html.mob #cpf-ret-modal table tbody tr td.num:last-child{grid-area: 1 / 4; justify-self: end; white-space: nowrap;}
html.mob #cpf-ret-modal table tbody tr td.num:last-child::before{content: 'Qty: '; color: var(--muted); font-weight: 400; font-size: 11px;}
html.mob #cpf-sold-modal table tbody tr td.num:last-child{grid-area: 2 / 4; justify-self: end; white-space: nowrap; font-size: 12.5px;}
html.mob #cpf-sold-modal table tbody tr td.num:last-child::before{content: 'Rate: '; color: var(--muted); font-weight: 400; font-size: 11px;}
html.mob #cpf-sold-modal table tbody tr td:nth-child(3):not(.num), html.mob #cpf-ret-modal table tbody tr td:nth-child(3):not(.num){grid-area: 2 / 1 / 3 / 4; font-size: 11px; color: var(--muted); font-style: italic;}
html.mob #cpf-sold-modal table tbody tr td:nth-child(3):not(.num)::before, html.mob #cpf-ret-modal table tbody tr td:nth-child(3):not(.num)::before{content: 'Customer: ';}
html.mob #cpf-sold-modal table tbody tr td[colspan], html.mob #cpf-ret-modal table tbody tr td[colspan]{grid-area: 1 / 1 / 2 / -1 !important;}

html.mob #db-result table{display: block;}
html.mob #db-result table thead{display: none;}
html.mob #db-result table tbody{display: block;}
html.mob #db-result table tbody tr{display: grid;
    grid-template-columns: min-content max-content minmax(0, 1fr) minmax(0, max-content);
    gap: 2px 0;
    padding: 8px 12px;}
html.mob #db-result table tbody tr + tr{border-top: 1px solid var(--line);}
html.mob #db-result table tbody tr td{border: 0; padding: 0; background: none;}
html.mob #db-result table tbody tr td:nth-child(1){grid-area: 1 / 1; font-weight: 600; white-space: nowrap;}
html.mob #db-result table tbody tr td:nth-child(2){grid-area: 1 / 2; white-space: nowrap;}
html.mob #db-result table tbody tr td:nth-child(2)::before{content: ', '; font-weight: 400;}
html.mob #db-result table tbody tr td:nth-child(5){grid-area: 1 / 4; justify-self: end; white-space: nowrap; font-weight: 600;}
html.mob #db-result table tbody tr td:nth-child(3){grid-area: 2 / 1 / 3 / 4; font-weight: 600;}
html.mob #db-result table tbody tr td:nth-child(4){grid-area: 3 / 1 / 4 / 4; font-size: 11px; color: var(--muted); font-style: italic;}
html.mob #db-result table tbody tr td:nth-child(4):not(:empty)::before{content: 'Account: ';}
html.mob /* group band rows ("RECEIPTS — 12 vouchers · total …") keep their band */
  #db-result table tbody tr.db-group td[colspan]{grid-area: 1 / 1 / 2 / -1 !important;
    background: #e4e8ee; border-top: 2px solid var(--line);
    font-size: 12px; text-transform: uppercase; letter-spacing: .05em;
    color: var(--muted); padding: .55rem .6rem .2rem;}
html.mob /* subtotal rows: label left, html.mob amount right — one line (no date comma) */
  #db-result table tbody tr.db-subtotal td[colspan]{grid-area: 1 / 1 / 2 / 4 !important;}
html.mob #db-result table tbody tr.db-subtotal td:nth-child(2){grid-area: 1 / 4; justify-self: end; white-space: nowrap;}
html.mob #db-result table tbody tr.db-subtotal td:nth-child(2)::before{content: none;}
html.mob /* empty-state row spans everything */
  #db-result table tbody tr td[colspan]{grid-area: 1 / 1 / 2 / -1 !important;}

html.mob /* ---- shared machinery: the bare tables of the group ---- */
  #page-items > table, html.mob #page-groups > table, html.mob #page-units > table, html.mob #page-materials > table, html.mob #page-bulkpricing > table, html.mob #page-cans #can-list > table, html.mob #page-production > table, html.mob #page-finishedreceive > table, html.mob #page-semifinishreceive > table, html.mob #page-materialsutilization > table, html.mob #page-semifinishstock #sfs-groups > table, html.mob #page-stockreport #stk-groups > table, html.mob #page-materialsreport #rmr-groups > table, html.mob #gitems-modal table, html.mob #bp-hist-table, html.mob #cm-out table, html.mob #sf-mv-body table, html.mob #sm-body table, html.mob #rm-body table{display: block;}
html.mob #page-items > table thead, html.mob #page-groups > table thead, html.mob #page-units > table thead, html.mob #page-materials > table thead, html.mob #page-bulkpricing > table thead, html.mob #page-cans #can-list > table thead, html.mob #page-production > table thead, html.mob #page-finishedreceive > table thead, html.mob #page-semifinishreceive > table thead, html.mob #page-materialsutilization > table thead, html.mob #page-semifinishstock #sfs-groups > table thead, html.mob #page-stockreport #stk-groups > table thead, html.mob #page-materialsreport #rmr-groups > table thead, html.mob #gitems-modal table thead, html.mob #bp-hist-table thead, html.mob #cm-out table thead, html.mob #sf-mv-body table thead, html.mob #sm-body table thead, html.mob #rm-body table thead{display: none;}
html.mob #page-items > table tbody, html.mob #page-groups > table tbody, html.mob #page-units > table tbody, html.mob #page-materials > table tbody, html.mob #page-bulkpricing > table tbody, html.mob #page-cans #can-list > table tbody, html.mob #page-production > table tbody, html.mob #page-finishedreceive > table tbody, html.mob #page-semifinishreceive > table tbody, html.mob #page-materialsutilization > table tbody, html.mob #page-semifinishstock #sfs-groups > table tbody, html.mob #page-stockreport #stk-groups > table tbody, html.mob #page-materialsreport #rmr-groups > table tbody, html.mob #gitems-modal table tbody, html.mob #bp-hist-table tbody, html.mob #cm-out table tbody, html.mob #sf-mv-body table tbody, html.mob #sm-body table tbody, html.mob #rm-body table tbody{display: block;}
html.mob #page-items > table tbody tr, html.mob #page-groups > table tbody tr, html.mob #page-units > table tbody tr, html.mob #page-materials > table tbody tr, html.mob #page-bulkpricing > table tbody tr, html.mob #page-cans #can-list > table tbody tr, html.mob #page-production > table tbody tr, html.mob #page-finishedreceive > table tbody tr, html.mob #page-semifinishreceive > table tbody tr, html.mob #page-materialsutilization > table tbody tr, html.mob #page-semifinishstock #sfs-groups > table tbody tr, html.mob #page-stockreport #stk-groups > table tbody tr, html.mob #page-materialsreport #rmr-groups > table tbody tr, html.mob #gitems-modal table tbody tr, html.mob #bp-hist-table tbody tr, html.mob #cm-out table tbody tr{display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 2px 10px;
    padding: 10px 12px;}
html.mob #page-items > table tbody tr + tr, html.mob #page-groups > table tbody tr + tr, html.mob #page-units > table tbody tr + tr, html.mob #page-materials > table tbody tr + tr, html.mob #page-bulkpricing > table tbody tr + tr, html.mob #page-cans #can-list > table tbody tr + tr, html.mob #page-production > table tbody tr + tr, html.mob #page-finishedreceive > table tbody tr + tr, html.mob #page-semifinishreceive > table tbody tr + tr, html.mob #page-materialsutilization > table tbody tr + tr, html.mob #page-semifinishstock #sfs-groups > table tbody tr + tr, html.mob #page-stockreport #stk-groups > table tbody tr + tr, html.mob #page-materialsreport #rmr-groups > table tbody tr + tr, html.mob #gitems-modal table tbody tr + tr, html.mob #bp-hist-table tbody tr + tr, html.mob #cm-out table tbody tr + tr{border-top: 1px solid var(--line);}
html.mob #page-items > table tbody tr td, html.mob #page-groups > table tbody tr td, html.mob #page-units > table tbody tr td, html.mob #page-materials > table tbody tr td, html.mob #page-bulkpricing > table tbody tr td, html.mob #page-cans #can-list > table tbody tr td, html.mob #page-production > table tbody tr td, html.mob #page-finishedreceive > table tbody tr td, html.mob #page-semifinishreceive > table tbody tr td, html.mob #page-materialsutilization > table tbody tr td, html.mob #page-semifinishstock #sfs-groups > table tbody tr td, html.mob #page-stockreport #stk-groups > table tbody tr td, html.mob #page-materialsreport #rmr-groups > table tbody tr td, html.mob #gitems-modal table tbody tr td, html.mob #bp-hist-table tbody tr td, html.mob #cm-out table tbody tr td{border: 0; padding: 0; background: none;}
html.mob /* action cells: buttons wrap inside the card */
  #page-items td.actions, html.mob #page-groups td.actions, html.mob #page-units td.actions, html.mob #page-materials td.actions, html.mob #page-bulkpricing td.actions, html.mob #page-cans td.actions, html.mob #page-production > table td.actions, html.mob #page-finishedreceive > table td.actions, html.mob #page-semifinishreceive > table td.actions, html.mob #page-materialsutilization > table td.actions, html.mob #page-semifinishstock #sfs-groups td.actions, html.mob #page-stockreport #stk-groups td.actions, html.mob #page-materialsreport #rmr-groups td.actions{white-space: normal; max-width: none;}
html.mob #page-items td.actions .btn, html.mob #page-groups td.actions .btn, html.mob #page-units td.actions .btn, html.mob #page-materials td.actions .btn, html.mob #page-cans td.actions .btn, html.mob #page-production > table td.actions .btn, html.mob #page-finishedreceive > table td.actions .btn, html.mob #page-semifinishreceive > table td.actions .btn, html.mob #page-materialsutilization > table td.actions .btn, html.mob #page-semifinishstock #sfs-groups td.actions .btn, html.mob #page-stockreport #stk-groups td.actions .btn, html.mob #page-materialsreport #rmr-groups td.actions .btn{margin: 2px 0 2px .3rem;}
html.mob /* banded group rows keep their look */
  #page-items tr.type-head td, html.mob #page-materials tr.type-head td, html.mob #page-cans tr.type-head td, html.mob #page-groups tr.type-head td, html.mob #page-semifinishstock #sfs-groups tr.type-head td, html.mob #page-stockreport #stk-groups tr.type-head td, html.mob #page-materialsreport #rmr-groups tr.type-head td{background: #e4e8ee; border-top: 2px solid var(--line);
    font-size: 12px; text-transform: uppercase; letter-spacing: .05em;
    color: var(--muted); padding: .55rem .6rem .2rem;}
html.mob /* figure prefixes + values (the labelled metric cells) */
  #page-items td.num, html.mob #page-materials td.num, html.mob #page-cans td.num, html.mob #page-semifinishstock #sfs-groups td.num, html.mob #page-stockreport #stk-groups td.num, html.mob #page-materialsreport #rmr-groups td.num{font-size: 12.5px; font-weight: 600;}
html.mob #page-items td.num::before, html.mob #page-materials td.num::before, html.mob #page-cans td.num::before, html.mob #page-semifinishstock #sfs-groups td.num::before, html.mob #page-stockreport #stk-groups td.num::before, html.mob #page-materialsreport #rmr-groups td.num::before{color: var(--muted); font-weight: 400; font-size: 11px;}
html.mob /* cont-209: the group's record lists (production, html.mob receives, html.mob utilizations) —
     the first cell is the record's identity (strong) and the action buttons
     ALWAYS sit on their own last line, html.mob right-aligned, html.mob like the other cards */
  #page-production > table tbody tr td:first-child, html.mob #page-finishedreceive > table tbody tr td:first-child, html.mob #page-semifinishreceive > table tbody tr td:first-child, html.mob #page-materialsutilization > table tbody tr td:first-child, html.mob #page-finishedutilization > table tbody tr td:first-child, html.mob #page-semiutilization > table tbody tr td:first-child{font-weight: 600;}
html.mob #page-production > table tbody tr td.actions, html.mob #page-finishedreceive > table tbody tr td.actions, html.mob #page-semifinishreceive > table tbody tr td.actions, html.mob #page-materialsutilization > table tbody tr td.actions, html.mob #page-finishedutilization > table tbody tr td.actions, html.mob #page-semiutilization > table tbody tr td.actions{grid-column: 1 / -1; text-align: right;}
html.mob /* band rows and empty states span the whole card (bulk pricing handles its
     own — its band carries inputs, html.mob not a colspan) */
  #page-items td[colspan], html.mob #page-groups td[colspan], html.mob #page-units td[colspan], html.mob #page-materials td[colspan], html.mob #page-cans td[colspan], html.mob #page-semifinishstock #sfs-groups td[colspan], html.mob #page-stockreport #stk-groups td[colspan], html.mob #page-materialsreport #rmr-groups td[colspan]{grid-area: 1 / 1 / 2 / -1 !important;}
html.mob /* ---- ITEMS (cont-209 re-map): line 1 = name | Stock right (semi-bold), html.mob line 2 = "Unit: u, html.mob Price: p, html.mob Ideal: i" full width (price/ideal ride in
     data attributes — those columns are hidden), html.mob line 3 = buttons right ---- */
  #page-items > table tbody tr{grid-template-columns: minmax(0, 1fr) auto;}
html.mob #page-items td:nth-child(1){grid-area: 1 / 1 / 2 / 2; font-weight: 600;}
html.mob #page-items td:nth-child(1) strong{white-space: normal;}
html.mob #page-items td:nth-child(4){grid-area: 1 / 2 / 2 / 3; justify-self: end; text-align: right; font-size: 12.5px;}
html.mob #page-items td:nth-child(4)::before{content: 'Stock: '; color: var(--muted); font-weight: 400; font-size: 11px;}
html.mob #page-items td:nth-child(2){grid-area: 2 / 1 / 3 / 3; font-size: 12.5px;}
html.mob #page-items td:nth-child(2)::before{content: 'Unit: '; color: var(--muted); font-weight: 400; font-size: 11px;}
html.mob #page-items td:nth-child(2)[data-price]::after{content: ', Price: ' attr(data-price) ', Ideal: ' attr(data-ideal);
    font-weight: 400; font-size: 12.5px;}
html.mob #page-items td:nth-child(3), html.mob #page-items td:nth-child(5){display: none;}
html.mob #page-items td:nth-child(6){grid-area: 3 / 1 / 4 / 3; text-align: right;}
html.mob /* ---- GROUPS: name | Assigned · buttons ---- */
  #page-groups td:nth-child(1){grid-area: 1 / 1 / 2 / 2; font-weight: 600;}
html.mob #page-groups td:nth-child(2){grid-area: 1 / 2 / 2 / 3; justify-self: end; font-size: 12.5px; font-weight: 600;}
html.mob #page-groups td:nth-child(2)::before{content: 'Assigned: '; color: var(--muted); font-weight: 400; font-size: 11px;}
html.mob #page-groups td:nth-child(3){grid-area: 2 / 1 / 3 / 3; text-align: right;}
html.mob /* ---- RAW MATERIALS (cont-209): line 1 = name | Stock w/ unit right, html.mob line 2 = Known as + Ideal, html.mob line 3 = buttons right ---- */
  #page-materials > table tbody tr{grid-template-columns: minmax(0, 1fr) auto;}
html.mob #page-materials td:nth-child(1){grid-area: 1 / 1 / 2 / 2; font-weight: 600;}
html.mob #page-materials td:nth-child(1) strong{white-space: normal;}
html.mob #page-materials td:nth-child(5){grid-area: 1 / 2 / 2 / 3; justify-self: end; text-align: right; font-size: 12.5px;}
html.mob #page-materials td:nth-child(5)::before{content: 'Stock: '; color: var(--muted); font-weight: 400; font-size: 11px;}
html.mob #page-materials td:nth-child(5)[data-unit]::after{content: ' ' attr(data-unit); font-weight: 400; font-size: 11px;}
html.mob #page-materials td:nth-child(5) div{display: none;}
html.mob /* the low-stock sub-line */
  #page-materials td:nth-child(2){grid-area: 2 / 1 / 3 / 3; font-size: 12.5px; font-style: italic; color: var(--muted); overflow-wrap: anywhere;}
html.mob #page-materials td:nth-child(2)::before{content: 'Known as: '; font-style: normal; color: var(--muted); font-weight: 400; font-size: 11px;}
html.mob #page-materials td:nth-child(2)::after{content: ', Ideal: ' attr(data-ideal);   /* cont-210: one line left to right, like the customers card */
    font-style: normal; font-weight: 400; font-size: 12.5px;}
html.mob #page-materials td:nth-child(3), html.mob #page-materials td:nth-child(4){display: none;}
html.mob #page-materials td:nth-child(6){grid-area: 3 / 1 / 4 / 3; text-align: right;}
html.mob /* ---- RAW MATERIALS REPORT (cont-209): line 1 = name | stock right, html.mob line 2 = "Opening: q, html.mob Purch: q, html.mob Prod: q, html.mob Used: q, html.mob Value: a" (rides on
     data attributes — the figure columns are hidden), html.mob line 3 = buttons ---- */
  #page-materialsreport #rmr-groups > table tbody tr{grid-template-columns: minmax(0, 1fr) auto;}
html.mob #page-materialsreport #rmr-groups td:nth-child(1){grid-area: 1 / 1 / 2 / 2; font-weight: 600;}
html.mob #page-materialsreport .u-quiet{display: none;}
html.mob #page-materialsreport #rmr-groups td:nth-child(6){grid-area: 1 / 2 / 2 / 3; justify-self: end; text-align: right; font-size: 12.5px;}
html.mob #page-materialsreport #rmr-groups td:nth-child(6)::before{content: 'Stock: '; color: var(--muted); font-weight: 400; font-size: 11px;}
html.mob #page-materialsreport #rmr-groups td:nth-child(2){grid-area: 2 / 1 / 3 / 3; font-size: 12.5px;}
html.mob #page-materialsreport #rmr-groups td:nth-child(2)::before{content: 'Opening: '; color: var(--muted); font-weight: 400; font-size: 11px;}
html.mob #page-materialsreport #rmr-groups td:nth-child(2)[data-purch]::after{content: ', Purch: ' attr(data-purch) ', Prod: ' attr(data-prod) ', Used: ' attr(data-used) ', Value: ' attr(data-value);
    font-weight: 400; font-size: 12.5px;}
html.mob #page-materialsreport #rmr-groups td:nth-child(3), html.mob #page-materialsreport #rmr-groups td:nth-child(4), html.mob #page-materialsreport #rmr-groups td:nth-child(5), html.mob #page-materialsreport #rmr-groups td:nth-child(7){display: none;}
html.mob #page-materialsreport #rmr-groups td:nth-child(8){grid-area: 3 / 1 / 4 / 3; text-align: right;}
html.mob /* ---- STOCK REPORT (cont-209): line 1 = name | closing stock right, html.mob line 2 = the period's movements + value (data attributes), html.mob line 3 =
     Graph / View movements right ---- */
  #page-stockreport #stk-groups > table tbody tr{grid-template-columns: minmax(0, 1fr) auto;}
html.mob #page-stockreport #stk-groups td:nth-child(1){grid-area: 1 / 1 / 2 / 2; font-weight: 600;}
html.mob #page-stockreport .u-quiet{display: none;}
html.mob #page-stockreport #stk-groups td:nth-child(8){grid-area: 1 / 2 / 2 / 3; justify-self: end; text-align: right; font-size: 12.5px;}
html.mob #page-stockreport #stk-groups td:nth-child(8)::before{content: 'Stock: '; color: var(--muted); font-weight: 400; font-size: 11px;}
html.mob #page-stockreport #stk-groups td:nth-child(2){grid-area: 2 / 1 / 3 / 3; font-size: 12.5px;}
html.mob #page-stockreport #stk-groups td:nth-child(2)::before{content: 'Opening: '; color: var(--muted); font-weight: 400; font-size: 11px;}
html.mob #page-stockreport #stk-groups td:nth-child(2)[data-produced]::after{content: ', Produced: ' attr(data-produced) ', Purchased: ' attr(data-purchased) ', Sold: ' attr(data-sold) ', Returned: ' attr(data-returned) ', Adjusted: ' attr(data-adjusted) ', Value: ' attr(data-value);
    font-weight: 400; font-size: 12.5px;}
html.mob #page-stockreport #stk-groups td:nth-child(3), html.mob #page-stockreport #stk-groups td:nth-child(4), html.mob #page-stockreport #stk-groups td:nth-child(5), html.mob #page-stockreport #stk-groups td:nth-child(6), html.mob #page-stockreport #stk-groups td:nth-child(7), html.mob #page-stockreport #stk-groups td:nth-child(9){display: none;}
html.mob #page-stockreport #stk-groups td:nth-child(10){grid-area: 3 / 1 / 4 / 3; text-align: right;}
html.mob /* ---- SEMI FINISH STOCK (cont-209): line 1 = name | stock right, html.mob line 2 =
     "Opening: q, html.mob Prod: q, html.mob Recv: q, html.mob Used: q" (data attributes), html.mob line 3 =
     Graph / View movements right ---- */
  #page-semifinishstock #sfs-groups > table tbody tr{grid-template-columns: minmax(0, 1fr) auto;}
html.mob #page-semifinishstock #sfs-groups td:nth-child(1){grid-area: 1 / 1 / 2 / 2; font-weight: 600;}
html.mob #page-semifinishstock .u-quiet{display: none;}
html.mob #page-semifinishstock #sfs-groups td:nth-child(6){grid-area: 1 / 2 / 2 / 3; justify-self: end; text-align: right; font-size: 12.5px;}
html.mob #page-semifinishstock #sfs-groups td:nth-child(6)::before{content: 'Stock: '; color: var(--muted); font-weight: 400; font-size: 11px;}
html.mob #page-semifinishstock #sfs-groups td:nth-child(2){grid-area: 2 / 1 / 3 / 3; font-size: 12.5px;}
html.mob #page-semifinishstock #sfs-groups td:nth-child(2)::before{content: 'Opening: '; color: var(--muted); font-weight: 400; font-size: 11px;}
html.mob #page-semifinishstock #sfs-groups td:nth-child(2)[data-prod]::after{content: ', Prod: ' attr(data-prod) ', Recv: ' attr(data-recv) ', Used: ' attr(data-used);
    font-weight: 400; font-size: 12.5px;}
html.mob #page-semifinishstock #sfs-groups td:nth-child(3), html.mob #page-semifinishstock #sfs-groups td:nth-child(4), html.mob #page-semifinishstock #sfs-groups td:nth-child(5){display: none;}
html.mob #page-semifinishstock #sfs-groups td:nth-child(7){grid-area: 3 / 1 / 4 / 3; text-align: right;}
html.mob /* ---- CANS & CARTONS (cont-209): line 1 = name | In stock right, html.mob line 2 =
     "Unit: u, html.mob Opening: n, html.mob Ideal: n", html.mob line 3 = buttons right ---- */
  #page-cans #can-list > table tbody tr{grid-template-columns: minmax(0, 1fr) auto;}
html.mob #page-cans #can-list > table tbody tr td:nth-child(1){grid-area: 1 / 1 / 2 / 2; font-weight: 600;}
html.mob #page-cans #can-list > table tbody tr td:nth-child(1) strong{white-space: normal;}
html.mob #page-cans #can-list > table tbody tr td:nth-child(4){grid-area: 1 / 2 / 2 / 3; justify-self: end; text-align: right; font-size: 12.5px;}
html.mob #page-cans #can-list > table tbody tr td:nth-child(4)::before{content: 'In stock: '; color: var(--muted); font-weight: 400; font-size: 11px;}
html.mob #page-cans #can-list > table tbody tr td:nth-child(4) div{display: none;}
html.mob #page-cans #can-list > table tbody tr td:nth-child(2){grid-area: 2 / 1 / 3 / 3; font-size: 12.5px;}
html.mob #page-cans #can-list > table tbody tr td:nth-child(2)::before{content: 'Unit: '; color: var(--muted); font-weight: 400; font-size: 11px;}
html.mob #page-cans #can-list > table tbody tr td:nth-child(2)[data-open]::after{content: ', Opening: ' attr(data-open) ', Ideal: ' attr(data-ideal);
    font-weight: 400; font-size: 12.5px;}
html.mob #page-cans #can-list > table tbody tr td:nth-child(3), html.mob #page-cans #can-list > table tbody tr td:nth-child(5){display: none;}
html.mob #page-cans #can-list > table tbody tr td:nth-child(6){grid-area: 3 / 1 / 4 / 3; text-align: right;}
html.mob /* ---- UNITS: name | In use · buttons ---- */
  #page-units td:nth-child(1){grid-area: 1 / 1 / 2 / 2; font-weight: 600;}
html.mob #page-units td:nth-child(2){grid-area: 1 / 2 / 2 / 3; justify-self: end; font-size: 12.5px; font-weight: 600;}
html.mob #page-units td:nth-child(2)::before{content: 'In use: '; color: var(--muted); font-weight: 400; font-size: 11px;}
html.mob #page-units td:nth-child(3){grid-area: 2 / 1 / 3 / 3;}
html.mob /* ---- MATERIALS: name | Stock · Known as · Unit/Ideal · buttons ---- */
  #page-materials > table tbody tr{grid-template-columns: repeat(2, minmax(0, 1fr));}
html.mob #page-materials td:nth-child(1){grid-area: 1 / 1 / 2 / 2; font-weight: 600;}
html.mob #page-materials td:nth-child(1) strong{white-space: normal;}
html.mob #page-materials td:nth-child(5){grid-area: 1 / 2 / 2 / 3; justify-self: end; text-align: right;}
html.mob #page-materials td:nth-child(5)::before{content: 'Stock: ';}
html.mob #page-materials td:nth-child(2){grid-area: 2 / 1 / 3 / 3; font-size: 11px; color: var(--muted); font-style: italic;}
html.mob #page-materials td:nth-child(2)::before{content: 'Known as: ';}
html.mob #page-materials td:nth-child(3){grid-area: 3 / 1 / 4 / 2; font-weight: 400; font-style: italic; color: var(--muted);}
html.mob #page-materials td:nth-child(3)::before{content: 'Unit: ';}
html.mob #page-materials td:nth-child(4){grid-area: 3 / 2 / 4 / 3; justify-self: end;}
html.mob #page-materials td:nth-child(4)::before{content: 'Ideal: ';}
html.mob #page-materials td:nth-child(6){grid-area: 4 / 1 / 5 / 3;}
html.mob /* ---- BULK PRICING: item | unit | current price; new-price input +
     History below; the GROUP band keeps its input + Apply ---- */
  #page-bulkpricing > table tbody tr{grid-template-columns: minmax(0, 1fr) auto auto;}
html.mob #page-bulkpricing td:nth-child(1){grid-area: 1 / 1 / 2 / 2; font-weight: 600;}
html.mob #page-bulkpricing td:nth-child(1) strong{white-space: normal;}
html.mob #page-bulkpricing td:nth-child(2){grid-area: 1 / 2 / 2 / 3; font-size: 11px; color: var(--muted); font-style: italic;}
html.mob #page-bulkpricing td:nth-child(3){grid-area: 1 / 3 / 2 / 4; justify-self: end;}
html.mob #page-bulkpricing td:nth-child(3)::before{content: 'Current: '; color: var(--muted); font-weight: 400; font-size: 11px;}
html.mob #page-bulkpricing td:nth-child(4){grid-area: 2 / 1 / 3 / 3;}
html.mob #page-bulkpricing td:nth-child(5){grid-area: 2 / 3 / 3 / 4; justify-self: end;}
html.mob /* the band row: same slots, html.mob but no metric prefixes; empty rows full width */
  #page-bulkpricing tr.type-head td::before{content: none !important;}
html.mob #page-bulkpricing tr.type-head td:nth-child(1){font-weight: 600;}
html.mob #page-bulkpricing tr.type-head td:nth-child(2){justify-self: end;}
html.mob #page-bulkpricing tr.type-head td:nth-child(3){justify-self: end;}
html.mob #page-bulkpricing tr:not(.type-head) td[colspan]{grid-area: 1 / 1 / 2 / -1 !important;}
html.mob /* ---- CANS & CARTONS: name | In stock · Unit/Ideal · Opening · buttons
     (the map works with AND without the Actions column) ---- */
  #page-cans > table tbody tr, html.mob #page-cans #can-list > table tbody tr{grid-template-columns: repeat(2, minmax(0, 1fr));}
html.mob #page-cans #can-list td:nth-child(1){grid-area: 1 / 1 / 2 / 2; font-weight: 600;}
html.mob #page-cans #can-list td:nth-child(1) strong{white-space: normal;}
html.mob #page-cans #can-list td:nth-child(4){grid-area: 1 / 2 / 2 / 3; justify-self: end; text-align: right;}
html.mob #page-cans #can-list td:nth-child(4)::before{content: 'In stock: ';}
html.mob #page-cans #can-list td:nth-child(2){grid-area: 2 / 1 / 3 / 2; font-weight: 400; font-style: italic; color: var(--muted);}
html.mob #page-cans #can-list td:nth-child(2)::before{content: 'Unit: ';}
html.mob #page-cans #can-list td:nth-child(5){grid-area: 2 / 2 / 3 / 3; justify-self: end;}
html.mob #page-cans #can-list td:nth-child(5)::before{content: 'Ideal: ';}
html.mob #page-cans #can-list td:nth-child(3){grid-area: 3 / 1 / 4 / 3;}
html.mob #page-cans #can-list td:nth-child(3)::before{content: 'Opening: ';}
html.mob #page-cans #can-list td:nth-child(6){grid-area: 4 / 1 / 5 / 3;}
html.mob /* ---- PRODUCTION / FINISHED / SEMI-FINISHED RECEIVE / MATERIALS
     UTILIZATION: "number, html.mob date" (status right) · items · by · buttons ---- */
  #page-production > table tbody tr, html.mob #page-finishedreceive > table tbody tr, html.mob #page-semifinishreceive > table tbody tr, html.mob #page-materialsutilization > table tbody tr{grid-template-columns: min-content max-content minmax(0, 1fr) auto;
    gap: 2px 0; /* no column gap — the comma prefix carries its own spacing */}
html.mob #page-production > table td:nth-child(1), html.mob #page-finishedreceive > table td:nth-child(1), html.mob #page-semifinishreceive > table td:nth-child(1), html.mob #page-materialsutilization > table td:nth-child(1){grid-area: 1 / 1 / 2 / 2; font-weight: 600;}
html.mob #page-production > table td:nth-child(1) strong, html.mob #page-finishedreceive > table td:nth-child(1) strong, html.mob #page-semifinishreceive > table td:nth-child(1) strong, html.mob #page-materialsutilization > table td:nth-child(1) strong{white-space: nowrap;}
html.mob #page-production > table td:nth-child(2), html.mob #page-finishedreceive > table td:nth-child(2), html.mob #page-semifinishreceive > table td:nth-child(2), html.mob #page-materialsutilization > table td:nth-child(2){grid-area: 1 / 2 / 2 / 3; white-space: nowrap;}
html.mob #page-production > table td:nth-child(2)::before, html.mob #page-finishedreceive > table td:nth-child(2)::before, html.mob #page-semifinishreceive > table td:nth-child(2)::before, html.mob #page-materialsutilization > table td:nth-child(2)::before{content: ', '; font-weight: 400;}
html.mob #page-production > table td:nth-child(3), html.mob #page-finishedreceive > table td:nth-child(3), html.mob #page-semifinishreceive > table td:nth-child(3), html.mob #page-materialsutilization > table td:nth-child(3){grid-area: 1 / 4 / 2 / 5; justify-self: end; text-align: right;
    font-size: 12.5px;}
html.mob #page-production > table td:nth-child(3) .chip, html.mob #page-finishedreceive > table td:nth-child(3) .chip, html.mob #page-semifinishreceive > table td:nth-child(3) .chip, html.mob #page-materialsutilization > table td:nth-child(3) .chip{background: transparent; border: 0; padding: 0;
    font-weight: 400; font-style: italic;}
html.mob #page-production > table td:nth-child(4), html.mob #page-finishedreceive > table td:nth-child(4), html.mob #page-semifinishreceive > table td:nth-child(4), html.mob #page-materialsutilization > table td:nth-child(4){grid-area: 2 / 1 / 3 / 5; font-weight: 600;}
html.mob #page-production > table td:nth-child(5), html.mob #page-finishedreceive > table td:nth-child(5), html.mob #page-semifinishreceive > table td:nth-child(5), html.mob #page-materialsutilization > table td:nth-child(5){grid-area: 3 / 1 / 4 / 5; font-size: 11px; color: var(--muted); font-style: italic;}
html.mob #page-production > table td:nth-child(5)::before{content: 'Produced by ';}
html.mob #page-finishedreceive > table td:nth-child(5)::before, html.mob #page-semifinishreceive > table td:nth-child(5)::before{content: 'Delivered by ';}
html.mob #page-materialsutilization > table td:nth-child(5)::before{content: 'Received by ';}
html.mob #page-production > table td:nth-child(6), html.mob #page-finishedreceive > table td:nth-child(6), html.mob #page-semifinishreceive > table td:nth-child(6), html.mob #page-materialsutilization > table td:nth-child(6){grid-area: 4 / 1 / 5 / 5; text-align: right;}
html.mob /* deleted rows: the reason line spans the card, html.mob BELOW the number/date line
     (tr + class beats the generic td[colspan] rule below it) */
  #page-production > table tbody tr td.void-msg, html.mob #page-finishedreceive > table tbody tr td.void-msg, html.mob #page-semifinishreceive > table tbody tr td.void-msg, html.mob #page-materialsutilization > table tbody tr td.void-msg{grid-area: 2 / 1 / 3 / -1 !important;}
html.mob /* empty-state rows */
  #page-production > table td[colspan], html.mob #page-finishedreceive > table td[colspan], html.mob #page-semifinishreceive > table td[colspan], html.mob #page-materialsutilization > table td[colspan]{grid-area: 1 / 1 / 2 / -1 !important;}
html.mob /* cont-209: the old 3-column cards for SEMI STOCK / STOCK REPORT / RAW
     MATERIALS REPORT were replaced by the cont-209 one-line-figure cards
     mapped with the ITEMS block above (semi stock keeps its own map below) */

  /* ---- the small modal tables: name | value cards ---- */
  #gitems-modal table tbody tr td:nth-child(1){grid-area: 1 / 1 / 2 / 2; font-weight: 600;}
html.mob #gitems-modal table tbody tr td:nth-child(2){grid-area: 1 / 2 / 2 / 3; justify-self: end; font-weight: 600;}
html.mob #gitems-modal table tbody tr td[colspan]{grid-area: 1 / 1 / 2 / -1 !important;}
html.mob #bp-hist-table tbody tr td:nth-child(1){grid-area: 1 / 1 / 2 / 2; font-weight: 600;}
html.mob #bp-hist-table tbody tr td:nth-child(3){grid-area: 1 / 2 / 2 / 3; justify-self: end; font-weight: 600;}
html.mob #bp-hist-table tbody tr td:nth-child(2){grid-area: 2 / 1 / 3 / 3; font-size: 11px; color: var(--muted); font-style: italic;}
html.mob #bp-hist-table tbody tr td[colspan]{grid-area: 1 / 1 / 2 / -1 !important;}
html.mob /* can movements: date | qty · stock after · reason */
  #cm-out table tbody tr{grid-template-columns: minmax(0, 1fr) auto;}
html.mob #cm-out table tbody tr td:nth-child(1){grid-area: 1 / 1 / 2 / 2; font-weight: 600;}
html.mob #cm-out table tbody tr td:nth-child(2){grid-area: 1 / 2 / 2 / 3; justify-self: end; font-weight: 600;}
html.mob #cm-out table tbody tr td:nth-child(3){grid-area: 2 / 1 / 3 / 2; font-size: 12.5px;}
html.mob #cm-out table tbody tr td:nth-child(3)::before{content: 'Stock after: '; color: var(--muted); font-weight: 400; font-size: 11px;}
html.mob #cm-out table tbody tr td:nth-child(4){grid-area: 3 / 1 / 4 / 3; font-size: 11px; color: var(--muted); font-style: italic;}
html.mob /* ---- movements popups ( Produced/Received/Consumed/... sections ):
     each row reads as one wrapped inline line ---- */
  #sf-mv-body table tbody tr, html.mob #sm-body table tbody tr, html.mob #rm-body table tbody tr{display: block; padding: 8px 12px; border-top: 1px solid var(--line);}
html.mob #sf-mv-body table tbody tr + tr, html.mob #sm-body table tbody tr + tr, html.mob #rm-body table tbody tr + tr{border-top: 1px solid var(--line);}
html.mob #sf-mv-body td, html.mob #sm-body td, html.mob #rm-body td{display: inline; border: 0; padding: 0 8px 0 0; background: none;}
html.mob #sf-mv-body td.num, html.mob #sm-body td.num, html.mob #rm-body td.num{font-weight: 600;}
html.mob /* wide label/value tables inside details modals scroll, html.mob never clip */
  #prod-view-modal .modal-box, html.mob #fr-view-modal .modal-box, html.mob #sfr-view-modal .modal-box, html.mob #mu-view-modal .modal-box, html.mob #sfs-mv-modal .modal-box, html.mob #stk-mv-modal .modal-box, html.mob #rmr-mv-modal .modal-box, html.mob #can-move-modal .modal-box, html.mob #gitems-modal .modal-box, html.mob #bp-hist-modal .modal-box{overflow-x: auto;}

html.mob #page-finishedutilization > table, html.mob #page-semiutilization > table{display: block;}
html.mob #page-finishedutilization > table thead, html.mob #page-semiutilization > table thead{display: none;}
html.mob #page-finishedutilization > table tbody, html.mob #page-semiutilization > table tbody{display: block;}
html.mob #page-finishedutilization > table tbody tr, html.mob #page-semiutilization > table tbody tr{display: grid;
    grid-template-columns: min-content max-content minmax(0, 1fr) auto;
    gap: 2px 0; /* no column gap — the comma prefix carries its own spacing */
    padding: 10px 12px;}
html.mob #page-finishedutilization > table tbody tr + tr, html.mob #page-semiutilization > table tbody tr + tr{border-top: 1px solid var(--line);}
html.mob #page-finishedutilization > table tbody tr td, html.mob #page-semiutilization > table tbody tr td{border: 0; padding: 0; background: none;}
html.mob /* line 1: number + comma + date (status right) */
  #page-finishedutilization > table td:nth-child(1), html.mob #page-semiutilization > table td:nth-child(1){grid-area: 1 / 1 / 2 / 2; font-weight: 600;}
html.mob #page-finishedutilization > table td:nth-child(1) strong, html.mob #page-semiutilization > table td:nth-child(1) strong{white-space: nowrap;}
html.mob #page-finishedutilization > table td:nth-child(2), html.mob #page-semiutilization > table td:nth-child(2){grid-area: 1 / 2 / 2 / 3; white-space: nowrap;}
html.mob #page-finishedutilization > table td:nth-child(2)::before, html.mob #page-semiutilization > table td:nth-child(2)::before{content: ', '; font-weight: 400;}
html.mob #page-finishedutilization > table td:nth-child(3), html.mob #page-semiutilization > table td:nth-child(3){grid-area: 1 / 4 / 2 / 5; justify-self: end; text-align: right; font-size: 12.5px;}
html.mob #page-finishedutilization > table td:nth-child(3) .chip, html.mob #page-semiutilization > table td:nth-child(3) .chip{background: transparent; border: 0; padding: 0;
    font-weight: 400; font-style: italic;}
html.mob /* line 2: the items list */
  #page-finishedutilization > table td:nth-child(4), html.mob #page-semiutilization > table td:nth-child(4){grid-area: 2 / 1 / 3 / 5; font-weight: 600;}
html.mob /* line 3: received by (quiet) */
  #page-finishedutilization > table td:nth-child(5), html.mob #page-semiutilization > table td:nth-child(5){grid-area: 3 / 1 / 4 / 5; font-size: 11px; color: var(--muted); font-style: italic;}
html.mob #page-finishedutilization > table td:nth-child(5)::before, html.mob #page-semiutilization > table td:nth-child(5)::before{content: 'Received by ';}
html.mob /* line 4: the buttons, html.mob right aligned */
  #page-finishedutilization > table td:nth-child(6), html.mob #page-semiutilization > table td:nth-child(6){grid-area: 4 / 1 / 5 / 5; text-align: right;}
html.mob #page-finishedutilization > table td.actions .btn, html.mob #page-semiutilization > table td.actions .btn{white-space: normal; max-width: none; margin: 2px 0 2px .3rem;}
html.mob /* deleted vouchers: the reason line spans the card, html.mob below the number/date */
  #page-finishedutilization > table tbody tr td.void-msg, html.mob #page-semiutilization > table tbody tr td.void-msg{grid-area: 2 / 1 / 3 / -1 !important;}
html.mob /* empty-state rows */
  #page-finishedutilization > table td[colspan], html.mob #page-semiutilization > table td[colspan]{grid-area: 1 / 1 / 2 / -1 !important;}
html.mob /* the details modal's label/value tables scroll, html.mob never clip */
  #fu-view-modal .modal-box, html.mob #su-view-modal .modal-box{overflow-x: auto;}

html.mob #sup-stmt-result table{display: block;}
html.mob #sup-stmt-result table thead{display: none;}
html.mob #sup-stmt-result table tbody{display: block;}
html.mob #sup-stmt-result table tbody tr{display: grid;
    grid-template-columns: min-content max-content minmax(0, 1fr) minmax(auto, 46vw);
    gap: 2px 6px;
    padding: 10px 12px;}
html.mob #sup-stmt-result table tbody tr + tr{border-top: 1px solid var(--line);}
html.mob #sup-stmt-result table tbody tr td{border: 0; padding: 0; background: none; text-align: left;}
html.mob #sup-stmt-result table tbody tr td:nth-child(1){grid-area: 1 / 1; white-space: nowrap;}
html.mob #sup-stmt-result table tbody tr td:nth-child(2){grid-area: 1 / 2;}
html.mob #sup-stmt-result table tbody tr td:nth-child(2) .chip{background: transparent; border: 0; padding: 0; font-weight: 400; font-size: 11px;}
html.mob #sup-stmt-result table tbody tr td:nth-child(3){grid-area: 1 / 3; font-size: 11px; color: var(--muted); font-style: italic;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;}
html.mob #sup-stmt-result table tbody tr td:nth-child(7){grid-area: 1 / 4; justify-self: end; white-space: nowrap;}
html.mob #sup-stmt-result table tbody tr td:nth-child(4){grid-area: 2 / 1 / 3 / -1; text-align: left;
    font-size: 11px; color: var(--muted); font-style: italic;}
html.mob #sup-stmt-result table tbody tr td:nth-child(4):empty{display: none;}
html.mob #sup-stmt-result table tbody tr td:nth-child(5){grid-area: 3 / 1 / 4 / -1; text-align: left; font-size: 12.5px;}
html.mob /* the desktop "—" dash span is hidden here; the Debit/Credit labels are
     gated on it with :has so a credit-only row reads "Credit: x" */
  #sup-stmt-result table tbody tr td:nth-child(5) .dmuted{display: none;}
html.mob #sup-stmt-result table tbody tr td:nth-child(5):not(:has(.dmuted))::before{content: 'Debit: '; color: var(--muted); font-weight: 400; font-size: 11px;}
html.mob #sup-stmt-result table tbody tr td:nth-child(5):not(:has(.dmuted))[data-cr]::after{content: ', Credit: ' attr(data-cr); color: var(--muted); font-weight: 400; font-size: 11px;}
html.mob #sup-stmt-result table tbody tr td:nth-child(5):has(.dmuted)[data-cr]::after{content: 'Credit: ' attr(data-cr); color: var(--muted); font-weight: 400; font-size: 11px;}
html.mob #sup-stmt-result table tbody tr td:nth-child(5):has(.dmuted):not([data-cr]){display: none;}
html.mob #sup-stmt-result table tbody tr td:nth-child(6){display: none;}

html.mob #page-items > table tbody tr, html.mob #page-groups > table tbody tr, html.mob #page-units > table tbody tr, html.mob #page-materials > table tbody tr{display: flex; flex-wrap: wrap; width: 100%; min-width: 100%; max-width: 100%;
    box-sizing: border-box; align-items: baseline; gap: 3px 0; padding: 10px 12px;}
html.mob /* line 1: name takes the rest, html.mob the metric hugs the right edge */
  #page-items > table tbody tr td:nth-child(1), html.mob #page-groups > table tbody tr td:nth-child(1), html.mob #page-units > table tbody tr td:nth-child(1), html.mob #page-materials > table tbody tr td:nth-child(1){order: 1; flex: 1 1 auto; min-width: 0; font-weight: 600;}
html.mob #page-items > table tbody tr td:nth-child(1) strong, html.mob #page-materials > table tbody tr td:nth-child(1) strong{white-space: normal;}
html.mob #page-items > table tbody tr td:nth-child(4), html.mob #page-groups > table tbody tr td:nth-child(2), html.mob #page-units > table tbody tr td:nth-child(2), html.mob #page-materials > table tbody tr td:nth-child(5){order: 2; flex: 0 0 auto; text-align: right; font-size: 12.5px; font-weight: 600;}
html.mob #page-groups > table tbody tr td:nth-child(2)::before{content: 'Assigned: ';}
html.mob #page-units > table tbody tr td:nth-child(2)::before{content: 'In use: ';}
html.mob /* line 2: the comma-separated figures, html.mob full width */
  #page-items > table tbody tr td:nth-child(2), html.mob #page-materials > table tbody tr td:nth-child(2){order: 3; flex: 1 1 100%; min-width: 0; font-size: 12.5px;}
html.mob /* line 3: the buttons — one row, html.mob right aligned */
  #page-items > table tbody tr td:nth-child(6), html.mob #page-groups > table tbody tr td:nth-child(3), html.mob #page-units > table tbody tr td:nth-child(3), html.mob #page-materials > table tbody tr td:nth-child(6){order: 4; flex: 1 1 100%; min-width: 0;
    display: flex; flex-wrap: nowrap; justify-content: flex-end; gap: 6px;}
html.mob #page-items > table tbody tr td:nth-child(6) .btn, html.mob #page-groups > table tbody tr td:nth-child(3) .btn, html.mob #page-units > table tbody tr td:nth-child(3) .btn, html.mob #page-materials > table tbody tr td:nth-child(6) .btn{margin: 2px 0; flex-shrink: 1;}
html.mob /* hidden raw columns (values ride the line-2 data attributes) */
  #page-items > table tbody tr td:nth-child(3), html.mob #page-items > table tbody tr td:nth-child(5), html.mob #page-materials > table tbody tr td:nth-child(3), html.mob #page-materials > table tbody tr td:nth-child(4){display: none;}
html.mob /* band + empty rows stay full width */
  #page-items > table tbody tr td[colspan], html.mob #page-groups > table tbody tr td[colspan], html.mob #page-units > table tbody tr td[colspan], html.mob #page-materials > table tbody tr td[colspan]{flex: 1 1 100%; order: 0;}
html.mob /* materials: stock with its unit; the low-stock sub-line stays hidden */
  #page-materials > table tbody tr td:nth-child(5)[data-unit]::after{content: ' ' attr(data-unit); font-weight: 400; font-size: 11px;}
html.mob #page-materials > table tbody tr td:nth-child(5) div{display: none;}
html.mob /* units/groups counts keep the muted label style */
  #page-groups > table tbody tr td:nth-child(2)::before, html.mob #page-units > table tbody tr td:nth-child(2)::before{color: var(--muted); font-weight: 400; font-size: 11px;}

@media (max-width: 640px) {


  /* ---- RAW MATERIALS REPORT / STOCK REPORT / SEMI FINISH STOCK: the
     "Opening: …, Purch: …" line reads from the LEFT — td.num's desktop
     right-align made every wrapped tail dangle to the right edge ---- */
  #page-materialsreport #rmr-groups td:nth-child(2),
  #page-stockreport #stk-groups td:nth-child(2),
  #page-semifinishstock #sfs-groups td:nth-child(2) { text-align: left; }

  /* the mobile button labels: View movements → Movements,
     View modifications → View (the cont-194 two-label pattern) */
  #page-materialsreport .blong, #page-stockreport .blong,
  #page-semifinishstock .blong, #page-cans .blong,
  #page-modifiedbills .blong { display: none; }
  #page-materialsreport .bmini, #page-stockreport .bmini,
  #page-semifinishstock .bmini, #page-cans .bmini,
  #page-modifiedbills .bmini { display: inline; }

  /* ---- BULK PRICING card: line 1 = name + grey-italic [unit],
     line 2 = Current: amount · Price set: input · History right.
     The GROUP band keeps its price input + Apply, tinted. ---- */
  #page-bulkpricing > table tbody tr { grid-template-columns: auto minmax(0, 1fr) auto; gap: 3px 8px; }
  #page-bulkpricing td:nth-child(1) { grid-area: 1 / 1 / 2 / 4; font-weight: 600; }
  #page-bulkpricing td:nth-child(1) strong { white-space: normal; }
  #page-bulkpricing > table tbody tr:not(.type-head) td:nth-child(1)[data-unit]::after {
    content: ' [' attr(data-unit) ']'; font-style: italic;
    color: var(--muted); font-weight: 400; font-size: 11px;
  }
  #page-bulkpricing td:nth-child(2) { display: none; }
  #page-bulkpricing td:nth-child(3) { grid-area: 2 / 1 / 3 / 2; justify-self: start; font-size: 12.5px; }
  #page-bulkpricing td:nth-child(3)::before { content: 'Current: '; color: var(--muted); font-weight: 400; font-size: 11px; }
  /* the price field flexes inside its cell — the 'Price set:' label and the
     input share the cell on ONE line and shrink instead of colliding with
     the Current amount or the History button */
  #page-bulkpricing td:nth-child(4) {
    grid-area: 2 / 2 / 3 / 3; display: flex; align-items: center;
    justify-content: flex-end; gap: 4px; white-space: nowrap;
  }
  #page-bulkpricing td:nth-child(4)::before { content: 'Price set: '; color: var(--muted); font-weight: 400; font-size: 11px; }
  #page-bulkpricing td:nth-child(4) input { flex: 1 1 0; min-width: 64px; max-width: 120px; }
  #page-bulkpricing td:nth-child(4) input::placeholder { font-size: 11px; }
  #page-bulkpricing td:nth-child(5) { grid-area: 2 / 3 / 3 / 4; justify-self: end; }
  /* the group band: name line 1 · its input + Apply right on line 2 */
  #page-bulkpricing tr.type-head td:nth-child(1) { grid-area: 1 / 1 / 2 / 4; }
  #page-bulkpricing tr.type-head td:nth-child(2) { display: block; grid-area: 2 / 2 / 3 / 3; justify-self: end; }
  #page-bulkpricing tr.type-head td:nth-child(3) { grid-area: 2 / 3 / 3 / 4; justify-self: end; }

  /* ---- CANS & CARTONS card: line 1 = name | Stock: qtn right, line 2 =
     the full app's buttons (Movements · Adjust · Rename · Ideal · Del).
     The selectors carry the cont-209 block's full chain so this later block
     wins it (a shorter chain loses on specificity). ---- */
  #page-cans #can-list > table tbody tr { grid-template-columns: minmax(0, 1fr) auto; }
  #page-cans #can-list > table tbody tr td:nth-child(1) { grid-area: 1 / 1 / 2 / 2; font-weight: 600; }
  #page-cans #can-list > table tbody tr td:nth-child(4) { grid-area: 1 / 2 / 2 / 3; justify-self: end; text-align: right; font-size: 12.5px; }
  #page-cans #can-list > table tbody tr td:nth-child(4)::before { content: 'Stock: '; color: var(--muted); font-weight: 400; font-size: 11px; }
  #page-cans #can-list > table tbody tr td:nth-child(2),
  #page-cans #can-list > table tbody tr td:nth-child(3),
  #page-cans #can-list > table tbody tr td:nth-child(5) { display: none; }
  #page-cans #can-list > table tbody tr td:nth-child(6) { grid-area: 2 / 1 / 3 / 3; text-align: right; }

  /* ---- DELETED BILLS: no panel card around the list, no "N deleted bills"
     count line; line 3 carries Type and By together ---- */
  #page-deletedbills .panel { background: none; border: 0; padding: 0; margin: 0; }
  #page-deletedbills .filters #dbill-count { display: none; }
  #page-deletedbills table.m-list tbody tr td:nth-child(2) { grid-area: 3 / 1 / 4 / 3; }
  #page-deletedbills table.m-list tbody tr td:nth-child(5) { grid-area: 3 / 3 / 4 / 5; justify-self: start; white-space: nowrap; }

  /* ---- MODIFIED BILLS: same card strip + count removal; line 3 =
     "Type: … Modified: …" (By lives in the popup on phones) ---- */
  #page-modifiedbills .panel { background: none; border: 0; padding: 0; margin: 0; }
  #page-modifiedbills .filters #mdb-count { display: none; }
  #page-modifiedbills table.m-list tbody tr td:nth-child(2) { grid-area: 3 / 1 / 4 / 3; }
  #page-modifiedbills table.m-list tbody tr td:nth-child(4) { grid-area: 3 / 3 / 4 / 5; justify-self: start; white-space: nowrap; }
  #page-modifiedbills table.m-list tbody tr td:nth-child(6) { display: none; }

  /* ---- AUDIT LOG: the details keep their FULL text (cont-185) but wrap as
     words (no more mid-token break-all walls) ---- */
  #page-logs table.m-list tbody tr td:nth-child(5) { word-break: break-word; }
  #page-logs table.m-list .log-details { max-width: none; white-space: normal; overflow: visible; }
}


/* ==== cont-212 html.mob mirrors of the block above ==== */

/* ---- RAW MATERIALS REPORT / STOCK REPORT / SEMI FINISH STOCK: the
     "Opening: …, Purch: …" line reads from the LEFT — td.num's desktop
     right-align made every wrapped tail dangle to the right edge ---- */
html.mob #page-materialsreport #rmr-groups td:nth-child(2), html.mob #page-stockreport #stk-groups td:nth-child(2), html.mob #page-semifinishstock #sfs-groups td:nth-child(2){text-align: left;}
/* the mobile button labels: View movements → Movements,
     View modifications → View (the cont-194 two-label pattern) */
html.mob #page-materialsreport .blong, html.mob #page-stockreport .blong, html.mob #page-semifinishstock .blong, html.mob #page-cans .blong, html.mob #page-modifiedbills .blong{display: none;}
html.mob #page-materialsreport .bmini, html.mob #page-stockreport .bmini, html.mob #page-semifinishstock .bmini, html.mob #page-cans .bmini, html.mob #page-modifiedbills .bmini{display: inline;}
/* ---- BULK PRICING card: line 1 = name + grey-italic [unit],
     line 2 = Current: amount · Price set: input · History right.
     The GROUP band keeps its price input + Apply, tinted. ---- */
html.mob #page-bulkpricing > table tbody tr{grid-template-columns: auto minmax(0, 1fr) auto; gap: 3px 8px;}
html.mob #page-bulkpricing td:nth-child(1){grid-area: 1 / 1 / 2 / 4; font-weight: 600;}
html.mob #page-bulkpricing td:nth-child(1) strong{white-space: normal;}
html.mob #page-bulkpricing > table tbody tr:not(.type-head) td:nth-child(1)[data-unit]::after{content: ' [' attr(data-unit) ']'; font-style: italic;
    color: var(--muted); font-weight: 400; font-size: 11px;}
html.mob #page-bulkpricing td:nth-child(2){display: none;}
html.mob #page-bulkpricing td:nth-child(3){grid-area: 2 / 1 / 3 / 2; justify-self: start; font-size: 12.5px;}
html.mob #page-bulkpricing td:nth-child(3)::before{content: 'Current: '; color: var(--muted); font-weight: 400; font-size: 11px;}
/* the price field flexes inside its cell — the 'Price set:' label and the
     input share the cell on ONE line and shrink instead of colliding with
     the Current amount or the History button */
html.mob #page-bulkpricing td:nth-child(4){grid-area: 2 / 2 / 3 / 3; display: flex; align-items: center;
    justify-content: flex-end; gap: 4px; white-space: nowrap;}
html.mob #page-bulkpricing td:nth-child(4)::before{content: 'Price set: '; color: var(--muted); font-weight: 400; font-size: 11px;}
html.mob #page-bulkpricing td:nth-child(4) input{flex: 1 1 0; min-width: 64px; max-width: 120px;}
html.mob #page-bulkpricing td:nth-child(4) input::placeholder{font-size: 11px;}
html.mob #page-bulkpricing td:nth-child(5){grid-area: 2 / 3 / 3 / 4; justify-self: end;}
/* the group band: name line 1 · its input + Apply right on line 2 */
html.mob #page-bulkpricing tr.type-head td:nth-child(1){grid-area: 1 / 1 / 2 / 4;}
html.mob #page-bulkpricing tr.type-head td:nth-child(2){display: block; grid-area: 2 / 2 / 3 / 3; justify-self: end;}
html.mob #page-bulkpricing tr.type-head td:nth-child(3){grid-area: 2 / 3 / 3 / 4; justify-self: end;}
/* ---- CANS & CARTONS card: line 1 = name | Stock: qtn right, line 2 =
     the full app's buttons (Movements · Adjust · Rename · Ideal · Del).
     The selectors carry the cont-209 block's full chain so this later block
     wins it (a shorter chain loses on specificity). ---- */
html.mob #page-cans #can-list > table tbody tr{grid-template-columns: minmax(0, 1fr) auto;}
html.mob #page-cans #can-list > table tbody tr td:nth-child(1){grid-area: 1 / 1 / 2 / 2; font-weight: 600;}
html.mob #page-cans #can-list > table tbody tr td:nth-child(4){grid-area: 1 / 2 / 2 / 3; justify-self: end; text-align: right; font-size: 12.5px;}
html.mob #page-cans #can-list > table tbody tr td:nth-child(4)::before{content: 'Stock: '; color: var(--muted); font-weight: 400; font-size: 11px;}
html.mob #page-cans #can-list > table tbody tr td:nth-child(2), html.mob #page-cans #can-list > table tbody tr td:nth-child(3), html.mob #page-cans #can-list > table tbody tr td:nth-child(5){display: none;}
html.mob #page-cans #can-list > table tbody tr td:nth-child(6){grid-area: 2 / 1 / 3 / 3; text-align: right;}
/* ---- DELETED BILLS: no panel card around the list, no "N deleted bills"
     count line; line 3 carries Type and By together ---- */
html.mob #page-deletedbills .panel{background: none; border: 0; padding: 0; margin: 0;}
html.mob #page-deletedbills .filters #dbill-count{display: none;}
html.mob #page-deletedbills table.m-list tbody tr td:nth-child(2){grid-area: 3 / 1 / 4 / 3;}
html.mob #page-deletedbills table.m-list tbody tr td:nth-child(5){grid-area: 3 / 3 / 4 / 5; justify-self: start; white-space: nowrap;}
/* ---- MODIFIED BILLS: same card strip + count removal; line 3 =
     "Type: … Modified: …" (By lives in the popup on phones) ---- */
html.mob #page-modifiedbills .panel{background: none; border: 0; padding: 0; margin: 0;}
html.mob #page-modifiedbills .filters #mdb-count{display: none;}
html.mob #page-modifiedbills table.m-list tbody tr td:nth-child(2){grid-area: 3 / 1 / 4 / 3;}
html.mob #page-modifiedbills table.m-list tbody tr td:nth-child(4){grid-area: 3 / 3 / 4 / 5; justify-self: start; white-space: nowrap;}
html.mob #page-modifiedbills table.m-list tbody tr td:nth-child(6){display: none;}
/* ---- AUDIT LOG: the details keep their FULL text (cont-185) but wrap as
     words (no more mid-token break-all walls) ---- */
html.mob #page-logs table.m-list tbody tr td:nth-child(5){word-break: break-word;}
html.mob #page-logs table.m-list .log-details{max-width: none; white-space: normal; overflow: visible;}

/* ==== cont-214: ACCOUNTS mobile card re-map (mirrors in styles.css) ==== */
@media (max-width: 640px) {
  #page-accounts table.m-list tbody tr td:nth-child(4) {
    display: block; grid-area: 1 / 2 / 2 / 3; justify-self: end; white-space: nowrap;
  }
  #page-accounts table.m-list tbody tr td:nth-child(5) {
    display: block; grid-area: 4 / 1 / 5 / 3; text-align: right;
  }
  #page-accounts table.m-list tbody tr td:nth-child(3)::before { content: 'Opening: '; }
  #page-accounts table.m-list tbody tr td:nth-child(3)::after { content: none !important; }
}

/* ==== cont-214 html.mob mirrors of the block above ==== */

html.mob #page-accounts table.m-list tbody tr td:nth-child(4){display: block; grid-area: 1 / 2 / 2 / 3; justify-self: end; white-space: nowrap;}
html.mob #page-accounts table.m-list tbody tr td:nth-child(5){display: block; grid-area: 4 / 1 / 5 / 3; text-align: right;}
html.mob #page-accounts table.m-list tbody tr td:nth-child(3)::before{content: 'Opening: ';}
html.mob #page-accounts table.m-list tbody tr td:nth-child(3)::after{content: none !important;}

/* ==== cont-216: BULK PRICING group bands keep the grey banded look on
   phones (mirrors in styles.css) — the page sat out of the banded-grey
   lists, so the generic card rule (background:none) flattened the band to
   transparent at phone widths; desktop was never affected ==== */
@media (max-width: 640px) {
  #page-bulkpricing tr.type-head td { background: #e4e8ee; border-top: 2px solid var(--line); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: .55rem .6rem .2rem; }
}

html.mob #page-bulkpricing tr.type-head td { background: #e4e8ee; border-top: 2px solid var(--line); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: .55rem .6rem .2rem; }

/* ==== cont-217: phone fine-tuning (mirrors in styles.css) — one line of
   right-aligned row buttons (expenses + accounts), short labels via
   data-short (phones only), search fields on their own full line ==== */
@media (max-width: 640px) {
  /* one line of buttons, right-aligned — the shrink-to-fit cell wrapped
     Delete onto a 2nd line (expenses) and stacked 4 accounts buttons */
  #page-expenses table.m-list tbody tr td:nth-child(8),
  #page-accounts table.m-list tbody tr td:nth-child(7) {
    display: flex; flex-wrap: nowrap; justify-content: flex-end;
    align-items: center; white-space: nowrap; text-align: right;
  }
  #page-expenses table.m-list tbody tr td:nth-child(8) .btn,
  #page-accounts table.m-list tbody tr td:nth-child(7) .btn { margin: 1px 0 1px .3rem; }
  /* short labels on phones (data-short sits on the buttons themselves) */
  .btn[data-short] { font-size: 0; }
  .btn[data-short]::after { content: attr(data-short); font-size: 13.5px; font-weight: 600; }
  .btn.small[data-short]::after { font-size: 12.5px; }
  /* search + the type filter share ONE line (owner request) — the search
     grows to fill, the type field keeps ~40%; the rest of the filters wrap
     below, so nothing overlaps */
  #page-expenses .filters > #exp-search,
  #page-transfers .filters > #tr-search { flex: 1 1 55%; min-width: 0; }
  #page-expenses .filters > #exp-cat,
  #page-transfers .filters > #tr-account-filter { flex: 0 1 40%; }
}

html.mob #page-expenses table.m-list tbody tr td:nth-child(8),
html.mob #page-accounts table.m-list tbody tr td:nth-child(7){display: flex; flex-wrap: nowrap; justify-content: flex-end; align-items: center; white-space: nowrap; text-align: right;}
html.mob #page-expenses table.m-list tbody tr td:nth-child(8) .btn,
html.mob #page-accounts table.m-list tbody tr td:nth-child(7) .btn{margin: 1px 0 1px .3rem;}
html.mob .btn[data-short]{font-size: 0;}
html.mob .btn[data-short]::after{content: attr(data-short); font-size: 13.5px; font-weight: 600;}
html.mob .btn.small[data-short]::after{font-size: 12.5px;}
html.mob #page-expenses .filters > #exp-search,
html.mob #page-transfers .filters > #tr-search{flex: 1 1 55%; min-width: 0;}
html.mob #page-expenses .filters > #exp-cat,
html.mob #page-transfers .filters > #tr-account-filter{flex: 0 1 40%;}

/* ==== cont-220: wrapped pickers (App.makeSearchable) size like every other
   filter field — the desktop .filters .combo rule (flex:0 1 auto) let the
   combo input's intrinsic width overflow its slot onto the next field (the
   supplier/currency overlap on the statement form) ==== */
html.mob .filters .combo{flex: 1 1 150px; min-width: 150px; max-width: 100%;}
html.mob .filters .combo > .combo-input{width: 100%; max-width: 100%; min-width: 0;}

/* ==== cont-221: daybook band rows wrap their full text; accounts card
   actions stay on one merged row ==== */
html.mob #db-result table tbody tr.db-group{grid-template-columns: minmax(0, 1fr);}
html.mob #db-result table tbody tr.db-group td[colspan]{min-width: 0; overflow-wrap: anywhere; line-height: 1.5;}
html.mob #page-accounts table.m-list tbody tr td.actions{display: flex; flex-wrap: nowrap; max-width: none;}
html.mob #page-accounts table.m-list tbody tr td.actions .btn{flex: 1 1 0; min-width: 0; margin: 0 0 0 .3rem; justify-content: center; text-align: center;}

/* ==== cont-223: voucher action buttons one row, bills-style padding ==== */
html.mob #page-payments table.m-list tbody tr td.actions,
html.mob #page-expenses table.m-list tbody tr td.actions,
html.mob #page-discounts table.m-list tbody tr td.actions,
html.mob #page-transfers table.m-list tbody tr td.actions{max-width: none; white-space: nowrap; text-align: right; justify-self: stretch;}
html.mob #page-payments table.m-list tbody tr td.actions .btn,
html.mob #page-expenses table.m-list tbody tr td.actions .btn,
html.mob #page-discounts table.m-list tbody tr td.actions .btn,
html.mob #page-transfers table.m-list tbody tr td.actions .btn{margin: 2px 0 2px .3rem; vertical-align: top;}
