/* Page Stock (public/stock.js) */
.stk-onglets{flex-wrap:nowrap}
/* Titre du panneau « Niveaux de stock » avec la même marge intérieure que les autres panneaux */
.content .stk-h{padding:12px 16px 0;margin-bottom:10px}
.stk-mv{table-layout:fixed;width:100%}
.stk-mv th.mv-q{width:140px} .stk-mv th.mv-m{width:170px} .stk-mv th.mv-v{width:96px} .stk-mv th.mv-n{width:150px} .stk-mv th.mv-p{width:96px}
.stk-mv td{white-space:nowrap}
.stk-mv .produit-nom{min-width:0}
.stk-mv .produit-nom>div{min-width:0;overflow:hidden}
.stk-mv .produit-nom b{display:block;overflow:hidden;text-overflow:ellipsis}
.stk-kpis{grid-template-columns:repeat(4,minmax(0,1fr))}
@media (max-width:1000px) and (min-width:761px){.stk-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}}
.stk-h{flex-wrap:wrap;gap:var(--esp-2)}
.stk-h .row{flex-wrap:wrap}
.stk-h input[type=search]{width:220px;flex:none}
.stk-table td{vertical-align:middle}

.stk-min{width:76px;text-align:right;padding:5px 8px;font-variant-numeric:tabular-nums}
.stk-var{font-weight:var(--g-fort);white-space:nowrap}
.stk-var.plus{color:var(--ok)} .stk-var.moins{color:var(--bad)}
.stk-pied{justify-content:space-between;flex-wrap:wrap}
.stk-filtres{flex-wrap:wrap}
.stk-filtres label{display:inline-flex;align-items:center;gap:6px}
.nowrap{white-space:nowrap}
@media (max-width:760px){.stk-kpis{grid-template-columns:minmax(0,1fr)}.stk-h input[type=search]{min-width:0;flex:1}}

/* ======================= Téléphone (Z Fold fermé 344 px → Z Fold ouvert 690 px) =======================
   Les tableaux deviennent des cartes (règles communes « table.ct » dans gestion.css). Rien ne change sur PC. */
.content .stk-tel{display:none!important}
@media (max-width:760px){
  .content table.ct .vignette.stk-tel{display:inline-flex!important;flex:none}
  .content table.ct span.stk-tel{display:inline!important;margin-left:auto;flex:none}
  .content table.ct td.ct-t b{min-width:0;overflow-wrap:anywhere}
  /* Onglets sur deux lignes au besoin, jamais de défilement de côté */
  .content .head .stk-onglets{flex-wrap:wrap;width:100%;max-width:100%}
  .content .head .stk-onglets button{flex:1 1 auto;min-height:38px}
  .content .head:has(.stk-onglets)>.row{width:100%;flex-wrap:wrap}
  /* Niveaux : recherche + niveau sur une ligne, Exporter dessous */
  .content .stk-h{padding:12px 12px 0}
  .content .stk-h>.row{width:100%;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px}
  .content .stk-h>.row>input[type=search]{width:auto;min-width:0;grid-column:1/-1}
  .content .stk-h>.row>select.inp{width:100%!important;min-width:0}
  .content .stk-h>.row>.btn{min-height:40px;justify-content:center}
  .content table.stk-table .stk-min{width:100%;max-width:120px;text-align:left}
  /* Mouvements / Historique : filtres à la largeur de l'écran */
  .content #stkCorps>.row>select.inp,.content .stk-filtres>select.inp{width:100%!important;flex:1 1 100%}
  .content .stk-filtres label{flex:1 1 140px;min-width:0}
  .content .stk-filtres label input{flex:1;min-width:0;width:100%!important}
  .content table.stk-mv .produit-nom{display:flex;align-items:center;gap:10px}
  /* Inventaire : boutons pleine largeur, faciles à toucher */
  .content #stkCorps>.panel>.row>.btn{flex:1 1 100%;justify-content:center;min-height:40px}
  .content #stkCorps>.panel>.row>input{min-width:0!important;flex:1 1 100%!important}
  .content .stk-pied>.btn{flex:1 1 100%;justify-content:center;min-height:42px}
  .content .stk-aj{grid-template-columns:minmax(0,1fr)}
  .content form[data-form="stockAjust"] .row>.btn{flex:1;justify-content:center;min-height:42px}
}
@media (min-width:480px) and (max-width:760px){
  .content .stk-h>.row{grid-template-columns:minmax(0,1.3fr) minmax(0,1fr) auto}
  .content .stk-h>.row>input[type=search]{grid-column:auto}
  .content .stk-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
}
/* Mouvements et historique : variation en grand à droite du produit ; date, motif, auteur sur une ligne */
@media (max-width:760px){
  .content table.ct:is(.stk-mv,.stk-hist)>tbody>tr{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px 10px}
  .content table.ct:is(.stk-mv,.stk-hist) td.ct-t{grid-column:1/3}
  .content table.ct:is(.stk-mv,.stk-hist) td[data-l=Variation]{order:-1;grid-column:3;align-items:flex-end;justify-content:center;font-size:1.15rem;padding-bottom:6px;border-bottom:1px solid var(--line)}
  .content table.ct:is(.stk-mv,.stk-hist) td[data-l=Variation]::before{display:none}
  .content table.ct:is(.stk-mv,.stk-hist) td.ct-p{grid-column:1/-1}
  .content table.ct:is(.stk-mv,.stk-hist) td.small.nowrap{white-space:normal}
}
@media (max-width:760px){
  .content table.ct:is(.stk-mv,.stk-hist) td.ct-p{order:1}
  /* Niveaux et inventaire : trois colonnes (Stock · Min · Statut / Système · Compté · Écart) */
  .content table.ct.stk-table>tbody>tr{grid-template-columns:repeat(3,minmax(0,1fr))}
  .content table.ct.stk-table .stk-min{max-width:100%}
}
.us-annule td{opacity:.55;text-decoration:line-through}.us-annule td:last-child{text-decoration:none}
/* Usage du garage : tous les champs sur une ligne (PC), les uns sous les autres (téléphone) */
.us-grille{display:grid;grid-template-columns:minmax(0,2fr) 70px minmax(170px,1.3fr) 150px minmax(0,1.5fr) auto;gap:var(--esp-2);align-items:end}
.us-grille .field span.xs{position:absolute}
.us-grille .field{position:relative}
@media (max-width:900px){.us-grille{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}.us-grille .field:first-child,.us-grille>.btn{grid-column:1/-1}.us-grille .field span.xs{position:static}}
