/* ==============================================================================
   BOTECO DO ZÉ — DESIGN SYSTEM (DARK & GOLD PREMIUM)
   ============================================================================== */

:root {
  --bg: #0E1013;
  --bg-soft: #15181D;
  --bg-elev: #1C2027;
  --bg-elev-2: #22262E;
  
  --line: rgba(244, 241, 234, 0.08);
  --line-strong: rgba(244, 241, 234, 0.16);

  --text-primary: #F4F1EA;
  --text-secondary: #9FA3AC;
  --text-muted: #666B75;

  --gold: #D6A24C;
  --gold-dark: #8C6A2E;
  --gold-soft: rgba(214, 162, 76, 0.14);
  --gold-ink: #14110A;

  --cozinha: #C1552F;
  --cozinha-soft: rgba(193, 85, 47, 0.15);
  --bar: #3FA7B0;
  --bar-soft: rgba(63, 167, 176, 0.15);
  --churrasco: #A6392B;
  --churrasco-soft: rgba(166, 57, 43, 0.15);

  --success: #4C9A6A;
  --success-soft: rgba(76, 154, 106, 0.15);
  --danger: #D9564A;
  --danger-soft: rgba(217, 86, 74, 0.15);
  --warning: #D6A24C;

  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 999px;

  --font-main: 'Work Sans', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: 'Bricolage Grotesque', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.38);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.55);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-main);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text-primary);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: var(--font-main);
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
  font-size: inherit;
}

input, textarea, select {
  font-family: var(--font-main);
  color: var(--text-primary);
}

::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-thumb {
  background: var(--bg-elev-2);
  border-radius: 4px;
}

/* ==============================================================================
   COMPONENTES GERAIS
   ============================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 14.5px;
  min-height: 44px; /* Touch target */
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
}
.btn:active {
  transform: scale(0.97);
}
.btn:disabled {
  opacity: 0.45;
  pointer-events: none;
}
.btn-gold {
  background: var(--gold);
  color: var(--gold-ink);
  box-shadow: 0 4px 14px rgba(214, 162, 76, 0.25);
}
.btn-gold:hover {
  background: #E2B25F;
  box-shadow: 0 6px 18px rgba(214, 162, 76, 0.35);
}
.btn-ghost {
  background: var(--bg-elev);
  color: var(--text-primary);
  border: 1px solid var(--line-strong);
}
.btn-ghost:hover {
  background: var(--bg-elev-2);
  border-color: var(--gold-dark);
}
.btn-line {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--line);
}
.btn-line:hover {
  color: var(--text-primary);
  border-color: var(--line-strong);
}
.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid var(--danger);
}
.btn-danger:hover {
  background: var(--danger);
  color: #fff;
}
.btn-block {
  width: 100%;
}
.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
  min-height: 34px;
  border-radius: var(--radius-sm);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--line-strong);
  color: var(--text-secondary);
  background: var(--bg-soft);
  white-space: nowrap;
}
.pill.active {
  background: var(--gold);
  color: var(--gold-ink);
  border-color: var(--gold);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-kitchen, .badge-cozinha { background: var(--cozinha-soft); color: var(--cozinha); }
.badge-bar { background: var(--bar-soft); color: var(--bar); }
.badge-grill, .badge-churrasco { background: var(--churrasco-soft); color: var(--churrasco); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-gold, .badge-warning { background: var(--gold-soft); color: var(--gold); }

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.dot-on {
  background: var(--success);
  box-shadow: 0 0 0 3px var(--success-soft);
}
.dot-off {
  background: var(--text-muted);
}

.card {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.input, .textarea, .select {
  width: 100%;
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  padding: 13px 16px;
  font-size: 14.5px;
  outline: none;
  color: var(--text-primary);
  transition: border-color 0.15s ease;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px var(--gold-soft);
}
.textarea {
  resize: vertical;
  min-height: 90px;
}

.form-group {
  margin-bottom: 18px;
}
.form-group label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 7px;
  letter-spacing: 0.02em;
}
.form-group .hint {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 5px;
}

.toast-wrap {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: 90vw;
  width: 420px;
}
.toast {
  background: var(--bg-elev-2);
  border: 1px solid var(--gold);
  color: var(--text-primary);
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toastSlideDown 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.toast.success { border-color: var(--success); color: #B7F5CC; }
.toast.error { border-color: var(--danger); color: #FFB3AC; }

@keyframes toastSlideDown {
  from { opacity: 0; transform: translateY(-18px); }
  to { opacity: 1; transform: translateY(0); }
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 14px;
}
.empty-state-icon {
  font-size: 36px;
  margin-bottom: 12px;
  opacity: 0.6;
}

/* ==============================================================================
   LAYOUT CLIENTE (MOBILE FIRST & APP NATIVO)
   ============================================================================== */

.client-app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
  padding-bottom: env(safe-area-inset-bottom, 24px);
}

.client-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(14, 16, 19, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 14px 18px 8px;
  border-bottom: 1px solid var(--line);
}

.client-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--gold-ink);
  font-size: 18px;
  box-shadow: 0 4px 12px rgba(214, 162, 76, 0.3);
}
.brand-info h1 {
  font-size: 16px;
  line-height: 1.15;
}
.brand-info p {
  font-size: 11.5px;
  color: var(--text-muted);
}

.table-badge {
  background: var(--bg-elev);
  border: 1px solid var(--gold-dark);
  color: var(--gold);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.search-box {
  position: relative;
  margin-bottom: 12px;
}
.search-box input {
  width: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-full);
  padding: 10px 16px 10px 38px;
  font-size: 13.5px;
  color: var(--text-primary);
  outline: none;
  transition: all 0.2s ease;
}
.search-box input:focus {
  border-color: var(--gold);
  background: var(--bg-elev);
}
.search-box .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.category-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin: 0 -18px;
  padding-left: 18px;
  padding-right: 18px;
}
.cat-pill {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  transition: all 0.15s ease;
}
.cat-pill.active {
  background: var(--gold);
  color: var(--gold-ink);
  border-color: var(--gold);
  box-shadow: 0 2px 10px rgba(214, 162, 76, 0.25);
}

.menu-content {
  flex: 1;
  padding: 14px 18px 130px;
}

.category-section-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 700;
  margin: 20px 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.product-card {
  display: flex;
  gap: 14px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 12px;
  margin-bottom: 12px;
  transition: transform 0.15s ease, border-color 0.15s ease;
  position: relative;
}
.product-card:active {
  transform: scale(0.99);
}
.product-card:hover {
  border-color: var(--line-strong);
}
.product-img {
  width: 82px;
  height: 82px;
  border-radius: var(--radius-md);
  object-fit: cover;
  background: var(--bg-elev);
  flex-shrink: 0;
  border: 1px solid var(--line);
}
.product-placeholder {
  width: 82px;
  height: 82px;
  border-radius: var(--radius-md);
  background: var(--bg-elev);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: var(--text-muted);
  flex-shrink: 0;
  border: 1px solid var(--line);
}
.product-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.product-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text-primary);
}
.product-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}
.product-price {
  font-size: 15px;
  font-weight: 700;
  color: var(--gold);
}

