/* =====================================================================
   Inventaire 7G — design 7G (refonte du 28/09/2026)
   Même langage que le logiciel 7G, Sentinelle et le Suivi : bleu 7G, Lexend,
   surfaces douces, coins arrondis. Les noms de classes sont ceux d'avant :
   la logique d'app.js n'a pas changé. L'ancien « Brutalist Pop » est dans la
   sauvegarde du 28/09.
   ===================================================================== */
@font-face { font-family: "Lexend"; src: url(/polices/lexend.woff2) format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Lexend Exa"; src: url(/polices/lexend-exa.woff2) format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --bleu: #0C3D63; --bleu-2: #15507F; --vert7g: #2CAA66;
  --bg: #EEF2F6; --surface: #FFFFFF; --surface2: #F4F7FA;
  --ink: #0E2233; --ink-soft: #43566A; --muted: #6B7D90;
  --line: #DDE4EC; --line-2: #C9D4DE;
  --pop: #0C3D63; --pop-ink: #FFFFFF; --pop-doux: #DCE8F2;
  --success: #1F8A55; --warn: #B8741A; --danger: #C23A3E; --info: #1C6892;
  --ok-doux: #DDF3E6; --warn-doux: #FBEBD3; --danger-doux: #FBE1E2; --info-doux: #DCEBFA;
  --shadow: 0 1px 0 rgba(12,61,99,.04), 0 10px 24px -16px rgba(12,61,99,.30);
  --shadow-sm: 0 1px 2px rgba(12,61,99,.08);
  --shadow-lg: 0 2px 6px rgba(12,61,99,.10), 0 30px 60px -28px rgba(12,61,99,.45);
  --radius: 12px; --radius-sm: 9px;
  /* anciens noms gardés : app.js en pose encore quelques-uns en ligne */
  --border: 1px solid var(--line);
  --font-title: "Lexend", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-body: "Lexend", "Segoe UI", system-ui, -apple-system, sans-serif;
  --f-large: "Lexend Exa", "Lexend", "Segoe UI", system-ui, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --haut-entete: 58px;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0A1724; --surface: #112233; --surface2: #0E1D2C;
  --ink: #E6EEF5; --ink-soft: #B6C4D2; --muted: #8FA2B4;
  --line: #1E3347; --line-2: #27405A;
  --pop: #1F5F93; --pop-ink: #FFFFFF; --pop-doux: #16304A;
  --success: #4CC486; --warn: #E3A450; --danger: #F07378; --info: #7DB8E8;
  --ok-doux: #123325; --warn-doux: #3A2A12; --danger-doux: #3B1A1D; --info-doux: #16304A;
  --shadow: 0 1px 0 rgba(0,0,0,.25), 0 12px 26px -16px rgba(0,0,0,.7);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
  --shadow-lg: 0 2px 6px rgba(0,0,0,.35), 0 30px 60px -28px rgba(0,0,0,.8);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { font-family: var(--font-body); background: var(--bg); color: var(--ink); min-height: 100dvh; overflow-x: hidden; -webkit-font-smoothing: antialiased; }
body { font-size: 14px; line-height: 1.45; padding-bottom: calc(84px + var(--safe-b)); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; background: transparent; border: 0; }
.hidden { display: none !important; }
::selection { background: var(--pop-doux); color: var(--ink); }
:focus-visible { outline: 2px solid #2E6DA4; outline-offset: 2px; }
#app, #login { position: relative; z-index: 1; }
svg.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }

/* Accent posé en fond par un style inline (app.js) : texte clair dessus. */
[style*="background:var(--pop)"], [style*="background:var(--pop)"] * { color: var(--pop-ink); }

/* ---------- typo ---------- */
h1, h2, h3, .t { font-family: var(--font-title); font-weight: 600; letter-spacing: -.01em; text-transform: none; }
.sec-title { font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
  margin: 1.5rem 0 .7rem; display: flex; align-items: center; gap: .6rem; }
.sec-title::before { content: ""; width: 4px; height: 14px; border-radius: 2px; background: var(--pop); flex: 0 0 auto; }
.sec-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.muted { color: var(--muted); }
.small { font-size: .8rem; }
.tnum { font-variant-numeric: tabular-nums; }

/* ---------- boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: .62rem 1.05rem; min-height: 40px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: var(--shadow-sm);
  font-weight: 500; font-size: .88rem; transition: background .15s, border-color .15s, transform .08s, box-shadow .15s; }
.btn:hover { border-color: var(--pop); background: var(--surface2); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn.primary { background: var(--pop); border-color: var(--pop); color: var(--pop-ink); }
.btn.primary:hover { background: var(--bleu-2); border-color: var(--bleu-2); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ok { background: var(--success); border-color: var(--success); color: #fff; }
.btn.sm { padding: .38rem .75rem; min-height: 32px; font-size: .8rem; border-radius: 8px; }
.btn.block { width: 100%; }
.btn.xl { padding: 1rem 1.2rem; min-height: 56px; font-size: 1rem; font-weight: 600; border-radius: 14px; box-shadow: var(--shadow); }

/* ---------- champs ---------- */
label.f { display: block; margin-bottom: .8rem; }
label.f > span { display: block; font-size: .78rem; font-weight: 500; color: var(--ink-soft); margin-bottom: .3rem; }
input, select, textarea { width: 100%; padding: .62rem .75rem; background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px;
  outline: none; font-size: 16px; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--pop); box-shadow: 0 0 0 3px var(--pop-doux); }
