/* ===== v493 — STOCK refait (frontend/stock.js) ==============================
   Design « salle de contrôle » (design.css) : jetons seulement, angles de 0 à
   3 px, filets de 1 px, chiffres tabulaires. Une carte par pièce : la photo
   en haut (carré), la quantité en gros chiffres, une pièce à 0 atténuée. */

#pcNew { white-space: nowrap; }

.pc-tot { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: baseline;
  padding: 8px 0 10px; margin-bottom: 10px; border-bottom: 1px solid var(--sep);
  color: var(--txt2); font-size: 13px; }
.pc-tot b { font-family: var(--f-num); font-size: 16px; font-weight: 600; color: var(--txt); }

/* ---- grille de cartes ---- */
.pc-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 10px; }
.pc-carte { position: relative; display: flex; flex-direction: column; align-items: stretch;
  min-width: 0; padding: 0; margin: 0; overflow: hidden; text-align: left; cursor: pointer;
  font: inherit; color: var(--txt); background: var(--card);
  border: 1px solid var(--sep); border-radius: 2px; box-shadow: none; }
.pc-carte:hover { border-color: var(--txt3); }
.pc-carte:focus-visible { outline: 2px solid var(--amber); outline-offset: 1px; }
.pc-carte.vide { opacity: .55; }
.pc-carte.vide .pc-img img { filter: grayscale(1); }
.pc-carte.vide .pc-q { color: var(--txt3); }

.pc-img { display: block; position: relative; width: 100%; aspect-ratio: 1 / 1;
  background: var(--fill); border-bottom: 1px solid var(--sep); overflow: hidden; }
.pc-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pc-noimg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--txt3); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }

.pc-q { font-family: var(--f-num); font-weight: 600; font-variant-numeric: tabular-nums;
  line-height: 1; color: var(--txt); }
.pc-carte .pc-q { position: absolute; top: 6px; right: 6px; min-width: 34px; padding: 4px 8px;
  text-align: center; font-size: 22px; background: var(--card);
  border: 1px solid var(--sep); border-radius: 2px; }