.add-btn-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--gold-ink);
  font-weight: 700;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(214, 162, 76, 0.3);
  transition: transform 0.15s ease;
}
.add-btn-circle:active {
  transform: scale(0.9);
}

.qty-stepper {
  display: inline-flex;
  align-items: center;
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-full);
}
.qty-stepper button {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}
.qty-stepper .qty-val {
  width: 24px;
  text-align: center;
  font-weight: 700;
  font-size: 13.5px;
  color: var(--gold);
}

/* Floating Cart Sticky Bar */
.cart-floating-bar {
  position: fixed;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 36px);
  max-width: 444px;
  background: var(--gold);
  color: var(--gold-ink);
  padding: 15px 22px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 15px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.65), 0 2px 10px rgba(214, 162, 76, 0.4);
  z-index: 60;
  animation: floatIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes floatIn {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
.cart-floating-bar:active {
  transform: translate(-50%, 2px) scale(0.98);
}

/* Bottom Sheet Cart & Checkout */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.bottom-sheet {
  background: var(--bg-soft);
  width: 100%;
  max-width: 480px;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  border-top: 1px solid var(--line-strong);
  padding: 8px 20px calc(24px + env(safe-area-inset-bottom, 12px));
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.sheet-handle {
  width: 40px;
  height: 4px;
  background: var(--line-strong);
  border-radius: var(--radius-full);
  margin: 8px auto 16px;
}
.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.sheet-header h3 {
  font-size: 19px;
}
.sheet-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-elev);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.cart-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.cart-item-info {
  flex: 1;
  min-width: 0;
  padding-right: 12px;
}
.cart-item-name {
  font-weight: 600;
  font-size: 14.5px;
}
.cart-item-unit {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.cart-item-total {
  font-weight: 700;
  font-size: 15px;
  color: var(--gold);
  margin-left: 14px;
  white-space: nowrap;
}

.checkout-steps {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
}
.checkout-step-pill {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--line-strong);
}
.checkout-step-pill.done {
  background: var(--gold);
}

.cart-total-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  border-top: 1px solid var(--line-strong);
  margin-top: 8px;
  font-size: 16px;
  font-weight: 700;
}
.cart-total-summary .total-val {
  font-size: 22px;
  color: var(--gold);
  font-family: var(--font-display);
}

