/* ============================================================
   VARIABLES
   ============================================================ */
:root {
  --primary:        #FF6B35;
  --primary-dark:   #E05A26;
  --primary-light:  #FF8C5A;
  --bg:             #F7F7F5;
  --card:           #FFFFFF;
  --text:           #1C1C1E;
  --text-muted:     #8E8E93;
  --border:         #E5E5EA;
  --success:        #34C759;
  --warning:        #FF9500;
  --danger:         #FF3B30;
  --info:           #007AFF;
  --purple:         #6F42C1;
  --radius-sm:      8px;
  --radius-md:      12px;
  --radius-lg:      20px;
  --shadow-sm:      0 1px 4px rgba(0,0,0,.08);
  --shadow-md:      0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:      0 8px 32px rgba(0,0,0,.14);
  --font:           -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  outline: none;
}

a { color: var(--primary); text-decoration: none; }

/* ============================================================
   LAYOUT
   ============================================================ */
.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 16px;
}

.container-wide {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1 { font-size: 1.6rem; font-weight: 700; }
h2 { font-size: 1.25rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 600; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 20px;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: .95rem;
  cursor: pointer;
  transition: all .15s ease;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); border-color: var(--primary-dark); }

.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover:not(:disabled) { filter: brightness(.9); }

.btn-danger  { background: var(--danger);  color: #fff; border-color: var(--danger);  }
.btn-danger:hover:not(:disabled) { filter: brightness(.9); }

.btn-warning { background: var(--warning); color: #fff; border-color: var(--warning); }
.btn-warning:hover:not(:disabled) { filter: brightness(.9); }

.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-outline:hover:not(:disabled) { background: var(--bg); }

.btn-full { width: 100%; }
.btn-sm   { padding: 7px 12px; font-size: .85rem; }
.btn-xl   { padding: 18px 32px; font-size: 1.1rem; border-radius: var(--radius-lg); }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 16px;
}

/* ============================================================
   BADGE / STATUS
   ============================================================ */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: .75rem;
  font-weight: 600;
  color: #fff;
}

/* ============================================================
   TOAST
   ============================================================ */
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #1C1C1E;
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: .9rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  transition: transform .3s ease;
  z-index: 9999;
  max-width: 90vw;
  text-align: center;
}
#toast.show          { transform: translateX(-50%) translateY(0); }
#toast.toast-success { background: var(--success); }
#toast.toast-error   { background: var(--danger);  }
#toast.toast-warning { background: var(--warning); }
#toast.toast-info    { background: var(--info);    }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 1000;
  align-items: flex-end;
  justify-content: center;
}
.modal-overlay.open {
  display: flex;
  animation: fadeIn .2s ease;
}

.modal-sheet {
  background: var(--card);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 20px 16px 32px;
  width: 100%;
  max-width: 480px;
  max-height: 92vh;
  overflow-y: auto;
  animation: slideUp .25s ease;
}

.modal-sheet-center {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  margin: auto;
  animation: scaleIn .2s ease;
}

