.page_inventaire {
  width: 100%;
}

/* Pleine largeur utile (les côtés étaient inutilisés en 50 %) */
#id_inventaire {
  width: auto;
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 16px;
}

/* === Boutons === */
.page_inventaire button {
  border: none;
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 10pt;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  vertical-align: middle;
  background-color: #f0f2f5;
  color: #333;
}

.page_inventaire button:hover {
  background-color: #e0e3e8;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

.page_inventaire button:active {
  transform: translateY(0);
  box-shadow: none;
}

/* === Header === */
.header-inventaire {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: linear-gradient(135deg, #f8f9fb 0%, #eef0f4 100%);
  border-bottom: 2px solid #dde0e6;
}

.hi-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.hi-title h1 {
  margin: 0;
  font-size: 15pt;
  font-weight: 700;
  color: #333;
}
.hi-title-icon {
  font-size: 14pt;
  color: var(--main-bg-color);
}

.hi-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hi-btn-refresh {
  background: var(--main-bg-color) !important;
  color: white !important;
  font-weight: 600;
  padding: 8px 18px !important;
  border-radius: 8px !important;
}
.hi-btn-refresh:hover {
  filter: brightness(1.1);
}

/* === Sections === */
.hi-section {
  padding: 12px 16px;
  border-bottom: 1px solid #eee;
  margin-bottom: 10px;
}

.hi-section-title {
  font-size: 9pt;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.hi-section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 8px;
}

.hi-section-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.hi-close-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* === Inventaire lists === */
.hi-inventaire-lists {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.hi-inventaire-list-block {
  flex: 1;
  min-width: 200px;
}

.hi-list-label {
  font-size: 10pt;
  font-weight: 600;
  color: #555;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.hi-icon-open {
  color: var(--main-bg-color);
}
.hi-icon-closed {
  color: #999;
}

.hi-link {
  cursor: pointer;
}
.hi-link:hover {
  color: var(--main-bg-color);
}

.hi-list-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.hi-list-item {
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 9pt;
  font-weight: 500;
  border: 1px solid #ddd;
  background: white;
  color: #555;
  cursor: pointer;
  transition: all 0.15s ease;
}
.hi-list-item:hover {
  border-color: var(--main-bg-color);
  color: var(--main-bg-color);
}
.hi-list-item-active {
  background: var(--main-bg-color);
  color: white;
  border-color: var(--main-bg-color);
}

.hi-list-empty {
  font-size: 9pt;
  color: #aaa;
  font-style: italic;
}

/* === Champs === */
.hi-field-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.hi-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
}
.hi-field-grow {
  flex: 1;
  min-width: 200px;
}

.hi-label {
  font-size: 9pt;
  font-weight: 500;
  color: #777;
}

.hi-input {
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 10pt;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
  box-sizing: border-box;
}
.hi-input:focus {
  border-color: var(--main-bg-color);
}
.hi-input-small {
  width: 80px;
}

.hi-product-search {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hi-select-product {
  min-width: 300px;
  width: 100%;
  max-width: 100%;
  vertical-align: middle;
  display: inline-block;
}
.hi-product-search {
  width: 100%;
}
.hi-select-small {
  width: 180px;
  vertical-align: middle;
  display: inline-block;
}

.hi-product-img {
  max-width: 50px;
  max-height: 50px;
  border-radius: 6px;
  border: 1px solid #eee;
  object-fit: contain;
}

/* === Boutons spéciaux === */
.hi-btn-add {
  background: var(--main-bg-color) !important;
  color: white !important;
  font-weight: 600;
}
.hi-btn-add:hover {
  filter: brightness(1.1);
}

.hi-btn-close {
  background: #e65100 !important;
  color: white !important;
  font-weight: 600;
}
.hi-btn-close:hover {
  filter: brightness(1.1);
}

.hi-btn-danger {
  background: #c62828 !important;
  color: white !important;
  font-weight: 600;
  padding: 10px 20px !important;
}
.hi-btn-danger:hover {
  filter: brightness(1.1);
}
.hi-btn-danger[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  filter: none !important;
}

/* === Détail comptable d'un produit (popup) === */
.hi-btn-compta {
  padding: 4px 8px !important;
  font-size: 9pt !important;
  background: #eef3fa !important;
  color: #1565c0 !important;
}
.hi-btn-compta:hover {
  background: #1565c0 !important;
  color: #fff !important;
}

.hi-modal-compta {
  min-width: 85%;
}
.hi-modal-compta .modal-body {
  max-height: 72vh;
  overflow-y: auto;
}

.hi-compta-filter {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 8px 10px;
  background: #f8f9fb;
  border: 1px solid #e5e8ee;
  border-radius: 8px;
}
.hi-compta-date {
  width: 160px;
}
.hi-compta-nolimit {
  padding: 5px 10px !important;
  font-size: 9pt !important;
}
.hi-compta-periode {
  font-size: 8.5pt;
  color: #888;
}

/* Deux groupes de comptage bien distincts : physique vs administratif */
.hi-compta-groups {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.hi-compta-group {
  flex: 1;
  min-width: 300px;
  border: 1px solid #dde3ec;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
}
.hi-compta-group-title {
  font-size: 9pt;
  font-weight: 700;
  color: #444;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.hi-compta-group-title .fa {
  color: var(--main-bg-color);
}
.hi-compta-group-sub {
  font-size: 7.5pt;
  font-weight: 500;
  color: #999;
  text-transform: none;
  letter-spacing: 0;
}

.hi-compta-kpis {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* KPI principal de chaque groupe (qté inventoriée / solde administratif) */
.hi-compta-kpi-main {
  background: #e8f1fb;
  border-color: #b9d4f0;
}
.hi-compta-kpi-main .hi-compta-kpi-val {
  color: #1a5799;
}

/* Verdict : solde administratif vs qté inventoriée */
.hi-compta-verdict {
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: 10pt;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.hi-compta-verdict-ok {
  background: #e7f5ec;
  border: 1px solid #b6e0c4;
  color: #1b5e20;
}
.hi-compta-verdict-bad {
  background: #ffeaea;
  border: 1px solid #f5b5b5;
  color: #c62828;
}
.hi-compta-kpi {
  flex: 1;
  min-width: 110px;
  background: #f8f9fb;
  border: 1px solid #e5e8ee;
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.hi-compta-kpi-val {
  font-size: 13pt;
  font-weight: 700;
  color: #333;
}
.hi-compta-kpi-lbl {
  font-size: 7.5pt;
  color: #888;
  text-align: center;
}
.hi-compta-kpi-ok {
  background: #e7f5ec;
  border-color: #b6e0c4;
}
.hi-compta-kpi-ok .hi-compta-kpi-val {
  color: #1b5e20;
}
.hi-compta-kpi-alert {
  background: #ffeaea;
  border-color: #f5b5b5;
}
.hi-compta-kpi-alert .hi-compta-kpi-val {
  color: #c62828;
}

.hi-compta-section {
  font-size: 9.5pt;
  font-weight: 700;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin: 14px 0 6px 0;
}
.hi-compta-section-toggle {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}
.hi-compta-section-toggle:hover {
  color: var(--main-bg-color);
}
.hi-compta-section-toggle .fa {
  font-size: 8pt;
  color: #999;
}

.hi-compta-kpi-muted {
  opacity: 0.65;
}

.hi-compta-annulees {
  font-size: 8pt;
  font-weight: 500;
  color: #e65100;
  text-transform: none;
  letter-spacing: 0;
  margin-left: 6px;
}

/* Commande client annulée : grisée/barrée, non comptée dans les totaux */
.hi-row-cancelled td {
  opacity: 0.55;
  text-decoration: line-through;
}
.hi-compta-empty {
  font-size: 9pt;
  color: #aaa;
  font-style: italic;
  margin-bottom: 8px;
}
.hi-compta-scroll {
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid #eee;
  border-radius: 6px;
}

.hi-mouv-pos {
  color: #2e7d32;
}
.hi-mouv-neg {
  color: #c62828;
}

.hi-badge-kit {
  display: inline-block;
  background: #ede7f6;
  color: #5e35b1;
  border: 1px solid #d1c4e9;
  border-radius: 10px;
  padding: 1px 8px;
  font-size: 7.5pt;
  font-weight: 600;
  margin-left: 6px;
  white-space: nowrap;
}
.hi-badge-avoir {
  display: inline-block;
  background: #fff3e0;
  color: #e65100;
  border: 1px solid #ffcc80;
  border-radius: 10px;
  padding: 1px 8px;
  font-size: 7.5pt;
  font-weight: 600;
  margin-left: 6px;
}

/* Bouton Restant à compter */
.hi-btn-reste {
  background: #1565c0 !important;
  color: white !important;
  font-weight: 600;
}
.hi-btn-reste:hover {
  filter: brightness(1.1);
}

/* Indicateur d'étape des modales de clôture */
.hi-step-badge {
  display: inline-block;
  background: #e8f1fb;
  color: #1a5799;
  border: 1px solid #b9d4f0;
  border-radius: 12px;
  padding: 2px 12px;
  font-size: 8.5pt;
  font-weight: 600;
  margin-left: 10px;
  vertical-align: middle;
  white-space: nowrap;
}

/* Liste des actions de la clôture (étape 2) */
.hi-close-actions-list {
  margin: 8px 0 0 0;
  padding-left: 20px;
  font-size: 9.5pt;
  color: #444;
}
.hi-close-actions-list li {
  margin-bottom: 5px;
  line-height: 1.4;
}

/* Alerte mouvements Dolibarr pendant l'inventaire (modale de clôture) */
.hi-modal-warning-block {
  display: block;
}
.hi-mouv-title {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
}
.hi-mouv-ok {
  background: #e7f5ec;
  border: 1px solid #b6e0c4;
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 12px;
  font-size: 9.5pt;
  color: #1b5e20;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Bouton Point kits */
.hi-btn-kits {
  background: #5e35b1 !important;
  color: white !important;
  font-weight: 600;
}
.hi-btn-kits:hover {
  filter: brightness(1.1);
}

/* Clôturer sans les droits Dolibarr : visuellement inactif (le clic explique le refus) */
.hi-btn-noright {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Point kits : tout est propre */
.hi-kits-clean {
  background: #e7f5ec;
  border: 1px solid #b6e0c4;
  border-radius: 6px;
  padding: 14px;
  font-size: 10.5pt;
  font-weight: 600;
  color: #1b5e20;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}

/* === Tables === */
.hi-tables {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hi-table-main {
  flex: 3;
  min-width: 300px;
}
.hi-table-history {
  flex: 2;
  min-width: 380px;
}

/* Titre au-dessus de chaque tableau */
.hi-table-title {
  font-size: 9.5pt;
  font-weight: 600;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.hi-table-title .fa {
  color: var(--main-bg-color);
}

/* Toggle de la colonne Date (masquée par défaut) */
.hi-datecol-toggle {
  margin-left: auto;
  color: #bbb;
  cursor: pointer;
  font-size: 9pt;
}
.hi-datecol-toggle:hover {
  color: var(--main-bg-color);
}
.hi-datecol-toggle-on {
  color: var(--main-bg-color);
}

/* Sélecteur de tableaux affichés (Les 2 / Produits / Scans) */
.hi-view-toggle {
  display: inline-flex;
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
}
.hi-view-toggle button {
  border-radius: 0 !important;
  padding: 6px 12px !important;
  font-size: 9pt !important;
  background: #fff !important;
  color: #666 !important;
  box-shadow: none !important;
  transform: none !important;
}
.hi-view-toggle button + button {
  border-left: 1px solid #ddd !important;
}
.hi-view-toggle button:hover {
  background: #f0f2f5 !important;
}
.hi-view-toggle button.hi-view-btn-active {
  background: var(--main-bg-color) !important;
  color: #fff !important;
  font-weight: 600;
}

/* Réf complète (non tronquée), lien vers la fiche produit Dolibarr */
.hi-td-ref {
  font-size: 9pt;
  color: #444;
  white-space: nowrap;
}

/* En-têtes triables (main.css impose thead th a { background: var(--main-bg-color) }
   → surcharger th ET a, même piège que la table de Gestion produits) */
.hi-table thead th a.hi-sort {
  background: transparent !important;
  color: #555 !important;
  text-decoration: none;
  cursor: pointer;
  display: inline-block;
  padding: 0;
}
.hi-table thead th a.hi-sort:hover {
  color: var(--main-bg-color) !important;
}

/* Recherche du tableau Produits inventoriés (vidée à chaque scan produit) */
.hi-content-search {
  width: 220px;
  margin-left: 12px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  font-size: 9pt;
  padding: 4px 8px;
}

/* Tri « dernier scan en premier » (titre du tableau Produits inventoriés) */
.hi-scan-sort {
  margin-left: auto;
  font-size: 8.5pt;
  font-weight: 600;
  color: #999;
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.hi-scan-sort:hover {
  color: var(--main-bg-color);
}
.hi-scan-sort .fa {
  color: inherit;
}
.hi-scan-sort-on {
  color: var(--main-bg-color);
}

/* Colonne Diff (Stock − Qté inventoriée) : 0 = conforme (vert), sinon écart (rouge) */
.hi-diff-zero {
  color: #2e7d32;
}
.hi-diff-alert {
  color: #c62828;
  background: #fff5f5;
}

/* Quantité aberrante (EAN scanné dans le champ Quantité) : signalée en rouge,
   exclue des totaux et ignorée à la clôture */
.hi-qty-suspect {
  color: #c62828;
}

/* Colonne Date : petite et discrète */
.hi-td-date {
  font-size: 8pt;
  color: #999;
  white-space: nowrap;
}

/* Bouton remonter en haut */
.hi-btn-scrolltop {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 46px;
  height: 46px;
  border-radius: 50% !important;
  background: var(--main-bg-color) !important;
  color: #fff !important;
  font-size: 14pt !important;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
  z-index: 500;
  padding: 0 !important;
}
.hi-btn-scrolltop:hover {
  filter: brightness(1.1);
}

.hi-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 10pt;
  /* main.css impose table { text-align: center } globalement */
  text-align: left;
}
.hi-table td {
  text-align: left;
}
.hi-table td.hi-td-num {
  text-align: center;
}

.hi-table-header th {
  background: linear-gradient(135deg, #f1f3f5 0%, #e8eaed 100%);
  padding: 8px 10px;
  font-weight: 600;
  font-size: 9pt;
  color: #555;
  text-align: left;
  border-bottom: 2px solid #ddd;
}

.hi-table-row td {
  padding: 6px 10px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
}

.hi-table-row:nth-child(even) td {
  background-color: #fafbfc;
}
.hi-table-row:nth-child(odd) td {
  background-color: #fff;
}

.hi-table-row:hover td {
  background-color: #f0f7ff;
}

.hi-table-row a {
  color: var(--main-bg-color);
  text-decoration: none;
}
.hi-table-row a:hover {
  text-decoration: underline;
}

.hi-td-code {
  font-family: monospace;
  font-size: 9pt;
  color: #666;
}
/* Tableau des scans : codes barres alignés à droite (comparaison visuelle des fins de codes) */
.hi-table-history td.hi-td-code {
  text-align: right;
}

.hi-td-num {
  text-align: center;
}

.hi-td-poste {
  font-size: 9pt;
  color: #777;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hi-text-danger {
  color: #c62828;
}

/* === Feedback scan === */
.hi-scan-feedback {
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 10pt;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: hi-scan-flash 0.4s ease;
}
.hi-scan-ok {
  background: #e7f5ec;
  border: 1px solid #b6e0c4;
  color: #1b5e20;
}
.hi-scan-unknown {
  background: #ffeaea;
  border: 1px solid #f5b5b5;
  color: #c62828;
}
@keyframes hi-scan-flash {
  0%   { transform: scale(0.98); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* === Vérification EAN === */
.hi-ean-feedback {
  gap: 8px;
  flex-wrap: wrap;
}
.hi-ean-verified,
.hi-ean-saved {
  background: #e7f5ec;
  border: 1px solid #b6e0c4;
  color: #1b5e20;
}
.hi-ean-mismatch,
.hi-ean-unknown {
  background: #ffeaea;
  border: 1px solid #f5b5b5;
  color: #c62828;
}
.hi-ean-info {
  background: #e8f1fb;
  border: 1px solid #b9d4f0;
  color: #1a5799;
}
.hi-ean-saving {
  background: #f5f5f5;
  border: 1px solid #ddd;
  color: #666;
}

.hi-btn-ean-replace {
  background: #c62828 !important;
  color: white !important;
  font-weight: 600;
  padding: 4px 10px !important;
  font-size: 9pt !important;
}
.hi-btn-ean-replace:hover {
  filter: brightness(1.1);
}

.hi-td-ean {
  font-family: monospace;
  font-size: 8.5pt;
  color: #555;
  white-space: nowrap;
}

.hi-ean-value {
  cursor: pointer;
  border-radius: 4px;
  padding: 2px 4px;
}
.hi-ean-value:hover {
  background: #eef3fa;
  color: var(--main-bg-color);
}
.hi-ean-missing {
  color: #e65100;
  font-weight: 600;
}
.hi-ean-na {
  color: #bbb;
}

.hi-ean-pen {
  font-size: 7pt;
  color: #aaa;
  opacity: 0;
  margin-left: 2px;
}
.hi-ean-value:hover .hi-ean-pen {
  opacity: 1;
}

.hi-ean-ok {
  color: #2e7d32;
  margin-right: 4px;
}
.hi-ean-bad {
  color: #c62828;
  margin-right: 4px;
}

.hi-ean-input {
  width: 130px;
  padding: 3px 6px;
  font-size: 9pt;
  font-family: monospace;
}

/* Bandeau « sons bloqués par le navigateur » (cliquable pour débloquer) */
.hi-audio-banner {
  margin-top: 8px;
  padding: 10px 14px;
  border-radius: 6px;
  background: #fff3e0;
  border: 1px solid #ffb74d;
  color: #e65100;
  font-size: 10pt;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: hi-scan-flash 0.4s ease;
}
.hi-audio-banner:hover {
  filter: brightness(0.98);
}

/* === Popup sons des scans (pattern popups de préférences) === */
.hi-sons-menu {
  position: relative;
  display: inline-block;
}

.hi-btn-sons {
  padding: 8px 12px !important;
}

.hi-sons-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  padding: 12px;
  z-index: 200;
  min-width: 230px;
  animation: navDropdownFadeIn 0.15s ease;
}

.hi-sons-title {
  font-size: 9pt;
  font-weight: 600;
  color: #555;
  text-align: left;
  margin-bottom: 8px;
}

.hi-sons-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10pt;
  padding: 4px 0;
  cursor: pointer;
  white-space: nowrap;
}
.hi-sons-item span {
  flex: 1;
  text-align: left;
}

.hi-sons-test {
  color: var(--main-bg-color);
  font-size: 8pt;
  cursor: pointer;
  padding: 4px;
}
.hi-sons-test:hover {
  filter: brightness(1.2);
}

/* Compteur sous les tableaux plafonnés (perf) */
.hi-table-more {
  padding: 6px 10px;
  font-size: 8.5pt;
  color: #888;
  text-align: center;
}
.hi-table-more a {
  color: var(--main-bg-color);
  cursor: pointer;
  font-weight: 600;
  margin-left: 6px;
}
.hi-table-more a:hover {
  text-decoration: underline;
}

/* Lignes historique en attente / échouées */
.hi-row-pending td {
  opacity: 0.6;
  font-style: italic;
}
.hi-row-failed td {
  background-color: #ffeaea !important;
  color: #c62828;
  text-decoration: line-through;
}

/* === Modal === */
.hi-modal {
  min-width: 60%;
}

.hi-modal-warning {
  background: #fff3e0;
  border: 1px solid #ffcc80;
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: 10pt;
  color: #e65100;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hi-modal-info {
  background: #f5f5f5;
  border-radius: 6px;
  padding: 12px 14px;
  margin-bottom: 12px;
  font-size: 10pt;
  color: #555;
  text-align: center;
}

.hi-modal-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.hi-loading {
  text-align: center;
  padding: 20px;
  color: var(--main-bg-color);
}

/* === Responsive mobile === */
@media (max-width: 768px) {
  #id_inventaire {
    width: auto;
    margin: 0 10px;
    padding: 0;
  }

  /* Les modales de la page (dont « Nom du poste », ouverte automatiquement
     au 1er usage d'un inventaire) héritent de .modal-container (600px fixe,
     css/main.css) : à 375px de large elle déborde et peut rendre le bouton
     de validation inatteignable. On la contraint à la largeur de l'écran,
     scopé à cette page uniquement. */
  #id_inventaire .modal-container {
    width: calc(100vw - 32px);
    max-width: 600px;
    box-sizing: border-box;
  }

  .hi-tables {
    flex-direction: column;
  }

  /* .hi-table-main / .hi-table-history restent des flex-items avec un
     min-width desktop (300/380px, cf. règles non-responsive plus haut) :
     sans le remettre à 0, le passage en colonne ci-dessus ne suffit pas à
     empêcher le débordement (un flex-item ne rétrécit jamais sous sa
     largeur de contenu intrinsèque par défaut). */
  .hi-table-main,
  .hi-table-history {
    flex: none;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
  }

  /* Tableaux larges (Produits inventoriés, Scans enregistrés, et toutes les
     tables des modales : détail comptable, restant à compter, point kits,
     clôture) : le overflow-x:hidden global de main.css (<=992px) rend les
     colonnes en trop invisibles ET inatteignables (cf. CLAUDE.md section
     Inventaire). Chaque <table class="hi-table"> devient son propre
     conteneur de défilement horizontal : passer la table en display:block
     lui donne une largeur fixe (celle de son conteneur, via le width:100%
     déjà posé par main.css) pendant que son contenu (thead+tbody, toujours
     en table-header-group/table-row-group) continue d'être mis en page
     comme UNE SEULE table anonyme — les colonnes de l'en-tête et du corps
     restent donc alignées, contrairement à passer thead/tbody chacun en
     display:table séparément. */
  #id_inventaire table.hi-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #e5e8ee;
    border-radius: 8px;
  }

  /* Indicateur visuel qu'il faut faire glisser le tableau : la ligne de
     titre passe en multi-lignes (desktop non concerné) pour accueillir un
     repère discret sous le titre des 2 tableaux principaux. */
  .hi-table-title {
    flex-wrap: wrap;
  }
  .hi-table-main .hi-table-title::after,
  .hi-table-history .hi-table-title::after {
    content: "⇄ faites glisser le tableau pour voir toutes les colonnes";
    flex: 1 0 100%;
    font-size: 7.5pt;
    font-weight: 400;
    font-style: italic;
    text-transform: none;
    letter-spacing: 0;
    color: #999;
    margin-top: 2px;
  }

  /* Champ de recherche du tableau Produits inventoriés : largeur fixe
     desktop (220px) remplacée par 100% pour ne pas forcer le débordement
     de la ligne de titre déjà repassée en multi-lignes ci-dessus. */
  .hi-content-search {
    width: 100%;
    margin-left: 0;
  }

  .hi-inventaire-lists {
    flex-direction: column;
    gap: 12px;
  }

  .hi-field-row {
    flex-direction: column;
    align-items: stretch;
  }

  .hi-select-product {
    min-width: 100%;
  }

  .hi-section-title-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .hi-close-controls {
    flex-wrap: wrap;
  }

  /* Cibles tactiles : scan à la scannette ou au doigt, boutons un peu plus
     grands (recommandation projet 44px) sans toucher au desktop. */
  .page_inventaire button {
    min-height: 44px;
  }
}
