/* Counter screen (POS and quotation builder) and the quotation pages. Loaded after app.css and uses its tokens. */

.counter { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 16px; align-items: start; }
.counter-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; height: calc(100vh - var(--top-h) - 48px); min-height: 560px; }
.ctool { display: flex; gap: 8px; align-items: center; padding: 10px; flex-wrap: nowrap; }
.ctool > * { flex-shrink: 0; }
.ctool > .grow-1 { flex-shrink: 1; min-width: 170px; }
.ctool > .scan-input { flex-shrink: 1; min-width: 150px; }
.ctool .search-input { position: relative; }
.ctool .search-input .input { min-height: 44px; padding-right: 44px; }
.ctool .grow-1 .input { border-color: color-mix(in srgb, var(--accent) 55%, var(--border-strong)); }
.grow-1 { flex: 1 1 260px; min-width: 0; }
.scan-input { flex: 0 1 200px; }
.scan-input .input { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .04em; }
.kbd-hint { display: inline-block; font-size: 10.5px; font-weight: 600; line-height: 17px; padding: 0 6px; border-radius: 5px; border: 1px solid var(--border-strong);
  background: var(--surface-2); color: var(--muted); font-family: ui-monospace, Consolas, monospace; }
.search-input .kbd-hint { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); }
.btn .kbd-hint { margin-left: 2px; }
.btn-primary .kbd-hint { background: rgba(0, 0, 0, .12); border-color: rgba(0, 0, 0, .18); color: var(--accent-ink); }
.n-pill { font-size: 11px; font-weight: 700; padding: 0 7px; border-radius: 99px; background: var(--surface-3); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.layout-seg button { display: inline-flex; align-items: center; gap: 6px; }
.layout-seg button.on { background: var(--surface-3); color: var(--ink); }
.ctool .dropdown summary { list-style: none; }
.ctool .dropdown summary::-webkit-details-marker { display: none; }
.cat-chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; flex: none; }
.cat-chips .chip { flex: none; }
.chip:disabled { opacity: .45; cursor: not-allowed; }
.accent-text { color: var(--accent-text); }
.catalog { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.quick { display: flex; gap: 8px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border); overflow-x: auto; flex: none; scrollbar-width: none; }
.quick .label { flex: none; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-right: 4px; }
.quick form { margin: 0; flex: none; }
.pgrid { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); grid-auto-rows: max-content;
  gap: 10px; padding: 14px; scrollbar-width: thin; align-content: start; }
.pcell { margin: 0; display: flex; }
.pick-more { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 10px 0 8px; font-size: 12.5px; color: var(--muted); }
.pgrid .pick-more { grid-column: 1 / -1; padding: 8px 0 4px; }
.pcard { position: relative; flex: 1; display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 10px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; transition: border-color .12s, transform .06s; }
.pcard:hover { border-color: var(--accent); }
.pcard:active { transform: scale(.985); }
.pcard:disabled { cursor: not-allowed; opacity: .55; }
.pcard:disabled:hover { border-color: var(--border); }
.ptag { position: absolute; top: 8px; right: 8px; z-index: 1; }
.ptag .badge { font-size: 10.5px; padding: 1px 7px; }
.pcard .ph { height: 84px; border-radius: 9px; display: grid; place-items: center; margin-bottom: 8px; overflow: hidden; font-weight: 800; font-size: 22px; letter-spacing: .02em;
  background: color-mix(in srgb, var(--cat) 15%, var(--surface-2)); color: color-mix(in srgb, var(--cat) 80%, var(--ink)); }
.pcard .ph img { width: 100%; height: 100%; object-fit: contain; }
.pinfo { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pcard .nm { font-weight: 600; font-size: 13px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.pcard .st { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pcard .st.low { color: var(--warn-text); }
.pcard .st.out { color: var(--danger-text); }
.pmeta { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 8px; }
.pcard .pr { font-weight: 800; font-size: 14.5px; font-variant-numeric: tabular-nums; }
.unit-tag { font-size: 10.5px; font-weight: 600; color: var(--muted); border: 1px solid var(--border-strong); border-radius: 5px; padding: 0 5px; text-transform: uppercase; }
.pgrid[data-layout="list"] { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 0; }
.pgrid[data-layout="list"] .pcard { flex-direction: row; align-items: center; gap: 12px; border-radius: 0; border-width: 0 0 1px; padding: 9px 14px; }
.pgrid[data-layout="list"] .pcard:hover { background: var(--surface-2); border-color: var(--border); }
.pgrid[data-layout="list"] .pcard .ph { width: 38px; height: 38px; margin: 0; font-size: 12.5px; flex: none; }
.pgrid[data-layout="list"] .pinfo { flex: 1; }
.pgrid[data-layout="list"] .pcard .nm { min-height: 0; -webkit-line-clamp: 1; }
.pgrid[data-layout="list"] .pmeta { margin: 0; padding: 0; flex-direction: row-reverse; gap: 12px; }
.pgrid[data-layout="list"] .ptag { position: static; order: 3; }
.pgrid .pick-none { grid-column: 1 / -1; }

.order { position: sticky; top: calc(var(--top-h) + 16px); display: flex; flex-direction: column; height: calc(100vh - var(--top-h) - 48px); min-height: 560px; overflow: hidden; }
.order-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 14px 16px 10px; }
.order-head h2 { font-size: 17px; margin-top: 2px; }
.order-head form { margin: 0; }
.order-note { display: flex; align-items: center; gap: 6px; margin: 0 16px 10px; font-size: 12px; color: var(--muted); }
.order-cust { display: flex; align-items: center; gap: 10px; margin: 0 12px; padding: 10px 12px; border-radius: 10px; border: 1px dashed var(--border-strong);
  background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.order-cust:hover { border-color: var(--accent); background: var(--surface-2); }
.order-cust.set { border-style: solid; background: var(--surface-2); }
.order-cust .avatar { width: 38px; height: 38px; font-size: 13px; }
.order-cust strong { display: block; font-size: 13.5px; }
.order-cust small { display: block; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.order-cust small.addr { white-space: normal; }
.cust-icon { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border-strong); display: grid; place-items: center; color: var(--muted); flex: none; }
.order-lines { flex: 1; min-height: 0; overflow-y: auto; padding: 2px 16px; margin-top: 10px; border-top: 1px solid var(--border); scrollbar-width: thin; }
.order-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; color: var(--muted); padding: 44px 16px; font-size: 13px; }
.order-empty strong { color: var(--ink); font-size: 14.5px; }
.order-empty .empty-icon { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--border-strong); margin-bottom: 4px; }
.oline { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.oline:last-child { border-bottom: 0; }
.oline .on { font-weight: 600; font-size: 13.5px; line-height: 1.3; }
.oline .os { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.oline .os form { margin: 0; }
.oline select.tier { border: 1px solid var(--border-strong); border-radius: 6px; background: var(--surface-2); color: var(--ink-2); font: inherit; font-size: 12px; padding: 1px 4px; max-width: 170px; }
.warn-text { color: var(--warn-text) !important; }
.oline .ot { font-weight: 750; text-align: right; font-variant-numeric: tabular-nums; }
.oline .oc { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; }
.oline .oc form { margin: 0; }
.oline .push { margin-left: auto; }
.oline .stepper { display: inline-flex; }
.oline .stepper form { display: flex; }
.oline .stepper button { width: 32px; height: 32px; }
.oline .stepper input { width: 64px; height: 32px; }
.order-foot { border-top: 1px solid var(--border); padding: 12px 16px 14px; display: flex; flex-direction: column; gap: 8px; }
.order-row { display: flex; justify-content: space-between; font-size: 13px; font-variant-numeric: tabular-nums; }
.order-disc { display: flex; align-items: center; gap: 8px; padding: 6px 0; border: 0; background: none; color: var(--ink-2); font: inherit; font-size: 13.5px; cursor: pointer; text-align: left; }
.order-disc:hover { color: var(--accent-text); }
.order-disc:disabled { opacity: .5; cursor: not-allowed; color: var(--muted); }
.order-disc .neg { margin-left: auto; color: var(--danger-text); font-weight: 600; font-variant-numeric: tabular-nums; }
.order-disc .kbd-hint { margin-left: 6px; }
.order-total { display: flex; justify-content: space-between; align-items: baseline; padding-top: 8px; border-top: 1px dashed var(--border-strong); }
.order-total span { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.order-total strong { font-size: 27px; font-weight: 800; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.order-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
.order-actions .btn.btn-primary { grid-column: 1 / -1; min-height: 52px; font-size: 15.5px; }
.order-actions .btn { min-height: 48px; padding: 6px 10px; }
.back-to-products { display: none; }

/* Quotations list and view */
.qfilters { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.qfilters label.field { min-width: 150px; }
.qfilters label.field:first-child { min-width: 180px; }
.qfilters > .btn { min-height: 40px; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12.5px; letter-spacing: .01em; }
h1 .mono { font-size: 21px; }
.qtable td, .qtable th { padding-top: 14px; padding-bottom: 14px; }
.dot-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 99px; white-space: nowrap; letter-spacing: 0; }
.dot-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.dot-status.open { background: var(--info-soft); color: var(--info-text); }
.dot-status.accepted, .dot-status.converted { background: var(--ok-soft); color: var(--ok-text); }
.dot-status.expired { background: var(--warn-soft); color: var(--warn-text); }
.dot-status.cancelled { background: var(--surface-3); color: var(--muted); }
h1 .dot-status { font-size: 13px; }
.btn.page-on { border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); }
.strike { text-decoration: line-through; }
details.dropdown[data-float] .menu-pop { min-width: 210px; }
.page-head .actions form { margin: 0; }

@media (max-width: 1280px) {
  .counter { grid-template-columns: minmax(0, 1fr) 350px; }
}
@media (max-width: 1100px) {
  .counter { grid-template-columns: minmax(0, 1fr) 320px; }
  .ctool { flex-wrap: wrap; }
  .order-actions { grid-template-columns: 1fr 1fr; }
  .order-actions .btn-primary { grid-column: 1 / -1; }
  .layout-seg button { padding: 5px 9px; }
}
@media (max-width: 760px) {
  .counter { grid-template-columns: minmax(0, 1fr); }
  .counter-main, .order { height: auto; min-height: 0; position: static; }
  .catalog { overflow: visible; }
  .pgrid { overflow: visible; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .counter[data-view="products"] > .order, .counter[data-view="cart"] > .counter-main { display: none; }
  .counter[data-view="cart"] .phone-bar { display: none; }
  .counter[data-view="products"] .pgrid { padding-bottom: 84px; }
  .counter[data-view="cart"] .back-to-products { display: inline-flex; justify-self: start; order: -1; }
  .order-lines { overflow: visible; }
  .hide-phone { display: none !important; }
  .scan-input { flex: 1 1 100%; }
  .qfilters label.field { min-width: 0; flex: 1 1 45%; }
  .qfilters label.field.grow-1 { flex-basis: 100%; }
}
@media print {
  .page-head .actions, .back-link { display: none !important; }
}
@media (max-width: 639px) {
  .table-cards.qtable td { padding: 2px 0; }
  .table-cards.qtable td.primary { padding-bottom: 6px; }
}

/* Payment */
.due-card { padding: 20px 22px 18px; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 10%, var(--surface)), var(--surface) 60%); }
.due-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.due-amount { font-size: 42px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; margin-top: 4px; font-variant-numeric: tabular-nums; }
.due-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.due-stats span { display: block; font-size: 11.5px; color: var(--muted); }
.due-stats strong { display: block; font-size: 15px; font-variant-numeric: tabular-nums; }
.due-stats .neg { color: var(--danger-text); }
.collect { display: flex; flex-direction: column; gap: 14px; padding-top: 18px; }
.cash-input { font-size: 26px; font-weight: 750; min-height: 58px; }
.quick-cash { display: flex; gap: 8px; flex-wrap: wrap; }
.quick-cash:empty { display: none; }
.ledger { padding: 14px 16px; border-radius: 10px; background: var(--surface-2); }
.menu-btn.po-btn { border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent); color: var(--accent-text); font-weight: 650; margin-top: 4px; }
.menu-btn.po-btn .icon { color: var(--accent-text); }
.menu-btn.po-btn:hover { background: var(--accent-soft); }
.po-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); }
.po-summary span { display: block; font-size: 11.5px; color: var(--muted); }
.po-summary strong { display: block; font-size: 15px; font-variant-numeric: tabular-nums; }
.cust { display: flex; gap: 12px; align-items: center; }
.cust .avatar { width: 44px; height: 44px; }
@media (max-width: 760px) {
  .due-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .due-amount { font-size: 34px; }
}