.pc-t { display: flex; flex-direction: column; gap: 3px; padding: 8px 10px 10px; min-width: 0; }
.pc-t b { font-size: 14px; font-weight: 600; line-height: 1.25; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pc-t small { font-size: 12px; color: var(--txt2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-t small.mono { font-family: var(--f-num); color: var(--txt); }

/* ---- fiche d'une pièce ---- */
.pc-tete { display: flex; align-items: center; gap: 14px; padding: 10px 12px; margin-bottom: 10px;
  background: var(--fill-3); border: 1px solid var(--sep); border-radius: 2px; }
.pc-tete .pc-q { font-size: 40px; min-width: 52px; }
.pc-tete small, .pc-prix small { display: block; margin-top: 2px; font-size: 12px; color: var(--txt2); }
.pc-prix { text-align: right; }
.pc-prix b { font-family: var(--f-num); font-size: 18px; font-weight: 600; color: var(--txt); }

.pc-det { margin: 0 0 10px; padding: 6px 10px; border: 1px solid var(--sep); border-radius: 2px; }
.pc-det summary { cursor: pointer; font-size: 13px; color: var(--txt2); }
.pc-fl { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 5px 0;
  border-top: 1px solid var(--sep-2); font-size: 12px; }
.pc-fl b { font-family: var(--f-num); }

.pc-mvt { margin: 0 0 12px; padding: 10px 12px; border: 1px solid var(--sep);
  border-left: 3px solid var(--amber); border-radius: 2px; }

.pc-photo-in { display: block; margin: 6px 0 10px; padding: 8px 10px; font-size: 13px; font-weight: 600;
  border: 1px dashed var(--txt3); border-radius: 2px; color: var(--txt); }
.pc-photo-in input[type="file"] { display: block; width: 100%; margin: 6px 0 4px; font: inherit; font-weight: 400; }
.pc-photo-in .t2, .frm .pc-photo-in .t2 { display: block; font-family: var(--f-txt); font-size: 12px;
  font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--txt2); }
.pc-mvt.frm { margin-top: 0; }
.sheet .pc-actions { flex-wrap: wrap; }

.pc-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; margin-bottom: 12px; }
.pc-ph { display: flex; flex-direction: column; min-width: 0; overflow: hidden; text-decoration: none;
  color: var(--txt2); background: var(--card); border: 1px solid var(--sep); border-radius: 2px; }
.pc-ph img { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: var(--fill); }
.pc-ph small { padding: 4px 6px; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-ph-add { align-items: center; justify-content: center; aspect-ratio: 1 / 1; cursor: pointer;
  font-weight: 600; color: var(--txt2); border-style: dashed; border-color: var(--txt3); }
.pc-ph-add:hover { color: var(--txt); border-color: var(--txt); }

.pc-hist { margin-bottom: 12px; border-top: 1px solid var(--sep); }
.pc-hist > div { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 7px 0;
  border-bottom: 1px solid var(--sep-2); font-size: 13px; }
.pc-hist b { font-family: var(--f-num); min-width: 36px; }
.pc-hist .t2 { font-size: 12px; color: var(--txt3); }

/* ---- téléphone ---- */
@media (max-width: 480px) {
  .pc-grille { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .pc-carte .pc-q { font-size: 18px; min-width: 28px; padding: 3px 6px; }
  .pc-t { padding: 7px 8px 8px; }
  .pc-t b { font-size: 13px; }
  .pc-tete { flex-wrap: wrap; gap: 10px; }
  .pc-tete .pc-q { font-size: 32px; }
  .pc-prix { text-align: left; flex-basis: 100%; }
  .pc-photos { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sheet .pc-actions { gap: 8px; }
  .sheet .pc-actions .btn { flex: 1 1 40%; padding: 12px 8px; font-size: 15px; }
}

/* ===== v528 — Stock refait (MODULES_CONTRAT, Stock) : jetons de design.css seulement ===== */
.pc-phrase { margin: 0 0 12px; color: var(--encre-2); font-size: 15px; }
.pc-barre { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.pc-barre #pcEtats { flex: 1 1 auto; min-width: 0; }
.pc-barre #pcEtats .p2 { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.pc-cat-btn { flex: none; min-height: 40px; }
.pc-vue button { min-height: 32px; padding: 0 12px; }
.pc-sans { display: grid; place-items: center; background: var(--actif); color: var(--encre-3); }
.pc-sans svg.i { width: 18px; height: 18px; }
/* tableau dense (PC) */
.pc-tab { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--trait); border-radius: var(--r); overflow: hidden; }
.pc-tab th { font-size: 12.5px; font-weight: 500; color: var(--encre-2); text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--trait); }
.pc-tab td { padding: 6px 12px; border-bottom: 1px solid var(--trait); font-size: 14.5px; vertical-align: middle; }
.pc-tab th.r, .pc-tab td.r { text-align: right; }
.pc-tab tbody tr { cursor: pointer; }
.pc-tab tbody tr:last-child td { border-bottom: 0; }
.pc-tab tbody tr:focus-visible { outline: 2px solid var(--bleu); outline-offset: -2px; }
.pc-tab tr.vide { opacity: .5; }
.pc-tab tr.vide .pc-vig { filter: grayscale(1); }
.pc-tab .c-img { width: 60px; }
.pc-vig { display: block; width: 48px; height: 48px; border-radius: var(--r-s); object-fit: cover; }
.pc-tab .c-nom b { display: block; font-weight: 600; }
.pc-tab .c-nom small { display: block; color: var(--encre-2); font-size: 12.5px; }
.pc-tab .c-q { font-size: 17px; font-weight: 700; }
.pc-tab .c-prix { white-space: nowrap; color: var(--encre-2); }
.pc-etat { font-size: 12px; padding: 2px 8px; }
.pc-empl-tel { display: none; }
.pc-etat.e-neuf { background: var(--vert-pale); color: var(--vert); }
.pc-etat.e-defectueux { background: var(--rouge-pale); color: var(--rouge); }
.pc-etat.e-a_tester, .pc-etat.e-en_test { background: var(--orange-pale); color: var(--orange); }
@media (hover: hover) and (pointer: fine) { .pc-tab tbody tr:hover { background: var(--surface-2); } }
/* téléphone : lignes à 2–3 étages, vignette 56 px — « RTX 4070 Super ……… 2 » / « Neuf · B2 » / « 629 CHF » */
@media (max-width: 820px) {
  .pc-vue { display: none; }
  .pc-tab, .pc-tab tbody, .pc-tab tr, .pc-tab td { display: block; }
  .pc-tab thead { display: none; }
  .pc-tab tbody tr { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 2px 12px; padding: 8px 14px;
    border-bottom: 1px solid var(--trait); grid-template-areas: "img nom q" "img etat q" "img prix q"; align-items: center; }
  .pc-tab td { padding: 0; border: 0; }
  .pc-tab .c-img { grid-area: img; width: auto; }
  .pc-tab .pc-vig { width: 56px; height: 56px; }
  .pc-tab .c-nom { grid-area: nom; min-width: 0; }
  .pc-tab .c-nom b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .pc-tab .c-nom small, .pc-tab .c-cat { display: none; }
  .pc-tab .c-etat { grid-area: etat; display: flex; gap: 6px; align-items: center; min-width: 0; font-size: 13.5px; }
  .pc-tab .c-empl { display: none; }
  .pc-empl-tel { display: inline !important; color: var(--encre-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .pc-tab .c-q { grid-area: q; font-size: 20px; }
  .pc-tab .c-prix { grid-area: prix; text-align: left; font-size: 13px; }
}
/* fiche (P6) */
.pc-ent { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 14px; align-items: center; margin-bottom: 14px; }
.pc-ent-ph { width: 72px; height: 72px; border-radius: var(--r); object-fit: cover; }
.pc-ent-t { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pc-ent-t b { font-size: 17px; line-height: 1.25; }
.pc-ent-t small { color: var(--encre-2); font-size: 12.5px; }
.pc-ent-q { text-align: center; }
.pc-ent-q b { display: block; font-size: 36px; font-weight: 700; line-height: 1; }
.pc-ent-q small { color: var(--encre-2); font-size: 12px; }
.pc-suite { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pc-suite .btn { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.pc-suite .btn svg.i { width: 18px; height: 18px; }
.pc-aide { margin: 6px 0 4px; font-size: 13px; color: var(--encre-2); }
.pc-prix-l b { font-size: 18px; font-weight: 700; }
.pc-prix-l small { display: block; color: var(--encre-2); font-size: 12.5px; }
.pc-ph-add { gap: 6px; }
.pc-ph-add svg.i { width: 22px; height: 22px; }
.pc-hist > div { align-items: center; }
.pc-hist-ph { width: 32px; height: 32px; border-radius: var(--r-s); object-fit: cover; flex: none; }
.pc-sens { font-size: 12px; padding: 2px 8px; }
.pc-sens.s-sortie { background: var(--actif); color: var(--encre); }
.pc-sens.s-entree, .pc-sens.s-creation { background: var(--vert-pale); color: var(--vert); }
.pc-sens.s-correction { background: var(--bleu-pale); color: var(--bleu); }
.pc-grille-act { margin-top: 14px; }
.pc-inv { display: flex; align-items: center; gap: 14px; margin: 14px 0; }
.pc-inv .step { display: flex; align-items: center; border: 1px solid var(--trait-fort); border-radius: var(--r-s); }
.pc-inv .step button { width: 44px; height: 44px; border: 0; background: none; color: var(--encre); font-size: 20px; cursor: pointer; }
.pc-inv .step span { min-width: 48px; text-align: center; font-weight: 700; font-size: 18px; font-variant-numeric: tabular-nums; }
.pc-photo-champ { margin: 6px 0 10px; }
.pc-photo-champ .lab { font-size: 13.5px; font-weight: 600; }
.pc-photo-champ .oblig { color: var(--rouge); }
/* fiche ouverte en panneau : le tableau garde l'essentiel ; noms sur une ligne */
.pc-tab .c-nom b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 360px; }
body.avec-panneau .pc-tab th:nth-child(3), body.avec-panneau .pc-tab .c-cat { display: none; }
body.avec-panneau .pc-tab .c-nom b { max-width: 200px; }
body.avec-panneau .pc-tab th, body.avec-panneau .pc-tab td { padding-left: 8px; padding-right: 8px; }
/* téléphone : UNE rangée — « Catégorie ▾ » en tête, les états défilent à côté */
@media (max-width: 820px) {
  .pc-barre { flex-wrap: nowrap; gap: 8px; }
  .pc-cat-btn { order: -1; min-height: 40px; padding: 0 10px; }
  .pc-tab .c-nom b { max-width: none; }
}
body.avec-panneau .pc-tab th:nth-child(5), body.avec-panneau .pc-tab .c-empl { display: none; }
body.avec-panneau .pc-empl-tel { display: inline; margin-left: 6px; color: var(--encre-2); }
body.avec-panneau .pc-tab .c-prix { font-size: 13px; }