@keyframes fadeIn   { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp  { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes scaleIn  { from { transform: scale(.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ============================================================
   HEADER INTERNO
   ============================================================ */
.internal-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 800px;
  margin: 0 auto;
}

.header-brand { font-size: .95rem; font-weight: 700; color: var(--primary); }
.header-meta  { display: flex; align-items: center; gap: 10px; font-size: .8rem; }

#user-header {
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-name { font-weight: 600; font-size: .9rem; }
.user-role { font-size: .75rem; color: var(--text-muted); }

/* ============================================================
   CONNECTION STATUS
   ============================================================ */
.conn-status {
  font-size: .72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 100px;
}
.status-online     { background: #E8F9EE; color: #1a7a3a; }
.status-offline    { background: #FEE9E7; color: #b31c12; }
.status-connecting { background: #FFF3E0; color: #b35a00; }

#last-update { font-size: .72rem; color: var(--text-muted); }

/* ============================================================
   TABS (interno)
   ============================================================ */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  background: var(--card);
  position: sticky;
  top: 57px;
  z-index: 90;
}
.tab-btn {
  flex: 1;
  padding: 12px 8px;
  background: none;
  border: none;
  font-size: .85rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all .15s;
  position: relative;
}
.tab-btn .tab-count {
  display: inline-block;
  background: var(--danger);
  color: #fff;
  font-size: .7rem;
  padding: 1px 5px;
  border-radius: 100px;
  margin-left: 4px;
}
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-content { display: none; padding: 16px; }
.tab-content.active { display: block; }

/* ============================================================
   SECTION LABEL
   ============================================================ */
.section-label {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin: 16px 0 8px;
}
.section-label:first-child { margin-top: 0; }
.section-label-prep { color: var(--warning); }

/* ============================================================
   ORDER CARDS (garçom + copa)
   ============================================================ */
.order-card {
  background: var(--card);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--info);
}

.order-card.wait-warning  { border-left-color: var(--warning); }
.order-card.wait-critical { border-left-color: var(--danger); animation: pulse-border 1.5s infinite; }

@keyframes pulse-border {
  0%, 100% { box-shadow: var(--shadow-sm); }
  50%       { box-shadow: 0 0 0 3px rgba(255,59,48,.25); }
}

.order-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.order-table-badge {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
}

.order-elapsed {
  font-size: .78rem;
  color: var(--text-muted);
  margin-left: auto;
}

.order-product-name { font-size: 1rem; font-weight: 600; margin-bottom: 4px; }
.order-opts-detail  { font-size: .82rem; color: var(--text-muted); margin-bottom: 6px; }
.order-qty          { font-size: .85rem; margin-bottom: 4px; }
.order-time-placed  { font-size: .75rem; color: var(--text-muted); margin-bottom: 10px; }

.order-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.order-card-actions .btn { flex: 1; min-width: 80px; }

/* ============================================================
   CURRENT ORDER CARD (garçom)
   ============================================================ */
.current-order-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-md);
  border-top: 5px solid var(--primary);
  margin-bottom: 16px;
}

.current-order-card.wait-critical { border-top-color: var(--danger); }
.current-order-card.wait-warning  { border-top-color: var(--warning); }

.order-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}
.order-table  { font-size: 1.3rem; font-weight: 800; color: var(--primary); }
.order-time   { font-size: .78rem; color: var(--text-muted); }
.order-product { font-size: 1.1rem; font-weight: 700; margin-bottom: 6px; }
.order-opts   { font-size: .85rem; color: var(--text-muted); margin-bottom: 8px; }
.order-qty-price {
  display: flex;
  justify-content: space-between;
  font-size: .9rem;
  margin-bottom: 4px;
}
.order-total  { font-weight: 700; font-size: 1rem; }
.order-since  { font-size: .75rem; color: var(--text-muted); margin-bottom: 16px; }

.order-actions      { display: flex; flex-direction: column; gap: 8px; }
.order-actions-row  { display: flex; gap: 8px; }
.order-actions-row .btn { flex: 1; }

/* ============================================================
   CLAIM SECTION (garçom)
   ============================================================ */
.claim-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 32px 0;
}

.pending-badge {
  background: var(--primary);
  color: #fff;
  padding: 8px 20px;
  border-radius: 100px;
  font-weight: 700;
  font-size: .95rem;
  animation: pop-in .3s ease;
}

.no-orders-msg { color: var(--text-muted); font-size: .9rem; }
.claim-hint    { font-size: .8rem; color: var(--text-muted); text-align: center; }

@keyframes pop-in { from { transform: scale(.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.pulse { animation: pulse-scale .4s ease; }
@keyframes pulse-scale {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.12); }
  100% { transform: scale(1); }
}

/* ============================================================
   STUCK ALERT
   ============================================================ */
#stuck-alert {
  display: none;
  background: #FFF3CD;
  border: 1px solid var(--warning);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: .85rem;
  color: #856404;
  margin-bottom: 12px;
}

/* ============================================================
   DELIVERY CONFIRM OVERLAY
   ============================================================ */
.delivery-confirm-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}
.delivery-confirm-overlay.open { display: flex; animation: fadeIn .2s ease; }

.delivery-confirm-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  max-width: 340px;
  width: 90%;
  text-align: center;
}
.delivery-confirm-card h3 { margin-bottom: 12px; }
.delivery-confirm-card p  { color: var(--text-muted); font-size: .9rem; margin-bottom: 20px; }
.delivery-confirm-actions { display: flex; flex-direction: column; gap: 10px; }

/* ============================================================
   AVAILABILITY ROWS (copa + admin)
   ============================================================ */
.availability-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 8px;
  box-shadow: var(--shadow-sm);
}
.availability-row.unavailable { opacity: .6; }

.avail-product-info { display: flex; align-items: center; gap: 12px; }
.avail-color { width: 12px; height: 36px; border-radius: 4px; flex-shrink: 0; }
.avail-name  { font-weight: 600; }
.avail-type  { font-size: .78rem; color: var(--text-muted); }

/* Toggle switch */
.toggle-switch { position: relative; display: inline-block; width: 48px; height: 26px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 100px;
  cursor: pointer;
  transition: .2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px; height: 20px;
  left: 3px; top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.toggle-switch input:checked + .toggle-slider { background: var(--success); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(22px); }

/* ============================================================
   ADMIN — PRODUCTS LIST
   ============================================================ */
.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.admin-product-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 8px;
  box-shadow: var(--shadow-sm);
}
.admin-product-row.inactive-row { opacity: .55; }

/* Setinhas de ordenação */
.sort-arrows {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex-shrink: 0;
}
.sort-arrow-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: .6rem;
  line-height: 1;
  padding: 2px 4px;
  cursor: pointer;
  border-radius: 4px;
  transition: color .12s, background .12s;
  -webkit-tap-highlight-color: transparent;
}
.sort-arrow-btn:hover:not(:disabled) { color: var(--primary); background: rgba(255,107,53,.08); }
.sort-arrow-btn:active:not(:disabled) { color: var(--primary-dark); }
.sort-arrow-btn:disabled { opacity: .2; cursor: default; }

.admin-product-color { width: 10px; height: 40px; border-radius: 4px; flex-shrink: 0; }
.admin-product-info  { flex: 1; min-width: 0; }
.admin-product-name  { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-product-meta  { font-size: .78rem; color: var(--text-muted); }
.avail-yes { color: var(--success); }
.avail-no  { color: var(--danger); }
.admin-product-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* ============================================================
   ADMIN — PROFILES LIST
   ============================================================ */
.admin-profile-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 8px;
  box-shadow: var(--shadow-sm);
}
.admin-profile-row.inactive-row { opacity: .55; }
.profile-name { font-weight: 600; }
.profile-meta { font-size: .78rem; color: var(--text-muted); }