/* Confirmação de Pedido */
.order-success-screen {
  text-align: center;
  padding: 50px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.success-icon-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--success-soft);
  color: var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  margin-bottom: 20px;
  border: 1px solid var(--success);
}
.order-summary-box {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
  width: 100%;
  max-width: 360px;
  text-align: left;
  margin: 24px 0;
}
.order-summary-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 13.5px;
  color: var(--text-secondary);
}
.order-summary-row b {
  color: var(--text-primary);
}

/* ==============================================================================
   PAINEL OPERACIONAL STAFF (/staff)
   ============================================================================== */

.staff-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.staff-navbar {
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}
.staff-user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-elev-2);
  color: var(--gold);
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
}

.staff-container {
  max-width: 760px;
  margin: 0 auto;
  width: 100%;
  padding: 20px 18px 80px;
}

.staff-kpi-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}
.staff-kpi-chip {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}
.staff-kpi-chip .kpi-num {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
}
.staff-kpi-chip .kpi-lbl {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-top: 2px;
  font-weight: 600;
}

.staff-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  position: sticky;
  top: 70px;
  background: var(--bg);
  padding: 6px 0;
  z-index: 20;
}
.staff-tab-btn {
  flex: 1;
  padding: 10px 12px;
  border-radius: var(--radius-full);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-secondary);
  border: 1px solid var(--line-strong);
  background: var(--bg-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.staff-tab-btn.active-kitchen { background: var(--cozinha-soft); color: var(--cozinha); border-color: var(--cozinha); }
.staff-tab-btn.active-bar { background: var(--bar-soft); color: var(--bar); border-color: var(--bar); }
.staff-tab-btn.active-grill { background: var(--churrasco-soft); color: var(--churrasco); border-color: var(--churrasco); }

.ticket-card {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-bottom: 14px;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.ticket-card.status-NEW {
  border-left: 4px solid var(--danger);
}
.ticket-card.status-PREPARING {
  border-left: 4px solid var(--warning);
}
.ticket-card.status-READY {
  border-left: 4px solid var(--success);
}
.ticket-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}
.ticket-table-num {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.1;
}
.ticket-customer {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}
.ticket-items-box {
  background: var(--bg-elev);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 12px;
}
.ticket-items-box li {
  display: flex;
  justify-content: space-between;
  font-size: 14.5px;
  padding: 4px 0;
  list-style: none;
}
.ticket-notes {
  background: var(--gold-soft);
  border: 1px solid var(--gold-dark);
  color: var(--gold);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 13px;
  margin-bottom: 12px;
}

/* ==============================================================================
   PAINEL DO GESTOR (/admin)
   ============================================================================== */

.admin-layout {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: 250px;
  background: var(--bg-soft);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.admin-sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid var(--line);
}
.admin-nav {
  padding: 16px 12px;
  flex: 1;
}
.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
  transition: all 0.15s ease;
}
.admin-nav-item:hover {
  background: var(--bg-elev);
  color: var(--text-primary);
}
.admin-nav-item.active {
  background: var(--gold-soft);
  color: var(--gold);
  border: 1px solid var(--gold-dark);
}

.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.admin-topbar {
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.admin-content {
  padding: 28px;
  flex: 1;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
@media (max-width: 900px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .admin-sidebar { display: none; }
}

.kpi-card {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.kpi-label {
  font-size: 12px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.04em;
}
.kpi-value {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  margin-top: 8px;
  color: var(--text-primary);
}
.kpi-value.gold {
  color: var(--gold);
}

/* Mapa de Mesas */
.tables-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 14px;
}
.table-tile {
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  padding: 14px 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 140px;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.table-tile:hover {
  border-color: var(--gold-dark);
}
.table-tile.occupied {
  background: var(--gold-soft);
  border-color: var(--gold);
}
.table-tile-num {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
}
.table-tile-status {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  margin-top: 2px;
}
.table-tile-customer {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 4px;
}
.table-tile-total {
  font-size: 14px;
  font-weight: 700;
  color: var(--gold);
  margin-top: 6px;
}

/* Tabelas Administrativas */
.data-table-wrap {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow-x: auto;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}
.data-table th {
  background: var(--bg-elev);
  padding: 14px 18px;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--line-strong);
}
.data-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--text-secondary);
}
.data-table tr:hover td {
  background: rgba(244, 241, 234, 0.02);
  color: var(--text-primary);
}