textarea { min-height: 76px; resize: vertical; }
.row { display: flex; gap: .6rem; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 130px; }

/* ---------- en-tête ---------- */
header.top { position: sticky; top: 0; z-index: 40; min-height: var(--haut-entete);
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line); padding: max(.55rem, env(safe-area-inset-top)) 1rem .55rem; display: flex; align-items: center; gap: .7rem; }
header.top .logo { width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  background: linear-gradient(145deg, #34B874, #1F8A55); color: #fff; box-shadow: 0 6px 14px -8px rgba(31,138,85,.8); }
header.top .logo svg { width: 20px; height: 20px; }
header.top .nom { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.15; }
header.top .nom small { font-size: .7rem; color: var(--muted); font-weight: 400; }
header.top h1 { font-size: 1rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
header.top .who { font-size: .75rem; font-weight: 500; color: var(--ink-soft); background: var(--surface2); border: 1px solid var(--line);
  padding: .25rem .6rem; border-radius: 999px; white-space: nowrap; }
.iconbtn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft);
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; transition: background .15s, color .15s; }
.iconbtn:hover { background: var(--surface2); color: var(--ink); }
.iconbtn svg { width: 18px; height: 18px; }

/* ---------- vues ---------- */
main { padding: 1rem 1rem 1.5rem; max-width: 960px; margin: 0 auto; }
.view { animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- cartes / stats ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem; margin-bottom: .9rem; }
.card.flat { box-shadow: none; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: .7rem; }
@media (min-width: 620px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: .8rem .9rem; position: relative; overflow: hidden; }
.stat .k { font-size: .74rem; color: var(--muted); font-weight: 500; }
.stat .v { font-family: var(--f-large); font-size: 1.7rem; font-weight: 500; line-height: 1.1; margin-top: .2rem; font-variant-numeric: tabular-nums; }
.stat .s { font-size: .72rem; color: var(--muted); margin-top: .15rem; }
.stat.alert .v { color: var(--danger); } .stat.warn .v { color: var(--warn); } .stat.ok .v { color: var(--success); }
.stat.alert { background: linear-gradient(0deg, var(--danger-doux), var(--surface) 70%); }
.stat.warn { background: linear-gradient(0deg, var(--warn-doux), var(--surface) 70%); }
.stat.clickable { cursor: pointer; transition: transform .15s, box-shadow .15s, border-color .15s; }
.stat.clickable:hover { transform: translateY(-1px); box-shadow: var(--shadow); border-color: var(--line-2); }

/* ---------- listes ---------- */
.list { display: flex; flex-direction: column; gap: .5rem; }
.item { display: flex; align-items: center; gap: .8rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: .65rem .8rem; transition: border-color .15s, box-shadow .15s, transform .15s; text-align: left; width: 100%; }
button.item:hover, .item[data-article]:hover, .item[data-a]:hover { border-color: var(--line-2); box-shadow: var(--shadow); transform: translateY(-1px); }
.item .tile { width: 42px; height: 42px; flex: 0 0 auto; border-radius: 11px; display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem; background: var(--pop-doux); color: var(--pop); }
.item .body { flex: 1; min-width: 0; }
.item .ttl { font-weight: 500; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .sub { font-size: .76rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .qty { font-weight: 600; font-size: 1.05rem; text-align: right; flex: 0 0 auto; min-width: 62px; font-variant-numeric: tabular-nums; }
.item .qty small { display: block; font-size: .66rem; color: var(--muted); font-weight: 400; }
.item.alert { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); background: linear-gradient(90deg, var(--danger-doux), var(--surface) 40%); }
.item.alert .qty { color: var(--danger); }

.badge { display: inline-flex; align-items: center; padding: .12rem .5rem; font-size: .7rem; font-weight: 500; border-radius: 999px;
  border: 0; background: var(--pop-doux); color: var(--pop); white-space: nowrap; }
[data-theme="dark"] .badge { color: #B9D8F2; }
.badge.ok { background: var(--ok-doux); color: var(--success); }
.badge.warn { background: var(--warn-doux); color: var(--warn); }
.badge.danger { background: var(--danger-doux); color: var(--danger); }
.badge.info { background: var(--info-doux); color: var(--info); }
.badge.ghost { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line-2); }

/* ---------- barre d'onglets (téléphone : en bas) ---------- */
nav.tabs { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(10px + var(--safe-b)); z-index: 50; width: min(560px, calc(100% - 20px));
  background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: saturate(1.5) blur(18px); -webkit-backdrop-filter: saturate(1.5) blur(18px);
  border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); display: flex; padding: .3rem; gap: .15rem; }
nav.tabs button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .15rem; padding: .42rem .1rem; font-size: .68rem; font-weight: 500;
  color: var(--muted); border-radius: 13px; position: relative; transition: background .15s, color .15s; }