/* ============================================================
   ADMIN — TABLES LIST
   ============================================================ */
.admin-table-row {
  background: var(--card);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 8px;
  box-shadow: var(--shadow-sm);
}
.table-info   { font-weight: 600; margin-bottom: 6px; }
.table-url    { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.token-url    { font-size: .72rem; color: var(--text-muted); word-break: break-all; flex: 1; }

/* ============================================================
   FORMS
   ============================================================ */
.form-group  { margin-bottom: 14px; }
.form-group label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 5px; color: var(--text-muted); }
.form-input  {
  width: 100%;
  padding: 11px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-size: .95rem;
  transition: border-color .15s;
}
.form-input:focus  { border-color: var(--primary); }
.form-input[type="color"] { padding: 4px; height: 40px; cursor: pointer; }
.form-row    { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-check { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.check-label { display: flex; align-items: center; gap: 6px; font-size: .85rem; font-weight: 600; cursor: pointer; }
.form-divider { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
.form-hint { font-size: .78rem; color: var(--text-muted); margin-top: 4px; display: block; }

/* ============================================================
   OPTION GROUP EDITOR (admin)
   ============================================================ */
.option-groups-section { margin-top: 4px; }
.option-groups-header  { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.option-group-editor   {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 10px;
}
.og-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }

/* ============================================================
   INFO BOX
   ============================================================ */
.info-box {
  background: #EBF4FF;
  border: 1px solid #C3DCFF;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: .85rem;
  color: #1a4d80;
  margin-bottom: 16px;
}

/* ============================================================
   MESA PAGE — HEADER
   ============================================================ */
.mesa-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  padding: 18px 16px 14px;
  text-align: center;
}
.mesa-restaurant-name { font-size: .78rem; font-weight: 700; opacity: .75; letter-spacing: .08em; text-transform: uppercase; }
.mesa-table-number    { font-size: 2rem; font-weight: 800; line-height: 1.2; letter-spacing: -.02em; }
.mesa-table-check     { font-size: .75rem; opacity: .7; margin-top: 3px; }
.mesa-subtitle {
  background: var(--bg);
  padding: 10px 16px 0;
  text-align: center;
  font-weight: 700;
  font-size: .78rem;
  color: var(--text-muted);
  letter-spacing: .07em;
  text-transform: uppercase;
}

/* ============================================================
   PRODUCT CARDS (mesa)
   ============================================================ */
.products-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 16px;
}

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

.product-card {
  background: var(--card);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,.07);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform .12s, box-shadow .12s;
  -webkit-tap-highlight-color: transparent;
}
.product-card:active { transform: scale(.96); box-shadow: 0 1px 4px rgba(0,0,0,.06); }

.product-color-bar { height: 6px; flex-shrink: 0; }
.product-img   { width: 100%; height: 96px; object-fit: cover; }
.product-icon  {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.product-icon-letter { font-size: 2.2rem; font-weight: 800; }
.product-info  { padding: 10px 10px 6px; flex: 1; }
.product-name  { font-weight: 700; font-size: .88rem; margin-bottom: 2px; line-height: 1.3; }
.product-desc  { font-size: .72rem; color: var(--text-muted); margin-bottom: 6px; line-height: 1.4; }
.product-price { font-size: .95rem; font-weight: 800; color: var(--primary); }
.product-card .btn {
  margin: 8px 10px 10px;
  padding: 10px;
  font-size: .85rem;
  border-radius: var(--radius-sm);
  width: calc(100% - 20px); /* override btn-full: evita overflow com as margens laterais */
  align-self: center;
}

/* ============================================================
   MODAL — PRODUTO
   ============================================================ */
.modal-product-header {
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.modal-product-name   { font-size: 1.2rem; font-weight: 800; margin-bottom: 3px; }
.modal-product-desc   { font-size: .87rem; color: var(--text-muted); margin-bottom: 8px; line-height: 1.4; }
.modal-product-price  { font-size: 1.15rem; font-weight: 800; color: var(--primary); }

/* Option groups (modal) */
.option-group { margin-bottom: 18px; }
.option-group-name {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.required-badge {
  font-size: .68rem;
  background: var(--danger);
  color: #fff;
  padding: 2px 7px;
  border-radius: 100px;
  text-transform: none;
  letter-spacing: 0;
}

.option-list { display: flex; flex-wrap: wrap; gap: 8px; }
.option-item {
  display: flex;
  align-items: center;
  cursor: pointer;
}
.option-item input { display: none; }
.option-label {
  padding: 10px 18px;
  border: 2px solid var(--border);
  border-radius: 100px;
  font-size: .88rem;
  font-weight: 600;
  transition: all .15s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.option-item input:checked + .option-label {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

/* Quantity selector */
.qty-section { margin: 16px 0 8px; }
.qty-label   { font-weight: 600; font-size: .85rem; color: var(--text-muted); margin-bottom: 10px; display: block; }

.quantity-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  width: fit-content;
}
.qty-btn {
  width: 48px;
  height: 48px;
  background: var(--bg);
  border: none;
  font-size: 1.4rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--text);
  transition: background .15s;
}
.qty-btn:active { background: var(--border); }
.qty-value {
  min-width: 52px;
  text-align: center;
  font-size: 1.2rem;
  font-weight: 700;
  padding: 0 8px;
}

.modal-total {
  text-align: center;
  font-size: 1rem;
  color: var(--text-muted);
  margin: 12px 0 16px;
}
.modal-total strong { color: var(--primary); font-size: 1.2rem; }

.modal-actions { display: flex; gap: 10px; }
.modal-actions .btn { flex: 1; }

/* ============================================================
   CONFIRMATION SCREEN
   ============================================================ */
#confirmation-screen {
  display: none;
  min-height: 100vh;
  background: var(--bg);
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.confirmation-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
  max-width: 380px;
  width: 100%;
  box-shadow: var(--shadow-lg);
}

.confirmation-icon {
  width: 64px; height: 64px;
  background: var(--success);
  color: #fff;
  font-size: 1.8rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.confirmation-title  { font-size: 1.5rem; font-weight: 800; margin-bottom: 16px; }
.confirmation-detail { background: var(--bg); border-radius: var(--radius-md); padding: 14px; margin-bottom: 16px; }
.conf-row   { font-size: .9rem; margin-bottom: 6px; text-align: left; }
.conf-opts  { color: var(--text-muted); font-size: .82rem; }
.confirmation-msg  { font-size: .95rem; color: var(--text-muted); margin-bottom: 20px; }
.confirmation-hint { font-size: .78rem; color: var(--text-muted); margin-top: 14px; }

/* ============================================================
   ERROR / EMPTY
   ============================================================ */
.error-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: 12px;
  text-align: center;
  padding: 24px;
}
.error-icon { font-size: 3rem; color: var(--danger); }
.empty-msg  { color: var(--text-muted); font-size: .9rem; padding: 24px; text-align: center; }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: linear-gradient(135deg, #FF6B35 0%, #E05A26 100%);
}

.login-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-lg);
}

