/* MEVQR — tableau de bord du restaurant */

.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.auth-card {
  width: 100%; max-width: 440px; background: var(--white); border-radius: 28px; padding: 32px 28px;
  box-shadow: 0 20px 50px rgba(120, 60, 30, .12); display: flex; flex-direction: column; gap: 18px;
}
.brand-mark { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 800; font-size: 24px; }
.brand-mark span { color: var(--terra); }
.tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); background: var(--cream); border-radius: 14px; padding: 4px; }
.tabs button { min-height: 44px; border: none; background: transparent; border-radius: 10px; font-weight: 700; cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--white); box-shadow: var(--shadow); }
.link-btn { background: none; border: none; color: var(--terra); font-weight: 700; cursor: pointer; padding: 8px 0; text-align: left; min-height: 44px; }
.form { display: flex; flex-direction: column; gap: 14px; }
.form-error { color: var(--red); font-weight: 600; font-size: 14px; }

.shell { min-height: 100vh; display: flex; flex-wrap: wrap; }
.side {
  flex: 1 1 230px; max-width: 100%; background: var(--ink); color: var(--white); padding: 24px 16px;
  display: flex; flex-direction: column; gap: 6px;
}
.side .brand-mark { padding: 0 8px 18px; color: var(--white); }
.side .brand-mark span { color: var(--saffron); }
.side a {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: 12px;
  color: #F3E3D6; text-decoration: none; font-weight: 600; font-size: 15px;
}
.side a[aria-current="page"] { background: var(--terra); color: var(--white); font-weight: 700; }
.side a .dot { margin-left: auto; min-width: 22px; height: 22px; border-radius: 11px; background: var(--saffron); color: var(--ink); font-size: 12px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; }
.side .spacer { flex: 1; }
.side .who { font-size: 13px; color: #CDBFB1; padding: 8px 12px; overflow-wrap: anywhere; }
.side .btn-ghost { background: transparent; color: #F3E3D6; border-color: #5A4A3E; }
@media (max-width: 760px) {
  .side { flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px; gap: 4px; }
  .side .brand-mark { padding: 0 8px; font-size: 20px; width: 100%; }
  .side .spacer, .side .who { display: none; }
  .side a { padding: 0 10px; font-size: 14px; }
}

.main { flex: 999 1 560px; min-width: 0; padding: 28px clamp(16px, 3vw, 36px) 64px; display: flex; flex-direction: column; gap: 22px; }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; }
.page-head h1 { font-size: clamp(26px, 3vw, 34px); }
.page-head .sub { color: var(--muted); font-size: 14px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }

.banner { border-radius: 16px; padding: 14px 16px; font-weight: 600; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.banner-wait { background: var(--amber-soft); color: #6A4100; }
.banner-demo { background: var(--ink); color: var(--white); }
.banner-demo a, .banner-demo button { color: var(--saffron); }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.kpi { background: var(--white); border-radius: 20px; padding: 18px; display: flex; flex-direction: column; gap: 4px; }
.kpi .k { font-size: 13px; color: var(--muted); font-weight: 600; }
.kpi .v { font-family: var(--font-display); font-size: 30px; font-weight: 800; }
.kpi .h { font-size: 12px; color: var(--muted); }

.panel { background: var(--white); border-radius: 22px; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.panel h2 { font-size: 20px; }
.seg { display: inline-flex; background: var(--cream); border-radius: 12px; padding: 4px; gap: 2px; }
.seg button { min-height: 40px; padding: 0 14px; border: none; border-radius: 9px; background: transparent; font-weight: 700; font-size: 14px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--white); box-shadow: var(--shadow); }

.order {
  display: flex; flex-wrap: wrap; align-items: flex-start; gap: 14px; border: 1px solid #F0E2D7; border-radius: 18px; padding: 14px 16px;
}
.order.is-new { border: 2px solid var(--terra); background: #FFF4EE; animation: arrive .6s ease; }
@keyframes arrive { from { transform: translateY(-6px); opacity: .3; } to { transform: none; opacity: 1; } }
.order .tbl {
  width: 56px; height: 56px; border-radius: 14px; background: var(--sand); flex: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 800; line-height: 1.05; text-align: center; font-size: 13px; padding: 4px;
}
.order.is-new .tbl { background: var(--terra); color: var(--white); }
.order .body { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.order .items { font-weight: 700; }
.order .meta { font-size: 13px; color: var(--muted); }
.order .note { font-size: 14px; background: var(--amber-soft); border-radius: 10px; padding: 6px 10px; align-self: flex-start; }
.order .right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.order .total { font-family: var(--font-display); font-size: 20px; font-weight: 800; }
.status { font-size: 12px; font-weight: 800; border-radius: 999px; padding: 4px 10px; }
.st-nouvelle { background: var(--terra-soft); color: var(--terra-dark); }
.st-en_cuisine { background: var(--amber-soft); color: #7A4B00; }
.st-servie { background: var(--green-soft); color: #1F5A3A; }
.st-annulee { background: #F2EAE6; color: var(--muted); text-decoration: line-through; }

.cat-list { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--cream); border: 1px solid var(--line); border-radius: 999px; padding: 4px 4px 4px 14px; font-weight: 700; }
.cat-chip button { width: 36px; height: 36px; border-radius: 50%; border: none; background: transparent; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.cat-chip button:hover { background: var(--white); }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; }
.inline-form .input { flex: 1 1 200px; width: auto; }

.dish-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid #F0E2D7; }
.dish-row:last-child { border-bottom: none; }
.dish-row .media { width: 64px; height: 64px; border-radius: 14px; flex: none; }
.dish-row .badge-video { display: none; }
.dish-row .info { flex: 1 1 200px; min-width: 0; }
.dish-row .name { font-weight: 800; }
.dish-row .price { color: var(--terra); font-weight: 800; }
.toggles { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.toggles .check { min-height: 36px; font-size: 14px; }
.tag-video { font-size: 11px; font-weight: 800; color: var(--terra-dark); background: var(--terra-soft); border-radius: 999px; padding: 2px 8px; margin-left: 6px; }

.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.qr-card { background: var(--white); border: 1px solid #F0E2D7; border-radius: 20px; padding: 16px; display: flex; flex-direction: column; gap: 10px; align-items: center; text-align: center; }
.qr-card .qr { width: 160px; height: 160px; }
.qr-card .lbl { font-family: var(--font-display); font-weight: 800; font-size: 20px; }
.qr-card .actions { justify-content: center; }

.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.media-pick { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.media-pick .media { width: 88px; height: 88px; border-radius: 14px; }
.media-pick .badge-video { display: none; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.empty-state { text-align: center; color: var(--muted); padding: 32px 16px; display: flex; flex-direction: column; gap: 12px; align-items: center; }

/* Impression des QR codes : 4 par page A4 */
#print-zone { display: none; }
@media print {
  @page { size: A4; margin: 10mm; }
  body > *:not(#print-zone) { display: none !important; }
  #print-zone { display: grid !important; grid-template-columns: repeat(2, 1fr); gap: 8mm; }
  .print-card {
    break-inside: avoid; border: 1.5mm solid #B84A24; border-radius: 6mm; padding: 8mm 6mm;
    display: flex; flex-direction: column; align-items: center; gap: 3mm; text-align: center; height: 128mm;
    font-family: var(--font-body); color: #2A1A12;
  }
  .print-card .resto { font-family: var(--font-display); font-weight: 800; font-size: 16pt; }
  .print-card .call { font-size: 13pt; font-weight: 700; color: #B84A24; }
  .print-card .qr { width: 62mm; height: 62mm; }
  .print-card .tbl { font-family: var(--font-display); font-weight: 800; font-size: 22pt; }
  .print-card .how { font-size: 10pt; color: #6B5447; }
  .print-card .pw { font-size: 9pt; color: #6B5447; margin-top: auto; }
}

@media (min-width: 761px) {
  #toast-zone { left: auto; right: 24px; transform: none; bottom: 24px; }
}
.qr-card .actions .btn { min-width: 44px; }
