/* ============================================================================
   parts.css — 2.10 « Le magasin »: the parts counter, physical counts, stock
   analysis, outside work on the work order, and the outside provider's page.
   Drawn with the design tokens, so light / dark follow.
   Prefixes: .pd (parts desk), .cnt (counts), .pa (analysis), .sb (sublets on
   the work order), .ow (outside-work list), .pv (the provider's page).
   ========================================================================== */

.alert--purple { background: var(--purple-soft); border-color: transparent; color: var(--purple-ink); }
.table--compact td, .table--compact th { padding-top: 6px; padding-bottom: 6px; }

/* ---- The parts counter ------------------------------------------------------ */
.pdreqs { display: flex; flex-direction: column; }
.pdreq { display: grid; grid-template-columns: minmax(0, 1fr) 150px auto; gap: var(--s-4); align-items: center; padding: var(--s-3) var(--s-5); border-bottom: 1px solid var(--line); border-left: 3px solid transparent; }
.pdreq:last-child { border-bottom: 0; }
.pdreq.is-vor { border-left-color: var(--danger); background: color-mix(in srgb, var(--danger-soft) 45%, transparent); }
.pdreq.is-urgent { border-left-color: var(--warning); }
.pdreq__main { min-width: 0; display: grid; gap: 3px; }
.pdreq__top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pdreq__part { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; font-size: var(--fs-md); }
.pdreq__part a { font-weight: 650; }
.pdreq__meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: var(--fs-sm); color: var(--ink-3); min-width: 0; }
.pdreq__meta .truncate { max-width: 260px; }
.pdreq__note { font-size: var(--fs-sm); color: var(--ink-2); background: var(--surface-2); border-radius: var(--r-sm); padding: 4px 8px; justify-self: start; }
.pdreq__stock { display: grid; gap: 1px; text-align: right; }
.pdreq__qty { font-size: 20px; font-weight: 750; font-variant-numeric: tabular-nums; line-height: 1.1; }
.pdreq__acts { display: flex; gap: 6px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.pdpick__wo + .pdpick__wo { border-top: 1px solid var(--line); }
.pdpick__head { display: flex; gap: 12px; align-items: baseline; padding: var(--s-3) var(--s-5) 4px; }
.pdpick .table td:first-child, .pdpick .table th:first-child { padding-left: var(--s-5); }
@media (max-width: 760px) {
  .pdreq { grid-template-columns: minmax(0, 1fr) auto; }
  .pdreq__acts { grid-column: 1 / -1; justify-content: flex-start; }
}

/* ---- Physical counts --------------------------------------------------------- */
.cnt__bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: var(--s-3) var(--s-5); border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.cnt__search { display: flex; align-items: center; gap: 6px; flex: 1 1 260px; color: var(--ink-3); }
.cnt__search .input { flex: 1; }
.cnt__in { width: 110px; text-align: right; font-size: var(--fs-md); font-weight: 650; }
.cnt__table tr.cnt--ok td { background: color-mix(in srgb, var(--success-soft) 40%, transparent); }
.cnt__table tr.cnt--off td { background: color-mix(in srgb, var(--warning-soft) 55%, transparent); }
.cntsheet__bars svg { display: block; height: 5mm; width: 32mm; margin-top: 1mm; }
.cntsheet__box { height: 8mm; border: 1px solid #333; border-radius: 2px; }

/* ---- Stock analysis ----------------------------------------------------------- */
.pa__class { display: flex; gap: var(--s-5); flex-wrap: wrap; }
.pa__class > div { display: grid; gap: 2px; }
.pa__class b { font-size: 20px; font-weight: 750; font-variant-numeric: tabular-nums; }
.pa__class span { font-size: var(--fs-sm); color: var(--ink-3); }
.pa__bar { display: flex; align-items: center; gap: var(--s-4); flex-wrap: wrap; padding: var(--s-3) var(--s-5); border-bottom: 1px solid var(--line); }

/* ---- Outside work on the work order ----------------------------------------------- */
.sbcard.is-late { box-shadow: inset 3px 0 0 var(--danger); }
.sbcard__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-5); }
.sbcard__label { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; }
.sbcard__jobs { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.sbcard__jobs small { display: block; color: var(--success-ink, var(--ink-2)); }
.sbmsgs { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.sbmsgs li { background: var(--surface-2); border-radius: var(--r-md); padding: 6px 10px; display: grid; gap: 2px; max-width: 88%; }
.sbmsgs li.is-shop { justify-self: end; background: var(--accent-soft); }
.sbmsgs small { font-size: var(--fs-xs); color: var(--ink-3); }
.sbt { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.sbt__i { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; font-size: var(--fs-sm); }
.sbt__i small { color: var(--ink-3); }
.sbt__i em { display: block; font-style: normal; color: var(--ink-2); }
.sbt__dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-3); }
.sbt__i.is-provider .sbt__dot { background: var(--info-soft); color: var(--info); }
.so__job { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-md); }
.so__job span { display: grid; gap: 2px; }
.so__job small { color: var(--ink-3); }
@media (max-width: 760px) { .sbcard__grid { grid-template-columns: minmax(0, 1fr); } }