nav.tabs button .ic { display: inline-flex; line-height: 1; }
nav.tabs button .ic svg { width: 21px; height: 21px; }
nav.tabs button:hover { color: var(--ink); }
nav.tabs button.on { color: var(--pop); background: var(--pop-doux); }
[data-theme="dark"] nav.tabs button.on { color: #CFE3F5; }
nav.tabs button .dot { position: absolute; top: 3px; right: calc(50% - 22px); min-width: 17px; height: 17px; border-radius: 999px; background: var(--danger); color: #fff;
  font-size: .62rem; font-weight: 600; display: flex; align-items: center; justify-content: center; padding: 0 4px; box-shadow: 0 0 0 2px var(--surface); }

/* Dans le logiciel 7G : le dock flotte en bas, les onglets passent sous l'en-tête. */
html.dans-logiciel body { padding-bottom: 100px; }
html.dans-logiciel #app:not(.hidden) { display: flex; flex-direction: column; }
html.dans-logiciel header.top { order: 0; }
html.dans-logiciel nav.tabs { order: 1; position: sticky; top: var(--haut-entete); left: auto; bottom: auto; transform: none; width: auto; z-index: 39;
  margin: 0; border-radius: 0; border-width: 0 0 1px; box-shadow: none; padding: .35rem 1rem; gap: .3rem; justify-content: flex-start; }
html.dans-logiciel nav.tabs button { flex: 0 0 auto; flex-direction: row; gap: .45rem; padding: .42rem .8rem; font-size: .85rem; border-radius: 9px; }
html.dans-logiciel nav.tabs button .ic svg { width: 18px; height: 18px; }
html.dans-logiciel nav.tabs button .dot { position: static; margin-left: .1rem; box-shadow: none; }
html.dans-logiciel main { order: 2; width: 100%; max-width: 1120px; padding-top: 1.2rem; }
html.dans-logiciel #btn-theme { display: none; }

/* ---------- scanner ---------- */
#scanwrap { position: relative; background: #000; border-radius: 18px; box-shadow: var(--shadow-lg); aspect-ratio: 1; max-height: 52vh; margin: 0 auto; overflow: hidden; }
#scanvideo { width: 100%; height: 100%; object-fit: cover; display: block; }
#scanwrap .frame { position: absolute; inset: 14%; border: 2px solid rgba(255,255,255,.9); border-radius: 16px; box-shadow: 0 0 0 9999px rgba(4,14,24,.5); }
#scanwrap .frame::before, #scanwrap .frame::after { content: ""; position: absolute; left: 8px; right: 8px; height: 2px; border-radius: 2px; background: #34B874; box-shadow: 0 0 12px #34B874; }
#scanwrap .frame::after { display: none; }
#scanwrap .frame::before { top: 6px; animation: scanline 2.2s ease-in-out infinite; }
@keyframes scanline { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(calc(52vh * .68)); } }
.scan-hint { text-align: center; font-size: .82rem; color: var(--muted); margin-top: .7rem; }

