/* Monzinc : thème sombre par défaut (aubergine et framboise), clair selon l'appareil */
:root {
  --bg: #161214; --surface: #1f1a1c; --sunk: #2a2326; --line: #3a3135; --ink: #f1ecee; --muted: #a79da2;
  --accent: #d65c7e; --accent-soft: #3a1d27; --on-accent: #1a0b10;
  --ok: #4cc38a; --ok-soft: #173326; --warn: #f0a04b; --warn-soft: #3a2a17; --bad: #ef5b5b; --bad-soft: #3d1a1a;
  --r: 12px; color-scheme: dark;
  --f: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {--bg: #f4f1f2; --surface: #ffffff; --sunk: #ece6e8; --line: #dcd2d6; --ink: #1f1a1c; --muted: #6e6267;
    --accent: #b23a5d; --accent-soft: #f6e1e8; --on-accent: #ffffff; --ok: #1f8a5a; --ok-soft: #e1f3ea; --warn: #b8660f; --warn-soft: #fbecd9; --bad: #c73434; --bad-soft: #fbe2e2; color-scheme: light;}
}
:root[data-theme="light"] {--bg: #f4f1f2; --surface: #ffffff; --sunk: #ece6e8; --line: #dcd2d6; --ink: #1f1a1c; --muted: #6e6267;
    --accent: #b23a5d; --accent-soft: #f6e1e8; --on-accent: #ffffff; --ok: #1f8a5a; --ok-soft: #e1f3ea; --warn: #b8660f; --warn-soft: #fbecd9; --bad: #c73434; --bad-soft: #fbe2e2; color-scheme: light;}
:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 15px/1.45 var(--f); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .45; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1 { font-size: 1.5rem; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; margin: 0; }
h3 { font-size: .95rem; margin: 14px 0 6px; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: .84rem; }
.mono { font-family: var(--mono); font-size: .85rem; }
.err { color: var(--bad); margin: 0; font-size: .9rem; }
.warnc { color: var(--warn); }
.okc { color: var(--ok); } .badc { color: var(--bad); }
.center { min-height: 100%; display: grid; place-items: center; padding: 24px; }
label { display: grid; gap: 6px; font-size: .88rem; font-weight: 600; color: var(--muted); }
label small { font-weight: 400; }
input, select { width: 100%; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); min-height: 44px; }
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.check { display: flex; gap: 10px; align-items: center; font-weight: 500; }
.check input { width: 20px; height: 20px; min-height: 0; accent-color: var(--accent); }

/* boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 10px 16px; border-radius: 10px; font-weight: 600; min-height: 44px; white-space: nowrap; }
.btn:not(:disabled):hover { border-color: var(--muted); }
.btn.pri { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #08130d; }
.btn.bad { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.big { min-height: 54px; font-size: 1.05rem; width: 100%; }
.btn.sm { min-height: 36px; padding: 6px 12px; font-size: .88rem; }
.btn.xs { min-height: 30px; padding: 4px 8px; font-size: .8rem; }
.linkbtn { border: 0; background: none; color: var(--muted); text-decoration: underline; font-size: .85rem; padding: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.chip { border: 1px solid var(--line); background: var(--surface); padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: .9rem; min-height: 40px; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.chip.sm { min-height: 32px; padding: 4px 10px; font-size: .82rem; }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip.on.bad { background: var(--bad); border-color: var(--bad); color: #fff; }
.chip .x { border: 0; background: none; color: var(--muted); font-size: 1.1rem; padding: 0 2px; }
.pill { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); } .pill.warn { background: var(--warn-soft); color: var(--warn); } .pill.bad { background: var(--bad-soft); color: var(--bad); }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: .72rem; font-weight: 800; margin-left: 6px; }
.lbl { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

/* mise en service et code */
.setup, .pinwrap { min-height: 100%; display: grid; place-items: center; padding: max(24px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.setup-card { width: min(560px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 26px; display: grid; gap: 16px; }
.brandrow { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; min-width: 0; }
.brandrow b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brandrow small { font-weight: 600; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; background: var(--sunk); border-radius: 999px; gap: 4px; }
.tabs button { border: 0; background: none; padding: 10px; border-radius: 999px; font-weight: 700; color: var(--muted); }
.tabs button.on { background: var(--accent); color: var(--on-accent); }
.form { display: grid; gap: 14px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .two { grid-template-columns: 1fr; } }
.modes { display: grid; gap: 8px; }
.mode { text-align: left; display: grid; gap: 2px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); }
.mode span { color: var(--muted); font-size: .88rem; }
.mode.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.devlist { display: grid; gap: 8px; border-top: 1px solid var(--line); padding-top: 14px; }
.devrow { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.devrow span { display: grid; min-width: 0; } .devrow small { color: var(--muted); }
.pincard { width: min(360px, 100%); display: grid; gap: 14px; justify-items: center; text-align: center; }
.dots { display: flex; gap: 14px; }
.dots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--muted); }
.dots i.f { background: var(--accent); border-color: var(--accent); }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; }
.pad button { min-height: 66px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); font-size: 1.5rem; font-weight: 700; }
.pad button:active { background: var(--sunk); }
.pad.covers { grid-template-columns: repeat(4, 1fr); }

