/* Shared look of the list pages (Products, Sales, People, Purchases):
   title with icon, view toggle, search + chips toolbar, "load more".
   Round corners stay round under every skin (glass-sharp squares
   everything), like the Settings page. */
.lx .pg-head > .sl-tt { display: flex; align-items: center; gap: 14px; }
.lx .sl-tt h1 { margin: 0; }
.lx .sl-tt p { margin: 2px 0 0; }
.sl-hic { width: 52px; height: 52px; border-radius: 16px; background: #fde7ec; display: grid; place-items: center; font-size: 26px; flex: none; }
.lx.tbl .sl-day-only, .lx:not(.tbl) .sl-tbl-only { display: none !important; }
.pr-view { display: inline-flex; border: 1px solid var(--mc-border, #eadfe1); border-radius: 12px; overflow: hidden; background: var(--mc-surface, #fff); padding: 3px; gap: 2px; }
.pr-view button { border: 0; background: none; width: 38px; height: 34px; font-size: 17px; color: var(--mc-muted, #8a7a7e); cursor: pointer; border-radius: 9px; }
.pr-view button.on { background: var(--mc-accent, #b9707f); color: var(--mc-accent-text, #fff); }
.sl-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.sl-q { flex: 1 1 260px; max-width: 360px; margin: 0; }
.sl-chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.sl-chips button, .sl-chips select { border: 1px solid var(--mc-border, #eadfe1); background: var(--mc-surface, #fff); border-radius: 999px; padding: 0 14px; height: 36px; font-weight: 700; font-size: 13px; color: var(--mc-text, #3a2a2e); cursor: pointer; }
.sl-chips button em { font-style: normal; font-weight: 700; margin-left: 4px; opacity: .75; }
.sl-chips button.on { background: var(--mc-accent, #b9707f); border-color: transparent; color: var(--mc-accent-text, #fff); }
.sl-load, .sl-empty { padding: 30px; text-align: center; color: var(--mc-muted, #8a7a7e); grid-column: 1 / -1; }
.pr-more-row { text-align: center; margin: 16px 0 4px; }
.pr-more-row[hidden] { display: none !important; }
@media (max-width: 600px) { .sl-q { max-width: none; } }

:is(#pr, #sl, #cu, #pu, #stx) :is(.sl-list, .sl-panel, .cu-card, .pr-card, .pu-card, .pg-card) { border-radius: 20px !important; }
:is(#pr, #sl, #cu, #pu, #stx) :is(.pg-btn, .pg-backbtn, .pg-search, .pg-search input, .sl-hic, .sl-dots > button, .sl-menu, .cu-acts a, .pr-acts a, .sl-av, .pr-pic, .cu-stats, .pr-view, .pg-store-pick, select.form-control) { border-radius: 14px !important; }
:is(#pr, #sl, #cu, #pu, #stx) :is(.pr-view button, .sl-menu a) { border-radius: 9px !important; }
:is(#pr, #sl, #cu, #pu, #stx) :is(.sl-chips button, .sl-chips select, .pr-chips button, .pr-chips select, .sl-month, .cu-grp, .pg-badge, .pr-row em, .pu-st) { border-radius: 999px !important; }
#cu .cu-av { border-radius: 50% !important; }

/* ---- Filter sheet (lists.js): search + ⚙️ button on top, the choices in a
   sheet that slides up from the bottom (phones) or drops under the button
   (desktop). The chosen row only changes colour, so text never moves. ---- */
.fs-bar { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.fs-bar .pg-search { flex: 1 1 auto; max-width: 520px; margin: 0; }
.fs-btn { position: relative; flex: none; width: 46px; height: 42px; display: grid; place-items: center; font-size: 17px; cursor: pointer;
    background: var(--mc-surface, #fff); border: 1px solid var(--mc-border, #eadfe1); color: var(--mc-text, #3a2a2e); }
.fs-btn.on { background: var(--mc-accent, #b9707f); border-color: var(--mc-accent, #b9707f); color: #fff; }
.fs-btn i { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; border: 2px solid var(--mc-surface, #fff);
    background: #d0504f; color: #fff; font: 700 10px/14px system-ui, sans-serif; font-style: normal; display: none; }
.fs-btn.on i { display: block; }
.fs-tags { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 10px; }
.fs-tags:empty { display: none; }
.fs-tags button { border: 1px solid var(--mc-border, #eadfe1); background: var(--mc-surface, #fff); color: var(--mc-text, #3a2a2e); padding: 4px 6px 4px 12px; font-size: 12.5px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.fs-tags button b { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: rgba(0,0,0,.06); color: var(--mc-muted, #8a7a7e); font-size: 11px; }
.fs[hidden] { display: none !important; }
.fs { position: fixed; inset: 0; z-index: 2100; }
.fs-dim { position: absolute; inset: 0; background: rgba(40, 20, 25, .35); animation: fs-fade .15s ease-out; }
.fs-panel { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; box-sizing: border-box; max-height: 82vh; max-height: calc(var(--fs-vh, 100dvh) * .82); overflow: hidden; background: var(--mc-surface, #fff); color: var(--mc-text, #3a2a2e);
    border-radius: 26px 26px 0 0; box-shadow: 0 -10px 30px rgba(0, 0, 0, .2); padding: 10px 18px calc(18px + env(safe-area-inset-bottom)); animation: fs-up .2s ease-out; }
.fs-grab { width: 42px; height: 5px; border-radius: 5px; background: var(--mc-border, #e2d6d8); margin: 0 auto 10px; }
.fs-panel > .fs-grab, .fs-panel > .fs-h, .fs-panel > .fs-go { flex-shrink: 0; }
.fs-body { flex: 1 1 auto; min-height: 0; min-width: 0; width: 100%; box-sizing: border-box; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; scrollbar-gutter: auto; }
.fs-body, .fs-body * { scrollbar-width: none; -ms-overflow-style: none; }
.fs-body::-webkit-scrollbar, .fs-body ::-webkit-scrollbar { display: none; width: 0; height: 0; }
.fs-panel > .fs-h, .fs-panel > .fs-go { width: 100%; box-sizing: border-box; }
.fs-body .fs-list.scroll { max-height: none; overflow: visible; }
@media (max-width: 767px) {
    .fs { top: var(--fs-vtop, 0px); bottom: auto; height: 100vh; height: var(--fs-vh, 100dvh); }
}
.fs-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.fs-h b { font-size: 16px; }
.fs-h button { border: 0; background: none; color: var(--mc-accent, #b9707f); font-weight: 700; font-size: 13px; cursor: pointer; padding: 6px 0; }
.fs-sec > h5 { margin: 14px 0 6px; font-size: 12px; font-weight: 700; color: var(--mc-muted, #8a7a7e); }
.fs-list { display: flex; flex-direction: column; }
.fs-list > button { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; text-align: left; padding: 11px 12px; border: 0;
    border-bottom: 1px solid var(--mc-border, #efe4e6); background: none; color: var(--mc-text, #3a2a2e); font-size: 14px; font-weight: 600; cursor: pointer; }
.fs-list > button:last-child { border-bottom-color: transparent; }
.fs-list > button em { font-style: normal; color: var(--mc-muted, #8a7a7e); font-weight: 600; }
.fs-list > button.on { background: rgba(185, 112, 127, .12); color: var(--mc-accent, #b9707f); border-bottom-color: transparent; }
.fs-list > button.on em { color: var(--mc-accent, #b9707f); }
.fs-list > button .fs-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; }
.fs-list.scroll { max-height: 40vh; overflow: auto; }
.fs-seg { display: flex; gap: 4px; padding: 4px; border-radius: var(--mc-radius-sm, 14px); background: var(--mc-surface-2, #f3eff8); overflow-x: auto; scrollbar-width: none; }
.fs-seg::-webkit-scrollbar { display: none; }
.fs-seg > button { flex: 1 0 auto; min-width: 72px; border: 0; border-radius: max(0px, calc(var(--mc-radius-sm, 14px) - 4px)); background: none; padding: 8px 10px; font-size: 12.5px; font-weight: 700; color: var(--mc-muted, #8a7a7e); cursor: pointer; white-space: nowrap; line-height: 1.3; }
.fs-seg > button em { display: block; font-style: normal; font-size: 11px; font-weight: 600; opacity: .85; }
.fs-seg > button.on { background: var(--mc-surface, #fff); color: var(--mc-accent, #8b6dd6); box-shadow: 0 1px 4px color-mix(in srgb, var(--mc-text, #252037) 12%, transparent); }
.fs-month { display: flex; align-items: center; justify-content: space-between; padding: 6px; background: rgba(185, 112, 127, .1); }
.fs-month > button { width: 36px; height: 36px; border: 0; background: var(--mc-surface, #fff); color: var(--mc-text, #3a2a2e); font-size: 18px; cursor: pointer; }
.fs-month > button:disabled { opacity: .35; cursor: default; }
.fs-month label { position: relative; margin: 0; font-weight: 700; font-size: 14px; cursor: pointer; padding: 6px 12px; }
.fs-month input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.fs-range { display: block; width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--mc-border, #eadfe1); border-radius: var(--mc-radius-sm, 14px); background: var(--mc-surface, #fff); color: var(--mc-text, #3a2a2e); font: inherit; font-weight: 600; text-align: left; cursor: pointer; }
.fs-go { display: block; width: 100%; margin-top: 16px; height: 48px; border: 0; background: var(--mc-accent, #b9707f); color: #fff; font-weight: 800; font-size: 15px; cursor: pointer; }
@keyframes fs-up { from { transform: translateY(30px); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes fs-fade { from { opacity: 0; } to { opacity: 1; } }
@media (min-width: 768px) {
    .fs-dim { background: transparent; animation: none; }
    .fs-panel { left: auto; bottom: auto; width: 380px; max-height: calc(100vh - 120px); border-radius: 20px; border: 1px solid var(--mc-border, #eadfe1);
        box-shadow: 0 20px 50px rgba(60, 30, 40, .2); padding-top: 14px; animation: fs-fade .15s ease-out; }
    .fs-grab { display: none; }
}
:is(#pr, #sl, #cu, #pu, #stx) .fs-btn { border-radius: 14px !important; }
.fs :is(.fs-go, .fs-month > button) { border-radius: 14px !important; }
.fs :is(.fs-list > button, .fs-list > a, .sv-picks button, .sv-date) { border-radius: var(--mc-radius-sm, 12px) !important; }
.fs .fs-month { border-radius: var(--mc-radius-sm, 14px) !important; }
.fs-tags button { border-radius: 999px !important; }
.fs .fs-panel { border-radius: 26px 26px 0 0 !important; }
.fs .fs-grab { border-radius: 5px !important; }
@media (min-width: 768px) { .fs .fs-panel { border-radius: 20px !important; } }
.fs .fs-dot, .fs-tags button b { border-radius: 50% !important; }
:is(#pr, #sl, #cu, #pu, #stx) .fs-btn i { border-radius: 99px !important; }

/* Export menu (lists.js EXP) */
.ex { position: relative; display: inline-flex; }
.ex-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; min-width: 170px; padding: 6px; background: var(--mc-surface, #fff); border: 1px solid var(--mc-border, #eadfe1); box-shadow: 0 14px 34px rgba(60, 30, 40, .18); }
.ex-menu[hidden] { display: none !important; }
.ex-menu button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 10px 12px; font-size: 14px; font-weight: 600; color: var(--mc-text, #3a2a2e); cursor: pointer; }
.ex-menu button:hover { background: rgba(185, 112, 127, .1); }
.ex > .ex-btn:disabled { opacity: 1; }
:is(#pr, #sl, #cu, #pu, #stx) .ex-menu { border-radius: 16px !important; }
:is(#pr, #sl, #cu, #pu, #stx) .ex-menu button { border-radius: 10px !important; }
@media (max-width: 767px) { .ex-menu { right: auto; left: 0; } .pg-head .pg-actions .ex { flex: 1; } .pg-head .pg-actions .ex .ex-btn { width: 100%; justify-content: center; } }

/* ---- Older lists in the new look (lx_auto.js): rows like Sales. ---- */
.lxa:not(.tbl) .pg-card table.pg-cards, .lxa:not(.tbl) .pg-card .table-responsive > table, .lxa:not(.tbl) .th-select-all,
.lxa:not(.tbl) .pg-dt-top .dataTables_length, .lxa:not(.tbl) .buttons-colvis { display: none !important; }
.lxa.tbl .lxa-list { display: none; }
.lxa .pg-head .pg-actions { align-items: center; }
.lxa .sl-tt { display: flex; align-items: center; gap: 14px; min-width: 0; }
.lxa .sl-tt > div { min-width: 0; }
.lxa .sl-tt p { margin: 2px 0 0; color: var(--mc-muted, #8a7a7e); font-size: 13px; }
.lxa .sl-tt p.lxa-n:empty { display: none; }
.lxa-list { margin: 2px 0 4px; }
.lxa-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto auto 40px; gap: 14px; align-items: center; padding: 12px 6px; border-bottom: 1px solid var(--mc-border, #f1e8ea); cursor: pointer; position: relative; }
.lxa-row:last-child { border-bottom: 0; }
.lxa-row:hover { background: linear-gradient(90deg, transparent, rgba(185, 112, 127, .07), transparent); }
.lxa-av { width: 40px; height: 40px; display: grid; place-items: center; font-weight: 700; color: #a0606e; }
.lxa-who { min-width: 0; }
.lxa-who b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--mc-text, #3a2a2e); }
.lxa-who b i { font-style: normal; color: var(--mc-muted, #8a7a7e); font-weight: 600; }
.lxa-who small, .lxa-amt small { display: block; color: var(--mc-muted, #8a7a7e); font-size: 12px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lxa-st { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.lxa-st:empty, .lxa-amt:empty { display: none; }
.lxa-st .label, .lxa-st .pg-badge, .lxa-st .badge { font-size: 11.5px; }
.lxa-amt { text-align: right; }
.lxa-amt b { font-size: 15px; white-space: nowrap; }
.lxa-dots { position: relative; grid-column: 5; }
.lxa-dots > button { width: 36px; height: 36px; border: 1px solid var(--mc-border, #eadfe1); background: var(--mc-surface, #fff); font-weight: 700; cursor: pointer; color: var(--mc-text, #3a2a2e); }
.lxa-menu { display: none; position: absolute; right: 0; top: 40px; z-index: 30; background: var(--mc-surface, #fff); border: 1px solid var(--mc-border, #eadfe1); box-shadow: 0 12px 30px rgba(60, 30, 40, .16); padding: 6px; min-width: 200px; }
.lxa-dots.open .lxa-menu { display: block; }
.lxa-menu a { display: block; padding: 9px 12px; color: var(--mc-text, #3a2a2e) !important; font-size: 14px; white-space: nowrap; text-decoration: none !important; }
.lxa-menu a:hover { background: rgba(185, 112, 127, .1); }
.lxa-menu a.lxa-del { color: var(--mc-danger, #c0392b) !important; }
.lxa-empty { text-align: center; color: var(--mc-muted, #8a7a7e); padding: 40px 10px; font-size: 14px; }
.lxa-empty span { display: block; font-size: 30px; margin-bottom: 6px; opacity: .7; }
.lxa :is(.lxa-av, .lxa-dots > button, .lxa-menu, .sl-hic, .pr-view) { border-radius: 14px !important; }
.lxa :is(.lxa-menu a, .pr-view button) { border-radius: 9px !important; }
.lxa .pg-card { border-radius: 20px !important; }
@media (max-width: 600px) {
    .lxa-row { grid-template-columns: 36px minmax(0, 1fr) auto 32px; gap: 10px; padding: 11px 2px; }
    .lxa-st { display: none; }
    .lxa-dots { grid-column: 4; }
    .lxa-av { width: 36px; height: 36px; }
    .lxa-dots > button { width: 32px; height: 32px; }
    .lxa .pg-head { flex-wrap: wrap; }
    .lxa .pg-head .pg-actions { width: 100%; display: flex; gap: 8px; }
    .lxa .pg-head .pg-actions > .pg-btn.pri { flex: 1; justify-content: center; }
    .lxa .sl-hic { width: 44px; height: 44px; font-size: 22px; }
}
.lxa:not(.tbl) .dataTables_info { display: none !important; }
.lxa .pg-actions > .dt-ex, .lxa .pg-actions > .lxa-view { flex: none; }
.lxa .pg-actions .lxa-moved { display: none !important; }
.lxa-bar { margin: 0 0 12px; }
.lxa-bar .pg-search { max-width: none; background: var(--mc-surface, #fff); }
.lxa .fs-btn, .lxa-bar .pg-search, .lxa-bar .pg-search input { border-radius: 14px !important; }
.lxa .pg-tools.lxa-empty-tools { margin: 0; padding: 0; min-height: 0; }
.lxa .pg-tools:has(> .pg-right:empty):not(:has(> :not(.pg-right))) { display: none; }
@media (max-width: 600px) {
    .lxa .pg-head .pg-actions { flex-wrap: nowrap; }
    .lxa .pg-head .pg-actions > .pg-btn.pri { flex: 1 1 auto; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; display: inline-flex; }
}
.lxa:not(.tbl) .pg-card .pg-tools { display: none !important; }
/* Phone: extra header buttons (Import, ...) shrink to their icon so the row stays one line. */
@media (max-width: 600px) {
    .lxa .pg-head .pg-actions > a.pg-btn:not(.pri), .lxa .pg-head .pg-actions > button.pg-btn:not(.pri) { font-size: 0; gap: 0; padding: 0 12px; flex: none; }
    .lxa .pg-head .pg-actions > a.pg-btn:not(.pri) svg, .lxa .pg-head .pg-actions > button.pg-btn:not(.pri) svg { width: 18px; height: 18px; }
}

/* Totals cards + status chips above a list (Sales, Delivery): a card with
   data-s filters the list like the chip of the same status. */
.dl-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 4px 0 14px; }
.dl-stat { background: var(--mc-surface, #fff); border: 1px solid var(--mc-border, #eadfe1); border-radius: 18px; padding: 14px 16px; }
.dl-stat[data-s] { cursor: pointer; }
.dl-stat.on { border-color: var(--mc-accent, #b9707f); box-shadow: 0 0 0 2px var(--mc-accent, #b9707f) inset; }
.dl-stat small { display: block; color: var(--mc-muted, #8a7a7e); font-size: 13px; font-weight: 600; }
.dl-stat b { display: block; font-size: 24px; margin-top: 4px; line-height: 1.2; }
.dl-stat[data-s="packing"] b { color: #c27012; }
.dl-stat[data-s="delivering"] b { color: #1673c9; }
.dl-stat[data-s="delivered"] b { color: #138a5c; }
.dl-chips { margin-bottom: 14px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.dl-chips::-webkit-scrollbar { display: none; }
.dl-chips button { white-space: nowrap; flex: none; }
@media (max-width: 767px) {
    .dl-stats { grid-template-columns: 1fr 1fr; gap: 10px; }
    .dl-stat { padding: 12px 14px; }
    .dl-stat b { font-size: 21px; }
}
.dl-stat[data-s="paid"] b { color: #138a5c; }
.dl-stat[data-s="partial"] b { color: #c27012; }
.dl-stat[data-s="due"] b { color: #c0392b; }
#sl .sl-chips button { border-radius: 999px !important; }

/* ---- Card lists (Suppliers, Customer groups, Gift cards, Users, Stores,
   Printers, Delivery companies, Expense types): a grid of cards with a
   tile, name, small numbers and actions, plus an optional quick-add row.
   Filtered on the page by CL() in lists.js. ---- */
.cl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; align-items: start; }
.cl-grid > .pg-empty { grid-column: 1 / -1; background: var(--mc-surface, #fff); border-radius: 20px; }
.cl-card { min-width: 0; background: var(--mc-surface, #fff); border: 1px solid var(--mc-border, #eadfe1); border-radius: 20px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.cl-card[hidden] { display: none; }
.cl-card.off { opacity: .65; border-style: dashed; }
.cl-card.cur { border: 2px solid var(--mc-accent, #0a84d6); }
.cl-top { display: flex; align-items: center; gap: 12px; }
.cl-tile { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 20px; font-weight: 800; color: #6b4a52; flex: none; overflow: hidden; }
.cl-tile.round { border-radius: 50%; font-size: 16px; }
.cl-nm { flex: 1; min-width: 0; }
.cl-nm b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cl-nm small { display: block; color: var(--mc-muted, #8a7a7e); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cl-badge { font-size: 11.5px; font-weight: 700; border-radius: 999px !important; padding: 3px 9px; white-space: nowrap; flex: none; }
.cl-badge.g { background: #dcf5e8; color: #0f7f55; } .cl-badge.o { background: #fff1dc; color: #b45309; } .cl-badge.r { background: #fde2e1; color: #b42318; }
.cl-badge.b { background: #e0efff; color: #0a6fc2; } .cl-badge.v { background: #efe8fb; color: #6d28d9; } .cl-badge.n { background: rgba(0, 0, 0, .05); color: var(--mc-muted, #64748b); }
.cl-kv { display: flex; gap: 8px; }
.cl-kv span { flex: 1; background: rgba(0, 0, 0, .035); border-radius: 12px; padding: 8px 10px; min-width: 0; }
.cl-kv small { display: block; color: var(--mc-muted, #8a7a7e); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cl-kv b { font-size: 15px; white-space: nowrap; }
.cl-acts { display: flex; gap: 8px; margin-top: auto; }
.cl-acts .pg-btn { justify-content: center; border-radius: 12px !important; white-space: nowrap; }
.cl-acts .pg-btn.pri { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.cl-acts .cl-del { color: var(--mc-danger, #c0392b); }
.cl-add { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: var(--mc-surface, #fff); border: 1px solid var(--mc-border, #eadfe1); border-radius: 18px; padding: 12px; margin: 0 0 14px; }
.cl-add input, .cl-add select { flex: 1 1 160px; min-width: 0; height: 42px; border: 1px solid var(--mc-border, #eadfe1); border-radius: 12px !important; padding: 0 12px; background: var(--mc-surface, #fff); color: var(--mc-text, #3a2a2e); font: inherit; }
.cl-add input.sm { flex: 0 0 110px; }
.cl-add .pg-btn { border-radius: 12px !important; }
.dl-stats.s3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.lx :is(.pg-btn, .pg-backbtn, .pg-search, .sl-hic, .fs-btn) { border-radius: 14px !important; }
.lx .sl-chips button { border-radius: 999px !important; }
@media (max-width: 767px) {
    .cl-grid { grid-template-columns: minmax(0, 1fr); }
    .dl-stats.s3 { gap: 8px; }
    .dl-stats.s3 .dl-stat { padding: 11px 10px; min-width: 0; }
    .dl-stats.s3 .dl-stat small { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .dl-stats.s3 .dl-stat b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .cl-add b { flex: 1 0 100%; }
    .cl-add input.sm { flex: 0 0 90px; }
}

/* ---- Reports (lx_auto.js): period bar, totals cards from the table footer,
   and a clean print (no menus, no filters, just the title, cards and table). ---- */
.lxa-per { display: flex; gap: 4px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; background: var(--mc-surface, #fff); border: 1px solid var(--mc-border, #eadfe1); border-radius: 14px; padding: 4px; margin: 0 0 12px; width: max-content; max-width: 100%; }
.lxa-per::-webkit-scrollbar { display: none; }
.lxa-per button { flex: none; border: 0; background: none; padding: 8px 14px; border-radius: 10px; font-weight: 700; font-size: 13px; color: var(--mc-muted, #64748b); cursor: pointer; white-space: nowrap; }
.lxa-per button.on { background: var(--mc-accent, #0a84d6); color: var(--mc-accent-text, #fff); }
/* The 📅 date button (datepick.js) instead of Today / 7 days / ... chips: in the
   header next to Export (first, like the month bar of Daily sales) on wide
   screens; on phones Export stays on the right and the dates go under it. */
.lxa-per.lxa-dp { background: none; border: 0; padding: 0; margin: 0; overflow: visible; width: 300px; max-width: 100%; order: -1; }
.lxa-per.lxa-dp .dp-btn { flex: 1; width: 100%; min-height: 44px; padding: 4px 14px; border: 1px solid var(--mc-border, #eadfe1); border-radius: 14px; background: var(--mc-surface, #fff); color: var(--mc-text, #0f172a); font-size: 14px; white-space: normal; }
@media (max-width: 767px) {
    /* Phones: the dates and Export side by side on one row. */
    .pg-head .pg-actions:has(.lxa-dp) { display: flex; flex-wrap: nowrap; align-items: stretch; width: 100%; gap: 8px; }
    .pg-head .pg-actions:has(.lxa-dp) .ex { flex: none; }
    .pg-head .pg-actions:has(.lxa-dp) .ex .ex-btn { width: auto; height: 100%; min-height: 44px; }
    .pg-head .pg-actions:has(.lxa-dp) .ex-menu { left: auto; right: 0; }
    .lxa-per.lxa-dp { order: -1; width: auto; flex: 1 1 0; min-width: 0; }
    .lxa-per.lxa-dp .dp-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
.lxa-kpi { margin: 0 0 14px; }
@media (max-width: 600px) { .lxa .pg-actions > .lxa-print { display: none !important; } }
.lxa-kpi .dl-stat b { font-size: 21px; }
@media print {
    .mp-rail, .main-sidebar, .main-header, .main-footer, .pg-actions, .pg-backbtn, .lxa-bar, .lxa-per, .fs-tags, .pg-dt-top, .pg-dt-foot, .dataTables_paginate, #form, .pg-filter, .mp-tabbar { display: none !important; }
    .content-wrapper { margin: 0 !important; padding: 0 !important; }
    .lxa .sl-hic { display: none; }
    .lx.lxa:not(.tbl) .pg-card table.pg-cards { display: table !important; }
    .lxa .lxa-list { display: none !important; }
}

/* ---- List + side panel (Sales, Adjustments): the panel sits on the right
   on wide screens and slides up from the bottom on phones. ---- */
.sl-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.sl-panel { position: sticky; top: 16px; background: var(--mc-surface, #fff); border: 1px solid var(--mc-border, #eadfe1); border-radius: 20px !important; padding: 18px; color: var(--mc-text, #3a2a2e); }
.sl-panel.loading { opacity: .6; }
.sl-pempty { text-align: center; color: var(--mc-muted, #8a7a7e); padding: 40px 10px; font-size: 14px; line-height: 2; }
.sl-x { display: none; }
.sl-ph { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sl-ph b { font-size: 16px; }
.sl-pm { color: var(--mc-muted, #8a7a7e); font-size: 13px; margin: 6px 0 12px; padding-bottom: 12px; border-bottom: 1px dashed var(--mc-border, #eadfe1); }
.sl-items > div, .sl-l, .sl-tot { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; padding: 5px 0; }
.sl-items i { font-style: normal; color: var(--mc-muted, #8a7a7e); }
.sl-items { padding-bottom: 8px; border-bottom: 1px dashed var(--mc-border, #eadfe1); margin-bottom: 6px; max-height: 320px; overflow: auto; }
.sl-l { color: var(--mc-muted, #8a7a7e); font-size: 13px; }
.sl-tot { font-size: 20px; font-weight: 700; padding: 8px 0; }
.sl-note { font-size: 13px; color: var(--mc-muted, #8a7a7e); margin: 8px 0 0; }
.sl-acts { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 8px; margin-top: 14px; }
.sl-acts .pg-btn { justify-content: center; border-radius: 12px !important; }
.sl-sel { background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--mc-accent, #b9707f) 9%, transparent), transparent); }
@media (max-width: 980px) {
    .sl-wrap { grid-template-columns: 1fr; }
    .sl-panel { display: none; position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 1600; max-height: 85vh; max-height: 85dvh; overflow: auto; overscroll-behavior: contain; padding-bottom: calc(18px + env(safe-area-inset-bottom)); border-radius: 22px 22px 0 0 !important; box-shadow: 0 -10px 40px rgba(0, 0, 0, .25); }
    .sl-panel.open { display: block; }
    .sl-x { display: block; position: absolute; right: 12px; top: 10px; border: 0; background: none; font-size: 26px; color: var(--mc-muted, #8a7a7e); }
    .sl-ph { padding-right: 34px; }
}

/* ---- Follow the chosen theme: the pastel tiles, avatars and +/- badges
   take the theme's own colours in dark mode instead of bright pastels. ---- */
html[data-mode="dark"] :is(.aj-ic, .ex-ic, .sv-ic, .ap-av, .po-av, .po-tile, .cl-tile:not([style*="color:#fff"]), .pc-tile, .un-code-t, .sl-av, .lxa-av, .sl-hic, .ob-ref, .dl-row .sl-av) {
    background: color-mix(in srgb, var(--mc-accent, #8b5cf6) 22%, var(--mc-surface, #1b1b25)) !important; color: var(--mc-text, #f1f1f5) !important;
}
html[data-mode="dark"] :is(.aj-u .up, .cl-badge.g, .ap-dd.later, .dl-st.delivered) { background: rgba(34, 197, 94, .16) !important; color: #4ade80 !important; }
html[data-mode="dark"] :is(.aj-u .dn, .cl-badge.r, .ap-dd.late) { background: rgba(239, 68, 68, .16) !important; color: #f87171 !important; }
html[data-mode="dark"] :is(.cl-badge.o, .ap-dd.today, .dl-st.packing) { background: rgba(245, 158, 11, .16) !important; color: #fbbf24 !important; }
html[data-mode="dark"] :is(.cl-badge.b, .dl-st.delivering, .ap-dd.week) { background: rgba(59, 130, 246, .18) !important; color: #93c5fd !important; }
html[data-mode="dark"] :is(.cl-badge.v, .po-slot, .pc-sub) { background: rgba(139, 92, 246, .2) !important; color: #c4b5fd !important; }
html[data-mode="dark"] :is(.cl-kv span, .pc-nums span) { background: rgba(255, 255, 255, .05); }

/* ---- Follow the chosen shape (🎨 > Shape): the round corners above are
   the default; square-ish shapes square the new list pages as well. ---- */
html:is([data-shape="sharp"], [data-shape="cut"], [data-shape="flat"]):not(#ui-x) :is(.dl-stat, .dl-list, .sl-list, .sl-panel, .cl-card, .cl-add, .pc-card, .po-list, .un-card, .un-add, .ob-card, .gc-face, .lxa-per, .fs .fs-panel, .lx .sl-hic, .lx .pg-backbtn, .lx .pg-search, .lx .pg-btn, .lx .fs-btn, .fs .fs-go, .fs .fs-month, .fs .fs-seg, .fs .fs-month > button, .fs .fs-list > button, .fs .fs-list > a, .fs .fs-seg > button, .sl-menu, .sl-menu a, .sl-dots > button, .cl-tile, .pc-tile, .po-tile, .po-av, .aj-ic, .ex-ic, .sv-ic, .ap-av, .sl-av, .lxa-av, .un-code-t, .ob-ref) {
    border-radius: var(--mc-radius-sm, 4px) !important;
}
html:is([data-shape="sharp"], [data-shape="cut"], [data-shape="flat"]):not(#ui-x) :is(.lx .sl-chips button, .fs-tags button, .cl-badge, .ap-dd, .dl-st, .aj-u span, .po-plus, .pc-sub, .lxa-per button) { border-radius: var(--mc-radius-sm, 4px) !important; }

/* Dashboard top: list-page header + alert cards */
.bq-dash-top .pg-head { margin-bottom: 14px; }
.dl-stats.da { grid-template-columns: repeat(auto-fill, minmax(200px, 240px)); }
a.dl-stat { color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
a.dl-stat:hover { border-color: var(--mc-accent, #b9707f); box-shadow: 0 0 0 1px var(--mc-accent, #b9707f) inset; }
@media (max-width: 767px) { .dl-stats.da { grid-template-columns: 1fr 1fr; } }

/* Report filter form inside the options sheet (lx_auto sheet()) */
.lxa-fs .lxa-fs-body .row { margin: 0; }
.lxa-fs .lxa-fs-body .row > [class*="col-"] { width: 100%; float: none; padding: 0; }
.lxa-fs .lxa-fs-body .form-group { margin: 12px 0 0; }
.lxa-fs .lxa-fs-body label { font-size: 12px; font-weight: 700; color: var(--mc-muted, #8a7a7e); margin-bottom: 6px; }
.lxa-fs .lxa-fs-sub, .lxa-fs .lxa-fs-body button[type=submit] { display: none !important; }
.lxa-fs .lxa-fs-body .form-control, .lxa-fs .select2-container .select2-selection { border-radius: 12px !important; }
.select2-container--open { z-index: 2200 !important; }
.lxa-fs .bootstrap-datetimepicker-widget { z-index: 2200 !important; }
/* Keep asynchronous list chrome in its first-paint geometry. */
.lxa:not(.tbl) .pg-dt-top, .lxa:not(.tbl) .pg-dt-foot { display:none !important; }
.lxa:not(.tbl) > .pg-card { min-height: max(420px, calc(100dvh - 200px)); }
#sl .sl-list { min-height:420px; }
#sl .sl-chips em { display:inline-block; min-width:3ch; text-align:center; }
@media(max-width:767px) { #sl .sl-tt > div { width:100%; } }#sl #sl-n { display:inline-block; min-width:3ch; }
#sl #sl-refund-count { display:inline-block; min-width:150px; }/* Match the mobile footer space before the legacy shell measures it. */
@media(max-width:767px) { body.skin-bq .content-wrapper:has(.pg) { min-height:calc(100dvh - 113px); } }@media(min-width:768px) { body.skin-bq .content-wrapper:has(.pg) { min-height:calc(100dvh - 35px); } }
/* Legacy Bootstrap rows must not collapse margins when AJAX rows arrive. */
.rp-legacy-range-root.lxa > .pg-card > .row { display:flow-root; margin:0; }
.rp-legacy-range-root.lxa > .pg-card > .row > :is(.col-sm-12,.col-xs-12) { float:none; width:100%; padding:0; }
.rp-legacy-range-root.lxa .table-responsive { min-height:calc(100dvh - 200px); }
.rp-legacy-range-root.lxa .table-responsive table { margin-top:0 !important; }
.rp-legacy-range-root.lxa .pg-dt-top { min-height:32px; }
#pr .pr-grid, #sl .sl-list { min-height:calc(100dvh - 200px); }.lxa.tbl > .pg-card > .pg-tools { display:flex !important; min-height:32px; margin:0; padding:0; }
.rp-legacy-range-root.lxa.tbl table.pg-cards:not(.sp-data-ready) { visibility:hidden; }.rp-legacy-range-root.lxa.tbl .dataTables_wrapper:not(:has(.sp-data-ready)) .pg-dt-foot { visibility:hidden; }
@media(min-width:768px) { .rp-range-actions .rp-cur { width:220px; min-width:220px; } }
#aj #aj-n { display:inline-block; min-width:3ch; }
/* Page-size controls have one geometry before and after Select2 enhancement. */
html:not(#ui-x) body .pg .dataTables_length select:not(.select2-hidden-accessible) {
    width:75px; height:32px !important; min-height:32px !important; margin:0;
}
html:not(#ui-x) body .pg .dataTables_length .select2-container {
    --shared-select-height:32px !important; width:75px !important;
    height:32px !important; margin:0 !important;
}
html:not(#ui-x) body .pg .dataTables_length .select2-selection--single {
    height:32px !important; min-height:32px !important;
}
html:not(#ui-x) body .pg .dataTables_length .select2-selection__rendered { font-size:13px !important; line-height:30px !important; }
html:not(#ui-x) body .pg .dataTables_length .select2-selection__arrow { height:30px !important; }
html:not(#ui-x) body .pg select.select2-hidden-accessible {
    width:1px !important; height:1px !important; min-height:0 !important;
}

/* Sales pages keep the selected row limit rather than appending forever. */
#sl-more { display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; text-align:left; }
#sl-page-info { color:var(--mc-muted,#777); font-size:13px; font-variant-numeric:tabular-nums; }

#sl-page-nav { display:flex; gap:4px; margin-left:auto; }
#sl-page-nav button { min-width:30px; height:30px; padding:0 8px; border:1px solid var(--mc-border,#ddd); border-radius:8px; background:var(--mc-surface,#fff); color:var(--mc-text,#252037); }
#sl-page-nav button[aria-current=page] { background:var(--mc-accent,#7c5cf0); color:var(--mc-accent-text,#fff); border-color:var(--mc-accent,#7c5cf0); }
#sl-page-nav button:disabled { opacity:.45; cursor:default; }
#sl-page-nav button:not(:disabled):not([aria-current]):hover { background:var(--mc-accent-soft,#eee9fc); }
#sl-page-nav button:focus-visible { outline:2px solid var(--mc-accent,#7c5cf0); outline-offset:2px; }
