/* Fabrique Bproof — noir, blanc, bleu (la palette de bproof.ch). */
:root {
  --fond: #f6f6f4;
  --carte: #ffffff;
  --encre: #0b0b0c;
  --doux: #5b5d63;
  --trait: #e3e3df;
  --bleu: #2f5bff;
  --bleu-fonce: #1e3fd1;
  --bleu-pale: #eaf0ff;
  --vert: #138a4a;
  --vert-pale: #e6f5ec;
  --orange: #b45309;
  --orange-pale: #fdf1e3;
  --rouge: #c02626;
  --rouge-pale: #fdeaea;
  --rayon: 14px;
  --ombre: 0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.04);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #0d0e10; --carte: #16181c; --encre: #f2f2f0; --doux: #a3a6ad; --trait: #2a2d33;
    --bleu: #5b80ff; --bleu-fonce: #8aa4ff; --bleu-pale: #1a2340;
    --vert: #4ccf86; --vert-pale: #12291d; --orange: #f0a35a; --orange-pale: #2e2112;
    --rouge: #f26d6d; --rouge-pale: #2e1616; --ombre: none; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--fond); color: var(--encre); }
body { font: 15px/1.55 "Hanken Grotesk", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
h1, h2, h3, .titre { font-family: Archivo, system-ui, sans-serif; letter-spacing: -.01em; line-height: 1.2; }
h1 { font-size: 28px; font-weight: 800; margin: 0 0 6px; }
h2 { font-size: 19px; font-weight: 700; margin: 28px 0 12px; }
h3 { font-size: 16px; font-weight: 700; margin: 0 0 8px; }
a { color: var(--bleu); }
.doux { color: var(--doux); }
.petit { font-size: 13px; }
code, .mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13px; }
.chargement { display: grid; place-items: center; height: 100vh; font-family: Archivo; font-weight: 700; color: var(--doux); }