.sbprint__jobs { margin: 0 0 2mm; padding-left: 6mm; }
.sbprint__jobs li { margin-bottom: 2mm; }
.sbprint__terms { display: grid; grid-template-columns: minmax(0, 1fr) 42mm; gap: 6mm; align-items: start; }
.sbprint__termlist p { margin: 0 0 1.5mm; }
.sbprint__qr { text-align: center; }
.sbprint__qr svg { width: 38mm; height: 38mm; display: block; margin: 0 auto 1mm; }
.sbprint__qr small { font-size: 7.5pt; color: #444; }

/* ---- The outside-work list ------------------------------------------------------- */
.owatts { display: flex; flex-direction: column; }
.owatt { display: grid; grid-template-columns: minmax(180px, 280px) minmax(0, 1fr) auto; gap: var(--s-4); align-items: center; padding: 10px var(--s-5); border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.owatt:last-child { border-bottom: 0; }
.owatt:hover { background: var(--accent-soft); }
.owatt__why { display: flex; gap: 6px; align-items: center; font-weight: 650; }
.owatt__what { color: var(--ink-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 700px) { .owatt { grid-template-columns: minmax(0, 1fr) auto; } .owatt__what { grid-column: 1; } }

/* ---- The provider's page ------------------------------------------------------------ */
.pv { --pv-max: 1080px; }
.pv__langs { margin-left: auto; display: inline-flex; gap: 2px; background: var(--surface-2); border-radius: 999px; padding: 3px; }
.pv__lang { border: 0; background: transparent; color: var(--ink-3); font: inherit; font-weight: 650; font-size: var(--fs-sm); padding: 4px 10px; border-radius: 999px; cursor: pointer; }
.pv__lang.is-on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.pv__demo { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px var(--pp-gutter, 20px); background: var(--purple-soft); color: var(--purple-ink); font-size: var(--fs-sm); }
.pv__demo a { margin-left: auto; font-weight: 650; }
.pv__main { width: 100%; max-width: var(--pv-max); margin: 0 auto; padding: var(--s-5) var(--pp-gutter, 20px) var(--s-7, 48px); display: grid; gap: var(--s-4); flex: 1 0 auto; }
.pv__foot { display: flex; gap: var(--s-4); flex-wrap: wrap; justify-content: center; padding: var(--s-4); border-top: 1px solid var(--line); font-size: var(--fs-sm); color: var(--ink-3); }
.pv__card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-5); display: grid; gap: var(--s-3); align-content: start; }
.pv__card h2 { margin: 0; font-size: var(--fs-md); display: flex; align-items: center; gap: 8px; }
.pv__center { text-align: center; justify-items: center; padding: 48px var(--s-5); }
.pv__center h1 { margin: 0; font-size: 22px; }
.pv__head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s-4); flex-wrap: wrap; }
.pv__head h1 { margin: 2px 0; font-size: clamp(20px, 3.4vw, 28px); letter-spacing: -.015em; }
.pv__eyebrow { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.pv__sub { color: var(--ink-3); font-size: var(--fs-sm); }
.pv__steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.pv__steps li { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--r-md); background: var(--surface-2); color: var(--ink-3); font-size: var(--fs-sm); font-weight: 600; min-width: 0; }
.pv__steps li span { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); font-size: 12px; }
.pv__steps li.is-done { color: var(--success-ink, var(--ink)); background: var(--success-soft); }
.pv__steps li.is-done span { background: var(--success); color: #fff; }
.pv__steps li.is-on { color: var(--ink); background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent); }
.pv__steps li.is-on span { background: var(--accent); color: var(--accent-ink, #fff); }
.pv__note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-lg); }
.pv__note--purple { background: var(--purple-soft); color: var(--purple-ink); }
.pv__note--ok { background: var(--success-soft); color: var(--success-ink); }
.pv__note--bad { background: var(--danger-soft); color: var(--danger-ink); }
.pv__grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--s-4); align-items: start; }
.pv__col { display: grid; gap: var(--s-4); align-content: start; }
.pv__jobs { margin: 0; padding-left: 20px; display: grid; gap: 10px; }
.pv__jobs p { margin: 2px 0 0; color: var(--ink-2); }
.pv__report { color: var(--success-ink) !important; }
.pv__instr { background: var(--warning-soft); color: var(--warning-ink); border-radius: var(--r-md); padding: 10px 12px; }
.pv__instr span { font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.pv__instr p { margin: 4px 0 0; white-space: pre-wrap; }
.pv__photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.pv__photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r-md); display: block; }
.pv__msgs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pv__msgs li { background: var(--surface-2); border-radius: var(--r-lg); padding: 8px 12px; max-width: 88%; display: grid; gap: 2px; }
.pv__msgs li.is-mine { justify-self: end; background: var(--accent-soft); }
.pv__msgs small { color: var(--ink-3); font-size: var(--fs-xs); }
.pv__send { display: flex; gap: 8px; align-items: flex-end; }
.pv__send .textarea { flex: 1; }
.pv__dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 14px; margin: 0; font-size: var(--fs-sm); }
.pv__dl dt { color: var(--ink-3); }
.pv__dl dd { margin: 0; overflow-wrap: anywhere; }
.pv__acts { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.pv__act { display: flex; gap: 10px; align-items: center; text-align: left; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; min-height: 60px; }
.pv__act span { display: grid; gap: 1px; }
.pv__act small { color: var(--ink-3); font-size: var(--fs-xs); }
.pv__act > svg { color: var(--accent); flex: none; }
.pv__act:hover, .pv__act.is-open { border-color: var(--accent); background: var(--accent-soft); }
.pv__act.is-danger > svg { color: var(--danger); }
.pv__act.is-danger:hover, .pv__act.is-danger.is-open { border-color: var(--danger); background: var(--danger-soft); }
.pv__panel { display: grid; gap: var(--s-3); padding: var(--s-4); border-radius: var(--r-lg); background: var(--surface-2); }
.pv__panel .btn { justify-self: start; }
.pv__row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-3); }
.pv__who .field { display: grid; gap: 4px; }
@media (max-width: 860px) {
  .pv__grid { grid-template-columns: minmax(0, 1fr); }
  .pv__steps { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .pv__steps li { flex-direction: column; text-align: center; font-size: 11px; padding: 6px 2px; gap: 4px; }
}
@media (max-width: 520px) { .pv__row { grid-template-columns: minmax(0, 1fr); } .pv__acts { grid-template-columns: minmax(0, 1fr); } }

/* ==========================================================================
   2.12 — inventory: counts, receiving, performance
   ========================================================================== */
.cnt__table tr.cnt--flag td { background: color-mix(in srgb, var(--danger-soft) 60%, transparent); }
.cnt__decide { gap: 4px; flex-wrap: nowrap; white-space: nowrap; }
.cnt__decide .btn { padding-inline: 8px; }
.sitebreak { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.sitebreak > span { white-space: nowrap; }

.rcv__head { display: grid; grid-template-columns: 1fr auto; gap: var(--s-4); align-items: end; margin-bottom: var(--s-3); }
.rcv__scan { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; max-width: 220px; }
.rcv__table tr.is-short td:first-child { box-shadow: inset 3px 0 0 var(--warning); }
.rcv__table tr.is-hit td { background: color-mix(in srgb, var(--success-soft) 80%, transparent); transition: background .2s; }
.rcv__table input.is-changed { border-color: var(--warning); background: color-mix(in srgb, var(--warning-soft) 60%, var(--surface)); }
@media (max-width: 720px) { .rcv__head { grid-template-columns: 1fr; } }

.pperf__hero { display: flex; gap: var(--s-5); align-items: center; padding: var(--s-5); }
.pperf__score { flex: 0 0 auto; width: 104px; height: 104px; border-radius: 50%; display: grid; place-content: center; text-align: center;
  border: 6px solid var(--border); background: var(--surface-2); }
.pperf__score b { font-size: 28px; line-height: 1; font-weight: 700; color: var(--ink); }
.pperf__score span { font-size: 9.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; margin-top: 4px; max-width: 76px; line-height: 1.2; }
.pperf__score[data-rating="good"] { border-color: var(--success); }
.pperf__score[data-rating="ok"] { border-color: var(--warning); }
.pperf__score[data-rating="bad"] { border-color: var(--danger); }
.pperf__say { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pperf__h { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: var(--s-5) 0 var(--s-3); }

.pkpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--s-3); }
.pkpi { display: flex; flex-direction: column; gap: 6px; padding: var(--s-4); border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border);
  color: inherit; text-decoration: none !important; position: relative; overflow: hidden; transition: transform .12s, box-shadow .12s; }
