:root {
  --bg: #fcf7f8;          /* rose très pâle, presque neutre */
  --carte: #ffffff;
  --texte: #2f2a2e;
  --doux: #7a6f75;
  --bord: #efe3e7;
  --accent: #b8466f;      /* rose framboise adouci */
  --accent-fonce: #9d3a5c;
  --accent-pale: #f8e3ea;
  --entete: #f5dbe5;
  --entete-texte: #5a2a3d;
  --neutre: #f3eeeb;      /* greige */
  --ok: #2e7d57; --ok-pale: #e5f3ec;
  --alerte: #a86a00; --alerte-pale: #fff0d6;
  --danger: #b83a4b; --danger-pale: #fde6e9;
}
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--texte); }
a { color: var(--accent); }
a:hover { color: var(--accent-fonce); }
main { max-width: 1100px; margin: 0 auto; padding: 16px; }
h1 { font-size: 1.55rem; margin: .2em 0 .6em; color: #4a2335; }
h2 { font-size: 1.15rem; margin: 1.2em 0 .5em; color: #4a2335; }
:focus-visible { outline: 3px solid #e9a8bf; outline-offset: 2px; }

/* Barre du haut */
.barre { background: var(--entete); color: var(--entete-texte); display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 10px 16px; border-bottom: 1px solid #ecc3d1; }
.barre .logo { font-size: 1.1rem; color: var(--entete-texte); }
.barre nav { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; }
.barre nav a { color: #7a3550; text-decoration: none; padding: 6px 10px; border-radius: 99px; }
.barre nav a.actif { background: #fff; color: var(--accent-fonce); font-weight: 600; box-shadow: 0 1px 3px rgba(120, 50, 80, .15); }
.barre nav a:hover { background: rgba(255,255,255,.65); }
.barre .qui { font-size: .9rem; color: #7a3550; }
.barre .qui a { color: var(--accent-fonce); }

/* Sélecteur de boutique */
.vue { display: inline-flex; background: rgba(255,255,255,.65); border-radius: 99px; padding: 3px; gap: 2px; }
.vue a { text-decoration: none; padding: 4px 12px; border-radius: 99px; color: #7a3550; font-size: .9rem; white-space: nowrap; }
.vue a.on { background: var(--accent); color: #fff; font-weight: 600; }
.vue a:not(.on):hover { background: #fff; }

.carte { background: var(--carte); border: 1px solid var(--bord); border-radius: 14px; padding: 16px; margin-bottom: 16px; }
.grille { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-bottom: 16px; }
.stat { background: var(--carte); border: 1px solid var(--bord); border-radius: 14px; padding: 14px; }
.stat b { display: block; font-size: 1.8rem; color: #4a2335; }
.stat span { color: var(--doux); font-size: .9rem; }

.msg { padding: 10px 14px; border-radius: 12px; margin-bottom: 12px; }
.msg.ok { background: var(--ok-pale); color: #1c4d35; }
.msg.err { background: var(--danger-pale); color: #6e1f2b; }

table { width: 100%; border-collapse: collapse; background: var(--carte); }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--bord); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--doux); background: #fbf3f5; }
tr.groupe td { background: var(--accent-pale); color: #6e2a46; font-weight: 600; border-bottom: 1px solid #efcbd8; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
.defile { overflow-x: auto; border: 1px solid var(--bord); border-radius: 14px; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: .8rem; font-weight: 600; }
.badge.ok { background: var(--ok-pale); color: var(--ok); }
.badge.commander { background: var(--alerte-pale); color: var(--alerte); }
.badge.urgent { background: var(--danger-pale); color: var(--danger); }

/* Pastilles de boutique */
.bq { display: inline-block; font-size: .72rem; padding: 1px 8px; border-radius: 99px; font-weight: 600; vertical-align: middle; white-space: nowrap; }
.bq.booklover { background: #fbdde8; color: #9a2f58; }
.bq.kenjia { background: #e7e0f7; color: #55419b; }
.bq.commun { background: #ece6e2; color: #6b5f5a; }

label { display: block; font-weight: 600; margin: 10px 0 4px; }
label small { font-weight: 400; color: var(--doux); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #e3d3d9; border-radius: 12px; font: inherit; background: #fff; color: var(--texte);
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
input[type=checkbox] { accent-color: var(--accent); }
.ligne { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.filtres { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 12px; }
.filtres > div { flex: 1 1 150px; }
.filtres label { margin-top: 0; }

button, .btn { display: inline-block; padding: 10px 16px; border: 0; border-radius: 12px; background: var(--accent); color: #fff; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
button:hover, .btn:hover { background: var(--accent-fonce); color: #fff; }
button.second, .btn.second { background: var(--accent-pale); color: #6e2a46; }
button.second:hover, .btn.second:hover { background: #f3d2de; color: #6e2a46; }
button.danger, .btn.danger { background: var(--danger); }
button.danger:hover, .btn.danger:hover { background: #9c2f3e; }
button.petit, .btn.petit { padding: 4px 10px; font-size: .85rem; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.doux { color: var(--doux); }
.centre { max-width: 420px; margin: 40px auto; }

/* Scanner */
.mode { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.mode button { padding: 18px 10px; font-size: 1.15rem; background: var(--neutre); color: #5c5257; }
.mode button.on.entree { background: var(--ok); color: #fff; }
.mode button.on.sortie { background: var(--danger); color: #fff; }
#code { font-size: 1.4rem; padding: 14px; }
.scan-ligne { display: grid; grid-template-columns: 1fr 110px; gap: 10px; }
#resultat { margin-top: 14px; padding: 16px; border-radius: 14px; font-size: 1.1rem; display: none; }
#resultat.ok { display: block; background: var(--ok-pale); }
#resultat.err { display: block; background: var(--danger-pale); }
#resultat.warn { display: block; background: var(--alerte-pale); }
#resultat .gros { font-size: 1.5rem; font-weight: 700; }
.sugg button { display: block; width: 100%; text-align: left; margin-top: 6px; background: #fff; color: var(--texte); border: 1px solid var(--bord); }
.sugg button:hover { background: var(--accent-pale); color: var(--texte); }
#video { width: 100%; max-height: 320px; border-radius: 14px; background: #000; display: none; margin-top: 10px; }

/* Photos */
.vignette { width: 48px; height: 48px; border-radius: 10px; border: 1px solid var(--bord); object-fit: cover; background: var(--neutre); vertical-align: middle; display: inline-block; }
img.vignette.zoom { cursor: zoom-in; }
.vignette.vide { text-align: center; line-height: 46px; font-size: 1.2rem; opacity: .35; cursor: default; }
.vignette.grande { width: 72px; height: 72px; }
#zoom-box { position: fixed; inset: 0; display: none; z-index: 1000; background: rgba(50, 25, 38, .8); align-items: center; justify-content: center; pointer-events: none; }
#zoom-box img { max-width: 94vw; max-height: 94vh; width: auto; height: auto; border-radius: 12px; box-shadow: 0 10px 50px rgba(0,0,0,.55); background: #fff; }
.produit-ligne { display: flex; gap: 12px; align-items: center; }

/* Étiquettes */
.etiquettes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6mm; }
.etiq { border: 1px dashed #bbb; padding: 3mm; text-align: center; font-size: 11px; break-inside: avoid; }
.etiq svg { max-width: 100%; height: 55px; }
.etiq .nom { font-weight: 700; }

@media print {
  .barre, .noprint, .msg { display: none !important; }
  body { background: #fff; }
  main { max-width: none; padding: 0; }
  .carte { border: 0; padding: 0; }
  .defile { border: 0; }
}
@media (max-width: 600px) {
  .barre nav { flex-basis: 100%; order: 3; }
  main { padding: 10px; }
  th, td { padding: 6px; font-size: .9rem; }
}