/* ---- coquille -------------------------------------------------------- */
.barre { position: sticky; top: 0; z-index: 10; background: #0b0b0c; color: #fff; border-bottom: 1px solid rgba(255,255,255,.06); }
.barre-in { max-width: 1180px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; gap: 22px; height: 58px; }
.marque { display: flex; align-items: center; gap: 10px; font-family: Archivo; font-weight: 800; font-size: 17px; color: #fff; text-decoration: none; white-space: nowrap; }
.marque svg { width: 28px; height: 28px; }
.nav { display: flex; gap: 4px; overflow-x: auto; flex: 1; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { color: #c9cbd1; text-decoration: none; padding: 7px 12px; border-radius: 999px; font-weight: 600; font-size: 14px; white-space: nowrap; }
.nav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav a.actif { color: #fff; background: var(--bleu); }
.nav .pastille { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 6px; border-radius: 9px; background: #fff; color: var(--encre); font-size: 11px; text-align: center; line-height: 18px; }
.qui { font-size: 13px; color: #c9cbd1; white-space: nowrap; }
.qui a { color: #fff; margin-left: 10px; }
.page { max-width: 1180px; margin: 0 auto; padding: 28px 16px 80px; }
.entete { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }

/* ---- éléments -------------------------------------------------------- */
.carte { background: var(--carte); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 18px; box-shadow: var(--ombre); }
.grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--trait); background: var(--carte); color: var(--encre);
  padding: 9px 15px; border-radius: 10px; font: 600 14px "Hanken Grotesk", sans-serif; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--doux); }
.btn.principal { background: var(--bleu); border-color: var(--bleu); color: #fff; }
.btn.principal:hover { background: var(--bleu-fonce); border-color: var(--bleu-fonce); }
.btn.noir { background: var(--encre); color: var(--carte); border-color: var(--encre); }
.btn.danger { color: var(--rouge); }
.btn.mini { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.puce { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--fond); border: 1px solid var(--trait); color: var(--doux); }
.puce.ok { background: var(--vert-pale); color: var(--vert); border-color: transparent; }
.puce.att { background: var(--orange-pale); color: var(--orange); border-color: transparent; }
.puce.err { background: var(--rouge-pale); color: var(--rouge); border-color: transparent; }
.puce.bleu { background: var(--bleu-pale); color: var(--bleu); border-color: transparent; }
.point { width: 12px; height: 12px; border-radius: 50%; flex: none; }
label { display: block; font-weight: 600; font-size: 13px; margin: 0 0 5px; }
.champ { margin-bottom: 14px; }
input[type=text], input[type=password], input[type=date], input[type=number], input:not([type]), select, textarea {
  width: 100%; font: 16px/1.4 "Hanken Grotesk", sans-serif; color: var(--encre); background: var(--carte);
  border: 1px solid var(--trait); border-radius: 10px; padding: 9px 11px; }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--bleu); outline-offset: -1px; border-color: transparent; }
input[type=color] { width: 48px; height: 38px; padding: 2px; border: 1px solid var(--trait); border-radius: 10px; background: var(--carte); }
.cocher { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.compteur { float: right; font-weight: 500; color: var(--doux); }
.compteur.trop { color: var(--rouge); font-weight: 700; }
.deux { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.trois { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 760px) { .deux, .trois { grid-template-columns: 1fr; } .qui span { display: none; } }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--doux); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--trait); }
td { padding: 10px; border-bottom: 1px solid var(--trait); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
.vide { padding: 30px; text-align: center; color: var(--doux); }
.avert { background: var(--orange-pale); color: var(--orange); border-radius: 10px; padding: 10px 14px; font-weight: 500; margin: 0 0 14px; }
.info { background: var(--bleu-pale); color: var(--bleu-fonce); border-radius: 10px; padding: 10px 14px; margin: 0 0 14px; }
.erreur-bloc { background: var(--rouge-pale); color: var(--rouge); border-radius: 10px; padding: 10px 14px; margin: 0 0 14px; font-weight: 500; }

/* ---- cartes d'app ---------------------------------------------------- */
.app-tete { display: flex; align-items: center; gap: 10px; }
.app-tete h3 { margin: 0; font-size: 18px; }
.app-acc { margin: 4px 0 12px; color: var(--doux); font-size: 14px; }
.morceaux { display: flex; flex-direction: column; gap: 6px; margin: 0 0 14px; }
.morceau { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; padding: 7px 10px; background: var(--fond); border-radius: 9px; }
.morceau b { font-weight: 600; }

/* ---- tâches ------------------------------------------------------------ */
.tache { border-left: 4px solid var(--trait); }
.tache.encours, .tache.attente { border-left-color: var(--bleu); }
.tache.ok { border-left-color: var(--vert); }
.tache.erreur { border-left-color: var(--rouge); }
.tache.question { border-left-color: var(--orange); }
.journal { background: #0b0b0c; color: #d7d9de; border-radius: 10px; padding: 12px 14px; max-height: 320px; overflow: auto; white-space: pre-wrap; font: 12.5px/1.6 ui-monospace, Menlo, Consolas, monospace; margin: 10px 0 0; }
.barre-prog { height: 4px; background: var(--trait); border-radius: 2px; overflow: hidden; margin: 8px 0 0; }
.barre-prog i { display: block; height: 100%; width: 40%; background: var(--bleu); animation: glisse 1.4s ease-in-out infinite; }
@keyframes glisse { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
.question { background: var(--orange-pale); border-radius: 10px; padding: 12px 14px; margin: 10px 0 0; }
.question p { margin: 0 0 10px; color: var(--encre); }

/* ---- connexion --------------------------------------------------------- */
.porte { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--encre); }
.porte .carte { max-width: 420px; width: 100%; padding: 32px; }
.porte h1 { font-size: 26px; }
.porte .marque { color: var(--encre); margin-bottom: 18px; }
.ms { width: 100%; padding: 12px; font-size: 15px; }
.qr { display: grid; place-items: center; padding: 12px; background: #fff; border-radius: 12px; margin: 14px 0; }
.qr img, .qr svg { width: 190px; height: 190px; }
.code-totp { font-size: 26px !important; letter-spacing: .4em; text-align: center; font-family: ui-monospace, Menlo, monospace !important; }

/* ---- toasts ------------------------------------------------------------ */
#toasts { position: fixed; left: 16px; right: 16px; bottom: 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 50; pointer-events: none; }
.toast { background: var(--encre); color: var(--carte); padding: 10px 16px; border-radius: 10px; font-weight: 600; box-shadow: 0 6px 24px rgba(0,0,0,.25); max-width: 560px; pointer-events: auto; }
.toast.err { background: var(--rouge); color: #fff; }

/* ---- vitrine (aperçu) ---------------------------------------------------- */
.chiffres { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.chiffre { background: var(--carte); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 16px; }
.chiffre b { display: block; font: 800 30px Archivo, sans-serif; }
.chiffre span { color: var(--doux); font-size: 13px; }
.arbo { max-height: 340px; overflow: auto; border: 1px solid var(--trait); border-radius: 10px; }
.arbo button { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--trait); background: none; padding: 9px 12px; font: 500 14px "Hanken Grotesk"; color: var(--encre); cursor: pointer; }
.arbo button:hover { background: var(--bleu-pale); }

/* Fiches : ce que les magasins ont répondu (1.7.0) */
.petit.alerte { color: var(--rouge); }
.carte.alerte { background: var(--rouge-pale); color: var(--rouge); }

/* page Vitrine : le tableau des cartes de bproof.ch (13 oct. 2026) */
.vt { width: 100%; border-collapse: collapse; }
.vt th { text-align: left; font-size: 12px; color: var(--doux); font-weight: 600; padding: 6px 8px; }
.vt td { padding: 8px; border-top: 1px solid var(--trait); vertical-align: middle; }
.vt select { min-width: 150px; }
.vt tr.vt-cachee td:not(:nth-child(3)) { opacity: .45; }

/* ---- la feuille « Publier » (1.9.4) ------------------------------------ */
body.fige { overflow: hidden; }
.voile { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.55); display: flex; align-items: flex-end; justify-content: center; }
.feuille { background: var(--carte); color: var(--encre); width: 100%; max-width: 520px; max-height: 88vh; overflow-y: auto;
  border-radius: 20px 20px 0 0; padding: 10px 18px calc(18px + env(safe-area-inset-bottom)); box-sizing: border-box; }
.feuille h2 { font-family: Archivo; font-size: 20px; margin: 6px 0 4px; }
.feuille-poignee { width: 40px; height: 5px; border-radius: 3px; background: var(--trait); margin: 0 auto 8px; }
.feuille-choix { display: grid; gap: 8px; }
.feuille-btn { width: 100%; min-height: 52px; font-size: 16px; justify-content: space-between; box-sizing: border-box; }
.feuille-tout { justify-content: center; margin-top: 12px; }
.feuille-annuler { justify-content: center; margin-top: 10px; }
@media (min-width: 700px) {
  .voile { align-items: center; }
  .feuille { border-radius: 18px; padding: 18px 20px 20px; }
  .feuille-poignee { display: none; }
}
