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

/* A8 — phone: app.css hides every .search-box under 700px (meant for the topbar search). Bring back
   the Menu product search and every table search; the topbar one stays hidden. */
@media (max-width:700px){
  .prod-filters .search-box.prod-search,
  .table-tools .search-box{display:flex;width:100%;flex:1 1 100%;min-width:0}
}

/* A16 — product detail KPIs: long values ("from ₱1,234.00", "makes ~1,234") wrap/shrink, never clip */
.prod-kpis .kpi-value{white-space:normal;overflow-wrap:anywhere;text-overflow:clip}
@media (max-width:700px){
  .prod-kpis .kpi-value{font-size:20px;letter-spacing:-.02em}
}
/* A16 — Options card: a long group name stays on one line with an ellipsis (no one-word-per-line) */
.prod-opt-group{max-width:240px;white-space:nowrap}
.prod-opt-group .fixa-gname{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media (max-width:700px){ .prod-opt-group{max-width:160px} }

/* A6 — option cost boxes driven by "Auto from ingredients" */
.prod-opt-money .input.fixa-auto{background:var(--paper);color:var(--muted);cursor:not-allowed}
.prod-opt-money .input.fixa-auto::placeholder{font-style:italic}

/* A7 — staff option rows have no Cost column */
.prod-opts.fixa-nocost .prod-opt-row{grid-template-columns:minmax(0,1fr) 112px 34px}
@media (max-width:700px){
  .prod-opts.fixa-nocost .prod-opt-row{grid-template-columns:minmax(0,1fr) minmax(0,1fr) 34px;grid-template-areas:"name name x" "price price x"}
}

/* A20 — Count: Enter keeps the next box clear of the sticky Save bar (and the phone bottom nav) */
.cnt-in{scroll-margin-top:90px;scroll-margin-bottom:150px}

/* A26 — "Showing the latest 2000" notice above Movements / Stock-in history */
.fixa-cap{padding:2px 2px 0}

/* A22 — staff Stock-in lines have no Cost / Total (costs are owner-only) */
.stock-line.fixa-nocost{grid-template-columns:minmax(0,1fr) 90px 36px}

/* A31 — phone Stock-in line: name + ✕ on top, Qty and Cost each half the width, Total on its own row
   (the old 3-across row left the cost box ~34px wide) */
@media (max-width:700px){
  .stock-line{grid-template-columns:minmax(0,1fr) minmax(0,1fr) 36px;grid-template-areas:"name name x" "qty cost cost" "tot tot tot";row-gap:8px}
  .stock-line .stock-line-f .input{min-width:0;width:100%}
  .stock-line .input-group{min-width:0;width:100%}
  .stock-line-tot{flex-direction:row;justify-content:space-between;align-items:center;text-align:left}
  .stock-line-tot .stock-line-total{height:auto}
  .stock-line.fixa-nocost{grid-template-areas:"name name x" "qty qty qty"}
}

/* A-R5 (round 2) — product movements From/To row stays hidden until "View all"
   (.prod-mv-range{display:flex} beat the [hidden] attribute) */
.prod-mv-range[hidden]{display:none}
/* A-R3 (round 2) — staff recipe editor: no "Cost to make" line */
.prod-rcp-cost[hidden]{display:none}

/* Round 3 — "Track this item's own stock" switch (Menu → Edit, recipe items, owner) */
.fixa-track-field{border:1px solid var(--line);border-radius:10px;padding:6px 12px 10px;background:var(--paper)}
.fixa-track-field label.toggle{height:auto;min-height:40px}
.fixa-track-field .field-hint{margin-top:2px;line-height:1.4}
.fixa-track-note{color:var(--warn-text)}

/* Round 4 — A-4.1 stock-in line: "Auto cost turns off" (tracked recipe item, owner) */
.fixa-autooff{color:var(--warn-text);line-height:1.3}
