/* KF HACCP · palette hygiène : sarcelle (propreté), bleu glacier (froid), menthe (conforme) */
:root {
  --primary: #0B7A75; --primary-2: #13A89E; --primary-soft: #E3F5F2;
  --bg: #F3F8F8; --card: #FFFFFF; --ink: #0F2A2E; --muted: #5F7A7D; --line: #DCE9EA;
  --ok: #16A34A; --ok-soft: #E6F6EC; --warn: #D97706; --warn-soft: #FEF3C7; --bad: #DC2626; --bad-soft: #FEE2E2;
  --froid: #2563EB; --huile: #C8940A; --marinade: #E4572E; --etiquette: #0B7A75; --nettoyage: #10B981;
  --reception: #6366F1; --refroid: #0891B2; --nc: #DC2626; --photo: #8B5CF6; --rapport: #475569; --home: #0B7A75; --reglages: #64748B;
  --r: 8px; --shadow: 0 1px 2px rgba(15,42,46,.06), 0 4px 16px rgba(15,42,46,.05);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
body { min-height: 100vh; overscroll-behavior-y: contain; }
a { color: inherit; text-decoration: none; }
h1 { font-size: 1.65rem; margin: 0; line-height: 1.15; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; margin: 26px 0 12px; display: flex; gap: 8px; align-items: baseline; }
h3 { font-size: 1rem; margin: 0 0 10px; }
small { font-size: .82rem; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .center { text-align: center; } .cap::first-letter { text-transform: uppercase; }
[hidden] { display: none !important; }
.i { flex: none; }

/* couleurs de module */
.m-home { --c: var(--home); } .m-froid { --c: var(--froid); } .m-huile { --c: var(--huile); } .m-marinade { --c: var(--marinade); }
.m-etiquette { --c: var(--etiquette); } .m-nettoyage { --c: var(--nettoyage); } .m-reception { --c: var(--reception); }
.m-refroid { --c: var(--refroid); } .m-nc { --c: var(--nc); } .m-photo { --c: var(--photo); } .m-rapport { --c: var(--rapport); } .m-reglages { --c: var(--reglages); }
.hi { width: 44px; height: 44px; border-radius: 8px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 13%, white); color: var(--c); flex: none; }
.hi.sm { width: 36px; height: 36px; border-radius: 8px; }

/* ---------- en-tête */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: var(--card); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.brand img { width: 38px; height: 38px; border-radius: 8px; }
.brand-t { display: flex; flex-direction: column; min-width: 0; line-height: 1.1; }
.brand-t b { color: var(--primary); letter-spacing: .08em; font-size: .95rem; }
.brand-t small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.top-btn { position: relative; width: 44px; height: 44px; border-radius: 8px; border: 0; background: var(--bg); color: var(--muted); display: grid; place-items: center; }
.top-btn .dot { position: absolute; right: 8px; bottom: 9px; width: 9px; height: 9px; border-radius: 99px; background: #9BB2B4; border: 2px solid var(--bg); }
.sync-ok .dot { background: var(--ok); } .sync-syncing .dot { background: var(--primary-2); animation: pulse 1s infinite; }
.sync-offline .dot { background: var(--warn); } .sync-error .dot, .sync-revoked .dot { background: var(--bad); } .sync-demo .dot { background: var(--photo); }
.top-btn .badge { position: absolute; top: 4px; right: 4px; min-width: 18px; height: 18px; border-radius: 99px; background: var(--bad); color: #fff; font: 700 .7rem/18px system-ui; font-style: normal; text-align: center; padding: 0 4px; }
.me { display: flex; align-items: center; gap: 8px; border: 0; background: var(--bg); border-radius: 5px; padding: 4px 14px 4px 4px; font: inherit; font-weight: 700; color: var(--ink); min-height: 44px; }
body.gated .top-btn, body.gated .me, body.gated .modbar { display: none; }
@keyframes pulse { 50% { opacity: .35; } }

.avatar { width: var(--s); height: var(--s); border-radius: 99px; background: var(--c); color: #fff; display: inline-grid; place-items: center; font-weight: 800; font-size: calc(var(--s) * .38); flex: none; box-shadow: inset 0 -3px 0 rgba(0,0,0,.12); }

/* ---------- barre d'icônes des catégories */
.modbar { position: sticky; top: calc(65px + env(safe-area-inset-top)); z-index: 15; display: flex; gap: 4px; overflow-x: auto; padding: 10px 12px; background: var(--card); border-bottom: 1px solid var(--line); scrollbar-width: none; }
.modbar::-webkit-scrollbar { display: none; }
.mod { flex: none; display: flex; flex-direction: column; align-items: center; gap: 5px; width: 76px; padding: 4px 0; color: var(--muted); }
.mod .mi { width: 50px; height: 50px; border-radius: 8px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 11%, white); color: var(--c); transition: transform .15s, background .15s; }
.mod small { font-size: .74rem; font-weight: 700; white-space: nowrap; }
.mod.on .mi { background: var(--c); color: #fff; box-shadow: 0 6px 14px color-mix(in srgb, var(--c) 35%, transparent); }
.mod.on small { color: var(--c); }
.mod:active .mi { transform: scale(.94); }

.overdue { display: flex; align-items: center; gap: 12px; margin: 12px 16px 0; padding: 12px 16px; border-radius: 8px; background: var(--bad); color: #fff; font-weight: 600; }
.overdue span { flex: 1; }
main { max-width: 1240px; margin: 0 auto; padding: 18px 16px calc(40px + env(safe-area-inset-bottom)); }

/* ---------- boutons, champs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 20px; border-radius: 8px; border: 2px solid var(--primary); background: var(--primary); color: #fff; font: inherit; font-weight: 700; cursor: pointer; white-space: nowrap; }
.btn.ghost { background: var(--card); color: var(--primary); border-color: var(--line); }
.btn.small { min-height: 40px; padding: 0 14px; font-size: .9rem; border-radius: 8px; }
.btn.big { width: 100%; min-height: 60px; font-size: 1.1rem; margin-top: 10px; border-radius: 8px; }
.btn.wide { width: 100%; margin-top: 10px; }
.btn.danger { color: var(--bad); }
.btn.big.ghost.danger { border-color: #F5C2C2; }
.btn:disabled { opacity: .5; }
.btn:active { transform: scale(.98); }
.row { display: flex; gap: 12px; align-items: flex-end; }
.row > * { flex: 1; min-width: 0; }
.row.wrap { flex-wrap: wrap; } .row.wrap > * { flex: 1 1 180px; }
.row.wrap-s { flex-wrap: wrap; gap: 8px; } .row.wrap-s > * { flex: 0 0 auto; }
.grid2 { display: grid; gap: 10px; }
.head { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; flex-wrap: wrap; }
.head h1 { flex: 1; min-width: 160px; }
.back { color: var(--primary); display: grid; place-items: center; width: 44px; height: 44px; }
.card { background: var(--card); border-radius: var(--r); padding: 18px; margin-bottom: 14px; box-shadow: var(--shadow); }
.fld { display: flex; flex-direction: column; gap: 6px; margin: 0 0 14px; font-weight: 700; font-size: .9rem; min-width: 0; }
input, select, textarea { font: inherit; font-weight: 500; color: var(--ink); background: var(--bg); border: 2px solid transparent; border-radius: 8px; padding: 12px 14px; min-height: 52px; width: 100%; }
textarea { resize: vertical; margin: 6px 0; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary-2); background: #fff; }
input[type=checkbox] { width: 24px; height: 24px; min-height: 0; accent-color: var(--primary); flex: none; }
.chk { display: flex; align-items: center; gap: 10px; font-weight: 600; margin: 8px 0; }
.checks { display: grid; gap: 2px; margin-bottom: 12px; }
.checks label { display: flex; align-items: center; gap: 12px; min-height: 46px; font-weight: 600; }
.search { margin-bottom: 12px; background: var(--card); box-shadow: var(--shadow); }
details summary { color: var(--muted); font-weight: 600; margin-bottom: 10px; cursor: pointer; }

.seg { display: flex; gap: 6px; margin-bottom: 14px; background: var(--bg); padding: 5px; border-radius: 8px; }
.seg > * { flex: 1; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span, .seg > button { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 46px; padding: 6px 10px; border-radius: 8px; border: 0; background: transparent; font: inherit; font-weight: 700; font-size: .92rem; color: var(--muted); width: 100%; }
.seg input:checked + span, .seg > button.on { background: var(--card); color: var(--primary); box-shadow: var(--shadow); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 14px; scrollbar-width: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.chip { flex: none; border: 2px solid var(--line); background: var(--card); border-radius: 5px; padding: 9px 16px; font: inherit; font-weight: 700; font-size: .88rem; color: var(--ink); }
.chip.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.stepper { display: flex; }
.stepper button { width: 52px; border: 0; background: var(--primary-soft); font-size: 1.4rem; color: var(--primary); }
.stepper button:first-child { border-radius: 8px 8px 0 0 13px; } .stepper button:last-child { border-radius: 0 13px 13px 0; }
.stepper input { border-radius: 0; text-align: center; min-width: 0; }
.fld.qty { flex: 0 0 180px; }

.pill { display: inline-flex; align-items: center; padding: 4px 11px; border-radius: 5px; background: var(--primary-soft); color: var(--primary); font-weight: 800; font-size: .78rem; white-space: nowrap; }
.pill.bad { background: var(--bad); color: #fff; } .pill.warn { background: var(--warn-soft); color: #92400E; } .pill.ok { background: var(--ok-soft); color: #166534; } .pill.info { background: #E0ECFF; color: #1E40AF; }

/* ---------- accès (association, qui êtes-vous) */
.gate { min-height: calc(100vh - 90px); display: grid; place-items: center; padding: 20px 0; }
.gate-card { background: var(--card); border-radius: 8px; padding: 30px 26px; width: 100%; max-width: 440px; box-shadow: var(--shadow); }
.gate-card.wide { max-width: 760px; }
.gate-card h1 { margin: 6px 0 8px; }
.gate-logo { width: 64px; height: 64px; border-radius: 8px; display: block; margin: 0 auto 10px; }
.code-in { font-size: 1.8rem; letter-spacing: .5em; text-align: center; font-weight: 800; }
.who-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-top: 22px; }
.who { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 20px 10px; border-radius: 8px; border: 2px solid var(--line); background: var(--card); font: inherit; color: var(--ink); }
.who b { font-size: 1.05rem; } .who small { color: var(--muted); }
.who:active { border-color: var(--primary-2); background: var(--primary-soft); }
.pin { display: flex; flex-direction: column; align-items: center; text-align: center; }
.pin h2 { margin: 10px 0 0 !important; }
.dots { display: flex; gap: 14px; margin: 8px 0 18px; }
.dots i { width: 16px; height: 16px; border-radius: 99px; border: 2px solid var(--primary); }
.dots i.on { background: var(--primary); }
.dots.shake { animation: shake .4s; } .dots.shake i { border-color: var(--bad); }
@keyframes shake { 20%, 60% { transform: translateX(-10px); } 40%, 80% { transform: translateX(10px); } }
.pinsheet .keypad { width: 100%; max-width: 340px; }

/* ---------- accueil */
.hello { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 6px; }
.hello p { margin: 0 0 4px; font-weight: 600; }
.cols { display: grid; gap: 0 22px; align-items: start; }
.pgrid { display: grid; gap: 10px; }
.pcard { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); border: 2px solid transparent; }
.pcard .mi { width: 48px; height: 48px; border-radius: 8px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 12%, white); color: var(--c); flex: none; }
.pc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pc-body small { color: var(--muted); }
.bar { height: 7px; border-radius: 99px; background: var(--bg); overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; background: var(--c, var(--primary)); border-radius: 99px; transition: width .4s; }
.pc-n { font-size: 1.7rem; font-weight: 800; color: var(--c); }
.pc-n small { font-size: .9rem; color: var(--muted); }
.pc-n.ok { color: var(--ok); } .pc-n.bad { color: var(--bad); }
.pcard.is-bad { border-color: #F5C2C2; background: #FFF8F8; }
.timeline { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 6px 0; }
.tl { display: flex; align-items: center; gap: 12px; padding: 12px 16px; position: relative; }
.tl + .tl { border-top: 1px solid var(--line); }
.tl-t { font-weight: 800; font-variant-numeric: tabular-nums; width: 48px; }
.tl-dot { width: 24px; height: 24px; border-radius: 99px; border: 2px solid var(--line); display: grid; place-items: center; flex: none; }
.tl-l { flex: 1; font-weight: 600; }
.tl-s { font-size: .8rem; font-weight: 800; padding: 4px 10px; border-radius: 5px; background: var(--bg); color: var(--muted); }
.tl.done .tl-dot { background: var(--ok); border-color: var(--ok); color: #fff; } .tl.done .tl-s { background: var(--ok-soft); color: #166534; } .tl.done .tl-l { color: var(--muted); }
.tl.late .tl-dot { border-color: var(--bad); } .tl.late .tl-s { background: var(--bad); color: #fff; }

/* ---------- appareils (froid, huile) */
.dgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.dcard { display: flex; flex-direction: column; gap: 6px; text-align: left; background: var(--card); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); border: 0; border-top: 5px solid var(--k); font: inherit; color: var(--ink); }
.dcard.k-positif { --k: var(--froid); } .dcard.k-negatif { --k: #1E3A8A; } .dcard.k-chaud { --k: #EA580C; } .dcard.k-huile { --k: var(--huile); }
.dc-top { display: flex; justify-content: space-between; gap: 8px; font-size: .78rem; font-weight: 700; color: var(--muted); }
.dc-top .kind { color: var(--k); display: inline-flex; gap: 4px; align-items: center; }
.dc-top .kind.y { color: var(--ok); } .dc-top .kind.n { color: var(--warn); }
.dc-name { font-size: 1.1rem; }
.dc-val { font-size: 2.6rem; font-weight: 800; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.dc-val small { font-size: 1rem; color: var(--muted); margin-left: 3px; font-weight: 700; }
.dc-val.ok { color: var(--ok); } .dc-val.bad { color: var(--bad); } .dc-val.warn { color: var(--warn); }
.ph { color: #B5C7C9; }
.spark { width: 100%; height: 36px; margin-top: 4px; }
.spark .band { fill: color-mix(in srgb, var(--k) 10%, white); }
.spark polyline { fill: none; stroke: var(--k); stroke-width: 2.2; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.dc-moments { display: flex; gap: 8px; }
.dc-moments span { flex: 1; display: flex; align-items: center; justify-content: center; gap: 4px; padding: 6px; border-radius: 10px; background: var(--bg); font-size: .8rem; font-weight: 700; color: var(--muted); }
.dc-moments span.y { background: var(--ok-soft); color: #166534; }
.dcard:active { transform: scale(.985); }
.gauge { width: 100%; max-width: 190px; margin: 4px auto 0; display: block; }
.gauge path { fill: none; stroke-width: 11; stroke-linecap: butt; }
.gauge .z1 { stroke: #BFE8CF; } .gauge .z2 { stroke: #FCD98A; } .gauge .z3 { stroke: #F8B4B4; }
.gauge .needle { stroke: var(--ink); stroke-width: 3.5; stroke-linecap: round; } .gauge .hub { fill: var(--ink); }
.dcard .row { margin-top: 8px; }
.dcard .btn { padding: 0 10px; }

/* ---------- saisie (pavé numérique) */
.bigval { display: flex; align-items: baseline; justify-content: center; gap: 6px; padding: 14px; margin-bottom: 12px; border-radius: 8px; background: var(--bg); border: 3px solid transparent; transition: .15s; }
.bigval .v { font-size: 3.4rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.bigval .u { font-size: 1.3rem; font-weight: 700; color: var(--muted); }
.bigval.ok { background: var(--ok-soft); border-color: var(--ok); color: #166534; }
.bigval.warn { background: var(--warn-soft); border-color: var(--warn); color: #92400E; }
.bigval.bad { background: var(--bad-soft); border-color: var(--bad); color: #991B1B; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 auto 10px; max-width: 420px; }
.keypad button { min-height: 62px; border-radius: 8px; border: 0; background: var(--card); box-shadow: inset 0 0 0 2px var(--line); font: 700 1.5rem system-ui; color: var(--ink); display: grid; place-items: center; }
.keypad button:active { background: var(--primary-soft); }
.keypad .del { color: var(--muted); }
.keypad span { display: block; }
.ko { background: var(--bad-soft); border-radius: 8px; padding: 14px; margin: 6px 0; }
.warn-t { display: flex; gap: 8px; align-items: center; color: #991B1B; font-weight: 800; margin: 0 0 10px; }
.ko textarea { background: #fff; }
.mini-hist { display: flex; flex-wrap: wrap; gap: 6px; }
.mini-hist span { padding: 6px 10px; border-radius: 10px; background: var(--bg); font-size: .82rem; }
.mini-hist span.bad { background: var(--bad-soft); color: #991B1B; }

/* ---------- marinades */
.mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 12px; }
.mcard { display: flex; gap: 14px; background: var(--card); border-radius: var(--r); padding: 12px; box-shadow: var(--shadow); border-left: 5px solid var(--marinade); }
.mcard.bad { border-left-color: var(--bad); background: #FFF8F8; } .mcard.warn { border-left-color: var(--warn); } .mcard.ok { border-left-color: var(--ok); }
.mphoto { width: 112px; height: 112px; border-radius: 8px; object-fit: cover; flex: none; background: var(--bg); }
.mphoto.empty { display: grid; place-items: center; color: #B5C7C9; }
.mc-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.mc-body b { font-size: 1.05rem; } .mc-body small { color: var(--muted); }
.mc-body .pill { align-self: flex-start; }
.mc-body .row { margin-top: 8px; }
.hint { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 8px; background: color-mix(in srgb, var(--c) 9%, white); color: color-mix(in srgb, var(--c) 80%, black); font-weight: 600; margin-bottom: 6px; }
.hint span { flex: 1; }
.strip { margin-bottom: 6px; }
.thumbs { display: flex; gap: 8px; overflow-x: auto; margin-top: 6px; }
.thumb { width: 84px; height: 84px; border-radius: 8px; object-fit: cover; flex: none; background: var(--bg); cursor: zoom-in; }
.pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; margin-bottom: 14px; }
.pk { text-align: left; padding: 12px 14px; border-radius: 8px; border: 2px solid var(--line); background: var(--card); font: inherit; color: var(--ink); display: flex; flex-direction: column; gap: 3px; }
.pk small { color: var(--muted); }
.pk.on { border-color: var(--marinade); background: #FFF4F0; box-shadow: inset 0 0 0 1px var(--marinade); }
.photo-big { width: 100%; min-height: 140px; border-radius: 8px; border: 3px dashed color-mix(in srgb, var(--photo) 45%, white); background: color-mix(in srgb, var(--photo) 6%, white); color: var(--photo); font: inherit; font-weight: 800; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; margin: 4px 0 12px; overflow: hidden; position: relative; }
.photo-big.small { min-height: 92px; flex-direction: row; }
.photo-big.has { border-style: solid; border-color: var(--ok); padding: 0; min-height: 0; }
.photo-big.has img { width: 100%; max-height: 260px; object-fit: cover; display: block; }
.photo-big.has span { position: absolute; bottom: 10px; right: 10px; background: rgba(15,42,46,.75); color: #fff; padding: 6px 12px; border-radius: 5px; font-size: .85rem; }

/* ---------- photos */
.subjects { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.subj { display: flex; align-items: center; gap: 10px; padding: 16px; border-radius: 8px; border: 0; background: var(--card); box-shadow: var(--shadow); font: inherit; font-weight: 700; color: var(--ink); text-align: left; }
.subj .i { color: var(--photo); }
.subj:active { background: color-mix(in srgb, var(--photo) 8%, white); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.gallery figure { margin: 0; background: var(--card); border-radius: 8px; overflow: hidden; box-shadow: var(--shadow); }
.gph { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; cursor: zoom-in; background: var(--bg); }
.gallery figcaption { padding: 8px 10px; display: flex; flex-direction: column; }
.gallery figcaption small { color: var(--muted); }
img.full { width: 100%; border-radius: 8px; margin-top: 12px; display: block; }

/* ---------- étiquettes */
.prods { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.prod { text-align: left; background: var(--card); border: 0; box-shadow: var(--shadow); border-radius: 8px; padding: 14px; min-height: 104px; font: inherit; color: var(--ink); display: flex; flex-direction: column; gap: 4px; }
.prod .hi { margin-bottom: 6px; }
.prod small { color: var(--muted); }
.prod:active { box-shadow: inset 0 0 0 2px var(--primary-2); }
.preview { display: flex; flex-direction: column; align-items: center; gap: 8px; background: repeating-linear-gradient(45deg, #EAF1F1, #EAF1F1 10px, #F1F6F6 10px, #F1F6F6 20px); border-radius: 8px; padding: 16px; margin: 4px 0 8px; }
.preview canvas { max-width: 100%; max-height: 240px; background: #fff; border-radius: 6px; box-shadow: 0 3px 12px rgba(15,42,46,.18); }

/* ---------- listes */
.list { display: grid; gap: 8px; }
.item { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 8px; padding: 12px 14px; border: 2px solid transparent; text-align: left; font: inherit; color: var(--ink); width: 100%; box-shadow: var(--shadow); }
.item > div:not(.right) { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.item small { color: var(--muted); }
.item .right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.item.bad { border-color: #F5C2C2; background: #FFF8F8; }
.item.warn { border-color: #FAD99A; background: #FFFCF3; }
.item.sel { border-color: var(--primary-2); }
.item > .i:last-child { color: var(--muted); }
.item.hist b { font-weight: 600; }
.has-ph { color: var(--photo); }
.unsync { width: 9px; height: 9px; border-radius: 99px; background: var(--warn); flex: none; }
.task { min-height: 66px; }
.task .box { width: 32px; height: 32px; border-radius: 10px; border: 2.5px solid var(--nettoyage); display: grid; place-items: center; color: #fff; flex: none; }
.task.done { opacity: .75; box-shadow: none; }
.task.done .box { background: var(--nettoyage); }
.task.done b { text-decoration: line-through; color: var(--muted); }
.timer { display: flex; align-items: center; gap: 14px; border-left: 5px solid var(--refroid); }
.timer .tm-body { flex: 1; display: flex; flex-direction: column; --c: var(--refroid); }
.timer .tm-body small { color: var(--muted); }
.tm-n { font-size: 1.8rem; font-weight: 800; color: var(--refroid); }
.timer.bad { border-left-color: var(--bad); background: #FFF8F8; } .timer.bad .tm-n { color: var(--bad); } .timer.bad .tm-body { --c: var(--bad); }
.filters { flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters > * { flex: 1 1 160px; }
.steps { padding-left: 20px; color: var(--muted); } .steps li { margin: 4px 0; }
table.kv { width: 100%; border-collapse: collapse; background: var(--bg); border-radius: 8px; overflow: hidden; }
table.kv th, table.kv td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); font-size: .92rem; vertical-align: top; }
table.kv th { color: var(--muted); font-weight: 600; width: 40%; }

/* ---------- feuille modale */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; background: rgba(9, 30, 32, .45); display: flex; align-items: flex-end; justify-content: center; opacity: 0; transition: opacity .2s; }
.sheet-wrap.on { opacity: 1; }
.sheet { position: relative; background: var(--card); width: 100%; max-width: 620px; max-height: 94vh; overflow-y: auto; border-radius: 10px 10px 0 0; padding: 22px 18px calc(22px + env(safe-area-inset-bottom)); transform: translateY(40px); transition: transform .22s; }
.sheet.small { max-width: 460px; }
.sheet-wrap.on .sheet { transform: none; }
.sheet > h2 { margin: 0 48px 14px 0; font-size: 1.3rem; display: block; }
.sheet h3 { margin-top: 18px; }
.sheet-x { position: absolute; top: 14px; right: 14px; width: 44px; height: 44px; border-radius: 5px; border: 0; background: var(--bg); color: var(--muted); display: grid; place-items: center; z-index: 2; }
.sh-head { display: flex; align-items: center; gap: 12px; margin: 0 52px 16px 0; }
.sh-head h2 { margin: 0; font-size: 1.3rem; }
.sh-head small { color: var(--muted); }
.sh-head .hi { background: color-mix(in srgb, var(--c) 13%, white); }
.sheet .seg { background: var(--bg); }
.photo-sheet { background: #0B1D1F; max-width: 900px; }
.photo-sheet .sheet-x { background: rgba(255,255,255,.15); color: #fff; }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 14px 20px; border-radius: 8px; font-weight: 700; z-index: 99; opacity: 0; transition: .25s; max-width: calc(100% - 32px); text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,.2); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast.ok { background: var(--ok); } .toast.bad { background: var(--bad); }

/* ---------- tablette */
@media (min-width: 760px) {
  .pgrid { grid-template-columns: repeat(2, 1fr); }
  .grid2 { grid-template-columns: repeat(3, 1fr); }
  .sheet-wrap { align-items: center; }
  .sheet { border-radius: 8px; }
  .mod { width: 84px; }
}
@media (min-width: 1100px) {
  .cols { grid-template-columns: 1.35fr 1fr; }
  .modbar { justify-content: center; }
}
@media (max-width: 420px) {
  h1 { font-size: 1.4rem; }
  .me span { display: none; } .me { padding: 4px; }
  .mcard { flex-direction: column; } .mphoto { width: 100%; height: 170px; }
  .fld.qty { flex: 0 0 150px; }
}

/* ---------- simplicité : à faire, raccourcis */
.todos { display: grid; gap: 10px; }
.todo { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 16px; min-height: 78px; border-radius: var(--r); border: 0; background: var(--card); box-shadow: var(--shadow); font: inherit; color: var(--ink); border-left: 6px solid var(--c); }
.todo .mi { width: 52px; height: 52px; border-radius: 8px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 12%, white); color: var(--c); flex: none; }
.td-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.td-t b { font-size: 1.08rem; }
.td-t small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.td-go { width: 44px; height: 44px; border-radius: 5px; display: grid; place-items: center; background: var(--c); color: #fff; flex: none; }
.todo.urgent { background: #FFF6F6; border-left-color: var(--bad); }
.todo.urgent .td-t small { color: #B91C1C; font-weight: 600; }
.todo:active { transform: scale(.99); }
.alldone { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 28px; border-radius: var(--r); background: var(--ok-soft); color: #166534; text-align: center; }
.alldone b { font-size: 1.2rem; }
.quicks { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.quick { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 16px; min-height: 104px; border-radius: var(--r); border: 0; background: var(--card); box-shadow: var(--shadow); font: inherit; color: var(--ink); text-align: left; }
.quick .mi { width: 46px; height: 46px; border-radius: 8px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 12%, white); color: var(--c); }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.kpis a { background: var(--card); border-radius: 8px; padding: 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.kpis b { font-size: 1.6rem; color: var(--primary); } .kpis small { color: var(--muted); }
.kpis a.bad b { color: var(--bad); }

/* étiquette en 2 touches */
.preview.big canvas { max-height: 300px; width: 100%; height: auto; object-fit: contain; }
.printrow { display: flex; gap: 12px; align-items: stretch; margin-top: 4px; }
.printrow .stepper { flex: 0 0 170px; }
.printrow .stepper input { min-height: 64px; font-size: 1.4rem; font-weight: 800; }
.printrow .btn.big { margin: 0; min-height: 64px; flex: 1; font-size: 1.2rem; }
details.more { margin-top: 14px; background: var(--bg); border-radius: 8px; padding: 12px 14px; }
details.more summary { margin: 0; }
details.more[open] summary { margin-bottom: 12px; }
details.more input { background: #fff; }
.pk { position: relative; min-height: 86px; }
.pk-cam { position: absolute; right: 12px; bottom: 12px; color: var(--marinade); }

/* contrôle sanitaire */
.inspect { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px 18px; margin-bottom: 14px; }
.inspect > div { flex: 1; min-width: 200px; display: flex; flex-direction: column; }
.inspect small { color: var(--muted); }
.cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 10px; }
.ccard { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); }
.ccard .mi { width: 48px; height: 48px; border-radius: 8px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 12%, white); color: var(--c); flex: none; }
.ccard > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ccard small { color: var(--muted); }
.cst { display: inline-flex; align-items: center; gap: 4px; font-size: .8rem; font-weight: 800; padding: 6px 10px; border-radius: 5px; white-space: nowrap; }
.cst.ok { background: var(--ok-soft); color: #166534; } .cst.warn { background: var(--warn-soft); color: #92400E; } .cst.bad { background: var(--bad); color: #fff; }
.ctable { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.crow { display: grid; grid-template-columns: 56px 1fr auto 44px 48px; gap: 10px; align-items: center; width: 100%; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--line); background: none; font: inherit; color: var(--ink); text-align: left; }
.crow:last-child { border-bottom: 0; }
.crow.bad { background: #FFF6F6; }
.c-time { font-weight: 800; font-variant-numeric: tabular-nums; }
.c-desc { display: flex; flex-direction: column; min-width: 0; }
.c-desc small { color: #B91C1C; }
.c-who { color: var(--muted); font-size: .88rem; }
.c-st { color: var(--ok); font-weight: 800; text-align: center; } .crow.bad .c-st { color: var(--bad); }
.c-ph { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; }
@media (max-width: 560px) { .crow { grid-template-columns: 48px 1fr 36px; } .c-who, .c-ph { display: none; } .printrow .stepper { flex-basis: 130px; } }
.chip.on[data-fill] { background: var(--reception); border-color: var(--reception); }
a.chip { display: inline-block; }

/* ---------- assistant imprimante */
.pw-status { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 8px; background: var(--warn-soft); color: #92400E; font-weight: 600; margin-bottom: 12px; }
.pw-status.ok { background: var(--ok-soft); color: #166534; }
.pw-steps { display: flex; align-items: center; gap: 8px; margin-bottom: 20px; }
.pw-dot { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--muted); font-size: .9rem; white-space: nowrap; }
.pw-dot i { width: 30px; height: 30px; border-radius: 99px; display: grid; place-items: center; background: var(--bg); font-style: normal; font-weight: 800; }
.pw-dot.on { color: var(--primary); } .pw-dot.on i { background: var(--primary); color: #fff; }
.pw-dot.done { color: var(--ok); } .pw-dot.done i { background: var(--ok); color: #fff; }
.pw-line { flex: 1; height: 2px; background: var(--line); min-width: 12px; }
.pw-hero { width: 104px; height: 104px; border-radius: 8px; margin: 4px auto 8px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.steps.big { font-size: 1.02rem; color: var(--ink); } .steps.big li { margin: 8px 0; }
.pw-scan { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 8px; background: var(--primary-soft); color: var(--primary); font-weight: 600; margin-bottom: 10px; }
.spin { width: 20px; height: 20px; border-radius: 99px; border: 3px solid color-mix(in srgb, var(--primary) 25%, white); border-top-color: var(--primary); animation: rot .8s linear infinite; flex: none; }
@keyframes rot { to { transform: rotate(360deg); } }
.pw-dev.likely { border-color: var(--primary-2); }
.pw .list { margin-bottom: 12px; }
.pw-res { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.res { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 10px; border-radius: 8px; border: 2px solid var(--line); background: var(--card); font: inherit; color: var(--ink); text-align: center; }
.res small { color: var(--muted); }
.res.ok { border-color: var(--ok); background: var(--ok-soft); color: #166534; }
.res.bad { border-color: #F5C2C2; color: #991B1B; }
.big2 { grid-template-columns: 1fr 1fr !important; margin-bottom: 8px; }
.big2 .res { min-height: 120px; justify-content: center; font-size: 1.1rem; }
.tips { color: var(--muted); padding-left: 20px; margin: 0 0 14px; } .tips li { margin: 4px 0; }
details.card.more { padding: 16px 18px; }

/* ---------- ouverture de la journée */
.open-hero { display: flex; align-items: center; gap: 18px; padding: 22px; border-radius: 8px; background: linear-gradient(135deg, #0B7A75, #13A89E); color: #fff; margin-bottom: 12px; }
.oh-txt { flex: 1; min-width: 0; }
.oh-txt p { margin: 4px 0 0; opacity: .9; font-weight: 600; }
.oh-txt h1 { color: #fff; margin: 4px 0; }
.ring { --p: 0; width: 96px; height: 96px; border-radius: 99px; flex: none; display: grid; place-items: center; background: conic-gradient(#FFD23F calc(var(--p) * 1%), rgba(255,255,255,.22) 0); }
.ring b { width: 76px; height: 76px; border-radius: 99px; background: #0E8D86; display: grid; place-items: center; font-size: 1.6rem; }
.ring small { font-size: .85rem; opacity: .8; }
.btn.go { min-height: 68px; font-size: 1.15rem; justify-content: flex-start; padding: 0 22px; margin-bottom: 4px; }
h2 .push { margin-left: auto; }
.otasks { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 8px; }
.otask { display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 68px; border-radius: 8px; border: 2px solid transparent; background: var(--card); box-shadow: var(--shadow); font: inherit; color: var(--ink); text-align: left; }
.otask .ob { width: 38px; height: 38px; border-radius: 8px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 12%, white); color: var(--c); flex: none; }
.otask .ot { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.otask .ot small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.otask > .i { color: var(--c); }
.otask.done { box-shadow: none; background: #F7FBFA; }
.otask.done .ob { background: var(--ok); color: #fff; }
.otask.done b { color: var(--muted); }
.otask.ko { border-color: #F5C2C2; background: #FFF6F6; } .otask.ko .ob { background: var(--bad); }
.o-foot { margin-top: 22px; justify-content: center; }
.todo.urgent-soft { border-left-color: var(--primary); background: var(--primary-soft); }
@media (max-width: 480px) { .open-hero { padding: 18px; } .ring { width: 78px; height: 78px; } .ring b { width: 62px; height: 62px; font-size: 1.3rem; } .pw-dot { font-size: 0; gap: 0; } }


/* ---------- cartes de module (icône en dégradé), compteurs */
.g-froid { --g1: #3B82F6; --g2: #1D4ED8; } .g-huile { --g1: #F59E0B; --g2: #EA580C; } .g-marinade { --g1: #F87171; --g2: #DC2626; }
.g-etiquette { --g1: #14B8A6; --g2: #0B7A75; } .g-nettoyage { --g1: #34D399; --g2: #059669; } .g-refroid { --g1: #22D3EE; --g2: #0891B2; }
.g-regle { --g1: #64748B; --g2: #334155; } .g-photo { --g1: #A855F7; --g2: #6D28D9; } .g-reception { --g1: #818CF8; --g2: #4F46E5; }
.g-etab { --g1: #2DD4BF; --g2: #0D9488; } .g-nc { --g1: #FB7185; --g2: #E11D48; }
.hub { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 14px; }
.hcard { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 22px; min-height: 176px; color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--g1) 14%, white); border-radius: 8px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--g1) 9%, white) 0%, #fff 78%); transition: transform .15s, box-shadow .15s; }
.hcard:active { transform: scale(.985); }
@media (hover: hover) { .hcard:hover { transform: translateY(-2px); box-shadow: 0 10px 24px color-mix(in srgb, var(--g1) 18%, transparent); } }
.h-ico { width: 56px; height: 56px; border-radius: 10px; display: grid; place-items: center; color: #fff; margin-bottom: 12px;
  background: linear-gradient(135deg, var(--g1), var(--g2)); box-shadow: 0 6px 14px color-mix(in srgb, var(--g2) 32%, transparent); }
.h-arrow { position: absolute; top: 22px; right: 18px; color: #94A3B8; }
.hcard b { font-size: 1.15rem; }
.h-desc { color: var(--muted); line-height: 1.45; font-size: .95rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 14px; margin-top: 18px; }
.stat { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; background: #fff; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); }
.stat small { display: block; color: var(--muted); font-weight: 600; }
.stat b { font-size: 1.8rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat .s-ico { color: var(--g2); }
.stat.is-bad { border-color: #F5C2C2; } .stat.is-bad b { color: var(--bad); }

/* barre des modules : tuiles carrées, dégradé sur le module actif */
.mod .mi { border-radius: 10px; }
.modbar .mod.m-froid { --g1: #3B82F6; --g2: #1D4ED8; } .modbar .mod.m-huile { --g1: #F59E0B; --g2: #EA580C; } .modbar .mod.m-marinade { --g1: #F87171; --g2: #DC2626; }
.modbar .mod.m-etiquette { --g1: #14B8A6; --g2: #0B7A75; } .modbar .mod.m-nettoyage { --g1: #34D399; --g2: #059669; } .modbar .mod.m-refroid { --g1: #22D3EE; --g2: #0891B2; }
.modbar .mod.m-photo { --g1: #A855F7; --g2: #6D28D9; } .modbar .mod.m-reception { --g1: #818CF8; --g2: #4F46E5; } .modbar .mod.m-nc { --g1: #FB7185; --g2: #E11D48; }
.modbar .mod.m-rapport, .modbar .mod.m-reglages { --g1: #64748B; --g2: #334155; } .modbar .mod.m-home { --g1: #2DD4BF; --g2: #0D9488; }
.mod.on .mi { background: linear-gradient(135deg, var(--g1, var(--c)), var(--g2, var(--c))); box-shadow: 0 6px 14px color-mix(in srgb, var(--g2, var(--c)) 35%, transparent); }

/* cartes plus sobres : bordure fine plutôt qu'ombre forte */
.card, .item, .pcard, .todo, .dcard, .mcard, .prod, .subj, .quick, .ccard, .timeline, .ctable, .inspect, .otask { box-shadow: none; border: 1px solid var(--line); }
.todo { border-left: 4px solid var(--c); }
.todo.urgent { border-left-color: var(--bad); }
.dcard { border-top: 4px solid var(--k); }
.mcard { border-left: 4px solid var(--marinade); }
.item.bad, .item.warn { border-width: 1px; }

/* tablette : cibles tactiles et grilles adaptées portrait / paysage */
@media (min-width: 700px) and (max-width: 1099px) { .hub { grid-template-columns: repeat(3, 1fr); } .stats { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1100px) { .hub { grid-template-columns: repeat(4, 1fr); } .stats { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 699px) { .hub { grid-template-columns: repeat(2, 1fr); gap: 10px; } .hcard { padding: 16px; min-height: 150px; } .h-desc { font-size: .85rem; } .h-ico { width: 46px; height: 46px; } .stats { grid-template-columns: repeat(2, 1fr); } }

/* ---------- bascule FR | EN */
.lang { display: flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; flex: none; }
.lang button { border: 0; background: #fff; min-width: 44px; min-height: 40px; font: 800 .85rem system-ui; color: var(--muted); letter-spacing: .04em; }
.lang button.on { background: var(--primary); color: #fff; }
body.gated .lang { display: flex; }

/* ---------- contrôle : onglets et chronologie */
.vtabs { display: flex; gap: 0; border-bottom: 2px solid var(--line); margin: 0 0 14px; }
.vtabs a { display: flex; align-items: center; gap: 8px; padding: 12px 18px; font-weight: 800; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -2px; min-height: 48px; }
.vtabs a.on { color: var(--primary); border-bottom-color: var(--primary); }
.chip.ko-chip { display: inline-flex; align-items: center; gap: 6px; }
.chip.ko-chip.on { background: var(--bad); border-color: var(--bad); }
.ctable.chrono .crow { grid-template-columns: 56px 36px 1fr auto 44px 48px; }
.c-ic { width: 32px; height: 32px; border-radius: 6px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 12%, white); color: var(--c); }
.c-desc em { font-style: normal; font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
@media (max-width: 560px) { .ctable.chrono .crow { grid-template-columns: 48px 32px 1fr 36px; } }

/* ---------- tournée des températures (tâche obligatoire) */
.round { margin: -4px 0 16px; padding: 12px 14px; background: color-mix(in srgb, var(--froid) 7%, white); border: 1px solid color-mix(in srgb, var(--froid) 18%, white); border-radius: 8px; }
.round-t { display: flex; justify-content: space-between; align-items: baseline; color: #1E40AF; }
.round-t span { font-weight: 800; font-variant-numeric: tabular-nums; }
.round-bar { height: 6px; background: #fff; border-radius: 3px; overflow: hidden; margin: 8px 0; }
.round-bar i { display: block; height: 100%; background: linear-gradient(90deg, #3B82F6, #1D4ED8); transition: width .3s; }
.round-steps { display: flex; gap: 6px; flex-wrap: wrap; }
.round-steps span { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; font-size: .78rem; font-weight: 700; border-radius: 5px; background: #fff; color: var(--muted); border: 1px solid var(--line); }
.round-steps span.on { background: #1D4ED8; color: #fff; border-color: #1D4ED8; }
.round-steps span.done { background: var(--ok-soft); color: #166534; border-color: #BFE8CF; }
.seg > button:disabled { opacity: .45; display: flex; align-items: center; justify-content: center; gap: 6px; }
.lockmsg { margin: -6px 0 12px; }
.sheet-wrap.locked { background: rgba(9, 30, 32, .6); }

/* ---------- feuille de relevés des températures */
.head.sub { margin: 26px 0 10px; } .head.sub h2 { margin: 0; flex: 1; }
.tlog-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.tlog { border-collapse: collapse; width: 100%; min-width: 640px; font-variant-numeric: tabular-nums; }
.tlog th, .tlog td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; }
.tlog thead th { background: color-mix(in srgb, var(--froid) 6%, white); vertical-align: bottom; }
.tlog thead th b { display: block; font-size: .88rem; }
.tlog thead th small { display: block; color: var(--muted); font-weight: 500; }
.tlog .ms { display: flex; gap: 4px; justify-content: center; margin-top: 4px; }
.tlog .ms i { font-style: normal; font-size: .7rem; color: var(--muted); width: 52px; }
.tlog tbody th { text-align: left; font-weight: 700; position: sticky; left: 0; background: #fff; }
.tlog td { display: table-cell; }
.tlog tr:last-child th, .tlog tr:last-child td { border-bottom: 0; }
.tc { display: inline-block; width: 52px; margin: 0 2px; padding: 6px 0; border-radius: 5px; font: 700 .9rem system-ui; border: 0; }
.tc.ok { background: var(--ok-soft); color: #166534; } .tc.bad { background: var(--bad); color: #fff; }
.tc.none { color: #B5C7C9; background: var(--bg); }

/* ---------- ligne de réglage avec un choix (ex. verrouillage automatique) */
.item > select { width: auto; flex: none; min-width: 112px; max-width: 40%; }
.item > div { min-width: 0; }

/* ---------- données en attente d'envoi */
.top-btn .pend { position: absolute; top: 3px; left: 3px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--warn); color: #fff; font: 800 .66rem/18px system-ui; font-style: normal; text-align: center; }
.overdue.warnbar { background: var(--warn); }

/* ---------- huile : cartes, états, historique */
.legend { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.lg { display: inline-flex; align-items: center; gap: 8px; font-size: .85rem; font-weight: 600; color: var(--muted); }
.lg::before { content: ''; width: 12px; height: 12px; border-radius: 3px; background: currentColor; }
.lg.ok::before { background: var(--ok); } .lg.warn::before { background: var(--warn); } .lg.bad::before { background: var(--bad); }
.state { display: inline-block; padding: 4px 10px; border-radius: 5px; font-size: .8rem; font-weight: 800; background: var(--bg); color: var(--muted); }
.state.ok { background: var(--ok-soft); color: #166534; } .state.warn { background: var(--warn-soft); color: #92400E; } .state.bad { background: var(--bad); color: #fff; }
.oilcard .dc-top { align-items: center; }
.oilcard .dc-top .dc-name { font-size: 1.15rem; color: var(--ink); }
.oilcard.bad { border-color: #F5C2C2; background: #FFF8F8; }
.oil-main { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 4px 0; }
.oil-main .gauge { max-width: 150px; margin: 0; }
.oil-main .dc-val { font-size: 2.4rem; }
.oil-facts { margin: 0 0 6px; display: grid; gap: 4px; }
.oil-facts div { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); font-size: .88rem; }
.oil-facts dt { color: var(--muted); } .oil-facts dd { margin: 0; font-weight: 700; text-align: right; }
.oil-facts dd.y { color: var(--ok); } .oil-facts dd.n { color: var(--warn); }
.state-line { text-align: center; margin: -4px 0 10px; min-height: 26px; }
.tlog.oil .tc { width: auto; padding: 6px 8px; }
.tlog .tc.warn { background: var(--warn-soft); color: #92400E; }
.tlog .tag { display: inline-block; font-style: normal; font-size: .7rem; font-weight: 800; padding: 3px 6px; margin: 2px; border-radius: 4px; }
.tag.ch { background: #FEF3C7; color: #92400E; } .tag.fi { background: #E0ECFF; color: #1E40AF; } .tag.nu { background: var(--bg); color: var(--muted); }
.open-hero.soir { background: linear-gradient(135deg, #334155, #0F172A); }
.open-hero.soir .ring b { background: #1E293B; }
.otask:disabled { opacity: .6; }
.flow-note { margin-top: 22px; display: flex; gap: 6px; justify-content: center; align-items: center; }

/* ---------- V2 : nouveaux modules */
.m-tracabilite { --c: #4F46E5; } .m-allergenes { --c: #C2410C; } .m-entretien { --c: #475569; } .m-audit { --c: #0D9488; } .m-documents { --c: #334155; } .m-formations { --c: #1D4ED8; }
.modbar .mod.m-tracabilite { --g1: #818CF8; --g2: #4F46E5; } .modbar .mod.m-allergenes { --g1: #FB923C; --g2: #C2410C; } .modbar .mod.m-entretien, .modbar .mod.m-documents { --g1: #64748B; --g2: #334155; }
.modbar .mod.m-audit { --g1: #2DD4BF; --g2: #0D9488; } .modbar .mod.m-formations { --g1: #60A5FA; --g2: #1D4ED8; }
.mono { font-family: ui-monospace, Menlo, monospace; word-break: break-all; }
.searchbar { display: flex; gap: 10px; margin-bottom: 12px; }
.searchbar input { flex: 1; font-size: 1.1rem; }
.searchbar .btn { flex: none; }
.trace-chain { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 16px 0 4px; color: var(--muted); font-weight: 700; font-size: .88rem; }
.trace-chain span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.trace-chain i { width: 24px; height: 2px; background: var(--line); }
.empty { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 32px 16px; border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); margin-top: 14px; }
.empty b { color: var(--ink); }
.tlog.allerg { min-width: 760px; }
.tlog.allerg thead th.rot { height: 118px; vertical-align: bottom; padding: 6px 2px; }
.tlog.allerg thead th.rot span { display: inline-block; writing-mode: vertical-rl; transform: rotate(180deg); font-size: .78rem; white-space: nowrap; }
.tlog.allerg tbody th small { display: block; color: var(--muted); font-weight: 500; font-size: .75rem; }
.al-y { color: var(--allergenes, #C2410C); font-size: 1.1rem; }
.al-n { color: #C9D6D7; }
.dcard.k-maint { --k: #475569; text-align: left; }
.dcard.k-maint.bad { border-color: #F5C2C2; background: #FFF8F8; } .dcard.k-maint.warn { --k: var(--warn); }
.dcard.k-maint .btn { align-self: flex-start; margin-top: 4px; }
.stat b.sm { font-size: 1.2rem; }
.audit-score { position: sticky; top: -20px; z-index: 2; display: flex; align-items: baseline; gap: 12px; padding: 12px 14px; margin: 0 0 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
.audit-score b { font-size: 1.8rem; font-variant-numeric: tabular-nums; }
.audit-score.ok { background: var(--ok-soft); color: #166534; } .audit-score.warn { background: var(--warn-soft); color: #92400E; } .audit-score.bad { background: var(--bad-soft); color: #991B1B; }
.audit-items { display: grid; gap: 6px; margin-bottom: 8px; }
.ai { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.ai.ko { border-color: #F5C2C2; background: #FFF8F8; }
.ai textarea { grid-column: 1 / -1; margin: 0; min-height: 44px; }
.tri { display: flex; gap: 4px; }
.tri button { min-width: 48px; min-height: 44px; border: 1px solid var(--line); border-radius: 6px; background: #fff; font: 700 .8rem system-ui; color: var(--muted); display: grid; place-items: center; }
.tri button[data-v="1"].on { background: var(--ok); border-color: var(--ok); color: #fff; }
.tri button[data-v="0"].on { background: var(--bad); border-color: var(--bad); color: #fff; }
.tri button[data-v="na"].on { background: var(--muted); border-color: var(--muted); color: #fff; }
.train .slide { padding: 22px 4px 14px; }
.train .slide h3 { font-size: 1.3rem; margin-bottom: 10px; }
.train .slide p { font-size: 1.1rem; line-height: 1.55; margin: 0; }
.tdots { display: flex; gap: 6px; }
.tdots i { flex: 1; height: 5px; border-radius: 3px; background: var(--line); }
.tdots i.done { background: var(--ok); } .tdots i.on { background: var(--primary); }
.quiz { display: grid; gap: 8px; margin-bottom: 8px; }
.quiz .res { align-items: flex-start; text-align: left; padding: 16px; }
.quiz .res.ok { border-color: var(--ok); background: var(--ok-soft); color: #166534; }
.quiz .res.bad { border-color: var(--bad); background: var(--bad-soft); color: #991B1B; }
.hcard .state { align-self: flex-start; margin-top: 8px; }
button.hcard { font: inherit; text-align: left; cursor: pointer; }

/* ---------- lecture IA des étiquettes */
.ai-box { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; margin: -4px 0 14px; border-radius: 8px; border: 1px solid var(--line); font-weight: 600; font-size: .92rem; }
.ai-box > div { display: flex; flex-direction: column; gap: 3px; }
.ai-box small { font-weight: 500; color: inherit; opacity: .85; }
.ai-box.busy { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.ai-box.ok { background: #EDE9FE; color: #5B21B6; border-color: #DDD6FE; }
.ai-box.warn { background: var(--warn-soft); color: #92400E; border-color: #FAD99A; }
.ai-box.muted { background: var(--bg); color: var(--muted); }
input.ai-filled, select.ai-filled { border-color: #A78BFA; background: #F5F3FF; box-shadow: inset 3px 0 0 #7C3AED; }

/* ---------- tournée : bouton Interrompre */
.sheet-stop { position: absolute; top: 12px; right: 12px; z-index: 3; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--muted); font: 700 .85rem system-ui; }
.sheet-stop:active { background: var(--bg); }
.sheet.locked .round { margin-top: 36px; }

/* ---------- V3 : cuisson, stock, rappels, données personnelles */
.m-cuisson { --c: #EA580C; } .m-stock { --c: #4F46E5; }
.modbar .mod.m-cuisson { --g1: #FB923C; --g2: #EA580C; } .modbar .mod.m-stock { --g1: #818CF8; --g2: #4F46E5; }
.quicks.two { grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); margin-bottom: 14px; }
.quick small { font-weight: 500; }
.stock-list { display: grid; gap: 8px; }
.stock-row { display: grid; grid-template-columns: 1fr auto auto; gap: 14px; align-items: center; width: 100%; padding: 12px 16px; min-height: 66px; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 8px; font: inherit; color: var(--ink); }
.stock-row > div { display: flex; flex-direction: column; min-width: 0; }
.stock-row small { color: var(--muted); }
.st-q { font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.st-q small { font-size: .85rem; font-weight: 600; }
.stock-row.bad { border-color: #F5C2C2; background: #FFF8F8; } .stock-row.bad .st-q { color: var(--bad); }
.stock-row.warn { border-color: #FAD99A; } .stock-row.warn .st-q { color: var(--warn); }
.stock-row:active { background: var(--bg); }
.notice { background: var(--bg); border-radius: 8px; padding: 14px 16px; margin-bottom: 8px; max-height: 50vh; overflow-y: auto; line-height: 1.55; }
.notice p { margin: 0 0 10px; } .notice p:last-child { margin: 0; }
@media (max-width: 480px) { .stock-row { grid-template-columns: 1fr auto; } .stock-row .state { grid-column: 1 / -1; justify-self: start; } }

/* ---------- réglages imprimante */
.pset { display: grid; gap: 14px; }
.pset-h { display: flex; align-items: center; gap: 16px; }
.pset-h > div { display: flex; flex-direction: column; }
.pset-h b { font-size: 1.2rem; }
.bt { width: 60px; height: 60px; border-radius: 10px; display: grid; place-items: center; color: #fff; background: #94A3B8; flex: none; }
.bt.ok { background: linear-gradient(135deg, #34D399, #059669); } .bt.warn { background: linear-gradient(135deg, #FBBF24, #D97706); }
.pset-t { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.pset-t h2 { margin: 0; }
.sizes { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.size { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 8px; min-height: 132px; border: 2px solid var(--line); border-radius: 8px; background: #fff; font: inherit; color: var(--ink); text-align: center; }
.size small { color: var(--muted); font-size: .75rem; }
.size-draw { height: 70px; display: grid; place-items: center; color: var(--muted); }
.size-draw i { display: block; border: 2px solid #94A3B8; border-radius: 3px; background: repeating-linear-gradient(0deg, #fff, #fff 6px, #F1F5F9 6px, #F1F5F9 7px); }
.size.on { border-color: var(--primary); background: var(--primary-soft); }
.size.on .size-draw i { border-color: var(--primary); }
.custom { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.custom .fld { margin: 0; flex: 1 1 120px; }
.gap-row { align-items: flex-end; }
.gap-row .fld { max-width: 260px; margin: 0; }
.pset input[type=range] { padding: 0; min-height: 36px; accent-color: var(--primary); background: none; }

/* Relevés (froid, huile) : tout visible sans défiler. Paysage : valeur + actions à gauche, pavé à droite */
.t-grid { display: grid; grid-template-columns: 1fr; gap: 0; }
.t-grid .keypad { width: 100%; }
.t-act .btn.big { margin-top: 2px; }
.t-act .btn.ghost { margin-top: 8px; }
.tsheet .mini-hist, .tsheet h3 { display: none; }
@media (min-width: 820px) and (orientation: landscape), (min-width: 820px) and (max-height: 900px) {
  .sheet.tsheet { max-width: 900px; }
  .t-grid { grid-template-columns: 1fr minmax(300px, 380px); grid-template-areas: "val kp" "act kp"; column-gap: 24px; align-items: start; }
  .t-val { grid-area: val; }
  .t-grid .keypad { grid-area: kp; margin: 0; max-width: none; }
  .t-act { grid-area: act; }
  .t-val .bigval { margin-bottom: 10px; }
  .t-val .ko textarea { min-height: 0; }
}
@media (max-height: 820px) {
  .sheet.tsheet { padding-top: 16px; max-height: 98vh; }
  .tsheet .round { margin-bottom: 10px; padding: 8px 12px; }
  .tsheet .round-bar { margin: 6px 0; }
  .tsheet .sh-head { margin-bottom: 10px; }
  .tsheet .bigval { padding: 10px; }
  .tsheet .bigval .v { font-size: 2.8rem; }
  .tsheet .keypad button { min-height: 54px; }
  .tsheet .seg { margin-bottom: 10px; }
}

/* Menu sans défilement : ce qui ne tient pas passe dans « Tout » */
.modbar { overflow: hidden; justify-content: center; }
.modbar .mod.m-more { --g1: #64748B; --g2: #334155; --c: #475569; }

/* Accueil : flux du moment en tête, liste à gauche, résumé du jour à droite (paysage) */
.hello { align-items: center; }
.pstat { display: inline-flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font-size: .92rem; }
.pstat.p-ok { border-color: #BFE8CF; background: var(--ok-soft); color: #166534; }
.pstat.p-todo { border-color: color-mix(in srgb, var(--warn) 40%, white); background: var(--warn-soft); color: #92400E; }
.home-grid { display: grid; gap: 0 24px; align-items: start; }
.home-main > h2:first-child { margin-top: 8px; }
.home-side .stats { margin-top: 18px; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.home-side .stat { padding: 14px; min-height: 0; }
.home-side .stat b { font-size: 1.6rem; }
.home-side .s-ico { width: 44px; height: 44px; }
@media (min-width: 900px) {
  .home-grid { grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr); }
  .home-side .stats { margin-top: 8px; }
}
@media (min-width: 900px) and (max-width: 1099px) { .home-side .stats { grid-template-columns: 1fr 1fr; } }
@media (max-width: 899px) { .home-side .stats { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 560px) { .home-side .stats { grid-template-columns: repeat(2, 1fr); } }
.todos .todo { min-height: 66px; padding: 12px 14px; }
.todos .todo .mi { width: 46px; height: 46px; }

.flowhero { display: flex; align-items: center; gap: 18px; width: 100%; margin: 8px 0 6px; padding: 20px 22px; border: 0; border-radius: 10px; text-align: left; font: inherit; color: #fff; background: linear-gradient(120deg, #0F766E, #0B5E59); box-shadow: 0 10px 24px rgba(11, 94, 89, .25); }
.flowhero.f-soir { background: linear-gradient(120deg, #334155, #1E293B); box-shadow: 0 10px 24px rgba(30, 41, 59, .25); }
.flowhero .fh-ico { width: 64px; height: 64px; flex: none; display: grid; place-items: center; border-radius: 10px; background: rgba(255,255,255,.16); }
.flowhero .fh-t { flex: 1; min-width: 0; display: grid; gap: 3px; }
.flowhero small { text-transform: uppercase; letter-spacing: .06em; font-size: .72rem; font-weight: 800; opacity: .8; }
.flowhero b { font-size: 1.45rem; line-height: 1.15; }
.flowhero .fh-t > span { opacity: .92; font-weight: 600; }
.fh-bar { display: block; height: 6px; margin-top: 6px; border-radius: 3px; background: rgba(255,255,255,.22); overflow: hidden; }
.fh-bar i { display: block; height: 100%; background: #fff; }
.fh-go { flex: none; display: inline-flex; align-items: center; gap: 4px; padding: 12px 16px; border-radius: 8px; background: #fff; color: #0B5E59; font-weight: 800; font-size: 1.05rem; }
.flowhero.f-soir .fh-go { color: #1E293B; }
.flowhero:active { transform: scale(.99); }
@media (max-width: 560px) { .flowhero { flex-wrap: wrap; } .fh-go { width: 100%; justify-content: center; } }

.flow-ok { text-align: center; padding: 8px 0 14px; color: var(--ok); }
.flow-ok h2 { color: var(--ink); margin: 8px 0 4px; }

.hello .pstat { flex: none; }
.fh-late { font-style: normal; background: #fff; color: var(--bad); padding: 2px 6px; border-radius: 4px; margin-right: 6px; letter-spacing: .03em; }
@media (min-width: 760px) { .modbar .mod { width: 80px; } }
.flow-ok h2 { display: block; text-align: center; margin: 8px 0 4px; }
.qtys { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0 14px; }
.qty { min-height: 60px; min-width: 110px; padding: 0 18px; border-radius: 8px; border: 2px solid var(--line); background: var(--card); font: 800 1.3rem system-ui; color: var(--ink); }
.qty.ghost { font-size: 1rem; font-weight: 700; color: var(--muted); }
.qty.on { border-color: var(--marinade, #DC2626); background: color-mix(in srgb, var(--marinade, #DC2626) 10%, white); color: #991B1B; }
/* Plan de maîtrise sanitaire */
.pms { display: grid; gap: 14px; }
.pms-sec { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px; }
.pms-sec h2 { margin: 0 0 10px; display: flex; align-items: center; gap: 10px; }
.pms-n { display: inline-grid; place-items: center; min-width: 30px; height: 30px; border-radius: 6px; background: var(--primary-soft); color: var(--primary); font-size: .95rem; }
.pms-sec p, .pms-ul { margin: 6px 0; line-height: 1.5; }
.pms-ul { padding-left: 20px; }
.pms-dl { display: grid; grid-template-columns: 160px 1fr; gap: 6px 14px; margin: 0; }
.pms-dl dt { font-weight: 700; color: var(--muted); } .pms-dl dd { margin: 0; }
.ptable { width: 100%; border-collapse: collapse; }
.ptable th, .ptable td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.ptable th { background: var(--bg); font-size: .82rem; color: var(--muted); }
@media (max-width: 560px) { .pms-dl { grid-template-columns: 1fr; } }