.login-logo   { text-align: center; margin-bottom: 24px; }
.login-logo h1 { font-size: 1.5rem; font-weight: 800; color: var(--primary); }
.login-logo p  { font-size: .85rem; color: var(--text-muted); margin-top: 4px; }

.login-form .form-group { margin-bottom: 16px; }
.login-error { color: var(--danger); font-size: .85rem; text-align: center; margin-top: 10px; min-height: 20px; }

/* ============================================================
   INDEX PAGE
   ============================================================ */
.index-page { padding: 32px 16px; max-width: 480px; margin: 0 auto; }
.index-page h1 { color: var(--primary); margin-bottom: 8px; }
.index-page p  { color: var(--text-muted); margin-bottom: 24px; }

.quick-links { display: flex; flex-direction: column; gap: 10px; }
.quick-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  transition: box-shadow .15s;
}
.quick-link:hover { box-shadow: var(--shadow-md); }
.quick-link .arrow { color: var(--text-muted); }

.mesa-links-section { margin-top: 24px; }
.mesa-links-section h3 { margin-bottom: 10px; color: var(--text-muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; }
.mesa-links { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.mesa-link  {
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 10px 4px;
  text-align: center;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}
.mesa-link:hover { background: var(--primary); color: #fff; }

/* ============================================================
   UTIL
   ============================================================ */
.text-center { text-align: center; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.gap-8 { gap: 8px; }

/* ============================================================
   SCROLLBAR (webkit)
   ============================================================ */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }

/* ============================================================
   MENU EM ESCADA (mesa)
   ============================================================ */
.menu-container { /* wrapper neutro */ }

@keyframes slideEnter        { from { transform: translateX(28px);  opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideEnterReverse { from { transform: translateX(-28px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.slide-enter         { animation: slideEnter        .2s cubic-bezier(.25,.46,.45,.94); }
.slide-enter-reverse { animation: slideEnterReverse .2s cubic-bezier(.25,.46,.45,.94); }

/* --- Nível 1: grid de categorias --- */
.category-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 14px 16px 20px;
}

.category-btn {
  background: var(--cat-color, var(--primary));
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 26px 12px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0,0,0,.16);
  transition: transform .12s, box-shadow .12s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.category-btn:active { transform: scale(.95); box-shadow: 0 2px 8px rgba(0,0,0,.12); }

.category-emoji {
  font-size: 2.6rem;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.2));
}
.category-label { font-size: .95rem; font-weight: 700; letter-spacing: .01em; }

/* --- Barra de navegação (back + breadcrumb) --- */
.menu-nav-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.menu-back-btn {
  display: flex;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  color: var(--primary);
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  padding: 6px 0;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.menu-back-btn:active { opacity: .55; }

.menu-breadcrumb-text {
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- Nível 2: lista de subcategorias --- */
.subcategory-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px 20px;
}

.subcategory-btn {
  background: var(--card);
  border: none;
  border-radius: var(--radius-md);
  padding: 0;
  display: flex;
  align-items: stretch;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,.07);
  transition: transform .12s, box-shadow .12s;
  width: 100%;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.subcategory-btn:active { transform: scale(.98); box-shadow: 0 1px 4px rgba(0,0,0,.06); }

/* Faixa colorida lateral */
.subcategory-btn::before {
  content: '';
  width: 5px;
  background: var(--cat-color, var(--primary));
  flex-shrink: 0;
}

.subcategory-content {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 14px;
  flex: 1;
}
.subcategory-emoji { font-size: 1.9rem; line-height: 1; }
.subcategory-text  { text-align: left; flex: 1; }
.subcategory-label { font-size: 1rem; font-weight: 700; color: var(--text); }
.subcategory-desc  { font-size: .78rem; color: var(--text-muted); margin-top: 2px; }
.subcategory-arrow {
  font-size: 1.3rem;
  color: var(--text-muted);
  padding-right: 14px;
  align-self: center;
}

/* --- Nível 3: grid de produtos --- */
.products-inner-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 14px 16px 40px; /* aumentado para não cortar último card */
}
@media (max-width: 360px) { .products-inner-grid { grid-template-columns: 1fr; } }

/* Mais espaço quando carrinho estiver visível */
body.has-cart .products-inner-grid { padding-bottom: 100px; }

/* --- Skeleton de carregamento --- */
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}
.skeleton-card {
  background: var(--card);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,.07);
}
.skeleton-bar {
  background: linear-gradient(90deg, #ececec 25%, #d8d8d8 50%, #ececec 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease infinite;
}
.skeleton-top    { height: 6px; }
.skeleton-icon   { height: 76px; }
.skeleton-line   { height: 12px; border-radius: 6px; margin: 10px 10px 6px; }
.skeleton-line-sm{ height: 10px; border-radius: 6px; margin: 0 10px 10px; width: 55%; }
.skeleton-btn    { height: 34px; border-radius: var(--radius-sm); margin: 8px 10px 10px; }

/* ============================================================
   CART BAR (mesa — fixa no rodapé)
   ============================================================ */
.cart-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 500;
  background: var(--primary);
  color: #fff;
  padding: 12px 16px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transform: translateY(100%);
  transition: transform .28s cubic-bezier(.25,.46,.45,.94);
  box-shadow: 0 -4px 20px rgba(0,0,0,.2);
}
.cart-bar.visible { transform: translateY(0); }

.cart-bar-info   { display: flex; flex-direction: column; gap: 1px; }
.cart-bar-count  { font-size: .78rem; opacity: .8; }
.cart-bar-total  { font-size: 1.1rem; font-weight: 800; letter-spacing: -.01em; }

.cart-bar-btn {
  background: #fff;
  color: var(--primary);
  border: none;
  border-radius: var(--radius-md);
  padding: 10px 18px;
  font-weight: 700;
  font-size: .9rem;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  flex-shrink: 0;
}
.cart-bar-btn:active { opacity: .82; }

/* Padding no conteúdo quando barra está visível */
body.has-cart #main-content { padding-bottom: 76px; }

/* ============================================================
   CART MODAL (mesa)
   ============================================================ */
.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.cart-close-btn {
  background: var(--bg);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: .95rem;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.cart-close-btn:active { background: var(--border); }

.cart-items { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }

.cart-item {
  display: flex;
  align-items: stretch;
  background: var(--bg);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.cart-item-color-bar { width: 5px; flex-shrink: 0; }
.cart-item-info      { flex: 1; padding: 10px 12px; min-width: 0; }
.cart-item-name      { font-weight: 700; font-size: .92rem; margin-bottom: 2px; }
.cart-item-opts      { font-size: .76rem; color: var(--text-muted); margin-bottom: 4px; }
.cart-item-qty-row   { display: flex; align-items: center; gap: 8px; }
.cart-item-qty       { font-size: .82rem; color: var(--text-muted); }
.cart-item-price     { font-size: .95rem; font-weight: 700; color: var(--primary); }

.cart-remove-btn {
  background: none;
  border: none;
  padding: 0 14px;
  font-size: 1rem;
  cursor: pointer;
  color: var(--text-muted);
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.cart-remove-btn:active { color: var(--danger); }

.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  font-size: 1rem;
  margin-bottom: 16px;
}
.cart-total-row strong { font-size: 1.15rem; color: var(--primary); }

.cart-actions { display: flex; gap: 10px; }
.cart-actions .btn { flex: 1; }

/* ============================================================
   CONFIRMATION — múltiplos itens
   ============================================================ */
.conf-mesa        { font-size: 1rem; font-weight: 700; margin-bottom: 8px; }
.conf-order-item  {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .9rem;
  margin-bottom: 2px;
}
.conf-total-row   {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  margin-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 1rem;
}
.conf-total-row strong { color: var(--primary); font-size: 1.1rem; }
.conf-warning     { color: var(--warning); font-size: .82rem; margin-top: 6px; }

/* ============================================================
   ADMIN — MODAL SHEET LARGO
   ============================================================ */
.admin-modal-sheet {
  max-width: 600px;
  margin: 0 auto;
}

.modal-drag-handle {
  width: 40px; height: 4px;
  background: var(--border);
  border-radius: 100px;
  margin: 0 auto 12px;
}

.admin-form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.admin-form-header h2,
.admin-form-header h3 { font-size: 1.15rem; }

.modal-close-x {
  background: var(--bg);
  border: none;
  border-radius: 50%;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  font-size: .95rem;
  cursor: pointer;
  color: var(--text-muted);
  flex-shrink: 0;
}
.modal-close-x:active { background: var(--border); }

/* ============================================================
   ADMIN — FORM SECTIONS
   ============================================================ */
.form-section {
  background: var(--bg);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 12px;
}
.form-section-title {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.optional-tag {
  font-size: .7rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--border);
  padding: 1px 6px;
  border-radius: 100px;
  margin-left: 4px;
  text-transform: none;
  letter-spacing: 0;
}

/* Prefix input (R$) */
.input-prefix-wrap { position: relative; }
.input-prefix {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  font-size: .9rem;
  font-weight: 600;
  color: var(--text-muted);
  pointer-events: none;
}
.input-with-prefix { padding-left: 34px; }

/* Form actions row */
.form-actions {
  display: flex;
  gap: 10px;
  padding-top: 8px;
  margin-top: 4px;
}
.btn-outline-danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger);
}
.btn-outline-danger:hover:not(:disabled) { background: #FFF0EF; }

/* ============================================================
   ADMIN — COLOR PRESETS
   ============================================================ */
.color-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.color-swatch {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  transition: transform .12s, border-color .12s;
  flex-shrink: 0;
}
.color-swatch:active { transform: scale(.88); }
.color-swatch.active {
  border-color: var(--text);
  transform: scale(1.15);
}

.color-custom-input {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 2px dashed var(--border);
  padding: 2px;
  cursor: pointer;
  background: none;
  flex-shrink: 0;
}

/* ============================================================
   ADMIN — CATEGORY PICKER
   ============================================================ */
.category-picker-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 4px;
}
@media (max-width: 400px) { .category-picker-grid { grid-template-columns: repeat(2, 1fr); } }

.category-pick-btn {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all .15s;
  -webkit-tap-highlight-color: transparent;
}
.category-pick-btn.active {
  border-color: var(--pick-color, var(--primary));
  background: color-mix(in srgb, var(--pick-color, var(--primary)) 10%, white);
}
.category-pick-btn:active { transform: scale(.95); }

.pick-emoji { font-size: 1.6rem; line-height: 1; }
.pick-label { font-size: .75rem; font-weight: 600; color: var(--text); }

/* Subcategorias */
.subcat-section { margin-top: 12px; }
.subcat-label { font-size: .8rem; font-weight: 600; color: var(--text-muted); display: block; margin-bottom: 8px; }
.subcat-pills { display: flex; flex-wrap: wrap; gap: 8px; }

.subcat-pill {
  padding: 7px 14px;
  border: 2px solid var(--border);
  border-radius: 100px;
  background: var(--card);
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  -webkit-tap-highlight-color: transparent;
}
.subcat-pill.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}
.subcat-pill:active { transform: scale(.96); }

/* ============================================================
   ADMIN — FLOW TYPE PICKER
   ============================================================ */
.flow-type-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.flow-card {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  cursor: pointer;
  text-align: left;
  transition: all .15s;
  -webkit-tap-highlight-color: transparent;
}
.flow-card.active {
  border-color: var(--primary);
  background: #FFF3EE;
}
.flow-card:active { transform: scale(.97); }
.flow-card-icon  { font-size: 1.5rem; margin-bottom: 4px; }
.flow-card-title { font-size: .9rem; font-weight: 700; color: var(--text); }
.flow-card-desc  { font-size: .75rem; color: var(--text-muted); line-height: 1.4; }

/* ============================================================
   ADMIN — OPTION GROUP CARDS
   ============================================================ */
.og-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 10px;
}

.og-card-header {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}
.og-name-input { flex: 1; font-weight: 600; }
.og-delete-btn {
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  flex-shrink: 0;
}
.og-delete-btn:hover { background: #FFF0EF; color: var(--danger); }

.og-meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.og-type-selector {
  display: flex;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.og-type-btn {
  padding: 6px 12px;
  background: none;
  border: none;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
}
.og-type-btn.active {
  background: var(--primary);
  color: #fff;
}

.og-required-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .83rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-muted);
}
.og-required-label input:checked + span { color: var(--text); }

.og-options-area { }

.og-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 32px;
  margin-bottom: 10px;
}

