:root {
  --bg: #0f1419;
  --card: #1a222c;
  --border: #2a3544;
  --text: #e8eef4;
  --muted: #8b98a8;
  --accent: #3d7c5a;
  --danger: #c45c5c;
}
* { box-sizing: border-box; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
html {
  height: 100%;
  scrollbar-gutter: stable;
}
body.app-body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  font-family: system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
}

/* Filigrane logo sur tout l’écran (toutes les pages, très discret) */
body.app-body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: url('logo-stockia-v3.png') no-repeat center 36%;
  background-size: clamp(320px, 78vmin, 920px);
  opacity: 0.052;
  pointer-events: none;
  z-index: 0;
}
/* Le main doit rester sous l’en-tête : même z-index faisait passer les tuiles / le contenu au-dessus du sous-menu Admin (clics inactifs). */
body.app-body .top {
  position: relative;
  z-index: 200;
}
body.app-body .main {
  position: relative;
  z-index: 1;
}
a { color: #7eb99a; }
.top {
  flex-shrink: 0;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 0.75rem 1.25rem; background: var(--card); border-bottom: 1px solid var(--border);
}
.top.top--login-gate {
  justify-content: center;
}
.top.top--login-gate .brand {
  pointer-events: auto;
}
.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  line-height: 0;
}
.brand-logo {
  height: 2.35rem;
  width: auto;
  max-width: 11rem;
  object-fit: contain;
  display: block;
}
.brand--home-pair {
  gap: 0.55rem;
  align-items: flex-start;
}
.brand-logo--home-1 {
  height: 2.85rem;
  max-height: 3.2rem;
  max-width: min(11.5rem, 44vw);
  width: auto;
  object-fit: contain;
  align-self: center;
}
.brand-logo--home-2 {
  height: 2.35rem;
  max-height: 2.75rem;
  max-width: min(10rem, 40vw);
  width: auto;
  object-fit: contain;
}
.top-end {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin-left: auto;
  justify-content: flex-end;
}
.top-end nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
nav { display: flex; flex-wrap: wrap; gap: 0.35rem; }
nav a {
  color: var(--muted); text-decoration: none; padding: 0.45rem 0.85rem; border-radius: 8px;
}
nav a.on, nav a:hover { background: #2d5c44; color: #fff; }

/* Menu : entrée stock (vert), sortie (rouge), chantiers (ambre / cuivré), état stock (bleu), nouvelle étiquette (jaune), admin (violet) */
nav a.nav-link--vert:link,
nav a.nav-link--vert:visited {
  color: #7ed4a8;
}
nav a.nav-link--vert.on,
nav a.nav-link--vert:hover,
nav a.nav-link--vert.on:link,
nav a.nav-link--vert.on:visited {
  background: linear-gradient(165deg, #6fe0a8 0%, #45a76f 38%, #2f7a4e 100%);
  color: #f6fffa;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    0 1px 6px rgba(31, 92, 60, 0.25);
}
nav a.nav-link--jaune:link,
nav a.nav-link--jaune:visited {
  color: #e8d058;
}
nav a.nav-link--jaune.on,
nav a.nav-link--jaune:hover,
nav a.nav-link--jaune.on:link,
nav a.nav-link--jaune.on:visited {
  background: linear-gradient(165deg, #f5e878 0%, #d4b82a 45%, #9a8018 100%);
  color: #2a2210;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
/* Superviseur : lien direct Administration */
nav a.nav-link--supervision:link,
nav a.nav-link--supervision:visited {
  color: #5ec8e0;
}
nav a.nav-link--supervision.on,
nav a.nav-link--supervision:hover,
nav a.nav-link--supervision.on:link,
nav a.nav-link--supervision.on:visited {
  background: linear-gradient(165deg, #6ed8f0 0%, #3a9ec4 45%, #1e6a82 100%);
  color: #f4fcff;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
nav a.nav-link--sortie:link,
nav a.nav-link--sortie:visited {
  color: #e07070;
}
nav a.nav-link--sortie.on,
nav a.nav-link--sortie:hover,
nav a.nav-link--sortie.on:link,
nav a.nav-link--sortie.on:visited {
  background: linear-gradient(165deg, #e88888 0%, #c05050 45%, #943838 100%);
  color: #fff;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
nav a.nav-link--chantier:link,
nav a.nav-link--chantier:visited {
  color: #e0aa6e;
}
nav a.nav-link--chantier.on,
nav a.nav-link--chantier:hover,
nav a.nav-link--chantier.on:link,
nav a.nav-link--chantier.on:visited {
  background: linear-gradient(165deg, #f2c88c 0%, #c9783a 42%, #8a4a22 100%);
  color: #fffaf4;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.26);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    0 1px 6px rgba(120, 60, 28, 0.32);
}
nav a.nav-link--bleu:link,
nav a.nav-link--bleu:visited {
  color: #6ba3e0;
}
nav a.nav-link--bleu.on,
nav a.nav-link--bleu:hover,
nav a.nav-link--bleu.on:link,
nav a.nav-link--bleu.on:visited {
  background: linear-gradient(165deg, #7eb3ef 0%, #4a86d4 40%, #2d5a9e 100%);
  color: #fff;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.top-end nav .nav-admin {
  position: relative;
  margin-left: 0;
}
nav .nav-admin {
  position: relative;
  margin-left: auto;
}
nav .nav-admin-summary {
  cursor: pointer;
  list-style: none;
  color: var(--muted);
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  font: inherit;
  font-weight: 700;
}
nav .nav-admin-summary::-webkit-details-marker { display: none; }
nav .nav-admin-summary.nav-link--admin {
  color: #b894e8;
}
nav .nav-admin-summary.nav-link--admin.on,
nav .nav-admin-summary.nav-link--admin:hover,
nav .nav-admin[open] .nav-admin-summary.nav-link--admin {
  background: linear-gradient(165deg, #c9a8f0 0%, #9b6fd4 45%, #6b4199 100%);
  color: #fff;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
nav .nav-admin-links {
  position: absolute;
  right: 0;
  left: auto;
  top: 100%;
  margin-top: 0.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 11rem;
  padding: 0.35rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
  z-index: 50;
}
nav .nav-admin-links a { display: block; }
nav .nav-admin-links a.on,
nav .nav-admin-links a:hover {
  background: linear-gradient(165deg, #c9a8f0 0%, #9b6fd4 45%, #6b4199 100%);
  color: #fff;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.15);
}

/* Pastille compte (initiales + point connecté) */
.user-menu-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 999px;
  -webkit-tap-highlight-color: transparent;
}
.user-menu-trigger:focus-visible {
  outline: 2px solid #7eb99a;
  outline-offset: 2px;
}
.user-menu-trigger__avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 50%;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  background: linear-gradient(145deg, #356b52, #2a5540);
  border: 1px solid rgba(126, 185, 154, 0.45);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.user-menu-trigger__status {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: #4caf7a;
  border: 2px solid var(--card);
  box-shadow: 0 0 0 1px rgba(76, 175, 122, 0.4);
}
.user-menu-trigger--mobile {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
}
.top.mobile-home-top--with-user {
  padding-right: 2.75rem;
}

.user-account-dialog {
  padding: 0;
  border: none;
  border-radius: 14px;
  background: transparent;
  max-width: calc(100vw - 1.5rem);
  box-shadow: none;
}
.user-account-dialog::backdrop {
  background: rgba(10, 14, 18, 0.55);
  backdrop-filter: blur(2px);
}
.user-account-dialog__panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem 1.35rem;
  min-width: min(19rem, 92vw);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}
.user-account-dialog__title {
  margin: 0 0 1rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
}
.user-account-dialog__session {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 0.65rem;
}
.user-account-dialog__dot {
  flex-shrink: 0;
  margin-top: 0.35rem;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: #4caf7a;
  box-shadow: 0 0 0 3px rgba(76, 175, 122, 0.22);
}
.user-account-dialog__line {
  margin: 0;
  line-height: 1.45;
  color: #fff;
}
.user-account-dialog__line strong {
  color: #fff;
  font-weight: 700;
}
.user-account-dialog__hint {
  margin: 0 0 1.15rem;
  font-size: 0.9rem;
}
.user-account-dialog__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}
.user-account-dialog__logout-form {
  margin: 0;
}

/* Entrée stock — QR code + recherche article côte à côte */
.row--entree-bc-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0 1rem;
  align-items: start;
}
.row--entree-bc-search--qr-only {
  grid-template-columns: minmax(0, 1fr);
}
.entree-bc-search__field label {
  display: block;
  margin-bottom: 0.35rem;
}
.entree-bc-search__field input,
.entree-bc-search__field select {
  width: 100%;
}
.field-with-qr-scan {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: stretch;
  min-width: 0;
}
.field-with-qr-scan__input-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  min-width: 0;
}
.field-with-qr-scan__input-actions > input {
  flex: 1 1 0;
  min-width: 0;
  width: auto;
  max-width: none;
}
.entree-bc-search__field .field-with-qr-scan__input-actions > input {
  width: auto;
  max-width: none;
}
.field-with-qr-scan__input-actions .btn--qr-scan {
  flex: 0 0 auto;
  font-size: 0.9rem;
}

/* Aperçu caméra QR dans le flux de la page (pas de modal) */
.stockia-qr-panel {
  margin-top: 0.35rem;
  padding: 0.65rem 0.7rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.stockia-qr-panel[hidden] {
  display: none !important;
}
.stockia-qr-panel__hint {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.35;
}
.stockia-qr-panel__video-wrap {
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
  aspect-ratio: 4 / 3;
  max-height: min(42vh, 320px);
}
.stockia-qr-panel__video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.stockia-qr-panel__msg {
  margin: 0;
  font-size: 0.84rem;
  min-height: 1.25em;
  line-height: 1.35;
}
.stockia-qr-panel__msg--err {
  color: #ff8a8a;
}
.stockia-qr-panel__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}
.stockia-qr-panel__file {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

/* Fiche article sous le panneau Caméra QR (mobile) */
.stockia-qr-fiche-inline {
  margin-top: 0.35rem;
  width: 100%;
  min-width: 0;
}
.stockia-qr-fiche-inline[hidden] {
  display: none !important;
}
.stockia-qr-fiche-inline__title {
  margin: 0 0 0.35rem;
  font-size: 0.84rem;
  line-height: 1.35;
}
.stockia-qr-fiche-inline__frame-wrap {
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--card);
}
.stockia-qr-fiche-inline__frame {
  display: block;
  width: 100%;
  min-height: 160px;
  height: min(45vh, 300px);
  border: none;
  background: transparent;
}

/* Diagnostic : ?stockia_debug_qr=1 ou localStorage stockia_debug_qr=1 */
.stockia-qr-diag {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: min(42vh, 280px);
  overflow: auto;
  z-index: 100000;
  margin: 0;
  padding: 0.5rem 0.65rem;
  font-size: 0.72rem;
  line-height: 1.35;
  font-family: ui-monospace, monospace;
  white-space: pre-wrap;
  word-break: break-word;
  color: #e8e8e8;
  background: rgba(12, 14, 18, 0.96);
  border-top: 2px solid #3d7c5a;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.35);
}
.entree-product-search-hint {
  margin: 0.4rem 0 0;
  font-size: 0.88rem;
  line-height: 1.4;
}
.entree-product-search-hint kbd {
  display: inline-block;
  padding: 0.08rem 0.35rem;
  font-size: 0.8em;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.2);
}
.entree-combo {
  position: relative;
  width: 100%;
}
.entree-combo__input {
  width: 100%;
}
.entree-combo__panel {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 2px);
  z-index: 400;
  max-height: min(16rem, 42vh);
  overflow-y: auto;
  margin: 0;
  padding: 0.25rem;
  list-style: none;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}
.entree-combo__option {
  margin: 0;
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1.35;
  color: var(--text);
}
.entree-combo__option:hover,
.entree-combo__option--active {
  background: rgba(61, 124, 90, 0.35);
  color: #fff;
}
.entree-combo__msg {
  margin: 0;
  padding: 0.5rem 0.55rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.chantiers-combo-block {
  margin-bottom: 0.85rem;
}
.chantier-row--highlight {
  outline: 2px solid rgba(110, 210, 150, 0.9);
  outline-offset: -2px;
  animation: chantier-row-highlight 1.8s ease;
}
@keyframes chantier-row-highlight {
  0% { background: rgba(61, 124, 90, 0.4); }
  35% { background: rgba(61, 124, 90, 0.22); }
  100% { background: transparent; }
}
@media (max-width: 640px) {
  .row--entree-bc-search {
    grid-template-columns: 1fr;
    gap: 0.85rem 0;
  }
}

.card--login { max-width: 28rem; margin-inline: auto; }
.card--login-foot { margin-top: 1.25rem; }

/* Connexion mobile : mot de passe + icone afficher-masquer */
.row--password-toggle .password-input-wrap {
  position: relative;
  display: block;
}
.row--password-toggle .password-input-wrap input {
  width: 100%;
  box-sizing: border-box;
  padding-right: 2.85rem;
}
.password-toggle-btn {
  position: absolute;
  top: 50%;
  right: 0.35rem;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.password-toggle-btn:hover,
.password-toggle-btn:focus-visible {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  outline: none;
}
.password-toggle-btn:focus-visible {
  box-shadow: 0 0 0 2px var(--accent);
}
.password-toggle-svg {
  flex-shrink: 0;
  pointer-events: none;
}
.password-toggle-btn[aria-pressed='true'] .password-toggle-svg--show {
  display: none;
}
.password-toggle-btn[aria-pressed='true'] .password-toggle-svg--hide {
  display: block;
}
.password-toggle-btn[aria-pressed='false'] .password-toggle-svg--hide {
  display: none;
}
.password-toggle-btn[aria-pressed='false'] .password-toggle-svg--show {
  display: block;
}

/* Administration — gestion des comptes app_users */
.admin-app-users__h3 {
  font-size: 1.02rem;
  font-weight: 700;
  margin: 1.25rem 0 0.6rem;
}
.admin-app-users__h3:first-of-type {
  margin-top: 0.4rem;
}
.admin-app-users__form--create {
  max-width: 28rem;
}
.admin-app-users__table-wrap {
  max-height: min(55vh, 520px);
}
.admin-app-users__form-hidden-fields {
  display: inline;
  margin: 0;
  padding: 0;
  border: none;
}
.admin-app-users-table__row td {
  vertical-align: middle;
}
.admin-app-users-table__td-login {
  min-width: 11rem;
}
.admin-app-users-table__input-login {
  width: 100%;
  max-width: 16rem;
  display: inline-block;
  vertical-align: middle;
}
.admin-app-users-table__td-login .admin-app-users__you {
  display: inline-block;
  margin-left: 0.35rem;
  vertical-align: middle;
}
.admin-app-users-table__td-active {
  white-space: nowrap;
  width: 1%;
}
.admin-app-users-table__th-active {
  width: 1%;
}
.admin-app-users-table__th-role {
  min-width: 14rem;
  width: auto;
}
.admin-app-users-table__td-role {
  min-width: 14rem;
  width: auto;
  max-width: 26rem;
  white-space: normal;
  vertical-align: middle;
}
.admin-app-users-table__select-role {
  font: inherit;
  width: 100%;
  min-width: 12rem;
  max-width: none;
  padding: 0.45rem 0.55rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
}
.admin-app-users__select-role {
  font: inherit;
  width: 100%;
  max-width: 36rem;
  min-width: 16rem;
  padding: 0.45rem 0.55rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
}
.admin-app-users-table__td-pass {
  min-width: 12rem;
}
.admin-app-users-table__input-pass {
  width: 100%;
  max-width: 22rem;
}
.admin-app-users-table__td-meta {
  font-size: 0.82rem;
  white-space: nowrap;
}
.admin-app-users-table__th-meta {
  white-space: nowrap;
}
.admin-app-users-table__td-actions {
  width: 1%;
  white-space: nowrap;
}
.admin-app-users-table__th-actions {
  width: 1%;
  white-space: nowrap;
}
.admin-app-users-table__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}
.admin-app-users__form--delete-inline {
  display: inline;
  margin: 0;
}
.admin-app-users__form--delete-inline button {
  margin: 0;
}
.admin-app-users__you {
  font-size: 0.8rem;
}
.admin-app-users-check {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  font-size: 0.88rem;
  white-space: nowrap;
}
.top.mobile-home-top {
  position: relative;
  justify-content: center;
  padding: 0.85rem 1rem;
}
/* Lien fixe sous l’en-tête : passer en menu bureau (voir layout.php). */
.mobile-ui-toggle {
  margin: 0 0 0.65rem;
  padding: 0 0.75rem;
  font-size: 0.82rem;
  text-align: center;
}
.mobile-ui-toggle a {
  color: var(--muted, #8a9ba8);
}
.top.mobile-home-top--with-back {
  padding-left: 2.65rem;
}
.mobile-banner-back {
  position: absolute;
  left: 0.4rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  background: transparent;
  -webkit-tap-highlight-color: transparent;
}
.mobile-banner-back:hover,
.mobile-banner-back:focus-visible {
  background: rgba(125, 185, 154, 0.18);
  color: #9ed4b5;
  outline: none;
}
.mobile-banner-back-icon {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
}
.mobile-home-banner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  max-width: 100%;
  text-align: center;
}
.mobile-home-banner-logos {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: center;
  gap: 0.55rem;
  flex-shrink: 0;
}
/* Hors menu mobile : logo page aussi grand que sur le menu, titre à droite. */
.mobile-home-banner-logos--inline-page {
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  max-width: min(28rem, 100%);
  margin-inline: auto;
  gap: 0.65rem;
  padding-inline: 0.15rem;
}
.mobile-home-banner-right--inline-title {
  align-items: flex-start;
  text-align: left;
  flex: 1 1 auto;
  min-width: 0;
  align-self: center;
}
.mobile-home-banner-sub--inline-title {
  text-align: left;
  max-width: none;
  font-size: clamp(1.02rem, 3.9vw, 1.2rem);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
}
.mobile-home-banner-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  min-width: 0;
}
.mobile-home-banner picture {
  display: contents;
}
.mobile-home-banner-logo {
  height: 2.75rem;
  width: auto;
  max-width: 5.5rem;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}
.mobile-home-banner-logo--1 {
  height: 3.15rem;
  max-height: 3.5rem;
  max-width: min(9rem, 42vw);
  align-self: center;
}
.mobile-home-banner-logo--2 {
  height: 2.5rem;
  max-width: min(6.5rem, 34vw);
  margin-bottom: 0.05rem;
}
.mobile-home-banner-illus {
  height: auto;
  max-height: 3.25rem;
  max-width: min(7.5rem, 36vw);
  width: auto;
  object-fit: contain;
}
.mobile-home-banner-sub {
  margin: 0;
  max-width: min(18rem, 92vw);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.3;
  text-align: center;
}
/* Accueil mobile : sous-titre sous le double logo. */
.mobile-home-banner-logos:not(.mobile-home-banner-logos--inline-page) .mobile-home-banner-sub {
  max-width: 13rem;
  font-size: 0.95rem;
}
.brand-home-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  line-height: 0;
}
.brand-home-tagline {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.25;
  text-align: center;
  max-width: 9rem;
  white-space: normal;
}
body.app-body--mobile-home .main--home {
  padding-top: 0.65rem;
}
body.app-body--mobile-app-shell .main {
  padding-top: 0.65rem;
}
body.app-body--mobile-app-shell .top.mobile-home-top--app {
  position: sticky;
  top: 0;
  z-index: 250;
}
.mobile-home-banner-logo-link {
  display: flex;
  align-items: center;
  line-height: 0;
  text-decoration: none;
  flex-shrink: 0;
}
.mobile-flow-page {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.mobile-entree-page .card h2 {
  font-size: 1.05rem;
}
.mobile-entree-page .card--flow-chantier h2 {
  font-size: 1.5em;
  font-weight: 800;
  letter-spacing: -0.02em;
}
/* Entrée mobile : quantité compacte, bouton « Ajouter au panier » aligné à droite sur la même ligne */
.mobile-entree-page .row--qty-with-action .qty-with-action {
  flex-wrap: nowrap;
  width: 100%;
  gap: 0.5rem 0.65rem;
}
.mobile-entree-page .row--qty-with-action .qty-with-action .qty-stepper {
  flex: 0 0 auto;
  max-width: 10.5rem;
  width: auto;
}
.mobile-entree-page .row--qty-with-action .qty-with-action .qty-stepper-input {
  flex: 1 1 auto;
  min-width: 2.25rem;
  max-width: 4rem;
  padding-left: 0.2rem;
  padding-right: 0.2rem;
}
.mobile-entree-page .row--qty-with-action .qty-with-action > .btn {
  flex: 1 1 auto;
  margin-left: auto;
  min-width: 0;
  text-align: center;
}
/* Sortie (et flux) mobile : même ligne quantité + « Ajouter » — pas de .mobile-entree-page sur flow-split */
body.app-body--mobile-app-shell.app-body--mobile-route .row--qty-with-action .qty-with-action {
  flex-wrap: nowrap;
  width: 100%;
  gap: 0.5rem 0.65rem;
}
body.app-body--mobile-app-shell.app-body--mobile-route .row--qty-with-action .qty-with-action .qty-stepper {
  flex: 0 0 auto;
  max-width: 10.5rem;
  width: auto;
}
body.app-body--mobile-app-shell.app-body--mobile-route .row--qty-with-action .qty-with-action .qty-stepper-input {
  flex: 1 1 auto;
  min-width: 2.25rem;
  max-width: 4rem;
  padding-left: 0.2rem;
  padding-right: 0.2rem;
}
body.app-body--mobile-app-shell.app-body--mobile-route .row--qty-with-action .qty-with-action > .btn {
  flex: 1 1 auto;
  margin-left: auto;
  min-width: 0;
  text-align: center;
}
.main {
  width: 100%;
  max-width: none;
  margin: 0 auto;
  padding: 1rem clamp(0.85rem, 3vw, 2rem) 1.25rem;
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  background: transparent;
}
/* Aligné sur .main : contenu sur toute la largeur utile avec marges latérales */
.main--wide { max-width: none; }
.main--home {
  max-width: none;
  min-height: 0;
  flex: 1 1 0;
}
.main--home .main-inner {
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
}
.main--home .main-inner__viewport {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow: hidden;
}

/* Accueil : tuiles « premium » — 3 colonnes sur écran large, logos plus grands */
.home-welcome {
  text-align: center;
  margin-bottom: 1.15rem;
}
.home-title {
  font-size: clamp(1.5rem, 4.5vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 0.5rem;
  line-height: 1.15;
}
.home-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem 0.95rem;
  align-items: stretch;
  justify-items: stretch;
}
@media (min-width: 720px) {
  .home-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 540px) {
  .home-actions {
    grid-template-columns: 1fr;
    gap: 0.7rem;
  }
}
/* Accueil : les 6 tuiles remplissent la hauteur sous le titre (pas d’ascenseur page) */
.main--home .home-welcome {
  flex-shrink: 0;
  margin-bottom: 0.65rem;
}
.main--home .home-actions {
  flex: 1 1 0;
  min-height: 0;
  align-content: stretch;
}
@media (min-width: 720px) {
  .main--home .home-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 719px) {
  .main--home .home-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 540px) {
  .main--home .home-actions {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(6, minmax(0, 1fr));
  }
  body.app-body--mobile-home .main--home .home-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(3, minmax(0, 1fr));
  }
}
@media (max-height: 720px) {
  .main--home .home-title {
    font-size: clamp(1.2rem, 4vw, 1.55rem);
    margin-bottom: 0.25rem;
  }
  .main--home .home-welcome {
    margin-bottom: 0.4rem;
  }
  .main--home .home-actions {
    gap: 0.55rem 0.65rem;
  }
}
.home-action {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  aspect-ratio: 1;
  min-height: 0;
  padding: 0.25rem;
  border-radius: 16px;
  overflow: hidden;
  box-sizing: border-box;
  border: 2px solid var(--tile-border, rgba(255, 255, 255, 0.14));
  background: var(--tile-bg, var(--card));
  color: var(--text);
  text-decoration: none;
  box-shadow:
    0 6px 0 rgba(0, 0, 0, 0.22),
    0 14px 36px rgba(0, 0, 0, 0.28);
  transition:
    transform 0.18s cubic-bezier(0.34, 1.2, 0.64, 1),
    box-shadow 0.18s ease,
    filter 0.18s ease,
    border-color 0.18s ease;
}
.home-action:hover {
  transform: translateY(-5px);
  filter: brightness(1.07);
  border-color: var(--tile-border-hover, rgba(255, 255, 255, 0.35));
  box-shadow:
    0 8px 0 rgba(0, 0, 0, 0.18),
    0 22px 44px rgba(0, 0, 0, 0.32),
    0 0 36px var(--tile-aura, transparent);
}
.home-action:active {
  transform: translateY(-2px);
  transition-duration: 0.08s;
}
.home-action:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 16px;
}
.main--home .home-action {
  aspect-ratio: unset;
  height: 100%;
  max-height: 100%;
}
.home-action--in {
  --tile-border: rgba(94, 214, 154, 0.4);
  --tile-border-hover: rgba(130, 245, 180, 0.78);
  --tile-aura: rgba(61, 124, 90, 0.35);
  --tile-bg: linear-gradient(155deg, #1f5c45 0%, #153d32 40%, #0f2420 100%);
}
.home-action--out {
  --tile-border: rgba(232, 150, 110, 0.42);
  --tile-border-hover: rgba(255, 184, 140, 0.85);
  --tile-aura: rgba(180, 90, 60, 0.28);
  --tile-bg: linear-gradient(155deg, #6b3d2e 0%, #4a2820 40%, #2a1814 100%);
}
.home-action--label {
  --tile-border: rgba(110, 170, 245, 0.42);
  --tile-border-hover: rgba(150, 200, 255, 0.82);
  --tile-aura: rgba(70, 120, 200, 0.3);
  --tile-bg: linear-gradient(155deg, #2a4a6e 0%, #1e3555 42%, #141e2e 100%);
}
.home-action--stock {
  --tile-border: rgba(168, 182, 206, 0.38);
  --tile-border-hover: rgba(210, 220, 238, 0.78);
  --tile-aura: rgba(120, 130, 160, 0.22);
  --tile-bg: linear-gradient(155deg, #3a3f52 0%, #282a38 42%, #1a1c26 100%);
}
.home-action--admin {
  --tile-border: rgba(190, 160, 230, 0.4);
  --tile-border-hover: rgba(220, 190, 255, 0.82);
  --tile-aura: rgba(140, 100, 200, 0.28);
  --tile-bg: linear-gradient(155deg, #4a3568 0%, #352850 42%, #1e1528 100%);
}
.home-action.home-action--disabled {
  pointer-events: none;
  cursor: not-allowed;
  opacity: 0.42;
  filter: grayscale(0.92);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.18), 0 8px 20px rgba(0, 0, 0, 0.2);
}
.home-action.home-action--disabled:hover,
.home-action.home-action--disabled:active {
  transform: none;
  filter: grayscale(0.92);
  border-color: var(--tile-border, rgba(255, 255, 255, 0.14));
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.18), 0 8px 20px rgba(0, 0, 0, 0.2);
}
.home-action--chantier {
  --tile-border: rgba(245, 190, 120, 0.45);
  --tile-border-hover: rgba(255, 220, 160, 0.85);
  --tile-aura: rgba(200, 130, 60, 0.28);
  --tile-bg: linear-gradient(155deg, #6b4e2e 0%, #4a3620 42%, #281e12 100%);
}
.home-action-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 0;
  align-self: stretch;
  width: 100%;
  max-width: 100%;
  max-height: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.home-action-icon svg {
  width: min(72%, 5.25rem);
  height: min(72%, 5.25rem);
  stroke-width: 1.85;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.35));
}
.home-action-icon--img {
  overflow: hidden;
}
.home-action-icon--img picture {
  display: contents;
}
.home-action-illus {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  min-width: 0;
  min-height: 0;
  object-fit: contain;
  object-position: center;
  flex-shrink: 1;
}
/* Accueil : visuels remplissent un peu mieux la tuile */
.main--home .home-action-illus {
  width: 96%;
  height: 96%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.home-action-label {
  font-size: clamp(1.2rem, 3.2vw, 1.45rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}
.home-action-hint {
  font-size: 0.875rem;
  margin-top: 0.45rem;
  line-height: 1.4;
  max-width: 17rem;
  opacity: 0.92;
}
.home-action-hint.muted {
  color: rgba(232, 238, 244, 0.75);
}
@media (prefers-reduced-motion: reduce) {
  .home-action {
    transition: none;
  }
  .home-action:hover,
  .home-action:active {
    transform: none;
    filter: none;
  }
}

/* Bannière titre + visuel (nouvel article, entrée / sortie stock) */
.nouveau-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  padding: 1rem 1.15rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.nouveau-hero.flow-page-hero {
  margin-bottom: 1.15rem;
}
.nouveau-hero-img {
  flex-shrink: 0;
  width: auto;
  max-height: 5.25rem;
  max-width: min(200px, 42vw);
  object-fit: contain;
  object-position: left center;
}
.nouveau-hero-text {
  flex: 1 1 220px;
  min-width: 0;
}
.nouveau-hero-text h1 {
  margin: 0 0 0.35rem;
  font-size: 1.45rem;
}
.nouveau-hero-sub {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.45;
  max-width: 36rem;
}
/* Page Chantiers : titre + visuel à gauche, import CSV à droite (grille 1fr + auto) */
.nouveau-hero.chantiers-page-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 1.25rem 1.75rem;
}
.nouveau-hero-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem 1.5rem;
  min-width: 0;
}
.chantiers-import-panel {
  max-width: min(26rem, 100%);
  min-width: 0;
  justify-self: end;
  padding: 0.85rem 1rem;
  background: #131920;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.chantiers-import-heading-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  margin-bottom: 0.65rem;
}
.chantiers-import-heading-row--with-action {
  margin-bottom: 0;
}
.chantiers-import-heading-row .chantiers-import-heading {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
}
.chantiers-import-heading-row .import-csv-form {
  margin: 0;
  flex: 0 0 auto;
}
.chantiers-import-heading {
  font-size: 1.1rem;
  font-weight: 600;
  cursor: help;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
}
.import-csv-toolbar--chantiers-only {
  margin-top: 0;
}
.import-csv-toolbar--chantiers-only .import-csv-picker {
  flex: 0 1 auto;
}
.chantiers-import-panel .muted:last-child {
  margin-bottom: 0;
}
@media (max-width: 720px) {
  .nouveau-hero.chantiers-page-hero {
    grid-template-columns: 1fr;
  }
  .chantiers-import-panel {
    width: auto;
    max-width: none;
    justify-self: stretch;
  }
}
.nouveau-shopping-hint {
  margin: -0.35rem 0 1rem;
  font-size: 0.88rem;
  line-height: 1.55;
  max-width: 42rem;
}
.nouveau-shopping-hint a {
  color: #8ecbb0;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.nouveau-shopping-hint a:hover {
  color: #a8dcc4;
}
.nouveau-shopping-sep {
  margin: 0 0.2rem;
  opacity: 0.55;
  user-select: none;
}

/* Nouvelle étiquette : plein cadre (évite scroll viewport vide), formulaire en grille sur bureau */
.main-inner--fill .main-inner__viewport > .page-nouvelle-etiquette {
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.page-nouvelle-etiquette > .nouveau-hero--etiquette-banner {
  flex-shrink: 0;
  margin-bottom: 0;
}
.page-nouvelle-etiquette > .nouveau-shopping-hint--inline {
  flex-shrink: 0;
  margin: 0;
  max-width: none;
}
.card.card--nouveau-etiquette {
  flex: 1 1 0;
  min-height: 0;
  margin-bottom: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
}
.form-nouveau-etiquette {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem 1.25rem;
  align-content: start;
}
.form-nouveau-etiquette .row {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.form-nouveau-etiquette .row label {
  margin: 0;
  font-size: 0.88rem;
}
.form-nouveau-etiquette .row input:not([type="checkbox"]),
.form-nouveau-etiquette .row select,
.form-nouveau-etiquette .row textarea {
  max-width: none;
}
.form-nouveau-etiquette .row--full {
  grid-column: 1 / -1;
}
.form-nouveau-etiquette .row--actions {
  grid-column: 1 / -1;
  margin-top: 0.25rem;
}
.form-nouveau-etiquette .row--checkbox label {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}
.form-nouveau-etiquette .row--checkbox input[type="checkbox"] {
  width: auto;
  max-width: none;
  margin: 0;
}
@media (max-width: 720px) {
  .form-nouveau-etiquette {
    grid-template-columns: 1fr;
  }
}

/* Entrée / Sortie bureau : colonne gauche (saisie + validation), panier large à droite */
.flow-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 1rem 1.35rem;
  align-items: stretch;
}
.main-inner--fill .main-inner__viewport > .flow-page-hero {
  flex-shrink: 0;
}
.main-inner--fill .main-inner__viewport > .flow-split {
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
}
.main-inner--fill .main-inner__viewport > .page-stock {
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.main-inner--fill .main-inner__viewport > .page-chantiers {
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.main-inner--fill .main-inner__viewport > .mobile-flow-page {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.flow-split__col--main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.flow-split__col--main .card {
  margin-bottom: 0;
}
.flow-split__col--cart {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.flow-split__col--cart .card--flow-cart {
  margin-bottom: 0;
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  height: auto;
  box-sizing: border-box;
}
.flow-split__col--cart .card--flow-cart h2 {
  font-size: clamp(1.4rem, 2.4vw, 1.85rem);
  font-weight: 800;
  margin: 0 0 0.85rem;
  letter-spacing: -0.02em;
}
.card--flow-cart__title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.card--flow-cart__title-icon {
  width: 2.6rem;
  height: auto;
  max-height: 2.25rem;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}
.flow-cart-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.flow-cart-empty {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.5;
}
.flow-cart-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.flow-cart-table-wrap table {
  margin: 0;
  font-size: 1.05rem;
  width: 100%;
  border-collapse: collapse;
}
.flow-cart-table-wrap th,
.flow-cart-table-wrap td {
  padding: 0.65rem 0.85rem;
}
.card--flow-chantier {
  border-color: rgba(61, 124, 90, 0.35);
}
/* Sortie stock : même famille visuelle que le panier sortie (pas le vert entrée). */
.card--flow-chantier--sortie {
  border-color: rgba(232, 150, 110, 0.42);
  box-shadow: inset 0 0 0 1px rgba(180, 90, 60, 0.12);
}
.card--flow-chantier--sortie select.select-chantier:focus {
  border-color: rgba(230, 145, 105, 0.9);
  box-shadow: 0 0 0 2px rgba(200, 100, 70, 0.2);
}
.card--flow-chantier--sortie .input-chantier-code:focus {
  outline: none;
  border-color: rgba(230, 145, 105, 0.9);
  box-shadow: 0 0 0 2px rgba(200, 100, 70, 0.2);
}
.card--flow-chantier h2 {
  font-size: 1.5em;
  font-weight: 800;
  margin: 0 0 0.65rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.card--flow-chantier h2.card--flow-chantier__title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.card--flow-chantier__title-icon {
  width: 3rem;
  height: auto;
  max-height: 2.35rem;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}
.flow-chantier-hint {
  margin: 0 0 0.65rem;
  font-size: 0.88rem;
  line-height: 1.4;
}

/* Chantier : vrai sélecteur + saisie libre (remplace datalist peu lisible) */
.chantier-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 100%;
}
.chantier-field .select-chantier,
.chantier-field .input-chantier-code {
  max-width: none;
  width: 100%;
}
select.select-chantier {
  max-width: 100%;
  padding: 0.5rem 2.25rem 0.5rem 0.75rem;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  background-size: 1rem 1rem;
}
select.select-chantier:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(61, 124, 90, 0.22);
}
.card--flow-chantier select.select-chantier {
  max-width: none;
}
.chantier-field-caption {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.35;
}
.flow-cart-table-wrap thead th {
  background: rgba(0, 0, 0, 0.2);
  position: sticky;
  top: 0;
  z-index: 1;
}
.flow-cart-table-wrap tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.03);
}

/* Panier : tableau Article / Qté ; swipe = supprimer (fond neutre, pas de panneau à droite) */
.flow-cart-remove-form {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.flow-cart-lines {
  display: flex;
  flex-direction: column;
  margin: 0;
}
.flow-cart-lines-head {
  display: grid;
  grid-template-columns: 1fr minmax(3rem, auto);
  gap: 0.5rem 0.75rem;
  align-items: center;
  padding: 0.65rem 0.85rem;
  font-size: 1.05rem;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
  position: sticky;
  top: 0;
  z-index: 1;
}
.flow-cart-lines-head__qty {
  text-align: right;
}
.flow-cart-line {
  position: relative;
  border-bottom: 1px solid var(--border);
}
.flow-cart-line:last-child {
  border-bottom: none;
}
.flow-cart-line:nth-child(even) .flow-cart-swipe {
  background: rgba(255, 255, 255, 0.03);
}
.flow-cart-line:nth-child(odd) .flow-cart-swipe {
  background: transparent;
}
.flow-cart-swipe {
  position: relative;
  overflow: hidden;
  touch-action: pan-y;
}
/* Bande sous la ligne : visible seulement quand on swipe vers la gauche */
.flow-cart-swipe__delete-reveal {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  z-index: 0;
  width: 6.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.35rem;
  box-sizing: border-box;
  /* Couleurs : variables sur .card--flow-cart (même famille que boutons entrée / sortie) */
  background: var(
    --flow-cart-delete-bg,
    linear-gradient(165deg, #e88888 0%, #c05050 45%, #943838 100%)
  );
  box-shadow: var(--flow-cart-delete-shadow);
  pointer-events: none;
}
.flow-cart-swipe__delete-text {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  text-align: center;
  line-height: 1.2;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25);
}
.flow-cart-swipe__track {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  will-change: transform;
}
.flow-cart-swipe__face {
  min-width: 100%;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 1fr minmax(3rem, auto);
  gap: 0.5rem 0.75rem;
  align-items: center;
  padding: 0.65rem 0.85rem;
  background: var(--card);
  box-shadow: inset 0 0 0 9999px transparent;
}
.flow-cart-line:nth-child(even) .flow-cart-swipe__face {
  box-shadow: inset 0 0 0 9999px rgba(255, 255, 255, 0.04);
}
.flow-cart-line__text {
  min-width: 0;
  line-height: 1.35;
}
.flow-cart-line__designation {
  font-weight: 600;
}
.flow-cart-line__qty-block {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}
.flow-cart-line__qty {
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.flow-cart-table-wrap--lines {
  overflow-x: hidden;
}
.flow-cart-actions {
  margin: 0;
  flex-shrink: 0;
}
.flow-cart-validate {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.25rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}
.flow-cart-validate__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.flow-cart-validate__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 0.85rem;
}
.flow-cart-actions--clear {
  flex: 0 0 auto;
}
.flow-cart-commit {
  flex: 1 1 14rem;
  min-width: 0;
  margin: 0;
}
.flow-cart-commit__line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.65rem;
  width: 100%;
}
.flow-cart-operator-label {
  flex: 0 0 auto;
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}
.flow-cart-commit__line > input {
  flex: 1 1 9rem;
  min-width: 0;
}
.flow-cart-commit__line > .btn {
  flex: 0 0 auto;
}
/* Dégradé « Supprimé » au swipe : aligné .btn-sortie-submit / .qty-stepper--sortie */
.card--flow-cart {
  --flow-cart-delete-bg: linear-gradient(165deg, #e88888 0%, #c05050 45%, #943838 100%);
  --flow-cart-delete-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 2px 8px rgba(100, 35, 35, 0.35);
}
.card--flow-cart--entree {
  border-color: rgba(94, 214, 154, 0.35);
  box-shadow: inset 0 0 0 1px rgba(61, 124, 90, 0.15);
  --flow-cart-delete-bg: linear-gradient(165deg, #6fe0a8 0%, #45a76f 38%, #2f7a4e 100%);
  --flow-cart-delete-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.48),
    0 2px 8px rgba(31, 92, 60, 0.35);
}
.card--flow-cart--sortie {
  border-color: rgba(232, 150, 110, 0.35);
  box-shadow: inset 0 0 0 1px rgba(180, 90, 60, 0.12);
}
@media (max-width: 900px) {
  .flow-split {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
  }
  /* Bureau étroit : scroll interne ; sur layout-mobile le viewport parent défile (voir body.app-body--mobile-route). */
  .main-inner--fill .main-inner__viewport > .flow-split {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .main-inner--fill .flow-split {
    grid-template-rows: none;
  }
  .flow-split__col--main {
    overflow: visible;
    min-height: 0;
  }
  .flow-split__col--cart {
    overflow: visible;
    min-height: 0;
  }
  .flow-split__col--cart .card--flow-cart {
    min-height: 0;
    flex: 0 0 auto;
  }
}

/* MySQL : exécution de requête collée */
.mysql-exec-card {
  margin-bottom: 1.25rem;
}
.mysql-exec-card__title {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
}
.mysql-exec-card__hint {
  margin: 0 0 0.85rem;
  font-size: 0.9rem;
  max-width: 48rem;
}
.mysql-exec-label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
}
.mysql-exec-sql {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  font-family: ui-monospace, "Cascadia Code", "Consolas", monospace;
  font-size: 0.88rem;
  line-height: 1.4;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.22);
  color: var(--text);
  resize: vertical;
  min-height: 8rem;
}
.mysql-exec-actions {
  margin-top: 0.65rem;
}
.mysql-exec-out {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.mysql-exec-out--ok {
  background: rgba(61, 124, 90, 0.1);
  border-color: rgba(61, 124, 90, 0.35);
}
.mysql-exec-out--err {
  background: rgba(196, 92, 92, 0.12);
  border-color: rgba(196, 92, 92, 0.4);
}
.mysql-exec-out__msg {
  margin: 0 0 0.65rem;
}
.mysql-exec-pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.86rem;
  font-family: ui-monospace, "Consolas", monospace;
}
.mysql-exec-table-wrap {
  max-height: min(50vh, 28rem);
  margin: 0;
}
.mysql-exec-table {
  margin-top: 0.35rem;
}
.mysql-page-subnav {
  margin: 0.5rem 0 0;
  font-size: 0.92rem;
}
.mysql-page-subnav a {
  color: #7eb99a;
}
.mysql-page-subnav__on {
  font-weight: 600;
  color: var(--text);
}
.mysql-page-table-crosslink {
  margin: 0 0 0.65rem;
}
.main-inner .mysql-explorer__card + .mysql-explorer__card {
  margin-top: 1rem;
}

/* Explorateur MySQL : deux panneaux équilibrés (gauche / droite) */
.mysql-explorer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0 1.35rem;
  align-items: start;
}
.mysql-explorer__col {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}
.mysql-explorer__col--left {
  padding-right: 1rem;
  border-right: 1px solid var(--border);
}
.mysql-explorer__col--right {
  padding-left: 0.15rem;
}
.mysql-explorer__part-label {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.3;
}
.mysql-explorer__h2 {
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
}
.mysql-explorer__card {
  margin-bottom: 0;
}
.mysql-explorer__card--data {
  min-height: min(72vh, 46rem);
  display: flex;
  flex-direction: column;
}
.mysql-table-list {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  max-height: min(38vh, 22rem);
  overflow: auto;
  margin: 0;
  padding: 0;
}
.mysql-table-list__item {
  display: block;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  text-decoration: none;
  color: var(--text);
  font-size: 0.92rem;
  word-break: break-word;
  border: 1px solid transparent;
}
.mysql-table-list__item:hover {
  background: rgba(255, 255, 255, 0.06);
}
.mysql-table-list__item--on {
  background: rgba(94, 142, 255, 0.18);
  border-color: rgba(94, 142, 255, 0.35);
  font-weight: 600;
}
.mysql-explorer__struct-wrap {
  max-height: min(36vh, 24rem);
  margin: 0;
}
.mysql-struct-table {
  font-size: 0.85rem;
}
.mysql-struct-table th,
.mysql-struct-table td {
  padding: 0.35rem 0.5rem;
  vertical-align: top;
}
.mysql-explorer__data-wrap {
  flex: 1 1 auto;
  min-height: 12rem;
  max-height: min(62vh, 40rem);
  margin: 0;
}
.mysql-data-table {
  font-size: 0.88rem;
}
.mysql-data-table th,
.mysql-data-table td {
  padding: 0.4rem 0.55rem;
  vertical-align: top;
  word-break: break-word;
}
.mysql-data-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(30, 40, 54, 0.96);
}
.mysql-explorer__pager {
  margin: 0 0 0.75rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}
.mysql-explorer__err {
  margin: 0;
}
.sauvegarde-root-hint {
  word-break: break-all;
  font-size: 0.92em;
}
@media (max-width: 640px) {
  .mysql-explorer {
    grid-template-columns: 1fr;
    gap: 1.25rem 0;
  }
  .mysql-explorer__col--left {
    padding-right: 0;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1.25rem;
  }
  .mysql-explorer__col--right {
    padding-left: 0;
  }
  .mysql-table-list {
    max-height: min(28vh, 16rem);
  }
}

.main-inner {
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
  background: transparent;
}
/* Contenu : par défaut défilant ici si la page n’active pas main-inner--fill */
.main-inner__viewport {
  flex: 1 1 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
  display: flex;
  flex-direction: column;
}
/* Pages « plein cadre » : pas de scroll sur le viewport, uniquement dans les zones (cartes, colonnes) */
.main-inner--fill .main-inner__viewport {
  overflow: hidden;
}
/* layout-mobile : une seule zone de défilement (le bandeau reste hors scroll, sticky). */
body.app-body--mobile-route .main-inner--fill .main-inner__viewport {
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
body.app-body--mobile-route .main-inner--fill .main-inner__viewport > .mobile-flow-page {
  flex: 0 0 auto;
  min-height: auto;
  overflow: visible;
}
body.app-body--mobile-route .main-inner--fill .main-inner__viewport > .flow-split {
  flex: 0 0 auto;
  min-height: auto;
  overflow: visible !important;
}
/* Sortie / entrée (flow-split) en coque mobile : tout défile sous le bandeau, pas de scroll piégé dans le panier */
body.app-body--mobile-app-shell.app-body--mobile-route .flow-split__col--cart .card--flow-cart {
  flex: 0 0 auto;
  min-height: auto;
  overflow: visible;
}
body.app-body--mobile-app-shell.app-body--mobile-route .flow-cart-body {
  flex: 0 0 auto;
  min-height: auto;
}
body.app-body--mobile-app-shell.app-body--mobile-route .flow-cart-table-wrap {
  flex: 0 0 auto;
  min-height: auto;
  overflow-x: auto;
  overflow-y: visible;
  max-height: none;
}
body.app-body--mobile-app-shell.app-body--mobile-route .flow-cart-table-wrap.flow-cart-table-wrap--lines {
  overflow-x: hidden;
}
/* Stock mobile : défilement = toute la zone sous le bandeau (viewport), tableau en flux (pas de scroll interne dans .stock-scroll) */
body.app-body--mobile-app-shell.app-body--mobile-route .main-inner--fill .main-inner__viewport > .page-stock {
  flex: 0 0 auto;
  min-height: auto;
  overflow: visible;
}
body.app-body--mobile-app-shell.app-body--mobile-route .page-stock .card.card--stock-panel {
  flex: 0 0 auto;
  min-height: auto;
  overflow: visible;
}
body.app-body--mobile-app-shell.app-body--mobile-route .card--stock-panel .stock-scroll {
  flex: 0 0 auto;
  min-height: auto;
  overflow-x: auto;
  overflow-y: visible;
  max-height: none;
}
body.app-body--mobile-app-shell .page-stock .stock-page-hero .nouveau-hero-img,
body.app-body--mobile-app-shell .page-stock .stock-page-hero .nouveau-hero-text > h1 {
  display: none;
}
body.app-body--mobile-app-shell .page-stock > .stock-page-hero {
  padding: 0.55rem 0.75rem;
  gap: 0;
  margin-bottom: 0.35rem;
}
body.app-body--mobile-route .main--home .main-inner__viewport {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
/* Accueil mobile : les 6 tuiles remplissent la hauteur utile sous le bandeau (grille 1fr × 3). */
body.app-body--mobile-home.app-body--mobile-route .main--home .main-inner__viewport {
  overflow: hidden;
}
body.app-body--mobile-home.app-body--mobile-route .main--home {
  padding: 0.4rem clamp(0.65rem, 2.5vw, 1rem) 0.5rem;
}
body.app-body--mobile-home.app-body--mobile-route .main--home .home-actions {
  flex: 1 1 0;
  min-height: 0;
  gap: clamp(0.35rem, 1.4vh, 0.6rem) clamp(0.45rem, 1.8vw, 0.75rem);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
  align-content: stretch;
  justify-items: stretch;
}
body.app-body--mobile-home.app-body--mobile-route .main--home .home-action {
  width: 100%;
  height: 100%;
  max-height: 100%;
  margin-inline: 0;
  aspect-ratio: unset;
  padding: clamp(0.2rem, 1vh, 0.4rem);
  border-radius: 14px;
  box-shadow:
    0 5px 0 rgba(0, 0, 0, 0.22),
    0 12px 30px rgba(0, 0, 0, 0.26);
}
body.app-body--mobile-home.app-body--mobile-route .main--home .home-action-illus {
  width: 92%;
  height: 92%;
  max-width: 100%;
  max-height: 100%;
}
/* Même écran mobile : pas de doublon visuel titre + image (déjà dans le bandeau). */
body.app-body--mobile-app-shell .nouveau-hero.flow-page-hero .nouveau-hero-img {
  display: none;
}
body.app-body--mobile-app-shell .nouveau-hero.flow-page-hero .nouveau-hero-text > h1 {
  display: none;
}
/* Nouvelle étiquette mobile : bandeau = titre — le bloc hero (cadre) serait vide si on ne le masquait pas entièrement. */
body.app-body--mobile-app-shell .page-nouvelle-etiquette > .nouveau-hero--etiquette-banner {
  display: none;
}
/* Hero « titre + image » seulement : une fois masqués ci-dessus, il ne restait qu’un bloc vide (ex. entrée / sortie). */
body.app-body--mobile-app-shell .nouveau-hero.flow-page-hero:not(:has(.nouveau-hero-sub)):not(:has(.mysql-page-subnav)):not(:has(.stock-meta--hero)):not(:has(.chantiers-import-panel)) {
  display: none;
}
body.app-body--mobile-app-shell .card--login > h1 {
  display: none;
}
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: 1rem 1.15rem; margin-bottom: 1rem;
}
h1 { margin-top: 0; font-size: 1.45rem; }
.muted { color: var(--muted); font-size: 0.9rem; }
.btn {
  display: inline-block; padding: 0.5rem 0.9rem; border-radius: 8px; border: 1px solid var(--border);
  background: #243040; color: var(--text); font: inherit; cursor: pointer; text-decoration: none;
}
.btn:hover { background: #2c3a4d; }
.btn.primary { background: var(--accent); border-color: transparent; color: #fff; }

/* Sortie stock : actions principales (Ajouter + Enregistrer) en rouge */
.btn.btn-sortie-submit {
  background: linear-gradient(165deg, #e88888 0%, #c05050 45%, #943838 100%);
  border-color: transparent;
  color: #fff;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 2px 8px rgba(100, 35, 35, 0.35);
}
.btn.btn-sortie-submit:hover {
  background: linear-gradient(165deg, #f09898 0%, #d06060 45%, #a84848 100%);
}
.btn.btn-sortie-submit:active {
  background: linear-gradient(165deg, #c86060 0%, #903030 100%);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.2);
}
.row { margin: 0.75rem 0; }
/* Quantité + bouton Ajouter sur une même ligne */
.qty-with-action {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 0.85rem;
}
.qty-with-action > .btn {
  flex: 0 0 auto;
}
.qty-with-action .qty-stepper {
  flex: 0 1 auto;
  max-width: min(28rem, 100%);
}
/* Opérateur + enregistrer entrée : champ extensible, bouton à droite */
.row--commit-operator label {
  display: block;
  margin-bottom: 0.35rem;
}
.field-with-primary-action {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 0.85rem;
  width: 100%;
}
.field-with-primary-action > input {
  flex: 1 1 14rem;
  min-width: 0;
}
.field-with-primary-action > .btn {
  flex: 0 0 auto;
}
/* Quantité : + / − (souvent utilisé sur téléphone scan) */
.qty-stepper {
  display: flex;
  align-items: stretch;
  max-width: 28rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #121920;
}
.qty-stepper-btn {
  flex: 0 0 auto;
  min-width: 2.85rem;
  min-height: 2.65rem;
  padding: 0.35rem 0.65rem;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
  border: none;
  border-radius: 0;
  background: #243040;
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.qty-stepper-btn:hover {
  background: #2c3a4d;
}
.qty-stepper-btn:active {
  background: #1e2836;
}

/* Variantes entrée (vert + reflet) / sortie (rouge) */
.qty-stepper--entree {
  border-color: rgba(110, 210, 150, 0.5);
  box-shadow: 0 0 0 1px rgba(61, 124, 90, 0.25);
}
.qty-stepper--entree .qty-stepper-btn {
  background: linear-gradient(
    165deg,
    #6fe0a8 0%,
    #45a76f 38%,
    #2f7a4e 100%
  );
  color: #f6fffa;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.48),
    inset 0 -2px 6px rgba(0, 0, 0, 0.12),
    0 2px 8px rgba(31, 92, 60, 0.35);
}
.qty-stepper--entree .qty-stepper-btn:hover {
  background: linear-gradient(165deg, #7ef0b8 0%, #4fb77f 38%, #388a5e 100%);
}
.qty-stepper--entree .qty-stepper-btn:active {
  background: linear-gradient(165deg, #4bc888 0%, #2e8f58 100%);
  box-shadow:
    inset 0 2px 5px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.qty-stepper--sortie {
  border-color: rgba(230, 130, 130, 0.55);
  box-shadow: 0 0 0 1px rgba(180, 70, 70, 0.22);
}
.qty-stepper--sortie .qty-stepper-btn {
  background: linear-gradient(
    165deg,
    #f09090 0%,
    #c45050 40%,
    #943838 100%
  );
  color: #fff8f8;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    inset 0 -2px 6px rgba(0, 0, 0, 0.15),
    0 2px 8px rgba(120, 40, 40, 0.35);
}
.qty-stepper--sortie .qty-stepper-btn:hover {
  background: linear-gradient(165deg, #ffa0a0 0%, #d46060 40%, #a84848 100%);
}
.qty-stepper--sortie .qty-stepper-btn:active {
  background: linear-gradient(165deg, #d86868 0%, #a03838 100%);
  box-shadow:
    inset 0 2px 5px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.qty-stepper-input {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  max-width: none;
  text-align: center;
  font-variant-numeric: tabular-nums;
  border: none;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  border-radius: 0;
  padding: 0.45rem 0.35rem;
  appearance: textfield;
  -moz-appearance: textfield;
}
.qty-stepper-input::-webkit-outer-spin-button,
.qty-stepper-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.qty-stepper--entree .qty-stepper-input {
  border-left-color: rgba(110, 210, 150, 0.45);
  border-right-color: rgba(110, 210, 150, 0.45);
}
.qty-stepper--sortie .qty-stepper-input {
  border-left-color: rgba(230, 130, 130, 0.45);
  border-right-color: rgba(230, 130, 130, 0.45);
}
label { display: block; margin: 0.5rem 0 0.2rem; font-size: 0.9rem; }
input, select, textarea {
  width: 100%; max-width: 28rem; padding: 0.45rem 0.65rem; border-radius: 6px; border: 1px solid var(--border);
  background: #121920; color: var(--text); font: inherit;
}
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th, td { padding: 0.45rem 0.5rem; border-bottom: 1px solid var(--border); text-align: left; }
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.main > .flash { flex-shrink: 0; }
.flash { padding: 0.65rem 0.85rem; border-radius: 8px; margin-bottom: 0.5rem; }
.flash.ok { background: rgba(61,124,90,.2); border: 1px solid var(--accent); }
.flash.err { background: rgba(196,92,92,.15); border: 1px solid var(--danger); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.tile { color: inherit; text-decoration: none; transition: border-color .15s; }
.tile:hover { border-color: var(--accent); }
.overflow { overflow: auto; max-height: min(70vh, 640px); }
.overflow--tall { max-height: min(75vh, 900px); }
/* En-têtes de tableau visibles pendant le défilement (aperçu admin, mouvements, etc.) */
.overflow thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(26, 34, 44, 0.96);
  box-shadow: 0 1px 0 var(--border);
}
th a.sort {
  color: var(--text); text-decoration: none;
  border-bottom: 1px dotted var(--muted);
  display: block;
  margin: -0.45rem -0.5rem;
  padding: 0.45rem 0.5rem;
}
th.num a.sort {
  text-align: right;
}
th a.sort:hover { border-bottom-color: var(--accent); }
th .th-sub {
  display: block;
  font-weight: 400;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.15rem;
}
th .th-static {
  display: block;
  margin: -0.45rem -0.5rem;
  padding: 0.45rem 0.5rem;
}
th.num .th-static { text-align: right; }
.stock-toolbar {
  display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; justify-content: space-between;
  margin-bottom: 0.75rem;
}
.stock-toolbar form.stock-filter-form {
  flex: 1 1 240px;
  min-width: 0;
}
.stock-toolbar .stock-normalize-locations-form {
  flex: 0 0 auto;
  margin: 0;
}
.stock-filter-form .stock-filter-row {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}
.stock-filter-row input[type="search"] {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  max-width: none;
}
.stock-filter-row .btn {
  flex-shrink: 0;
  white-space: nowrap;
}
.stock-meta { font-size: 0.9rem; color: var(--muted); }
.pagination {
  display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-top: 0.75rem;
}
.pagination .sep { color: var(--muted); }

/* Modal étiquette (page stock) */
body.stock-label-modal--open {
  overflow: hidden;
}
.stock-label-modal {
  position: fixed;
  inset: 0;
  z-index: 8000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
}
.stock-label-modal[hidden] {
  display: none !important;
}
.stock-label-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 10, 14, 0.72);
  backdrop-filter: blur(4px);
}
.stock-label-modal__panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(100%, 36rem);
  max-height: min(94vh, 36rem);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}
.stock-label-modal__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.stock-label-modal__title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}
.stock-label-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.stock-label-modal__frame {
  width: 100%;
  flex: 0 1 auto;
  min-height: 17rem;
  max-height: min(58vh, 32rem);
  border: 0;
  background: #1e252d;
  display: block;
}

/* Image imprimante au-dessus de tout (bouton Imprimer — modal étiquette) */
.stock-printer-photo-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
  pointer-events: none;
}
.stock-printer-photo-overlay[hidden] {
  display: none !important;
}
/* Voile retiré : la page derrière reste telle quelle ; la couche sert encore au clic pour fermer */
.stock-printer-photo-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: transparent;
  pointer-events: auto;
}
.stock-printer-photo-overlay__panel {
  position: relative;
  z-index: 1;
  margin: 0 auto;
  max-width: min(94vw, 44rem);
  max-height: min(90vh, 40rem);
  line-height: 0;
  pointer-events: auto;
}
.stock-printer-photo-overlay__img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: min(90vh, 40rem);
  object-fit: contain;
  border-radius: 10px;
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(0, 0, 0, 0.12);
}
.stock-printer-photo-overlay__close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 2;
  font: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(15, 20, 26, 0.92);
  color: #e8eef4;
  cursor: pointer;
  line-height: 1.2;
}
.stock-printer-photo-overlay__close:hover {
  background: rgba(30, 38, 48, 0.95);
}

/* Modal confirmation « vider le stock » (import admin) */
body.import-clear-stock-modal--open {
  overflow: hidden;
}
.import-clear-stock-modal .stock-label-modal__panel {
  width: min(100%, 26rem);
  max-height: none;
}
.import-clear-stock-modal__body {
  padding: 1rem 1.1rem 0.25rem;
  line-height: 1.45;
}
.import-clear-stock-modal__body p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text);
}
.import-clear-stock-modal__footer {
  padding: 0.85rem 1rem 1rem;
  border-top: 1px solid var(--border);
  justify-content: flex-end;
}

/* Modal confirmation « normaliser emplacements » (page stock) */
body.stock-normalize-locations-modal--open {
  overflow: hidden;
}
.stock-normalize-locations-modal .stock-label-modal__panel {
  width: min(100%, 26rem);
  max-height: none;
}
.stock-normalize-locations-modal__body {
  padding: 1rem 1.1rem 0.25rem;
  line-height: 1.45;
}
.stock-normalize-locations-modal__body p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text);
}
/* Modal « Ajouter un chantier » (page Chantiers) */
body.chantier-add-modal--open {
  overflow: hidden;
}
.chantier-add-modal .stock-label-modal__panel {
  display: flex;
  flex-direction: column;
  width: min(100%, 26rem);
  max-height: min(92vh, 34rem);
}
.chantier-add-modal__body {
  padding: 0.35rem 1.1rem 0.5rem;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}
.chantier-add-modal__intro {
  margin: 0 0 0.85rem;
  font-size: 0.9rem;
  line-height: 1.5;
}
.chantier-add-modal__field.row {
  margin-top: 0;
  margin-bottom: 0.65rem;
}
.chantier-add-modal__field.row:last-of-type {
  margin-bottom: 0.15rem;
}
.chantier-add-modal__form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}
.chantier-add-modal__footer {
  flex-shrink: 0;
  padding: 0.85rem 1rem 1rem;
  margin: 0;
  border-top: 1px solid var(--border);
  justify-content: flex-end;
}

.stock-normalize-locations-modal__body code {
  font-size: 0.9em;
}
.stock-normalize-locations-modal__body p.stock-normalize-locations-modal__hint {
  margin-top: 0.65rem;
  font-size: 0.9rem;
}
.stock-normalize-locations-modal__footer {
  padding: 0.85rem 1rem 1rem;
  border-top: 1px solid var(--border);
  justify-content: flex-end;
}

/* Page stock : remplit la hauteur sous le menu ; seul le tableau défile */
th.col-doublon,
td.col-doublon {
  white-space: nowrap;
  text-align: center;
  font-size: 0.92rem;
}
th.col-empl-non-norm,
td.col-empl-non-norm {
  white-space: nowrap;
  text-align: center;
  font-size: 0.92rem;
}
.stock-flag {
  display: inline-block;
}
.stock-flag--oui {
  color: var(--danger);
  font-weight: 600;
}
.stock-flag--non {
  color: var(--muted);
}

.page-stock {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow: hidden;
}
/* Page Chantiers : bandeau + carte liste ; seul le tableau défile */
.page-chantiers {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow: hidden;
}
.page-chantiers > .chantiers-page-hero.nouveau-hero.flow-page-hero {
  flex-shrink: 0;
  margin-bottom: 0.35rem;
}
.card.card--chantiers-panel {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-bottom: 0;
}
.chantiers-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  flex-shrink: 0;
  margin-bottom: 0.5rem;
}
.chantiers-panel-head h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
}
.card--chantiers-panel > .muted {
  flex-shrink: 0;
}
.card--chantiers-panel > .chantiers-combo-block {
  flex-shrink: 0;
}
.chantiers-list-scroll {
  overflow: auto;
  overflow-x: auto;
  scrollbar-gutter: stable;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
}
.card--chantiers-panel .chantiers-list-scroll {
  flex: 1 1 0;
  min-height: 0;
}
.chantiers-list-scroll table {
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
}
.chantiers-list-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(26, 34, 44, 0.96);
  box-shadow: 0 1px 0 var(--border);
}
.page-stock > .stock-page-hero {
  flex-shrink: 0;
  margin-bottom: 0.35rem;
}
.page-stock .stock-page-hero .nouveau-hero-text h1 {
  margin: 0 0 0.35rem;
  font-size: 1.45rem;
}
.page-stock .stock-meta--hero {
  flex-shrink: 0;
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
}
.page-stock .stock-meta--hero strong {
  color: var(--text);
}
/* Carte stock : translucide pour laisser voir le filigrane de la page (body::after) */
.card.card--stock-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-bottom: 0;
  background: rgba(26, 34, 44, 0.22);
}
.card--stock-panel > .stock-toolbar { flex-shrink: 0; }
.card--stock-panel > .stock-grand-total { flex-shrink: 0; }
.card--stock-panel > .pagination {
  flex-shrink: 0;
  margin-top: 0.65rem;
}

/* Zone tableau — fond transparent = filigrane global de la page */
.stock-scroll.stock-scroll--loading {
  opacity: 0.6;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
.stock-scroll {
  overflow: auto;
  overflow-x: auto;
  max-height: min(68vh, 800px);
  scrollbar-gutter: stable;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
}
.card--stock-panel .stock-scroll {
  flex: 1 1 0;
  min-height: 0;
  max-height: none;
}
/* border-collapse: separate évite que le corps du tableau se peigne au-dessus des lignes sticky (collapse + sticky est buggé sur plusieurs moteurs). */
.stock-scroll table {
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
}
.stock-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: var(--card);
  box-shadow: 0 1px 0 var(--border);
  vertical-align: bottom;
}
.stock-scroll tbody tr {
  background: rgba(15, 20, 25, 0.1);
}
.stock-scroll tbody tr:nth-child(even) {
  background: rgba(15, 20, 25, 0.16);
}
.stock-scroll tfoot td {
  position: sticky;
  bottom: 0;
  z-index: 3;
  background: var(--card);
  font-weight: 600;
  border-top: 2px solid var(--accent);
  box-shadow: 0 -1px 0 var(--border);
  vertical-align: middle;
}
.stock-scroll thead th:first-child {
  border-top-left-radius: 7px;
}
.stock-scroll thead th:last-child {
  border-top-right-radius: 7px;
}
th.col-csv-ligne,
td.col-csv-ligne {
  max-width: 5rem;
  white-space: nowrap;
}
.stock-grand-total {
  margin: 0.85rem 0 0;
  padding: 0.65rem 0.85rem;
  background: rgba(61, 124, 90, 0.12);
  border: 1px solid var(--accent);
  border-radius: 8px;
  font-size: 0.95rem;
}
.stock-grand-total strong { font-weight: 700; }

/* Import CSV : option en-tête + ligne fichier */
.import-csv-header-option {
  margin: 0 0 0.85rem;
}
.import-csv-header-option.row {
  margin-bottom: 0.85rem;
}
.import-csv-header-label {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.95rem;
  cursor: pointer;
  margin: 0 0 0.35rem;
}
.import-csv-header-label input {
  margin-top: 0.2rem;
  flex-shrink: 0;
  width: auto;
  max-width: none;
}
.import-csv-header-hint {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.35;
  max-width: 40rem;
}
.import-csv-danger-zone {
  padding: 0.65rem 0 0.65rem 0.75rem;
  border-left: 3px solid var(--danger);
  border-radius: 0 4px 4px 0;
  background: rgba(196, 92, 92, 0.08);
}

/* Import CSV : ligne fichier (bouton stylé) + importer à droite */
.import-csv-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem 1rem;
}
.import-csv-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 0.9rem;
  flex: 1 1 12rem;
  min-width: 0;
}
.import-csv-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.import-csv-file-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.52rem 1.05rem;
  border-radius: 8px;
  border: 1px solid rgba(126, 185, 154, 0.55);
  background: linear-gradient(180deg, rgba(94, 214, 154, 0.16), rgba(61, 124, 90, 0.12));
  color: var(--text);
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  flex-shrink: 0;
}
.import-csv-file-btn:hover {
  background: linear-gradient(180deg, rgba(94, 214, 154, 0.26), rgba(61, 124, 90, 0.2));
  border-color: rgba(126, 215, 170, 0.75);
}
.import-csv-file-input:focus-visible + .import-csv-file-btn {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.import-csv-filename {
  font-size: 0.88rem;
  min-width: 0;
  flex: 1 1 8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.import-csv-submit {
  flex-shrink: 0;
  margin-left: auto;
}
@media (max-width: 520px) {
  .import-csv-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .import-csv-submit {
    margin-left: 0;
  }
}

/* Import CSV : overlay progression */
body.import-csv-loading {
  overflow: hidden;
}
.import-csv-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1rem;
  background: rgba(10, 14, 18, 0.82);
  backdrop-filter: blur(6px);
}
.import-csv-overlay.is-open {
  display: flex;
}
.import-csv-overlay[hidden]:not(.is-open) {
  display: none !important;
}
.import-csv-overlay-box {
  text-align: center;
  padding: 1.75rem 2rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  max-width: min(92vw, 22rem);
}
.import-csv-overlay-spinner {
  width: 2.75rem;
  height: 2.75rem;
  margin: 0 auto 1rem;
  border: 3px solid var(--border);
  border-top-color: #7eb99a;
  border-radius: 50%;
  animation: import-csv-spin 0.75s linear infinite;
}
@keyframes import-csv-spin {
  to { transform: rotate(360deg); }
}
.import-csv-overlay-pct {
  margin: 0 0 0.35rem;
  font-size: 1.85rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  color: var(--text);
}
.import-csv-overlay-pct span {
  display: inline-block;
  min-width: 3.2ch;
  text-align: right;
}
.import-csv-overlay-hint {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.35;
}