/* Modal Genérico */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-box {
  background: var(--bg-soft);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xl);
  max-width: 520px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: var(--shadow-lg);
}

/* ==============================================================================
   QR CODE E IMPRESSÃO
   ============================================================================== */

.qr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}
.qr-print-card {
  background: #F4F1EA;
  color: #111;
  border-radius: var(--radius-lg);
  padding: 24px 18px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: var(--shadow-md);
  border: 2px solid #E2DED2;
  break-inside: avoid;
}
.qr-print-brand {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #222;
}
.qr-print-table {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  margin: 6px 0 14px;
  color: #0E1013;
}
.qr-canvas-box {
  width: 160px;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  padding: 10px;
  border-radius: var(--radius-md);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.1);
}
.qr-print-url {
  font-size: 10px;
  color: #666;
  margin-top: 12px;
  word-break: break-all;
}

@media print {
  body {
    background: #fff !important;
    color: #000 !important;
  }
  .admin-sidebar, .admin-topbar, .btn, .toast-wrap, .no-print {
    display: none !important;
  }
  .admin-main, .admin-content {
    padding: 0 !important;
    margin: 0 !important;
  }
  .qr-print-card {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
  }
}

/* ==============================================================================
   CLIENT APP & MESA GATE SYSTEM
   ============================================================================== */

.client-app {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 100vh;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  position: relative;
  box-sizing: border-box;
}

.mesa-gate-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  padding: 44px 20px 48px;
  text-align: center;
  box-sizing: border-box;
}

.mesa-brand-badge {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #F0C766 0%, #D6A24C 60%, #8C6A2E 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 28px;
  color: #14110A;
  box-shadow: 0 10px 28px rgba(214, 162, 76, 0.35);
  margin: 0 auto 20px;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.mesa-brand-badge:hover {
  transform: scale(1.08) rotate(-3deg);
}

.mesa-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  background: linear-gradient(180deg, #FFFFFF 30%, #D6A24C 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.mesa-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.55;
  max-width: 320px;
  margin: 0 auto 26px;
}

.mesa-direct-bar {
  width: 100%;
  max-width: 340px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-soft);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-full);
  padding: 5px 6px 5px 16px;
  margin-bottom: 24px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.mesa-direct-bar:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(214, 162, 76, 0.15);
}
.mesa-direct-bar input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 14px;
  color: var(--text-primary);
}
.mesa-direct-bar input::placeholder {
  color: var(--text-muted);
}
.mesa-direct-bar button {
  padding: 8px 18px;
  border-radius: var(--radius-full);
  background: var(--gold);
  color: var(--gold-ink);
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
  transition: opacity 0.2s, transform 0.1s;
}
.mesa-direct-bar button:active {
  transform: scale(0.96);
}

.mesa-section-title {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 340px;
}
.mesa-section-title::before,
.mesa-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

.mesa-grid {
  width: 100%;
  max-width: 340px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.mesa-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 8px;
  background: var(--bg-soft);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  text-decoration: none;
  position: relative;
  overflow: hidden;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.mesa-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: transparent;
  transition: background 0.2s;
}
.mesa-card:hover {
  background: var(--bg-elev-2);
  border-color: var(--gold);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 16px rgba(214, 162, 76, 0.2);
}
.mesa-card:hover::before {
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.mesa-card:active {
  transform: scale(0.97);
}

.mesa-num {
  font-size: 22px;
  font-weight: 800;
  color: var(--gold);
  font-family: var(--font-display);
  line-height: 1.1;
}

.mesa-lbl {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 3px;
}

.mesa-info-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  padding: 8px 14px;
  border-radius: var(--radius-full);
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
  max-width: 320px;
  margin: 0 auto 20px;
}

.mesa-footer-link {
  margin-top: 24px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
  width: 100%;
  max-width: 320px;
}
.mesa-footer-link a {
  font-size: 13px;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
}
.mesa-footer-link a:hover {
  color: var(--gold);
}

