/* PTI Caisse — DA du logo : blanc / gris clair / noir, sobre et sans accent coloré.
   Le seul repère typographique volontaire : les chiffres qui représentent de l'argent
   sont systématiquement en monospace (ticket, stats, rapport Z) — un fil rouge visuel
   qui ne dépend d'aucune couleur. Le vert / ambre / rouge n'est conservé que pour un
   petit nombre de signaux fonctionnels (danger, stock bas, statut synchronisé) — pas
   comme identité visuelle. */

:root {
  color-scheme: light;
  --ink: #121212;
  --ink-2: #2c2c2c;
  --muted: #6b6b6b;
  --muted-2: #999999;
  --line: #e2e2e2;
  --line-soft: #ececec;
  --canvas: #f5f5f5;
  --panel: #ffffff;
  --panel-soft: #f7f7f7;
  --green: #1c7a4d;
  --green-soft: #e9f5ee;
  --amber: #92600a;
  --amber-soft: #faf1de;
  --red: #b3261e;
  --red-soft: #fbeceb;
  --strong: #121212;
  --strong-hover: #2c2c2c;
  --strong-text: #ffffff;
  --sidebar: #111111;
  --sidebar-line: #292929;
  --nav-active: #ffffff;
  --shadow: 0 20px 48px rgba(0, 0, 0, .14);
  --radius: 14px;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", "Roboto Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body, #app { min-height: 100%; width: 100%; max-width: 100%; overflow-x: hidden; }

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--canvas);
  color: var(--ink);
  font: 14px/1.45 var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