.pkpi *, .pwatch__i * { text-decoration: none !important; }
.pkpi::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--border); }
.pkpi[data-rating="good"]::before { background: var(--success); }
.pkpi[data-rating="ok"]::before { background: var(--warning); }
.pkpi[data-rating="bad"]::before { background: var(--danger); }
.pkpi:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgb(0 0 0 / .08); }
.pkpi__top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pkpi__label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.pkpi__value { font-size: 30px; font-weight: 700; line-height: 1.1; color: var(--ink); font-variant-numeric: tabular-nums; }
.pkpi__target { font-size: 12px; color: var(--muted); }
.pkpi__why { font-size: 12.5px; color: var(--ink2, var(--muted)); line-height: 1.4; }
.pkpi__bar { display: block; }

.pages { display: flex; flex-direction: column; gap: 10px; }
.page__row { display: grid; grid-template-columns: minmax(120px, 170px) 1fr auto auto; gap: 10px; align-items: center; font-size: 13px; }
.page__track { height: 10px; border-radius: 5px; background: var(--surface-3, var(--surface-2)); overflow: hidden; }
.page__track i { display: block; height: 100%; border-radius: 5px; background: var(--success); }
.page__track i[data-age="slow"] { background: var(--info, var(--accent)); }
.page__track i[data-age="aged"] { background: var(--warning); }
.page__track i[data-age="dead"] { background: var(--danger); }
.page__val { font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 560px) { .page__row { grid-template-columns: 1fr auto; } .page__track { grid-column: 1 / -1; order: 3; } .page__tgt { display: none; } }

