/* Tableau de bord restaurant */
.login { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1.2rem; background: linear-gradient(160deg, #1c1917, #431407); }
.login .card { width: 100%; max-width: 400px; padding: 1.4rem; }
.logo-line { display: flex; align-items: center; gap: .6rem; color: #fff; font-size: 1.3rem; margin-bottom: 1rem; }
.logo-line img { width: 40px; height: 40px; border-radius: 10px; }
.seg { display: inline-flex; background: var(--bg); border-radius: 12px; padding: 3px; gap: 3px; border: 1px solid var(--line); }
.seg button { border: 0; background: transparent; padding: .5rem .9rem; border-radius: 9px; font: inherit; font-weight: 650; color: var(--ink2); cursor: pointer; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.login .seg { display: flex; } .login .seg button { flex: 1; }
.pin { font-size: 1.6rem; letter-spacing: .5em; text-align: center; }

.app { min-height: 100vh; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: .6rem; padding: calc(.6rem + env(safe-area-inset-top, 0px)) 1rem .6rem; background: #fff; border-bottom: 1px solid var(--line); }
.tlogo { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; flex: none; }
.tlogo.txt { display: grid; place-content: center; background: var(--brand); color: #fff; font-weight: 800; }
.tname { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.openbtn { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: .45rem .8rem; font: inherit; font-weight: 750; color: var(--muted); cursor: pointer; white-space: nowrap; }
.openbtn.on { background: #dcfce7; border-color: #86efac; color: #166534; }
.nav { display: flex; gap: .3rem; padding: .5rem 1rem; overflow-x: auto; background: #fff; border-bottom: 1px solid var(--line); scrollbar-width: none; position: sticky; top: 61px; z-index: 19; }
.nav a { flex: none; display: flex; align-items: center; gap: .4rem; padding: .5rem .85rem; border-radius: 11px; color: var(--ink2); font-weight: 650; }
.nav a.on { background: var(--ink); color: #fff; }
main#view { padding: 1rem; max-width: 1400px; margin: 0 auto; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.empty { color: var(--muted); text-align: center; padding: .6rem 0; }

/* Tableau des commandes */
.board-head { display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: .8rem; }
.board { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(250px, 1fr)); gap: .8rem; align-items: start; overflow-x: auto; }
.col { background: #f3eee9; border-radius: 16px; padding: .7rem; min-height: 50vh; }
.col h2 { font-size: .95rem; display: flex; justify-content: space-between; align-items: center; margin: .1rem .2rem .7rem; }
.count { background: var(--ink); color: #fff; border-radius: 99px; padding: .05rem .55rem; font-size: .8rem; }
.col-nouvelle { background: #e6efff; } .col-preparation { background: #fff4dc; } .col-prete { background: #e3f6e9; } .col-encaisser { background: #f3eee9; }
.oc { background: #fff; border-radius: 14px; padding: .75rem .8rem; margin-bottom: .6rem; box-shadow: 0 1px 3px rgba(0,0,0,.08); border: 2px solid transparent; animation: pop .25s; }
@keyframes pop { from { transform: scale(.96); opacity: .3; } }
.oc.late { border-color: #fca5a5; }
.late-t { color: var(--red); font-weight: 700; }
.onum { font-size: 1.25rem; }
.owhere { font-weight: 750; color: var(--brand-d); margin: .1rem 0 .3rem; }
.oitems { list-style: none; padding: 0; margin: 0 0 .4rem; font-size: 1rem; }
.oitems li { padding: .15rem 0; }
.oitems em { display: block; font-style: normal; font-size: .85rem; color: var(--red); font-weight: 650; margin-left: 1.6rem; }
.onote { background: #fef3c7; border-radius: 8px; padding: .35rem .5rem; font-size: .88rem; margin: .3rem 0; }
.opay { border-top: 1px dashed var(--line); padding-top: .45rem; margin-top: .3rem; }
.oact { margin-top: .55rem; }
.call { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; background: #fde68a; border-radius: 12px; padding: .65rem .9rem; margin-bottom: .6rem; font-size: 1rem; animation: pop .25s; }
.call .btn { margin-left: auto; }
.done-list { margin-top: 1rem; background: #fff; border-radius: 14px; border: 1px solid var(--line); padding: .7rem 1rem; }
.done-list summary { cursor: pointer; font-weight: 700; }
.done-row { padding: .45rem 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.bigtotal { font-size: 2.2rem; font-weight: 850; text-align: center; margin: .3rem 0 1rem; }
.paygrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .5rem; margin-bottom: .8rem; }
.verify { background: #fef3c7; border-radius: 12px; padding: .8rem; margin-bottom: 1rem; }
.verify code { font-size: 1.05rem; font-weight: 800; }
.printbtn { margin-bottom: .5rem; }
.quick h3 { margin: .8rem 0 .4rem; font-size: .9rem; color: var(--muted); }
.qgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .4rem; }
.qbtn { position: relative; border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: .6rem; text-align: left; font: inherit; cursor: pointer; display: flex; flex-direction: column; gap: .15rem; }
.qbtn span { font-size: .8rem; color: var(--muted); }
.qbtn em { position: absolute; top: .3rem; right: .4rem; font-style: normal; font-weight: 850; color: var(--brand); }
.qbtn.on { border-color: var(--brand); background: var(--brand-l); }

/* Menu */
.mi { display: flex; align-items: center; gap: .7rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.mi img, .mi .nophoto { width: 58px; height: 58px; border-radius: 12px; object-fit: cover; flex: none; background: var(--bg); display: grid; place-content: center; font-size: 1.4rem; }
.mi-body { background: none; border: 0; text-align: left; font: inherit; color: inherit; cursor: pointer; display: flex; flex-direction: column; padding: 0; }
.mi-body:disabled { cursor: default; }
.mi.off { opacity: .5; }
.switch { position: relative; width: 50px; height: 28px; margin: 0; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #d6d3d1; border-radius: 99px; transition: background .2s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; background: #fff; border-radius: 50%; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(22px); }
.photo-pick { height: 170px; border: 2px dashed var(--line); border-radius: 14px; display: grid; place-content: center; overflow: hidden; cursor: pointer; color: var(--muted); font-weight: 650; }
.photo-pick img { width: 100%; height: 170px; object-fit: cover; }
.logo-pick { width: 72px; height: 72px; border-radius: 16px; border: 2px dashed var(--line); display: grid; place-content: center; overflow: hidden; cursor: pointer; color: var(--muted); font-size: .8rem; flex: none; }
.logo-pick img { width: 72px; height: 72px; object-fit: cover; }

/* Tables */
.takeaway { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.takeaway .qr { width: 150px; flex: none; }
.link { display: block; background: var(--bg); padding: .5rem .7rem; border-radius: 10px; font-size: .85rem; margin: .4rem 0 .6rem; word-break: break-all; }
.tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .8rem; }
.tcard { text-align: center; margin: 0; }
.tcard .qr { width: 140px; margin: 0 auto .4rem; }
.qr svg { width: 100%; height: auto; display: block; }
.center-row { justify-content: center; margin-top: .4rem; }
.printzone { display: none; }

/* Ventes */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .8rem; }
.kpi { margin: 0; } .kpi span { color: var(--muted); font-size: .85rem; } .kpi b { display: block; font-size: 1.5rem; letter-spacing: -.02em; }
.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin-top: .8rem; }
.bar-row { padding: .45rem 0; border-bottom: 1px solid var(--line); }
.warn-t { color: var(--amber); margin-top: .6rem; }
.hbars { display: grid; grid-template-columns: repeat(24, 1fr); gap: 3px; height: 140px; align-items: end; }
.hbars div { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.hbars i { width: 100%; background: var(--brand); border-radius: 4px 4px 0 0; min-height: 2px; }
.hbars span { font-size: .65rem; color: var(--muted); height: 1rem; }
.dayrow { display: grid; grid-template-columns: 110px 1fr 120px; gap: .6rem; align-items: center; padding: .3rem 0; font-size: .9rem; }
.dayrow b { text-align: right; }
.dbar { background: var(--bg); border-radius: 6px; height: 14px; overflow: hidden; } .dbar i { display: block; height: 100%; background: var(--brand); }
.staff { padding: .55rem 0; border-bottom: 1px solid var(--line); } .staff.off { opacity: .5; }
.staff-form { margin-top: .8rem; } .staff-form input, .staff-form select { width: auto; flex: 1; min-width: 120px; margin: 0; }

@media (max-width: 760px) {
  .board { grid-template-columns: repeat(var(--cols, 4), 82vw); scroll-snap-type: x mandatory; }
  .col { scroll-snap-align: start; }
  .cols2 { grid-template-columns: 1fr; }
  .two { grid-template-columns: 1fr; gap: 0; }
  .top .small { display: none; }
}

/* Impression des QR codes (A4, 4 par page) */
@media print {
  body { background: #fff; }
  .app > header, .nav, #view > *:not(.printzone), #toasts { display: none !important; }
  main#view { padding: 0; }
  .printzone { display: grid !important; grid-template-columns: 1fr 1fr; gap: 8mm; }
  .pcard { border: 2px solid #000; border-radius: 6mm; padding: 6mm; text-align: center; break-inside: avoid; height: 128mm; display: flex; flex-direction: column; justify-content: space-between; }
  .pname { font-size: 18pt; font-weight: 800; }
  .pcard .qr { width: 62mm; margin: 0 auto; }
  .ptable { font-size: 22pt; font-weight: 900; }
  .phint { font-size: 11pt; } .pby { font-size: 8pt; color: #666; }
  @page { size: A4; margin: 10mm; }
}
