
*{box-sizing:border-box}html,body{margin:0;height:100%;font-family:Arial,sans-serif;background:#0f172a;color:#fff}
button,input,select,textarea{font:inherit}button{border:0;border-radius:10px;padding:10px 14px;background:#334155;color:#fff;font-weight:700;cursor:pointer}
button:active{transform:translateY(1px)}.gold{background:#d4a017;color:#111827}.success{background:#15803d}.danger{background:#991b1b}.blue{background:#1d4ed8}.full{width:100%}.hidden{display:none!important}
.screen{display:none;min-height:100vh}.screen.active{display:block}
.login-card{width:min(430px,92%);margin:8vh auto;background:linear-gradient(#1f2937,#111827);padding:34px;border-radius:24px;text-align:center;box-shadow:0 25px 70px #0008}
.logo,.mini-logo{background:#d4a017;color:#111827;font-weight:900;display:grid;place-items:center}.logo{width:86px;height:86px;border-radius:20px;font-size:48px;margin:0 auto 18px}.mini-logo{width:42px;height:42px;border-radius:12px}
.login-card h1{margin:0;font-size:36px}.login-card p,.login-card small{color:#94a3b8}.login-card input{width:100%;padding:16px;margin:18px 0 12px;border-radius:12px;border:1px solid #334155;background:#0b1220;color:#fff;text-align:center;font-size:24px;letter-spacing:8px}
header{min-height:72px;background:#111827;border-bottom:1px solid #334155;padding:14px 18px;display:flex;align-items:center;justify-content:space-between;gap:10px}.brand{display:flex;align-items:center;gap:12px}header h2{margin:0}.header-actions{display:flex;gap:8px;flex-wrap:wrap}
.zone-bar{background:#1e293b;padding:9px 12px;display:flex;justify-content:space-between;gap:10px;border-bottom:1px solid #334155}.zone-bar>div:first-child{display:flex;gap:8px;overflow:auto}.zone-btn{white-space:nowrap}.zone-btn.active{background:#d4a017;color:#111827}
.toolbar{padding:10px 12px;display:flex;gap:8px;flex-wrap:wrap;background:#111827}.legend{padding:10px 14px;background:#0b1220;display:flex;gap:16px;flex-wrap:wrap;color:#cbd5e1;font-size:14px}.legend i{display:inline-block;width:11px;height:11px;border-radius:50%;margin-right:5px}.free{background:#22c55e}.occupied{background:#ef4444}.waiting{background:#f59e0b}.bill{background:#3b82f6}.reserved{background:#a855f7}
.canvas-wrap{height:calc(100dvh - 180px);min-height:360px;overflow:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;touch-action:pan-x pan-y;padding:18px;background:#dbe1e8}.canvas-wrap #canvas{position:relative;width:1300px;height:820px;background:#fff;border:2px dashed #94a3b8;border-radius:16px;touch-action:pan-x pan-y}
.item{position:absolute;display:flex;align-items:center;justify-content:center;text-align:center;user-select:none;touch-action:none}.table{color:#fff;font-weight:800;border:3px solid #166534;box-shadow:0 8px 18px #0003}.table.round{width:112px;height:112px;border-radius:50%}.table.square{width:112px;height:112px;border-radius:18px}.table.rect{width:175px;height:100px;border-radius:18px}.table.free{background:#16a34a}.table.occupied{background:#dc2626;border-color:#991b1b}.table.waiting{background:#d97706;border-color:#92400e}.table.bill{background:#2563eb;border-color:#1d4ed8}.table.reserved{background:#9333ea;border-color:#6b21a8}.label{background:#fde68a;color:#111827;padding:8px 12px;border-radius:8px;font-weight:800}.editing .item{outline:3px dashed #1118;cursor:move}
.order-layout{display:grid;grid-template-columns:190px 1fr 350px;min-height:calc(100vh - 72px)}.categories{padding:14px;background:#111827}.category-btn{width:100%;text-align:left;margin-bottom:8px}.category-btn.active{background:#d4a017;color:#111827}.products{padding:16px;display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:14px;align-content:start}.product{background:#1f2937;border:1px solid #334155;border-radius:15px;padding:15px;min-height:125px;display:flex;flex-direction:column;justify-content:space-between}.product span{color:#facc15}.cart{background:#111827;padding:16px;display:flex;flex-direction:column}.cart label input{width:70px;padding:7px;background:#0b1220;color:#fff;border:1px solid #334155;border-radius:8px}.cart-lines{flex:1;overflow:auto}.cart-line{display:grid;grid-template-columns:1fr auto;gap:8px;padding:10px 0;border-bottom:1px solid #334155}.line-actions{display:flex;gap:5px;justify-content:flex-end}.line-actions button{padding:4px 8px}.total{display:flex;justify-content:space-between;font-size:20px;padding:16px 0}.cart textarea{min-height:72px;background:#0b1220;color:#fff;border:1px solid #334155;border-radius:10px;padding:10px}.cart-buttons{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:12px}
.admin-grid,.stats{padding:20px;display:grid;grid-template-columns:repeat(3,1fr);gap:16px}.panel,.stat{background:#1f2937;border:1px solid #334155;border-radius:16px;padding:18px}.panel input,.panel select{width:100%;padding:11px;margin-bottom:10px;border-radius:9px;border:1px solid #334155;background:#0b1220;color:#fff}.wide{grid-column:1/-1}.admin-row,.history-row{display:flex;justify-content:space-between;gap:10px;padding:10px 0;border-bottom:1px solid #334155}.stat strong{display:block;font-size:28px;margin-top:8px}
dialog{border:0;border-radius:18px;padding:0;width:min(390px,92vw)}dialog::backdrop{background:#0009}dialog form{display:grid;gap:12px;padding:22px}dialog label{display:grid;gap:6px;color:#111827}dialog input,dialog select{padding:10px;border:1px solid #aaa;border-radius:8px}.dialog-actions{display:flex;justify-content:flex-end;gap:8px}.payment-total{font-size:28px;font-weight:900;color:#111827;text-align:center}
@media(max-width:900px){
.order-layout{grid-template-columns:1fr}
.categories{display:flex;overflow:auto}
.category-btn{min-width:145px;margin-right:8px}
.admin-grid,.stats{grid-template-columns:1fr}
.canvas-wrap{height:calc(100dvh - 210px);min-height:420px}
.canvas-wrap #canvas{width:1100px;height:760px}
}
@media(max-width:620px){
header{align-items:flex-start;flex-direction:column}
.zone-bar{align-items:flex-start;flex-direction:column}
.canvas-wrap{height:calc(100dvh - 300px);min-height:380px;padding:10px}
.canvas-wrap #canvas{width:950px;height:700px}
.cart-buttons{grid-template-columns:1fr}
}

/* Correctif tablette : le plan peut défiler dans les deux sens. */
html,body{min-height:100%;overflow:auto}
.canvas-wrap{
  overflow-x:auto!important;
  overflow-y:auto!important;
  -webkit-overflow-scrolling:touch;
  touch-action:pan-x pan-y;
}
.canvas-wrap #canvas{
  flex:none;
  max-width:none;
  touch-action:pan-x pan-y;
}
.item{touch-action:none}