/* structure */
.shell, .kshell { min-height: 100%; display: grid; grid-template-rows: auto 1fr; }
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: var(--surface); border-bottom: 1px solid var(--line);
  padding: max(8px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left)); }
.nav { display: flex; gap: 4px; overflow-x: auto; flex: 1; min-width: 0; }
.nav button { border: 0; background: none; padding: 10px 12px; border-radius: 10px; font-weight: 600; color: var(--muted); white-space: nowrap; min-height: 44px; display: inline-flex; align-items: center; }
.nav button.on { background: var(--accent-soft); color: var(--ink); }
.me { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.clock { font-family: var(--mono); font-size: 1.05rem; }
.main { padding: 16px max(16px, env(safe-area-inset-right)) max(32px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); display: grid; gap: 14px; align-content: start; min-width: 0; }
.bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg { width: 12px; height: 12px; border-radius: 4px; border: 2px solid var(--line); }
.lg.ouverte { border-color: var(--muted); border-style: dashed; } .lg.cmd { border-color: var(--accent); background: var(--accent-soft); } .lg.part { border-color: var(--warn); background: var(--warn-soft); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: grid; gap: 12px; min-width: 0; }
.sec { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: space-between; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 12px; }
.empty-box { display: grid; gap: 6px; text-align: center; padding: 40px 16px; border: 1px dashed var(--line); border-radius: var(--r); color: var(--muted); }
.empty-box b { color: var(--ink); }

/* notifications */
.notifs { display: grid; gap: 6px; }
.notif { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; background: var(--ok-soft); border: 1px solid var(--ok); }
.notif i { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); flex: none; animation: pulse 1.6s ease-in-out infinite; }
.notif span { flex: 1; min-width: 0; } .notif small { color: var(--muted); }
@keyframes pulse { 50% { opacity: .35; } }