.option-chip-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--primary);
  color: #fff;
  padding: 5px 10px 5px 12px;
  border-radius: 100px;
  font-size: .82rem;
  font-weight: 600;
}
.chip-x-btn {
  background: rgba(255,255,255,.3);
  border: none;
  border-radius: 50%;
  width: 16px; height: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem;
  cursor: pointer;
  color: #fff;
  line-height: 1;
  padding: 0;
  flex-shrink: 0;
}
.chip-x-btn:hover { background: rgba(255,255,255,.5); }

.no-opts-hint {
  font-size: .78rem;
  color: var(--text-muted);
  font-style: italic;
}

.add-option-row {
  display: flex;
  gap: 6px;
  align-items: center;
}
.add-option-input { flex: 1; font-size: .88rem; }
.add-option-btn {
  width: 36px; height: 38px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1.3rem;
  font-weight: 400;
  cursor: pointer;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.add-option-btn:active { background: var(--primary-dark); }

.empty-hint {
  font-size: .83rem;
  color: var(--text-muted);
  text-align: center;
  padding: 16px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
}

/* ============================================================
   ADMIN — STATUS TOGGLES
   ============================================================ */
.status-toggles { display: flex; flex-direction: column; gap: 10px; }
.status-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--card);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}
.status-toggle-label { font-weight: 600; font-size: .9rem; margin-bottom: 2px; }
.status-toggle-desc  { font-size: .75rem; color: var(--text-muted); }