/* ---------- modale ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; }
@media (min-width: 620px) { .modal { align-items: center; } }
.modal .back { position: absolute; inset: 0; background: rgba(6,20,33,.45); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: fade .2s ease; }
.modal .panel { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 18px 18px 0 0; box-shadow: var(--shadow-lg);
  width: 100%; max-width: 540px; max-height: 88dvh; overflow-y: auto; padding: 1.2rem 1.2rem calc(1.2rem + var(--safe-b)); animation: pop .22s cubic-bezier(.2,.9,.3,1.1); }
@media (min-width: 620px) { .modal .panel { border-radius: 18px; padding-bottom: 1.2rem; } }
@keyframes pop { from { transform: translateY(18px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.modal h2 { font-size: 1.05rem; font-weight: 600; margin-bottom: 1rem; padding-right: 2.4rem; }
.modal .x { position: absolute; top: .8rem; right: .8rem; width: 32px; height: 32px; border-radius: 999px; background: var(--surface2); color: var(--ink-soft);
  border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-weight: 500; }
.modal .x:hover { color: var(--ink); background: var(--line); }

/* ---------- toast ---------- */
#toast { position: fixed; top: max(14px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%) translateY(-160%);
  background: var(--ink); color: var(--bg); border-radius: 12px; box-shadow: var(--shadow-lg);
  padding: .7rem 1.1rem; font-weight: 500; font-size: .88rem; z-index: 200; max-width: 92vw; text-align: center; transition: transform .3s cubic-bezier(.2,.9,.3,1.15); }
#toast.show { transform: translateX(-50%) translateY(0); }
#toast.ok { background: var(--success); color: #fff; }
#toast.err { background: var(--danger); color: #fff; }

/* ---------- connexion ---------- */
#login { position: fixed; inset: 0; z-index: 300; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; padding: 1.5rem;
  overflow-y: auto; background: radial-gradient(120% 85% at 50% 0%, #17568A 0%, #0C3D63 45%, #061A2B 100%); color: #EAF2F9; }
#login .logo { width: 64px; height: 64px; border-radius: 18px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, #34B874, #1F8A55); color: #fff; box-shadow: 0 18px 36px -14px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.3); }
#login .logo svg { width: 34px; height: 34px; }
#login h1 { color: #fff; font-weight: 600; }
#login .sous { color: rgba(234,242,249,.7); font-size: .82rem; margin-top: -.6rem; }
#login form { width: 100%; max-width: 380px; background: var(--surface); color: var(--ink); border-radius: 18px; box-shadow: 0 2px 6px rgba(0,0,0,.12), 0 40px 80px -30px rgba(0,0,0,.55); padding: 1.4rem; }
#login .pied { text-align: center; max-width: 340px; color: rgba(234,242,249,.62); font-size: .78rem; }
#login .err { color: var(--danger); font-weight: 500; font-size: .82rem; min-height: 1.1rem; text-align: center; margin-top: .6rem; }
.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-top: .6rem; }
.pinpad button { padding: .85rem; border-radius: 12px; border: 1px solid var(--line); background: var(--surface2); font-size: 1.25rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.pinpad button:hover { background: var(--line); }
.pinpad button:active { transform: scale(.96); }
.pinpad button[data-k="ok"] { background: var(--pop); border-color: var(--pop); color: var(--pop-ink); }
.pindots { display: flex; gap: .6rem; justify-content: center; margin: .8rem 0; }
.pindots i { width: 13px; height: 13px; border-radius: 999px; border: 1.5px solid var(--line-2); background: transparent; transition: background .15s, border-color .15s; }
.pindots i.on { background: var(--pop); border-color: var(--pop); }

/* ---------- tableau ---------- */
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .84rem; }
.tbl th { background: var(--surface2); color: var(--muted); text-align: left; padding: .55rem .6rem; font-size: .72rem; font-weight: 500; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: .55rem .6rem; border-bottom: 1px solid var(--line); }
.tbl tr:last-child td { border-bottom: 0; }
.scrollx { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }

/* ---------- vues du stock (Kanban / Cartes / Liste / Tableau) ---------- */
.vbar { display: flex; align-items: center; gap: .5rem; margin-bottom: .7rem; }
.vmodes { display: flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--surface2); border: 1px solid var(--line); flex: 0 0 auto; }
.vmodes button { padding: .32rem .6rem; font-size: .95rem; line-height: 1; border-radius: 7px; color: var(--muted); }
.vmodes button.on { background: var(--surface); color: var(--pop); box-shadow: var(--shadow-sm); }
[data-theme="dark"] .vmodes button.on { color: #CFE3F5; background: var(--pop-doux); }
#s-group { flex: 1; min-width: 0; padding: .4rem .55rem; font-size: .82rem; border-radius: 9px; }
#s-count { flex: 0 0 auto; margin-left: auto; font-weight: 500; white-space: nowrap; color: var(--muted); }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: .45rem; margin-bottom: .8rem; }
.kpi { border: 1px solid var(--line); border-radius: 11px; background: var(--surface); padding: .5rem .3rem; text-align: center; box-shadow: var(--shadow-sm); transition: border-color .15s, background .15s; }
.kpi:hover { border-color: var(--line-2); }
.kpi.on { background: var(--pop-doux); border-color: var(--pop); }
.kpi b { display: block; font-family: var(--f-large); font-weight: 500; font-size: 1.15rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.kpi span { font-size: .66rem; color: var(--muted); font-weight: 500; display: block; line-height: 1.2; }
.kpi.seuil b { color: var(--warn); } .kpi.rupt b { color: var(--danger); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .6rem; }
.cards .card, .cards > button { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); background: var(--surface); padding: .7rem; margin: 0; text-align: left;
  display: flex; flex-direction: column; gap: .3rem; min-height: 124px; transition: transform .15s, box-shadow .15s, border-color .15s; }
.cards .card:hover, .cards > button:hover { transform: translateY(-1px); box-shadow: var(--shadow); border-color: var(--line-2); }
.card .tile { width: 32px; height: 32px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: .95rem; background: var(--pop-doux); color: var(--pop); }
.card .ttl { font-weight: 500; font-size: .82rem; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .sub { font-size: .7rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .qty { font-family: var(--f-large); font-weight: 500; font-size: 1.2rem; margin-top: auto; font-variant-numeric: tabular-nums; }
.card .qty small { font-family: var(--font-body); font-size: .66rem; color: var(--muted); font-weight: 400; margin-left: .2rem; }
.card.alert { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); } .card.alert .qty { color: var(--danger); }

.kanban { display: flex; gap: .7rem; overflow-x: auto; padding-bottom: .5rem; -webkit-overflow-scrolling: touch; }
.kcol { flex: 0 0 220px; display: flex; flex-direction: column; gap: .4rem; background: var(--surface2); border: 1px solid var(--line); border-radius: var(--radius); padding: .45rem; }
.kh { padding: .3rem .4rem .45rem; font-size: .78rem; font-weight: 600; color: var(--ink-soft); display: flex; justify-content: space-between; align-items: center; gap: .4rem; }
.kh span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kh em { font-style: normal; flex: 0 0 auto; font-weight: 500; font-size: .7rem; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 0 .45rem; }
.kbody { display: flex; flex-direction: column; gap: .35rem; max-height: 56vh; overflow-y: auto; }
.kcard { border: 1px solid var(--line); border-radius: 9px; box-shadow: var(--shadow-sm); background: var(--surface); padding: .45rem .55rem; text-align: left; display: flex; gap: .45rem; align-items: center; transition: border-color .15s; }
.kcard:hover { border-color: var(--pop); }
.kcard .b { flex: 1; min-width: 0; }
.kcard .t2 { display: block; font-weight: 500; font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kcard .s2 { display: block; font-size: .66rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kcard .q2 { flex: 0 0 auto; font-weight: 600; font-size: .86rem; font-variant-numeric: tabular-nums; }
.kcard.alert .q2 { color: var(--danger); }

.tbl tr[data-article] { cursor: pointer; }
.tbl tr[data-article]:hover td { background: var(--pop-doux); }

/* ---------- divers ---------- */
.chips { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .3rem; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; padding: .34rem .8rem; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); font-size: .8rem; font-weight: 500; color: var(--ink-soft); transition: background .15s, border-color .15s; }
.chip:hover { border-color: var(--pop); }
.chip.on { background: var(--pop); border-color: var(--pop); color: var(--pop-ink); }
.empty { text-align: center; padding: 2.6rem 1rem; color: var(--muted); }
.empty .ic { font-size: 2.2rem; margin-bottom: .5rem; display: block; opacity: .8; }
.bar { height: 8px; background: var(--surface2); border-radius: 999px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.bar i { display: block; height: 100%; border-radius: 999px; background: var(--pop); }
.bar i.ok { background: var(--success); } .bar i.warn { background: var(--warn); } .bar i.danger { background: var(--danger); }
.qrbox { text-align: center; padding: .6rem; }
.qrbox img { width: 200px; height: 200px; border-radius: 12px; border: 1px solid var(--line); padding: 8px; background: #fff; image-rendering: pixelated; }
.split { display: flex; justify-content: space-between; align-items: center; gap: .6rem; }
.stepper { display: flex; align-items: center; gap: .5rem; }
.stepper button { width: 52px; height: 52px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface); font-size: 1.5rem; font-weight: 500; box-shadow: var(--shadow-sm); }
.stepper button:active { transform: scale(.95); }
.stepper input { text-align: center; font-family: var(--f-large); font-size: 1.6rem; font-weight: 500; height: 52px; }
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* Bandeau d'accueil (app.js le pose en style inline sur l'accent) */
.card[style*="background:var(--pop)"] { background: linear-gradient(135deg, #17568A, #0C3D63 60%, #0A3252) !important; border: 0 !important; box-shadow: var(--shadow-lg); }
.card[style*="background:var(--pop)"] .btn { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.25); color: #fff; box-shadow: none; }
.card[style*="background:var(--pop)"] .btn:hover { background: rgba(255,255,255,.22); }

/* Toast vide : entièrement caché (sinon un liseré dépasse en haut) */
#toast { visibility: hidden; transform: translateX(-50%) translateY(calc(-100% - 40px)); }
#toast.show { visibility: visible; }

/* Pastilles de catégorie : la couleur de la catégorie, adoucie */
.tile[style*="background"] { box-shadow: inset 0 0 0 100px rgba(255,255,255,.62); }
[data-theme="dark"] .tile[style*="background"] { box-shadow: inset 0 0 0 100px rgba(17,34,51,.55); }
.item .ttl, .item .sub { display: block; }

/* Bouton Face ID (posé par faceid-bouton.js) */
#btn-faceid { border: 1px solid var(--line-2) !important; border-radius: 10px !important; font-weight: 500 !important; color: var(--ink); background: var(--surface) !important; min-height: 40px; }
#btn-faceid:hover { border-color: var(--pop) !important; }

@media (max-width: 480px) { header.top .who { display: none; } }