.pwatch { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--s-3); }
.pwatch__i { display: flex; gap: 12px; align-items: flex-start; padding: var(--s-4); border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); color: inherit; text-decoration: none; }
a.pwatch__i:hover { border-color: var(--accent); }
.pwatch__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pwatch__label { font-size: 12px; color: var(--muted); font-weight: 600; }
.pwatch__value { font-size: 20px; font-variant-numeric: tabular-nums; }
.pwatch__sub { font-size: 12px; color: var(--muted); }
@media (max-width: 560px) { .pperf__hero { flex-direction: column; align-items: flex-start; } .pkpi__value { font-size: 26px; } }
@media print { .pkpi, .pwatch__i { break-inside: avoid; } }
.phealth { display: flex; flex-direction: column; gap: 10px; }
.phealth__row { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--border); }
.phealth__row:first-child { border-top: 0; padding-top: 0; }
.phealth__n { width: 40px; height: 40px; border-radius: 10px; display: grid; place-content: center; font-weight: 700; background: var(--warning-soft); color: var(--warning-ink); }
.phealth__n[data-key="negative"] { background: var(--danger-soft); color: var(--danger-ink); }
.phealth__txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.phealth__parts { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; margin-top: 2px; }
@media (max-width: 560px) { .phealth__row { grid-template-columns: 40px 1fr; } .phealth__row > .btn { grid-column: 2; justify-self: start; } }