/* salle */
.tables { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px; }
.tbl { display: grid; gap: 2px; text-align: left; min-height: 96px; padding: 12px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); align-content: start; }
.tbl b { font-size: 1.45rem; line-height: 1.1; } .tbl span { font-size: .85rem; color: var(--muted); } .tbl small { font-family: var(--mono); font-size: .8rem; margin-top: auto; }
.tbl.ouverte { border-style: dashed; border-color: var(--muted); }
.tbl.cmd { border-color: var(--accent); background: var(--accent-soft); } .tbl.cmd span { color: var(--ink); }
.tbl.part { border-color: var(--warn); background: var(--warn-soft); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.ocard { display: grid; gap: 4px; text-align: left; padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.ocard span, .ocard small { color: var(--muted); }

/* note */
.panel-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 20; }
.panel { position: fixed; z-index: 21; top: 0; right: 0; bottom: 0; width: min(980px, 100%); background: var(--bg); border-left: 1px solid var(--line); display: grid; grid-template-rows: auto auto 1fr auto; box-shadow: -20px 0 40px rgba(0, 0, 0, .35);
  padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
.ph { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface); flex-wrap: wrap; }
.ph > div:first-child { flex: 1; min-width: 0; display: grid; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); }
.stepper button { border: 0; background: none; min-width: 40px; min-height: 40px; font-size: 1.2rem; font-weight: 700; }
.stepper span { min-width: 64px; text-align: center; font-weight: 700; font-family: var(--mono); }
.stepper.sm button { min-width: 34px; min-height: 34px; } .stepper.sm span { min-width: 28px; }
.algbar { background: var(--bad); color: #fff; font-weight: 700; padding: 6px 16px; }
.onote { background: var(--accent-soft); padding: 6px 16px; font-style: italic; }
.pbody { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); min-height: 0; }
.picker { padding: 12px 16px; display: grid; gap: 12px; align-content: start; overflow-y: auto; border-right: 1px solid var(--line); }
.prods { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.prod { display: grid; gap: 4px; text-align: left; padding: 12px; min-height: 84px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); align-content: start; }
.prod span { color: var(--accent); font-weight: 700; } .prod small { color: var(--muted); font-size: .74rem; }
.prod:active { background: var(--sunk); }
.prod.out { opacity: .5; } .prod.out span { color: var(--bad); }
.lines { padding: 12px 16px; overflow-y: auto; display: grid; gap: 10px; align-content: start; }
.cg { display: grid; gap: 4px; }
.cgh { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.line { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 6px 0; flex-wrap: wrap; }
.ln { display: grid; min-width: 0; flex: 1 1 140px; } .ln em { color: var(--accent); font-size: .85rem; } .ln small { color: var(--muted); font-size: .78rem; }
.la { display: flex; align-items: center; gap: 6px; }
.lt { font-family: var(--mono); min-width: 74px; text-align: right; }
.line.sent .ln b::after { content: " ✓"; color: var(--ok); }
.empty { text-align: center; padding: 30px 0; }
.pf { border-top: 1px solid var(--line); background: var(--surface); padding: 12px 16px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.tot { display: grid; } .tot b { font-size: 1.6rem; font-family: var(--mono); } .tot span, .tot small { color: var(--muted); font-size: .82rem; }
.acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pay { position: absolute; inset: auto 0 0 0; max-height: 92%; overflow-y: auto; background: var(--surface); border-top: 2px solid var(--accent); padding: 16px max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); display: grid; gap: 12px; box-shadow: 0 -20px 40px rgba(0, 0, 0, .4); }
.big { font-size: 1.1rem; margin: 0; } .big b { font-family: var(--mono); }
@media (max-width: 760px) {
  .pbody { grid-template-columns: 1fr; grid-template-rows: auto 1fr; overflow-y: auto; }
  .picker { border-right: 0; border-bottom: 1px solid var(--line); overflow: visible; }
  .prods { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lines { overflow: visible; }
  .pf .acts { width: 100%; } .pf .acts .btn { flex: 1; }
  .top .me .pill { display: none; }
}

/* listes et tableaux */
.list { display: grid; gap: 8px; }
.row, .prow { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.row > span:first-child, .prow > span:first-child { display: grid; min-width: 0; }
.row small, .prow small { color: var(--muted); }
.price { width: 96px; text-align: right; font-family: var(--mono); }
.t { width: 100%; border-collapse: collapse; font-size: .9rem; }
.t th, .t td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.t th { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.t .r { text-align: right; font-family: var(--mono); }
.card:has(> .t) { overflow-x: auto; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 12px; }
.kpi { font-size: 1.6rem; font-family: var(--mono); }
.ztab { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.ztab div { display: grid; padding: 10px; border-radius: 10px; background: var(--sunk); } .ztab span { color: var(--muted); font-size: .8rem; } .ztab b { font-family: var(--mono); }

/* cuisine */
.kshell .top { justify-content: space-between; }
.kcount { color: var(--muted); } .kcount b { color: var(--ink); font-family: var(--mono); font-size: 1.2rem; }
.kds { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; align-items: start; }
.kt { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: grid; }
.kt header { display: flex; justify-content: space-between; gap: 8px; padding: 10px 12px; background: var(--ink); color: var(--bg); }
.kt header > div:first-child { display: grid; min-width: 0; } .kt header b { font-size: 1.2rem; } .kt header span { font-size: .78rem; opacity: .8; }
.kti { text-align: right; display: grid; } .kti b { font-family: var(--mono); }
.kt.late1 header { background: var(--warn); color: #1a1006; }
.kt.late2 header { background: var(--bad); color: #fff; } .kt.late2 { box-shadow: 0 0 0 2px var(--bad); }
.kt.done { opacity: .6; } .kt.done header { background: var(--ok); color: #08130d; }
.kalg { padding: 6px 12px; background: var(--bad); color: #fff; font-weight: 700; font-size: .85rem; }
.knote { padding: 6px 12px; background: var(--accent-soft); font-style: italic; font-size: .9rem; }
.kg { padding: 8px 10px; display: grid; gap: 2px; border-top: 1px solid var(--line); }
.kg.wait { background: var(--sunk); color: var(--muted); }
.kgh { display: flex; justify-content: space-between; font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 0 4px; }
.kit { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 8px; text-align: left; border: 0; background: none; padding: 8px 4px; border-radius: 8px; font-size: 1.05rem; min-height: 44px; }
.kit:not(:disabled):hover { background: var(--sunk); }
.kit b { font-family: var(--mono); font-size: 1.15rem; } .kit em { display: block; color: var(--accent); font-size: .85rem; }
.kit.ok { color: var(--muted); text-decoration: line-through; }
.kit:disabled { opacity: 1; }
.kt footer { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.kbump { flex: 1; min-height: 50px; font-size: 1.05rem; }
@media (max-width: 560px) { .kds { grid-template-columns: 1fr; } }

/* fenêtres */
.modal-bg { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .55); display: grid; place-items: center; padding: 16px; }
.modal { width: min(520px, 100%); max-height: 92vh; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px; display: grid; gap: 14px; }
.toast { position: fixed; z-index: 50; left: 50%; transform: translateX(-50%); bottom: calc(20px + env(safe-area-inset-bottom)); background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 12px; font-weight: 600; max-width: calc(100% - 32px); box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.toast.bad { background: var(--bad); color: #fff; } .toast.warn { background: var(--warn); color: #1a1006; }

/* ticket */
.receipt { background: #fff; color: #111; font-family: var(--mono); font-size: 13px; line-height: 1.5; padding: 18px 16px; border-radius: 8px; width: min(340px, 100%); justify-self: center; }
.receipt .c { text-align: center; } .receipt .rname { font-size: 16px; } .receipt .rt { font-weight: 700; margin: 8px 0 2px; letter-spacing: .04em; }
.receipt .r { display: flex; justify-content: space-between; gap: 12px; } .receipt .r.big { font-weight: 700; font-size: 15px; margin-top: 4px; }
.receipt hr { border: 0; border-top: 1px dashed #888; margin: 8px 0; } .receipt .small { font-size: 11px; color: #555; }
@media print {
  @page { size: 80mm auto; margin: 0; }
  body { background: #fff; }
  body * { visibility: hidden; }
  .print-area, .print-area * { visibility: visible; }
  .print-area { position: absolute; left: 0; top: 0; width: 80mm; border-radius: 0; }
  .noprint { display: none !important; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media (max-width: 760px) {
  .top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; }
  .top .nav { grid-column: 1 / -1; order: 3; }
  .top .clock { display: none; }
  .tables { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
}

/* modules */
textarea { width: 100%; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; resize: vertical; }
textarea:focus { outline: none; border-color: var(--accent); }
details.card > summary { cursor: pointer; list-style: none; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::after { content: " ▾"; color: var(--muted); }
code { font-family: var(--mono); font-size: .85em; background: var(--sunk); padding: 1px 6px; border-radius: 6px; overflow-wrap: anywhere; }
.nav button.locked { opacity: .55; }
.nav button .lock { margin-left: 6px; }
.badge.warn { background: var(--warn); color: #1a1006; }
.lockpage { max-width: 680px; gap: 14px; padding: 28px; }
.lockpage .pill { width: max-content; gap: 6px; }
.alerts { display: grid; gap: 8px; }
.alert { display: flex; align-items: center; gap: 12px; text-align: left; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--warn); background: var(--warn-soft); }
.alert i { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); flex: none; }
.alert span { flex: 1; min-width: 0; } .alert b { color: var(--warn); }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 14px; align-items: start; }
.hbars { display: flex; align-items: flex-end; gap: 4px; height: 160px; padding-top: 8px; }
.hb { flex: 1; display: grid; grid-template-rows: 1fr auto; height: 100%; gap: 4px; min-width: 0; }
.hb i { align-self: end; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 2px; }
.hb span { font-size: .68rem; color: var(--muted); text-align: center; font-family: var(--mono); }
.slot { display: inline-grid; justify-items: center; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line); font-size: .78rem; color: var(--muted); min-width: 64px; }
.slot b { font-family: var(--mono); color: var(--ink); font-size: .9rem; }
.slot.part { border-color: var(--accent); } .slot.full { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
.warnbox { border-color: var(--warn); }
.upres { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rbtn { width: 100%; border: 0; background: none; text-align: left; padding: 10px 8px; border-radius: 8px; border-bottom: 1px solid var(--line); }
.rbtn.on { background: var(--accent-soft); }
.eqs { display: grid; gap: 10px; }
.eq { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(0, 2fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); }
.eq > div:first-child { display: grid; } .eq small { color: var(--muted); }
.eq.ok { border-color: var(--ok); } .eq.bad { border-color: var(--bad); }
.eq .rd { display: flex; flex-wrap: wrap; gap: 6px; }
.temp { width: 86px; text-align: right; font-family: var(--mono); }
@media (max-width: 640px) { .eq { grid-template-columns: 1fr; } }
.scrollx { overflow-x: auto; }
.t.plan { min-width: 860px; }
.t.plan th.today { color: var(--accent); }
.t.plan td { vertical-align: top; }
.shift { display: inline-flex; align-items: center; gap: 4px; margin: 2px 0; padding: 4px 6px; border-radius: 8px; background: var(--accent-soft); font-family: var(--mono); font-size: .8rem; white-space: nowrap; }
.shift small { font-family: var(--f); color: var(--muted); }
.shift .x { border: 0; background: none; color: var(--muted); padding: 0 2px; font-size: 1rem; }
.t tr.low td { background: color-mix(in srgb, var(--warn) 8%, transparent); }
.inl { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.inl .price { width: 78px; }
.warnc { color: var(--warn); }
/* barre du haut sur deux lignes : identité et compte, puis les sections */
.top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; }
.top .nav { grid-column: 1 / -1; order: 3; margin: 0 -6px; }
.kshell .top .kcount { order: 2; }
.card > .btn { justify-self: start; }

/* formules, sous-catégories, notes rapides */
.subh { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-top: 4px; }
.picks { color: var(--ink) !important; opacity: .8; }
.step { display: grid; gap: 8px; }
.step.card { padding: 12px; background: var(--bg); }
input.qn { width: min(320px, 60vw); }
/* espace groupe */
.setup.wide .setup-card { width: min(980px, 100%); }
.t tr.tot td { border-top: 2px solid var(--line); }
/* plan de salle */
.floor-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); max-width: 100%; }
.floor { position: relative; min-width: 100%; background-image: radial-gradient(var(--line) 1px, transparent 1px); background-size: 20px 20px; }
.floor .ftbl { position: absolute; min-height: 0; padding: 8px 10px; align-content: center; justify-items: center; text-align: center; }
.floor .ftbl b { font-size: 1.15rem; } .floor .ftbl span, .floor .ftbl small { font-size: .75rem; }
.floor .ftbl.rond { border-radius: 50%; }
.floor.edit .ftbl { cursor: grab; touch-action: none; border-style: dashed; }
.floor .ftbl.dragging { cursor: grabbing; box-shadow: 0 10px 24px rgba(0,0,0,.4); z-index: 2; }
.ftbl .shape { font-style: normal; font-size: .7rem; padding: 2px 8px; border-radius: 999px; background: var(--sunk); color: var(--ink); cursor: pointer; }
/* mise en route du stock */
.onboard { border-color: var(--warn); }
.onboard .pill, .sugg .lbl { width: max-content; }
.okbox { border-color: var(--ok); gap: 4px; }
.sugg { border-color: var(--accent); gap: 6px; }
.countl { display: grid; gap: 6px; }
.cnt { display: flex !important; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); color: var(--ink); font-weight: 500; }
.cnt > span:first-child { display: grid; } .cnt small { color: var(--muted); font-weight: 400; }
.offbox { border-color: var(--warn); }

/* espace employé (/moi) */
.authcard { width: min(420px, 100%); }
.authcard h1 { font-size: 1.3rem; }
.moiwrap { max-width: 640px; margin: 0 auto; padding: 12px 16px calc(24px + env(safe-area-inset-bottom)); display: grid; gap: 12px; }
.moitop { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 4px 0; }
.moitop .brandrow span { display: grid; line-height: 1.2; min-width: 0; }
.moitop .brandrow small { text-transform: none; letter-spacing: 0; }
.next { background: var(--accent-soft); border-color: var(--accent); gap: 4px; }
.next b { font-size: 1.15rem; } .next b::first-letter { text-transform: uppercase; }
.nexth { font-family: var(--mono); font-size: 1.05rem; }
.weeknav { display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: center; }
.days { list-style: none; margin: 0; padding: 0; display: grid; }
.days li { display: grid; grid-template-columns: 64px 1fr; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); align-items: start; }
.days li.today .dname { color: var(--accent); }
.dname { font-weight: 700; text-transform: capitalize; padding-top: 4px; }
.dshifts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 28px; }
.dshifts .shift em { font-style: normal; font-family: var(--f); font-weight: 700; margin-right: 4px; }
.dshifts .shift.other { background: var(--sunk); }
.total { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.hist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.hist li { display: grid; grid-template-columns: 52px 1fr 62px; gap: 8px; align-items: center; }
.hist .hb { grid-column: 2 / 4; }
.hw { font-size: .82rem; color: var(--muted); }
.hbar { position: relative; height: 12px; background: var(--sunk); border-radius: 6px; overflow: hidden; }
.hbar i { position: absolute; inset: 0 auto 0 0; background: var(--accent); border-radius: 6px; }
.hbar i.plan { background: color-mix(in srgb, var(--accent) 40%, transparent); }
.hbar u { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--ink); }
.hv { font-family: var(--mono); font-size: .85rem; text-align: right; }
@media (min-width: 520px) { .hist li { grid-template-columns: 60px 1fr 64px 200px; } .hist .hb { grid-column: auto; } }
.moiwrap .ztab { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hbar { overflow: visible; } .hbar i { overflow: hidden; }
.moiact { display: flex; align-items: center; gap: 6px; }
.flash { background: var(--ok-soft); border-color: var(--ok); color: var(--ink); font-weight: 600; }

/* guide de prise en main */
.tour { position: fixed; inset: 0; z-index: 60; }
.tour.dim { background: rgba(10, 6, 8, .62); }
.tour-hole { position: fixed; border-radius: 12px; box-shadow: 0 0 0 9999px rgba(10, 6, 8, .62); outline: 2px solid var(--accent); outline-offset: 2px; transition: top .25s, left .25s, width .25s, height .25s; pointer-events: none; }
.tour-card { position: fixed; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: grid; gap: 10px; box-shadow: 0 20px 50px rgba(0, 0, 0, .45); max-height: calc(100vh - 24px); overflow-y: auto; }
.tour-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tour-top .linkbtn { padding: 4px; }
.tour-card h2 { font-size: 1.2rem; }
.tour-body { display: grid; gap: 8px; } .tour-body p, .tour-body ul, .tour-body ol { margin: 0; }
.tour-body ul { padding-left: 18px; display: grid; gap: 4px; }
.tsteps { padding-left: 0; list-style: none; counter-reset: ts; display: grid; gap: 8px; }
.tsteps li { counter-increment: ts; position: relative; padding-left: 34px; min-height: 24px; }
.tsteps li::before { content: counter(ts); position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-weight: 800; font-size: .8rem; }
.tip { background: var(--sunk); border-radius: 10px; padding: 10px 12px; font-size: .9rem; }
.tour-dots { display: flex; gap: 5px; justify-content: center; }
.tour-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); } .tour-dots i.on { background: var(--accent); width: 16px; border-radius: 3px; }
.tour-card .acts { display: flex; justify-content: flex-end; gap: 8px; position: sticky; bottom: -18px; margin: 0 -18px -18px; padding: 10px 18px 18px; background: var(--surface); border-radius: 0 0 16px 16px; }
.helpbtn { width: 36px; padding: 0; font-weight: 800; border-color: var(--line) !important; border-radius: 50%; }
@media (prefers-reduced-motion: reduce) { .tour-hole { transition: none; } }

/* liste de mise en route */
.onboard { border-color: var(--accent); }
.setup-bar { height: 8px; border-radius: 4px; background: var(--sunk); overflow: hidden; }
.setup-bar i { display: block; height: 100%; background: var(--ok); border-radius: 4px; transition: width .4s; }
.setup-list { list-style: none; margin: 0; padding: 0; display: grid; }
.setup-list li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.setup-list .sck { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-weight: 800; color: #08130d; }
.setup-list li.done .sck { background: var(--ok); border-color: var(--ok); }
.setup-list li.done .stx b { text-decoration: line-through; color: var(--muted); }
.setup-list .stx { display: grid; gap: 2px; } .setup-list .stx small { color: var(--muted); }
.setup-list .acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 640px) { .setup-list li { grid-template-columns: 28px minmax(0, 1fr); } .setup-list .acts { grid-column: 2; justify-content: flex-start; } }

/* aide */
.acts.start { justify-content: flex-start; flex-wrap: wrap; }
.faq details { border-top: 1px solid var(--line); }
.faq summary { cursor: pointer; padding: 12px 0; font-weight: 600; }
.faq details p { margin: 0 0 12px; color: var(--muted); }
.me { min-width: 0; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 760px) { .top .me [data-a=theme] { display: none; } .top .me { gap: 6px; } }

/* modification du plan de salle */
.planed { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: start; }
@media (max-width: 900px) { .planed { grid-template-columns: 1fr; } }
.planpanel { position: sticky; top: 120px; max-height: calc(100vh - 140px); overflow-y: auto; }
.planpanel h3 { margin: 0; color: var(--ink); font-size: 1rem; }
.propbox { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: grid; gap: 10px; }
.inrow { display: flex; gap: 8px; } .inrow input { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.floor .deco { position: absolute; display: grid; place-items: center; border: 2px dashed var(--muted); border-radius: 8px; color: var(--muted); font-weight: 700; font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; background: color-mix(in srgb, var(--sunk) 60%, transparent); user-select: none; text-align: center; padding: 0 6px; overflow: hidden; }
.floor.edit .deco { cursor: grab; touch-action: none; }
.floor .deco.dragging { cursor: grabbing; z-index: 2; }
.floor .psel { outline: 3px solid var(--accent); outline-offset: 3px; }
.floor .ftbl .tin { display: grid; justify-items: center; gap: 2px; pointer-events: none; }
.floor-empty { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; }
button.ln { border: 0; background: none; text-align: left; padding: 4px 6px; margin: -4px -6px; border-radius: 8px; color: inherit; cursor: pointer; }
button.ln:hover, .line.editing button.ln { background: var(--sunk); }
.ln u { text-decoration: underline; text-underline-offset: 2px; color: var(--accent); }
.lineed { display: grid; gap: 8px; padding: 10px; margin: 2px 0 8px; border: 1px solid var(--accent); border-radius: 10px; background: var(--accent-soft); }
.lineed .acts { justify-content: flex-end; }

/* planning */
.plbox { padding: 12px; }
.plan2 { border-collapse: separate; border-spacing: 4px; min-width: 760px; }
.plan2 th, .plan2 td { border: 0; padding: 0; vertical-align: top; }
.plan2 th { padding: 4px 2px; font-size: .78rem; text-transform: capitalize; }
.plan2 th.today { color: var(--accent); }
.pemp { display: grid; grid-template-columns: 10px 1fr; column-gap: 8px; align-items: center; padding: 6px 4px !important; min-width: 120px; }
.pemp i { width: 10px; height: 10px; border-radius: 50%; grid-row: span 2; }
.pemp small { color: inherit; opacity: .65; font-size: .72rem; }
.pcell { width: 100%; min-height: 58px; display: grid; gap: 3px; align-content: start; padding: 4px; border: 1px dashed color-mix(in srgb, currentColor 22%, transparent); border-radius: 8px; background: transparent; color: inherit; text-align: left; }
button.pcell:hover, .pcell.sel { border-style: solid; border-color: var(--accent); }
.pc-empty { display: grid; place-items: center; min-height: 48px; opacity: .45; font-size: 1.1rem; }
.pc-slot { display: grid; padding: 4px 6px; border-radius: 6px; font-size: .78rem; line-height: 1.25; }
.pc-slot b { font-family: var(--mono); font-weight: 600; } .pc-slot small, .pc-slot em { font-size: .7rem; opacity: .9; font-style: normal; }
.pc-slot.off { text-align: center; min-height: 48px; align-content: center; }
.pc-note { font-size: .7rem; font-style: italic; opacity: .8; padding: 0 2px; }
.plbox.compact .pcell { min-height: 40px; padding: 2px; } .plbox.compact .pc-slot { padding: 2px 4px; } .plbox.compact .pc-slot small { display: none; }
.ptot { white-space: nowrap; padding: 6px 4px !important; font-size: .82rem; }
.plegend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .8rem; margin-top: 8px; }
.plegend span { display: inline-flex; align-items: center; gap: 6px; } .plegend i { width: 12px; height: 12px; border-radius: 3px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 2px; }
.cedit { border-color: var(--accent); }
.slotrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.slotrow input { width: 90px; font-family: var(--mono); }
.pcfg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.pcfg-grid h3 { color: var(--ink); margin: 0 0 6px; font-size: 1rem; }
.pcfg-grid > div { display: grid; gap: 8px; align-content: start; }
.pcfg input[type=color], .inrow input[type=color] { width: 44px; min-width: 44px; padding: 2px; height: 40px; min-height: 0; }
.swatch { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); padding: 0; }
.swatch.on { outline: 2px solid var(--accent); outline-offset: 2px; }
.swatch.none { background: repeating-linear-gradient(45deg, var(--surface), var(--surface) 4px, var(--sunk) 4px, var(--sunk) 8px); }
.emps { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.inl { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.shift .pdot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 2px; }
.shift.offd { background: var(--sunk); font-family: var(--f); font-weight: 600; }
.dnote { flex-basis: 100%; font-size: .78rem; font-style: italic; color: var(--muted); }
/* la note s'adapte au nombre de bandeaux (allergies, note de table) */
.panel { display: flex; flex-direction: column; }
.panel > .pbody { flex: 1 1 auto; min-height: 0; }
.panel > .ph, .panel > .algbar, .panel > .onote, .panel > .pf { flex: none; }
.dshifts .dnote + .dnote { margin-left: 0; }
