/* Inventaire 7G — nouvelle interface (02/10/2026) : styles PROPRES à l'Inventaire.
   Tout le commun (couleurs, police, en-tête, connexion, boutons, champs, pastilles, fenêtres, toast) est dans 7g-commun.css,
   chargé avant ce fichier. Ici : « À traiter », maître-détail, fiche, +/− géants, barre du bas du téléphone. */

#app { min-height: 100dvh; display: flex; flex-direction: column; }
.ref { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 12px; color: var(--muted); }

/* recherche de l'en-tête */
.cherche { flex: 1; min-width: 0; position: relative; display: flex; align-items: center; max-width: 560px; }
.cherche .ic { position: absolute; left: 12px; color: var(--muted); }
.cherche input { padding-left: 38px; padding-right: 36px; background: var(--surface2); }
.cherche kbd { position: absolute; right: 10px; font: 500 11px var(--mono); color: var(--muted); border: 1px solid var(--line-2); border-radius: 5px; padding: 1px 6px; }
.menu-moi { position: absolute; right: 16px; top: 58px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 8px; display: grid; min-width: 220px; }
.menu-moi p { margin: 4px 8px 8px; font-size: 12.5px; color: var(--muted); }
.menu-moi a, .menu-moi button { text-align: left; padding: 9px 10px; border-radius: 8px; border: 0; background: none; cursor: pointer; text-decoration: none; color: var(--ink); }
.menu-moi a:hover, .menu-moi button:hover { background: var(--surface2); }

main { flex: 1; min-height: 0; width: 100%; max-width: 1500px; margin: 0 auto; padding: 16px; }
main:focus { outline: none; }
.barre-bas { display: none; }
/* bandeau « Inventaire annuel en cours » (12/10/2026) */
.bandeau-annuel { display: flex; align-items: center; gap: 10px; margin: 12px auto 0; width: calc(100% - 32px); max-width: 1468px; padding: 10px 14px; border-radius: 12px; background: var(--orange-doux); color: var(--ink); text-decoration: none; border: 1px solid var(--orange); }
.bandeau-annuel > span:nth-child(2) { flex: 1; min-width: 0; }

