﻿:root {
  --bg: #f3f5fb;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #dbe3ee;
  --ok: #15803d;
  --ok-bg: #ecfdf3;
  --err: #b91c1c;
  --err-bg: #fef2f2;
  --brand: #0f172a;
  --accent: #2563eb;
  --shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}
* { box-sizing: border-box; }
html {
  max-width: 100%;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  color: var(--text);
  max-width: 100%;
  overflow-x: hidden;
  padding-bottom: var(--safe-bottom);
  background:
    radial-gradient(1000px 400px at -5% -10%, #dbeafe 0%, transparent 55%),
    radial-gradient(1000px 380px at 105% -15%, #e0f2fe 0%, transparent 60%),
    var(--bg);
}
body.mobile-kiosk {
  min-height: 100dvh;
  overflow: hidden;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: calc(14px + var(--safe-top)) calc(18px + var(--safe-right)) 14px calc(18px + var(--safe-left));
  background: linear-gradient(95deg, #0f172a, #1e3a8a);
  color: #fff;
}
.topbar h1 { margin: 0; font-size: 1.05rem; }
.topbar a {
  color: #fff;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 600;
}
.container {
  width: min(1240px, 96%);
  max-width: 100%;
  margin: 16px auto 40px;
  display: grid;
  gap: 14px;
}
.card {
  max-width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow);
}
.card h2 { margin: 0 0 10px; font-size: 1.06rem; }
.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
}
.auth-wrap .card { width: min(480px, 100%); }
.toast {
  border-radius: 12px;
  border: 1px solid transparent;
  padding: 11px 12px;
  font-weight: 700;
  animation: fadeIn 0.2s ease;
}
.toast.success { background: var(--ok-bg); color: var(--ok); border-color: #86efac; }
.toast.error { background: var(--err-bg); color: var(--err); border-color: #fca5a5; }
@keyframes fadeIn { from {opacity:.4; transform:translateY(-2px);} to {opacity:1; transform:translateY(0);} }
form { display: grid; gap: 9px; }
.grid, .wizard-grid { grid-template-columns: 1fr; }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}
.stats-grid article {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  background: #f8fbff;
}
.stats-grid strong { display: block; font-size: 1.4rem; color: #0b3b99; }
.stats-grid span { color: var(--muted); font-size: 0.9rem; }
.step {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  background: #fcfdff;
}
.step > span { display: inline-block; font-size: 0.77rem; color: #1d4ed8; font-weight: 700; margin-bottom: 6px; }
.step label { display: block; font-size: 0.9rem; color: var(--muted); margin-bottom: 5px; }
label { display: block; font-size: 0.9rem; color: var(--muted); margin-bottom: 4px; }
input, select, button, textarea {
  width: 100%;
  min-height: 44px;
  border-radius: 11px;
  border: 1px solid var(--border);
  padding: 10px 11px;
  font-size: 16px;
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
}
input[type="checkbox"],
input[type="radio"] {
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  border-radius: 4px;
  appearance: auto;
  -webkit-appearance: checkbox;
  box-shadow: none;
}
input:focus, select:focus, textarea:focus, button:focus-visible {
  outline: none;
  border-color: #7dd3fc;
  box-shadow: 0 0 0 3px rgba(14,165,233,0.16);
}
button {
  border: none;
  color: #fff;
  font-weight: 700;
  background: linear-gradient(130deg, var(--brand), #1d4ed8);
  cursor: pointer;
  touch-action: manipulation;
}
button:hover { filter: brightness(1.04); }
button:disabled { opacity: 0.6; cursor: not-allowed; }
button.loading::after {
  content: '';
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,.5);
  border-top-color: #fff;
  border-radius: 50%;
  display: inline-block;
  margin-left: 8px;
  vertical-align: middle;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
button.danger { background: linear-gradient(130deg, #7f1d1d, #b91c1c); }
.btn-outline, .btn-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 999px;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  background: #eff6ff;
  padding: 0 12px;
  text-decoration: none;
  font-weight: 700;
  width: auto;
}
.palette-wrap { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.palette-chip {
  width: auto;
  min-height: 38px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}
.palette-chip span { width: 12px; height: 12px; border-radius: 999px; display: inline-block; }
.preview-card {
  margin-top: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  padding: 12px;
  background: #f8fafc;
}
.preview-card button { width: auto; min-width: 140px; }
.table-wrap { overflow: auto; max-width: 100%; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; min-width: 1060px; background: #fff; }
thead th { background: #eef2ff; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.55px; }
th, td { border-bottom: 1px solid var(--border); text-align: left; padding: 9px; vertical-align: top; }
details summary { cursor: pointer; font-weight: 700; color: #1d4ed8; margin: 6px 0; }
.inline, .inline-row, .inline-block { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.inline input, .inline-row input, .inline-row select, .inline-block input { width: auto; min-width: 170px; }
.inline button, .inline-row button, .inline-block button { width: auto; }
.compact-form { margin: 10px 0; }
.account-row {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) auto 1fr;
  gap: 8px;
  align-items: center;
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 10px;
  margin-bottom: 8px;
}
.badge { display: inline-flex; align-items: center; justify-content: center; min-height: 28px; padding: 0 10px; border-radius: 999px; font-size: 0.82rem; font-weight: 700; }
.badge.ok { color: #065f46; background: #d1fae5; }
.badge.off { color: #7f1d1d; background: #fee2e2; }
.tab-shell { padding-top: 10px; }
.tab-shell,
.tab-panel,
.stats-grid article,
.mini-card {
  min-width: 0;
}
.tab-nav { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.tab-btn { width: auto; min-height: 38px; padding: 0 12px; border-radius: 999px; border: 1px solid #bfdbfe; background: #eff6ff; color: #1d4ed8; font-weight: 700; }
.tab-btn.active { background: #1d4ed8; color: #fff; border-color: #1d4ed8; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.category-grid { display: grid; gap: 8px; }
.mini-card { border: 1px solid var(--border); border-radius: 12px; padding: 10px; background: #fff; }
.upload-zone {
  border: 2px dashed #bfdbfe;
  border-radius: 12px;
  padding: 12px;
  text-align: center;
  background: #f8fbff;
}
.upload-zone.dragover { border-color: #2563eb; background: #eff6ff; }
.upload-zone p { margin: 0 0 8px; color: var(--muted); }
.upload-zone input[type=file] { border: none; background: transparent; }
.upload-zone img { margin-top: 8px; width: 120px; height: 120px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); }
.dish-admin-list { display: grid; gap: 10px; }
.dish-admin-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 10px;
  background: #fff;
}
.dish-thumb { width: 90px; height: 90px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); display: grid; place-items: center; color: var(--muted); font-size: 0.75rem; }
.dish-thumb img { width: 100%; height: 100%; object-fit: cover; }
.dish-info h4 { margin: 0 0 4px; }
.dish-info p { margin: 0 0 6px; }
.dish-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; }
.modal {
  border: none;
  border-radius: 16px;
  width: min(760px, 95vw);
  padding: 0;
  box-shadow: 0 30px 60px rgba(15,23,42,0.3);
}
.modal::backdrop { background: rgba(2,6,23,0.55); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.modal form { padding: 14px; }
.empty-state {
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
  color: var(--muted);
  background: #f8fafc;
}
.live-feed-shell {
  position: relative;
  z-index: 1;
}
.live-feed-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  border-radius: 14px;
  padding: 14px 16px;
  border: 2px solid transparent;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.12);
  position: sticky;
  top: 74px;
  z-index: 36;
}
.live-feed-banner[hidden],
.tab-live-badge[hidden] {
  display: none !important;
}
.live-feed-banner strong {
  display: block;
  margin-bottom: 4px;
  font-size: 1rem;
}
.live-feed-banner p {
  margin: 0;
  color: inherit;
}
.live-feed-banner.is-order {
  background: linear-gradient(135deg, #fff1f2, #fee2e2);
  color: #991b1b;
  border-color: #fca5a5;
}
.live-feed-banner.is-reservation {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  color: #1d4ed8;
  border-color: #93c5fd;
}
.tab-live-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  vertical-align: middle;
}
.live-feed-actions {
  margin-top: 12px;
}
.live-feed-actions .muted {
  font-size: 0.9rem;
}
.caisse-install-tip {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #bfdbfe;
  background: linear-gradient(135deg, #eff6ff, #f8fbff);
}
.caisse-install-tip strong {
  display: block;
  margin-bottom: 4px;
  color: #1d4ed8;
}
.caisse-install-tip p {
  margin: 0;
  color: var(--text);
  line-height: 1.45;
}
.result-card code { background: #f1f5f9; border: 1px solid var(--border); padding: 3px 6px; border-radius: 8px; }
.hero-kicker { margin: 0; text-transform: uppercase; letter-spacing: 0.7px; font-size: 0.72rem; color: #1d4ed8; }
.muted { color: var(--muted); }
.loyalty-search-bar { margin: 10px 0 12px; }
.loyalty-history {
  margin-top: 8px;
  width: 100%;
}
.loyalty-history summary {
  cursor: pointer;
  font-weight: 700;
  color: #1d4ed8;
}
.history-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.history-list li {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  background: #f8fafc;
}
.history-list li span,
.history-list li small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}
.compact-history-card {
  margin-top: 12px;
  background: #f8fafc;
}
.compact-history-list {
  gap: 6px;
}
.compact-history-list > div {
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
}
.compact-history-list strong,
.compact-history-list span,
.compact-history-list small {
  display: block;
}
.compact-history-list span,
.compact-history-list small {
  color: var(--muted);
}
.live-alert-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(127, 29, 29, 0.78);
  backdrop-filter: blur(2px);
  z-index: 120;
}
.live-alert-overlay.show {
  display: flex;
  animation: liveAlertBackdrop .22s ease-out;
}
.live-alert-popup {
  width: min(540px, 100%);
  border-radius: 24px;
  padding: 22px;
  background: linear-gradient(145deg, #fff1f2 0%, #fee2e2 45%, #fecaca 100%);
  border: 3px solid #dc2626;
  box-shadow: 0 32px 80px rgba(127, 29, 29, 0.42);
  animation: liveAlertPulse 1.1s ease-in-out infinite alternate;
}
.live-alert-popup h2 {
  margin: 8px 0 10px;
  font-size: 1.9rem;
  line-height: 1.15;
  color: #7f1d1d;
}
.live-alert-popup p {
  font-size: 1.02rem;
  line-height: 1.5;
}
.live-alert-popup .hero-kicker {
  color: #b91c1c;
  font-size: .82rem;
}
.live-alert-popup button:not(.btn-outline) {
  background: linear-gradient(135deg, #991b1b, #dc2626);
}
.live-alert-popup .btn-outline {
  background: #fff;
  border-color: #fca5a5;
  color: #b91c1c;
}
@keyframes liveAlertBackdrop {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes liveAlertPulse {
  from { transform: scale(1); }
  to { transform: scale(1.015); }
}
.caisse-body {
  background:
    radial-gradient(900px 380px at -5% -10%, #dbeafe 0%, transparent 55%),
    radial-gradient(900px 380px at 105% -15%, #dcfce7 0%, transparent 60%),
    #eff4fb;
}
body.mobile-kiosk.caisse-body .topbar {
  position: sticky;
  top: 0;
  z-index: 60;
}
body.mobile-kiosk .caisse-layout {
  height: calc(100dvh - 84px - var(--safe-top));
  overflow-y: auto;
  padding-bottom: calc(20px + var(--safe-bottom));
}
.caisse-layout {
  width: min(1400px, 97%);
}
.caisse-hero .inline-row {
  align-items: stretch;
}
.caisse-hero-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}
.caisse-stats article strong {
  font-size: 1.7rem;
}
.caisse-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.caisse-reservation-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.caisse-column {
  min-height: 420px;
}
.caisse-column-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.caisse-column-head h2 {
  margin: 0;
}
.caisse-ticket-list {
  display: grid;
  gap: 10px;
}
.caisse-ticket {
  border-radius: 16px;
  padding: 14px;
  border: 1px solid var(--border);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
  background: #fff;
}
.caisse-ticket-pending {
  border-color: #f59e0b;
  background: linear-gradient(135deg, #fffbeb, #fff);
}
.caisse-ticket-preparing {
  border-color: #60a5fa;
  background: linear-gradient(135deg, #eff6ff, #fff);
}
.caisse-ticket-ready {
  border-color: #34d399;
  background: linear-gradient(135deg, #ecfdf5, #fff);
}
.caisse-ticket-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 8px;
}
.caisse-ticket-head strong {
  font-size: 1.05rem;
}
.caisse-ticket-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  color: var(--muted);
  font-size: .92rem;
}
.caisse-ticket-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f8fafc;
  border: 1px solid var(--border);
}
.caisse-actions {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.caisse-actions .btn-outline,
.caisse-actions button {
  width: 100%;
}
.internal-note-cell textarea {
  min-width: 0;
}
.internal-note-cell {
  min-width: 300px;
}
.stats-grid strong {
  overflow-wrap: anywhere;
}
.note-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  min-width: 0;
}
.note-form textarea {
  width: 100%;
  min-width: 0;
  resize: vertical;
}
.note-form .btn-outline,
.note-form button {
  width: 100%;
  justify-content: center;
}
.settings-check {
  display: flex;
  align-items: end;
}
.checkbox-field {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--text);
  font-weight: 600;
  min-height: 44px;
}
.checkbox-field span {
  color: var(--text);
}
@media (min-width: 900px) { .grid, .wizard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) { .account-row { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .container { width: calc(100% - 16px); margin: 12px auto 28px; }
  .card { padding: 13px; }
  .topbar { padding: calc(12px + var(--safe-top)) calc(14px + var(--safe-right)) 12px calc(14px + var(--safe-left)); }
  .topbar h1 { font-size: 1rem; }
  .dish-admin-card { grid-template-columns: 1fr; }
  .dish-thumb { width: 100%; height: 150px; }
}

.allergen-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0;
}
.allergen-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
  background: #f8fbff;
  color: #1e293b;
  width: auto;
  font-size: 0.84rem;
}
.allergen-chip input { min-height: auto; width: auto; }

.topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.admin-lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.admin-lang-btn {
  min-height: 32px;
  min-width: 44px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.3);
  background: rgba(255,255,255,.16);
  color: #fff;
  font-size: .76rem;
  font-weight: 800;
  padding: 0 10px;
}
.admin-lang-btn.active {
  background: #fff;
  color: #1d4ed8;
}

@media (max-width: 860px) {
  .tab-nav {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .tab-nav::-webkit-scrollbar {
    height: 6px;
  }

  .tab-nav::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
  }

  .tab-btn {
    flex: 0 0 auto;
  }
}

@media (max-width: 760px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .table-wrap table {
    min-width: 760px;
  }
}

@media (max-width: 1100px) {
  .caisse-columns {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .caisse-hero-head {
    flex-direction: column;
  }
  .caisse-hero-head > div:last-child {
    width: 100%;
  }
  .caisse-hero .inline-row {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }
  .caisse-hero .inline-row .btn-outline,
  .caisse-hero .inline-row button {
    width: 100%;
  }
  .live-alert-popup h2 {
    font-size: 1.35rem;
  }
}

@media (max-width: 640px) {
  .container {
    width: 94%;
  }

  .card {
    padding: 13px;
  }

  .tab-shell {
    overflow: hidden;
  }

  .tab-shell .tab-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-flow: row;
    gap: 8px;
    overflow-x: hidden;
    overflow-y: visible;
    padding-bottom: 2px;
    width: 100%;
  }

  .tab-shell .tab-btn {
    display: inline-flex;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100%;
    flex: none !important;
    min-height: 44px;
    padding: 8px 10px;
    white-space: normal;
    line-height: 1.2;
    text-align: center;
    justify-content: center;
  }

  .topbar {
    padding: calc(12px + var(--safe-top)) calc(14px + var(--safe-right)) 12px calc(14px + var(--safe-left));
  }

  .topbar h1 {
    font-size: 1rem;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .topbar-actions a {
    width: auto;
    max-width: 100%;
  }

  .dish-admin-card {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .inline-row,
  .inline,
  .inline-block {
    flex-direction: column;
    align-items: stretch;
  }

  .inline-row input,
  .inline-row select,
  .inline input,
  .inline-block input {
    width: 100%;
    min-width: 0;
  }

  .inline-row button,
  .inline button,
  .inline-block button,
  .btn-outline {
    width: 100%;
  }

  .table-wrap {
    overflow-x: auto;
    border: 0;
    background: transparent;
  }

  .live-feed-banner {
    flex-direction: column;
    align-items: stretch;
    top: calc(66px + var(--safe-top));
  }

  .caisse-layout {
    width: calc(100% - 12px);
    margin: 8px auto 24px;
    gap: 10px;
  }

  body.mobile-kiosk .caisse-layout {
    height: calc(100dvh - 78px - var(--safe-top));
    margin-top: 8px;
  }

  .caisse-hero {
    padding: 14px;
  }

  .caisse-hero-head h2 {
    font-size: 1.2rem;
    margin-bottom: 6px;
  }

  .caisse-hero-head p.muted {
    margin: 0;
    line-height: 1.45;
  }

  .caisse-stats article {
    padding: 12px;
  }

  .caisse-stats article strong {
    font-size: 1.45rem;
  }

  .caisse-columns,
  .caisse-reservation-columns {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .caisse-column {
    min-height: 0;
    padding: 14px;
  }

  .caisse-column-head {
    align-items: center;
    margin-bottom: 12px;
  }

  .caisse-column-head h2 {
    font-size: 1rem;
  }

  .caisse-ticket {
    padding: 12px;
    border-radius: 14px;
  }

  .caisse-ticket-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .caisse-ticket-head strong {
    font-size: 1rem;
    line-height: 1.3;
  }

  .caisse-ticket .muted {
    line-height: 1.4;
  }

  .caisse-ticket-meta {
    flex-direction: column;
    align-items: stretch;
  }

  .caisse-ticket-meta span {
    width: 100%;
    justify-content: flex-start;
  }

  .compact-history-card .compact-history-list {
    gap: 8px;
  }

  .table-wrap table,
  .table-wrap thead,
  .table-wrap tbody,
  .table-wrap tr,
  .table-wrap th,
  .table-wrap td {
    display: block;
    width: 100%;
  }

  .table-wrap thead {
    display: none;
  }

  .table-wrap table {
    min-width: 0;
    background: transparent;
  }

  .table-wrap tbody {
    display: grid;
    gap: 12px;
  }

  .table-wrap tr {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--shadow);
    overflow: hidden;
  }

  .table-wrap td {
    border-bottom: 1px solid var(--border);
    padding: 10px 12px;
  }

  .table-wrap td:last-child {
    border-bottom: 0;
  }

  .table-wrap td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
  }

  .table-wrap td form {
    width: 100%;
  }
  .internal-note-cell {
    min-width: 0;
  }

  #loyalty-scanner-shell .inline-row {
    gap: 10px;
  }

  #loyalty-qr-code {
    min-width: 0;
  }

  #loyalty-scanner-video {
    width: 100%;
    max-width: 100%;
    height: auto;
  }
}

@media (max-width: 520px) {
  .topbar.caisse-body,
  .caisse-body .topbar {
    gap: 8px;
  }

  .caisse-body .topbar {
    align-items: stretch;
  }

  .caisse-body .topbar h1 {
    font-size: .96rem;
    line-height: 1.3;
  }

  .caisse-body .topbar-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .caisse-body .topbar-actions a {
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .tab-shell .tab-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tab-shell .tab-btn {
    width: 100% !important;
    min-width: 0 !important;
    flex: none !important;
  }

  .mini-card,
  .step,
  .card {
    border-radius: 14px;
  }

  .table-wrap table { min-width: 0; }

  .caisse-layout {
    width: calc(100% - 10px);
  }

  body.mobile-kiosk .topbar {
    padding-bottom: 10px;
  }

  body.mobile-kiosk .caisse-layout {
    height: calc(100dvh - 132px - var(--safe-top));
  }

  .caisse-ticket {
    padding: 11px;
  }

  .live-alert-overlay {
    padding: 10px;
  }

  .live-alert-popup {
    width: 100%;
    min-height: min(72vh, 560px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 22px 18px calc(24px + var(--safe-bottom));
    border-radius: 24px;
  }

  .live-alert-popup h2 {
    font-size: 1.55rem;
  }

  .live-alert-popup p {
    font-size: 1.08rem;
  }

  .live-alert-popup .inline-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .live-alert-popup .inline-row button,
  .live-alert-popup .inline-row .btn-outline {
    width: 100%;
    min-height: 52px;
    font-size: 1rem;
  }
}

/* Safe visual polish */
.card {
  border-color: rgba(148, 163, 184, 0.22);
  box-shadow:
    0 12px 30px rgba(15, 23, 42, 0.08),
    0 1px 0 rgba(255, 255, 255, 0.72) inset;
}

.stats-grid article,
.mini-card,
.step,
.preview-card,
.caisse-ticket,
.compact-history-list > div {
  box-shadow:
    0 10px 24px rgba(15, 23, 42, 0.06),
    0 1px 0 rgba(255, 255, 255, 0.72) inset;
  border-color: rgba(148, 163, 184, 0.24);
}

.tab-btn,
.btn-outline,
.topbar a,
button {
  transition:
    transform .16s ease,
    box-shadow .18s ease,
    filter .18s ease,
    background-color .18s ease,
    border-color .18s ease;
}

.tab-btn:hover,
.btn-outline:hover,
.topbar a:hover,
button:hover {
  transform: translateY(-1px);
}

.tab-btn:not(.active) {
  background: linear-gradient(180deg, #f8fbff 0%, #eef5ff 100%);
}

.tab-btn.active {
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.28);
}

.btn-outline {
  background: linear-gradient(180deg, #f8fbff 0%, #ecf4ff 100%);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.10);
}

button {
  box-shadow: 0 12px 24px rgba(29, 78, 216, 0.22);
}

button.danger {
  box-shadow: 0 12px 24px rgba(185, 28, 28, 0.18);
}

input,
select,
textarea {
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

thead th {
  background: linear-gradient(180deg, #eef4ff 0%, #e7efff 100%);
  color: #334155;
}

.table-wrap tr:hover td {
  background: #fbfdff;
}

.badge {
  letter-spacing: .15px;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
}

.live-feed-banner {
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}

.caisse-ticket {
  position: relative;
}

.caisse-ticket::before {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  top: 0;
  height: 3px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.22);
}

.caisse-ticket-pending::before {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.caisse-ticket-preparing::before {
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

.caisse-ticket-ready::before {
  background: linear-gradient(90deg, #10b981, #34d399);
}

.note-form textarea,
.internal-note-cell textarea {
  min-height: 92px;
}

@media (max-width: 640px) {
  .card,
  .mini-card,
  .step {
    border-radius: 16px;
  }

  .tab-shell .tab-btn {
    min-height: 46px;
  }
}

/* Restaurant admin premium polish */
.tab-shell {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(247, 250, 255, 0.96) 100%);
  border: 1px solid rgba(148, 163, 184, 0.20);
  box-shadow:
    0 22px 50px rgba(15, 23, 42, 0.09),
    0 1px 0 rgba(255, 255, 255, 0.82) inset;
}

.tab-shell .tab-nav {
  position: sticky;
  top: calc(74px + var(--safe-top));
  z-index: 8;
  padding: 10px;
  margin: -4px -4px 14px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,.92) 0%, rgba(241,245,249,.88) 100%);
  border: 1px solid rgba(148, 163, 184, 0.16);
  backdrop-filter: blur(10px);
}

.tab-panel h2 {
  position: relative;
  display: inline-block;
  margin-bottom: 14px;
  padding-bottom: 6px;
  font-size: 1.18rem;
  letter-spacing: -0.02em;
}

.tab-panel h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 74%;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, #2563eb, transparent);
}

.tab-panel > .muted {
  margin-top: -4px;
  margin-bottom: 14px;
}

.stats-grid article {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #fbfdff 0%, #f3f8ff 100%);
}

.stats-grid article::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, #2563eb, #60a5fa);
  opacity: 0.95;
}

.stats-grid article strong {
  letter-spacing: -0.03em;
}

.mini-card,
.preview-card,
.upload-zone,
.empty-state {
  background: linear-gradient(180deg, rgba(255,255,255,.98) 0%, rgba(249,251,255,.98) 100%);
}

.section-head {
  margin-bottom: 14px;
}

.section-head .btn-outline {
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.10);
}

.dish-admin-card,
.table-wrap tr,
.account-row {
  background: linear-gradient(180deg, rgba(255,255,255,.98) 0%, rgba(249,251,255,.98) 100%);
}

.dish-admin-card {
  border-radius: 18px;
  box-shadow:
    0 14px 30px rgba(15, 23, 42, 0.07),
    0 1px 0 rgba(255, 255, 255, 0.82) inset;
}

.dish-thumb {
  border-radius: 14px;
}

.dish-info h4 {
  font-size: 1.02rem;
  letter-spacing: -0.015em;
}

.table-wrap {
  border-radius: 16px;
  overflow: hidden;
  box-shadow:
    0 16px 34px rgba(15, 23, 42, 0.06),
    0 1px 0 rgba(255, 255, 255, 0.85) inset;
}

.table-wrap td {
  background: transparent;
}

.table-wrap tbody tr:nth-child(odd) td {
  background: rgba(248, 250, 252, 0.55);
}

.table-wrap tbody tr:hover td {
  background: rgba(239, 246, 255, 0.78);
}

.internal-note-cell,
.note-form {
  min-width: 0;
}

.note-form textarea {
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.compact-history-card {
  background: linear-gradient(180deg, rgba(255,255,255,.98) 0%, rgba(247,250,255,.98) 100%);
}

.compact-history-list > div {
  border-style: solid;
}

.modal {
  border-radius: 20px;
  overflow: hidden;
}

.modal-head {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

@media (max-width: 860px) {
  .tab-shell .tab-nav {
    top: calc(70px + var(--safe-top));
  }
}

@media (max-width: 640px) {
  .tab-shell {
    padding-top: 8px;
  }

  .tab-shell .tab-nav {
    margin: 0 0 14px;
    padding: 8px;
    border-radius: 14px;
  }

  .tab-panel h2 {
    font-size: 1.08rem;
  }
}

body.review-prompt-open {
  overflow: hidden;
}

.review-prompt-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: auto;
  background: rgba(2, 6, 23, 0.38);
  backdrop-filter: blur(3px);
}

.review-prompt-card {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 91;
  pointer-events: auto;
  width: min(420px, calc(100vw - 28px));
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: linear-gradient(180deg, rgba(255,255,255,.99) 0%, rgba(247,250,255,.99) 100%);
  box-shadow: 0 28px 70px rgba(2, 6, 23, 0.22);
}

.review-prompt-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.10);
  border: 1px solid rgba(37, 99, 235, 0.18);
  color: #1d4ed8;
  font-weight: 800;
  font-size: 0.78rem;
}

.review-prompt-card h3 {
  margin: 12px 0 8px;
  font-size: clamp(1.12rem, 2.8vw, 1.35rem);
  line-height: 1.15;
  color: #0b1220;
}

.review-prompt-card p {
  margin: 0;
  color: #56667d;
  line-height: 1.5;
}

.review-prompt-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.review-prompt-actions .btn-outline,
.review-prompt-actions button,
.review-prompt-actions a {
  min-height: 46px;
  border-radius: 14px;
  padding: 0 16px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  pointer-events: auto;
  position: relative;
  z-index: 2;
}

.review-prompt-actions .btn-outline {
  flex: 1 1 45%;
}

.review-prompt-actions button:last-child,
.review-prompt-actions a:last-child {
  flex: 1 1 55%;
  border: 1px solid #2563eb;
  background: #2563eb;
  color: #fff;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.24);
}

@media (max-width: 640px) {
  .review-prompt-card {
    width: calc(100vw - 24px);
    padding: 16px;
    border-radius: 18px;
  }

  .review-prompt-actions {
    flex-direction: column;
  }
}
