:root { --p: #0e7490; --p2: #155e75; --pc: #e0f2f7; --fond: #f6f8fa; --carte: #fff; --t: #0f172a; --doux: #64748b; --bord: #e2e8f0; --vert: #059669; --rouge: #dc2626; --bleu: #2563eb; --ombre: 0 6px 20px rgba(15, 23, 42, .06); }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body { font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--fond); color: var(--t); padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.plein { fill: currentColor; stroke: none; }
h1 { font-size: 26px; letter-spacing: -.02em; margin: 4px 0 14px; }
h2 { font-size: 17px; margin: 24px 0 10px; display: flex; align-items: center; gap: 8px; }
h2 small, h3 small { color: var(--doux); font-weight: 600; font-size: 13px; }
h3 { margin: 0 0 10px; font-size: 16px; display: flex; justify-content: space-between; }

/* Barre du haut et navigation */
.barre { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top)); background: rgba(255,255,255,.92); backdrop-filter: blur(12px); border-bottom: 1px solid var(--bord); }
.marque { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 17px; margin-right: auto; min-width: 0; }
.marque img { width: 32px; height: 32px; }
.marque span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bouton-icone { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; color: var(--doux); }
.etat-sync { border: 0; background: none; display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--doux); padding: 6px 8px; border-radius: 999px; cursor: pointer; }
.etat-sync span { display: none; }
@media (min-width: 640px) { .etat-sync span { display: inline; } }
.etat-sync i { width: 9px; height: 9px; border-radius: 50%; background: #94a3b8; }
.etat-sync.ok i { background: var(--vert); } .etat-sync.cours i { background: #f59e0b; animation: clignote 1s infinite; } .etat-sync.hors i { background: var(--rouge); }
@keyframes clignote { 50% { opacity: .3; } }
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr); background: #fff; border-top: 1px solid var(--bord); padding-bottom: env(safe-area-inset-bottom); }
.nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 9px 0 8px; font-size: 11px; font-weight: 700; color: #94a3b8; }
.nav a.actif { color: var(--p); }
.nav a.plus svg { background: var(--p); color: #fff; border-radius: 14px; width: 44px; height: 32px; padding: 5px 11px; box-shadow: 0 6px 16px rgba(14,116,144,.35); }
@media (min-width: 900px) { body { padding-bottom: 0; padding-left: 96px; } .nav { top: 0; right: auto; width: 96px; grid-template-columns: 1fr; grid-auto-rows: 82px; align-content: start; padding-top: 70px; border-top: 0; border-right: 1px solid var(--bord); } .barre { margin-left: -96px; padding-left: 112px; } }
#vue { max-width: 980px; margin: 0 auto; }
#vue.entree { animation: entre .3s ease-out; }
@keyframes entre { from { opacity: 0; transform: translateY(8px); } }
.page { padding: 16px; }

/* Éléments */
.bouton { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 14px; padding: 12px 16px; font-weight: 800; background: var(--p); color: #fff; cursor: pointer; text-align: center; }
.bouton:active { transform: scale(.97); }
.bouton:disabled { opacity: .5; }
.bouton.grand { padding: 14px 18px; font-size: 16px; }
.bouton.petit { padding: 8px 12px; font-size: 14px; border-radius: 11px; }
.bouton.clair { background: #fff; color: var(--t); border: 1px solid var(--bord); }
.bouton.vert { background: var(--vert); } .bouton.bleu { background: var(--bleu); } .bouton.wa { background: #25d366; color: #053b1c; }
.lien, .lien-rouge { border: 0; background: none; color: var(--p); font-weight: 700; cursor: pointer; padding: 6px 4px; }
.lien-rouge { color: var(--rouge); }
.carte { background: var(--carte); border: 1px solid var(--bord); border-radius: 18px; padding: 16px; margin-top: 12px; box-shadow: var(--ombre); }
.carte.alerte { background: #fff7ed; border-color: #fed7aa; }
.champ { display: block; margin-top: 10px; }
.champ > span { display: block; font-size: 12.5px; font-weight: 700; color: var(--doux); margin-bottom: 5px; }
.champ input, .champ textarea, .champ select, .article input, .article select, .ligne-tarif input, .ligne-date input { width: 100%; border: 1.5px solid var(--bord); border-radius: 12px; padding: 11px 12px; background: #fff; outline: none; }
.champ input:focus, .champ textarea:focus, .article input:focus { border-color: var(--p); }
.deux { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }
@media (max-width: 480px) { .deux { grid-template-columns: 1fr; } }
.aide { color: var(--doux); font-size: 13px; }
.vide { color: var(--doux); text-align: center; padding: 18px 8px; margin: 0; }
.filtres { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.filtres button { border: 1.5px solid var(--bord); background: #fff; border-radius: 999px; padding: 8px 13px; font-weight: 700; font-size: 14px; cursor: pointer; }
.filtres button.on { background: var(--t); color: #fff; border-color: var(--t); }
.interrupteur-ligne { display: flex; align-items: center; gap: 10px; padding: 12px 0 2px; font-weight: 700; }
.interrupteur-ligne input { width: 22px; height: 22px; accent-color: var(--p); }
.boutons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; align-items: center; }
.toast { position: fixed; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--t); color: #fff; padding: 11px 16px; border-radius: 12px; z-index: 99; font-weight: 600; max-width: 92vw; animation: entre .25s; }

/* Accueil */
.bonjour { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.bonjour small { color: var(--doux); text-transform: capitalize; }
.bonjour h1 { margin: 0; }
.recherche-ticket, .champ-recherche { display: flex; align-items: center; gap: 10px; background: #fff; border: 1.5px solid var(--bord); border-radius: 16px; padding: 4px 14px; margin: 14px 0; color: var(--doux); }
.recherche-ticket input, .champ-recherche input { border: 0; outline: 0; flex: 1; padding: 11px 0; background: none; color: var(--t); font-size: 16px; }
.chiffres { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.chiffres div { background: #fff; border: 1px solid var(--bord); border-radius: 16px; padding: 14px; }
.chiffres b { display: block; font-size: 22px; letter-spacing: -.02em; }
.chiffres small { color: var(--doux); font-size: 13px; }
.chiffres .vert b { color: var(--vert); } .chiffres .rouge b { color: var(--rouge); }
.chiffres.petits b { font-size: 18px; }

/* Listes */
.liste { display: grid; gap: 8px; }
.ligne { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--bord); border-radius: 16px; padding: 12px 14px; }
.ligne:active { background: #f8fafc; }
.num { font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 800; color: var(--p2); background: var(--pc); border-radius: 9px; padding: 4px 8px; font-size: 14px; flex: none; }
.num.grand { font-size: 20px; padding: 6px 12px; }
.milieu { flex: 1; min-width: 0; display: grid; }
.milieu b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.milieu small, .droite small { color: var(--doux); font-size: 13px; }
.milieu em { color: #b45309; font-style: normal; font-weight: 700; }
.droite { display: grid; justify-items: end; gap: 3px; text-align: right; }
.du { color: var(--rouge) !important; font-weight: 700; }
.pastille { font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 999px; background: #f1f5f9; color: #475569; }
.pastille.vert { background: #d1fae5; color: #065f46; } .pastille.bleu { background: #dbeafe; color: #1e40af; } .pastille.rouge { background: #fee2e2; color: #991b1b; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--pc); color: var(--p2); font-weight: 800; flex: none; }
.avatar.grand { width: 64px; height: 64px; font-size: 26px; }

/* Dépôt */
.tarifs { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.tarifs button { border: 1.5px solid var(--bord); background: #fff; border-radius: 14px; padding: 10px 8px; cursor: pointer; display: grid; gap: 2px; text-align: center; transition: border-color .15s; }
.tarifs button:hover { border-color: var(--p); }
.tarifs b { font-size: 14px; } .tarifs small { color: var(--p); font-weight: 700; }
.tarifs .autre { border-style: dashed; }
#d-articles { margin-top: 12px; display: grid; gap: 8px; }
.article { border: 1px solid var(--bord); border-radius: 14px; padding: 10px; background: #fbfdfe; display: grid; gap: 8px; }
.article-haut { display: flex; justify-content: space-between; align-items: center; }
.article-bas { display: grid; grid-template-columns: 1fr 90px auto; gap: 8px; align-items: center; }
.article .st { font-weight: 800; min-width: 70px; text-align: right; }
.qte { display: flex; align-items: center; gap: 6px; }
.qte button { width: 34px; height: 34px; border-radius: 10px; border: 1.5px solid var(--bord); background: #fff; font-size: 18px; font-weight: 800; cursor: pointer; }
.qte output { min-width: 22px; text-align: center; font-weight: 800; }
.total-barre { position: sticky; bottom: calc(68px + env(safe-area-inset-bottom)); margin-top: 14px; background: var(--t); color: #fff; border-radius: 18px; padding: 12px 12px 12px 18px; display: flex; align-items: center; justify-content: space-between; gap: 10px; box-shadow: 0 12px 30px rgba(15,23,42,.3); }
@media (min-width: 900px) { .total-barre { bottom: 12px; } }
.total-barre b { display: block; font-size: 22px; } .total-barre small { opacity: .75; }

/* Commande */
.retour { color: var(--doux); font-weight: 700; display: inline-block; margin-bottom: 6px; }
.entete-cmd { display: grid; gap: 4px; }
.entete-cmd > div { display: flex; align-items: center; gap: 10px; }
.entete-cmd h1 { margin: 6px 0 0; }
.sous { color: var(--doux); }
.actions-cmd { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.ligne-art { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--bord); }
.ligne-art small { display: block; color: var(--doux); font-size: 13px; }
.ligne-art.total { font-weight: 800; font-size: 18px; border-bottom-style: solid; }
.ligne-art.du { color: var(--rouge); font-weight: 800; }
.note { background: #fefce8; border-radius: 10px; padding: 8px 10px; margin: 10px 0 0; }
.infos { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.infos small { display: block; color: var(--doux); font-size: 12.5px; }
.bas-cmd { display: flex; justify-content: space-between; margin-top: 16px; }
.ligne-tarif { display: grid; grid-template-columns: 1fr 100px auto; gap: 8px; margin-bottom: 6px; }
.ligne-date { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.ligne-date input { max-width: 200px; }

/* Boîtes de dialogue */
dialog.boite { border: 0; border-radius: 20px; padding: 20px; width: min(440px, 94vw); box-shadow: 0 30px 80px rgba(0,0,0,.3); }
dialog.boite::backdrop { background: rgba(15,23,42,.5); }
dialog.boite h2 { margin-top: 0; }
.choix-imp { display: grid; gap: 8px; }
.ok { color: var(--vert); font-weight: 700; }

/* ================= Impression ================= */
#impression { display: none; }
@media print {
  body.en-impression > *:not(#impression) { display: none !important; }
  body.en-impression { background: #fff; padding: 0; }
  body.en-impression #impression { display: block; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.papier-ticket { color: #000; font: 12px/1.35 ui-monospace, Menlo, Consolas, "Courier New", monospace; }
.papier-ticket.l58 { width: 58mm; } .papier-ticket.l80 { width: 80mm; }
.ticket { padding: 3mm 3mm 6mm; }
.t-centre { text-align: center; }
.t-nom { font-size: 16px; display: block; text-transform: uppercase; }
.t-num { font-size: 22px; font-weight: 800; letter-spacing: 1px; }
.t-trait { border-top: 1px dashed #000; margin: 6px 0; }
.t-ligne { display: flex; justify-content: space-between; gap: 6px; }
.t-art small { display: block; padding-left: 10px; color: #000; }
.t-total { font-size: 14px; }
.t-retire { font-weight: 800; border: 1px solid #000; padding: 3px; margin-top: 6px; }
.t-note { margin-top: 6px; }
.t-pied { font-size: 11px; }
.ticket .code-barres { width: 100%; height: 12mm; margin-top: 2px; }
.papier-etiquettes { color: #000; font: 10px/1.2 system-ui, Arial, sans-serif; }
.etiquette { width: var(--lw); height: var(--lh); padding: 1.5mm 2mm; overflow: hidden; page-break-after: always; break-after: page; display: flex; flex-direction: column; justify-content: space-between; }
.papier-etiquettes.rouleau .etiquette { height: auto; min-height: 30mm; border-bottom: 1px dashed #000; padding-bottom: 4mm; }
.e-haut { display: flex; justify-content: space-between; align-items: baseline; }
.e-num { font-size: 15px; font-family: ui-monospace, Menlo, Consolas, monospace; }
.e-k { font-weight: 800; font-size: 12px; }
.e-nom { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.e-art { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.etiquette .code-barres { width: 100%; height: 7mm; }
.e-bas { display: flex; justify-content: space-between; font-weight: 700; }