/* « À traiter » */
.compteurs { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 16px; }
.compteur { display: grid; gap: 4px; text-align: left; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; box-shadow: var(--shadow-sm); color: var(--ink); }
.compteur b { font: 500 30px/1 var(--mono); }
.compteur span { font-size: 13px; color: var(--ink-soft); }
.compteur.rup b { color: var(--rouge); } .compteur.bas b { color: var(--orange); }
.compteur[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-doux); }
.bloc { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-bottom: 16px; }
.bloc > h2 { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; }
.ligne-action { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.ligne-action:last-child { border-bottom: 0; }
.ligne-action .quoi { flex: 1; min-width: 200px; display: grid; }
.ligne-action .quoi b { font-weight: 500; }

/* Stock : familles | liste | fiche */
.md { display: grid; grid-template-columns: 220px minmax(0, 1fr) minmax(320px, 400px); height: calc(100dvh - 92px); min-height: 480px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.familles { border-right: 1px solid var(--line); overflow: auto; padding: 8px; background: var(--surface2); }
.familles h2 { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 10px 8px 6px; font-weight: 600; }
.familles button { width: 100%; display: flex; justify-content: space-between; gap: 8px; padding: 7px 9px; border-radius: 8px; border: 0; background: none; cursor: pointer; text-align: left; color: var(--ink-soft); }
.familles button:hover { background: var(--surface); }
.familles button[aria-pressed="true"] { background: var(--accent-doux); color: var(--ink); font-weight: 500; }
.familles button span:last-child { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.liste { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.liste .filtres { display: flex; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; align-items: center; }
.liste .filtres select { width: auto; min-height: 30px; padding: 4px 8px; font-size: 12.5px; }
.liste .filtres .compte { margin-left: auto; color: var(--muted); font-size: 12.5px; }
.puce-f { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); font-size: 12.5px; cursor: pointer; color: var(--ink-soft); }
.puce-f[aria-pressed="true"] { background: #0C3D63; border-color: #0C3D63; color: #fff; }
.articles { overflow: auto; flex: 1; min-height: 0; }
.art { display: grid; grid-template-columns: 9px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 9px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.art:hover { background: var(--surface2); }
.art[aria-selected="true"] { background: var(--accent-doux); }
.art .t { min-width: 0; display: grid; }
.art .t b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.art .t span { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.art .q { text-align: right; font-family: var(--mono); font-weight: 500; }
.art .q small { display: block; font-weight: 400; color: var(--muted); font-size: 11px; }
.fiche { border-left: 1px solid var(--line); overflow: auto; padding: 18px; display: grid; gap: 14px; align-content: start; }
.fiche h2 { margin: 0; font-size: 17px; font-weight: 600; text-wrap: balance; }
.grand-q { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.grand-q b { font: 500 40px/1 var(--mono); }
.infos { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: 13px; margin: 0; }
.infos dt { color: var(--muted); } .infos dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.courbe svg { width: 100%; height: 90px; display: block; }
.courbe small { color: var(--muted); font-size: 12px; }
.histo { display: grid; font-size: 12.5px; }
.histo div { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.histo div span:first-child { color: var(--muted); font-family: var(--mono); font-size: 11.5px; }
.qr-mini { width: 120px; height: 120px; border-radius: 10px; background: #fff; padding: 6px; border: 1px solid var(--line); }
.sous-titre { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; margin: 0 0 4px; }
.retour-liste { display: none; }

/* +/− */
.ajuste { display: grid; grid-template-columns: 64px minmax(0, 1fr) 64px; gap: 8px; align-items: center; }
.ajuste button { height: 64px; border-radius: 16px; font-size: 28px; font-weight: 500; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; color: var(--ink); }
.ajuste input { height: 64px; text-align: center; font: 500 28px var(--mono); border-radius: 16px; }
.video-scan { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 16px; background: #0B1622; max-width: 100%; }

/* écran moyen : la fiche s'ouvre à la place d'une partie de la liste */
@media (max-width: 1150px) {
  .md { grid-template-columns: 200px minmax(0, 1fr); } .md .fiche { display: none; }
  .md.fiche-ouverte { grid-template-columns: 200px minmax(0, 1fr) minmax(300px, 360px); } .md.fiche-ouverte .fiche { display: grid; }
}
@media (max-width: 1000px) { .entete .cherche { max-width: none; } }

/* téléphone : liste puis fiche, barre du bas avec le scan au centre */
@media (max-width: 700px) {
  .entete { flex-wrap: wrap; gap: 8px; padding-inline: 12px; }
  .entete .onglets, #btn-scan, .entete .espace { display: none; }
  .cherche { order: 3; flex-basis: 100%; max-width: none; }
  .cherche kbd { display: none; }
  .cherche input { padding-right: 12px; }
  .marque { flex: 1; }
  .menu-moi { right: 12px; }
  main { padding: 12px 12px calc(96px + env(safe-area-inset-bottom)); }
  .barre-bas { display: grid; grid-template-columns: repeat(5, 1fr); align-items: end; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
  .barre-bas a { display: grid; justify-items: center; gap: 3px; font-size: 11px; color: var(--ink-soft); text-decoration: none; padding: 6px 0; }
  .barre-bas a .ic { width: 22px; height: 22px; }
  .barre-bas a[aria-current="page"] { color: var(--accent); font-weight: 600; }
  .scan-rond { justify-self: center; width: 64px; height: 64px; margin-top: -26px; border-radius: 50%; border: 4px solid var(--bg); background: #0C3D63; color: #fff; display: grid; place-items: center; box-shadow: var(--shadow-lg); cursor: pointer; }
  .scan-rond .ic { width: 28px; height: 28px; }
  html.dans-logiciel .toast { bottom: 100px; }
  .toast { bottom: calc(96px + env(safe-area-inset-bottom)); }
  .md { display: block; height: auto; border: 0; background: none; }
  .familles { display: flex; gap: 6px; overflow-x: auto; border: 0; padding: 0 0 8px; background: none; }
  .familles h2 { display: none; }
  .familles button { width: auto; flex: none; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); white-space: nowrap; }
  .liste { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
  .articles { overflow: visible; }
  .md .fiche, .md.fiche-ouverte .fiche { display: none; }
  .md.fiche-ouverte .liste, .md.fiche-ouverte .familles { display: none; }
  .md.fiche-ouverte .fiche { display: grid; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
  .retour-liste { display: inline-flex; justify-self: start; }
  .art { padding: 12px 14px; }
  .fiche .actions .btn { flex: 1 1 140px; min-height: 52px; font-size: 15px; }
  .compteurs { grid-template-columns: 1fr 1fr; }
}
