/* Auto Parts Offer: styles of our own additions (from 2.12.18-apo2). The program's own styles stay in
   app.css and ui.css, untouched; these only use its colours. */

/* apo2: where the part goes after the check — the warehouse reads it from across the table */
.apo-go { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid transparent; }
.apo-go-ic { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 10px; color: #fff; }
.apo-go-text { display: grid; gap: 2px; min-width: 0; }
.apo-go-text small { font-size: 12px; font-weight: 500; color: var(--muted); }
.apo-go-text b { font-size: 22px; line-height: 1.15; font-weight: 700; letter-spacing: .01em; color: var(--ink); }
.apo-go-hint { font-size: 13px; color: var(--muted); }
.apo-go-orders { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 2px; }
.apo-go-order { display: inline-flex; align-items: center; height: 30px; padding: 0 10px; border-radius: 8px; background: var(--panel, #fff); box-shadow: inset 0 0 0 1px var(--line); font-size: 15px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.apo-go.ship { background: var(--blue-soft); border-color: color-mix(in srgb, var(--blue) 35%, transparent); }
.apo-go.ship .apo-go-ic { background: var(--blue); }
.apo-go.shelf { background: var(--green-soft); border-color: color-mix(in srgb, var(--green) 35%, transparent); }
.apo-go.shelf .apo-go-ic { background: var(--green); }
.apo-go.none { background: var(--field); border-style: dashed; border-color: var(--line); }
.apo-go.none .apo-go-ic { background: var(--muted); }
.apo-go.none .apo-go-text b { font-size: 16px; font-weight: 600; }

/* apo2: "what it's for" said by hand — on the card, in the window and in the form */
.apo-for-by { display: flex; align-items: center; gap: 4px; }
.apo-for-orders { display: grid; gap: 4px; }
.apo-for-seg { justify-self: start; }

/* apo2: the order's number on the "what it's for" card — the program's own colour for it is white on
   pale blue, which cannot be read; blue on pale blue can */
.sup-for .sup-for-chip:not(.stock) { color: var(--blue); }

/* ===== apo3: the warehouse section (web/apo-wh.js) ===== */
.apo-wh-scan { flex: none; display: flex; align-items: center; gap: 10px; padding: 12px 24px; background: var(--panel); border-bottom: 1px solid var(--line); }
.apo-wh-scan-ic { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; background: var(--field); color: var(--muted); flex: none; }
.apo-wh-scan-input { flex: 1; min-width: 0; height: 46px; padding: 0 14px; border-radius: 12px; border: 2px solid var(--line); background: var(--field); color: var(--ink); font: 500 17px/1 inherit; font-family: inherit; outline: none; }
.apo-wh-scan-input:focus { border-color: var(--blue); background: var(--panel); }
.apo-wh-scan .btn { height: 46px; padding: 0 20px; }
.apo-wh-body { display: grid; gap: 14px; align-content: start; }
.apo-wh-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.apo-wh-tile { display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); text-align: left; cursor: pointer; font: inherit; color: var(--ink); transition: box-shadow .15s, transform .15s; }
.apo-wh-tile:hover { box-shadow: 0 6px 22px rgba(0,0,0,.08); transform: translateY(-1px); }
.apo-wh-tile-ic { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 14px; color: #fff; flex: none; background: var(--blue); }
.apo-wh-tile.label .apo-wh-tile-ic { background: #c94f0a; }
.apo-wh-tile.locs .apo-wh-tile-ic { background: var(--green); }
.apo-wh-tile.count .apo-wh-tile-ic { background: #6b5bd2; }
.apo-wh-tile-text { display: grid; gap: 3px; min-width: 0; }
.apo-wh-tile-text b { font-size: 17px; font-weight: 600; }
.apo-wh-tile-text span { font-size: 13px; color: var(--muted); }
.apo-wh-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.apo-wh-stat { display: grid; gap: 2px; padding: 12px 16px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); text-align: left; cursor: pointer; font: inherit; color: var(--ink); }
.apo-wh-stat b { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.apo-wh-stat span { font-size: 13px; color: var(--muted); }
.apo-wh-stat.warn b { color: #b97a00; }
.apo-wh-note { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px; background: rgba(214,155,20,.12); border: 1px dashed rgba(214,155,20,.55); }
.apo-wh-note > div { display: grid; gap: 2px; flex: 1; min-width: 0; }
.apo-wh-note span { color: var(--muted); font-size: 13px; }
.apo-wh-note.bad { background: var(--red-soft); border-color: var(--red); }
.apo-wh-note.go { background: var(--blue-soft); border: 1px solid color-mix(in srgb, var(--blue) 35%, transparent); }
.apo-wh-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.apo-wh-bar h2 { margin: 0; font-size: 19px; font-weight: 600; }
.apo-wh-bar-push { margin-left: auto; display: flex; gap: 8px; }
.apo-wh-filter { width: 260px; }
.apo-wh-lead { margin: 0; }
.apo-wh-rows { display: grid; gap: 6px; }
.apo-wh-row { display: grid; grid-template-columns: 112px minmax(150px, 230px) minmax(0, 1fr) auto auto 16px; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); text-align: left; cursor: pointer; font: inherit; color: var(--ink); }
.apo-wh-row:hover { border-color: var(--blue); }
.apo-wh-row-main { display: flex; align-items: center; gap: 8px; min-width: 0; }
.apo-wh-row-main b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.apo-wh-row-desc { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.apo-wh-code { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: 7px; background: var(--field); font: 600 13px/1.3 "IBM Plex Mono", Consolas, monospace; white-space: nowrap; }
.apo-wh-code.big { font-size: 16px; padding: 7px 12px; border-radius: 10px; }
.apo-wh-loc { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 12px; background: var(--green-soft); color: var(--green); font-weight: 700; font-size: 13px; white-space: nowrap; }
.apo-wh-qty { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.apo-wh-item-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.apo-wh-item-name { display: flex; align-items: center; gap: 10px; }
.apo-wh-item-name h2 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -.01em; }
.apo-wh-item-desc { margin: 0; font-size: 16px; }
.apo-wh-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.apo-wh-fact { align-content: start; }
.apo-wh-fact .btn { justify-self: start; }
.apo-wh-big { font-size: 40px; line-height: 1.05; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.apo-wh-fact.empty .apo-wh-big { font-size: 24px; color: #b97a00; padding: 8px 0; }
.apo-wh-events { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.apo-wh-events li { display: flex; align-items: center; gap: 10px; }
.apo-wh-ev-ic { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--field); color: var(--muted); flex: none; }
.apo-wh-ev-ic.place { background: var(--green-soft); color: var(--green); }
.apo-wh-ev-ic.count { background: var(--blue-soft); color: var(--blue); }
.apo-wh-ev-text { flex: 1; min-width: 0; }
.apo-wh-rack { display: grid; gap: 8px; }
.apo-wh-rack h3 { margin: 4px 0 0; font-size: 14px; font-weight: 600; color: var(--muted); }
.apo-wh-locgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 10px; }
.apo-wh-loccard { display: grid; gap: 2px; padding: 12px 14px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); text-align: left; cursor: pointer; font: inherit; color: var(--ink); }
.apo-wh-loccard:hover { border-color: var(--blue); }
.apo-wh-loccard b { font-size: 24px; font-weight: 700; }
.apo-wh-loccard span { font-size: 13px; color: var(--green); font-weight: 600; }
.apo-wh-loccard.empty { border-style: dashed; }
.apo-wh-loccard.empty span { color: var(--muted); font-weight: 400; }
.apo-wh-loccard small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.apo-wh-lochead { grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 20px; }
.apo-wh-lochead-code { display: grid; gap: 2px; }
.apo-wh-lochead-code small { color: var(--muted); font-size: 13px; }
.apo-wh-lochead-code b { font-size: 60px; line-height: 1; font-weight: 800; letter-spacing: -.01em; }
.apo-wh-lochead-btns { display: grid; gap: 8px; justify-items: start; }
.apo-wh .danger-text { color: var(--red); }
.apo-wh-newloc-row { display: flex; align-items: flex-end; gap: 10px; }
.apo-wh-newloc-row .field { flex: 0 0 110px; }
.apo-wh-newloc-row .input { font-size: 22px; font-weight: 700; text-transform: uppercase; text-align: center; height: 52px; }
.apo-wh-dash { font-size: 26px; font-weight: 700; padding-bottom: 10px; color: var(--muted); }
.apo-wh-newloc-prev { margin-left: auto; display: grid; gap: 2px; text-align: right; }
.apo-wh-newloc-prev small { color: var(--muted); font-size: 12px; }
.apo-wh-newloc-prev b { font-size: 34px; line-height: 1.1; font-weight: 800; }
.apo-wh-place-in { height: 48px; font-size: 17px; }
.apo-wh-chips { display: flex; flex-wrap: wrap; gap: 6px; max-height: 190px; overflow: auto; }
.apo-wh-chip { padding: 7px 13px; border-radius: 10px; background: var(--field); border: 1px solid transparent; font: 700 14px/1 inherit; font-family: inherit; color: var(--ink); cursor: pointer; }
.apo-wh-chip:hover { border-color: var(--blue); }
.apo-wh-chip.on { background: var(--green-soft); color: var(--green); }
.apo-wh-count-what { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.apo-wh-count-what b { font-size: 18px; }
.apo-wh-count-row { display: flex; align-items: center; gap: 10px; }
.apo-wh-count-in { flex: 1; height: 68px; font-size: 38px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.apo-wh-step { width: 68px; height: 68px; flex: none; justify-content: center; border-radius: 14px; }
.apo-wh-prev { display: grid; place-items: center; padding: 16px; background: var(--field); border-radius: 12px; }
.apo-wh-mini-lbl { width: 94px; height: 152px; overflow: hidden; }
.apo-wh-mini-lbl .apo-lbl { transform: scale(.5); transform-origin: top left; }
.apo-wh-lochead .apo-wh-mini-lbl { width: 94px; }

/* a label as it will print: black on white whatever the theme */
.apo-lbl { display: flex; flex-direction: column; gap: .35em; box-sizing: border-box; padding: .8em; background: #fff; color: #000; border: 1px solid #c8c8cc; border-radius: 6px; box-shadow: 0 2px 10px rgba(0,0,0,.10); overflow: hidden; font-family: Geologica, Inter, system-ui, sans-serif; line-height: 1.2; text-align: left; }
.apo-lbl-top { display: flex; align-items: center; justify-content: space-between; gap: .5em; font-size: 1.15em; }
.apo-lbl-shelf { border: .12em solid #000; padding: 0 .35em; font-weight: 700; white-space: nowrap; }
.apo-lbl-part { font-size: 2em; font-weight: 700; line-height: 1.08; overflow-wrap: anywhere; }
.apo-lbl-desc { font-size: 1.05em; font-weight: 600; flex: 1; overflow: hidden; }
.apo-lbl-bar { text-align: center; margin-top: auto; flex: none; }
.apo-lbl-bar .bc128 { display: block; width: 100%; height: 3.6em; }
.apo-lbl-bar span { font: 600 .95em/1.3 "IBM Plex Mono", Consolas, monospace; letter-spacing: .1em; }
.apo-lbl-band { background: #000; color: #fff; font-weight: 700; font-size: 1.2em; padding: .3em .55em; letter-spacing: .04em; }
.apo-lbl-loc { flex: 1; display: grid; place-items: center; font-size: 7em; font-weight: 800; line-height: 1; white-space: nowrap; }
.apo-lbl-note { text-align: center; font-size: 1em; }
.apo-lbl.loc .apo-lbl-bar .bc128 { height: 5em; }
.apo-lbl.wide { flex-direction: row; align-items: center; gap: .8em; padding: .6em .8em; }
.apo-lbl.wide .apo-lbl-desc, .apo-lbl.wide .apo-lbl-band, .apo-lbl.wide .apo-lbl-note, .apo-lbl.wide .apo-lbl-top { display: none; }
.apo-lbl.wide .apo-lbl-part { font-size: 1.7em; flex: 1; }
.apo-lbl.wide .apo-lbl-loc { font-size: 4em; }
.apo-lbl.wide .apo-lbl-bar { margin: 0; flex: 1; }
.apo-lbl.wide .apo-lbl-bar .bc128 { height: 2.6em; }
@media (max-width: 760px) {
  .apo-wh-scan { padding: 10px 14px; }
  .apo-wh-row { grid-template-columns: minmax(0, 1fr) auto; }
  .apo-wh-row-desc, .apo-wh-row > .ico { display: none; }
  .apo-wh-lochead { grid-template-columns: minmax(0, 1fr); }
  .apo-wh-filter { width: 100%; }
}
.apo-go-put { justify-self: start; margin: 4px 0 2px; }

/* ===== apo4: three-part addresses, the link with the sheet, the table ===== */
.apo-wh-tiles { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.apo-wh-tile { flex-direction: column; align-items: flex-start; gap: 12px; padding: 16px; }
.apo-wh-tile-ic { width: 48px; height: 48px; }
.apo-wh-tile.table .apo-wh-tile-ic { background: #1f8f5f; }
.apo-wh-newloc-row .field { flex: 0 0 78px; }
.apo-wh-sync { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px; background: var(--green-soft); border: 1px solid color-mix(in srgb, var(--green) 30%, transparent); }
.apo-wh-sync.ro { background: rgba(214,155,20,.12); border-color: rgba(214,155,20,.5); }
.apo-wh-sync-ic { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--green); color: #fff; flex: none; }
.apo-wh-sync.ro .apo-wh-sync-ic { background: #b97a00; }
.apo-wh-sync-text { display: grid; gap: 1px; flex: 1; min-width: 0; }
.apo-wh-sync-text b { font-weight: 600; }
.apo-wh-sync-text span { font-size: 13px; color: var(--muted); }
.apo-wh-sync.wait .apo-wh-sync-text span { color: #9a6a00; }
.apo-wh-qty.sheet { font-weight: 500; color: var(--muted); }
.apo-wh-sheet { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; }
.apo-wh-sheet.ok { background: var(--green-soft); color: var(--green); }
.apo-wh-sheet.wait { background: rgba(214,155,20,.18); color: #9a6a00; }
.apo-wh-itemsheet { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; padding: 5px 11px; border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--green); background: var(--green-soft); }
.apo-wh-itemsheet.wait { color: #9a6a00; background: rgba(214,155,20,.18); }
.apo-wh-tablewrap { overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.apo-wh-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.apo-wh-table th { position: sticky; top: 0; z-index: 1; text-align: left; padding: 9px 12px; background: var(--field); color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; border-bottom: 1px solid var(--line); }
.apo-wh-table td { padding: 8px 12px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); white-space: nowrap; }
.apo-wh-table td:last-child, .apo-wh-table th:last-child { border-right: 0; text-align: center; }
.apo-wh-table tr:last-child td { border-bottom: 0; }
.apo-wh-table tbody tr { cursor: pointer; }
.apo-wh-table tbody tr:hover td { background: color-mix(in srgb, var(--blue-soft) 45%, transparent); }
.apo-wh-table td.c-desc { white-space: normal; min-width: 180px; color: var(--muted); }
.apo-wh-table td.c-qty { text-align: right; font-variant-numeric: tabular-nums; }
.apo-wh-table th:nth-child(6) { text-align: right; }
.apo-wh-table td.edit { cursor: cell; }
.apo-wh-table td.edit:hover { box-shadow: inset 0 0 0 2px var(--blue); background: var(--panel); }
.apo-lbl-note { font-weight: 600; letter-spacing: .02em; }
