/* Customer Orders (orders app): the list cards, the item table (list + order summary) and the form's item rows. */

.oc-card { overflow: hidden; }
.oc-head { display: flex; align-items: center; gap: .9rem; width: 100%; padding: 1rem 1.1rem; background: none; border: 0; text-align: left; color: inherit; }
.oc-av { flex: 0 0 auto; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 1.05rem; }
.oc-tone-0 { background: #e8f0ff; color: #1d4ed8; }
.oc-tone-1 { background: #e6f6ec; color: #15803d; }
.oc-tone-2 { background: #fff1de; color: #c2610c; }
.oc-tone-3 { background: #f3e8ff; color: #7e22ce; }
.oc-tone-4 { background: #e0f4f8; color: #0e7490; }
.oc-who { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
.oc-name { font-weight: 700; font-size: 1.08rem; overflow-wrap: anywhere; }
.oc-done { align-self: flex-start; margin-top: .15rem; }
.oc-meta { color: var(--pb-muted); font-size: .88rem; overflow-wrap: anywhere; }
.oc-meta .bi { margin-right: .25rem; }
.oc-sum { flex: 0 0 auto; text-align: right; flex-direction: column; align-items: flex-end; }
.oc-sum b { color: var(--pb-primary); font-size: 1.1rem; }
.oc-chev { flex: 0 0 auto; color: var(--pb-muted); transition: transform .2s; }
.oc-head:not(.collapsed) .oc-chev { transform: rotate(180deg); }
.oc-body { padding: 0 1.1rem 1.1rem; }

/* item table: Item | Qty | Price | Total (the same order everywhere) */
.oc-table { border: 1px solid var(--pb-border); border-radius: 12px; overflow: hidden; }
.oc-tr { display: grid; grid-template-columns: minmax(0, 1fr) 3rem 6.5rem 7rem; gap: .5rem; padding: .7rem .9rem; border-top: 1px solid var(--pb-border); align-items: center; }
.oc-tr > span:nth-child(n+2) { text-align: right; white-space: nowrap; }
.oc-tr > span:nth-child(2) { text-align: center; }
.oc-th { background: var(--pb-bg); border-top: 0; font-size: .85rem; font-weight: 600; color: var(--pb-muted); }
.oc-item { overflow-wrap: anywhere; }
.oc-total { background: var(--pb-primary-soft); border-radius: 12px; padding: .7rem 1rem; display: flex; align-items: center; gap: 1.2rem; }
.oc-total span { color: var(--pb-text); font-size: .92rem; }
.oc-total b { color: var(--pb-primary); font-size: 1.35rem; }

/* form */
#orderForm select[name=currency] { width: auto; min-width: 5.5rem; }

@media (max-width: 575.98px) {
  .oc-head { padding: .9rem; gap: .7rem; }
  .oc-av { width: 42px; height: 42px; font-size: .95rem; }
  .oc-body { padding: 0 .9rem .9rem; }
  .oc-tr { grid-template-columns: minmax(0, 1fr) 2rem 4.6rem 5.2rem; gap: .35rem; padding: .6rem .65rem; font-size: .9rem; }
  .oc-total b { font-size: 1.15rem; }
}
/* printing / saving as PDF (the order summary): just the summary, on white, with thin borders — no menu, footer or buttons */
@media print {
  @page { size: A4; margin: 12mm 12mm; }
  .demo-bar, .pb-nav, .nav-sheet, .pb-footer, .toast-wrap, .oc-keypad { display: none !important; }
  html, body, .pb-main { background: #fff !important; padding: 0 !important; margin: 0 !important; }
  .container { max-width: none !important; padding: 0 !important; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  html { font-size: 12.5px; }  /* compact on paper: a long order still fits one page */
  .pb-card { box-shadow: none !important; border: 1px solid #dde3ec !important; }
  .card-pad { padding: 5mm 6mm !important; }
  .oc-summary { margin-bottom: 4mm !important; break-inside: auto; }  /* a long order may go on to the next page… */
  .oc-summary > .mb-4 { margin-bottom: 4mm !important; }
  .oc-tr { padding: .28rem .8rem; }                                   /* …but never in the middle of an item */
  .oc-total { padding: .45rem .9rem; break-inside: avoid; }
  .oc-total b { font-size: 1.2rem; }
  .oc-pays { break-inside: avoid; margin-bottom: 3mm !important; }    /* "How to pay" stays in one piece */
  .oc-pays .col-md-6 { flex: 0 0 auto; width: 50%; }                 /* two accounts per row, like the website */
  .oc-pays .mb-3 { margin-bottom: 2.5mm !important; }
  .oc-pay { padding: 2.5mm 4mm; }
  .oc-pay-bank { margin-bottom: 1mm; }
  .oc-pay-row { padding: 1mm 0; }
  .oc-pay-num { font-size: 1.05rem; }
  .oc-print-note { font-size: .8rem; margin: 0; break-inside: avoid; }
  .oc-powered { margin-top: 4mm; padding-top: 2.5mm; border-top: 1px solid #dde3ec; text-align: center; font-size: .8rem; color: var(--pb-muted); break-inside: avoid; }
  .oc-print-right { text-align: right !important; }
  .oc-tr { break-inside: avoid; }
  .oc-pay { break-inside: avoid; }
}


/* the order bar: looks like one input — the customer is a chip inside it, then Item | Qty | Price | ✓ inline */
.oc-bar { position: relative; }
.oc-input { display: flex; align-items: center; gap: .35rem; min-height: 52px; min-width: 0; padding: .3rem .35rem .3rem .85rem; background: #fff;
  border: 1px solid var(--bs-border-color); border-radius: 14px; transition: border-color .15s, box-shadow .15s; }
.oc-input:focus-within { border-color: #86b0f7; box-shadow: 0 0 0 .2rem rgba(37, 99, 235, .15); }
.oc-input .oc-search-ico { position: static; transform: none; color: var(--pb-muted); flex: 0 0 auto; }
.oc-in { border: 0; outline: 0; background: transparent; font-size: 1rem; line-height: 1.5; padding: .45rem .4rem; min-width: 0; color: var(--pb-text); border-radius: 8px; }
.oc-in::-webkit-search-cancel-button { display: none; }
.oc-namebox { position: relative; flex: 1 1 auto; min-width: 0; display: flex; }
.oc-namebox .oc-in { position: relative; z-index: 1; width: 100%; }
.oc-ghost { position: absolute; inset: 0; padding: .45rem .4rem; font-size: 1rem; line-height: 1.5; white-space: pre; overflow: hidden; color: transparent; pointer-events: none; }
.oc-ghost b { color: #9aa6b8; font-weight: 400; }
.oc-chip { display: inline-flex; align-items: center; gap: .3rem; flex: 0 1 auto; min-width: 0; max-width: 45%; background: var(--pb-primary); color: #fff;
  border-radius: 999px; padding: .3rem .3rem .3rem .8rem; font-weight: 600; }
.oc-pill-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oc-pill-tag { font-size: .75rem; font-weight: 500; opacity: .85; white-space: nowrap; }
.oc-pill-tag.is-new { background: rgba(255, 255, 255, .22); border-radius: 999px; padding: 0 .4rem; opacity: 1; }
.oc-pill-new { flex: 0 0 auto; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .22); color: #fff; font-size: .75rem; font-weight: 600;
  padding: .05rem .45rem; white-space: nowrap; display: inline-flex; align-items: center; }
.oc-pill-new.d-none { display: none; }
.oc-chip-x { flex: 0 0 auto; width: 22px; height: 22px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .28); color: #fff; display: grid; place-items: center; padding: 0; font-size: 1rem; }
.oc-fields { display: flex; align-items: center; gap: .15rem; flex: 1 1 auto; min-width: 0; }
.oc-fields.d-none { display: none; }
.oc-f-item { flex: 1 1 auto; width: 3rem; }
.oc-f-qty { flex: 0 0 3.4rem; width: 3.4rem; text-align: center; border-left: 1px solid var(--pb-border); border-radius: 0; }
.oc-f-price { flex: 0 0 5.2rem; width: 5.2rem; text-align: center; border-left: 1px solid var(--pb-border); border-radius: 0; }
.oc-fields .oc-in:focus { background: var(--pb-primary-soft); border-radius: 8px; border-left-color: transparent; }
.oc-fields input[readonly] { caret-color: transparent; }
.oc-f-add { flex: 0 0 auto; width: 42px; height: 42px; border: 0; border-radius: 10px; background: var(--pb-primary); color: #fff; font-size: 1.2rem; display: grid; place-items: center; }
@media (max-width: 575.98px) {
  .oc-input { padding-left: .6rem; gap: .25rem; }
  .oc-chip { flex-shrink: 0; max-width: 40%; padding-left: .6rem; }
  .oc-pill-tag:not(.is-new) { display: none; }
  .oc-pill-new { width: 22px; height: 22px; padding: 0; justify-content: center; font-size: 0; }  /* a phone: just the + */
  .oc-pill-new i { font-size: 1rem; }
  .oc-f-qty { flex-basis: 2.8rem; width: 2.8rem; }
  .oc-f-price { flex-basis: 4rem; width: 4rem; }
  .oc-f-add { width: 38px; height: 38px; }
  .oc-in { padding: .45rem .3rem; }
}
.oc-menu { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20; background: #fff; border: 1px solid var(--pb-border); border-radius: 12px; box-shadow: var(--pb-shadow); padding: .3rem; max-height: 320px; overflow-y: auto; }
.oc-opt { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .6rem .7rem; border: 0; background: none; border-radius: 8px; text-align: left; color: inherit; }
.oc-opt.active, .oc-opt:hover { background: var(--pb-primary-soft); }
.oc-opt .oc-av { width: 30px; height: 30px; font-size: .75rem; }
.oc-opt small { color: var(--pb-muted); margin-left: auto; white-space: nowrap; }
/* the line under the box: a rounded box whose color follows what it says (tip / ready / needs something / problem) */
.oc-hint { font-size: .92rem; margin-bottom: .5rem; padding: .45rem .75rem .45rem 2.2rem; position: relative; border-radius: 12px; line-height: 1.45;
  background: var(--pb-primary-soft); border: 1px solid #cddcfa; color: var(--pb-text); transition: background .15s, border-color .15s; }
.oc-hint::before { content: "\F46B"; font-family: "bootstrap-icons"; position: absolute; left: .75rem; top: .45rem; color: var(--pb-primary); }  /* lightbulb */
.oc-hint .text-muted { color: var(--pb-text) !important; }
.oc-hint .ok, .oc-hint .warn, .oc-hint .bad { color: inherit; }
.oc-hint .ok > .bi, .oc-hint .warn > .bi, .oc-hint .bad > .bi { display: none; }  /* the box's own icon says it */
.oc-hint:has(.ok) { background: var(--pb-success-soft); border-color: #b7e4c7; }
.oc-hint:has(.ok)::before { content: "\F26A"; color: var(--pb-success); }   /* check-circle-fill */
.oc-hint:has(.warn) { background: var(--pb-warning-soft); border-color: #f6d3a6; }
.oc-hint:has(.warn)::before { content: "\F431"; color: var(--pb-warning); } /* info-circle */
.oc-hint:has(.bad) { background: var(--pb-danger-soft); border-color: #f5c2c2; }
.oc-hint:has(.bad)::before { content: "\F332"; color: var(--pb-danger); }   /* exclamation-circle-fill */
.oc-steps { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem; }
.oc-steps span { background: #fff; border: 1px solid #cddcfa; border-radius: 999px; padding: 0 .42rem; font-weight: 600; font-size: .8rem; color: var(--pb-primary-dark); white-space: nowrap; }
.oc-steps .bi { color: var(--pb-primary); font-size: .65rem; }
.oc-now { color: var(--pb-danger); font-weight: 700; }  /* the box to type in now */
.oc-next { font-weight: 400; white-space: nowrap; margin-left: .3rem; font-size: .85rem; }
.oc-touch { display: none; }  /* phones say "Next" (the keypad's key), computers "Enter" */
@media (pointer: coarse) { .oc-touch { display: block; flex-basis: 100%; margin: .15rem 0 0; } .oc-desk { display: none; } }
.oc-hint kbd { background: var(--pb-bg); color: var(--pb-text); border: 1px solid var(--pb-border); font-size: .75rem; padding: .02rem .3rem; }
@media (max-width: 575.98px) {
  .oc-fields { grid-template-columns: minmax(0, 1fr) 3.6rem 5.4rem 2.9rem; gap: .35rem; }
  .oc-fields .form-control { padding: .6rem .55rem; }
}
.oc-flash { animation: oc-flash 1.2s ease-out; }
@keyframes oc-flash { from { box-shadow: 0 0 0 3px var(--pb-success); } to { box-shadow: var(--pb-shadow); } }
.oc-new-badge { background: var(--pb-success-soft); color: var(--pb-success); font-weight: 600; }

/* phones: the keypad while adding items (fixed at the bottom; the iPhone keyboard stays closed) */
.oc-keypad { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1040; display: grid; grid-template-columns: repeat(3, 1fr) 1.25fr; gap: 6px;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); background: #d7dce4; box-shadow: 0 -4px 16px rgba(11, 31, 68, .12); }
.oc-keypad.d-none { display: none; }
.oc-keypad button { height: 52px; border: 0; border-radius: 10px; background: #fff; font-size: 1.45rem; font-weight: 500; color: var(--pb-text);
  box-shadow: 0 1px 0 rgba(0, 0, 0, .18); touch-action: manipulation; -webkit-user-select: none; user-select: none; }
.oc-keypad button:active { background: #c4cad4; }
.oc-keypad .oc-k-fn { background: #eef1f6; font-size: 1rem; font-weight: 600; }
.oc-keypad button:disabled { opacity: .4; }
.oc-keypad .oc-k-go { grid-column: 4; grid-row: 2 / span 2; height: auto; background: var(--pb-primary); color: #fff; font-size: 1.1rem; font-weight: 700;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.oc-keypad .oc-k-go .bi { font-size: 1.5rem; }
.oc-keypad .oc-k-del { grid-column: 4; grid-row: 4; }
.oc-keypad .oc-k-go:active { background: var(--pb-primary-dark); }
.oc-keypad .oc-k-go.is-done { background: var(--pb-success); }
.oc-keypad .oc-k-go.is-done:active { background: #12823b; }
body.oc-keypad-on { padding-bottom: 260px; }
body.oc-keypad-on .oc-menu { max-height: 190px; }

/* Done with something missing: that box turns red and shakes (orders_bar.js refuse) */
.oc-fields .oc-in.is-bad, .oc-fields .oc-in.is-bad:focus { background: var(--pb-danger-soft); color: var(--pb-danger); box-shadow: inset 0 0 0 2px var(--pb-danger); border-radius: 8px; animation: oc-shake .35s; }
.oc-fields .oc-in.is-bad::placeholder { color: var(--pb-danger); opacity: .7; }
@keyframes oc-shake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }

/* the order form on phones: Save always at hand */
@media (max-width: 575.98px) {
  .oc-actions { position: sticky; bottom: 0; z-index: 5; margin: 0 -12px 1.5rem !important; padding: .75rem 12px calc(.75rem + env(safe-area-inset-bottom));
    background: rgba(244, 247, 252, .96); border-top: 1px solid var(--pb-border); }
  .oc-actions .btn-primary { flex: 1 1 auto; }
}

/* the order form: its items, each the same box as the item entry, changed in place (× removes it) */
#itemList .oc-line { margin-bottom: .5rem; min-height: 50px; padding-right: .35rem; }
#itemList .oc-line .oc-f-qty, #itemList .oc-line .oc-f-price { border-left: 1px solid var(--pb-border); border-radius: 0; }
#itemList .oc-line .oc-in:focus { background: var(--pb-primary-soft); border-radius: 8px; border-left-color: transparent; }
.oc-l-total { flex: 0 0 6.5rem; text-align: right; font-weight: 700; color: var(--pb-text); white-space: nowrap; padding-right: .25rem; }
@media (max-width: 575.98px) {  /* phones: the line total on its own small line inside the box */
  #itemList .oc-line { flex-wrap: wrap; row-gap: 0; padding-bottom: .4rem; }
  #itemList .oc-line .oc-l-total { order: 9; flex: 1 0 100%; font-size: .85rem; color: var(--pb-muted); padding: 0 .5rem 0 0; }
  #itemList .oc-line .oc-l-total::before { content: "= "; font-weight: 400; }
}
.oc-x { flex: 0 0 auto; border: 0; background: none; color: var(--pb-muted); padding: 0; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; }
.oc-x:hover, .oc-x:active { background: var(--pb-danger-soft); color: var(--pb-danger); }

/* payment options (the seller's page, the order form's ticks, "How to pay" on the order summary) */
.oc-pay { padding: .85rem 1rem; border: 1px solid var(--pb-border); border-radius: 12px; }
.oc-pay-bank { font-weight: 700; font-size: 1.05rem; margin-bottom: .35rem; }
.oc-pay-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: .6rem; padding: .4rem 0; border-top: 1px dashed var(--pb-border); }
.oc-pay-row span { grid-column: 1 / -1; color: var(--pb-muted); font-size: .78rem; }
.oc-pay-row b { min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
.oc-pay-num { font-size: 1.15rem; letter-spacing: .03em; white-space: nowrap; overflow-wrap: normal !important; }
.oc-pay-editing { box-shadow: 0 0 0 2px var(--pb-primary); }
.oc-pay-check { display: flex; align-items: center; gap: .65rem; padding: .65rem .75rem; border: 1px solid var(--pb-border); border-radius: 12px; cursor: pointer; }
.oc-pay-check .form-check-input { margin: 0; flex: 0 0 auto; width: 1.25rem; height: 1.25rem; }

/* batches (Pro / Business): the switcher above the bar */
.oc-batch-btn { max-width: 70vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oc-batch-menu { min-width: 16rem; max-height: 60vh; overflow-y: auto; }
.oc-batch-menu .dropdown-item { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.oc-batch-menu .oc-batch-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oc-batch-menu small { white-space: nowrap; opacity: .75; }

/* ---- Insights (orders/insights.html): totals cards, the merged items, the save bar ---- */
.oi-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
@media (min-width: 768px) { .oi-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.oi-card { padding: .85rem 1rem; display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.oi-card span { font-size: .8rem; color: var(--bs-secondary-color); }
.oi-card strong { font-size: 1.35rem; line-height: 1.2; overflow-wrap: anywhere; }
.oi-card small { font-size: .75rem; color: var(--bs-secondary-color); }
.oi-net { border-color: var(--bs-primary); }
.oi-net strong { color: var(--bs-primary); }
.oi-net strong.text-danger { color: var(--bs-danger) !important; }

.oi-row { display: grid; gap: .25rem .75rem; padding: .65rem 0; border-top: 1px solid var(--bs-border-color);
  grid-template-columns: 1fr 1fr; grid-template-areas: "name name" "qty sold" "cost cost" "total profit"; font-size: .9rem; }
.oi-row:first-of-type { border-top: 0; }
.oi-row.is-missing .oi-cost input { border-color: var(--bs-warning); background: color-mix(in srgb, var(--bs-warning) 8%, transparent); }
.oi-name { grid-area: name; min-width: 0; display: flex; flex-direction: column; }
.oi-name b { overflow-wrap: anywhere; }
.oi-qty { grid-area: qty; } .oi-sold { grid-area: sold; } .oi-cost { grid-area: cost; }
.oi-total { grid-area: total; } .oi-profit { grid-area: profit; }
.oi-cost input { font-size: 1rem; }
@media (min-width: 768px) {
  .oi-row { grid-template-columns: minmax(0, 2.4fr) .6fr 1.3fr 1.2fr 1fr 1fr; grid-template-areas: "name qty sold cost total profit"; align-items: center; column-gap: 1.25rem; }
  .oi-head { font-size: .75rem; color: var(--bs-secondary-color); padding-top: 0; border-top: 0; }
  .oi-qty, .oi-sold, .oi-total, .oi-profit { text-align: end; }
  .oi-cost input { font-size: .875rem; }
}
.oi-cur { max-width: 5.5rem; }
.oi-save { position: sticky; bottom: 0; padding: .75rem 0 calc(.75rem + env(safe-area-inset-bottom)); background: var(--bs-body-bg); z-index: 5; }

/* Insights tabs + Overview */
.oi-tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--bs-border-color); overflow-x: auto; scrollbar-width: none; }
.oi-tabs a { padding: .55rem .9rem; color: var(--bs-secondary-color); text-decoration: none; font-weight: 600; white-space: nowrap;
  border-bottom: 2px solid transparent; margin-bottom: -1px; }
.oi-tabs a:hover { color: var(--bs-body-color); }
.oi-tabs a.active { color: var(--bs-primary); border-bottom-color: var(--bs-primary); }
.oi-chart { position: relative; height: 260px; }
.oi-legend { display: flex; gap: 1rem; color: var(--bs-secondary-color); }
.oi-key { display: inline-block; width: .7rem; height: .7rem; border-radius: 2px; vertical-align: -1px; margin-right: .2rem; }
.oi-key-sales { background: #94a3b8; } .oi-key-net { background: #2563eb; }
.oi-brow { display: grid; gap: .2rem .75rem; padding: .6rem 0; border-top: 1px solid var(--bs-border-color); color: inherit; text-decoration: none;
  grid-template-columns: 1fr 1fr 1fr; grid-template-areas: "name name name" "sales cost net"; font-size: .9rem; }
a.oi-brow:hover { background: var(--bs-tertiary-bg); }
.oi-brow.oi-head { border-top: 0; padding-top: 0; font-size: .75rem; color: var(--bs-secondary-color); }
.oi-bname { grid-area: name; display: flex; flex-wrap: wrap; align-items: center; gap: 0 .4rem; min-width: 0; }
.oi-bname small { flex-basis: 100%; }
.oi-bsales { grid-area: sales; } .oi-bcost { grid-area: cost; } .oi-bnet { grid-area: net; }
@media (min-width: 768px) {
  .oi-brow { grid-template-columns: minmax(0, 2fr) 1fr 1fr 1.2fr; grid-template-areas: "name sales cost net"; align-items: center; }
  .oi-bsales, .oi-bcost, .oi-bnet { text-align: end; }
}
.oi-top { display: flex; align-items: center; gap: .75rem; padding: .55rem 0; border-top: 1px solid var(--bs-border-color); font-size: .9rem; }
.oi-top:first-of-type { border-top: 0; }
.oi-rank { width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--pb-primary-soft); color: var(--bs-primary);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .8rem; flex-shrink: 0; }
.min-w-0 { min-width: 0; }
.oi-card .oi-change { margin-top: .25rem; color: var(--bs-secondary-color); }
.oi-change .bi { font-size: 1.1em; vertical-align: -.1em; }
/* Insights → Customers */
.oi-cust { border-top: 1px solid var(--bs-border-color); }
.oi-cust:first-of-type { border-top: 0; }
.oi-cust summary { display: flex; align-items: center; gap: .75rem; padding: .6rem 0; cursor: pointer; list-style: none; font-size: .9rem; }
.oi-cust summary::-webkit-details-marker { display: none; }
.oi-cust-chev { color: var(--bs-secondary-color); transition: transform .15s; }
.oi-cust[open] .oi-cust-chev { transform: rotate(180deg); }
.oi-cust-orders { padding: 0 0 .75rem 2.35rem; }
.oi-cust-orders a, .oi-quiet { display: flex; align-items: center; gap: .75rem; padding: .45rem .5rem; border-radius: .5rem; color: inherit;
  text-decoration: none; font-size: .875rem; }
.oi-cust-orders a:hover, .oi-quiet:hover { background: var(--bs-tertiary-bg); }
.oi-quiet { padding: .5rem; margin: 0 -.5rem; border-top: 1px solid var(--bs-border-color); border-radius: 0; }

/* ---- the Orders page top row (the order bar is the page): batch + switch on the left, icon buttons right ---- */
.oc-page { padding-top: 1rem; }
.oc-top { display: flex; align-items: center; gap: .4rem; margin-bottom: .6rem; min-height: 42px; }
.oc-top-batch { min-width: 0; }
.oc-top-batch .oc-batch-btn { display: flex; align-items: baseline; gap: .4rem; max-width: 100%; padding: .35rem .6rem; border-radius: 10px; font-size: 1.05rem; }
.oc-top-batch .oc-batch-btn b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oc-top-batch .oc-batch-btn:hover { background: var(--pb-primary-soft); }
.oc-top-label { font-size: .75rem; color: var(--pb-muted); }
.oc-top-basic { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: .5rem; min-width: 0; }
.oc-top-basic h1 { font-size: 1.25rem; margin: 0; }
.oc-tools { margin-left: auto; display: flex; gap: .3rem; flex-shrink: 0; }
.oc-ico { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; min-width: 40px; height: 40px; padding: 0 .55rem;
  border: 1px solid var(--pb-border); border-radius: 10px; background: #fff; color: var(--pb-text); text-decoration: none; font-size: 1.1rem; }
.oc-ico span { font-size: .875rem; display: none; }
.oc-ico:hover { background: var(--pb-primary-soft); color: var(--pb-primary); }
@media (min-width: 768px) { .oc-tools .oc-ico span { display: inline; } }
/* the batch picker (Pro / Business) */
.oc-continue { display: flex; align-items: center; gap: .8rem; padding: 1rem 1.1rem; margin-bottom: .8rem; text-decoration: none; color: inherit;
  border: 2px solid var(--pb-primary); }
.oc-continue:hover { background: var(--pb-primary-soft); }
.oc-continue b { font-size: 1.2rem; }
.oc-continue small { color: var(--pb-muted); }
.oc-continue-ico { flex: 0 0 44px; height: 44px; border-radius: 50%; background: var(--pb-primary); color: #fff; display: grid; place-items: center; font-size: 1.4rem; }
.oc-blist { padding: .25rem 0; }
.oc-blist a { display: flex; align-items: center; gap: .7rem; padding: .7rem 1rem; color: inherit; text-decoration: none; }
.oc-blist a + a { border-top: 1px solid var(--pb-border); }
.oc-blist a:hover { background: var(--pb-primary-soft); }
.oc-newbatch-btn { height: 40px; border-radius: 10px; white-space: nowrap; padding: 0 .75rem; display: inline-flex; align-items: center; gap: .3rem; }  /* a link now: centre its text like the icon buttons */
@media (max-width: 399.98px) { .oc-page .oc-top-basic h1 { font-size: 1.1rem; } }
.oc-needs { border: 2px solid var(--pb-primary); }  /* Payment options: the currency still to choose */

/* Insights → Batches → By customer: each order with its items (item · qty · price · total · cost · profit) */
.oi-cust-row { display: grid; grid-template-columns: minmax(0, 2.4fr) .6fr 1fr 1fr 1fr 1fr; gap: .25rem .75rem; padding: .4rem 0; border-top: 1px solid var(--pb-border); align-items: baseline; font-size: .9rem; }
.oi-cust-head { border-top: 0; padding-top: 0; font-size: .72rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--pb-muted); }
@media (max-width: 767.98px) {
  .oi-cust-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .oi-cust-row > :first-child { grid-column: 1 / -1; }
  .oi-cust-row .text-end { text-align: left !important; }
}

/* the line under the top row: what these orders use (currency · payment options) + Change */
.oc-uses { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem 1rem; color: var(--pb-muted); }
.oc-uses > span { min-width: 0; }
.oc-uses .bi { margin-right: .2rem; }

/* New batch / batch payments: one payment account per row (tick · name · number · Edit) */
.bp-row { display: flex; align-items: center; gap: .75rem; padding: .55rem .75rem; border: 1px solid var(--pb-border); border-radius: 10px; }
.oc-newbatch-btn { font-size: .875rem; font-weight: 600; padding: 0 .65rem; }  /* same text size as the Insights button beside it */

/* the customer's changes on the order summary (orders/_summary_changes.html, _summary_bar.html, js/summary_changes.js) */
.ocx-hint { font-size: .84rem; color: var(--pb-muted); margin: 0 0 .6rem; }
.ocx-banner { display: flex; gap: .5rem; background: #fffaeb; border: 1px solid #fedf89; color: #93370d; border-radius: 12px; padding: .65rem .8rem; font-size: .84rem; margin-bottom: .6rem; }
.ocx { display: flex; flex-direction: column; gap: .5rem; }
.ocx-card { display: flex; align-items: center; gap: .6rem; background: #fff; border: 1px solid var(--pb-border); border-radius: 14px; padding: .75rem .8rem; }
.ocx-card.is-removed { opacity: .6; }
.ocx-card.is-removed .ocx-nm { text-decoration: line-through; }
.ocx-name { flex: 1; min-width: 0; }
.ocx-name b { display: block; font-weight: 600; overflow-wrap: anywhere; line-height: 1.3; }
.ocx-sub { display: block; color: var(--pb-muted); font-size: .84rem; margin-top: .15rem; }
.ocx-sub strong { color: var(--pb-text); font-weight: 600; }
.ocx-was { color: #b54708; font-weight: 600; }
.ocx-act { display: flex; align-items: center; flex-shrink: 0; margin: 0; }
.ocx-ro { flex-shrink: 0; font-weight: 600; white-space: nowrap; }
.ocx-qty { display: inline-flex; align-items: center; border: 1px solid var(--pb-border); border-radius: 999px; height: 36px; background: #fff; }
.ocx-qty.is-changed { border-color: #f79009; background: #fffaeb; }
.ocx-qty button { border: 0; background: none; width: 36px; height: 34px; font-size: 1.15rem; color: var(--pb-text); border-radius: 999px; padding: 0; }
.ocx-qty button .bi { font-size: .9rem; color: var(--pb-muted); }
.ocx-qty button:active { background: var(--pb-bg); }
.ocx-qty span { min-width: 1.8rem; text-align: center; font-weight: 700; }
.ocx-undo { border: 0; background: none; color: var(--pb-primary); font-weight: 700; padding: .4rem .2rem; }
.ocx-tag { font-size: .64rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: .1rem .45rem; border-radius: 999px; vertical-align: 2px; white-space: nowrap; }
.ocx-new { background: #e7f6ec; color: #1a7f37; } .ocx-wait { background: #fff4e0; color: #9a6100; } .ocx-rm { background: #fdecec; color: #b42318; }
.ocx-addrow { display: block; width: 100%; margin-top: .6rem; border: 1.5px dashed #b2c3f0; background: #f5f8ff; color: var(--pb-primary); font-weight: 700; border-radius: 14px; padding: .8rem; }
.ocx-add { display: flex; gap: .5rem; margin-top: .75rem; }
.ocx-add .form-control { min-width: 0; }
.ocx-add .ocx-add-qty { width: 5rem; flex-shrink: 0; }
.ocx-add .btn { flex-shrink: 0; }
/* the bottom sheet */
.ocx-sheet.offcanvas-bottom { height: auto; max-height: 88vh; border-radius: 20px 20px 0 0; }
@media (min-width: 768px) { .ocx-sheet.offcanvas-bottom { max-width: 520px; margin: 0 auto; } }
.ocx-grab { width: 40px; height: 5px; border-radius: 9px; background: var(--pb-border); margin: .5rem auto 0; }
.ocx-search { display: flex; align-items: center; gap: .5rem; border: 1.5px solid var(--pb-primary); border-radius: 12px; padding: 0 .75rem; }
.ocx-search .bi { color: var(--pb-muted); }
.ocx-search input { border: 0; outline: 0; flex: 1; min-width: 0; padding: .7rem 0; font-size: 16px; background: none; }
.ocx-list { max-height: 38vh; overflow-y: auto; }
.ocx-pick { display: flex; justify-content: space-between; gap: .75rem; width: 100%; border: 0; border-bottom: 1px solid var(--pb-border); background: none; padding: .7rem .1rem; text-align: left; }
.ocx-pick span { overflow-wrap: anywhere; }
.ocx-pick small { color: var(--pb-muted); white-space: nowrap; }
.ocx-pick.on { color: var(--pb-primary); font-weight: 700; }
.ocx-pick.on small { color: var(--pb-primary); }
.ocx-none { color: var(--pb-muted); font-size: .9rem; padding: .7rem 0; }
.ocx-qrow { display: flex; justify-content: space-between; align-items: center; margin: 1rem 0; }
.ocx-big { padding: .8rem; font-weight: 700; border-radius: 12px; }
/* the bar at the bottom: fixed on phones, under the card on wider screens */
.ocx-bar { position: sticky; bottom: 0; z-index: 1020; display: flex; align-items: center; gap: .75rem; background: #fff; border-top: 1px solid var(--pb-border);
  box-shadow: 0 -4px 14px rgba(16, 24, 40, .06); padding: .7rem 1rem calc(.7rem + env(safe-area-inset-bottom)); margin: 0 -12px; }
@media (min-width: 768px) { .ocx-bar { border: 1px solid var(--pb-border); border-radius: 14px; margin: 0 0 1rem; } }
.ocx-bar-t { flex: 1; min-width: 0; }
.ocx-bar-t small { display: block; font-size: .78rem; color: var(--pb-muted); }
.ocx-bar-t b { font-size: 1.2rem; color: var(--pb-primary); }
.ocx-bar-t s { color: var(--pb-muted); font-size: .85rem; margin-left: .3rem; }
.ocx-bar .btn { font-weight: 700; border-radius: 12px; padding: .65rem 1rem; white-space: nowrap; }
.ocx-btn-soft { background: var(--pb-primary-soft); color: var(--pb-primary); border: 0; }
.ocx-btn-soft:hover { background: var(--pb-primary-soft); color: var(--pb-primary); filter: brightness(.97); }
@media print { .ocx-bar { display: none !important; } }
.ocx-hd { font-size: .74rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--pb-muted); margin-bottom: .4rem; }
.ocx-history { font-size: .84rem; color: var(--pb-muted); }
.ocx-history > div:not(.ocx-hd) { padding: .15rem 0; }
.ocx-chg { display: flex; align-items: center; gap: .5rem; padding: .6rem 0; border-bottom: 1px solid var(--pb-border); flex-wrap: wrap; }
.ocx-chg .ocx-what { flex: 1; min-width: 10rem; }
.ocx-chg form { display: flex; gap: .35rem; align-items: center; }
.ocx-price { width: 6.5rem; }
.ocx-pick.ocx-typed { cursor: default; color: var(--pb-text); font-weight: 600; }
.ocx-pick.ocx-typed small { color: var(--pb-muted); }
