/* Bug-sweep fixes, team d (Oct 2026). Loaded after si.css. */

/* D12 — Suppliers detail: the unpaid-items grid (22+74+…+82px) was wider than the modal at 390px.
   Phone: hide the Date and Unit columns; the date + unit cost move under the item name. */
.sup-item-date { display: none; }
@media (max-width: 600px) {
  .sup-row, .sup-row-head { grid-template-columns: 22px minmax(0,1fr) 34px 76px; gap: 6px; }
  .sup-row > :nth-child(2), .sup-row-head > :nth-child(2),
  .sup-row > :nth-child(5), .sup-row-head > :nth-child(5) { display: none; }
  .sup-item-date { display: block; margin-top: 2px; }
  .sup-item { min-width: 0; }
  .sup-pay-actions > .btn, .sup-amt-group { flex: 1 1 auto; }
  .sup-amt-group .input { max-width: none !important; flex: 1 1 auto; min-width: 0; }
  /* Payables summary: name + owed on top, contact / sold / paid underneath */
  .sup-srow, .sup-srow-head { grid-template-columns: minmax(0,1fr) auto; row-gap: 2px; }
  .sup-srow-head > :nth-child(2), .sup-srow-head > :nth-child(3), .sup-srow-head > :nth-child(4) { display: none; }
  .sup-srow-head > :nth-child(5) { grid-column: 2; grid-row: 1; }
  .sup-srow > .sup-sname { grid-column: 1; grid-row: 1; }
  .sup-srow > .sup-owed { grid-column: 2; grid-row: 1; }
  .sup-srow > :nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  .sup-srow > :nth-child(3), .sup-srow > :nth-child(4) { grid-row: 3; text-align: left; font-size: 12px; }
  .sup-srow > :nth-child(3) { grid-column: 1; }
  .sup-srow > :nth-child(4) { grid-column: 2; text-align: right; }
  .sup-srow > :nth-child(3)::before { content: 'Sold '; }
  .sup-srow > :nth-child(4)::before { content: 'Paid '; }
}

/* D6 — credit with a supplier (paid for items later refunded / voided / excluded) */
.sup-credit-banner { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 10px;
  background: color-mix(in srgb, var(--ok, #2E7D5B) 10%, #fff); border: 1px solid color-mix(in srgb, var(--ok, #2E7D5B) 30%, transparent); }
.sup-credit-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.sup-credit-top b { color: var(--ok, #2E7D5B); font-size: 16px; }
.sup-credit-chip { display: block; font-size: 11.5px; font-weight: 600; color: var(--ok, #2E7D5B); white-space: nowrap; }
.sup-detail.is-busy .sup-pay-actions { opacity: .6; pointer-events: none; }

/* D19 — charts are drawn at the card's real width; wider charts scroll sideways inside the card */
.rep-chartwrap > .rep-chartin { min-width: 0; }
.rep-chartwrap > .rep-chartin .chart svg { width: 100%; }

/* D18 — "before bill discounts" note on the Insights All sales card */
.ins-card-note { font-size: 11px; line-height: 1.2; }

/* D-R1 — a deleted supplier that still has money on its row stays listed, labelled "(inactive)" */
.sup-inactive { font-weight: 400; white-space: nowrap; }

/* D-5.1 — ranged CSV links after a failed load: dimmed; a tap shows why instead of downloading an error */
.rep-export.rep-export-off { opacity: .5; cursor: not-allowed; }

/* D-8.1 — ₱0 owed: the disabled pay buttons say why, on their own line under them */
.sup-pay-actions > .sup-nothing-owed { flex: 1 0 100%; margin-top: -2px; overflow-wrap: anywhere; }

/* Founder test fixes (23 Oct 2026), workstream D */
/* Show/hide eye on every password field (core/ui.js withEye) */
.pw-wrap { position: relative; width: 100%; min-width: 0; }
.pw-wrap > .input { width: 100%; padding-right: 42px; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border: 0; background: none; color: var(--muted, #6b6570); cursor: pointer; border-radius: 8px; }
.pw-eye:hover { color: var(--ink, #0E0B0F); }
.pw-eye:focus-visible { outline: 2px solid var(--navy, #1d2a44); outline-offset: 1px; }
.staff-edit-pinrow .pw-wrap, .row .pw-wrap { flex: 1 1 auto; width: auto; }
/* Long store name under the PeppyPOS word in the sidebar: wrap up to three lines instead of cutting it */
.sidebar-brand.peppy-side-brand > div { min-width: 0; }
.sidebar-brand.peppy-side-brand small:not(.psb-greet) { white-space: normal; overflow-wrap: anywhere; line-height: 1.3; max-width: 150px; letter-spacing: .04em;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
/* Phone Menu list: price and stock under the item name (the wide columns stay for tablets and desktop) */
.prod-mmeta { display: none; }
@media (max-width: 700px) {
  .prod-mmeta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 3px; }
  .prod-mmeta .prod-stock { display: inline-flex; align-items: center; gap: 4px; }
}