/* 2.14 — « Inventaire prouvé » (views/stock-audit.js) */
.inv-proof{display:flex;gap:16px;align-items:center;flex-wrap:wrap}
.inv-proof__title{font-size:var(--fs-lg);font-weight:650}
.inv-table .num{font-variant-numeric:tabular-nums}
.inv-up{color:var(--success,#15803d)}
.inv-down{color:var(--danger,#b91c1c)}

/* ==========================================================================
   2.14 — the parts room on a phone
   ========================================================================== */

/* The counter's look-up box on its home screen. */
.pdfind { margin-bottom: var(--s-4); }
.pdfind .cspick__results { max-height: 320px; overflow-y: auto; }

/* A parts table on a phone was a sideways scroll: six columns, 390px of glass,
   and the quantity off the right edge. Below 560px the two tables that are
   worked standing up — the count sheet and the receiving modal — stack each row
   as a card, with every cell labelled from its own `data-label`. Rows without
   the attribute still read: the label simply does not print. */
@media (max-width: 560px) {
  .cnt__table, .rcv__table { display: block; }
  .cnt__table thead, .rcv__table thead { display: none; }
  .cnt__table tbody, .rcv__table tbody { display: block; }

  .cnt__table tr, .rcv__table tr {
    display: grid; grid-template-columns: minmax(0, 1fr);
    gap: 2px; padding: var(--s-3) var(--s-4);
    border: 1px solid var(--border); border-radius: var(--r-md);
    margin-bottom: var(--s-3); background: var(--surface);
  }
  .cnt__table td, .rcv__table td {
    display: grid; grid-template-columns: 40% minmax(0, 1fr);
    align-items: center; gap: var(--s-3);
    height: auto; min-height: 44px; padding: 2px 0; border-bottom: 0;
    text-align: left;
  }
  /* The header the row lost, put back in front of each value. */
  .cnt__table td[data-label]::before, .rcv__table td[data-label]::before {
    content: attr(data-label);
    font-size: var(--fs-xs); font-weight: var(--fw-semi);
    text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
  }
  /* The first cell is the part: it is the card's title, full width. */
  .cnt__table td:first-child, .rcv__table td:first-child {
    grid-template-columns: minmax(0, 1fr); padding-bottom: var(--s-2);
  }
  .cnt__table td:first-child::before, .rcv__table td:first-child::before { display: none; }
  /* Inputs go full width: a 96px box in a stacked card is a target nobody hits. */
  .cnt__table .input, .rcv__table .input { width: 100% !important; }
  .cnt__table .cs-qty, .rcv__table .cs-qty { justify-content: flex-start; }
  .cnt__table .td-num, .rcv__table .td-num { text-align: left; }
  /* A label written for a table cell has to be allowed to wrap in a card. */
  .cnt__table .check, .rcv__table .check { white-space: normal; }
  .cnt__table .nowrap, .rcv__table .nowrap { white-space: normal; }
  /* The « 28 pièces · 5 790,40 $ » line above the table, on one 390px line. */
  #receive-form .row-tight { flex-wrap: wrap; }
  /* The left-edge marks become a full border: there is no first cell to mark. */
  .rcv__table tr.is-short td:first-child { box-shadow: none; }
  .rcv__table tr.is-short { border-left: 4px solid var(--warning); }
  .cnt__table tr.cnt--ok td, .cnt__table tr.cnt--off td, .cnt__table tr.cnt--flag td { background: transparent; }
  .cnt__table tr.cnt--ok { border-color: var(--success); }
  .cnt__table tr.cnt--off { border-color: var(--warning); }
  .cnt__table tr.cnt--flag { border-color: var(--danger); }
}

/* =============================================================================
   2.15 — purchase lots (first in, first out)
   The lot bar: one segment per lot on the shelf, oldest on the left, width by
   quantity, colour by age. The leftmost segment is the one the next sale takes.
   ============================================================================= */
.lotbar { display: flex; width: 100%; height: 14px; border-radius: 99px; overflow: hidden; background: var(--surface-3); gap: 2px; }
.lotbar__seg { display: block; height: 100%; min-width: 3px; background: var(--success); position: relative; transition: filter var(--t-fast); }
.lotbar__seg:hover { filter: brightness(1.12); }
.lotbar__seg[data-age="fresh"] { background: var(--success); }
.lotbar__seg[data-age="mid"]   { background: var(--info); }
.lotbar__seg[data-age="old"]   { background: var(--warning); }
.lotbar__seg[data-age="stale"] { background: var(--danger); }
.lotbar__seg[data-age="legacy"] { background: var(--muted); }
.lotbar__seg.is-next { outline: 2px solid var(--ink); outline-offset: -2px; }
.lotbar--sm { height: 8px; gap: 1px; }
.lotlegend { display: flex; flex-wrap: wrap; gap: var(--s-3) var(--s-4); font-size: var(--fs-xs); color: var(--muted); margin-top: var(--s-2); }
.lotlegend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: -1px; margin-right: 5px; }
.lotlegend i[data-age="fresh"] { background: var(--success); }
.lotlegend i[data-age="mid"] { background: var(--info); }
.lotlegend i[data-age="old"] { background: var(--warning); }
.lotlegend i[data-age="stale"] { background: var(--danger); }
.lotlegend i[data-age="legacy"] { background: var(--muted); }

/* The row of the lot that goes out next. */
tr.lot--next td { background: color-mix(in srgb, var(--success) 7%, transparent); }
tr.lot--next td:first-child { box-shadow: inset 3px 0 0 var(--success); }

/* The price-basis table on the part page: the basis in force is highlighted. */
.basis { display: grid; grid-template-columns: 1fr auto auto; gap: 2px var(--s-3); align-items: center; }
.basis__row { display: contents; }
.basis__row > span { padding: 6px 8px; border-radius: var(--r-sm); font-size: var(--fs-sm); }
.basis__row > span:first-child { border-radius: var(--r-sm) 0 0 var(--r-sm); }
.basis__row > span:last-child { border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.basis__row.is-on > span { background: var(--accent-soft); color: var(--accent-ink-on-soft); font-weight: var(--fw-semi); }
.basis__row .num { text-align: right; font-variant-numeric: tabular-nums; }
.basis__hint { font-size: var(--fs-xs); color: var(--muted); margin-top: var(--s-2); }

/* 2.15 — small type helper used by the pricing and advisor screens. */
.t-upper { text-transform: uppercase; letter-spacing: .06em; font-weight: var(--fw-semi); }

/* 2.15 — paid · charged · internet: three tiles with arrows between them. */
.pricing3 { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; gap: var(--s-2); align-items: stretch; }
.pricing3__tile { border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--s-3) var(--s-4); background: var(--surface); min-width: 0; }
.pricing3__tile.is-sell { border-color: var(--accent); background: var(--accent-soft); }
.pricing3__tile.is-above { border-color: var(--success); }
.pricing3__tile.is-below { border-color: var(--warning); }
.pricing3__tile.is-empty { border-style: dashed; }
.pricing3__l { font-size: var(--fs-xs); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: var(--fw-semi); }
.pricing3__v { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 2px; }
.pricing3__s { font-size: var(--fs-xs); color: var(--muted); margin-top: 4px; overflow-wrap: anywhere; }
.pricing3__arrow { display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); font-size: var(--fs-xs); gap: 2px; padding: 0 2px; }
.basis--5 { grid-template-columns: 1fr auto auto auto auto; }
.basis__head > span { font-size: var(--fs-xs); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: var(--fw-semi); padding-bottom: 2px; }
@media (max-width: 620px) {
  .pricing3 { grid-template-columns: 1fr; }
  .pricing3__arrow { flex-direction: row; justify-content: flex-start; padding: 0 var(--s-2); }
  .basis--5 { grid-template-columns: 1fr auto auto; }
  .basis--5 .basis__row > span:nth-child(4), .basis--5 .basis__row > span:nth-child(5) { display: none; }
}

/* 2.15 — the parts dashboard's « coming in » calendar: one row per day. */
.pdday { display: grid; grid-template-columns: 96px 1fr; gap: var(--s-3); padding: 8px var(--s-4); border-bottom: 1px solid var(--border); align-items: start; }
.pdday:last-child { border-bottom: 0; }
.pdday.is-empty { color: var(--muted); padding-top: 5px; padding-bottom: 5px; }
.pdday.is-today { background: var(--accent-soft); }
.pdday--late { background: var(--danger-soft); }
.pdday__d { display: flex; flex-direction: column; font-size: var(--fs-sm); }
.pdday__list { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pdday__po { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: var(--fs-sm); color: inherit; text-decoration: none; padding: 4px 8px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--border); }
.pdday__po:hover { border-color: var(--accent); }

/* 2.15.1 — the supplier's confirmation page */
.so-table td { vertical-align: top; }
.so-table tr.is-done td { opacity: .55; }
.so-table .input, .so-table .select { min-height: 34px; }
.so-table .select { min-width: 170px; }
@media (max-width: 760px) {
  .so-table thead { display: none; }
  .so-table, .so-table tbody, .so-table tr, .so-table td { display: block; width: 100%; }
  .so-table tr { border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--s-3); margin-bottom: var(--s-3); }
  .so-table td { padding: 4px 0 !important; text-align: left !important; }
  .so-table .input, .so-table .select { width: 100% !important; }
}

/* 2.15.2 — the parts department report, on screen and on paper */
.report__brief { border-left: 4px solid var(--accent); }
@media print {
  .report .pagehead__actions, .report .no-print { display: none !important; }
  .report .grid { break-inside: avoid; }
  .report .card { break-inside: avoid; box-shadow: none; border: 1px solid #bbb; }
  .report .kpi { border: 1px solid #bbb; }
}