/* ============================================================
   ADMIN — PROFILE CARDS
   ============================================================ */
.profile-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem;
  font-weight: 800;
  flex-shrink: 0;
}
.admin-profile-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 8px;
  box-shadow: var(--shadow-sm);
}
.admin-profile-row.inactive-row { opacity: .55; }
.profile-info { flex: 1; min-width: 0; }
.profile-name { font-weight: 600; }
.profile-meta { font-size: .78rem; color: var(--text-muted); }

/* ============================================================
   ADMIN — ROLE PICKER (funcionário)
   ============================================================ */
.steps-box {
  background: #EBF4FF;
  border: 1px solid #C3DCFF;
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.step-item { display: flex; gap: 12px; align-items: flex-start; }
.step-num  {
  width: 24px; height: 24px;
  background: var(--info);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem;
  font-weight: 800;
  flex-shrink: 0;
}
.step-title { font-weight: 700; font-size: .88rem; margin-bottom: 2px; }
.step-desc  { font-size: .8rem; color: #1a4d80; }

.uuid-display {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.uuid-label { font-size: .78rem; color: var(--text-muted); }
.uuid-code  { font-family: monospace; font-size: .78rem; word-break: break-all; }

.role-picker { display: flex; flex-direction: column; gap: 8px; }

.role-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  cursor: pointer;
  transition: all .15s;
  -webkit-tap-highlight-color: transparent;
}
.role-card input { display: none; }
.role-card.active { border-color: var(--primary); background: #FFF3EE; }
.role-card:active { transform: scale(.98); }
.role-card-emoji { font-size: 1.4rem; flex-shrink: 0; }
.role-card-label { font-weight: 700; font-size: .9rem; }
.role-card-desc  { font-size: .75rem; color: var(--text-muted); margin-top: 1px; }

/* ============================================================
   ADMIN — MESAS
   ============================================================ */
.table-row-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.table-number-badge {
  background: var(--primary);
  color: #fff;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: .82rem;
  font-weight: 700;
}
.table-name-extra { font-size: .85rem; color: var(--text-muted); }

.copy-btn { min-width: 80px; }

/* ============================================================
   GARÇOM — origem do pedido (badge inline)
   ============================================================ */
.order-origin-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #FFF3E0;
  color: #E65100;
  border: 1px solid #FFCC80;
  border-radius: 100px;
  padding: 4px 12px;
  font-size: .78rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.origin-badge-sm {
  background: #FFF3E0;
  color: #E65100;
  border: 1px solid #FFCC80;
  border-radius: 100px;
  padding: 2px 8px;
  font-size: .72rem;
  font-weight: 700;
  white-space: nowrap;
}

/* ============================================================
   GARÇOM — painel redesenhado
   ============================================================ */
.garcom-panel {
  padding: 12px 16px 120px;
  max-width: 600px;
  margin: 0 auto;
}

.garcom-section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.section-count {
  background: var(--primary);
  color: #fff;
  border-radius: 100px;
  padding: 1px 7px;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}
.select-all-btn {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--primary);
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
  padding: 2px 4px;
  letter-spacing: 0;
  text-transform: none;
  -webkit-tap-highlight-color: transparent;
}

/* Meus pedidos */
.my-order-card {
  background: var(--card);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--primary);
}
.my-order-card.wait-warning  { border-left-color: var(--warning); }
.my-order-card.wait-critical {
  border-left-color: var(--danger);
  animation: pulse-border 1.5s infinite;
}

.stuck-warn {
  background: #FFF3CD;
  color: #856404;
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: .78rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.my-order-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.my-order-table  { font-size: 1.05rem; font-weight: 800; color: var(--primary); }
.my-order-timer  { font-size: .78rem; color: var(--text-muted); margin-left: auto; }
.my-order-timer.wait-warning  { color: var(--warning); font-weight: 700; }
.my-order-timer.wait-critical { color: var(--danger);  font-weight: 700; }

.my-order-product { font-size: 1rem; font-weight: 700; margin-bottom: 3px; }
.my-order-opts    { font-size: .8rem; color: var(--text-muted); margin-bottom: 4px; }
.my-order-meta    { font-size: .78rem; color: var(--text-muted); margin-bottom: 12px; }
.my-order-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.my-order-actions .btn { flex: 1; min-width: 70px; }

/* Disponíveis — cards selecionáveis */
.available-list { display: flex; flex-direction: column; gap: 8px; }

.available-card {
  display: flex;
  align-items: stretch;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all .15s;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.available-card:active      { transform: scale(.98); }
.available-card.selected    { border-color: var(--primary); background: #FFF3EE; }
.available-card.wait-warning  { border-left: 4px solid var(--warning); }
.available-card.wait-critical { border-left: 4px solid var(--danger); }
.available-card.selected.wait-warning  { border-color: var(--primary); border-left-color: var(--warning); }
.available-card.selected.wait-critical { border-color: var(--primary); border-left-color: var(--danger); }

.avail-checkbox {
  width: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border-right: 1px solid var(--border);
  font-size: 1rem;
  font-weight: 800;
  color: var(--primary);
  transition: background .15s;
}
.avail-checkbox.checked {
  background: var(--primary);
  color: #fff;
  border-right-color: var(--primary);
}

.avail-body {
  flex: 1;
  padding: 10px 12px;
  min-width: 0;
}
.avail-top {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.avail-table   { font-size: .95rem; font-weight: 800; color: var(--text); }
.avail-timer   { font-size: .75rem; color: var(--text-muted); margin-left: auto; }
.avail-timer.wait-warning  { color: var(--warning); font-weight: 700; }
.avail-timer.wait-critical { color: var(--danger);  font-weight: 700; }
.avail-product { font-size: .92rem; font-weight: 700; margin-bottom: 2px; }
.avail-opts    { font-size: .76rem; color: var(--text-muted); margin-bottom: 3px; }
.avail-meta    { font-size: .76rem; color: var(--text-muted); }

/* Barra de claim (fixa no rodapé) */
.claim-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 500;
  background: var(--primary);
  color: #fff;
  padding: 12px 16px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transform: translateY(100%);
  transition: transform .28s cubic-bezier(.25,.46,.45,.94);
  box-shadow: 0 -4px 20px rgba(0,0,0,.2);
}
.claim-bar.visible { transform: translateY(0); }

.claim-bar-info {
  font-size: .82rem;
  opacity: .9;
  flex: 1;
}
.claim-bar-btn {
  background: #fff;
  color: var(--primary);
  border: none;
  border-radius: var(--radius-md);
  padding: 10px 18px;
  font-weight: 700;
  font-size: .92rem;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.claim-bar-btn:disabled { opacity: .6; }
.claim-bar-btn:active { opacity: .85; }

/* Estado vazio do garçom */
.garcom-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  text-align: center;
  gap: 8px;
}
.garcom-empty-icon  { font-size: 3rem; }
.garcom-empty-title { font-weight: 700; font-size: 1.1rem; }
.garcom-empty-desc  { font-size: .88rem; color: var(--text-muted); }

/* ============================================================
   GARÇOM — itens dentro do card de grupo (meus pedidos)
   ============================================================ */
.my-order-items {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 8px 0 10px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.my-order-item-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: .88rem;
}

.my-item-qty {
  font-weight: 700;
  color: var(--primary);
  flex-shrink: 0;
  min-width: 24px;
}

.my-item-name {
  font-weight: 600;
  flex: 1;
}

.my-item-opts {
  font-size: .75rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.my-item-price {
  font-weight: 700;
  color: var(--text);
  font-size: .84rem;
  flex-shrink: 0;
}

.my-order-total {
  font-size: .86rem;
  color: var(--text-muted);
  text-align: right;
  margin-bottom: 10px;
}
.my-order-total strong {
  color: var(--primary);
  font-size: .95rem;
}

/* ============================================================
   GARÇOM — cards de aviso "produto acabou" (avisar clientes)
   ============================================================ */
.notify-section-label { color: var(--warning); }

.notify-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #FFFBEB;
  border: 2px solid var(--warning);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 8px;
  animation: slideUp .2s ease;
}

.notify-icon { font-size: 1.4rem; flex-shrink: 0; }

.notify-content { flex: 1; min-width: 0; }
.notify-table   { font-size: .82rem; font-weight: 700; color: var(--text-muted); margin-bottom: 2px; }
.notify-msg     { font-size: .92rem; color: var(--text); line-height: 1.35; }
.notify-msg strong { color: var(--warning); }
.notify-qty     { font-size: .75rem; color: var(--text-muted); margin-top: 2px; }

.notify-btn { flex-shrink: 0; white-space: nowrap; }

/* Item cancelado (produto acabou) dentro do card */
.item-row-cancelled {
  opacity: .55;
  text-decoration: line-through;
  text-decoration-color: var(--danger);
}
.item-row-cancelled .my-item-qty,
.item-row-cancelled .my-item-name { color: var(--text-muted); }

.item-out-tag {
  font-size: .7rem;
  font-weight: 700;
  background: var(--danger);
  color: #fff;
  padding: 2px 7px;
  border-radius: 100px;
  flex-shrink: 0;
  text-decoration: none;
}

/* Banner de aviso inline no card */
.notify-inline-banner {
  background: #FFFBEB;
  border: 1.5px solid var(--warning);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: .85rem;
  color: #7a4f00;
  margin-bottom: 10px;
  line-height: 1.4;
}
.notify-inline-banner strong { color: var(--warning); }

/* Botão "produto acabou" inline no item */
.unavail-item-btn {
  background: none;
  border: none;
  font-size: .78rem;
  cursor: pointer;
  padding: 1px 4px;
  border-radius: 4px;
  opacity: .3;
  flex-shrink: 0;
  line-height: 1;
  transition: opacity .15s, transform .12s;
  -webkit-tap-highlight-color: transparent;
}
.unavail-item-btn:hover  { opacity: 1; }
.unavail-item-btn:active { transform: scale(.85); opacity: 1; }

/* ============================================================
   GARÇOM — itens dentro do card disponível (selecionável)
   ============================================================ */
.avail-items {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 4px;
}

.avail-item-row {
  display: flex;
  align-items: baseline;
  gap: 5px;
  font-size: .83rem;
}

.avail-item-qty {
  font-weight: 700;
  color: var(--primary);
  flex-shrink: 0;
  min-width: 20px;
}

.avail-item-name {
  font-weight: 600;
  flex: 1;
}

.avail-item-opts {
  font-size: .73rem;
  color: var(--text-muted);
  flex-shrink: 0;
}
