:root {
  --bg: #1c1814;
  --stage: #231e19;
  --panel: #fbf6ee;
  --card: #ffffff;
  --ink: #2b2118;
  --muted: #8a7b6b;
  --line: #ebe1d2;
  --gold: #d9a05b;
  --gold-d: #b97f3a;
  --green: #2e9e5b;
  --red: #d63b30;
  --orange: #d98a1b;
  --blue: #3a74d8;
  --radius: 14px;
  --font: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 500 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
body.modal-open, body.logged-out { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; }

/* ---------- barre du haut ---------- */
.topbar { display: flex; align-items: center; gap: 14px; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); background: #15120f; color: #f3e6d1; border-bottom: 1px solid #2f2820; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand .logo { font-size: 26px; width: 42px; height: 42px; display: grid; place-items: center; background: linear-gradient(145deg, #3a2f24, #261f19); border-radius: 12px; box-shadow: inset 0 1px 0 rgba(255,255,255,.08); }
.brand h1 { font-size: 19px; font-weight: 900; letter-spacing: .3px; color: var(--gold); }
.brand small { color: #b9a68e; font-size: 12px; }
.local-badge { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 99px; background: #2a3a2f; color: #bfe6c9; border: 1px solid #3c5444; white-space: nowrap; }
.local-badge.warn { background: #4a2a24; color: #ffc9bd; border-color: #6b3a30; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.session-box { display: flex; align-items: center; gap: 8px; min-width: 0; }
.who { --c: #d9a05b; display: inline-flex; align-items: center; gap: 6px; font-weight: 800; color: #f3e6d1; background: #2a231c; border: 1px solid #43382c; border-left: 4px solid var(--c); border-radius: 10px; padding: 6px 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.btn.dark { background: #2a231c; border-color: #43382c; color: #e9d9c0; }
.btn.dark:hover { background: #352c23; }

/* ---------- boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid #d9ccb8; background: #fff; color: var(--ink); border-radius: 10px; padding: 8px 13px; font-weight: 700; cursor: pointer; transition: transform .12s, background .15s, box-shadow .15s; text-decoration: none; }
.btn:hover { background: #fff7ea; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--gold); border-color: var(--gold-d); color: #2a1a08; box-shadow: 0 2px 0 var(--gold-d); }
.btn.primary:hover { background: #e4ae6c; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--red); border-color: #f0c4bd; }
.btn.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 9px; }
.btn.big { padding: 12px 18px; font-size: 15px; width: 100%; }
.btn.icon { padding: 7px 10px; background: #2a231c; border-color: #43382c; color: #fff; }
.topbar .btn.primary { box-shadow: 0 2px 0 #8e5f27; }
.btn:focus-visible, .tab:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid #f5c77e; outline-offset: 2px; }

/* ---------- mise en page ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 440px; height: calc(100vh - 63px); height: calc(100dvh - 63px); }
.stage { position: relative; background: radial-gradient(ellipse at 50% 45%, #3a3129 0%, #231e19 55%, #171310 100%); overflow: hidden; min-height: 320px; }
#scene { display: block; width: 100%; height: 100%; touch-action: manipulation; }
.queue { position: absolute; left: 12px; bottom: 12px; display: flex; gap: 6px; flex-wrap: wrap; max-width: calc(100% - 24px); pointer-events: none; }
.chip { --c: #6a717c; background: rgba(28,24,20,.82); color: #f3e6d1; border: 1px solid rgba(255,255,255,.12); border-left: 4px solid var(--c); padding: 4px 10px; border-radius: 9px; font-size: 12px; font-weight: 700; backdrop-filter: blur(4px); }
.chip.run { background: rgba(217,160,91,.95); color: #2a1a08; }
.chip.label { border-left-color: var(--gold); color: var(--gold); }
.chip.idle { border-left-color: var(--green); }
.stage-tools { position: absolute; right: 12px; top: 12px; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.stage-tools .btn { background: rgba(28,24,20,.8); color: #f3e6d1; border-color: rgba(255,255,255,.14); backdrop-filter: blur(4px); }
.stage-tools .btn[aria-pressed="true"] { background: rgba(217,160,91,.9); color: #2a1a08; }
.stage-hint { position: absolute; right: 12px; bottom: 12px; margin: 0; color: #a99681; font-size: 12px; pointer-events: none; }
.tooltip { position: absolute; pointer-events: none; background: #15120f; color: #f6dfb0; padding: 5px 10px; border-radius: 8px; font-size: 12px; font-weight: 700; white-space: nowrap; box-shadow: 0 4px 14px rgba(0,0,0,.35); }
.toasts { position: absolute; top: 52px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; width: min(460px, calc(100% - 24px)); pointer-events: none; z-index: 5; }
.toast { background: #fffdf8; color: var(--ink); border-radius: 12px; padding: 9px 14px; box-shadow: 0 8px 24px rgba(0,0,0,.35); border-left: 5px solid var(--blue); font-weight: 600; animation: tin .3s ease-out; width: 100%; }
.toast.ok { border-left-color: var(--green); }
.toast.bad { border-left-color: var(--red); }
.toast.out { opacity: 0; transform: translateY(-6px); transition: .4s; }
@keyframes tin { from { opacity: 0; transform: translateY(-10px) scale(.97); } }

/* ---------- panneau ---------- */
.panel { background: var(--panel); display: flex; flex-direction: column; min-height: 0; border-left: 1px solid #3a3027; }
.tabs { display: flex; gap: 2px; padding: 8px 8px 0; overflow-x: auto; background: #f1e8da; border-bottom: 1px solid var(--line); scrollbar-width: none; flex-shrink: 0; }
.tab { border: 0; background: transparent; padding: 9px 11px; border-radius: 10px 10px 0 0; font-weight: 800; color: var(--muted); cursor: pointer; white-space: nowrap; display: flex; align-items: center; gap: 5px; }
.tab.on { background: var(--panel); color: var(--ink); box-shadow: 0 -2px 0 var(--gold) inset; }
.count { background: var(--red); color: #fff; font-size: 11px; border-radius: 99px; padding: 0 6px; min-width: 18px; text-align: center; }
.panel-body { padding: 12px 14px 20px; overflow-y: auto; flex: 1; }
.panel-body h3 { font-size: 14px; font-weight: 900; margin: 16px 0 8px; display: flex; align-items: center; gap: 6px; text-transform: uppercase; letter-spacing: .4px; color: #5b4b3a; }
.panel-body h3 small { background: #eadfce; color: #6e5d4b; border-radius: 99px; padding: 0 7px; font-size: 11px; }
.local-note { margin: 0; padding: 8px 14px; font-size: 11.5px; color: #7d6c5a; background: #f1e8da; border-top: 1px solid var(--line); }
.empty { color: var(--muted); font-size: 13px; margin: 4px 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.bad-t { color: var(--red); }
.warn-t { color: var(--orange); font-weight: 700; }
.toolbar { display: flex; align-items: center; gap: 8px; justify-content: space-between; flex-wrap: wrap; margin-bottom: 4px; }
.toolbar p { margin: 0; flex: 1; min-width: 180px; }

.live-card { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #2a231c; color: #f6e8d2; padding: 10px 12px; border-radius: 12px; }
.live-card small { color: #d4bf9f; }
.live-card.idle { background: #e7f3e9; color: #2c5a3a; font-weight: 700; justify-content: flex-start; }
.pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(46,158,91,.6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(46,158,91,0); } 100% { box-shadow: 0 0 0 0 rgba(46,158,91,0); } }

.req-card, .alert-card, .order-card, .sup-card, .rack-item { --est: #999; background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--est); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 8px; box-shadow: 0 1px 2px rgba(60,40,20,.05); }
.order-card, .sup-card { border-left-color: var(--gold); }
.order-card.o-validee { border-left-color: var(--blue); }
.order-card.o-recue { border-left-color: var(--green); }
.order-card.o-annulee { opacity: .65; }
.req-card header, .alert-card header, .order-card header, .sup-card header { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.sup-card header .btn { margin-left: auto; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--est); display: inline-block; flex-shrink: 0; }
.num { font-size: 12px; color: var(--muted); font-weight: 800; }
.lines { margin: 6px 0 2px; font-weight: 700; }
.meta { margin: 2px 0; font-size: 12.5px; color: #6e5d4b; }
.meta.warn { color: var(--red); font-weight: 700; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.status { margin-left: auto; font-size: 11.5px; font-weight: 800; padding: 2px 9px; border-radius: 99px; white-space: nowrap; }
.s-recue { background: #eceae6; color: #555; }
.s-preparation { background: #fdf0d7; color: #9a5d00; }
.s-manquants { background: #fde2df; color: #b3261e; }
.s-prete { background: #dcf3e4; color: #1d7a43; }
.s-remise { background: #dde8fb; color: #2a5bb0; }
.s-annulee { background: #eee; color: #888; }
.ostatus { margin-left: auto; font-size: 11.5px; font-weight: 800; color: #6e5d4b; background: #f3ece1; padding: 2px 9px; border-radius: 99px; }
.tag { display: inline-block; font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 99px; background: #f1e8da; margin: 2px 2px 2px 0; }
.tag.bad { background: #fde2df; color: #b3261e; }
.tag.warn { background: #fdf0d7; color: #9a5d00; }

.stepper { display: flex; align-items: center; gap: 4px; margin: 8px 0 4px; flex-wrap: wrap; }
.stepper i { flex: 0 0 10px; height: 2px; background: #e2d6c4; }
.step { font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 99px; background: #f1ebe2; color: #a8998a; }
.step.done { background: #dcf3e4; color: #1d7a43; }
.step.now { background: var(--gold); color: #2a1a08; }
.step.now.bad { background: #fde2df; color: #b3261e; }
.step.cancel { background: #eee; color: #888; }

.cta-box { display: flex; gap: 10px; align-items: center; justify-content: space-between; background: #2a231c; color: #f6e8d2; padding: 12px; border-radius: var(--radius); flex-wrap: wrap; }
.cta-box small { color: #d4bf9f; }
.rows .row, .row { display: flex; align-items: center; gap: 8px; justify-content: space-between; padding: 8px 10px; background: #fff; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.row.link { cursor: pointer; }
.row.link:hover { background: #fff7ea; }

table { border-collapse: collapse; width: 100%; }
.mini { margin-top: 6px; font-size: 12.5px; }
.mini th, .mini td { text-align: left; padding: 3px 6px; border-bottom: 1px solid #f2ebe0; }
.mini th { color: var(--muted); font-weight: 800; font-size: 11px; }
tr.bad td { color: #b3261e; background: #fff4f2; }
tr.focus td { background: #fff3d6; }
.tbl { font-size: 13px; margin: 8px 0; }
.tbl th, .tbl td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.tbl th { font-size: 11.5px; color: var(--muted); font-weight: 800; text-transform: uppercase; letter-spacing: .3px; }
.tbl-wrap { overflow-x: auto; }
.num-in { width: 72px; padding: 6px 8px; border: 1px solid #d9ccb8; border-radius: 8px; background: #fff; }

.cat-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.swatch { width: 12px; height: 26px; border-radius: 4px; display: inline-block; flex-shrink: 0; box-shadow: inset 0 -6px 0 rgba(0,0,0,.15); }
.stock-grid { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.sg-head, .sg-row { display: grid; grid-template-columns: minmax(0, 2.2fr) 1fr .8fr .8fr .9fr auto; gap: 8px; align-items: center; padding: 8px 10px; }
.sg-head { font-size: 11px; font-weight: 800; color: var(--muted); text-transform: uppercase; background: #faf5ed; }
.sg-row { border-top: 1px solid #f2ebe0; font-size: 13px; }
.sg-row small { display: block; font-size: 11px; }
.sg-prod { display: flex; gap: 8px; align-items: center; }
.sg-act { display: flex; gap: 4px; }
.panel .sg-head, .panel .sg-row { grid-template-columns: minmax(0, 1fr) auto auto auto; }
.panel .sg-head span:nth-child(2), .panel .sg-row > span:nth-child(2) { display: none; }
.panel .sg-row > span:nth-child(3)::before, .panel .sg-row > span:nth-child(4)::before, .panel .sg-row > span:nth-child(5)::before { content: attr(data-l); display: block; font-size: 10px; color: var(--muted); font-weight: 800; text-transform: uppercase; }
.panel .sg-head { display: none; }
.panel .sg-act { grid-column: 1 / -1; justify-content: flex-end; }

.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.filters select, .grid-form input, .grid-form select, .grid-form textarea, .order-foot input, .order-foot textarea, form label > select, form label > textarea { width: 100%; padding: 8px 10px; border: 1px solid #d9ccb8; border-radius: 10px; background: #fff; }
.filters select { width: auto; flex: 1; min-width: 120px; }
.hist .hrow { display: grid; grid-template-columns: 82px 1fr auto; gap: 8px; padding: 8px 10px; background: #fff; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 5px; align-items: center; font-size: 13px; }
.htype { font-size: 11px; font-weight: 900; text-transform: uppercase; padding: 2px 7px; border-radius: 99px; text-align: center; }
.t-entree .htype { background: #dcf3e4; color: #1d7a43; }
.t-sortie .htype { background: #fde2df; color: #b3261e; }
.t-transfert .htype { background: #dde8fb; color: #2a5bb0; }
.hdate { text-align: right; font-size: 12px; color: #6e5d4b; }
.closed summary { cursor: pointer; font-weight: 800; color: var(--muted); margin: 8px 0; }
.totals { margin-bottom: 8px; }

/* commande établissement */
.hello { --est: #999; font-size: 15px; margin: 4px 0; display: flex; align-items: center; gap: 8px; }
.catalog { display: flex; flex-direction: column; gap: 6px; }
.cat-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; }
.ci-name { display: flex; gap: 8px; align-items: center; }
.ci-av { font-size: 12px; font-weight: 700; color: #2c5a3a; text-align: right; }
.ci-qty { grid-column: 1 / -1; display: flex; gap: 6px; }
.ci-qty input { width: 90px; padding: 8px 10px; border: 1px solid #d9ccb8; border-radius: 10px; font-size: 16px; }
.ci-qty select { flex: 1; padding: 8px; border: 1px solid #d9ccb8; border-radius: 10px; background: #fff; font-size: 14px; }
.order-foot { position: sticky; bottom: -20px; background: var(--panel); padding: 12px 0 4px; margin-top: 12px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.order-foot label { display: grid; gap: 4px; font-weight: 700; font-size: 12.5px; }
.order-foot input, .order-foot textarea { font-size: 16px; }
.summary { margin: 0; font-weight: 700; }

/* ---------- connexion ---------- */
.login { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(21,17,13,.62); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); overflow-y: auto; }
.login-card { background: var(--panel); border-radius: 22px; width: min(560px, 100%); padding: 22px 22px 18px; box-shadow: 0 30px 80px rgba(0,0,0,.5); animation: mup .25s ease-out; }
.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.login-brand > span { font-size: 26px; width: 44px; height: 44px; display: grid; place-items: center; background: #2a231c; border-radius: 12px; }
.login-brand b { display: block; font-size: 19px; font-weight: 900; color: var(--gold-d); }
.login-brand small { color: var(--muted); font-size: 12px; }
.login-card h2 { font-size: 20px; font-weight: 900; margin: 4px 0 12px; }
.space-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.space-card { --c: #999; display: flex; align-items: center; gap: 10px; text-align: left; background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--c); border-radius: 14px; padding: 12px; cursor: pointer; transition: transform .12s, box-shadow .15s; min-height: 64px; }
.space-card:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(60,40,20,.12); }
.space-card:first-child { grid-column: 1 / -1; background: #2a231c; color: #f6e8d2; border-color: #2a231c; border-left-color: var(--c); }
.space-card:first-child small { color: #d4bf9f; }
.space-card:disabled { opacity: .55; cursor: not-allowed; }
.space-card b { display: block; font-size: 15px; }
.space-card small { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.sc-icon { font-size: 22px; width: 40px; height: 40px; flex-shrink: 0; display: grid; place-items: center; background: rgba(217,160,91,.16); border-radius: 12px; }
.demo-codes { margin: 12px 0 0; padding: 8px 12px; background: #fff3d6; border-radius: 10px; font-size: 13px; }
.login-note { margin: 10px 0 0; font-size: 12px; color: var(--muted); }
.link-btn { border: 0; background: none; color: var(--gold-d); font-weight: 800; cursor: pointer; padding: 8px 0 0; text-decoration: underline; }
.link-btn.back { padding: 0 0 8px; text-decoration: none; }
.login-who { --c: #999; display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--c); border-radius: 14px; padding: 10px 12px; }
.login-who small { display: block; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.login-who b { font-size: 17px; }
.pin-label { text-align: center; margin: 16px 0 8px; font-weight: 700; color: #5b4b3a; }
.pin-dots { display: flex; justify-content: center; gap: 12px; height: 18px; }
.pin-dots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid #c9b79e; }
.pin-dots i.on { background: var(--ink); border-color: var(--ink); }
.pin-dots.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.pin-error { text-align: center; color: var(--red); font-weight: 700; min-height: 20px; margin: 8px 0; font-size: 13px; }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 300px; margin: 0 auto; }
.pin-key { height: 58px; border-radius: 16px; border: 1px solid #e0d3bf; background: #fff; font-size: 22px; font-weight: 800; cursor: pointer; box-shadow: 0 2px 0 #e0d3bf; touch-action: manipulation; }
.pin-key:active { transform: translateY(2px); box-shadow: none; }
.pin-key.del { background: #f1e8da; }
.pin-key.ok { background: var(--gold); border-color: var(--gold-d); box-shadow: 0 2px 0 var(--gold-d); }
.pin-key:disabled { opacity: .45; cursor: default; }
.remember { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 14px; font-size: 13px; font-weight: 700; }
.remember input { width: 18px; height: 18px; }
.code-row { display: flex; gap: 6px; }
.code-row input { flex: 1; font-size: 16px; letter-spacing: 2px; }

/* ---------- fenêtres ---------- */
.modal { position: fixed; inset: 0; background: rgba(20,15,10,.6); display: grid; place-items: center; z-index: 50; padding: 16px; backdrop-filter: blur(3px); }
.modal[hidden] { display: none; }
.modal-card { position: relative; background: var(--panel); border-radius: 18px; width: min(760px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 20px 20px 18px; box-shadow: 0 24px 60px rgba(0,0,0,.45); animation: mup .22s ease-out; }
@keyframes mup { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.modal-close { position: absolute; top: 10px; right: 12px; border: 0; background: #eadfce; width: 32px; height: 32px; border-radius: 50%; font-size: 20px; cursor: pointer; line-height: 1; }
.modal-card h2 { --est: transparent; font-size: 19px; font-weight: 900; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-right: 40px; margin-bottom: 6px; }
.modal-card h2 .status { margin-left: 4px; }
.modal-card h4 { margin: 14px 0 6px; font-size: 13px; text-transform: uppercase; color: #6e5d4b; letter-spacing: .4px; }
.bad-h { color: #b3261e; }
.comment { background: #fff; border: 1px dashed #d9ccb8; padding: 8px 10px; border-radius: 10px; font-style: italic; }
.log { list-style: none; padding: 0; margin: 0; font-size: 12.5px; }
.log li { padding: 4px 0; border-bottom: 1px solid #f2ebe0; }
.log span { color: var(--muted); font-weight: 700; margin-right: 6px; }
.ok-box, .info-box { padding: 9px 12px; border-radius: 10px; font-size: 13px; margin: 10px 0; }
.ok-box { background: #dcf3e4; color: #1d5a35; }
.info-box { background: #eef3fb; color: #2b4a77; }
.demo-note { background: #fff3d6; padding: 8px 12px; border-radius: 10px; font-weight: 700; }
.choice { display: grid; gap: 8px; margin-top: 12px; }
.choice .btn { flex-direction: column; align-items: flex-start; text-align: left; padding: 11px 14px; }
.choice .btn small { font-weight: 600; opacity: .75; font-size: 12px; }
.grid-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0; }
.grid-form label, form > label { display: grid; gap: 4px; font-weight: 700; font-size: 12.5px; margin: 6px 0; }
.grid-form .full { grid-column: 1 / -1; }
.grid-form input[type="color"] { height: 40px; padding: 3px; }
.rack-item { border-left-width: 1px; }
.ri-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gauge { position: relative; height: 10px; background: #efe6d8; border-radius: 99px; overflow: hidden; margin: 8px 0 4px; }
.gauge span { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, #6cc38b, #2e9e5b); border-radius: 99px; }
.gauge .res { background: repeating-linear-gradient(45deg, #d98a1b, #d98a1b 4px, #e9a94c 4px, #e9a94c 8px); opacity: .9; }

/* ---------- téléphone & tablette ---------- */
@media (max-width: 1100px) { .layout { grid-template-columns: minmax(0, 1fr) 380px; } }
@media (max-width: 900px) {
  .layout { display: block; height: auto; }
  .stage { height: 56vh; height: 56svh; min-height: 300px; }
  .panel { border-left: 0; border-top: 1px solid #3a3027; min-height: 60vh; }
  .panel-body { overflow: visible; }
  .tabs { position: sticky; top: 0; z-index: 4; }
  .order-foot { position: static; }
}
@media (max-width: 600px) {
  .topbar { gap: 8px; padding: 8px 12px; }
  .brand small, .stage-hint { display: none; }
  .brand h1 { font-size: 17px; }
  .top-actions { width: 100%; margin-left: 0; }
  .session-box { flex: 1; }
  .who { flex: 1; max-width: none; }
  .space-grid { grid-template-columns: 1fr; }
  .login { padding: 10px; place-items: start center; }
  .login-card { padding: 18px 16px 16px; }
  #demoBtn { font-size: 13px; padding: 7px 10px; }
  .stage-tools { top: 8px; right: 8px; }
  .stage-tools .btn { font-size: 11.5px; padding: 4px 8px; }
  .queue { left: 8px; bottom: 8px; }
  .chip { font-size: 11px; }
  .toasts { top: 44px; }
  .panel-body { padding: 10px 12px 18px; }
  .grid-form { grid-template-columns: 1fr; }
  .grid-form input, .grid-form select, .grid-form textarea, .filters select, .num-in, form > label > select, form > label > textarea { font-size: 16px; }
  .modal { padding: 0; place-items: end center; }
  .modal-card { border-radius: 18px 18px 0 0; max-height: 92dvh; padding: 18px 14px calc(16px + env(safe-area-inset-bottom)); }
  .tbl.resp thead { display: none; }
  .tbl.resp tr { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; border-bottom: 1px solid var(--line); padding: 8px 0; }
  .tbl.resp td { border: 0; padding: 2px 0; }
  .tbl.resp td:first-child, .tbl.resp td:last-child { grid-column: 1 / -1; }
  .tbl.resp td[data-l]::before { content: attr(data-l) ' : '; color: var(--muted); font-size: 11px; font-weight: 800; }
  .hist .hrow { grid-template-columns: 1fr; }
  .hdate { text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