button { color: inherit; }
/* Contour de focus (4.92.0) : plein, 2 px, à la couleur du texte (lisible en thème sombre) ; blanc sur le menu sombre. */
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
.sidebar :focus-visible { outline-color: #fff; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.hidden { display: none !important; }
.muted { color: var(--muted); }
.danger-text { color: var(--red); }
.success-text { color: var(--green); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }

.boot-screen {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  background: var(--panel);
}
.boot-screen img { width: min(360px, 70vw); height: auto; }
.boot-screen p { margin: 0; color: var(--muted); }
.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--line-soft);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 45%) 1fr;
  background: var(--panel);
}
.auth-brand {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px;
  color: #fff;
  background:
    radial-gradient(85% 65% at 12% -8%, rgba(255, 255, 255, .05), transparent 60%),
    #0d0d0d;
}
.auth-brand::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  right: -170px;
  bottom: -160px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 50%;
  box-shadow: 0 0 0 64px rgba(255, 255, 255, .02), 0 0 0 128px rgba(255, 255, 255, .014);
}
.auth-brand img { position: relative; z-index: 1; width: min(360px, 80%); filter: invert(1); }
.auth-promise { position: relative; z-index: 1; max-width: 500px; }
.auth-promise h2 { margin: 0 0 12px; font-size: clamp(30px, 4vw, 52px); line-height: 1.02; letter-spacing: -.045em; }
.auth-promise p { max-width: 420px; margin: 0; color: rgba(255, 255, 255, .65); font-size: 16px; }
.auth-features { position: relative; z-index: 1; display: grid; gap: 10px; color: rgba(255, 255, 255, .76); }
.auth-features span { display: flex; gap: 9px; align-items: center; }
.auth-features i { width: 7px; height: 7px; border-radius: 50%; background: #fff; }
.auth-form-wrap { display: grid; place-items: center; padding: 30px; }
.auth-card { width: min(440px, 100%); }
.auth-mobile-logo { display: none; }
.eyebrow { display: inline-block; margin-bottom: 14px; color: var(--muted); font-size: 11px; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.auth-card h1 { margin: 0 0 10px; font-size: 36px; letter-spacing: -.04em; }
.auth-card > p { margin: 0 0 28px; color: var(--muted); font-size: 15px; }
/* Comptes de confiance de cet appareil (4.92.0) : un toucher mène au pavé du code. */
.known-accounts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: -12px 0 22px; }
.known-accounts .button { justify-content: flex-start; min-height: 48px; min-width: 0; }
.known-accounts .button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.field { display: grid; align-content: start; gap: 7px; margin-bottom: 15px; color: var(--ink-2); font-size: 13px; font-weight: 750; }
.field input, .field select, .field textarea, .input {
  width: 100%;
  border: 1px solid #d4d4d4;
  border-radius: 11px;
  background: var(--panel);
  color: var(--ink);
  padding: 0 13px;
  min-height: 45px;
  outline: none;
  transition: border-color .12s var(--ease), box-shadow .12s var(--ease);
}
.field textarea { min-height: 90px; padding-top: 11px; resize: vertical; }
/* « Afficher plus » des longues listes (4.65.0, grands catalogues). */
.list-more { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 14px 4px; color: var(--muted); font-size: 13px; }
/* Œil des cases de mot de passe (4.64.0). */
.password-wrap { position: relative; display: block; }
.field .password-wrap > input { padding-right: 46px; }
.password-eye { position: absolute; top: 0; right: 0; width: 46px; height: 100%; display: grid; place-items: center; padding: 0; border: 0; border-radius: 0 11px 11px 0; background: none; color: var(--muted); cursor: pointer; }
.password-eye:hover, .password-eye[aria-pressed="true"] { color: var(--ink); }
.password-eye:focus-visible { outline: 2px solid var(--ink); outline-offset: -4px; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(18, 18, 18, .09); }
.field-note { color: var(--muted); font-size: 11px; font-weight: 500; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid .wide { grid-column: 1 / -1; }
.auth-error, .inline-error { padding: 11px 13px; margin: 0 0 15px; border: 1px solid #f0c3ba; border-radius: 10px; background: var(--red-soft); color: var(--red); font-weight: 650; }
.security-note { margin-top: 18px; color: var(--muted-2); font-size: 11px; text-align: center; }
.security-note + .security-note { margin-top: 4px; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 15px;
  border: 0;
  border-radius: 10px;
  background: var(--strong);
  color: var(--strong-text);
  font-weight: 760;
  cursor: pointer;
  text-decoration: none;
  transition: transform .12s var(--ease), background .12s var(--ease), opacity .12s var(--ease);
}
.button:hover { transform: translateY(-1px); background: var(--strong-hover); }
.button:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.button.full { width: 100%; }
.button.primary { background: var(--strong); }
.button.primary:hover { background: var(--strong-hover); }
.button.secondary { background: #eeeeee; color: var(--ink); }
.button.secondary:hover { background: #e2e2e2; }
.button.ghost { border: 1px solid var(--line); background: var(--panel); color: var(--ink); }
.button.danger { background: var(--red); }
.button.danger-soft { background: var(--red-soft); color: var(--red); }
.button.small { min-height: 34px; padding: 0 11px; border-radius: 8px; font-size: 12px; }
.icon-button { width: 38px; height: 38px; padding: 0; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); display: inline-grid; place-items: center; cursor: pointer; }
.icon-button:hover { background: var(--panel-soft); }
.icon-button:disabled { opacity: .35; cursor: not-allowed; }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.app-shell { width: 100%; max-width: 100%; min-height: 100vh; display: block; padding-left: 236px; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  width: 236px;
  height: 100vh; height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  border-right: 1px solid var(--sidebar-line);
  background: var(--sidebar);
  color: #fff;
}
.sidebar-logo { padding: 5px 10px 26px; }
.sidebar-logo img { width: 184px; max-width: 100%; filter: invert(1); }
.nav { display: grid; gap: 5px; }
.nav-button {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 45px;
  padding: 0 13px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: rgba(255, 255, 255, .6);
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: background .12s var(--ease), color .12s var(--ease);
}
.nav-button:hover { color: #fff; background: rgba(255, 255, 255, .07); }
.nav-button.active { color: #fff; background: rgba(255, 255, 255, .12); }
.nav-button::before { content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px; border-radius: 999px; background: transparent; }
.nav-button.active::before { background: var(--nav-active); }
.nav-button .count { margin-left: auto; min-width: 22px; padding: 2px 6px; border-radius: 999px; background: rgba(255, 255, 255, .14); font-size: 10px; text-align: center; font-family: var(--font-mono); }
.sidebar-footer { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .1); }
.workspace-card { width: 100%; padding: 11px; border: 1px solid rgba(255, 255, 255, .12); border-radius: 11px; background: rgba(255, 255, 255, .05); color: #fff; text-align: left; cursor: pointer; }
.workspace-card:hover { border-color: rgba(255, 255, 255, .24); background: rgba(255, 255, 255, .08); }
.workspace-card.static, .workspace-card.static:hover { cursor: default; border-color: rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .05); }
.workspace-label { display: block; color: rgba(255, 255, 255, .42); font-size: 8px; font-weight: 850; letter-spacing: .12em; }
.workspace-name { display: block; margin: 4px 0 8px; overflow-wrap: anywhere; line-height: 1.3; font-size: 11px; font-weight: 800; }
.workspace-card.static .workspace-name { margin-bottom: 0; }
.workspace-action { display: flex; align-items: center; gap: 5px; color: rgba(255, 255, 255, .7); font-size: 9px; font-weight: 750; }
.workspace-action .icon { width: 13px; height: 13px; }
.user-chip { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 10px; align-items: center; width: 100%; padding: 9px; border: 0; border-radius: 10px; background: transparent; color: #fff; text-align: left; cursor: pointer; }
.user-chip:hover { background: rgba(255, 255, 255, .06); }
.cell-product .avatar { background: var(--strong); color: var(--strong-text); font-size: 12px; }
.avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; background: rgba(255, 255, 255, .14); color: #fff; font-weight: 850; }
/* Un nom long (« Pacific Studio · Assistance ») passe à la ligne au lieu d'élargir la barre. */
.user-chip strong { display: block; overflow-wrap: anywhere; line-height: 1.25; font-size: 12px; }
.user-chip small { color: rgba(255, 255, 255, .5); font-size: 10px; }

.mobile-header { display: none; }
.mobile-header > div { display: flex; align-items: center; gap: 4px; min-width: 0; }
.mobile-workspace { display: flex; align-items: center; gap: 6px; min-width: 0; max-width: 190px; padding: 7px 9px !important; border: 1px solid var(--line) !important; border-radius: 9px; background: var(--panel) !important; color: var(--ink); }
.mobile-workspace span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; font-weight: 750; }
.mobile-workspace .icon { flex: 0 0 auto; width: 15px; height: 15px; }
.app-main { width: 100%; max-width: 100%; min-width: 0; padding: 28px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 22px; }
.page-head h1 { margin: 0 0 3px; font-size: 28px; letter-spacing: -.035em; }
.page-head p { margin: 0; color: var(--muted); }
.page-head > div:first-child, .section-head > div:first-child { min-width: 0; }
.page-actions { min-width: 0; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; align-items: center; }
.sync-pill { display: inline-flex; gap: 6px; align-items: center; padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--green); font-size: 11px; font-weight: 750; }
.sync-pill i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.cashier-layout { width: 100%; max-width: 100%; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 20px; align-items: start; }
.cashier-layout > *, .catalog-panel, .ticket-panel, .panel { max-width: 100%; min-width: 0; }
.catalog-panel, .ticket-panel, .panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: 0 8px 26px rgba(0, 0, 0, .045); }
.catalog-panel { padding: 18px; }
.scanner-box { width: 100%; max-width: 100%; min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 11px; align-items: center; padding: 6px 8px 6px 13px; border: 2px solid var(--ink); border-radius: 12px; background: var(--panel); transition: border-color .12s var(--ease), box-shadow .12s var(--ease); }
.scanner-box.reading { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(18, 18, 18, .08); }
.scanner-box.error { border-color: var(--red); }
.scanner-box input { min-width: 0; height: 39px; border: 0; outline: 0; background: transparent; font-size: 15px; }
/* Croix « Effacer » (4.92.0) : dans le champ, seulement quand il contient du texte. */
.scanner-field { min-width: 0; display: flex; align-items: center; }
.scanner-field input { flex: 1 1 auto; width: 100%; }
.scanner-clear { flex: none; width: 36px; height: 36px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; }
#scannerInput:placeholder-shown + .scanner-clear { display: none; }
.empty-state .empty-actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 14px; margin-top: 12px; }
.scanner-state { display: inline-flex; gap: 6px; align-items: center; min-width: 105px; padding: 8px 10px; border-radius: 8px; background: var(--green-soft); color: var(--green); font-size: 11px; font-weight: 800; }
.scanner-state i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
/* Scanner à la caméra (4.56.0) : bouton sur téléphone et tablette, écran plein au-dessus des fenêtres
 * (100) et sous les messages (.toast, 150), qui annoncent l'article ajouté ou le code inconnu. */
.scanner-box.has-camera { grid-template-columns: auto minmax(0, 1fr) auto auto; }
.scanner-camera { display: inline-grid; place-items: center; width: 46px; height: 40px; padding: 0; border: 0; border-radius: 9px; background: var(--ink); color: var(--panel); cursor: pointer; }
.scanner-camera .icon { width: 22px; height: 22px; }
/* 4.57.0 : le même bouton à côté d'un champ (code-barres de l'article, comptage, bon d'achat). */
.input-camera { display: flex; gap: 8px; align-items: stretch; min-width: 0; }
.input-camera input { flex: 1 1 auto; min-width: 0; width: auto; }
.input-camera .scanner-camera, .credit-pay-input .scanner-camera { flex: 0 0 auto; height: auto; min-height: 44px; }
.camera-text-button { justify-self: start; margin: 2px 0 12px; }
.camera-scanner { position: fixed; inset: 0; z-index: 140; background: #000; overflow: hidden; }
.camera-scanner video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.camera-frame { position: absolute; left: 50%; top: 42%; width: min(80vw, 440px); height: min(48vw, 260px); transform: translate(-50%, -50%); border: 3px solid rgba(255, 255, 255, .92); border-radius: 18px; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .42); }
.camera-frame.read-ok { --flash: #34c77b; animation: camera-read .7s ease-out; }
.camera-frame.read-error { --flash: #ff5a4f; animation: camera-read .7s ease-out; }
@keyframes camera-read { from { border-color: var(--flash); border-width: 6px; } }
.camera-bar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; gap: 14px; align-items: center; justify-content: space-between; padding: 18px max(16px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); background: linear-gradient(transparent, rgba(0, 0, 0, .78)); color: #fff; }
.camera-status { margin: 0; min-width: 0; font-size: 15px; font-weight: 700; overflow-wrap: anywhere; }
.camera-status.error { color: #ffb4ad; }
.camera-done { flex: 0 0 auto; min-height: 48px; padding: 0 24px; }
.scanner-help { min-width: 0; display: flex; justify-content: space-between; gap: 12px; margin: 9px 2px 15px; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.chips { width: 100%; max-width: 100%; min-width: 0; display: flex; gap: 7px; overflow-x: auto; overscroll-behavior-inline: contain; padding-bottom: 3px; scrollbar-width: none; }
.chip { flex: 0 0 auto; min-height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--muted); font-weight: 700; cursor: pointer; transition: background .12s var(--ease), border-color .12s var(--ease); }
.chip.active { border-color: var(--strong); background: var(--strong); color: var(--strong-text); }
.filter-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 14px 0; }
.filter-row strong { font-size: 13px; }
.switch-label { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; cursor: pointer; }
.switch-label input { accent-color: var(--ink); }
/* 4.51.1 : jusqu’à quatre tuiles par ligne, jamais moins de 120 px de large (trois, puis deux, sur un écran étroit). */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(max(120px, calc((100% - 33px) / 4)), 1fr)); gap: 11px; }
.product-card { position: relative; min-width: 0; padding: 13px; border: 1px solid var(--line-soft); border-radius: 12px; background: var(--panel); text-align: left; cursor: pointer; transition: border-color .12s var(--ease), transform .12s var(--ease), box-shadow .12s var(--ease); }
.product-card:hover { transform: translateY(-2px); border-color: #bdbdbd; box-shadow: 0 10px 22px rgba(0, 0, 0, .08); }
.product-card:disabled, .product-card[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none; }
/* Photo produit : s'ajoute au-dessus du sigle/texte existants sans les
 * remplacer — le nom, la description, le prix et le SKU restent visibles
 * en dessous comme avant l'ajout des photos. */
.product-photo { margin: -13px -13px 10px; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 12px 12px 0 0; background: var(--panel-soft); }
.product-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.product-mark { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 10px; background: var(--line-soft); color: var(--ink-2); font-size: 11px; font-weight: 900; letter-spacing: -.02em; font-family: var(--font-mono); }
.tone-blue, .tone-sky, .tone-cyan, .tone-navy, .tone-violet, .tone-rose, .tone-green, .tone-lime, .tone-orange, .tone-amber, .tone-red { background: var(--line-soft); color: var(--ink-2); }
.stock-tag { padding: 4px 6px; border-radius: 6px; background: var(--green-soft); color: var(--green); font-size: 9px; font-weight: 850; font-family: var(--font-mono); }
.stock-tag.low { background: var(--amber-soft); color: var(--amber); }
.stock-tag.out { background: var(--red-soft); color: var(--red); }
/* 4.51.1 : quatre tuiles par ligne, le nom va sur deux lignes au lieu d'être coupé (« Carpaccio de thon… »). */
.product-card h3 { min-height: 34px; margin: 12px 0 2px; overflow: hidden; white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: 13px; }
.product-card p { min-height: 31px; margin: 0 0 10px; color: var(--muted); font-size: 10px; }
.product-price { min-width: 0; display: flex; justify-content: space-between; align-items: end; gap: 6px; font-size: 15px; font-weight: 850; font-family: var(--font-mono); }
.product-price small { min-width: 0; overflow: hidden; color: var(--muted-2); font-size: 9px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-sans); }
.empty-state { grid-column: 1 / -1; padding: 50px 20px; text-align: center; color: var(--muted); }

.ticket-panel { position: sticky; top: 20px; overflow: hidden; }
.ticket-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 17px; border-bottom: 1px solid var(--line); }
.ticket-head h2 { margin: 0; font-size: 16px; }
.ticket-count { min-width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; background: var(--strong); color: var(--strong-text); font-size: 10px; font-family: var(--font-mono); }
/* « Vider » (4.92.0) : à côté du compteur ; sur le téléphone, au-dessus des lignes du ticket. */
.ticket-clear { margin: 0 8px 0 auto; }
.mobile-ticket-clear { display: flex; justify-content: flex-end; padding: 10px 17px 0; }
.mobile-ticket-clear .ticket-clear { margin: 0; }
.ticket-lines { min-height: 238px; max-height: calc(100vh - 480px); overflow: auto; padding: 4px 16px; }
.empty-ticket { min-height: 220px; display: grid; place-content: center; justify-items: center; gap: 10px; color: var(--muted-2); text-align: center; }
.empty-ticket .icon { width: 34px; height: 34px; }
.ticket-line { display: grid; grid-template-columns: 1fr auto; gap: 9px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.ticket-line h4 { margin: 0 0 2px; font-size: 12px; }
.ticket-line p { margin: 0; color: var(--muted); font-size: 10px; }
.line-supplements { margin: 2px 0; color: var(--muted-2); font-size: 10px; font-weight: 600; }
.product-card.has-variants .product-price small { display: flex; align-items: center; gap: 3px; color: var(--ink); font-weight: 700; }
.product-card.has-variants .product-price small .icon { width: 11px; height: 11px; }
.line-total { font-weight: 850; font-size: 12px; text-align: right; font-family: var(--font-mono); }
.quantity { display: inline-flex; align-items: center; gap: 7px; margin-top: 8px; }
.quantity button { width: 27px; height: 27px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); cursor: pointer; }
.quantity span { min-width: 18px; text-align: center; font-size: 11px; font-weight: 800; font-family: var(--font-mono); }
/* Quantité à taper (4.92.0) : le nombre est un bouton, de la taille des − et +. */
.quantity .quantity-value { width: auto; min-width: 34px; padding: 0 6px; font-size: 11px; font-weight: 800; font-family: var(--font-mono); color: var(--ink); }
.ticket-options { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ticket-options button { min-height: 45px; padding: 8px 12px; border: 0; background: var(--panel-soft); color: var(--muted); font-size: 11px; cursor: pointer; }
.ticket-options button + button { border-left: 1px solid var(--line); }
.ticket-options strong { display: block; color: var(--ink); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.totals { display: grid; gap: 8px; padding: 15px 17px; }
.total-row { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 11px; }
.total-row strong { color: var(--ink); font-family: var(--font-mono); }
.total-row.grand { align-items: end; margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--ink); font-size: 14px; }
.total-row.grand strong { font-size: 26px; letter-spacing: -.03em; }
.ticket-actions { display: grid; grid-template-columns: 58px 1fr; gap: 9px; padding: 0 17px 17px; }
.receipt-print-frame { position: fixed; right: 0; bottom: 0; width: 1px; height: 1px; border: 0; opacity: 0; pointer-events: none; }
.mobile-cart-dock { display: none; }
.mobile-ticket-modal .modal-body { padding: 0; }
.mobile-ticket-lines { max-height: min(48vh, 460px); overflow: auto; padding: 4px 17px; overscroll-behavior: contain; }
.mobile-ticket-hold { padding: 0 17px 17px; }
.mobile-ticket-actions { position: sticky; bottom: 0; z-index: 2; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 11px; margin-bottom: 18px; }
.stat { padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel); }
.stat span { display: block; color: var(--muted); font-size: 10px; font-weight: 700; }
.stat strong { display: block; margin-top: 6px; font-size: 20px; letter-spacing: -.02em; font-family: var(--font-mono); }
.table-wrap { max-width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); -webkit-overflow-scrolling: touch; overscroll-behavior-inline: contain; }
.data-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.data-table th { padding: 12px 14px; background: var(--panel-soft); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 10px; font-weight: 850; letter-spacing: .06em; text-align: left; text-transform: uppercase; }
.data-table td { padding: 13px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr.clickable { cursor: pointer; }
.data-table tbody tr.clickable:hover { background: var(--panel-soft); }
.cell-product { display: flex; gap: 10px; align-items: center; }
.cell-product .product-mark { flex: 0 0 auto; width: 34px; height: 34px; }
.cell-product strong { display: block; font-size: 12px; }
.cell-product small { color: var(--muted); font-size: 10px; }
.status-badge { display: inline-flex; padding: 5px 8px; border-radius: 999px; background: var(--line-soft); color: var(--ink-2); font-size: 9px; font-weight: 850; }
.status-badge.cancelled { background: var(--red-soft); color: var(--red); }
.status-badge.cashier { background: var(--line-soft); color: var(--ink-2); }
.row-actions { display: flex; justify-content: flex-end; gap: 6px; }
.users-table .row-actions .button { white-space: nowrap; }

.closing-grid { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 18px; align-items: start; }
.panel { padding: 20px; }
.panel h2 { margin: 0 0 4px; font-size: 17px; }
.panel > p { margin: 0 0 18px; color: var(--muted); font-size: 12px; }
.expected-cash { padding: 16px; margin-bottom: 17px; border-radius: 12px; background: var(--strong); color: var(--strong-text); }
.expected-cash span { display: block; color: rgba(255, 255, 255, .57); font-size: 10px; }
.expected-cash strong { display: block; margin-top: 5px; font-size: 28px; font-family: var(--font-mono); }
.closure-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; }
.closure-card { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 13px; border: 1px solid var(--line-soft); border-radius: 11px; }
.panel-span-full { grid-column: 1 / -1; }
.closure-card h3 { margin: 0 0 2px; font-size: 12px; }
.closure-card p { margin: 0; color: var(--muted); font-size: 10px; }
.variance { font-weight: 850; text-align: right; font-family: var(--font-mono); }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 22px; background: rgba(0, 0, 0, .62); backdrop-filter: blur(5px); }
.modal { width: min(560px, 100%); max-height: calc(100vh - 44px); overflow: auto; overscroll-behavior: contain; border-radius: 18px; background: var(--panel); box-shadow: 0 28px 90px rgba(0, 0, 0, .3); }
.modal.wide { width: min(820px, 100%); }
.modal.small { width: min(420px, 100%); }
.modal-head { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 19px 21px; border-bottom: 1px solid var(--line); background: var(--panel); background: color-mix(in srgb, var(--panel) 97%, transparent); }
.modal-head h2 { margin: 0 0 2px; font-size: 19px; }
.modal-head p { margin: 0; color: var(--muted); font-size: 11px; }
.modal-body { padding: 21px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 15px 21px; border-top: 1px solid var(--line); background: var(--panel-soft); }
.modal-actions.split { justify-content: space-between; }
.modal-actions > div { display: flex; gap: 8px; }
.choice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
/* Quatre moyens (4.54.0, avec le chèque) : deux par ligne plutôt que trois puis un seul. */
.choice-grid:has(> :nth-child(4):last-child) { grid-template-columns: repeat(2, 1fr); }
/* Deux tuiles côte à côte (4.83.0, commission ou loyer d'un collaborateur), sans :has pour les navigateurs anciens. */
.choice-grid.two { grid-template-columns: repeat(2, 1fr); margin-bottom: 14px; }
.choice { min-height: 83px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel); cursor: pointer; text-align: left; }
.choice:hover, .choice.active { border-color: var(--ink); background: var(--panel-soft); }
.choice strong { display: block; margin-top: 8px; }
.choice small { color: var(--muted); }
.amount-presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin: 10px 0 16px; }
.amount-presets button { min-height: 34px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); cursor: pointer; font-size: 11px; font-family: var(--font-mono); }
.payment-total { display: flex; justify-content: space-between; align-items: end; padding: 14px; margin-bottom: 15px; border-radius: 11px; background: var(--strong); color: var(--strong-text); }
.payment-total span { color: rgba(255, 255, 255, .6); }
.payment-total strong { font-size: 26px; font-family: var(--font-mono); }
.label-kind { display: flex; gap: 7px; margin-bottom: 15px; }
.label-kind button { flex: 1; min-height: 40px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); cursor: pointer; font-weight: 750; }
.label-kind button.active { border-color: var(--strong); background: var(--strong); color: var(--strong-text); }
.label-stage { display: grid; place-items: center; min-height: 290px; padding: 28px; border: 1px dashed #cfcfcf; border-radius: 13px; background: var(--panel-soft); overflow: auto; }
.label-preview { width: min(570px, 100%); filter: drop-shadow(0 12px 24px rgba(0, 0, 0, .16)); }
.label-preview svg { display: block; width: 100%; height: auto; }
.product-detail-grid { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 15px; margin-bottom: 16px; border: 1px solid var(--line); border-radius: 12px; }
.product-detail-grid h3 { margin: 0 0 3px; }
.product-detail-grid p { margin: 0; color: var(--muted); }
.product-detail-grid strong { font-size: 20px; font-family: var(--font-mono); }
.inline-create { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; align-items: end; padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.inline-create .field { margin: 0; }
.manager-list { display: grid; margin-top: 10px; }
.manager-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; min-height: 58px; padding: 9px 2px; border-bottom: 1px solid var(--line-soft); }
.manager-row:last-child { border-bottom: 0; }
.manager-row strong, .manager-row small { display: block; }
.manager-row small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.section-label { margin: 7px 0 10px; padding-top: 17px; border-top: 1px solid var(--line); color: var(--ink); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.optional-section { padding: 16px 0 3px; margin-top: 4px; border-top: 1px solid var(--line); }
.optional-section strong { font-size: 12px; }
.optional-section p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.field > small { color: var(--muted); font-size: 10px; font-weight: 550; }
.organization-intro { display: grid; grid-template-columns: 48px 1fr; gap: 13px; align-items: center; padding: 14px; margin-bottom: 14px; border-radius: 12px; background: var(--line-soft); color: var(--ink); }
.organization-intro > span { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 12px; background: var(--panel); }
.organization-intro p { margin: 2px 0 0; color: var(--muted); font-size: 11px; }
.organization-list { display: grid; gap: 9px; }
/* Espaces clients et Abonnements : une section par domaine d'activité. */
.space-group { margin-top: 18px; scroll-margin-top: 16px; }
.space-group-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin: 0 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line); color: var(--ink); font-size: 12px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.space-group-title span { padding: 2px 7px; border-radius: 999px; background: var(--line-soft); color: var(--muted); font-size: 10px; letter-spacing: 0; }
.space-group-title small { margin-left: auto; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: 0; text-transform: none; }
.space-group.demo { padding: 10px 12px 12px; border: 1px dashed var(--line); border-radius: 12px; background: var(--line-soft); }
.space-group.demo .space-group-title { border-bottom-style: dashed; }
.space-family-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.space-family-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--ink); font-size: 11px; text-decoration: none; }
.space-family-chip b { color: var(--muted); }
.space-family-chip.demo { border-style: dashed; color: var(--muted); }
.organization-card { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.organization-card.current { border-color: #a8a8a8; box-shadow: 0 0 0 3px rgba(18, 18, 18, .07); }
.organization-card.inactive { opacity: .55; background: var(--panel-soft); }
.organization-mark, .receipt-business-mark { display: grid; place-items: center; border-radius: 10px; background: var(--strong); color: var(--strong-text); font-weight: 900; }
.organization-mark { width: 44px; height: 44px; }
.organization-copy { min-width: 0; }
.organization-copy strong { margin-right: 7px; }
.organization-copy small { display: block; margin-top: 2px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.organization-actions { display: flex; align-items: center; gap: 6px; }
.mini-badge { display: inline-flex; margin-right: 5px; padding: 3px 5px; border-radius: 999px; background: var(--panel-soft); color: var(--muted); font-size: 7px; font-weight: 900; vertical-align: middle; }
.mini-badge.current { background: var(--green-soft); color: var(--green); }
.receipt { width: 100%; padding: 8px 5px 3px; color: #111; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.receipt-brand { display: grid; justify-items: center; padding: 5px 0 17px; text-align: center; }
.receipt-brand img { width: 230px; max-width: 78%; }
.receipt-brand h3 { margin: 7px 0 0; max-width: 100%; font: 850 17px/1.1 var(--font-sans); letter-spacing: -.02em; }
.receipt-brand p { margin: 8px 0 0; font-size: 9px; font-weight: 900; letter-spacing: .16em; }
.receipt-business-mark { width: 54px; height: 54px; margin-bottom: 3px; font: 900 17px var(--font-sans); }
.receipt-meta { display: grid; gap: 0; padding: 10px 0; border-top: 2px solid #111; border-bottom: 1px dashed #888; font-size: 10px; }
.receipt-meta div { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 8px; padding: 2px 0; }
.receipt-meta span { color: #555; }
.receipt-meta strong { overflow-wrap: anywhere; text-align: right; }
.receipt-columns { display: flex; justify-content: space-between; padding: 11px 0 6px; border-bottom: 1px solid #111; font-size: 9px; font-weight: 900; }
.receipt-items { display: grid; }
.receipt-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 9px 0; border-bottom: 1px dashed #aaa; font-size: 10px; }
.receipt-item b { display: block; line-height: 1.35; }
.receipt-item small { display: block; margin-top: 3px; color: #555; font-size: 8px; }
.receipt-item > strong { white-space: nowrap; }
.receipt-totals { display: grid; gap: 6px; padding: 13px 0; border-bottom: 2px solid #111; }
.receipt-totals div { display: flex; justify-content: space-between; gap: 12px; font-size: 10px; }
.receipt-totals .grand { align-items: baseline; padding: 8px 0; margin: 3px 0; border-top: 1px solid #111; border-bottom: 1px solid #111; font-size: 18px; font-weight: 950; }
.receipt-footer { display: grid; justify-items: center; gap: 4px; padding: 18px 0 7px; text-align: center; }
.receipt-footer strong { font-size: 10px; letter-spacing: .09em; }
.receipt-footer span { max-width: 250px; font-size: 9px; }
.receipt-footer small { margin-top: 6px; color: #666; font-size: 8px; }
.receipt-output-note { display: grid; gap: 2px; padding: 11px 12px; margin-top: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-soft); color: var(--muted); font-size: 10px; }
.receipt-output-note strong { color: var(--ink); font-size: 11px; }
.receipt-output-note span { line-height: 1.4; }
.receipt-output-note .ios-print-hint { padding-top: 8px; margin-top: 6px; border-top: 1px solid var(--line); color: var(--muted); }
.receipt-print-controls { display: grid; gap: 5px; padding-top: 15px; margin-top: 13px; border-top: 1px solid var(--line); }
.receipt-print-controls label { display: grid; gap: 7px; }
.receipt-print-controls strong { font-size: 11px; }
.receipt-print-controls select { width: 100%; min-height: 42px; padding: 0 38px 0 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); color: var(--ink); font-weight: 700; }
.receipt-print-controls small { color: var(--muted); font-size: 9px; }
.confirm-icon { width: 54px; height: 54px; display: grid; place-items: center; margin-bottom: 14px; border-radius: 15px; background: var(--red-soft); color: var(--red); }
.confirm-icon .icon { width: 26px; height: 26px; }
/* Messages (4.81.0) : le vert laisse passer le doigt vers la tuile dessous, le rouge se ferme d'un toucher. */
.toast { position: fixed; z-index: 150; left: 50%; bottom: 26px; transform: translateX(-50%); min-width: 240px; max-width: calc(100vw - 34px); padding: 12px 16px; border-radius: 11px; background: var(--strong); color: var(--strong-text); box-shadow: 0 16px 40px rgba(0, 0, 0, .22); text-align: center; font-weight: 700; animation: toast-in .2s var(--ease); pointer-events: none; }
.toast.error { background: var(--red); color: #fff; pointer-events: auto; cursor: pointer; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }
/* Attente du serveur (4.81.0) : classe posée par core/api.js quand une demande dépasse 0,4 s. Écran seulement. */
@media screen {
  html.server-wait, html.server-wait * { cursor: progress; }
  html.server-wait body::after { content: ""; position: fixed; z-index: 500; top: env(safe-area-inset-top, 0px); left: 0; width: 35%; height: 3px; background: var(--ink); pointer-events: none; animation: server-wait 1.1s ease-in-out infinite; }
}
@keyframes server-wait { from { transform: translateX(-100%); } to { transform: translateX(290%); } }
@media (prefers-reduced-motion: reduce) { html.server-wait body::after { width: 100%; opacity: .4; animation: none; } }

@media (max-width: 1180px) {
  .cashier-layout { grid-template-columns: minmax(0, 1fr) 350px; }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .management-tabs + .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 901px) and (max-width: 1050px) {
  /* Tablette en paysage (960 × 528) et fenêtre Windows : le ticket reste à côté des articles. */
  .cashier-layout { grid-template-columns: minmax(0, 1fr) 300px; gap: 12px; }
  .ticket-panel { position: static; }
  .ticket-lines { max-height: 380px; }
  .closing-grid { grid-template-columns: 1fr; }
}

:root[data-theme="dark"] .inventory-tabs, :root[data-theme="dark"] .inventory-stats article, :root[data-theme="dark"] .inventory-stock-panel, :root[data-theme="dark"] .inventory-live, :root[data-theme="dark"] .inventory-scanner, :root[data-theme="dark"] .inventory-last, :root[data-theme="dark"] .inventory-count-list, :root[data-theme="dark"] .inventory-count-row, :root[data-theme="dark"] .inventory-paused-card, :root[data-theme="dark"] .module-selector label { background: var(--panel); border-color: var(--line); }

@media (max-width: 1100px) {
  .inventory-stats { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .inventory-count-layout { grid-template-columns: 1fr; }
  .inventory-count-items { max-height: 380px; }
}

@media (max-width: 900px) {
  .app-shell { display: block; padding-left: 0; padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .sidebar { position: fixed; inset: auto 0 0; z-index: 50; width: auto; height: calc(66px + env(safe-area-inset-bottom)); padding: 7px max(8px, env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); overflow: visible; border: 0; border-top: 1px solid var(--sidebar-line); }
  .sidebar-logo, .sidebar-footer { display: none; }
  .nav { display: flex; gap: 3px; width: 100%; }
  .nav-button { flex: 1 1 0; min-width: 0; min-height: 50px; padding: 4px; flex-direction: column; justify-content: center; gap: 2px; font-size: 11px; }
  .nav-button::before { left: 12px; right: 12px; top: 0; bottom: auto; width: auto; height: 3px; }
  .nav-button .icon { width: 18px; height: 18px; }
  .nav-button .count { display: none; }
  .mobile-header { position: sticky; top: 0; z-index: 40; display: flex; justify-content: space-between; align-items: center; width: 100%; min-width: 0; min-height: calc(58px + env(safe-area-inset-top)); height: auto; padding: calc(8px + env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 8px max(14px, env(safe-area-inset-left)); border-bottom: 1px solid var(--line); background: rgba(245, 245, 245, .96); backdrop-filter: blur(12px); }
  .mobile-header img { flex: 0 1 auto; width: 154px; max-width: 38vw; min-width: 0; height: auto; }
  .mobile-header button { border: 0; background: transparent; }
  .app-main { padding: clamp(14px, 2.4vw, 18px); }
  .cashier-layout { grid-template-columns: minmax(0, 1fr); }
  .ticket-panel { position: static; }
  .ticket-lines { max-height: 360px; }
  .closing-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 660px) {
  .auth-page { display: block; background: var(--canvas); }
  .auth-brand { display: none; }
  .auth-form-wrap { min-height: 100vh; padding: 24px; }
  .auth-card { padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); box-shadow: var(--shadow); }
  .auth-mobile-logo { display: block; margin-bottom: 32px; }
  .auth-mobile-logo img { width: 220px; max-width: 100%; }
  .auth-card h1 { font-size: 30px; }
  .app-main { padding: 14px; }
  .page-head { align-items: center; gap: 10px; margin-bottom: 15px; }
  .page-head h1 { font-size: 22px; overflow-wrap: break-word; word-break: normal; }
  .page-head p, .sync-pill { display: none; }
  .page-actions { flex: 0 0 auto; gap: 6px; }
  .page-actions .button span { display: none; }
  /* Le bouton principal de la page garde son texte (4.92.0) : « Lancer un inventaire » n'était plus qu'une icône. */
  .page-actions .button.primary span, .page-actions .inventory-launch span { display: inline; }
  .catalog-panel { padding: 12px; }
  .scanner-box { grid-template-columns: auto minmax(0, 1fr); }
  .scanner-box.has-camera { grid-template-columns: auto minmax(0, 1fr) auto; }
  .scanner-state { display: none; }
  .scanner-help span:last-child { display: none; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .product-card { padding: 10px; }
  .product-card p { min-height: 28px; }
  .product-price { font-size: 13px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:last-child:nth-child(odd) { grid-column: span 2; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  /* Moyens de paiement deux par deux : la monnaie à rendre reste visible sans faire défiler. */
  .choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid .wide { grid-column: auto; }
  .modal-backdrop { padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) 0 max(10px, env(safe-area-inset-left)); align-items: end; }
  .modal { max-height: calc(100vh - max(10px, env(safe-area-inset-top))); max-height: calc(100dvh - max(10px, env(safe-area-inset-top))); border-radius: 18px 18px 0 0; }
  .modal.wide, .modal.small { width: 100%; }
  .modal-head, .modal-body { padding: 17px; }
  .modal-actions { padding: 13px 17px calc(13px + env(safe-area-inset-bottom)); }
  .amount-presets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .label-stage { min-height: 220px; padding: 14px; }
  .organization-card { grid-template-columns: 40px minmax(0, 1fr); }
  .organization-mark { width: 40px; height: 40px; }
  .organization-actions { grid-column: 1 / -1; justify-content: flex-end; padding-top: 7px; border-top: 1px solid var(--line-soft); }
  .organization-intro { grid-template-columns: 40px 1fr; }
  .organization-intro > span { width: 40px; height: 40px; }
}

@media (max-width: 430px) {
  .mobile-header { gap: 10px; padding-right: max(10px, env(safe-area-inset-right)); padding-left: max(10px, env(safe-area-inset-left)); }
  .mobile-header img { width: 128px; max-width: 42vw; }
  .mobile-header > div { flex: 0 0 auto; }
  .mobile-workspace { width: 39px; height: 39px; min-height: 39px; padding: 0 !important; justify-content: center; }
  .mobile-workspace span { display: none; }
  .mobile-header > div > button:last-child { width: 39px; height: 39px; padding: 0; display: grid; place-items: center; }
  .app-main { padding: 11px; }
  .page-actions { gap: 5px; }
  .page-actions .button { width: 40px; padding: 0; }
  .page-actions .button.primary, .page-actions .inventory-launch { width: auto; padding: 0 12px; }
  .catalog-panel { padding: 10px; }
  .product-card p { min-height: 28px; }
  .scanner-help { display: block; line-height: 1.35; }
  .filter-row { flex-wrap: wrap; align-items: flex-start; }
  .switch-label { margin-left: auto; }
  .ticket-options { grid-template-columns: 1fr; }
  .ticket-options button + button { border-left: 0; border-top: 1px solid var(--line); }
  .ticket-actions { padding-inline: 12px; }
  .modal-actions, .modal-actions.split { flex-wrap: wrap; }
  .modal-actions > div:not(.receipt-action-group) { width: 100%; }
  .modal-actions > div:not(.receipt-action-group) .button { flex: 1; }
  .modal-actions.split > .muted { width: 100%; }
  .inline-create { grid-template-columns: minmax(0, 1fr); }
  .inline-create .button { width: 100%; }
  .receipt { padding-inline: 0; }
}

@media (max-width: 374px) {
  .product-grid { grid-template-columns: minmax(0, 1fr); }
  .product-card h3, .product-card p { min-height: 0; }
  .page-head h1 { font-size: 20px; }
}

/* Barre du bas (4.92.0) : 11 px sur tablette, 10 px sur téléphone. Avec six entrées, 9 px comme avant : « Commandes »
 * mesure 59 px en 10 px (Geist) et n'a que 47 à 55 px de 360 à 412 px de large ; 11 px tient dès 480 px. */
@media (max-width: 520px) {
  .nav-button { font-size: 10px; }
  .nav:has(> :nth-child(6)) .nav-button { font-size: 9px; }
}

@media (max-width: 359px) {
  .mobile-header img { width: 112px; }
  .app-main { padding: 9px; }
  .catalog-panel { padding: 9px; }
  .product-grid { grid-template-columns: minmax(0, 1fr); }
  .product-card h3 { min-height: 0; display: block; white-space: normal; }
  .product-card p { min-height: 0; }
  .nav-button, .nav:has(> :nth-child(6)) .nav-button { font-size: 8px; }
  .nav-button .icon { width: 17px; height: 17px; }
}

/* Barre « ticket en cours » sur téléphone et tablette en portrait (jusqu'à 900 px de large). */
@media (max-width: 900px) {
  .app-shell.cashier-active { padding-bottom: calc(148px + env(safe-area-inset-bottom)); }
  .cashier-layout > .ticket-panel { display: none; }
  .mobile-cart-dock {
    position: fixed;
    z-index: 49;
    left: max(10px, env(safe-area-inset-left));
    right: max(10px, env(safe-area-inset-right));
    bottom: calc(74px + env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    min-height: 64px;
    padding: 9px 12px;
    border: 1px solid #292929;
    border-radius: 16px;
    background: #0d0d0d;
    color: #fff;
    box-shadow: 0 14px 35px rgba(0, 0, 0, .35);
    text-align: left;
    cursor: pointer;
  }
  .mobile-cart-dock.is-updated { animation: mobile-cart-added .85s var(--ease) both; }
  .mobile-cart-icon { position: relative; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: #1e1e1e; color: #e6e6e6; }
  .mobile-cart-icon .icon { width: 23px; height: 23px; }
  .mobile-cart-icon b { position: absolute; right: -5px; top: -5px; min-width: 20px; height: 20px; display: grid; place-items: center; padding: 0 5px; border: 2px solid #0d0d0d; border-radius: 999px; background: #fff; color: #0d0d0d; font-size: 9px; font-family: var(--font-mono); }
  .mobile-cart-copy, .mobile-cart-total { min-width: 0; display: grid; gap: 2px; }
  .mobile-cart-copy small { color: #b3b3b3; font-size: 10px; font-weight: 900; letter-spacing: .08em; }
  .mobile-cart-copy strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-cart-total { justify-items: end; padding-left: 8px; }
  .mobile-cart-total strong { font-size: 15px; white-space: nowrap; font-family: var(--font-mono); }
  .mobile-cart-total small { color: #9c9c9c; font-size: 10px; font-weight: 750; }
  .mobile-ticket-modal { max-height: calc(100vh - max(10px, env(safe-area-inset-top))); max-height: calc(100dvh - max(10px, env(safe-area-inset-top))); }
  .mobile-ticket-lines { max-height: min(42vh, 360px); max-height: min(42dvh, 360px); }
  .mobile-ticket-lines .empty-ticket { min-height: 150px; }
  .mobile-ticket-modal .ticket-options { grid-template-columns: 1fr 1fr; }
  .mobile-ticket-modal .ticket-options button + button { border-top: 0; border-left: 1px solid var(--line); }
  .mobile-ticket-modal .totals { padding-bottom: 12px; }
  .mobile-ticket-modal .mobile-ticket-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; padding-bottom: calc(13px + env(safe-area-inset-bottom)); }
  .mobile-ticket-modal .mobile-ticket-actions .button { width: 100%; min-width: 0; padding-inline: 10px; }
  .toast { bottom: calc(82px + env(safe-area-inset-bottom)); }
  .app-shell.cashier-active ~ .toast { bottom: calc(150px + env(safe-area-inset-bottom)); }
}

@keyframes mobile-cart-added {
  0% { border-color: #fff; box-shadow: 0 0 0 5px rgba(255, 255, 255, .16), 0 14px 35px rgba(0, 0, 0, .35); }
  100% { border-color: #292929; box-shadow: 0 14px 35px rgba(0, 0, 0, .35); }
}

@page { margin: 0; }

@media print {
  html, body { margin: 0 !important; background: #fff !important; }
}

/* PTI Caisse 3.0 — sessions, pilotage, hors-ligne et thème sombre */
.connectivity-banner { display: flex; align-items: center; gap: 9px; margin: -8px 0 18px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel-soft); color: var(--ink-2); font-size: 12px; font-weight: 700; }
.connectivity-banner.offline { border-color: #ecd9ae; background: var(--amber-soft); color: var(--amber); }
.connectivity-banner.error { border-color: #eeb5aa; background: var(--red-soft); color: var(--red); }
.connectivity-banner button { margin-left: auto; border: 0; background: transparent; color: inherit; font-weight: 850; cursor: pointer; }
.sync-pill.offline { color: var(--amber); }
.session-pill { display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.session-pill.open { background: var(--green-soft); color: var(--green); }
.session-pill .icon { width: 16px; height: 16px; }
.session-required { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 16px; padding: 13px 15px; border: 1px solid #ecd9ae; border-radius: 13px; background: var(--amber-soft); color: var(--amber); }
.session-required > div { display: flex; align-items: center; gap: 11px; }
.session-required strong, .session-required small { display: block; }
.session-required small { margin-top: 2px; font-weight: 500; }
/* Autre caisse ouverte depuis moins de 24 h (4.92.0) : une information, pas une alerte. */
.session-required.calm { border-color: var(--line); background: var(--panel-soft); color: var(--ink-2); }
/* « Attente » (ou « Cuisine » en prise de commande) écrit sous l'icône (4.92.0). */
.hold-button { position: relative; flex-direction: column; gap: 1px; padding: 0 2px; }
.hold-button small { font-size: 11px; font-weight: 650; line-height: 1.1; }
.hold-button > span:empty { display: none; }
.hold-button > span { position: absolute; right: -5px; top: -6px; min-width: 18px; height: 18px; display: grid; place-items: center; padding: 0 4px; border-radius: 999px; background: var(--strong); color: #fff; font-size: 8px; font-family: var(--font-mono); }
.internal-value span { white-space: nowrap; }
.internal-value { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; font-weight: 500; font-family: var(--font-mono); }
.stat small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.status-badge.refunded { background: var(--line-soft); color: var(--ink-2); }
.status-badge.partially_refunded { background: var(--amber-soft); color: var(--amber); }
.status-badge.pending_sync { background: var(--line-soft); color: var(--ink-2); }
.closure-card { grid-template-columns: minmax(0, 1fr) auto; }
.closure-main { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; width: 100%; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.session-live { grid-column: 1 / -1; }
.session-live-head, .section-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 18px; }
.session-live-head h2, .section-head h2 { margin: 2px 0 3px; }
.session-live-head p, .section-head p { margin: 0; color: var(--muted); font-size: 11px; }
.stats.compact { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.confirm-check { display: flex; align-items: flex-start; gap: 8px; margin: 10px 0 16px; padding: 11px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); font-size: 11px; }
.confirm-check input { margin-top: 2px; accent-color: var(--ink); }
.management-tabs { position: sticky; top: 0; z-index: 8; display: flex; gap: 6px; overflow-x: auto; margin: 0 0 16px; padding: 7px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel); box-shadow: 0 6px 16px rgba(0, 0, 0, .04); scrollbar-width: none; }
.management-tabs button, .payment-mode button { flex: 0 0 auto; min-height: 35px; padding: 0 12px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 750; cursor: pointer; }
.management-tabs button.active, .payment-mode button.active { background: var(--strong); color: var(--strong-text); }
.management-panel { margin-top: 0; }
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.quick-actions, .export-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.export-grid { margin-top: 18px; }
.export-period { margin-top: 14px; max-width: 360px; }
/* 4.93.0 : .field (display: grid) l'emportait sur l'attribut hidden : Montant et Pourcentage de la remise s'affichaient
 * ensemble, et « Sens » de Mouvement de stock ne se cachait pas. */
#discountForm .field[hidden], [data-movement-direction][hidden] { display: none !important; }
/* Note rouge (« Ticket à 0 F », sortie qui dépasse le stock) : la couleur grise de .field-note (pacific-studio.css) l'emportait. */
.field-note.danger-text { color: var(--red); }
.export-grid .button small { font-weight: 400; opacity: .75; }
.payment-mode { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-bottom: 13px; padding: 4px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel-soft); }
.payment-mode button { width: 100%; }
.mixed-payments { display: grid; gap: 9px; }
.mixed-payments .field span { display: flex; align-items: center; gap: 6px; }
.mixed-payments .icon { width: 16px; height: 16px; }
.hold-summary { display: flex; justify-content: space-between; padding: 13px; border-radius: 10px; background: var(--panel-soft); }
.hold-list { display: grid; gap: 9px; }
.hold-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 11px; }
.hold-card > button:first-child { display: flex; justify-content: space-between; gap: 12px; width: 100%; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.hold-card strong, .hold-card small { display: block; }
.hold-card small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.hold-actions { display: flex; align-items: center; gap: 6px; }
/* Additions séparées (4.91.0) */
.split-lines { display: grid; gap: 8px; margin: 10px 0; padding: 0; list-style: none; }
.split-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 11px; }
.split-line.moving { border-color: var(--green); background: var(--green-soft); }
.split-line strong, .split-line small { display: block; }
.split-line small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.split-stepper { display: flex; align-items: center; gap: 8px; }
.split-stepper strong { min-width: 48px; text-align: center; }
.split-totals { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.split-totals span { display: grid; gap: 2px; padding: 10px; border-radius: 11px; background: var(--panel-soft); color: var(--muted); font-size: 12px; }
.split-totals strong { color: var(--ink); font-size: 18px; }
/* Paiement divisé (4.92.0) : un 3e mode, le choix par articles ou en parts égales, et les parts réglées une à une. */
.payment-mode.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.split-kinds { margin-bottom: 10px; }
.split-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; padding: 10px 12px; border: 1px solid var(--green); border-radius: 11px; background: var(--green-soft); font-size: 13px; }
.split-banner span { flex: 1 1 200px; }
.split-banner .icon { width: 18px; height: 18px; }
.split-count { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 6px 0 10px; }
.split-parts { display: grid; gap: 6px; margin: 0 0 12px; padding: 0; list-style: none; }
.split-part { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 11px; color: var(--muted); }
.split-part.current { border-color: var(--strong); color: var(--ink); font-weight: 700; }
.split-part.paid { border-color: var(--green); background: var(--green-soft); color: var(--ink); }
.split-part.paid .icon { width: 15px; height: 15px; vertical-align: -2px; }
.split-part .button { margin-left: auto; }
/* Alerte « Commande prête » en salle (4.91.0) : au-dessus de tout, jusqu'au « Vu ». */
.ready-alert { position: fixed; z-index: 160; top: 12px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 14px; max-width: calc(100vw - 24px); padding: 12px 14px 12px 18px; border-radius: 14px; background: #14532d; color: #fff; box-shadow: 0 12px 32px rgba(0, 0, 0, .32); animation: ready-pulse 1s ease-in-out 3; }
.ready-alert strong { display: block; font-size: 22px; line-height: 1.2; }
.ready-alert small { display: block; opacity: .85; }
@keyframes ready-pulse { 50% { transform: translateX(-50%) scale(1.04); } }
.customer-search { display: grid; gap: 7px; max-height: 52vh; overflow: auto; }
.customer-choice { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 56px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: inherit; text-align: left; cursor: pointer; }
.customer-choice.active { border-color: var(--ink); box-shadow: 0 0 0 2px rgba(18, 18, 18, .08); }
.customer-choice strong, .customer-choice small { display: block; }
.customer-choice small { color: var(--muted); font-size: 10px; }
.customer-note { padding: 12px; border-radius: 10px; background: var(--panel-soft); color: var(--muted); white-space: pre-wrap; }
.refund-lines { display: grid; gap: 7px; margin-bottom: 16px; }
.refund-line { display: grid; grid-template-columns: minmax(0, 1fr) 82px; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.refund-line strong, .refund-line small { display: block; }
.refund-line small { color: var(--muted); font-size: 10px; }
.refund-line input { width: 100%; min-height: 40px; border: 1px solid var(--line); border-radius: 8px; padding: 0 9px; font-family: var(--font-mono); }
/* À rendre (4.92.0) : « Tout rembourser » et le montant, entre les lignes et le moyen de remboursement. */
.refund-summary { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.refund-summary .total-row.grand { flex: 1 1 220px; margin-top: 0; }
.refund-line.disabled { opacity: .45; }
/* Pied du ticket (5.16.0) : les actions dans une grille de quatre colonnes de même largeur, « Imprimer » en tête.
   Chaque case réserve deux lignes à son libellé (« Annuler la vente », « Sur téléphone » sur un téléphone) : toutes
   les cases ont la même hauteur et les icônes restent sur la même ligne. Après la vente, « Nouvelle vente » dessous,
   sur toute la largeur. */
.receipt-footer-actions { display: grid; gap: 10px; }
.receipt-footer-actions .receipt-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.receipt-footer-actions .receipt-actions:empty { display: none; }
.receipt-footer-actions .compact-action { min-width: 0; padding: 7px 4px 6px; gap: 3px; justify-content: flex-start; }
.receipt-footer-actions .compact-action span { display: grid; align-content: center; min-height: 2.3em; white-space: normal; text-align: center; text-wrap: balance; overflow-wrap: anywhere; }
.modal-actions > .button.receipt-new-sale { min-height: 52px; font-size: 16px; }
.receipt-change { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; padding: 12px 14px; border-radius: 12px; background: var(--green-soft); color: var(--ink); font-weight: 750; }
.receipt-change strong { font-size: 28px; letter-spacing: -.02em; font-family: var(--font-mono); white-space: nowrap; }
.receipt-copy-link { justify-self: start; padding: 4px 0; border: 0; background: none; color: var(--ink); font: inherit; font-size: 12px; font-weight: 650; text-decoration: underline; cursor: pointer; }
.z-report-actions { display: flex; gap: 8px; }
/* Boutons d'action du ticket et du rapport Z (4.92.0) : le libellé est écrit sous l'icône, en petit, « Imprimer »
   compris. Au doigt, les bulles d'aide (title) n'apparaissent jamais ; le pied du reçu passe à la ligne au besoin. */
/* Ticket sans papier (5.12.0) : le QR code du lien, grand, sur fond blanc même en thème sombre. */
.ticket-link { display: grid; justify-items: center; gap: 14px; text-align: center; }
.ticket-link-qr { padding: 16px; border-radius: 12px; background: #fff; }
.ticket-link-qr svg { display: block; width: min(64vw, 280px); height: auto; }
/* Image de fond de l'écran client (5.13.0), Réglages › Le commerce. L'aperçu est posé sur fond sombre, comme l'écran client. */
.display-image-setting { display: grid; gap: 8px; margin-top: 16px; }
.display-image-setting .field-note { margin: 0; }
.display-image-preview { width: 160px; height: 110px; padding: 8px; border-radius: 10px; background: #0b0b0c; object-fit: contain; }
/* Nouveautés (5.13.0) : la fenêtre montrée une fois après une mise à jour. */
.news-list { display: grid; gap: 16px; }
.news-item { display: grid; grid-template-columns: 24px 1fr; gap: 12px; align-items: start; }
.news-item svg { width: 22px; height: 22px; margin-top: 1px; }
.news-item p { margin: 4px 0 0; font-size: 14px; line-height: 1.45; opacity: .8; }
.compact-action {
  min-width: 52px;
  flex: 0 0 auto;
  flex-direction: column;
  padding: 5px 8px;
  gap: 2px;
  justify-content: center;
}
.compact-action span { font-size: 11px; font-weight: 650; line-height: 1.15; white-space: nowrap; }
.compact-action svg { width: 20px; height: 20px; }
.z-report { color: var(--ink); }
.z-report strong, .z-report .z-grid > div { font-family: var(--font-mono); }
.z-brand { display: flex; justify-content: space-between; align-items: end; padding-bottom: 10px; border-bottom: 2px solid var(--ink); }
.z-brand strong { font-size: 18px; }
.z-brand span { font-size: 10px; font-weight: 900; letter-spacing: .14em; font-family: var(--font-sans); }
.z-report > h3 { margin: 14px 0 8px; font-family: var(--font-sans); }
.z-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; margin-top: 12px; }
.z-grid > div { display: flex; justify-content: space-between; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line-soft); font-size: 11px; }
.z-grid .grand { grid-column: 1 / -1; padding: 10px 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); font-size: 14px; }
.period-buttons { display: flex; gap: 5px; overflow-x: auto; scrollbar-width: none; }
.bar-chart { display: grid; gap: 8px; }
.chart-row { display: grid; grid-template-columns: 78px minmax(30px, 1fr) 92px; align-items: center; gap: 8px; font-size: 10px; }
.chart-row i { display: block; width: var(--bar); height: 9px; border-radius: 999px; background: var(--ink); }
.chart-row i.negative { background: var(--red); }
.chart-row strong { text-align: right; font-family: var(--font-mono); }
/* Jours en rouge (5.11.0) : une commission de dépôt-vente a changé ce jour-là. */
.chart-row.commission-changed span, .chart-row.commission-changed strong, .chart-row.commission-changed small { color: var(--red); }
.chart-row.commission-changed small { grid-column: 1 / -1; margin-top: -4px; }
.stats-controls { display: grid; justify-items: end; gap: 8px; }
.custom-period { display: flex; align-items: end; gap: 7px; }
.custom-period label { display: grid; gap: 3px; color: var(--muted); font-size: 9px; font-weight: 750; }
.custom-period input { min-height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); }
.custom-period .button { min-height: 34px; }
.stats-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
.stats-detail-grid > section { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-soft); }
.stats-detail-grid h3 { margin: 0 0 12px; font-size: 13px; }


/* Module Inventaire */
.inventory-tabs { display: flex; gap: 5px; margin: -6px 0 18px; padding: 4px; width: fit-content; max-width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); scrollbar-width: none; }
.inventory-tabs button { position: relative; flex: 0 0 auto; min-height: 38px; padding: 0 14px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 760; cursor: pointer; }
.inventory-tabs button.active { background: var(--strong); color: var(--strong-text); }
.inventory-tabs button i { position: absolute; width: 7px; height: 7px; top: 7px; right: 7px; border-radius: 50%; background: var(--amber); }
.inventory-launch { white-space: nowrap; }

/* Réglages en onglets (4.45.0) et Modèle d'exemple */
.settings-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 16px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.settings-tabs button { flex: 1 1 auto; min-height: 38px; padding: 0 12px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 760; cursor: pointer; white-space: nowrap; }
.settings-tabs button.active { background: var(--strong); color: var(--strong-text); }
.settings-list { display: grid; gap: 8px; margin-top: 16px; }
/* Réglages › Abonnement (5.17.0) : le nombre de caisses, − et + de part et d'autre. */
.register-plan { display: grid; gap: 12px; }
.register-plan > p { margin: 0; }
.register-plan-count { display: flex; align-items: center; justify-content: center; gap: 24px; padding: 18px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.register-plan-count > div { display: grid; justify-items: center; min-width: 88px; }
.register-plan-count strong { font-family: var(--font-mono); font-size: 40px; line-height: 1; }
.register-plan-count span { margin-top: 4px; color: var(--muted); font-weight: 700; }
.register-plan-count .icon-button { width: 48px; height: 48px; border-radius: 12px; }
.register-plan .tax-warning { display: grid; gap: 10px; justify-items: start; }
.register-plan h3 { margin: 0; font-size: 18px; }
.register-steps { display: flex; align-items: center; justify-content: center; gap: 18px; padding: 14px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.register-steps > div { display: grid; justify-items: center; gap: 4px; text-align: center; }
.register-steps span { color: var(--muted); font-size: 12px; font-weight: 760; text-transform: uppercase; letter-spacing: .04em; }
.register-steps strong { font-size: 20px; }
.register-steps > .icon { width: 22px; height: 22px; flex: none; color: var(--muted); }
.register-sums { display: grid; margin: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.register-sums > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 12px 14px; }
.register-sums > div + div { border-top: 1px solid var(--line); }
.register-sums dt { color: var(--muted); font-weight: 700; }
.register-sums dd { margin: 0; font-family: var(--font-mono); font-size: 18px; font-weight: 800; text-align: right; white-space: nowrap; }
.register-wait { color: var(--muted); }
.register-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.register-actions .button { flex: 1 1 160px; min-height: 44px; }
.register-done { justify-items: center; text-align: center; padding: 8px 0; }
.register-done-mark { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--green-soft); color: var(--green); }
.register-done-mark .icon { width: 28px; height: 28px; }
.register-done .button { min-width: 160px; min-height: 44px; }
.settings-check { display: flex; align-items: center; gap: 10px; margin: 2px 0 14px; font-size: 13px; cursor: pointer; }
.settings-check input { width: 18px; height: 18px; flex: 0 0 auto; margin: 0; accent-color: var(--ink); }
.settings-pair { display: flex; gap: 8px; }
.settings-pair .button { flex: 1; }
.showcase-panel h3 { margin: 4px 0 6px; }
.showcase-types { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.showcase-type { display: grid; gap: 4px; padding: 11px 12px; text-align: left; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--ink); cursor: pointer; }
.showcase-type small { color: var(--muted); font-size: 11px; line-height: 1.35; }
.showcase-type.active { border-color: var(--strong); box-shadow: inset 0 0 0 1px var(--strong); }
.showcase-type:disabled { cursor: default; opacity: .7; }
.showcase-spaces { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.showcase-spaces h3 { margin: 0 0 4px; }
.showcase-space { display: flex; align-items: center; gap: 10px; text-align: left; }
.showcase-space > span { display: grid; gap: 2px; min-width: 0; }
.showcase-space small { color: var(--muted); font-size: 11px; }
.showcase-space.current { padding: 10px 12px; border: 1px solid var(--strong); border-radius: 12px; }
.agent-install > p { margin: 0 0 12px; }
.agent-steps { margin: 16px 0 10px; padding-left: 20px; display: grid; gap: 8px; line-height: 1.45; }
@media (max-width: 520px) { .showcase-types { grid-template-columns: 1fr; } }
.inventory-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 15px; }
.inventory-stats.compact { grid-template-columns: repeat(4, minmax(0,1fr)); }
.inventory-stats article { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.inventory-stats article > span { display: block; color: var(--muted); font-size: 9px; font-weight: 850; letter-spacing: .08em; }
.inventory-stats article > strong { display: block; margin-top: 5px; font: 800 23px/1.1 var(--font-mono); letter-spacing: -.04em; overflow-wrap: anywhere; }
.inventory-stats article > small { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; }
.inventory-stock-panel { padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.inventory-toolbar { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 12px; }
.inventory-search { flex: 1; min-width: 220px; display: flex; align-items: center; gap: 9px; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel-soft); }
.inventory-search .icon { flex: 0 0 auto; width: 18px; color: var(--muted); }
.inventory-search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); }
.inventory-actions, .inventory-filters { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.inventory-filters { margin-bottom: 12px; }
.inventory-filters > span { margin-left: auto; color: var(--muted); font-size: 11px; font-weight: 700; }
.inventory-mobile-stock-list { display: none; }
.inventory-live { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.inventory-live-head { display: flex; justify-content: space-between; gap: 20px; align-items: end; padding: 20px 20px 14px; }
.inventory-live-head h2 { margin: 5px 0 3px; font-size: 22px; letter-spacing: -.03em; }
.inventory-live-head p { margin: 0; color: var(--muted); }
.inventory-live-badge { color: var(--green); font-size: 10px; font-weight: 900; letter-spacing: .09em; }
.inventory-live.paused .inventory-live-badge { color: var(--amber); }
.inventory-progress-copy { text-align: right; }
.inventory-progress-copy strong { display: block; font: 800 27px/1 var(--font-mono); }
.inventory-progress-copy span { color: var(--muted); font-size: 10px; }
.inventory-progress { height: 5px; background: var(--line-soft); }
.inventory-progress i { display: block; height: 100%; background: var(--ink); transition: width .2s var(--ease); }
.inventory-count-layout { display: grid; grid-template-columns: minmax(320px, .85fr) minmax(360px, 1.15fr); gap: 16px; padding: 16px; background: var(--panel-soft); }
.inventory-scan-column { min-width: 0; display: grid; align-content: start; gap: 12px; }
.inventory-scanner { display: grid; gap: 12px; padding: 17px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel); box-shadow: 0 8px 25px rgba(0,0,0,.04); }
.inventory-scanner > div { display: flex; align-items: center; gap: 11px; }
.inventory-scanner > div > .icon { width: 28px; height: 28px; }
.inventory-scanner strong, .inventory-scanner small { display: block; }
.inventory-scanner small { color: var(--muted); font-size: 10px; margin-top: 2px; }
.inventory-scanner input { width: 100%; min-height: 48px; padding: 0 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-soft); color: var(--ink); font-family: var(--font-mono); outline: 0; }
.inventory-scanner input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(18,18,18,.08); }
.inventory-last { padding: 17px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel); }
.inventory-last.empty { min-height: 145px; display: grid; place-content: center; justify-items: center; color: var(--muted); text-align: center; }
.inventory-last.empty .icon { width: 30px; height: 30px; }
.inventory-last-main { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 11px; align-items: center; }
.inventory-last-main h3 { margin: 0; font-size: 15px; }
.inventory-last-main p { margin: 2px 0 0; color: var(--muted); font-size: 10px; }
.inventory-last-main > strong { font: 850 31px/1 var(--font-mono); }
.inventory-difference { display: flex; justify-content: space-between; align-items: center; margin-top: 13px; padding: 9px 11px; border-radius: 9px; background: var(--panel-soft); }
.inventory-difference strong { font-family: var(--font-mono); }
.inventory-difference.ok strong { color: var(--green); }
.inventory-difference.plus strong { color: var(--amber); }
.inventory-difference.minus strong { color: var(--red); }
.inventory-last-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 10px; }
.inventory-count-list { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel); }
.inventory-count-list .section-head { margin-bottom: 10px; }
.inventory-count-items { display: grid; gap: 6px; max-height: 500px; overflow-y: auto; padding-right: 2px; }
.inventory-count-row { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 60px; padding: 10px 11px; border: 1px solid var(--line-soft); border-radius: 10px; background: var(--panel); color: inherit; text-align: left; cursor: pointer; }
.inventory-count-row:hover { border-color: var(--line); background: var(--panel-soft); }
.inventory-count-row strong, .inventory-count-row small { display: block; }
.inventory-count-row small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.inventory-count-row.pending { opacity: .7; }
.inventory-count-value { flex: 0 0 auto; text-align: right; font: 800 17px/1.15 var(--font-mono); }
.inventory-count-value small { font-family: var(--font-sans); }
.inventory-live-actions, .inventory-review-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 16px; border-top: 1px solid var(--line); background: var(--panel); }
.inventory-paused-card, .inventory-empty { text-align: center; }
.inventory-paused-card { padding: 32px 18px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel); }
.inventory-paused-card .icon, .inventory-empty-icon .icon { width: 36px; height: 36px; }
.inventory-paused-card h3, .inventory-empty h2 { margin: 10px 0 5px; }
.inventory-paused-card p, .inventory-empty p { margin: 0 auto 15px; max-width: 520px; color: var(--muted); }
.inventory-empty { padding: 55px 20px; }
.inventory-review { padding: 18px; }
.inventory-review-head { display: flex; justify-content: space-between; align-items: start; gap: 16px; margin-bottom: 15px; }
.inventory-review-head h2 { margin: 0 0 4px; }
.inventory-review-head p { margin: 0; color: var(--muted); }
.inventory-warning { display: flex; gap: 10px; align-items: start; margin: 0 0 14px; padding: 12px 13px; border: 1px solid #ead4aa; border-radius: 11px; background: var(--amber-soft); color: var(--amber); }
.inventory-warning p { margin: 2px 0 0; font-size: 11px; }
.inventory-diff-pill { display: inline-flex; min-width: 42px; justify-content: center; padding: 4px 7px; border-radius: 999px; font: 800 11px/1 var(--font-mono); background: var(--panel-soft); }
.inventory-diff-pill.plus { color: var(--amber); background: var(--amber-soft); }
.inventory-diff-pill.minus { color: var(--red); background: var(--red-soft); }
.inventory-diff-pill.ok { color: var(--green); background: var(--green-soft); }
.inventory-item-summary { display: flex; align-items: center; gap: 11px; margin-bottom: 15px; }
.inventory-item-summary h3 { margin: 0; }
/* Réserve d'un article (5.7.0) : boutique, réserve, total. */
.reserve-levels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.reserve-levels div { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--panel-soft); }
.reserve-levels small { display: block; color: var(--muted); font-size: 11px; }
.reserve-levels strong { font-size: 20px; }
.inventory-item-summary p { margin: 2px 0 0; color: var(--muted); font-size: 10px; }
.inventory-item-numbers, .inventory-history-summary { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; margin-bottom: 15px; }
.inventory-history-summary { grid-template-columns: repeat(4,minmax(0,1fr)); }
.inventory-item-numbers > div, .inventory-history-summary > div { padding: 11px; border-radius: 10px; background: var(--panel-soft); }
.inventory-item-numbers span, .inventory-history-summary span { display: block; color: var(--muted); font-size: 9px; }
.inventory-item-numbers strong, .inventory-history-summary strong { display: block; margin-top: 3px; font-family: var(--font-mono); }
.module-selector { display: grid; gap: 8px; margin: 3px 0 15px; padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel-soft); }
.module-selector > strong { font-size: 12px; }
.module-selector label { display: flex; align-items: flex-start; gap: 9px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); cursor: pointer; }
.module-selector input { margin-top: 3px; accent-color: var(--ink); }
.module-selector b, .module-selector small { display: block; }
.module-selector small { margin-top: 2px; color: var(--muted); font-size: 10px; }

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f2f2f2;
  --ink-2: #d8d8d8;
  --muted: #9a9a9a;
  --muted-2: #737373;
  --line: #2c2c2c;
  --line-soft: #232323;
  --canvas: #0a0a0a;
  --panel: #141414;
  --panel-soft: #1a1a1a;
  --green: #4bbf87;
  --green-soft: #123023;
  --amber: #e0aa5a;
  --amber-soft: #35270f;
  --red: #f28b7a;
  --red-soft: #3a1c17;
  --strong: #232323;
  --strong-hover: #2f2f2f;
  --strong-text: #ffffff;
  --sidebar: #0a0a0a;
  --sidebar-line: #262626;
  --nav-active: #ffffff;
  --shadow: 0 24px 60px rgba(0, 0, 0, .5);
}
:root[data-theme="dark"] body, :root[data-theme="dark"] .boot-screen, :root[data-theme="dark"] .auth-page { background: var(--canvas); }
:root[data-theme="dark"] .auth-form-wrap, :root[data-theme="dark"] .auth-card, :root[data-theme="dark"] .catalog-panel, :root[data-theme="dark"] .ticket-panel, :root[data-theme="dark"] .panel, :root[data-theme="dark"] .stat, :root[data-theme="dark"] .table-wrap, :root[data-theme="dark"] .modal, :root[data-theme="dark"] .organization-card, :root[data-theme="dark"] .product-card, :root[data-theme="dark"] .choice, :root[data-theme="dark"] .chip, :root[data-theme="dark"] .field input, :root[data-theme="dark"] .field select, :root[data-theme="dark"] .field textarea, :root[data-theme="dark"] .input, :root[data-theme="dark"] .icon-button, :root[data-theme="dark"] .scanner-box, :root[data-theme="dark"] .amount-presets button, :root[data-theme="dark"] .label-kind button, :root[data-theme="dark"] .button.ghost, :root[data-theme="dark"] .mobile-workspace { background: var(--panel); color: var(--ink); border-color: var(--line); }
:root[data-theme="dark"] .modal-head, :root[data-theme="dark"] .modal-actions, :root[data-theme="dark"] .data-table th, :root[data-theme="dark"] .mobile-header { background: rgba(20, 20, 20, .97); color: var(--ink); }
:root[data-theme="dark"] .button.secondary { background: #232323; color: var(--ink); }
:root[data-theme="dark"] .button.secondary:hover { background: #2b2b2b; }
:root[data-theme="dark"] .data-table tbody tr.clickable:hover { background: var(--panel-soft); }
:root[data-theme="dark"] .receipt { background: #fff; color: #111; border-radius: 10px; padding: 12px; }
:root[data-theme="dark"] .label-stage { background: #0a0a0a; }
:root[data-theme="dark"] .management-tabs { box-shadow: none; }
:root[data-theme="dark"] .mobile-header { background: rgba(10, 10, 10, .96); }
:root[data-theme="dark"] .avatar { background: rgba(255, 255, 255, .12); color: #fff; }

@media (max-width: 900px) {
  /* Sur plusieurs lignes (4.92.0), la barre défile avec la page : collée en haut, elle prendrait l'écran. */
  .management-tabs { position: static; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .session-live { grid-column: auto; }
  .stats-detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 660px) {
  .session-required { align-items: flex-start; }
  .session-required > .button { display: none; }
  .stats.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats.compact .stat:last-child { grid-column: auto; }
  .section-head { align-items: center; flex-wrap: wrap; gap: 10px; }
  .section-head p { display: none; }
  .quick-actions, .export-grid { grid-template-columns: 1fr; }
  .management-tabs { margin-inline: -3px; }
  .management-panel { padding: 13px; }
  .z-grid { grid-template-columns: 1fr; }
  .z-grid .grand { grid-column: auto; }
  .refund-line { grid-template-columns: minmax(0, 1fr) 68px; }
  .chart-row { grid-template-columns: 64px minmax(25px, 1fr) 78px; }
  .stats-controls { width: 100%; justify-items: stretch; }
  .custom-period { display: grid; grid-template-columns: 1fr 1fr; }
  .custom-period .button { grid-column: 1 / -1; }
  .stats-detail-grid > section { padding: 11px; }
  .connectivity-banner { margin: 0 0 12px; }
}

@media (max-width: 560px) {
  .closure-list { grid-template-columns: minmax(0, 1fr); }
  .z-report-actions { gap: 8px; }
}

@media (max-width: 430px) {
  .mobile-cart-dock { left: max(7px, env(safe-area-inset-left)); right: max(7px, env(safe-area-inset-right)); min-height: 60px; padding: 8px 9px; }
  .mobile-cart-copy strong { font-size: 11px; }
  .mobile-cart-total strong { font-size: 13px; }
  .product-mark { width: 35px; height: 35px; }
  .stock-tag { max-width: 88px; text-align: center; }
  .page-head .session-pill { display: none; }
  .session-live-head { display: block; }
  .session-live-head .session-pill { margin-top: 9px; }
  .hold-card > button:first-child { display: grid; }
  .hold-card > button:first-child > div:last-child { text-align: left; }
  .section-head > .button { width: 100%; }
  .closure-main { grid-template-columns: minmax(0, 1fr); }
  .closure-main .variance { text-align: left; }
  .stats-detail-grid > section { min-width: 0; overflow: hidden; }
}


/* Stock en fiches jusqu'à 760 px (téléphone couché compris) : le tableau y était plus large que l'écran. */
@media (max-width: 760px) {
  .inventory-table { display: none; }
  .inventory-mobile-stock-list { display: grid; gap: 7px; }
  .inventory-mobile-product { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 10px; width: 100%; min-height: 62px; padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel); color: inherit; text-align: left; cursor: pointer; }
  .inventory-mobile-copy, .inventory-mobile-stock { min-width: 0; }
  .inventory-mobile-copy strong, .inventory-mobile-copy small, .inventory-mobile-stock strong, .inventory-mobile-stock small { display: block; }
  .inventory-mobile-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .inventory-mobile-copy small { margin-top: 2px; color: var(--muted); font-size: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .inventory-mobile-stock { text-align: right; }
  .inventory-mobile-stock > strong { font: 800 18px/1 var(--font-mono); }
  .inventory-mobile-stock > small { margin-top: 3px; color: var(--green); font-size: 8px; font-weight: 800; }
  .inventory-mobile-stock > small.low { color: var(--amber); }
  .inventory-mobile-stock > small.out { color: var(--red); }
}

@media (max-width: 660px) {
  .inventory-tabs { width: 100%; margin-top: -3px; }
  .inventory-tabs button { flex: 1 0 auto; padding-inline: 11px; }
  .inventory-stats, .inventory-stats.compact { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .inventory-stats article { padding: 13px; }
  .inventory-stats article > strong { font-size: 20px; }
  .inventory-toolbar { display: grid; }
  .inventory-search { min-width: 0; }
  .inventory-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .inventory-actions .button { width: 100%; padding-inline: 9px; }
  .inventory-filters { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
  .inventory-filters .chip { flex: 0 0 auto; }
  .inventory-filters > span { display: none; }
  .inventory-live-head { align-items: start; padding: 15px; }
  .inventory-live-head p { font-size: 10px; }
  .inventory-progress-copy strong { font-size: 22px; }
  .inventory-count-layout { padding: 10px; gap: 10px; }
  .inventory-count-list { padding: 10px; }
  .inventory-count-items { max-height: 42vh; }
  .inventory-last-actions { grid-template-columns: 1fr; }
  .inventory-live-actions, .inventory-review-actions { display: grid; grid-template-columns: 1fr; }
  .inventory-live-actions .button, .inventory-review-actions .button { width: 100%; }
  .inventory-review { padding: 12px; }
  .inventory-review-head { align-items: center; }
  .inventory-history-summary { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 430px) {
  .inventory-live-head { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; }
  .inventory-live-head h2 { font-size: 17px; }
  .inventory-progress-copy span { display: none; }
  .inventory-scanner { padding: 13px; }
  .inventory-last { padding: 13px; }
  .inventory-count-row { min-height: 56px; padding: 9px; }
  .inventory-count-row > span:first-child { min-width: 0; }
  .inventory-count-row > span:first-child strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .inventory-item-numbers { grid-template-columns: 1fr 1fr 1fr; gap: 5px; }
  .inventory-item-numbers > div { padding: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .button, .chip, .product-card, .field input, .field select, .field textarea, .input, .scanner-box, .nav-button {
    transition: none;
  }
  .toast, .mobile-cart-dock.is-updated { animation: none; }
  .spinner { animation-duration: 1.6s; }
}

/* Cashier 3.3 — fournisseurs, achats, import et permissions */
.reorder-banner { display:flex; align-items:center; justify-content:space-between; gap:14px; margin:0 0 16px; padding:13px 14px; border:1px solid var(--line); border-radius:12px; background:var(--panel-soft); }
.reorder-banner > div { display:flex; align-items:center; gap:11px; min-width:0; }
.reorder-banner svg { flex:0 0 auto; }
.reorder-banner span, .reorder-banner strong, .reorder-banner small { display:block; }
.reorder-banner small { margin-top:2px; color:var(--muted); }
.permission-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin:2px 0 15px; padding:12px; border:1px solid var(--line); border-radius:12px; background:var(--panel-soft); }
.permission-grid > strong { grid-column:1 / -1; font-size:12px; }
.permission-choice { display:flex; align-items:flex-start; gap:8px; min-height:54px; padding:9px; border:1px solid var(--line); border-radius:10px; background:var(--panel); cursor:pointer; }
.permission-choice input { margin-top:2px; }
.permission-choice span, .permission-choice strong, .permission-choice small { display:block; }
.permission-choice small { margin-top:2px; color:var(--muted); font-size:9px; line-height:1.35; }
.purchase-head { display:flex; justify-content:space-between; gap:12px; margin:16px 0 7px; color:var(--muted); font-size:10px; text-transform:uppercase; letter-spacing:.05em; }
.purchase-lines { display:grid; gap:7px; max-height:min(48vh,520px); overflow:auto; padding-right:2px; }
.purchase-line { display:grid; grid-template-columns:auto minmax(0,1fr) 92px 112px; align-items:center; gap:9px; padding:9px 10px; border:1px solid var(--line); border-radius:10px; background:var(--panel); }
.purchase-line > span { min-width:0; }
.purchase-line > span strong, .purchase-line > span small { display:block; }
.purchase-line > span strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.purchase-line > span small { margin-top:2px; color:var(--muted); font-size:9px; }
.purchase-line > input[type="number"] { width:100%; min-width:0; height:38px; padding:0 8px; border:1px solid var(--line); border-radius:9px; background:var(--panel); color:var(--ink); }
.purchase-detail-lines { display:grid; gap:7px; margin-top:14px; }
.purchase-detail-line { display:grid; grid-template-columns:minmax(0,1fr) 130px 105px; align-items:center; gap:10px; padding:10px 11px; border:1px solid var(--line); border-radius:10px; }
.purchase-detail-line span, .purchase-detail-line strong, .purchase-detail-line small { display:block; min-width:0; }
.purchase-detail-line small { margin-top:2px; color:var(--muted); font-size:9px; }
.purchase-detail-line input { width:100%; height:38px; padding:0 8px; border:1px solid var(--line); border-radius:9px; background:var(--panel); color:var(--ink); }
.file-drop { display:block; position:relative; border:1px dashed var(--line-strong, var(--line)); border-radius:14px; background:var(--panel-soft); cursor:pointer; }
.file-drop input { position:absolute; inset:0; width:100%; height:100%; opacity:0; cursor:pointer; }
.file-drop > span { display:grid; justify-items:center; gap:5px; padding:28px 16px; text-align:center; pointer-events:none; }
.file-drop strong, .file-drop small { display:block; }
.file-drop small { color:var(--muted); font-size:10px; }
.import-help { margin-top:12px; padding:12px; border:1px solid var(--line); border-radius:11px; background:var(--panel-soft); }
.import-help p { margin:5px 0 0; color:var(--muted); font-size:10px; line-height:1.5; }

@media (max-width: 660px) {
  .reorder-banner { align-items:stretch; flex-direction:column; }
  .reorder-banner .button { width:100%; }
  .permission-grid { grid-template-columns:1fr; }
  .permission-grid > strong { grid-column:auto; }
  .purchase-line { grid-template-columns:auto minmax(0,1fr); }
  .purchase-line > input[type="number"] { grid-column:2; }
  .purchase-detail-line { grid-template-columns:minmax(0,1fr) auto; }
  .purchase-detail-line > input { grid-column:1 / -1; }
  .purchase-head small { display:none; }
}
.permission-grid.permission-disabled { opacity:.55; pointer-events:none; }
.purchase-line.hidden { display:none; }

/* Cashier 3.4 — espace Gestion enrichi */
.management-section-hero { display:flex; justify-content:space-between; align-items:flex-start; gap:18px; margin:-2px 0 18px; padding:18px; border:1px solid var(--line); border-radius:15px; background:linear-gradient(135deg,var(--panel-soft),var(--panel)); }
.management-section-hero h2 { margin:3px 0 5px; font-size:22px; }
.management-section-hero p { max-width:720px; margin:0; color:var(--muted); line-height:1.5; }
.management-kpi-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(170px,1fr)); gap:11px; margin-bottom:16px; }
.management-kpi-grid.compact { margin-bottom:18px; }
.management-kpi { display:flex; align-items:center; gap:12px; min-width:0; min-height:98px; padding:15px; border:1px solid var(--line); border-radius:14px; background:var(--panel); box-shadow:0 6px 18px rgba(0,0,0,.025); }
.management-kpi.attention { border-color:#e6c67f; }
.management-kpi-icon { flex:0 0 auto; width:42px; height:42px; display:grid; place-items:center; border-radius:11px; background:var(--panel-soft); }
.management-kpi-icon .icon { width:20px; height:20px; }
.management-kpi > div { min-width:0; }
.management-kpi small, .management-kpi div > span { display:block; }
.management-kpi small { color:var(--muted); font-size:9px; font-weight:850; letter-spacing:.06em; }
.management-kpi strong { display:block; margin:5px 0 3px; overflow:hidden; text-overflow:ellipsis; font:850 20px/1.1 var(--font-mono); }
.management-kpi div > span { color:var(--muted); font-size:9px; }
.management-dashboard-grid { display:grid; grid-template-columns:minmax(0,1.35fr) minmax(320px,.65fr); gap:16px; align-items:start; }
.management-command-center { min-width:0; }
.management-quick-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
.management-quick-card { display:grid; grid-template-columns:38px minmax(0,1fr); align-items:center; gap:11px; min-height:72px; padding:12px; border:1px solid var(--line); border-radius:12px; background:var(--panel); color:var(--ink); text-align:left; cursor:pointer; transition:transform .12s var(--ease),border-color .12s var(--ease),background .12s var(--ease); }
.management-quick-card:hover { transform:translateY(-1px); border-color:#bdbdbd; background:var(--panel-soft); }
.management-quick-card > .icon { width:20px; height:20px; justify-self:center; }
.management-quick-card strong, .management-quick-card small { display:block; }
.management-quick-card small { margin-top:3px; color:var(--muted); font-size:9px; }
.section-head.compact { margin-bottom:12px; }
.management-toolbar { display:flex; align-items:center; gap:9px; margin:0 0 15px; }
.management-search { flex:1 1 auto; min-width:220px; height:43px; display:grid; grid-template-columns:auto minmax(0,1fr); align-items:center; gap:8px; padding:0 12px; border:1px solid var(--line); border-radius:11px; background:var(--panel); }
.management-search .icon { width:17px; height:17px; color:var(--muted); }
.management-search input { width:100%; min-width:0; border:0; outline:0; background:transparent; color:var(--ink); font:inherit; }
.management-search:focus-within { border-color:var(--ink); box-shadow:0 0 0 3px rgba(18,18,18,.07); }
.entity-card-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(285px,1fr)); gap:12px; }
.entity-card { min-width:0; padding:14px; border:1px solid var(--line); border-radius:14px; background:var(--panel); box-shadow:0 5px 16px rgba(0,0,0,.02); }
.entity-card-head { display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:10px; }
.entity-avatar { width:42px; height:42px; display:grid; place-items:center; flex:0 0 auto; border-radius:12px; background:var(--strong); color:var(--strong-text); font-size:12px; font-weight:900; letter-spacing:.04em; }
.entity-avatar.large { width:58px; height:58px; border-radius:15px; font-size:16px; }
.entity-card-title { min-width:0; }
.entity-card-title h3, .entity-card-title strong { display:block; margin:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:13px; }
.entity-card-title p, .entity-card-title small { display:block; margin:3px 0 0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--muted); font-size:9px; }
.entity-contact-list { display:grid; gap:7px; margin:13px 0; padding:12px 0; border-top:1px solid var(--line-soft); border-bottom:1px solid var(--line-soft); }
.entity-contact-list > span { display:grid; grid-template-columns:18px minmax(0,1fr); align-items:center; gap:7px; color:var(--muted); }
.entity-contact-list .icon { width:15px; height:15px; }
.entity-contact-list b { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--ink-2); font-size:9px; font-weight:650; }
.entity-mini-stats { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; margin-bottom:10px; }
.entity-mini-stats > span { padding:9px 8px; border-radius:9px; background:var(--panel-soft); text-align:center; }
.entity-mini-stats small, .entity-mini-stats strong { display:block; }
.entity-mini-stats small { color:var(--muted); font-size:8px; }
.entity-mini-stats strong { margin-top:3px; font:850 15px/1 var(--font-mono); }
.entity-card-meta { display:flex; flex-wrap:wrap; gap:5px; min-height:22px; margin:0 0 11px; }
.entity-card-meta span { padding:4px 7px; border-radius:999px; background:var(--line-soft); color:var(--muted); font-size:8px; font-weight:750; }
.entity-empty { grid-column:1 / -1; min-height:220px; display:grid; place-items:center; align-content:center; gap:8px; border:1px dashed var(--line); border-radius:14px; }
.management-contact-table td { vertical-align:middle; }
.management-contact-table td small { display:block; margin-top:3px; color:var(--muted); font-size:9px; }
.management-mobile-list { display:none; }
.entity-card-main { width:100%; display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:10px; padding:0; border:0; background:transparent; color:inherit; text-align:left; cursor:pointer; }
.entity-card-value { min-width:0; text-align:right; }
.entity-card-value strong, .entity-card-value small { display:block; }
.entity-card-value strong { font-family:var(--font-mono); }
.entity-card-value small { margin-top:3px; color:var(--muted); font-size:8px; }
.form-section { padding:0 0 18px; margin-bottom:18px; border-bottom:1px solid var(--line); }
.form-section:last-child { padding-bottom:0; margin-bottom:0; border-bottom:0; }
.form-section-head { margin-bottom:12px; }
.form-section-head strong, .form-section-head small { display:block; }
.form-section-head strong { font-size:12px; }
.form-section-head small { margin-top:3px; color:var(--muted); font-size:9px; }
.detail-hero { display:flex; align-items:center; gap:13px; padding:14px; margin-bottom:13px; border:1px solid var(--line); border-radius:13px; background:var(--panel-soft); }
.detail-hero h3 { margin:2px 0 3px; font-size:18px; }
.detail-hero p, .detail-hero small { display:block; margin:0; color:var(--muted); }
.detail-hero small { margin-top:3px; font-size:9px; }
.detail-contact-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin-bottom:13px; }
.contact-action { display:grid; grid-template-columns:32px minmax(0,1fr); align-items:center; gap:9px; min-height:62px; padding:10px 11px; border:1px solid var(--line); border-radius:11px; background:var(--panel); color:inherit; text-decoration:none; }
a.contact-action:hover { background:var(--panel-soft); border-color:#bdbdbd; }
.contact-action .icon { width:18px; height:18px; justify-self:center; }
.contact-action small, .contact-action strong { display:block; min-width:0; }
.contact-action small { color:var(--muted); font-size:8px; text-transform:uppercase; letter-spacing:.05em; }
.contact-action strong { margin-top:3px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:10px; }
.contact-action.wide-contact { grid-column:1 / -1; }
.muted-action { opacity:.65; }
.entity-stat-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; margin-bottom:13px; }
.entity-stat-grid > div, .supplier-terms-grid > div { min-width:0; padding:11px; border-radius:10px; background:var(--panel-soft); }
.entity-stat-grid span, .entity-stat-grid strong, .supplier-terms-grid small, .supplier-terms-grid strong { display:block; }
.entity-stat-grid span, .supplier-terms-grid small { color:var(--muted); font-size:8px; text-transform:uppercase; letter-spacing:.04em; }
.entity-stat-grid strong { margin-top:5px; overflow:hidden; text-overflow:ellipsis; font:850 13px/1.2 var(--font-mono); }
.supplier-terms-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin-bottom:13px; }
.supplier-terms-grid strong { margin-top:4px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:10px; }
.detail-note { margin:0 0 15px; padding:12px; border:1px solid var(--line); border-radius:11px; background:var(--panel-soft); }
.detail-note small { color:var(--muted); font-size:8px; font-weight:850; letter-spacing:.06em; }
.detail-note p { margin:6px 0 0; white-space:pre-wrap; line-height:1.5; }
.detail-section-head { display:flex; justify-content:space-between; gap:12px; margin:15px 0 8px; }
/* Bouton d'une partie de fiche (5.16.0) : son libellé reste sur une ligne ; faute de place (téléphone), il passe sous le titre. */
.detail-section-head { flex-wrap: wrap; align-items: center; }
.detail-section-head .row-actions .button { white-space: nowrap; }
.detail-section-head h3 { margin:0; font-size:13px; }
.detail-section-head p { margin:3px 0 0; color:var(--muted); font-size:9px; }
.detail-split { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.detail-split > section { min-width:0; }
.purchase-history-list .manager-row, .added-sales .manager-row, .credit-detail button.manager-row { width:100%; border:0; border-bottom:1px solid var(--line-soft); background:transparent; color:inherit; text-align:left; cursor:pointer; }
/* Ventes ajoutées après coup (4.81.0) : bordure rouge, fond à peine teinté, en clair comme en sombre. */
.added-sales { margin:0 0 14px; padding:12px 13px; border:1px solid var(--red); border-radius:11px; background:var(--red-soft); }
.added-sales h3 { margin:0; color:var(--red); font-size:13px; }
.added-sales p { margin:4px 0 10px; font-size:12px; }
.added-sales .manager-list { margin-top:4px; }
/* 7 colonnes au lieu de 8 : le tableau tient dans la fiche malgré la marge de l'encadré, et défile sur téléphone. */
.added-sales .data-table { min-width:660px; }
.added-sales .data-table td:last-child { white-space:nowrap; }
.data-table td small.added-note { color:var(--red); font-weight:750; }

@media (max-width: 980px) {
  .management-kpi-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .management-dashboard-grid { grid-template-columns:1fr; }
  .entity-card-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}

@media (max-width: 760px) {
  .management-section-hero { align-items:stretch; flex-direction:column; padding:14px; }
  .management-section-hero .button { width:100%; }
  .management-toolbar { align-items:stretch; flex-direction:column; }
  .management-search { width:100%; min-width:0; }
  .management-toolbar > .button, .management-toolbar > a.button { width:100%; }
  .entity-card-grid { grid-template-columns:1fr; }
  .management-desktop-table { display:none; }
  .management-mobile-list { display:grid; gap:8px; }
  .detail-split { grid-template-columns:1fr; }
}

@media (max-width: 560px) {
  .management-kpi-grid, .management-kpi-grid.compact { grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; }
  .management-kpi { min-height:82px; padding:11px; }
  .management-kpi-icon { display:none; }
  .management-kpi strong { font-size:16px; }
  .management-kpi div > span { font-size:8px; }
  .management-quick-grid { grid-template-columns:1fr; }
  .management-quick-card { min-height:62px; }
  .detail-contact-grid { grid-template-columns:1fr; }
  .contact-action.wide-contact { grid-column:auto; }
  .entity-stat-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .supplier-terms-grid { grid-template-columns:1fr; }
  .detail-hero { align-items:flex-start; }
  .entity-avatar.large { width:48px; height:48px; border-radius:13px; }
}

/* Deux cases de chiffres par rangée jusqu'à 331 px (deux cases de 150 px tiennent « 10 000 F ») ; une seule en dessous. */
@media (max-width: 330px) {
  .management-kpi-grid, .management-kpi-grid.compact { grid-template-columns:1fr; }
}
/* De 981 à 1100 px, la case garde la place du montant plutôt que celle du pictogramme. */
@media (min-width: 981px) and (max-width: 1100px) {
  .management-kpi-icon { display:none; }
}

@media (max-width: 380px) {
  .entity-card-main { grid-template-columns:auto minmax(0,1fr); }
  .entity-card-value { grid-column:2; text-align:left; }
}
[data-customer-search-row][hidden], [data-supplier-search-row][hidden] { display:none !important; }
[data-purchase-search-row][hidden] { display:none !important; }

/* ============================================================
   3.5.0 — TVA, mouvements d'espèces, réinitialisation
   ============================================================ */

.tax-checklist { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .5rem; }
.tax-checklist li {
  padding: .65rem .85rem;
  border-radius: 12px;
  border: 1px solid var(--line, #e5e7eb);
  background: var(--surface-2, #fafafa);
  font-size: .9rem;
  line-height: 1.4;
}
.tax-checklist li.done { border-color: #16a34a33; background: #16a34a0f; }
.tax-checklist li.todo { border-color: #f59e0b40; background: #f59e0b0f; }

.total-row.subtle { opacity: .72; font-size: .88em; }
.total-row.subtle strong { font-weight: 600; }

.manager-row.muted { opacity: .55; }
.manager-row-actions { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }

.checkbox-field {
  flex-direction: row !important;
  align-items: center;
  gap: .6rem;
}
.checkbox-field input { width: auto; margin: 0; }

/* Photo produit — fiche article (import + aperçu + suppression) */
.product-image-uploader { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.product-image-preview {
  width: 72px; height: 72px; flex: 0 0 auto;
  display: grid; place-items: center;
  border-radius: 12px; overflow: hidden;
  background: var(--panel-soft); border: 1px solid var(--line-soft);
}
.product-image-preview img { width: 100%; height: 100%; object-fit: cover; }
.product-image-preview .product-mark { width: 100%; height: 100%; border-radius: 0; font-size: 15px; }
.product-image-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.product-image-scope { margin-top: 10px; }
.icon-button.category-priority.is-pinned svg { fill: #F5B301; stroke: #B98200; }
.category-priority-note { display: flex; align-items: center; gap: 6px; margin: 8px 0 4px; }
.category-priority-note .icon { width: 16px; height: 16px; flex: none; }
/* Ordre manuel (4.37.0) : poignée de glisser-déposer. */
.sortable-row { display: flex; align-items: center; gap: 10px; }
.sortable-row > div:not(.row-actions) { flex: 1; min-width: 0; }
.sort-handle { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 36px; flex: none; color: var(--muted); cursor: grab; touch-action: none; border-radius: 8px; }
.sort-handle:hover { background: var(--panel-soft); color: var(--ink); }
.sort-handle .icon { width: 18px; height: 18px; fill: currentColor; stroke: none; }
.sort-dragging { box-shadow: 0 12px 30px rgba(0, 0, 0, .18); background: var(--panel); border-radius: 10px; opacity: .96; cursor: grabbing; }
.sort-placeholder { border: 2px dashed var(--line); border-radius: 10px; background: var(--panel-soft); }
.product-order-chips { margin: 10px 0 12px; }
/* Fidélité (4.37.0). */
.loyalty-flag { display: flex; align-items: center; gap: 4px; margin-top: 2px; color: #B98200; font-weight: 700; }
.loyalty-flag .icon { width: 12px; height: 12px; fill: #F5B301; stroke: #B98200; }
.loyalty-reward { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; border-bottom: 1px solid var(--line); background: #FFF7DD; color: #6B4E00; font-weight: 700; text-align: left; cursor: pointer; }
.loyalty-reward small { display: block; font-weight: 500; opacity: .8; }
.loyalty-reward .icon { width: 20px; height: 20px; flex: none; }
.loyalty-reward.active { background: #F5B301; color: #1B1400; }
:root[data-theme="dark"] .loyalty-reward { background: #3A2E08; color: #FFE08A; }
:root[data-theme="dark"] .loyalty-reward.active { background: #F5B301; color: #1B1400; }
.loyalty-adjust { display: grid; grid-template-columns: 130px 120px 1fr auto; gap: 10px; align-items: end; margin-top: 12px; }
.loyalty-adjust .wide { min-width: 0; }
.loyalty-modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.loyalty-fields { margin-bottom: 8px; }
.loyalty-fields[hidden] { display: none; }
@media (max-width: 720px) {
  .loyalty-adjust, .loyalty-modes { grid-template-columns: 1fr; }
}
.file-button { cursor: pointer; }

/* Mouvements d'espèces */
.cash-movements {
  margin: 1rem 0;
  padding: 1rem;
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 14px;
  background: var(--surface-2, #fafafa);
}
.cash-movements .section-head { margin-bottom: .75rem; }
.cash-movements h3 { margin: 0; font-size: 1rem; }
.cash-movements p { margin: .15rem 0 0; font-size: .82rem; opacity: .7; }

/* Comptage par coupures */
.cash-breakdown {
  margin: .85rem 0;
  padding: .85rem 1rem;
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 14px;
  background: var(--surface-2, #fafafa);
}
.cash-breakdown summary { cursor: pointer; font-weight: 600; }
.cash-breakdown > p { margin: .6rem 0 .9rem; }
.denomination-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: .55rem;
  margin-bottom: .85rem;
}
.denomination {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  font-size: .78rem;
  font-weight: 600;
  opacity: .85;
}
.denomination input {
  width: 100%;
  padding: .5rem .6rem;
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 10px;
  font-size: .95rem;
  text-align: right;
  background: var(--surface, #fff);
  color: inherit;
}

/* Réinitialisation de mot de passe */
.link-button {
  display: block;
  width: 100%;
  margin: .75rem 0 0;
  padding: .5rem;
  background: none;
  border: none;
  color: inherit;
  opacity: .7;
  font-size: .85rem;
  text-decoration: underline;
  cursor: pointer;
}
.link-button:hover { opacity: 1; }

.reset-code {
  margin: 1rem 0;
  padding: 1.1rem;
  border: 2px dashed var(--line, #d4d4d8);
  border-radius: 14px;
  text-align: center;
  font: 700 1.6rem/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .12em;
  user-select: all;
}
.reset-result p { line-height: 1.5; }

@media (max-width: 480px) {
  .denomination-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
  .reset-code { font-size: 1.25rem; letter-spacing: .08em; }
  .manager-row-actions { width: 100%; }
}

.tax-warning {
  margin: 0 0 1rem;
  padding: .85rem 1rem;
  border: 1px solid #f59e0b66;
  border-left: 4px solid #f59e0b;
  border-radius: 12px;
  background: #f59e0b14;
  font-size: .9rem;
  line-height: 1.5;
}

/* Fiche Abonnement (4.38.1) : modules et limites de la formule, ajustables. */
.billing-offer {
  display: grid;
  gap: .6rem;
  padding: .85rem 1rem;
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 12px;
  background: #f8fafc;
}
.billing-offer .form-grid { margin: 0; }
.billing-offer .field-note { margin: 0; }
/* « Caisses comprises » (5.15.0) et la note « Ancien client » : le même écart que les autres champs sous le cadre. */
.billing-offer + .field, .billing-offer + .field-note { margin-top: 14px; }
.billing-modules { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .35rem .9rem; }
.billing-modules label { display: flex; align-items: center; gap: .5rem; font-size: .92rem; }
.billing-modules input { width: 18px; height: 18px; flex: none; }

.tax-mode-badge {
  margin: 0 0 .6rem;
  padding: .45rem .6rem;
  border-radius: 9px;
  background: #f59e0b16;
  border: 1px solid #f59e0b40;
  font-size: .76rem;
  line-height: 1.35;
  text-align: center;
}

/* ============================================================
   3.7.0 — Impression directe et tiroir-caisse
   ============================================================ */

[data-only][hidden] { display: none !important; }
.printer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 1rem 0 .5rem;
}
.printer-actions .button { flex: 1 1 auto; min-width: 140px; }

.agent-status {
  margin-top: 1rem;
  padding: .75rem .9rem;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: .2rem;
  font-size: .86rem;
  line-height: 1.4;
}
.agent-status strong { font-weight: 600; }
.agent-status span { opacity: .8; }
.agent-status.ok { background: #16a34a0f; border: 1px solid #16a34a33; }
.agent-status.error { background: #dc262610; border: 1px solid #dc262633; }

@media (max-width: 480px) {
  .printer-actions .button { flex: 1 1 100%; }
}

/* ============================================================
   3.8.0 — Console d'abonnements
   ============================================================ */

.subscription-banner {
  margin: 0 0 1rem;
  padding: .75rem 1rem;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: .2rem;
  font-size: .88rem;
  line-height: 1.45;
}
.subscription-banner span { opacity: .85; font-size: .84rem; }
.subscription-banner .button { align-self: flex-start; margin-top: .5rem; }
.subscription-banner.info { background: #2563eb0f; border: 1px solid #2563eb33; }
.subscription-banner.warn { background: #f59e0b14; border: 1px solid #f59e0b40; }
.subscription-banner.bad  { background: #dc262610; border: 1px solid #dc262640; }

.subscription-badge {
  display: inline-block;
  margin-left: .4rem;
  padding: .1rem .45rem;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
  vertical-align: middle;
}
.subscription-badge.ok   { background: #16a34a1f; color: #15803d; }
.subscription-badge.warn { background: #f59e0b26; color: #b45309; }
.subscription-badge.bad  { background: #dc26261f; color: #b91c1c; }

.subscription-row small { display: block; }
.subscription-note { opacity: .7; font-style: italic; margin-top: .2rem; }
/* Sections de la console Abonnements (4.89.0), atteintes par les pastilles de la vue d'ensemble. */
.subscription-section { scroll-margin-top: 16px; }

@media (prefers-color-scheme: dark) {
  .subscription-badge.ok   { color: #4ade80; }
  .subscription-badge.warn { color: #fbbf24; }
  .subscription-badge.bad  { color: #f87171; }
}

/* ============================================================
   3.9.0 — Remises et écran client
   ============================================================ */

.discount-context {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: .75rem .9rem;
  margin-bottom: .9rem;
  border-radius: 12px;
  background: var(--surface-2, #fafafa);
  border: 1px solid var(--line, #e5e7eb);
  font-size: .92rem;
}
.discount-context strong { font-variant-numeric: tabular-nums; }

.discount-modes { display: flex; gap: .5rem; margin-bottom: 1rem; }
.discount-modes .button { flex: 1; }

.line-discount-tag {
  display: inline-block;
  margin-top: .2rem;
  padding: .08rem .4rem;
  border-radius: 999px;
  background: #16a34a1f;
  color: #15803d;
  font-size: .7rem;
  font-weight: 600;
  white-space: nowrap;
}
@media (prefers-color-scheme: dark) { .line-discount-tag { color: #4ade80; } }

.line-total s { opacity: .5; font-size: .85em; font-weight: 400; }
.line-buttons { display: flex; gap: 12px; justify-content: flex-end; }

/* Modale « abonnement requis » (paywall) affichée au client bloqué. */
.paywall-plans {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
  margin: 1rem 0;
  align-items: stretch;
}
.paywall-plan {
  display: flex;
  flex-direction: column;
  gap: .45rem;
  padding: 1rem .9rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-soft);
}
.paywall-plan h3 { margin: 0; font-size: 1rem; text-align: center; }
.paywall-price { margin: 0; font-size: 1.35rem; font-weight: 700; text-align: center; }
.paywall-price span { font-size: .7rem; font-weight: 500; color: var(--muted); }
.paywall-tagline {
  margin: 0;
  font-size: .78rem;
  line-height: 1.4;
  color: var(--muted);
  text-align: center;
}
.paywall-features {
  margin: .35rem 0 0;
  padding: .6rem 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .3rem;
  font-size: .8rem;
  line-height: 1.35;
}
.paywall-features li { position: relative; padding-left: 1.1rem; }
/* Coche dessinee en CSS : pas d'icone a charger, et elle reste lisible
   en theme sombre comme en theme clair. */
.paywall-features li::before {
  content: "";
  position: absolute;
  left: .1rem;
  top: .3rem;
  width: .32rem;
  height: .6rem;
  border: solid #16a34a;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
/* Pousse le bouton en bas : les trois cartes s'alignent meme si l'une
   annonce une ligne de plus que les autres. */
.paywall-plan .button { width: 100%; margin-top: auto; }
.paywall-plan .field-note { margin-top: auto; text-align: center; }
@media (max-width: 640px) {
  .paywall-plans { grid-template-columns: 1fr; }
  .paywall-plan .button, .paywall-plan .field-note { margin-top: .5rem; }
}

/* Restauration 4.0 : surfaces tactiles, héritage du thème existant. */
.rest-toolbar,.rest-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}
.rest-toolbar{padding:12px 0}.rest-fields{padding:14px;border-bottom:1px solid var(--line,#ddd);display:grid;gap:12px}.rest-fields label{display:grid;gap:6px;font-size:12px;font-weight:600}.rest-input-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.rest-fields input,.rest-fields select,.rest-fields textarea{width:100%;min-width:0;min-height:42px;border:1px solid var(--line,#ddd);border-radius:8px;padding:9px;background:var(--panel,#fff);color:inherit;font:inherit}.rest-fields textarea{min-height:58px;resize:vertical}.rest-fields small,.rest-help,.rest-sync{font-size:12px;opacity:.72;line-height:1.5}.rest-sync{margin:10px 0 18px}.rest-line-note{display:block;border:0;background:transparent;color:inherit;text-align:left;padding:7px 0;text-decoration:underline;font-size:12px;white-space:normal;overflow-wrap:anywhere}.rest-board{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin-top:18px;align-items:start}.rest-column{background:var(--panel,#fff);border:1px solid var(--line,#ddd);border-radius:14px;padding:12px;min-width:0}.rest-column h2{font-size:15px;margin:0 0 15px;display:flex;justify-content:space-between;gap:10px}.rest-column h2 span{opacity:.6}.rest-order{border:1px solid var(--line,#ddd);border-radius:10px;padding:14px;margin-bottom:12px;overflow-wrap:anywhere}.rest-order h3{margin:12px 0 6px;font-size:16px}.rest-order p{margin:7px 0}.rest-order ul{list-style:none;padding:0;margin:15px 0}.rest-order li{margin:10px 0;font-size:14px}.rest-order small{display:block;font-size:12px;line-height:1.5;opacity:.8}.rest-order li small{font-size:14px;font-weight:600;opacity:1;margin-top:4px}.rest-card-actions{display:grid;gap:8px;margin-top:12px}.rest-card-actions .button{width:100%;white-space:normal;min-height:42px}.rest-paid{display:inline-block;font-size:11px;font-weight:700;background:#fff1d2;color:#714300;border-radius:5px;padding:5px 8px}.rest-paid.yes{background:#dcf4e7;color:#175534}.rest-note{padding:10px;border-left:3px solid #a7792b;background:rgba(175,135,60,.1);font-weight:600}.rest-late{border-top:3px solid #b87723}.rest-empty{font-size:13px;opacity:.6;padding:20px 0}.rest-help{margin-top:20px}
@media(max-width:1250px){.rest-board{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:650px){.rest-board{grid-template-columns:1fr}.rest-input-grid{grid-template-columns:1fr 1fr}.rest-heading .button{font-size:11px}.rest-fields{padding:12px}.rest-toolbar .button{flex:1}}


/* ------------------------------------------------------------------
 * Écran Caisse sur ordinateur : mise en page à la hauteur de la fenêtre.
 * Le bloc « Caisse » et le ticket restent en place ; seule la liste des
 * produits défile (recherche et catégories restent visibles), et les
 * lignes du ticket défilent dans le ticket. (« sticky » ne pouvait pas
 * marcher : html/body ont overflow-x: hidden.) Dès 901 px de large et
 * 400 px de haut : tablette en paysage (960 × 528) et fenêtre Windows aussi. Plus bas (clavier de la
 * tablette ouvert), la page défile et la bande des commandes reste sous les articles (design.css).
 * ------------------------------------------------------------------ */
@media (min-width: 901px) and (min-height: 400px) {
  .app-shell.cashier-active { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
  .app-shell.cashier-active .app-main { height: 100%; display: flex; flex-direction: column; overflow: hidden; }
  .app-shell.cashier-active .app-main > * { flex: 0 0 auto; }
  .app-shell.cashier-active .cashier-layout { flex: 1 1 auto; min-height: 0; align-items: stretch; }
  .app-shell.cashier-active .catalog-panel { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
  .app-shell.cashier-active .catalog-panel > * { flex: 0 0 auto; }
  .app-shell.cashier-active .product-grid { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; align-content: start; padding: 3px 6px 10px 3px; margin: 0 -6px 0 -3px; }
  .app-shell.cashier-active .ticket-panel { position: static; display: flex; flex-direction: column; min-height: 0; overflow-y: auto; }
  .app-shell.cashier-active .ticket-panel > * { flex: 0 0 auto; }
  .app-shell.cashier-active .ticket-panel > .ticket-lines { flex: 1 1 auto; min-height: 140px; max-height: none; overscroll-behavior: contain; }
}

/* Ticket de caisse à l'écran : identique au ticket imprimé (voir
 * assets/js/print/ticket-layout.js, TICKET_CSS). Toujours sur « papier »
 * blanc, même en thème sombre. */
.tk{container-type:inline-size;width:100%;color:#000;font-family:"Consolas","Menlo","DejaVu Sans Mono","Liberation Mono","Courier New",monospace;font-variant-ligatures:none;font-kerning:none}
.tk-l{white-space:pre;overflow:hidden;font-size:var(--tk-fs,calc(100cqw / (var(--tk-cols) * 0.6)));line-height:1.3}
.tk-b{font-weight:700}
.tk-big{line-height:2.3}
.tk-big{transform:scaleY(1.7);transform-origin:center}
.tk-qr{display:flex;justify-content:center;padding:1.5mm 0}
.tk-qr svg{width:28%;height:auto}
.receipt.receipt-paper{max-width:430px;margin:0 auto;padding:14px 12px 18px;background:#fff;color:#000;border:1px solid #e3e3e3;border-radius:6px;box-shadow:0 6px 22px rgba(0,0,0,.08)}
:root[data-theme="dark"] .receipt.receipt-paper{background:#fff;color:#000}

/* ------------------------------------------------------------------
 * Clavier tactile intégré (assets/js/ui/touch-keyboard.js)
 * Pavé numérique : ancré à droite (les fenêtres restent visibles).
 * Clavier texte : ancré en bas. Les fenêtres se décalent d'autant.
 * ------------------------------------------------------------------ */
.kb { position: fixed; z-index: 400; background: #16181c; color: #fff; box-shadow: 0 -10px 40px rgba(0,0,0,.35); user-select: none; -webkit-user-select: none; touch-action: manipulation; font-family: var(--font-sans, system-ui, sans-serif); }
.kb[hidden] { display: none; }
.kb-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 30px; margin-bottom: 8px; color: #b8bec8; font-size: 13px; font-weight: 600; }
.kb-head span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-key { display: grid; place-items: center; min-width: 0; min-height: 58px; padding: 0 6px; border: 0; border-radius: 10px; background: #2b2f36; color: #fff; font: 600 22px/1 var(--font-sans, system-ui, sans-serif); cursor: pointer; box-shadow: inset 0 -2px 0 rgba(0,0,0,.35); }
.kb-key.kb-pressed, .kb-key:active { background: #4a505a; transform: translateY(1px); }
.kb-fn { background: #3a3f47; font-size: 18px; }
.kb-ok { background: #1f9d55; font-size: 18px; }
.kb-on { background: #e8eaed; color: #111; }
.kb .kb-mini { min-height: 30px; padding: 0 12px; font-size: 13px; }

/* Pavé numérique */
.kb-num { right: 12px; top: 50%; transform: translateY(-50%); width: 316px; padding: 14px; border-radius: 18px; }
.kb-display { margin-bottom: 10px; padding: 10px 14px; border-radius: 10px; background: #0c0d10; font: 700 34px/1.1 var(--font-mono, ui-monospace, monospace); text-align: right; letter-spacing: .02em; overflow: hidden; text-overflow: ellipsis; }
.kb-display.kb-fresh { color: #8fd3a8; }
.kb-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kb-grid .kb-key { min-height: 64px; font-size: 26px; }
.kb-grid .kb-fn, .kb-grid .kb-ok { font-size: 20px; }

/* Clavier texte */
.kb-text { left: 50%; bottom: 0; transform: translateX(-50%); width: min(1100px, 100%); padding: 10px 12px calc(12px + env(safe-area-inset-bottom)); border-radius: 18px 18px 0 0; }
.kb-row { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; margin-top: 6px; }
.kb-row .kb-wide { grid-column: span 1; }
.kb-row .kb-space { grid-column: span 3; font-size: 16px; }
.kb-text .kb-key { min-height: 54px; font-size: 21px; }

@media (max-width: 899px) {
  .kb-num { top: auto; bottom: 0; right: 0; left: 0; transform: none; width: 100%; border-radius: 18px 18px 0 0; padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .kb-grid .kb-key { min-height: 52px; }
}

/* Place laissée au clavier ouvert */
.kb-open .modal-backdrop { padding-bottom: calc(22px + var(--kb-bottom, 0px)); padding-right: calc(22px + var(--kb-right, 0px)); }
.kb-open .modal { max-height: calc(100vh - 44px - var(--kb-bottom, 0px)); }
.kb-open .app-main { padding-bottom: calc(28px + var(--kb-bottom, 0px)); }
/* Messages (4.81.0) : juste au-dessus du clavier ouvert, qui couvre aussi la barre du bas du téléphone. */
.kb-open .toast, .kb-open .app-shell.cashier-active ~ .toast { bottom: calc(26px + var(--kb-bottom, 0px)); }
/* Écran bas, pavé en bas (téléphone, petite tablette) (4.92.0) : pavé serré et fenêtre allégée, collée au pavé.
 * Avant, l'encaissement ne gardait que son titre et ses boutons (environ 12 px de contenu sur 360 × 640). */
@media (max-width: 899px) and (max-height: 760px) {
  .kb-num { padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); }
  .kb-num .kb-head { min-height: 0; margin-bottom: 4px; font-size: 12px; }
  .kb-num .kb-display { margin-bottom: 6px; padding: 4px 12px; font-size: 24px; }
  .kb-num .kb-grid { gap: 5px; }
  .kb-num .kb-grid .kb-key { min-height: 40px; font-size: 21px; }
  .kb-num .kb-grid .kb-fn, .kb-num .kb-grid .kb-ok { font-size: 17px; }
  .kb-open .modal-backdrop { padding-top: 6px; padding-bottom: var(--kb-bottom, 0px); }
  .kb-open .modal { max-height: calc(100dvh - 6px - var(--kb-bottom, 0px)); }
  .kb-open .modal-head { align-items: center; padding: 6px 14px; }
  .kb-open .modal-head h2 { margin: 0; font-size: 16px; }
  .kb-open .modal-head p { display: none; }
  .kb-open .modal-head .icon-button { width: 34px; height: 34px; min-height: 34px; }
  .kb-open .modal-actions { padding: 6px 14px; }
  .kb-open .modal-actions .button { min-height: 40px; }
  /* Le pavé remplace les montants proposés : le champ remonte avec la monnaie à rendre juste dessous, au-dessus des boutons. */
  .kb-open .modal .amount-presets { display: none; }
  .kb-open #amountReceived, .kb-open #splitReceived { scroll-margin: 8px 0 126px; }
}

/* Paiement multiple : reste en espèces / en carte */
.remainder-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.remainder-actions .button { justify-content: center; min-height: 48px; }
/* « Sur le compte » sans client (4.92.0) : le choix du client, sous le message. */
.auth-error .account-pick { display: flex; margin-top: 8px; }

/* Clôture : ouvrir le tiroir pour compter */
.session-live-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.session-live-actions .button { min-height: 44px; }

/* Numéro de caissier (matricule) : sur le ticket c'est la seule mention
 * de l'employé ; dans l'app il accompagne son nom. */
.agent-number { display: inline-block; padding: 2px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel-soft); color: var(--muted); font-family: var(--font-mono, ui-monospace, monospace); font-size: 12px; font-weight: 700; letter-spacing: .02em; vertical-align: middle; }
h3 .agent-number { font-size: 13px; }

/* Connexion employé (numéro + code) : une seule carte, centrée, à portée
 * de doigt sur le PoS. */
.auth-card .field input { min-height: 52px; }
.pin-card .field input { font-size: 20px; letter-spacing: .06em; }

/* Pavé de code à 6 chiffres (connexion employé, création du code).
 * Grandes touches rondes, points qui se remplissent : même logique
 * qu'un déverrouillage de téléphone. */
.pin-card { text-align: center; }
.pin-stage h1 { margin: 0 0 6px; font-size: 26px; letter-spacing: -.02em; }
.pin-subtitle { margin: 0 0 20px; color: var(--muted); font-size: 14px; }
.pin-dots { display: flex; justify-content: center; gap: 14px; margin-bottom: 18px; }
.pin-dots i { width: 14px; height: 14px; border: 2px solid var(--line); border-radius: 50%; background: transparent; transition: background .12s ease, border-color .12s ease; }
.pin-dots i.on { background: var(--ink); border-color: var(--ink); }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; max-width: 300px; margin: 8px auto 4px; }
.pin-key { width: 80px; height: 80px; margin: 0 auto; border: 1px solid var(--line); border-radius: 50%; background: var(--panel-soft); color: var(--ink); font: 300 30px/1 var(--font-sans, system-ui, sans-serif); cursor: pointer; touch-action: manipulation; }
.pin-key:active { background: var(--ink); color: var(--strong-text, #fff); transform: scale(.96); }
.pin-key.pin-action { font-size: 22px; background: transparent; border-color: transparent; }
.pin-card .link-button { margin-top: 14px; }
@media (max-height: 700px) {
  .pin-key { width: 66px; height: 66px; font-size: 26px; }
  .pin-pad { gap: 10px; }
}
.auth-card .checkbox-field { display: flex; align-items: center; gap: 12px; text-align: left; font-weight: 600; }
.auth-card .checkbox-field input { flex: 0 0 auto; width: 22px; height: 22px; margin: 0; }
.auth-card .field { text-align: left; }

/* Déclinaisons : choix de la taille en caisse et tableau des stocks. */
.variant-picker { display: grid; gap: 14px; }
.variant-block { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--panel); }
.variant-block-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.variant-block-head strong { font-size: 16px; }
.variant-block-head span { color: var(--muted); font-size: 12px; }
.internal-code { margin-left: 6px; padding: 0 4px; border: 1px solid currentColor; border-radius: 4px; color: var(--muted); font-size: 10px; font-weight: 600; vertical-align: middle; opacity: .75; }
.size-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.size-chip { display: grid; gap: 2px; place-items: center; min-height: 64px; padding: 8px 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-soft); color: var(--ink); cursor: pointer; }
.size-chip strong { font-size: 17px; }
.size-chip small { color: var(--muted); font-size: 11px; }
.size-chip:active { background: var(--ink); color: var(--strong-text, #fff); }
.size-chip.out { opacity: .45; cursor: not-allowed; }
.variant-sizes { color: var(--muted-2); font-size: 11px; }
.variant-matrix { margin-top: 18px; }
.variant-matrix h4 { margin: 0 0 8px; font-size: 14px; }
.variant-table td, .variant-table th { text-align: center; }
.variant-table th[scope="row"] { text-align: left; }
.variant-cell strong { font-variant-numeric: tabular-nums; }
.variant-cell.low strong { color: #b45309; }
.variant-cell.out strong { color: #b91c1c; }
.variant-cell.empty { color: var(--muted-2); }
.variant-total { font-weight: 700; }

/* Recherche en haut d'une fenêtre de sélection (client du ticket). */
.picker-search { display: flex; align-items: center; gap: 9px; min-height: 48px; margin-bottom: 10px; padding: 0 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel-soft); }
.picker-search .icon { flex: 0 0 auto; width: 18px; color: var(--muted); }
.picker-search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 16px; }
.picker-more { padding: 10px 12px; color: var(--muted); font-size: 12px; text-align: center; }

/* Capacités du commerce et bloc de déclinaisons de la fiche article. */
.capability-block { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.capability-block > strong { display: block; font-size: 13px; }
.capability-locked { margin-top: 10px; }
.variant-fields { padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel-soft); }
.variant-fields-grid { margin-top: 12px; }
.variant-fields-grid.hidden { display: none; }

/* Assistant de déclinaisons : coloris, tailles et stock de chaque case. */
.variant-builder { margin-top: 12px; display: flex; flex-direction: column; gap: 14px; }
.variant-builder.hidden { display: none; }
.chip-editor { display: flex; flex-direction: column; gap: 8px; }
.chip-editor-head { display: flex; align-items: baseline; gap: 8px; }
.chip-editor-head b { font-size: 13px; }
.chip-editor-head small { color: var(--muted); }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; min-height: 34px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 6px 6px 6px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); font-size: 13px; font-weight: 700; }
.chip button { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; background: var(--panel-soft); color: var(--muted); cursor: pointer; }
.chip button:hover { background: var(--line); color: var(--ink); }
.chip button .icon { width: 12px; }
.chip-empty { color: var(--muted); font-size: 13px; }
.chip-input { display: flex; gap: 8px; }
.chip-input input { flex: 1; min-width: 0; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel-soft); color: var(--ink); font: inherit; }
.chip-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-preset { padding: 6px 11px; border: 1px dashed var(--line); border-radius: 999px; background: transparent; color: var(--muted); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.chip-preset:hover { border-style: solid; color: var(--ink); }
.variant-matrix-edit { border-top: 1px solid var(--line); padding-top: 12px; }
.variant-matrix-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px; margin-bottom: 10px; }
.variant-matrix-head b { display: block; font-size: 13px; }
.variant-matrix-head small { color: var(--muted); }
.variant-fill { display: flex; align-items: center; gap: 8px; }
.variant-fill label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 700; }
.variant-fill input { width: 72px; min-height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-soft); color: var(--ink); font: inherit; }
.variant-stock-input { width: 100%; min-width: 56px; min-height: 40px; padding: 0 8px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-soft); color: var(--ink); font: inherit; text-align: center; }
.variant-table th[scope="row"] { white-space: nowrap; }
.field.hidden, .form-grid > label.hidden { display: none; }

/* La case des déclinaisons suit la même mise en forme que les
 * interrupteurs des réglages : titre sur sa ligne, explication dessous. */
.variant-fields .switch-label { align-items: flex-start; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); font-size: 12px; color: inherit; }
.variant-fields .switch-label input { margin-top: 3px; }
.variant-fields .switch-label b, .variant-fields .switch-label small { display: block; }
.variant-fields .switch-label small { color: var(--muted); }
.variant-matrix-edit .table-wrap { max-height: 320px; overflow: auto; }
.variant-matrix-edit thead th { position: sticky; top: 0; z-index: 1; background: var(--panel); }
.variant-matrix-edit .variant-table th, .variant-matrix-edit .variant-table td { padding: 6px 8px; }
.variant-stock-input { min-width: 48px; }
.variant-sku-preview { margin-top: 10px; }
.variant-sku-preview code { padding: 1px 5px; border-radius: 5px; background: var(--panel-soft); font-size: 11px; }
/* Le tableau des déclinaisons n'a pas besoin de la largeur minimale des
 * grands tableaux de gestion : il doit tenir dans la fenêtre. */
.variant-matrix-edit .variant-table { min-width: 0; }
.variant-matrix-edit .variant-table td { max-width: 96px; }

/* Bloc d'un modèle (4.80.0) : prix et quantité de chaque variante dans une seule fenêtre. */
.family-base { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 4px 14px; margin-bottom: 12px; }
.family-base .field { width: 160px; }
.family-base .field-note { flex: 1 1 220px; margin: 0 0 10px; }
.family-form .table-wrap { max-height: 52vh; overflow: auto; }
.family-form thead th { position: sticky; top: 0; z-index: 1; }
.data-table.family-table { min-width: 0; }
.data-table.family-table th, .data-table.family-table td { padding: 6px 8px; }
.data-table.family-table tbody th { background: none; color: inherit; font-size: 13px; font-weight: 750; letter-spacing: 0; text-transform: none; border-bottom: 1px solid var(--line-soft); }
.family-table .family-input { width: 100%; min-width: 64px; max-width: 140px; min-height: 40px; }
.family-table .family-sku { color: var(--muted); font-size: 11px; }
.family-table .own-price, .family-table .was-price { display: block; margin-top: 2px; font-size: 10px; }
.family-table .own-price { color: var(--amber); font-weight: 800; }
.family-table .own-price[hidden] { display: none; }
.family-add { margin-top: 10px; }

/* Bons d'achat et avoirs. */
.credit-settings { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.sell-voucher-button { margin-bottom: 8px; }
.credit-pay { margin: 14px 0; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel-soft); }
.credit-pay-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.credit-pay-head b { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.credit-pay-head small { color: var(--muted); }
.credit-pay-line { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line-soft); }
.credit-pay-line span { flex: 1; display: flex; flex-direction: column; }
.credit-pay-line small { color: var(--muted); font-size: 11px; }
.credit-pay-input { display: flex; gap: 8px; margin-top: 8px; }
.credit-pay-input input { flex: 1; min-width: 0; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel); color: var(--ink); font: inherit; letter-spacing: .06em; text-transform: uppercase; }
.credit-settled { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding: 12px; border-radius: 11px; background: var(--panel-soft); color: var(--muted); font-size: 12px; }
.credit-detail-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 16px; }
.credit-detail-head h3 { margin: 2px 0 0; font-size: 26px; letter-spacing: .04em; }
.credit-kind { color: var(--muted); font-size: 10px; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
.credit-balance { text-align: right; }
.credit-balance span { display: block; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.credit-balance strong { font-size: 24px; }
.credit-balance small { display: block; color: var(--muted); }
.credit-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 16px 0; }
.credit-meta span { display: block; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .06em; }
.credit-status { font-size: 11px; font-weight: 800; }
.credit-status.active { color: var(--green); }
.credit-status.expired, .credit-status.cancelled { color: var(--red); }
.credit-status.used { color: var(--muted); }
.credit-movement-amount { text-align: right; }
.credit-movement-amount small { display: block; color: var(--muted); }
.confirm-field { margin-top: 14px; text-align: left; }
@media (max-width: 560px) { .credit-settings { grid-template-columns: 1fr; } }
.voucher-recipient { margin: 4px 0 12px; }
.voucher-recipient-list { max-height: 210px; overflow: auto; margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.voucher-recipient-chosen { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel-soft); }
.voucher-recipient-chosen span { flex: 1; display: flex; flex-direction: column; }
.voucher-recipient-chosen small { color: var(--muted); font-size: 11px; }
.credit-flag { display: inline-flex; align-items: center; gap: 4px; color: var(--green); font-size: 10px; font-weight: 800; }
.credit-flag .icon { width: 12px; }
.ticket-options .muted-value { color: var(--muted); font-weight: 700; }
.ticket-options .has-credit { border-color: var(--green); }
.customer-choice-side { display: flex; align-items: center; gap: 8px; }
.credit-badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; background: var(--panel-soft); color: var(--green); font-size: 11px; font-weight: 800; }
.credit-badge .icon { width: 12px; }
.credit-owner-hint { margin-bottom: 8px; justify-content: flex-start; font-size: 12px; }
.credit-owner-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }

/* Sélection multiple d'articles et actions groupées. */
.select-cell { width: 44px; }
.select-box { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 9px; cursor: pointer; }
.select-box:hover { background: var(--panel-soft); }
.select-box input { width: 17px; height: 17px; accent-color: var(--ink); cursor: pointer; }
tr.is-selected > td { background: var(--panel-soft); }
.inventory-mobile-row { display: flex; align-items: center; gap: 4px; }
.inventory-mobile-row .inventory-mobile-product { flex: 1; min-width: 0; }
.inventory-mobile-row.is-selected { border-radius: 11px; background: var(--panel-soft); }
.selection-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 12px 0; padding: 10px 14px; border: 1px solid var(--ink); border-radius: 11px; background: var(--panel); }
.selection-bar strong { font-size: 13px; }
/* Boutons de la sélection (4.83.0, avec « Étiquettes ») : à la ligne sur une tablette en portrait ou un téléphone. */
.selection-bar .row-actions { flex-wrap: wrap; }
.bulk-field { padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.bulk-field:last-of-type { border-bottom: 0; }
.bulk-field .switch-label { align-items: flex-start; font-size: 12px; color: inherit; }
.bulk-field .switch-label b, .bulk-field .switch-label small { display: block; }
.bulk-field .switch-label small { color: var(--muted); }
.bulk-control { margin: 10px 0 0 26px; display: flex; flex-direction: column; gap: 6px; }
.bulk-control.hidden { display: none; }
.bulk-control input, .bulk-control select { min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel-soft); color: var(--ink); font: inherit; }
.bulk-control input.hidden, .bulk-control select.hidden { display: none; }
.bulk-price { display: flex; flex-wrap: wrap; gap: 8px; }
.bulk-price select { flex: 1 1 180px; }
.bulk-price input { flex: 1 1 160px; }
.bulk-selection-preview { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 14px; }

/* Coût d'achat : résumé et historique dans la fiche article. */
.cost-panel { margin-top: 18px; }
.cost-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 12px; }
.cost-summary > div { padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel-soft); }
.cost-summary span { display: block; color: var(--muted); font-size: 10px; font-weight: 850; letter-spacing: .06em; }
.cost-summary strong { display: block; font-size: 18px; }
.cost-summary small { display: block; color: var(--muted); font-size: 11px; }
.cost-delta { text-align: right; }
.cost-delta small { display: block; color: var(--muted); }
.data-table td small { display: block; color: var(--muted); font-size: 11px; }
.data-table tfoot th, .data-table tfoot td { padding: 12px 14px; border-top: 1px solid var(--line); background: var(--panel-soft); }

/* Boutique en ligne (4.29) : commandes du site à retirer et encaisser. */
.online-ticket-banner { display: flex; gap: 10px; align-items: center; margin: 0 0 10px; padding: 10px 12px; border-radius: 10px; background: var(--green-soft); color: var(--green); }
.online-ticket-banner strong { display: block; font-size: 12px; }
.online-ticket-banner small { display: block; color: var(--ink-2); font-size: 11px; }
.online-orders-button { margin-bottom: 10px; justify-content: center; }
.online-count { display: inline-grid; min-width: 22px; height: 22px; padding: 0 6px; place-items: center; border-radius: 999px; background: var(--strong); color: var(--strong-text); font-size: 11px; font-weight: 850; }
.online-order-list { display: grid; gap: 12px; margin-top: 12px; }
.online-order-card { padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.online-order-card header { display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; }
.online-order-card header small { display: block; color: var(--muted); font-size: 11px; }
.online-order-total { display: grid; gap: 4px; justify-items: end; text-align: right; }
.online-order-total strong { font-size: 16px; }
.online-order-lines { margin: 12px 0 0; padding: 10px 0 0; border-top: 1px solid var(--line-soft); list-style: none; display: grid; gap: 6px; }
.online-order-lines li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: baseline; font-size: 12px; }
.online-order-lines small { color: var(--muted); font-family: var(--font-mono); font-size: 10px; }
.online-order-note { margin: 10px 0 0; color: var(--ink-2); font-size: 12px; font-style: italic; }
.online-order-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; flex-wrap: wrap; }
.status-badge.online-reserved { background: var(--amber-soft); color: var(--amber); }
.status-badge.completed { background: var(--green-soft); color: var(--green); }
.online-key-value { font-size: 1rem; letter-spacing: .02em; word-break: break-all; }
.online-connection { display: grid; gap: 12px; }
.online-connection-state { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
@media (max-width: 560px) {
  .online-order-card header { flex-direction: column; }
  .online-order-total { justify-items: start; text-align: left; }
  .online-order-actions .button { flex: 1 1 100%; }
}

/* Appareils d'un compte (4.39.0) */
.device-list { list-style: none; margin: .75rem 0; padding: 0; display: grid; gap: .5rem; }
.device-row { display: grid; grid-template-columns: auto 1fr auto; gap: .75rem; align-items: center; padding: .65rem .8rem; border: 1px solid var(--line, #e5e7eb); border-radius: 12px; }
.device-row strong { display: block; }
.device-row small { display: block; color: var(--muted, #64748b); font-size: .82rem; margin-top: .15rem; }

/* Charges (4.48.0) : mois affiché, et mois précédents cliquables */
.expense-month-nav { display: flex; align-items: center; gap: 8px; }
.expense-month-nav strong { min-width: 9.5em; text-align: center; font-size: 15px; }
.expense-month-row { width: 100%; padding: 4px 0; border: 0; background: transparent; font-family: inherit; font-size: 11px; color: var(--muted); text-align: left; cursor: pointer; }
.expense-month-row:hover strong, .expense-month-row:focus-visible strong { text-decoration: underline; }
.expense-row .manager-row-actions { flex-wrap: nowrap; flex-shrink: 0; margin-left: auto; width: auto; }
.expense-section { margin-top: 20px; }
.expense-section h3 { margin: 0; font-size: 15px; }
.expense-section .totals { padding: 10px 2px 0; }
@media (max-width: 760px) {
  .expense-month-nav { justify-content: space-between; }
}

/* Statistiques avec les charges (4.48.1) : six cases, en deux rangées de trois */
.stats.stats-with-expenses { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 660px) {
  .stats.stats-with-expenses { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats.stats-with-expenses .stat:last-child { grid-column: auto; }
}

/* Abonnement : montant convenu (4.49.0), visible seulement avec « Autre montant… » */
[data-billing-price-field][hidden] { display: none !important; }

/* Vue propriétaire (4.51.0) : visible par le propriétaire seul, pas par l'administrateur du commerce. */
[data-owner-only] { outline: 2px solid #22c55e; outline-offset: -2px; }
section[data-owner-only], form[data-owner-only], .function-group[data-owner-only] { outline-offset: 4px; }

/* Arrivages (4.52.0) : date de péremption et prix d'achat dans une ligne de réception. */
.arrival-inputs { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.arrival-inputs > span { display: grid; gap: 3px; flex: 1 1 150px; color: var(--muted); font-size: 11px; font-weight: 700; }
.arrival-inputs input { width: 100%; min-height: 38px; padding: 0 8px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); color: var(--ink); }
/* Bouton « Dater le stock » (4.52.1) : sur une ligne, à côté du titre. */
.cost-panel .section-head > .button { flex-shrink: 0; white-space: nowrap; }

/* Finitions 4.55.1 */
/* Références, codes-barres et étiquettes de stock : sur une ligne. */
.data-table td.mono, .stock-tag { white-space: nowrap; }
/* « (facultatif) » sur la même ligne que son libellé : le champ reste aligné sur ses voisins. */
.field > span > small { color: var(--muted); font-size: 11px; font-weight: 450; }
/* Boutons d'en-tête des onglets de Gestion : libellé sur une ligne. */
.management-section-hero .button { white-space: nowrap; }
/* Onglets de Gestion : tous visibles (plusieurs lignes au besoin) au lieu de défiler hors champ, sur téléphone aussi
 * depuis la 4.92.0 (on n'en voyait que 3 ou 4, sans signe des autres). */
.management-tabs { flex-wrap: wrap; overflow-x: visible; }
/* Tableau du stock : sous 1440 px, la colonne Code-barres cède sa place (le code reste dans la fiche et la recherche). */
@media (max-width: 1440px) {
  .data-table .col-barcode { display: none; }
}
/* Ventes sur téléphone : une fiche par ticket (numéro et total en haut, date, client, paiement et statut dessous) au lieu d'un tableau qui défile hors de l'écran. */
@media (max-width: 640px) {
  .sales-table { display: block; width: 100%; min-width: 0; }
  .sales-table thead { display: none; }
  .sales-table tbody { display: block; }
  .sales-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .data-table.sales-table td { display: block; min-width: 0; padding: 0; border: 0; }
  .sales-table td:nth-child(1) { grid-column: 1; grid-row: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* Les quatre dernières cellules comptées depuis la fin (4.82.0) : la colonne Collaborateur du dépôt-vente s'insère avant elles. */
  .sales-table td:nth-last-child(2) { grid-column: 2; grid-row: 1; text-align: right; }
  .sales-table td:nth-child(2) { grid-column: 1; grid-row: 2; color: var(--muted); font-size: 12px; }
  .sales-table td:nth-last-child(1) { grid-column: 2; grid-row: 2; justify-self: end; }
  .sales-table td:nth-child(3) { grid-column: 1; grid-row: 3; font-size: 12px; }
  .sales-table td:nth-last-child(3) { grid-column: 2; grid-row: 3; text-align: right; color: var(--muted); font-size: 12px; }
  .sales-table td:nth-last-child(4) { display: none; }
  .sales-table td.sale-collaborators { grid-column: 1 / -1; grid-row: 4; font-size: 12px; }
  .sales-table td[colspan] { grid-column: 1 / -1; grid-row: auto; text-align: center; justify-self: stretch; }
  /* Paiements par carte (4.79.0) : ticket et frais en haut, date et montant dessous, le type de carte sur toute la largeur. */
  .card-payments-table { display: block; width: 100%; min-width: 0; }
  .card-payments-table thead { display: none; }
  .card-payments-table tbody { display: block; }
  .card-payments-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .data-table.card-payments-table td { display: block; min-width: 0; padding: 0; border: 0; }
  .card-payments-table td:nth-child(1) { grid-column: 1; grid-row: 1; }
  .card-payments-table td:nth-child(5) { grid-column: 2; grid-row: 1; align-self: center; color: var(--muted); font-size: 12px; }
  .card-payments-table td:nth-child(5)::before { content: "Frais "; }
  .card-payments-table td:nth-child(2) { grid-column: 1; grid-row: 2; color: var(--muted); font-size: 12px; }
  .card-payments-table td:nth-child(3) { grid-column: 2; grid-row: 2; text-align: right; }
  .card-payments-table td:nth-child(4) { grid-column: 1 / -1; grid-row: 3; }
  .card-payments-table td[colspan] { grid-column: 1 / -1; grid-row: auto; text-align: center; }
  /* Bloc d'un modèle (4.80.0) : coloris, taille et boutons en haut, SKU dessous, quantité et prix côte à côte. */
  .data-table.family-table { display: block; }
  .family-table thead { display: none; }
  .family-table tbody { display: block; }
  .family-table tr { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .data-table.family-table td, .data-table.family-table th { display: block; min-width: 0; padding: 0; border: 0; }
  .family-table tr > :last-child { margin-left: auto; }
  .family-table td[data-label="Coloris"], .family-table td[data-label="Taille"] { flex: 1 1 30%; }
  .family-table .family-sku { order: 5; flex: 0 0 100%; }
  .family-table td[data-label="Quantité"], .family-table td[data-label="Prix"] { order: 6; flex: 1 1 40%; }
  .family-table td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 2px; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
  .family-table .family-input { max-width: none; }
}

/* Dépôt-vente (4.78.0) : type de carte à l'encaissement, quantités d'un bon de dépôt. */
.card-type-choice { display: grid; gap: 6px; margin-top: 14px; }
.card-type-choice > span { color: var(--muted); font-size: 11px; font-weight: 750; }
.compact-input { width: 84px; min-height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); }
.field-note .link-button { display: inline; width: auto; margin: 0; padding: 0; font-size: inherit; }
/* Trois boutons en tête de Collaborateurs : ils passent sous le texte plutôt que de sortir du cadre. */
.management-section-hero .row-actions { flex-wrap: wrap; }
.section-head > .row-actions { flex-shrink: 0; flex-wrap: wrap; }
.section-head > .row-actions .button { white-space: nowrap; }
@media (min-width: 761px) {
  .management-section-hero { flex-wrap: wrap; }
  .management-section-hero > div:first-child { flex: 1 1 300px; }
  .form-grid.card-type-row { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); }
}

/* Étiquettes A4 (4.83.0) : articles et quantités à gauche, planche et placement à droite. La planche en petit reste
 * blanche comme le papier, même en thème sombre. */
.modal.label-sheet-modal { width: min(1060px, 100%); }
.label-sheet-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.label-sheet-block { display: grid; gap: 10px; margin-bottom: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.label-sheet-block > * { margin: 0; }
.label-sheet-block h3 { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.label-sheet-step { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--strong); color: var(--strong-text); font-size: 11px; }
.label-sheet-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.label-sheet-row > span { flex: 0 0 auto; color: var(--muted); font-size: 12px; font-weight: 750; }
.chips.label-sheet-chips { flex-wrap: wrap; overflow: visible; }
/* Pied d'un bon de dépôt : trois boutons dans une petite fenêtre, ils passent à la ligne entiers. */
.modal-actions.wrap { flex-wrap: wrap; }
.modal-actions.wrap > .button { white-space: nowrap; }
.label-sheet-results { display: grid; gap: 4px; }
.label-sheet-results:empty { display: none; }
.label-sheet-result { display: grid; gap: 1px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-soft); color: var(--ink); text-align: left; cursor: pointer; }
.label-sheet-result small { color: var(--muted); font-size: 11px; }
.label-sheet-lines { display: grid; gap: 2px; max-height: 420px; overflow: auto; }
.label-sheet-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 8px 2px 2px; font-size: 12px; }
.label-sheet-head span { color: var(--muted); font-weight: 650; }
.label-sheet-line { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 7px 2px; border-bottom: 1px solid var(--line-soft); }
.label-sheet-line.off .label-sheet-line-text { opacity: .55; }
.label-sheet-tick { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 1.5px solid var(--muted-2); border-radius: 7px; background: var(--panel); color: var(--strong-text); cursor: pointer; }
.label-sheet-tick[aria-pressed="true"] { border-color: var(--strong); background: var(--strong); }
.label-sheet-tick .icon { width: 16px; height: 16px; }
.label-sheet-line-text { display: grid; gap: 2px; min-width: 0; }
.label-sheet-line-text strong { overflow-wrap: anywhere; font-size: 13px; }
.label-sheet-line-text small { display: flex; flex-wrap: wrap; gap: 2px 9px; color: var(--muted); font-size: 11px; }
.label-sheet-bad { padding: 0 6px; border-radius: 5px; background: var(--red); color: #fff; font-size: 10px; font-weight: 850; }
.label-sheet-stepper { display: flex; align-items: center; gap: 4px; }
.label-sheet-stepper button { width: 32px; height: 32px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); font-size: 17px; font-weight: 750; cursor: pointer; }
.label-sheet-stepper button:disabled { opacity: .4; cursor: default; }
.label-sheet-stepper b { min-width: 2.4em; text-align: center; font-variant-numeric: tabular-nums; }
.label-sheet-total { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.label-sheet-total span { color: var(--muted); font-size: 11px; }
.label-sheet-problems { padding: 10px 12px; border: 1px solid var(--red); border-radius: 10px; background: var(--red-soft); color: var(--red); font-size: 12px; }
.label-sheet-problems ul { margin: 6px 0 0; padding-left: 18px; }
.label-sheet-preview { display: grid; gap: 4px; margin: 0; }
.label-sheet-preview svg { display: block; width: min(100%, 420px); height: auto; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.label-sheet-preview figcaption { color: var(--muted); font-size: 11px; }
.label-sheet-format { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 650; }
.label-sheet-map { position: relative; width: min(100%, 260px); aspect-ratio: 210 / 297; border: 1px solid #c9c9c9; background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .08); }
.label-sheet-cell { position: absolute; box-sizing: border-box; display: grid; place-items: center; padding: 0; border: .5px solid #c4c4c4; background: #fff; color: #777; font-size: 9px; font-weight: 700; cursor: pointer; }
.label-sheet-cell.used { background: repeating-linear-gradient(45deg, #d6d6d6 0 3px, #fff 3px 6px); color: #999; }
.label-sheet-cell.now { background: #121212; color: #fff; }
.label-sheet-cell.unusable { background: repeating-linear-gradient(-45deg, #b9b9b9 0 2px, #ececec 2px 5px); color: #999; cursor: default; }
.label-sheet-cell.picked { font-size: 11px; }
.label-sheet-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--muted); font-size: 11px; }
.label-sheet-legend span { display: inline-flex; align-items: center; gap: 5px; }
.label-sheet-legend i { width: 14px; height: 9px; border: 1px solid #c4c4c4; background: #fff; }
.label-sheet-legend i.used { background: repeating-linear-gradient(45deg, #d6d6d6 0 2px, #fff 2px 4px); }
.label-sheet-legend i.now { background: #121212; border-color: #121212; }
.label-sheet-legend i.unusable { background: repeating-linear-gradient(-45deg, #b9b9b9 0 2px, #ececec 2px 4px); }
.label-sheet-why { margin: 0; color: var(--red); font-size: 12px; font-weight: 650; text-align: right; }
.label-sheet-confirm { display: grid; gap: 10px; }
.label-sheet-confirm > * { margin: 0; }
.label-sheet-unit { display: flex; align-items: center; gap: 6px; }
.label-sheet-unit input { flex: 1; min-width: 0; }
.label-sheet-unit small { color: var(--muted); font-size: 11px; }
.form-grid.label-sheet-measures { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.label-sheet-settings .label-sheet-block .field { margin-bottom: 0; }
.label-sheet-tips p { margin: 0; color: var(--muted); font-size: 12px; }
@media (max-width: 760px) {
  .label-sheet-grid { grid-template-columns: 1fr; }
  .label-sheet-map { width: 100%; }
  .form-grid.label-sheet-measures { grid-template-columns: 1fr 1fr; }
  .label-sheet-lines { max-height: none; }
  .label-sheet-tick { width: 40px; height: 40px; }
  .label-sheet-stepper button { width: 44px; height: 44px; }
  .label-sheet-why { text-align: left; }
}

/* Rapports de stock (4.94.0) : lignes resserrées, stock dormant sur toute la largeur. */
.stock-report .manager-row { min-height: 0; padding: 7px 2px; }
.stats-detail-grid > .span-all { grid-column: 1 / -1; }
.stock-report .data-table.dormant-table { min-width: 0; }
.stock-report .dormant-table th, .stock-report .dormant-table td { padding: 8px 12px; }
.stock-report .dormant-table td small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.stock-report .dormant-table td:not(:first-child), .stock-report .dormant-table th:not(:first-child) { text-align: right; white-space: nowrap; }
@media (max-width: 560px) { .stock-report .dormant-table th, .stock-report .dormant-table td { padding: 7px 6px; } .stock-report .dormant-table td:last-child, .stock-report .dormant-table th:last-child { white-space: normal; } }
/* Relevé détaillé (5.4.0) : les champs de la facture ne paraissent que pour « Facture » ; sans :has, ils restent visibles. */
@supports selector(:has(a)) {
  .account-statement-form .statement-invoice-fields { display: none; }
  .account-statement-form:has(input[name="document"][value="invoice"]:checked) .statement-invoice-fields { display: block; }
}
.statement-invoices { display: grid; gap: 6px; margin-top: 12px; }
.statement-invoices .button { justify-content: flex-start; text-align: left; }
/* Recettes (5.10.0) : une ligne par ingrédient, quantité et unité, coût de la ligne. */
.recipe-lines { display: grid; gap: 8px; }
.recipe-row { display: grid; grid-template-columns: minmax(0, 1fr) 150px 80px auto; gap: 8px; align-items: center; }
.recipe-row select { min-width: 0; }
.recipe-quantity { display: flex; align-items: center; gap: 6px; margin: 0; }
.recipe-quantity input { width: 100%; min-width: 0; }
.recipe-quantity span { min-width: 46px; color: var(--muted); font-size: .9em; }
.recipe-cost { text-align: right; font-variant-numeric: tabular-nums; }
.recipe-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.recipe-total { margin: 0; }
.recipe-panel { margin-top: 14px; }
.recipe-panel p { margin: 4px 0; }
@media (max-width: 640px) {
  .recipe-row { grid-template-columns: minmax(0, 1fr) 80px auto; }
  .recipe-row select { grid-column: 1 / -1; }
}