/* P.O transactions */
.dot-status.unpaid { background: var(--info-soft); color: var(--info-text); }
.dot-status.partial { background: var(--warn-soft); color: var(--warn-text); }
.dot-status.overdue { background: var(--danger-soft); color: var(--danger-text); }
.dot-status.paid { background: var(--ok-soft); color: var(--ok-text); }
.owed { color: var(--danger-text); }

/* Store logo in the brand mark */
.brand-mark.logo { background: #fff; overflow: hidden; border: 1px solid var(--border); }
.brand-mark.logo img { width: 100%; height: 100%; object-fit: contain; }

/* Shift turnover: summary sections side by side under the transactions */
.shift-sum { overflow: hidden; grid-column: 1 / -1; }
.shift-sum .card-head { padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.sum-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1px; background: var(--border); }
.sum-grid .sum-block { background: var(--surface); border: 0; padding: 14px 16px 16px; }
.sum-grid .sum-block + .sum-block { border-top: 0; }
.sum-grid .sum { font-size: 13px; gap: 8px 10px; }
.sum-grid .sum dt { white-space: nowrap; }
.sum-block.result { background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.sum-block.result.SHORT { background: color-mix(in srgb, var(--danger) 9%, var(--surface)); }
.sum-block.result.BALANCED { background: color-mix(in srgb, var(--ok) 9%, var(--surface)); }
.sum-block.result .coh { display: flex; flex-direction: column; margin-bottom: 10px; }
.sum-block.result .coh span { font-size: 12px; color: var(--muted); }
.sum-block.result .coh strong { font-size: 24px; font-weight: 800; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
@media (max-width: 1560px) { .sum-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .sum-grid { grid-template-columns: minmax(0, 1fr); } }
@media print { .sum-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* P.O payment form */
.pay-rows { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.pay-rows:empty { display: none; }
.pay-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr) 150px 170px 38px; gap: 8px; align-items: center; }
.pay-row.onl { grid-template-columns: 150px minmax(0, 1fr) minmax(0, 1fr) 170px 38px; }
.pay-empty { margin: 10px 0 0; }
.pay-total { background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
@media (max-width: 900px) {
  .pay-row, .pay-row.onl { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding-bottom: 10px; border-bottom: 1px dashed var(--border-strong); }
  .pay-row [data-remove-row] { justify-self: end; }
}

/* Home: daily report */
.dash-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.day-nav { display: flex; align-items: center; gap: 8px; margin: 0; }
.day-pick { display: flex; flex-direction: column; gap: 2px; }
.day-pick .input { min-height: 38px; padding: 6px 10px; width: 160px; }
.icon-btn.disabled { opacity: .35; pointer-events: none; }
.dash-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.kpi-card { display: flex; flex-direction: column; gap: 2px; padding: 16px 16px 14px; color: var(--ink); min-width: 0; }
a.kpi-card:hover { text-decoration: none; border-color: var(--border-strong); background: var(--surface-2); }
.kpi-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.kpi-card .kpi-icon { width: 36px; height: 36px; border-radius: 10px; }
.kpi-card .kpi-label { font-size: 12.5px; color: var(--muted); }
.kpi-card .kpi-value { font-size: 22px; font-weight: 800; letter-spacing: -.01em; font-variant-numeric: tabular-nums; line-height: 1.25; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kpi-card .kpi-sub { font-size: 12px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-tag { font-size: 11.5px; font-weight: 700; padding: 1px 8px; border-radius: 99px; background: var(--surface-3); color: var(--muted); letter-spacing: 0; }
.kpi-tag.balanced { background: var(--ok-soft); color: var(--ok-text); }
.kpi-tag.short { background: var(--danger-soft); color: var(--danger-text); }
.kpi-tag.over { background: var(--warn-soft); color: var(--warn-text); }
.dash-row { margin-top: 16px; }
.mixbar { display: flex; gap: 2px; height: 14px; border-radius: 7px; overflow: hidden; margin-bottom: 12px; background: var(--surface-3); }
.mixbar span { display: block; min-width: 3px; }
.mixbar .empty-bar { flex: 1; background: var(--surface-3); }
.rank { list-style: none; margin: 0; padding: 6px 20px 12px; }
.rank li { display: flex; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
.rank li:last-child { border-bottom: 0; }
.rank-n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11.5px; font-weight: 700; background: var(--surface-3); color: var(--ink-2); flex: none; }
.rank .title { display: block; font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank .detail { font-size: 11.5px; color: var(--muted); }
.rank .grow { flex: 1; min-width: 0; }
.rank .meta { font-weight: 700; font-variant-numeric: tabular-nums; }
.rank-bar { display: block; height: 4px; border-radius: 2px; background: var(--surface-3); margin: 4px 0 2px; overflow: hidden; }
.rank-bar i { display: block; height: 100%; background: var(--chart-line); border-radius: 2px; }
.mini-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mini-stats.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mini-stats > * { display: flex; flex-direction: column; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); color: var(--ink); }
.mini-stats a:hover { text-decoration: none; background: var(--surface-3); }
.mini-stats strong { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.mini-stats span { font-size: 11.5px; color: var(--muted); }
.mini-stats .warn strong { color: var(--warn-text); }
.mini-stats .danger strong { color: var(--danger-text); }
.label-row { margin: 14px 0 2px; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.big-figure { display: flex; flex-direction: column; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); }
.big-figure span { font-size: 12px; color: var(--muted); }
.big-figure strong { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.big-figure small { font-size: 12px; color: var(--muted); }
.dash-kpis.k7 { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.neg-text { color: var(--danger-text) !important; }
.ok-text { color: var(--ok-text) !important; }

/* Payment screens (P.O, supplier): form beside the summary, stacked on tablets and phones */
.grid-main.pay-layout { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
@media (max-width: 1024px) { .grid-main.pay-layout { grid-template-columns: minmax(0, 1fr); } }

/* Supplier payment voucher: signature lines */
.receipt .sig-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 30px; font-size: 11px; text-align: center; }
.receipt .sig-line { display: block; min-height: 18px; border-bottom: 1px solid #111; margin-bottom: 3px; font-size: 12px; font-weight: 700; overflow-wrap: anywhere; }

/* Home: receivables & payables (weekly / monthly) */
#money { scroll-margin-top: calc(var(--top-h) + 14px); }
.owe-head { flex-wrap: wrap; gap: 10px; }
.owe-tools { display: flex; align-items: center; gap: 8px; }
.owe-figs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.owe-figs.n1 { grid-template-columns: minmax(0, 1fr); }
.owe-figs small b { font-weight: 700; }
.owe-net.up strong { color: var(--ok-text); }
.owe-net.down strong { color: var(--danger-text); }
.owe-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.owe-cols.one { grid-template-columns: minmax(0, 1fr); }
.owe-col { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px 16px; min-width: 0; }
.owe-col-head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.owe-col-head h3 { margin: 0; font-size: 15px; font-weight: 700; }
.owe-col-head .sub { font-size: 12px; color: var(--muted); }
.owe-col .kpi-icon { width: 36px; height: 36px; border-radius: 10px; }
.sum dt.owe-split { font-size: 12px; padding-left: 12px; margin-top: -4px; }
.owe-list li { align-items: center; gap: 10px; padding: 8px 0; }
.owe-list a.grow { color: inherit; }
.owe-list a.grow:hover { text-decoration: none; }
.owe-list a.grow:hover .title { text-decoration: underline; }
.owe-list .title, .owe-list .detail { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.owe-due { flex: none; display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.owe-list .meta { min-width: 96px; font-variant-numeric: tabular-nums; }
.owe-table td.num, .owe-table th.num { font-variant-numeric: tabular-nums; }
.owe-table tr.is-now td { background: var(--surface-2); font-weight: 600; }
.owe-table tr.is-ahead td:first-child { color: var(--muted); }
.owe-table tfoot th, .owe-table tfoot td { padding: 11px 14px; border-top: 2px solid var(--border-strong); font-weight: 800; font-size: 13.5px; color: var(--ink); text-transform: none; letter-spacing: 0; background: none; }
@media (max-width: 1700px) { .dash-kpis.k7 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 1500px) { .dash-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1024px) {
  .dash-kpis.k7 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-kpis.k7 > :last-child { grid-column: span 2; }
  .owe-figs, .owe-cols { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) { .dash-row.grid-2 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 639px) {
  .owe-table.table-cards td.nil { display: none; }
  .owe-table.table-cards tr { padding: 10px 2px; }
  .owe-table.table-cards td.primary { font-size: 14px; font-weight: 700; }
  .owe-table.table-cards tfoot, .owe-table.table-cards tfoot tr, .owe-table.table-cards tfoot th, .owe-table.table-cards tfoot td { display: block; width: 100%; text-align: left; border: 0; padding: 2px 0; }
  .owe-table.table-cards tfoot tr { border-top: 2px solid var(--border-strong); padding: 10px 2px; }
}
@media (max-width: 560px) {
  .owe-tools { width: 100%; }
  .owe-tools .seg { flex: 1; }
  .owe-tools .seg a { flex: 1; text-align: center; }
  .owe-due .badge { display: none; }
}
@media (max-width: 1024px) { .dash-row.grid-3 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .dash-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi-card .kpi-value { font-size: 18px; }
  .dash-row[style*="grid-template-columns"] { grid-template-columns: minmax(0, 1fr) !important; }
  .day-nav { width: 100%; }
  .day-pick { flex: 1; }
  .day-pick .input { width: 100%; }
}

/* Sales history and statements */
.stype { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; letter-spacing: .05em; padding: 2px 9px; border-radius: 99px; white-space: nowrap; background: var(--surface-3); color: var(--ink-2); }
.stype::before { content: ""; width: 6px; height: 6px; border-radius: 2px; background: currentColor; }
.stype.valid { background: var(--ok-soft); color: var(--ok-text); }
.stype.credit { background: var(--accent-soft); color: var(--accent-text); }
.stype.dp { background: var(--info-soft); color: var(--info-text); }
.stype.return { background: var(--danger-soft); color: var(--danger-text); }
.paid-with { font-size: 12.5px; color: var(--ink-2); max-width: 280px; }
.sales-tiles { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.op.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
@media print {
  .sales-tiles { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
  .sales-tiles .op { padding: 8px 10px; }
}
@media (max-width: 760px) {
  .sales-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .sales-tiles .op { padding: 10px 12px; }
  .sales-tiles .kpi-icon { display: none; }
  .sales-tiles .op-value { font-size: 18px; }
}

/* Corrections of processed sales */
.fix-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 650; padding: 1px 7px; border-radius: 6px; background: var(--warn-soft); color: var(--warn-text); white-space: nowrap; }
td .fix-tag { margin-top: 4px; }
.fix-tag.new { background: var(--ok-soft); color: var(--ok-text); }
.fix-tag.gone { background: var(--danger-soft); color: var(--danger-text); }
.oline.removed .on, .oline.removed .ot { color: var(--muted); text-decoration: line-through; }
.order-cust.locked { cursor: default; }
.order-cust.locked:hover { background: inherit; }
.fix-sum { display: flex; flex-direction: column; gap: 4px; padding-top: 6px; }
.fix-settle { display: flex; align-items: flex-start; gap: 8px; line-height: 1.4; margin-top: 4px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); font-size: 13px; }
.fix-settle.up { background: var(--info-soft); color: var(--info-text); }
.fix-settle.down { background: var(--warn-soft); color: var(--warn-text); }
.fix-problem { display: flex; align-items: flex-start; gap: 8px; line-height: 1.4; padding: 8px 10px; border-radius: 8px; background: var(--danger-soft); color: var(--danger-text); font-size: 13px; }
.fix-log li { padding: 12px 0; }
.fix-log .reason { color: var(--ink); font-style: italic; margin: 2px 0; }

/* Customer orders: status pill and the steps (Pending → Ready → On the way → Delivered → Complete; Cancelled apart) */
.ostatus { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 650; padding: 2px 10px; border-radius: 99px; white-space: nowrap; }
.ostatus::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.ostatus.pending { background: var(--warn-soft); color: var(--warn-text); }
.ostatus.ready { background: var(--info-soft); color: var(--info-text); }
.ostatus.onway { background: color-mix(in srgb, var(--s7) 16%, transparent); color: var(--s7); }
.ostatus.delivered { background: var(--accent-soft); color: var(--accent-text); }
.ostatus.complete { background: var(--ok-soft); color: var(--ok-text); }
.ostatus.cancelled { background: var(--danger-soft); color: var(--danger-text); }
h1 .ostatus { font-size: 13px; vertical-align: middle; }
.osteps { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); list-style: none; margin: 0; padding: 0; counter-reset: s; }
.osteps li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; font-size: 12px; color: var(--muted); }
.osteps li::before { content: ""; position: absolute; top: 13px; left: -50%; right: 50%; height: 2px; background: var(--border-strong); z-index: 0; }
.osteps li:first-child::before { display: none; }
.osteps li.done::before, .osteps li.now::before { background: var(--accent); }
.osteps .dot { position: relative; z-index: 1; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700;
  background: var(--surface); border: 2px solid var(--border-strong); color: var(--muted); }
.osteps li.done .dot { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.osteps li.now .dot { border-color: var(--accent); color: var(--accent-text); box-shadow: 0 0 0 4px var(--accent-soft); }
.osteps li.now .lab { color: var(--ink); font-weight: 650; }
.osteps.cancelled li:not(.cancel) { opacity: .55; }
.osteps li.cancel::before { background: var(--border-strong); }
.osteps li.cancel .dot { border-color: var(--danger); color: var(--danger-text); box-shadow: 0 0 0 4px var(--danger-soft); }
.osteps li.cancel .lab { color: var(--danger-text); }
.order-tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.order-tiles .op { padding: 10px 12px; }
.btn.btn-cancel-order { color: var(--danger-text); }
@media (max-width: 1280px) { .order-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .order-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .order-tiles .kpi-icon { display: none; }
  .order-tiles .op-value { font-size: 18px; }
}
.osteps.compact .dot { width: 18px; height: 18px; font-size: 0; border-width: 2px; }
.osteps.compact li::before { top: 8px; }
.osteps.compact .lab { display: none; }
.fixed-price { font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; }
.order-remarks { padding: 14px 22px; border-bottom: 1px solid var(--border); }
.order-remarks .label { display: block; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.order-remarks p { margin: 0; white-space: normal; }
.needed-late { color: var(--danger-text); font-weight: 650; }

/* Shift turnover as a pop-up (shift.php): actions, the result strip, transactions beside the summary report */
.shift-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.shift-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 16px; }
.shift-kpis .op-label { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.shift-kpis .op-value.neg { color: var(--danger-text); }
.shift-kpis .op.verdict.SHORT { border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); background: color-mix(in srgb, var(--danger) 6%, var(--surface)); }
.shift-kpis .op.verdict.OVER { border-color: color-mix(in srgb, var(--warn) 45%, var(--border)); background: color-mix(in srgb, var(--warn) 6%, var(--surface)); }
.shift-kpis .op.verdict.BALANCED { border-color: color-mix(in srgb, var(--ok) 45%, var(--border)); background: color-mix(in srgb, var(--ok) 6%, var(--surface)); }
.shift-pop { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.shift-pop .shift-sum { grid-column: auto; }
.shift-pop .sum-grid { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 1100px) {
  .shift-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shift-pop { grid-template-columns: minmax(0, 1fr); }
  .shift-pop .sum-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .shift-kpis { gap: 8px; }
  .shift-kpis .op { padding: 10px; gap: 8px; }
  .shift-kpis .op .kpi-icon { display: none; }
  .shift-kpis .op-value { font-size: 17px; }
  .shift-pop .sum-grid { grid-template-columns: minmax(0, 1fr); }
}
@media print {
  /* An open pop-up prints alone, as a page. */
  body:has(dialog.popup-dlg[open]) > :not(dialog.popup-dlg) { display: none !important; }
  dialog.popup-dlg[open] { position: static; display: block; width: auto; max-width: none; height: auto; max-height: none; margin: 0; border: 0; box-shadow: none; overflow: visible; }
  dialog.popup-dlg::backdrop { background: none; }
  .popup-dlg .popup-body { overflow: visible; background: #fff; padding: 0; }
  .popup-dlg .popup-head { padding: 0 0 10px; }
  .popup-dlg .popup-head .icon-btn, .popup-dlg .popup-foot, #popup-flash { display: none !important; }
  .shift-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .shift-pop { grid-template-columns: minmax(0, 1fr) 300px; }
}

/* Text colors for amounts: short / refused (danger), over (warn), balanced (ok) */
.neg { color: var(--danger-text); }
.warn-text { color: var(--warn-text); }
.ok-text { color: var(--ok-text); }

/* Reports › Shift history (shift-history.php, app/shiftreport.php) */
.sh-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.sh-kpis .kpi-sub { font-size: 12px; color: var(--muted); }
.sh-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; align-items: stretch; }
.sh-grid.even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sh-grid .card-head { align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.sh-grid .card-head .legend-inline { margin-left: auto; padding-top: 3px; }
.chart .seg { stroke: var(--surface); stroke-width: 1.5px; }
.chart .donut-num { fill: var(--ink); font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.mix-wrap { display: flex; align-items: center; gap: 22px; }
.chart.mix-ring { flex: 0 0 190px; }
.mix-legend { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; font-size: 13.5px; }
.mix-legend li { display: flex; align-items: center; gap: 10px; }
.mix-legend li i { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.mix-legend li span { flex: 1; min-width: 0; display: flex; flex-direction: column; color: var(--ink-2); }
.mix-legend li small { color: var(--muted); font-size: 12px; }
.mix-legend li strong { font-variant-numeric: tabular-nums; }
.mix-legend .sum-line { border-top: 1px solid var(--border); padding-top: 12px; }
.hbars { display: flex; flex-direction: column; gap: 12px; }
.hbar { display: grid; grid-template-columns: minmax(110px, 30%) minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.hbar-name { display: flex; flex-direction: column; min-width: 0; font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-name small { font-weight: 500; font-size: 12px; color: var(--muted); }
.hbar-track { height: 16px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.hbar-fill { display: flex; gap: 2px; height: 100%; min-width: 2px; border-radius: 4px; overflow: hidden; }
.hbar-fill i { display: block; height: 100%; min-width: 2px; }
.hbar-val { font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; text-align: right; min-width: 70px; }
.sh-table td .sub { white-space: normal; }
.sh-table th, .sh-table td.num { white-space: nowrap; }
.sh-table td.primary { min-width: 0; width: 1%; white-space: nowrap; }
.sh-table tfoot td { border-top: 1px solid var(--border-strong); background: var(--surface-2); }
@media (max-width: 1400px) { .sh-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .sh-grid, .sh-grid.even { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
  .sh-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .mix-wrap { flex-direction: column; align-items: stretch; }
  .chart.mix-ring { flex-basis: auto; width: 190px; align-self: center; }
  .hbar { grid-template-columns: minmax(0, 1fr) auto; }
  .hbar-track { grid-column: 1 / -1; grid-row: 2; }
  .sh-table tfoot td { background: none; }
}
@media print {
  .sh-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .sh-grid { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
  .sh-grid.even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* The cashier's Sales dashboard: this shift's figures and quick buttons over the POS catalog (pos.php) */
.dash-strip { display: flex; align-items: center; gap: 6px 20px; padding: 10px 14px; flex: none; flex-wrap: wrap; }
.ds-shift { display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 0; color: var(--ink); font: inherit; cursor: pointer; text-align: left; }
.ds-shift .kpi-icon { width: 36px; height: 36px; border-radius: 10px; }
.ds-shift strong, .ds-fig strong { display: block; font-size: 15px; font-weight: 750; font-variant-numeric: tabular-nums; }
.ds-shift small, .ds-fig small { display: block; font-size: 11.5px; color: var(--muted); }
.ds-fig { padding-left: 18px; border-left: 1px solid var(--border); }
.ds-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 760px) {
  .dash-strip { gap: 8px 14px; }
  .ds-fig:nth-of-type(3) { display: none; }
  .ds-fig { padding-left: 12px; }
  .ds-actions { margin-left: 0; width: 100%; }
}

/* Inventory › Monthly inventory (inventory.php, app/inventory.php) */
.inv-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.inv-tile { gap: 8px; }
.inv-tile-top { display: flex; align-items: flex-start; gap: 10px; }
.inv-tile-top .grow { min-width: 0; }
.inv-tile .kpi-value { white-space: nowrap; }
.inv-tile .kpi-value small { font-size: 12px; font-weight: 600; color: var(--muted); }
.inv-tile .spark { width: 86px; height: 34px; flex: none; margin-left: auto; overflow: visible; }
.inv-tile-sub { font-size: 12px; color: var(--muted); min-height: 2.4em; }
.inv-vs { display: flex; justify-content: space-between; gap: 6px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); border-top: 1px solid var(--border); padding-top: 8px; }
.inv-vs > span { display: inline-flex; align-items: center; gap: 4px; }
.delta.neutral { background: var(--info-soft); color: var(--info-text); }
.month-step { display: flex; align-items: center; gap: 6px; }
.month-step .input { min-width: 160px; }
.month-step .icon-btn.disabled { opacity: .35; pointer-events: none; }
.inv-table tfoot td { border-top: 1px solid var(--border-strong); background: var(--surface-2); }
.inv-table td .sub { white-space: normal; }
.inv-table th, .inv-table td.num { white-space: nowrap; }
.mix-legend a { color: inherit; }
@media (max-width: 1500px) { .inv-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .inv-kpis { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .inv-table tfoot td { background: none; }
}
@media print { .inv-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Pop-ups with a menu panel on the left (styled like the main sidebar) and the screen on the right: Monthly inventory,
   Payment. Each side scrolls on its own; opened as a page, the menu stays in view while the page scrolls. */
.popup.split > .popup-body { padding: 0; display: flex; flex-direction: column; }
.popup-dlg .popup.split > .popup-body { overflow: hidden; }
.popup.split #popup-flash > .notice { margin: 12px 20px 0; }
.split-pop { display: grid; grid-template-columns: 252px minmax(0, 1fr); flex: 1; min-height: 0; }
.split-side { display: flex; flex-direction: column; gap: 1px; padding: 6px 12px 16px; overflow-y: auto; border-right: 1px solid var(--border); background: var(--bg-side); scrollbar-width: thin; }
.split-side .nav-section { display: flex; align-items: center; justify-content: space-between; }
.split-side button.nav-item { width: 100%; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; }
.split-side .nav-item[disabled], .split-side .nav-item.disabled { opacity: .4; cursor: not-allowed; }
.split-side .nav-item.disabled:hover, .split-side .nav-item[disabled]:hover { background: none; }
.split-side .nav-item.active::before { left: -12px; }
.year-step { display: inline-flex; align-items: center; gap: 4px; letter-spacing: 0; text-transform: none; }
.year-step strong { font-size: 12px; color: var(--ink); min-width: 34px; text-align: center; }
.year-step a, .year-step .off { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; color: var(--ink-2); }
.year-step a:hover { background: var(--surface-2); text-decoration: none; }
.year-step .off { opacity: .3; }
.split-main { min-width: 0; overflow-y: auto; padding: 16px 20px 24px; background: var(--bg); }
.popup-page .split-side { position: sticky; top: var(--top-h); align-self: start; max-height: calc(100vh - var(--top-h)); }
.popup-page .split-main { overflow: visible; }
.inv-filters { margin-bottom: 14px; padding: 0; border: 0; }
.count-in { width: 110px; min-height: 36px; padding: 4px 10px; text-align: right; margin-left: auto; }
.count-table td.num { white-space: nowrap; }
.count-bar { position: sticky; bottom: 0; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 16px; border-top: 1px solid var(--border); background: var(--surface); border-radius: 0 0 var(--radius) var(--radius); }
.count-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) {
  .split-pop { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .split-side { flex-direction: row; overflow-x: auto; overflow-y: hidden; padding: 8px 10px; border-right: 0; border-bottom: 1px solid var(--border); }
  .split-side .nav-item { flex: none; }
  .split-side .nav-item.active::before { display: none; }
  .split-side .nav-section { margin: 0 4px 0 10px; }
  .popup-page .split-side { position: static; max-height: none; }
  .split-main { padding: 14px; }
  .count-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media print {
  .popup.split > .popup-body, .popup-dlg .popup.split > .popup-body { overflow: visible; display: block; }
  .split-pop { display: block; }
  .split-main { overflow: visible; padding: 0; background: #fff; }
  .count-bar { display: none; }
}
/* Inside the pop-up, tiles and charts follow the room next to the menu, not the screen. */
.split-main { container-type: inline-size; }
@container (min-width: 1001px) { .split-main .sh-grid:not(.even) { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); } }
.split-main .chart.mix-ring { flex-basis: 170px; }
.split-main .inv-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.split-main .count-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@container (min-width: 1400px) { .split-main .inv-kpis:not(.count-kpis) { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@container (max-width: 1000px) { .split-main .sh-grid, .split-main .sh-grid.even { grid-template-columns: minmax(0, 1fr); } }
@container (max-width: 820px) { .split-main .inv-kpis, .split-main .count-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (max-width: 520px) { .split-main .inv-kpis { grid-template-columns: minmax(0, 1fr); } }

/* Payment as a pop-up (pay.php): amount due and cash on the left of the screen, customer and non-cash payments on the right */
.split-side .nav-item.primary { background: var(--accent); color: var(--accent-ink); font-weight: 650; margin: 2px 0; }
.split-side .nav-item.primary .icon { color: inherit; }
.split-side .nav-item.primary:hover { background: var(--accent-hover); }
.split-side .nav-item.primary .tag { color: inherit; border-color: rgba(0, 0, 0, .25); }
.pay-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
@container (max-width: 860px) { .split-main .pay-grid { grid-template-columns: minmax(0, 1fr); } }

/* POS cart panel: roomier on wide screens */
@media (min-width: 1700px) { .counter { grid-template-columns: minmax(0, 1fr) 440px; } }
@media (min-width: 2400px) { .counter { grid-template-columns: minmax(0, 1fr) 500px; } }

/* Store profile › Receipt printing: two choice cards with a small picture of the paper */
.print-choice { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.print-opt { display: flex; gap: 14px; align-items: flex-start; padding: 14px; border: 1px solid var(--border-strong); border-radius: 12px; cursor: pointer; background: var(--surface); }
.print-opt:hover { border-color: var(--accent); }
.print-opt:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.print-opt input { margin: 3px 0 0; accent-color: var(--accent); }
.print-opt strong { display: block; font-size: 14px; }
.print-opt small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.print-pic { flex: none; display: flex; flex-direction: column; gap: 3px; padding: 6px 5px; border-radius: 3px; background: #fff; box-shadow: 0 0 0 1px var(--border-strong); }
.print-pic.roll { width: 26px; height: 44px; }
.print-pic.a4 { width: 36px; height: 48px; }
.print-pic i { display: block; height: 3px; border-radius: 2px; background: #c9ccd1; }
.print-pic.a4 i:first-child { height: 6px; background: linear-gradient(90deg, #1f5f7a, #3aa58a); }
.print-pic i:last-child { width: 60%; }
@media (max-width: 760px) { .print-choice { grid-template-columns: minmax(0, 1fr); } }

/* Down payments: Sales › Down payment (downpayment.php), the customer's D.P file (dp-customer.php), Reports › Down
   payment history (dp-history.php), the Less D.P card in the payment (pay.php) */
.dot-status.ok { background: var(--ok-soft); color: var(--ok-text); }
.dot-status.muted { background: var(--surface-3); color: var(--muted); }
.dot-status.danger { background: var(--danger-soft); color: var(--danger-text); }
.dp-side-none { margin: 2px 12px 8px; }
.dp-side-row .nav-label { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.dp-side-row .nav-label small { font-size: 11px; color: var(--muted); font-family: var(--mono, ui-monospace, monospace); }
.dp-side-row .tag.neg { color: var(--danger-text); }
.dp-pick { display: flex; flex-direction: column; max-height: 100%; }
.dp-cust-list { max-height: min(58vh, 560px); border-top: 1px solid var(--border); }
.dp-cust-list .pick-row { grid-template-columns: auto minmax(0, 1fr) auto; gap: 2px 12px; color: inherit; text-decoration: none; }
.dp-cust-list .pick-row:hover { background: var(--surface-2); }
.dp-cust-list .avatar { width: 36px; height: 36px; font-size: 12.5px; }
.dp-cust { padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.dp-grid textarea { resize: vertical; min-height: 70px; }
.dp-preview { padding: 12px 14px; border-radius: 10px; background: var(--surface-2); }
.dp-balance-card { background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, var(--surface)), var(--surface) 65%); }
.dp-balance { font-size: 34px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.dp-done { display: grid; place-items: start center; padding: 10px 0; }
.dp-done-card { width: min(640px, 100%); padding: 30px 30px 22px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.dp-done-icon { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok-text); margin-bottom: 4px; }
.dp-done-icon .icon { width: 28px; height: 28px; }
.dp-done-amount { font-size: 44px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.dp-done-who { color: var(--ink-2); }
.dp-done-figs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; width: 100%; margin: 12px 0 4px; padding: 14px; border-radius: 12px; background: var(--surface-2); }
.dp-done-figs dt { font-size: 11.5px; color: var(--muted); }
.dp-done-figs dd { margin: 2px 0 0; font-size: 16px; font-weight: 650; font-variant-numeric: tabular-nums; }
.dp-done-for { margin: 0; color: var(--ink-2); }
.dp-done-for span { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-right: 4px; }
.dp-done-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 12px; }
.dp-done-more { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; padding-top: 12px; margin-top: 6px; border-top: 1px solid var(--border); width: 100%; }
.dp-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.dp-kpi .kpi-label { display: flex; align-items: center; gap: 7px; }
.dp-kpi .kpi-label i { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.dp-kpi.on-hand { background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 14%, var(--surface)), var(--surface) 70%); border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.dp-kpi.on-hand .kpi-value { color: var(--accent-text); }
.dp-split { display: flex; gap: 2px; height: 10px; border-radius: 5px; overflow: hidden; background: var(--surface-3); }
.dp-split i { display: block; height: 100%; min-width: 3px; }
.dp-split-legend { margin: 8px 0 16px; font-size: 12px; flex-wrap: wrap; }
.dp-table td .sub { white-space: normal; }
.dp-table th, .dp-table td.num { white-space: nowrap; }
.dp-table td.primary, .dp-table td[data-label="Reference"] { white-space: nowrap; }
.dp-table tfoot td { border-top: 1px solid var(--border-strong); background: var(--surface-2); }
.dp-kind { display: inline-block; min-width: 46px; margin-right: 6px; padding: 1px 7px; border-radius: 6px; font-size: 11px; font-weight: 700; text-align: center; background: var(--s1-soft, var(--info-soft)); color: var(--info-text); }
.dp-kind.used { background: var(--ok-soft); color: var(--ok-text); }
.dp-kind.refund { background: var(--warn-soft); color: var(--warn-text); }
.dp-kind.cancelled { background: var(--surface-3); color: var(--muted); }
.dp-meter { display: block; width: 110px; height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; margin-top: 4px; }
.dp-meter i { display: block; height: 100%; background: var(--s2); border-radius: 3px; }
.dp-row-cancelled td, .dp-row-refund td { color: var(--muted); }
.dp-row-cancelled strong { text-decoration: line-through; }
.dp-acts { display: flex; gap: 6px; justify-content: flex-end; }
.dp-slip { margin-bottom: 14px; align-items: center; }
.dp-slip > div { flex: 1; }
.dp-who { display: flex; align-items: center; gap: 10px; }
.dp-who .avatar { width: 34px; height: 34px; font-size: 12px; flex: none; }
.dp-who a { font-weight: 650; color: inherit; }
.dp-pay .kv dd strong { font-size: 15px; }
@container (max-width: 860px) { .dp-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .dp-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .dp-done-card { padding: 22px 16px 18px; }
  .dp-done-amount { font-size: 34px; }
  .dp-done-figs { grid-template-columns: minmax(0, 1fr); text-align: left; }
  .dp-acts { justify-content: flex-start; }
}
@media print { .dp-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } .dp-split { print-color-adjust: exact; -webkit-print-color-adjust: exact; } }

/* Expenses (expenses.php, expense.php, expense-categories.php) */
.ex-cat { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--surface-3); color: var(--ink-2); white-space: nowrap; }
.ex-table td[data-label="Description"] a { color: inherit; font-weight: 600; }
.ex-chips { margin-top: -4px; }
.ex-chips .chip.on { border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); }
.ex-drawer { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: 12px; cursor: pointer; }
.ex-drawer:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.ex-drawer.disabled { opacity: .6; cursor: not-allowed; }
.ex-drawer input { margin: 3px 0 0; accent-color: var(--accent); width: 16px; height: 16px; }
.ex-drawer strong { display: block; font-size: 14px; }
.ex-drawer small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.ex-amount { font-size: 18px; font-weight: 700; }
.ex-add { display: flex; gap: 10px; }
.ex-add .input { flex: 1; }
.ex-suggest { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 12px; }
.ex-suggest form { display: contents; }
.ex-rename { display: flex; gap: 6px; align-items: center; min-width: 220px; }
.ex-rename .input { min-height: 34px; padding-block: 5px; }
.ex-share { display: inline-block; width: 60px; height: 6px; border-radius: 3px; background: var(--surface-3); vertical-align: middle; overflow: hidden; margin-right: 6px; }
.ex-share i { display: block; height: 100%; background: var(--s4); }
.ex-cat-table td { vertical-align: middle; }
@media (max-width: 640px) { .ex-add { flex-direction: column; } .ex-share { display: none; } }

/* Reports › Monthly report (monthly-report.php, app/monthly.php) */
.mr-hero { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; padding: 18px 22px;
  border-radius: 16px; overflow: hidden; color: #fff; background: linear-gradient(100deg, #1f5f7a 0%, #2c7f86 45%, #3aa58a 100%); }
.mr-hero::before { content: ""; position: absolute; left: -40px; top: -60px; width: 150px; height: 220px; transform: rotate(24deg); background: rgba(255, 255, 255, .08); }
.mr-hero::after { content: ""; position: absolute; right: -80px; bottom: -120px; width: 320px; height: 320px; border-radius: 50%; background: rgba(255, 255, 255, .07); }
.mr-hero-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 14px; min-width: 0; }
.mr-hero-brand img, .mr-hero-mark { width: 54px; height: 54px; border-radius: 14px; object-fit: contain; background: rgba(255, 255, 255, .14); flex: none; }
.mr-hero-mark { display: grid; place-items: center; }
.mr-hero-mark .icon { width: 28px; height: 28px; }
.mr-hero h1 { margin: 0; font-size: 26px; font-weight: 750; letter-spacing: -.01em; color: #fff; }
.mr-hero-sub { font-size: 15px; opacity: .9; }
.mr-hero-tools { position: relative; z-index: 1; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mr-hero-tools .btn { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .25); color: #fff; }
.mr-hero-tools .btn:hover { background: rgba(255, 255, 255, .24); }
.mr-step { display: inline-flex; align-items: center; gap: 4px; padding: 3px; border-radius: 12px; background: rgba(0, 0, 0, .14); }
.mr-step .icon-btn { color: #fff; }
.mr-step .icon-btn.off { opacity: .35; }
.mr-step .input { min-width: 170px; background: #fff; color: #1d2a33; border-color: transparent; }
.mr-tiles { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.mr-tile { padding: 14px 14px 12px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.mr-tile-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.mr-tile-top > div { min-width: 0; }
.mr-tile-label { font-size: 12.5px; color: var(--muted); }
.mr-tile-value { font-size: 26px; font-weight: 750; letter-spacing: -.01em; line-height: 1.2; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mr-tile-value.neg { color: var(--danger-text); }
.mr-tile .spark { width: 46%; max-width: 110px; height: 34px; flex: none; overflow: visible; margin-top: 4px; }
.mr-tile-foot { display: grid; grid-template-columns: repeat(3, auto); justify-content: space-between; gap: 6px; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.mr-tile-foot span { display: block; font-size: 10.5px; font-weight: 600; color: var(--muted); letter-spacing: .04em; }
.mr-tile-foot .delta { font-size: 11px; padding: 0 6px; }
.mr-tile-note { font-size: 11.5px; color: var(--muted); }
.mr-strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); margin-bottom: 16px; }
.mr-strip > div { padding: 12px 16px; border-right: 1px solid var(--border); min-width: 0; }
.mr-strip > div:last-child { border-right: 0; }
.mr-strip span { display: block; font-size: 11.5px; color: var(--muted); }
.mr-strip strong { display: block; font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mr-strip small { display: block; font-size: 11.5px; color: var(--muted); }
.mr-strip small.neg { color: var(--danger-text); }
.mr-strip small.ok-text { color: var(--ok-text); }
.mr-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; align-items: start; }
.mr-left { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.mr-left .card-head h2 { font-size: 18px; font-weight: 600; }
.mr-left .card-head h2 span { font-weight: 750; }
.t1 { color: var(--s1); }
.t2 { color: var(--s2); }
.t3 { color: var(--s3); }
.t4 { color: var(--s4); }
.mr-gauges { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 16px 8px 12px; }
.mr-gauge { position: relative; text-align: center; padding: 0 10px; border-right: 1px solid var(--border); }
.mr-gauge:nth-child(4) { border-right: 0; }
.mr-gauge svg { width: 100%; max-width: 150px; height: auto; display: block; margin: 0 auto; }
.mr-gauge .track { fill: none; stroke: var(--surface-3); stroke-width: 14; stroke-linecap: round; }
.mr-gauge .fill { fill: none; stroke-width: 14; stroke-linecap: round; }
.mr-gauge-val { margin-top: -26px; font-size: 22px; font-weight: 750; font-variant-numeric: tabular-nums; }
.mr-gauge-val.neg { color: var(--danger-text); }
.mr-gauge-label { font-size: 13px; font-weight: 650; margin-top: 2px; }
.mr-gauge-sub { font-size: 11.5px; color: var(--muted); }
.mr-chart .area { opacity: .13; }
.mr-chart .line { stroke-width: 2.4; }
.mr-chart.hovering .dot, .mr-chart.hovering .cross { opacity: 0; }
.mr-chart g:hover .dot, .mr-chart g:hover .cross { opacity: 1; }
.mr-chart .grid-line.zero { stroke: var(--border-strong); }
.mr-chart .tick.strong { fill: var(--ink); font-weight: 700; }
.mr-chart .hit.sel { fill: var(--accent-soft); opacity: .5; }
.mr-is { font-size: 13px; }
.mr-is th { white-space: nowrap; }
.mr-is td { padding-top: 7px; padding-bottom: 7px; }
.mr-is td.num { white-space: nowrap; font-variant-numeric: tabular-nums; }
.mr-is .sub { display: block; font-size: 11.5px; color: var(--muted); font-weight: 400; }
.mr-is .mr-grp-head td { font-weight: 700; }
.mr-is .mr-sub td:first-child { padding-left: 38px; color: var(--ink-2); }
.mr-is .mr-sub td { font-size: 12.5px; }
.mr-is .mr-grp:not(.open) .mr-sub { display: none; }
.mr-is .mr-line td:first-child { padding-left: 18px; color: var(--ink-2); }
.mr-is .mr-subtotal td { font-weight: 700; border-top: 1px solid var(--border-strong); background: var(--surface-2); }
.mr-is .mr-total td { font-weight: 800; font-size: 14px; border-top: 2px solid var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.mr-is tfoot .mr-total td { color: var(--accent-text); }
.mr-fold { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; padding: 0; font: inherit; font-weight: 700; color: inherit; cursor: pointer; text-align: left; }
.mr-fold-icon { width: 14px; height: 14px; border: 1.5px solid var(--muted); border-radius: 3px; position: relative; flex: none; }
.mr-fold-icon::before, .mr-fold-icon::after { content: ""; position: absolute; background: var(--muted); left: 2px; right: 2px; top: 5px; height: 1.5px; }
.mr-fold-icon::after { left: 5px; right: auto; width: 1.5px; top: 2px; bottom: 2px; height: auto; }
.mr-fold[aria-expanded="true"] .mr-fold-icon::after { display: none; }
.mr-days-wrap { overflow-x: auto; }
.mr-day-table { font-size: 12.5px; min-width: 1500px; }
.mr-day-table th { white-space: nowrap; vertical-align: bottom; }
.mr-day-table th span { display: block; font-size: 10.5px; font-weight: 500; color: var(--muted); text-transform: none; letter-spacing: 0; }
.mr-day-table .mr-band th { text-align: center; font-size: 10.5px; letter-spacing: .1em; color: var(--muted); border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.mr-day-table td { white-space: nowrap; font-variant-numeric: tabular-nums; vertical-align: top; }
.mr-day-table td .sub { display: block; font-size: 11px; color: var(--muted); }
.mr-day-table tbody tr { cursor: pointer; }
.mr-day-table tbody tr:hover td { background: var(--surface-2); }
.mr-day-table .mr-idle td { color: var(--muted); }
.mr-day-table .mr-today td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.mr-day-table td a { color: inherit; }
.mr-day-table .mr-res { background: color-mix(in srgb, var(--s2) 6%, var(--surface)); }
.mr-day-table th.mr-res { color: var(--ink); }
.mr-sticky-l { position: sticky; left: 0; z-index: 1; background: var(--surface); }
.mr-sticky-r { position: sticky; right: 0; z-index: 1; box-shadow: -6px 0 10px -8px rgba(0, 0, 0, .5); }
td.mr-sticky-r { background: color-mix(in srgb, var(--s2) 9%, var(--surface)); }
.mr-day-table thead .mr-sticky-r, .mr-day-table thead .mr-sticky-l { background: var(--surface); z-index: 2; }
.mr-day-table tfoot td { border-top: 2px solid var(--border-strong); background: var(--surface-2); font-weight: 600; }
.mr-day-table tfoot .mr-sticky-l, .mr-day-table tfoot .mr-sticky-r { background: var(--surface-2); }
.mr-est { font-style: normal; font-size: 10px; padding: 0 4px; border-radius: 4px; background: var(--surface-3); color: var(--muted); }
.mr-flag { display: inline-block; font-size: 10.5px; font-weight: 700; padding: 0 6px; border-radius: 99px; }
.mr-flag.gain { background: var(--ok-soft); color: var(--ok-text); }
.mr-flag.loss { background: var(--danger-soft); color: var(--danger-text); }
.mr-flag.none { background: var(--surface-3); color: var(--muted); }
.mr-foot { margin: 0; padding: 10px 20px 14px; }
@media (max-width: 1700px) { .mr-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 1300px) {
  .mr-grid { grid-template-columns: minmax(0, 1fr); }
  .mr-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mr-strip > div:nth-child(3) { border-right: 0; }
  .mr-strip > div:nth-child(-n+3) { border-bottom: 1px solid var(--border); }
}
@media (max-width: 760px) {
  .mr-hero { padding: 16px; }
  .mr-hero h1 { font-size: 20px; }
  .mr-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .mr-tile-value { font-size: 21px; }
  .mr-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mr-strip > div { border-bottom: 1px solid var(--border); }
  .mr-strip > div:nth-child(2n) { border-right: 0; }
  .mr-gauges { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 16px; }
  .mr-gauge:nth-child(2) { border-right: 0; }
  .mr-step .input { min-width: 0; }
}
@media print {
  .mr-hero { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .mr-tiles { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .mr-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
  .mr-is .mr-grp .mr-sub { display: table-row; }
  .mr-day-table { min-width: 0; font-size: 9.5px; }
  .mr-sticky-l, .mr-sticky-r { position: static; box-shadow: none; }
}

/* Returns & voids (returns.php, return.php, dispose.php) and Stock movements (stock-movements.php) */
.rv-tabs { flex-wrap: wrap; }
.rv-tabs a { display: inline-flex; align-items: center; gap: 6px; }
.rv-tabs .n-pill { font-size: 11px; }
.rv-lead { margin: 0; padding: 10px 20px; border-bottom: 1px solid var(--border); }
.rv-table td .sub { white-space: normal; }
.rv-table td.rv-reason { max-width: 320px; white-space: normal; color: var(--ink-2); }
.rv-table .rv-out td { background: color-mix(in srgb, var(--danger) 4%, var(--surface)); }
.rt-find { display: flex; gap: 10px; }
.rt-find .search-input { flex: 1; }
.rt-sales { max-height: min(56vh, 520px); border: 1px solid var(--border); border-radius: 12px; }
.rt-sales .pick-row { grid-template-columns: auto minmax(0, 1fr) auto; gap: 2px 12px; color: inherit; text-decoration: none; }
.rt-sales .pick-row:hover { background: var(--surface-2); }
.rt-head { display: grid; grid-template-columns: auto minmax(0, 1.4fr) auto auto 1fr; gap: 12px 26px; align-items: center; padding: 12px 16px; border-radius: 12px; background: var(--surface-2); }
.rt-head span { display: block; font-size: 11.5px; color: var(--muted); }
.rt-head strong { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rt-head small { display: block; font-size: 11.5px; color: var(--muted); }
.rt-head-links { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.rt-lines { margin-top: 14px; border: 1px solid var(--border); border-radius: 12px; }
.rt-lines td { vertical-align: middle; }
.rt-lines td .sub { display: block; font-size: 11.5px; color: var(--muted); }
.rt-lines .rt-done td { color: var(--muted); }
.rt-qty { width: 190px; }
.qty-step { display: inline-flex; align-items: center; gap: 4px; }
.qty-step .input { width: 72px; text-align: center; min-height: 36px; padding: 4px 6px; }
.rt-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 18px; margin-top: 16px; }
.rt-label { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 4px 0 8px; }
.rt-choices { display: flex; flex-direction: column; gap: 8px; }
.rt-choices .rt-label:not(:first-child) { margin-top: 10px; }
.rt-opt { display: flex; gap: 12px; align-items: center; padding: 11px 14px; border: 1px solid var(--border-strong); border-radius: 12px; cursor: pointer; }
.rt-opt:hover { border-color: var(--accent); }
.rt-opt:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); box-shadow: inset 0 0 0 1px var(--accent); }
.rt-opt input { accent-color: var(--accent); margin: 0; }
.rt-opt strong { display: block; font-size: 14px; }
.rt-opt small { display: block; font-size: 12px; color: var(--muted); }
.rt-opt-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--info-soft); color: var(--info-text); }
.rt-opt-icon.ok { background: var(--ok-soft); color: var(--ok-text); }
.rt-opt-icon.bad { background: var(--danger-soft); color: var(--danger-text); }
.rt-side { display: flex; flex-direction: column; gap: 12px; }
.rt-side .chips .chip.on, form .chips .chip.on { border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); }
.rt-sum { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); }
.rt-history { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }
.rt-history .list { padding: 0; }
.sm-quick { margin-left: auto; align-self: flex-end; }
.sm-types { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); padding: 0; overflow: hidden; }
.sm-type { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; background: var(--surface); color: inherit; text-decoration: none; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.sm-type:hover { background: var(--surface-2); }
.sm-type.on { background: color-mix(in srgb, var(--accent) 8%, var(--surface)); box-shadow: inset 0 -2px 0 var(--accent); }
.sm-type strong { font-size: 16px; font-variant-numeric: tabular-nums; }
.sm-type small { font-size: 11.5px; color: var(--muted); }
.sm-pill { display: inline-block; align-self: flex-start; padding: 1px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 700; white-space: nowrap; background: var(--surface-3); color: var(--muted); }
.sm-pill.in { background: var(--ok-soft); color: var(--ok-text); }
.sm-pill.out { background: var(--info-soft); color: var(--info-text); }
.sm-pill.bad { background: var(--danger-soft); color: var(--danger-text); }
.sm-pill.adj { background: var(--warn-soft); color: var(--warn-text); }
.sm-table td .sub { white-space: normal; }
.sm-table .sm-note { max-width: 340px; }
.sm-table tbody tr { cursor: pointer; }
.sm-table tbody tr:hover td { background: var(--surface-2); }
.kpi-value.neg { color: var(--danger-text); }
@media (max-width: 900px) {
  .rt-grid { grid-template-columns: minmax(0, 1fr); }
  .rt-head { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rt-head-links { grid-column: 1 / -1; justify-content: flex-start; }
}
@media (max-width: 640px) { .rt-find { flex-direction: column; } .sm-quick { margin-left: 0; } }
.rv-filter { gap: 8px; margin-left: auto; flex-wrap: nowrap; }
.rv-filter select.input { width: 170px; }
.rv-filter input[type="search"].input { width: 250px; }
@media (max-width: 900px) { .rv-filter { flex-wrap: wrap; margin-left: 0; } .rv-filter select.input, .rv-filter input[type="search"].input { width: 100%; } }

/* Sales history: the dashboard on top (app/views/sales-dashboard.php, app/salesdash.php) */
.sd { margin-bottom: 18px; }
.sd-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; margin-bottom: 14px; padding: 18px 22px; border-radius: 16px;
  background: linear-gradient(110deg, color-mix(in srgb, var(--accent) 16%, var(--surface)), var(--surface) 62%); border: 1px solid var(--border); }
.sd-head h2 { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -.01em; }
.sd-head p { margin: 4px 0 0; color: var(--ink-2); font-style: italic; font-size: 13px; }
.sd-periods { display: flex; gap: 6px; flex-wrap: wrap; }
.sd-periods .chip.on { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.sd-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.sd-tile { position: relative; padding: 14px 16px 12px; display: flex; flex-direction: column; gap: 8px; min-width: 0; border-top: 3px solid color-mix(in srgb, var(--accent) 55%, var(--border)); }
.sd-tile-label { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.sd-tile-main { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.sd-tile-value { font-size: 28px; font-weight: 750; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sd-tile-side { text-align: right; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sd-tile-side small { display: block; font-size: 10.5px; font-weight: 500; color: var(--muted); font-style: italic; }
.sd-tile-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); font-style: italic; }
.sd-tile-foot .delta { font-style: normal; font-size: 11px; padding: 0 6px; }
.sd-tile .spark { width: 44%; max-width: 110px; height: 26px; flex: none; overflow: visible; }
.sd-row { display: grid; gap: 14px; margin-bottom: 14px; align-items: stretch; }
.sd-row.wide { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
.sd-row.even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sd-row .card-head { align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.sd-row .card-head .legend-inline, .sd-row .card-head > .btn { margin-left: auto; }
.sd-chart .line-prev { stroke-width: 1.8; }
.sd-chart.hovering .dot, .sd-chart.hovering .dot-prev, .sd-chart.hovering .cross { opacity: 0; }
.sd-chart g:hover .dot, .sd-chart g:hover .dot-prev, .sd-chart g:hover .cross { opacity: 1; }
.sd-none { padding: 4px 20px 18px; margin: 0; }
.sd-rank { list-style: none; margin: 0; padding: 4px 20px 14px; display: flex; flex-direction: column; gap: 10px; }
.sd-rank li { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.sd-rank-n { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: 12px; font-weight: 800; background: var(--surface-3); color: var(--ink-2); }
.sd-rank li:nth-child(-n+3) .sd-rank-n { background: var(--accent-soft); color: var(--accent-text); }
.sd-rank-main { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.sd-rank-main a { font-weight: 650; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sd-rank-main small { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sd-bar { display: block; height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.sd-bar i { display: block; height: 100%; border-radius: 3px; background: var(--s1); }
.sd-bar.c2 i { background: var(--s2); }
.sd-rank-val { font-weight: 750; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.sd-rank-val small { display: block; font-size: 11px; font-weight: 500; color: var(--muted); }
.sd-loss-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.sd-loss-grid > div { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); min-width: 0; }
.sd-loss-grid span { display: block; font-size: 11.5px; color: var(--muted); }
.sd-loss-grid strong { display: block; font-size: 17px; font-variant-numeric: tabular-nums; }
.sd-loss-grid small { display: block; font-size: 11.5px; color: var(--muted); }
.sd-sub-h { margin: 14px 0 8px; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.sd-still { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.sd-still li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 10px; }
.sd-still a { color: var(--ink); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sd-still small { grid-column: 1; font-size: 11.5px; color: var(--muted); }
.sd-still b { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-variant-numeric: tabular-nums; }
@media (max-width: 1500px) { .sd-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .sd-row.wide, .sd-row.even { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
  .sd-head { padding: 14px; }
  .sd-head h2 { font-size: 19px; }
  .sd-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .sd-tile-value { font-size: 22px; }
  .sd-tile-main { flex-direction: column; align-items: flex-start; }
  .sd-tile-side { text-align: left; }
}
@media print { .sd-kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); } .sd-row.wide { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); } .sd-row.even { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Reorders (reorders.php, reorder-new.php, reorder.php) */
.ro-low { padding: 0 14px 10px; }
.ro-cost { border: 0; background: none; padding: 0; font: inherit; font-weight: 700; color: var(--accent-text); cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.ro-cost:hover { text-decoration-style: solid; }
.ro-needs { margin-bottom: 16px; }
.ro-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; padding: 4px 20px 20px; }
.ro-group { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); }
.ro-group-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.ro-group-head strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ro-group-head small { display: block; font-size: 11.5px; color: var(--muted); }
.ro-group ul { list-style: none; margin: 0; padding: 6px 14px 10px; }
.ro-group li { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.ro-group li:last-child { border-bottom: 0; }
.ro-group li .grow { min-width: 0; display: flex; flex-direction: column; }
.ro-group li a { color: var(--ink); font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ro-group li small { font-size: 11.5px; }
.ro-suggest { font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--accent-text); }
.ro-suggest small { font-weight: 500; color: var(--muted); }
.ro-sup-row { grid-template-columns: minmax(0, 1fr) auto auto; }
@media (max-width: 640px) { .ro-groups { grid-template-columns: minmax(0, 1fr); padding: 4px 12px 14px; } }

/* Receive delivery as a pop-up (receive.php) */
.rcv-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
.rcv-head .card-head h2, #recv-lines .card-head h2 { display: flex; align-items: center; gap: 8px; }
.rcv-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.rcv-fields .span-2 { grid-column: 1 / -1; }
.rcv-f .input-group .addon { color: var(--muted); }
.rcv-f select.input { cursor: pointer; }
.rcv-terms { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: -2px; }
.rcv-terms .chip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
.rcv-table td .sub { white-space: normal; overflow-wrap: anywhere; }
.rcv-table th, .rcv-table td.num { white-space: nowrap; }
.rcv-table td.primary { min-width: 180px; overflow-wrap: anywhere; }
.rcv-total { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 14px 20px 18px; border-top: 1px solid var(--border); }
.rcv-total .sum { flex: 1; max-width: 340px; margin: 0; }
.rcv-pick { position: sticky; top: 0; max-height: calc(100vh - 170px); }
.rcv-pick .pick-head .muted { line-height: 1.35; }
.rcv-side-sum { margin: 2px 4px 6px; display: flex; flex-direction: column; gap: 6px; }
.rcv-side-sum > div { display: flex; justify-content: space-between; gap: 8px; padding: 6px 10px; border-radius: 8px; background: var(--surface-2); font-size: 12.5px; }
.rcv-side-sum dt { color: var(--muted); }
.rcv-side-sum dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.rcv-side-sum dd small { display: block; font-size: 11px; color: var(--muted); }
.rcv-ro { margin: 2px 4px; padding: 10px; border-radius: 10px; background: var(--info-soft); display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; }
.rcv-ro a { color: var(--info-text); }
.rcv-ro small { color: var(--ink-2); }
.rcv-ro form { margin-top: 4px; }
.rcv-dlg { width: min(560px, calc(100vw - 24px)); }
.rcv-dlg-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.rcv-dlg-head .thumb { width: 42px; height: 42px; border-radius: 11px; background: var(--accent-soft); color: var(--accent-text); }
.rcv-group { padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; margin-top: 10px; }
.rcv-group-title { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.rcv-group-title span { text-transform: none; letter-spacing: 0; font-weight: 600; font-size: 12px; }
.fields.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@container (max-width: 980px) { .split-main .rcv-grid { grid-template-columns: minmax(0, 1fr); } .rcv-pick { position: static; max-height: 460px; } }
@media (max-width: 640px) { .rcv-fields { grid-template-columns: minmax(0, 1fr); } .fields.three { grid-template-columns: minmax(0, 1fr); } }
/* On a phone the pop-up menu is one scrolling row: buttons as wide as their label, the receive summary left to the
   totals card under the list, the reorder as one short line. */
@media (max-width: 900px) {
  .split-side { align-items: center; }
  .split-side button.nav-item { width: auto; }
  .split-side > form { flex: none; }
  #recv-side { display: none; }
  .split-side .rcv-ro { flex: none; flex-direction: row; align-items: center; gap: 8px; padding: 4px 6px 4px 10px; white-space: nowrap; }
  .split-side .rcv-ro small { display: none; }
  .split-side .rcv-ro form { margin: 0; }
}

/* ---------- Transfers between branches (transfer-new.php, transfers.php, transfer.php, transfer-receive.php) ---------- */
.tr-info { margin: 0 12px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.tr-route { display: flex; align-items: center; gap: 10px; }
.tr-node { flex: 1; min-width: 0; }
.tr-node small { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.tr-node strong { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-node.to strong { color: var(--accent-text); }
.tr-node select.input { min-height: 34px; padding-block: 4px; }
.tr-arrow { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--surface); color: var(--muted); flex: none; }
.tr-reach { margin-top: 6px; font-size: 11.5px; color: var(--muted); }
.tr-reach .icon { vertical-align: -2px; }
.tr-fields { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 8px; margin-top: 10px; }
.tr-fields .field { font-size: 12px; margin: 0; }
.tr-fields .input { min-height: 34px; padding-block: 4px; }
.tr-waiting { margin-bottom: 16px; border-color: var(--warn); }
.tr-waiting h2 .icon { vertical-align: -3px; color: var(--warn-text); }
.tr-wait-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 10px; padding: 4px 20px 18px; }
.tr-wait { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.tr-wait small { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.tr-route-card { display: flex; flex-direction: column; gap: 12px; }
.tr-stop { display: flex; align-items: flex-start; gap: 12px; }
.tr-stop small { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.tr-stop strong { display: block; }
.tr-recv-table .tr-got { width: 96px; min-height: 34px; padding: 4px 8px; text-align: right; }
.tr-recv-table td.num .sub { display: block; }
.tr-recv-sum { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 13px; }
.tr-recv-sum [data-tr-recv-out] { font-weight: 700; }
.code-block { margin: 10px 0; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); font: 13px/1.5 ui-monospace, Consolas, monospace; overflow-x: auto; }
@media (max-width: 640px) { .tr-fields { grid-template-columns: minmax(0, 1fr); } .tr-wait-list { grid-template-columns: minmax(0, 1fr); padding-inline: 14px; } }
/* Long product names (some run to several lines of specs) wrap and are cut short inside their card instead of widening
   the catalog past a phone's screen. */
.pcard, .pgrid[data-layout="list"] .pinfo { min-width: 0; }
.pcard .nm { overflow-wrap: anywhere; }
/* Customers and sales agents get no prices (and customers nothing about stock): those slots stay empty. */
.pcard .pr:empty, .pcard .st:empty { display: none; }

/* Cash & bank (cash.php, cash-account.php, cheques.php, the pop-ups) and the cash flow statement (cash-flow.php) */
.cb-attention li { align-items: center; }
.cb-attention .lead.kpi-icon { width: 30px; height: 30px; border-radius: 9px; }
.cb-attention .detail { display: block; }
.cb-accounts { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; margin-bottom: 16px; }
.cb-acct { display: flex; flex-direction: column; gap: 10px; padding: 16px; min-width: 0; }
.cb-acct.closed { opacity: .65; }
.cb-acct-top { display: flex; gap: 12px; align-items: center; color: var(--ink); min-width: 0; }
.cb-acct-top:hover { text-decoration: none; }
.cb-acct-top:hover strong { text-decoration: underline; }
.cb-acct-top .kpi-icon { flex: none; width: 36px; height: 36px; border-radius: 10px; }
.cb-acct-top .grow { display: flex; flex-direction: column; min-width: 0; }
.cb-acct-top strong { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-acct-top small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-bal { font-size: 24px; font-weight: 800; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.cb-month { display: flex; gap: 10px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.cb-month span:first-child { color: var(--muted); margin-right: auto; }
.cb-uses { gap: 6px; }
.cb-uses .pill { font-size: 11.5px; padding: 2px 8px; }
.cb-count { color: var(--ink-2); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.cb-actions { display: flex; gap: 6px; margin-top: auto; padding-top: 4px; }
.cb-form label.check { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 12px; cursor: pointer; }
.cb-form label.check:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.cb-form label.check input { margin: 3px 0 0; accent-color: var(--accent); width: 16px; height: 16px; flex: none; }
.cb-form label.check strong { display: block; font-size: 13.5px; }
.cb-form label.check small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.cb-form .form-section h3.section-title { margin: 4px 0 12px; font-size: 14px; }
.cb-types { gap: 6px; margin-top: 6px; }
.chip-check { cursor: pointer; }
.chip-check input { position: absolute; opacity: 0; pointer-events: none; }
.chip-check span { display: inline-flex; align-items: center; gap: 4px; padding: 5px 11px; border-radius: 99px; border: 1px solid var(--border-strong); font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.chip-check span small { font-weight: 500; color: var(--muted); }
.chip-check input:checked + span { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); color: var(--ink); }
.chip-check input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.cb-form:has(select[name="kind"] option[value="cash"]:not(:checked)) .cb-cash-only { display: none; }
.cb-kinds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.cb-kind { cursor: pointer; }
.cb-kind input { position: absolute; opacity: 0; pointer-events: none; }
.cb-kind > span { display: block; height: 100%; padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: 11px; font-size: 13px; }
.cb-kind > span strong { font-weight: 650; }
.cb-kind > span small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.cb-kind input:checked + span { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.cb-kind input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.cb-move .cb-to { display: none; }
.cb-move:has(input[name="kind"][value="transfer"]:checked) .cb-to { display: flex; }
.cb-recon { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; margin: 14px 0 0; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.cb-recon dt { color: var(--ink-2); }
.cb-recon dt small { color: var(--muted); margin-left: 4px; }
.cb-recon dd { margin: 0; text-align: right; font-weight: 600; }
.cb-recon .grand { border-top: 1px solid var(--border-strong); padding-top: 8px; font-weight: 800; color: var(--ink); }
.cb-uncleared { margin-top: 12px; font-size: 13px; }
.cb-uncleared summary { cursor: pointer; color: var(--muted); font-weight: 600; }
.cb-step .btn { margin-top: 12px; }
.cb-cheque-kv { margin-bottom: 8px; }
.cf-statement { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.cf-statement td { padding: 8px 20px; border-bottom: 1px solid var(--border); }
.cf-statement td.n { text-align: right; white-space: nowrap; width: 1%; }
.cf-statement td.n.neg { color: var(--danger-text); }
.cf-statement tr.sec td { background: var(--surface-2); font-weight: 700; color: var(--ink); padding-top: 11px; padding-bottom: 11px; }
.cf-statement tr.line td:first-child { padding-left: 34px; color: var(--ink-2); }
.cf-statement tr.line a { color: inherit; }
.cf-statement tr.line a:hover { color: var(--accent-text, var(--accent)); }
.cf-statement tr.zero td { color: var(--muted); }
.cf-statement tr.subtotal td { font-weight: 700; border-bottom: 1px solid var(--border-strong); }
.cf-statement tr.on td { background: color-mix(in srgb, var(--accent) 9%, var(--surface)); }
.cf-io span { white-space: nowrap; }
#expense-form:has(input[name="drawer"]:checked) .ex-paid { display: none; }
.ex-paid small { display: block; margin-top: 4px; font-weight: 400; font-size: 12px; }
.cf-statement tr.grand td { font-weight: 800; font-size: 15px; border-top: 2px solid var(--border-strong); border-bottom: 0; }
.cf-statement tr.quiet td { color: var(--muted); font-size: 12.5px; }
.cf-statement tr.check td { font-size: 12.5px; }
.cf-tie { display: inline-flex; gap: 6px; align-items: center; }
@media (max-width: 760px) {
  .cb-kinds { grid-template-columns: 1fr; }
  .cf-statement td { padding: 8px 12px; }
  .cf-statement tr.line td:first-child { padding-left: 20px; }
}
