.vendas-shell {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: -18px;
  position: relative;
  height: calc(100vh - var(--topbar-h));
  overflow: hidden;
}

/* ── Comanda view ────────────────────────────────────── */

.vendas-comanda-topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: -16px -24px 16px;
  padding: 10px 14px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.vendas-comanda-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
  flex: 1;
}

.vendas-comanda-body {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 16px;
  align-items: start;
}

.vendas-comanda-sidebar {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vendas-mesa-info-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.vendas-mesa-info-num   { font-size: 1.3rem; font-weight: 800; color: var(--purple); margin: 0; }
.vendas-mesa-info-local { font-size: 0.78rem; color: var(--muted); margin: 0; }

.vc-comanda-list { display: flex; flex-direction: column; gap: 6px; }

.vc-comanda-card {
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color 0.12s;
}

.vc-comanda-card:hover,
.vc-comanda-card.active { border-color: var(--purple); }

.vc-comanda-card-head { display: flex; justify-content: space-between; align-items: center; }
.vc-comanda-num       { font-weight: 700; color: var(--purple); font-size: 0.9rem; }
.vc-comanda-total     { font-size: 0.82rem; font-weight: 600; color: #c0392b; }
.vc-comanda-itens-count { font-size: 0.72rem; color: var(--muted); margin-top: 2px; }
.vc-nova-comanda-btn  { width: 100%; }

.vendas-comanda-main { display: flex; flex-direction: column; gap: 12px; }

.vc-items-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
}

.vc-items-list { display: flex; flex-direction: column; gap: 4px; }

.vc-item-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 8px;
  align-items: center;
  padding: 8px 6px;
  border-bottom: 1px solid #f0f0f4;
  font-size: 0.88rem;
}

.vc-item-row:last-child { border-bottom: none; }
.vc-item-name  { font-weight: 600; }
.vc-item-obs   { font-size: 0.74rem; color: var(--muted); }
.vc-item-qty   { color: var(--muted); font-size: 0.82rem; white-space: nowrap; }
.vc-item-price { font-weight: 700; white-space: nowrap; }

.vc-item-del {
  background: none;
  border: none;
  color: #c0392b;
  cursor: pointer;
  font-size: 1rem;
  padding: 2px 4px;
}

.vc-totals {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.vc-totals-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  padding: 2px 0;
}

.vc-totals-grand {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--purple);
  margin-top: 4px;
}

.vendas-comanda-empty {
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
  padding: 24px 0;
}


/* ── VC2 (comanda cards nova layout) ─────────────────── */

.vc2-shell {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

/* ── VC2 Topbar de informacoes ─────────────────────────── */
.vc2-topbar {
  display: flex;
  align-items: center;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  padding: 8px 16px;
  flex-shrink: 0;
  flex-wrap: wrap;
  gap: 0;
}
.vc2-topbar-item {
  display: flex;
  flex-direction: column;
  padding: 2px 16px;
  gap: 1px;
}
.vc2-topbar-item:first-child { padding-left: 0; }
.vc2-topbar-label {
  font-size: 0.63rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  margin-bottom: 1px;
}
.vc2-topbar-sep {
  width: 1px;
  height: 34px;
  background: var(--line);
  align-self: center;
  flex-shrink: 0;
}
.vc2-topbar-spacer { flex: 1; min-width: 12px; }
.vc2-topbar-total {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  padding: 6px 14px;
  background: var(--purple);
  border-radius: 8px;
}
.vc2-topbar-total .vc2-topbar-label { color: rgba(255,255,255,0.7); }
.vc2-topbar-total-val {
  font-size: 1.15rem;
  font-weight: 900;
  color: #fff;
}
.vc2-sidebar { display: none; }

/* ── Modal agrupar ── */

.vc2-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.48);
  align-items: flex-start;
  justify-content: center;
  padding-top: 14vh;
  z-index: 200;
}

.vc2-modal-overlay:not(.hidden) { display: flex; }

.vc2-modal {
  background: var(--panel);
  border-radius: 12px;
  padding: 22px 24px;
  min-width: 300px;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 8px 32px rgba(0,0,0,0.22);
}

.vc2-modal-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--orange);
  margin-bottom: 10px;
}

.vc2-modal-info {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 14px;
}

.vc2-agrupar-lista {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  max-height: 260px;
  overflow-y: auto;
}

.vc2-agrupar-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg);
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 12px 16px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  transition: border-color 0.12s, background 0.12s, color 0.12s;
}

.vc2-agrupar-item:hover {
  border-color: var(--orange);
  background: rgba(255,61,16,0.05);
  color: var(--orange);
}

.vc2-agrupar-item span:last-child {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 700;
}

.vc2-nome-input {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--line);
  border-radius: 7px;
  font-size: 0.95rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.14s;
}

.vc2-nome-input:focus { border-color: var(--purple); }

.vc2-modal-btns {
  display: flex;
  justify-content: flex-end;
}

/* ── Modal itens da comanda ── */

.vc2-itens-modal {
  background: var(--panel);
  border-radius: 12px;
  width: 90%;
  max-width: 760px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 40px rgba(0,0,0,0.28);
  overflow: hidden;
}

.vc2-itens-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.vc2-itens-modal-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--purple);
  margin: 0;
}

.vc2-itens-modal-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background 0.1s, color 0.1s;
}

.vc2-itens-modal-close:hover { background: var(--line); color: var(--text); }

.vc2-itens-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

.vc2-itens-modal-footer {
  border-top: 1px solid var(--line);
  flex-shrink: 0;
}

.vc2-itens-modal-footer .vc2-bottom-totals {
  border-top: none;
}

/* botão ver itens — rodapé */
.vc2-comanda-ver-btn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 5px 18px;
  line-height: 1;
  transition: background 0.1s, color 0.1s, border-color 0.1s;
}

.vc2-comanda-ver-btn:hover { background: rgba(93,22,116,0.08); color: var(--purple); border-color: var(--purple); }

.vc2-order-code  { font-size: 1rem; font-weight: 700; color: var(--purple); }
.vc2-order-total-val { font-size: 1rem; font-weight: 700; color: var(--orange); }
.vc2-num-cmds-row { display: flex; justify-content: space-between; align-items: center; }
.vc2-num-value   { font-weight: 700; color: var(--text); font-size: 1rem; }
.vc2-hr          { border: none; border-top: 1px solid var(--line); margin: 4px 0; }
.vc2-section-label { font-size: 0.68rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 2px; }

.vc2-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
  min-height: 18px;
}

.vc2-info-val    { font-weight: 700; color: var(--text); font-size: 0.85rem; text-align: right; }
.vc2-pessoas-ctrl { display: flex; align-items: center; gap: 6px; }

.vc2-pessoas-btn {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}

.vc2-pessoas-btn:hover { border-color: var(--purple); color: var(--purple); background: var(--panel); }

#vc-pessoas-count { font-weight: 700; color: var(--text); min-width: 18px; text-align: center; }

.vc2-timer { font-weight: 700; color: var(--orange); font-size: 0.88rem; font-variant-numeric: tabular-nums; }


.vc2-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}

.vc2-topbar { padding: 12px 14px 8px; }

/* ── Container do modulo (pdv_off usa #pdv-content, gestao usa
   .content-stack — cada um ja resolve o padding/altura no proprio
   core/layout.css; aqui so reforcamos o encaixe do #vm-view-global
   dentro de #pdv-content, que so existe no pdv_off - inerte na gestao
   web, que nao tem esse elemento). ── */
.pdv-content[data-module="venda_mesa"] {
  padding: 0;
}

#vm-view-global {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* scrollbar visível dentro da área branca (so pdv_off - a gestao web
   usa .vcomanda-main dentro de .content-stack, que ja rola por conta
   do proprio core/layout.css) */
#vm-view-global .vcomanda-main::-webkit-scrollbar { width: 6px; }
#vm-view-global .vcomanda-main::-webkit-scrollbar-track { background: #f0f0f0; }
#vm-view-global .vcomanda-main::-webkit-scrollbar-thumb { background: #555; border-radius: 3px; }

.vc2-section {
  background: var(--panel);
  margin: 0 12px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  overflow: hidden;
}

.vc2-section--cards {
  overflow: hidden;
  margin-top: 10px;
}

.vc2-section-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--purple);
  margin: 0;
  padding: 8px 12px 6px;
  border-bottom: 1px solid var(--line);
}

.vc2-section--expand {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.vc2-section--expand .vc2-table-wrap {
  flex: 1;
  overflow-y: auto;
}

.vc2-comanda-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 10px;
  padding: 10px 12px 12px;
  max-height: 560px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--orange) #f0f0f0;
}

.vc2-comanda-cards::-webkit-scrollbar { width: 5px; }
.vc2-comanda-cards::-webkit-scrollbar-track { background: #f0f0f0; border-radius: 3px; }
.vc2-comanda-cards::-webkit-scrollbar-thumb { background: var(--orange); border-radius: 3px; }

.vc2-comanda-card {
  border: 2px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  overflow: hidden;
}

.vc2-comanda-card:hover { border-color: var(--orange); }
.vc2-comanda-card.active { border-color: var(--purple); box-shadow: 0 2px 10px rgba(93,22,116,0.25); }
.vc2-comanda-card.fechada { opacity: 0.55; }

/* ── Cabeçalho: nome + renomear ── */
.vc2-comanda-card-head {
  background: var(--purple);
  border-bottom: 1px solid rgba(255,255,255,0.15);
  padding: 7px 9px;
  border-radius: 8px 8px 0 0;
  display: flex;
  align-items: center;
  gap: 5px;
}

.vc2-comanda-card.active .vc2-comanda-card-head { background: #4a1070; border-bottom-color: rgba(255,255,255,0.2); }
.vc2-comanda-card.fechada .vc2-comanda-card-head { background: #9ca3af; border-bottom-color: rgba(255,255,255,0.15); }

.vc2-comanda-num { font-weight: 700; font-size: 0.84rem; flex: 1; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.vc2-comanda-card.active .vc2-comanda-num { color: #fff; }

/* ── Botões da comanda ── */
.vc2-comanda-card-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 8px 6px;
  border-bottom: 1px solid var(--line);
}

.vc2-comanda-card-actions-row2 {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.vc2-comanda-open-btn {
  background: var(--orange);
  border: none;
  color: #fff;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 800;
  padding: 13px 10px;
  line-height: 1;
  width: 100%;
  transition: background 0.1s;
  text-align: center;
}
.vc2-comanda-open-btn:hover { background: var(--orange-dark); }

.vc2-comanda-fechar-btn {
  background: #16a34a;
  border: none;
  color: #fff;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 800;
  padding: 13px 8px;
  line-height: 1;
  width: 100%;
  transition: background 0.1s;
  text-align: center;
}
.vc2-comanda-fechar-btn:hover { background: #15803d; }

.vc2-comanda-action-btn {
  background: #c0392b;
  border: none;
  color: #fff;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 800;
  padding: 13px 8px;
  line-height: 1;
  width: 100%;
  transition: background 0.1s;
  text-align: center;
}
.vc2-comanda-action-btn:hover { background: #a93226; }

/* botão ver itens — rodapé do card */
.vc2-comanda-card-ver-row {
  display: flex;
  justify-content: center;
  padding: 5px 8px 6px;
  border-top: 1px solid var(--line);
}

/* ── Corpo: info ── */
.vc2-comanda-card-body {
  padding: 8px 10px;
  font-size: 0.77rem;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.vc2-comanda-status { font-size: 0.62rem; border-radius: 10px; padding: 2px 5px; font-weight: 600; flex-shrink: 0; }
.vc2-comanda-status.aberta  { background: #e6f9ef; color: #1a7a45; }
.vc2-comanda-status.fechada { background: var(--bg); color: var(--muted); }

.vc2-comanda-valor { color: var(--orange); font-weight: 700; font-size: 0.85rem; margin-top: 2px; }

.vc2-add-comanda-card {
  border: 2px dashed var(--line);
  border-radius: 10px;
  background: var(--bg);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--orange);
  font-size: 0.88rem;
  font-weight: 600;
  transition: background 0.12s, border-color 0.12s;
  min-height: 175px;
}

.vc2-add-comanda-card:hover { background: var(--panel); border-color: var(--orange); }
.vc2-add-icon { font-size: 2.2rem; line-height: 1; color: var(--orange); }

.vc2-products-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
}

.vc2-products-header .vc2-section-title { border-bottom: none; padding: 7px 0 6px; flex: 1; }

.vc2-search-box { display: flex; gap: 6px; align-items: center; }

.vc2-search-box input {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 0.82rem;
  width: 180px;
}

.vc2-search-box button {
  background: var(--orange);
  border: none;
  color: #fff;
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 0.85rem;
}

.vc2-table-wrap { overflow-x: auto; }

.vc2-items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.vc2-items-table th {
  background: var(--bg);
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 6px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.vc2-items-table th.tc,
.vc2-items-table td.tc { text-align: center; }

.vc2-items-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
}

.vc2-item-row:last-child td { border-bottom: none; }
.vc2-item-row:hover td      { background: var(--bg); }
.vc2-item-name { font-weight: 600; color: var(--purple); }
.vc2-item-obs  { color: var(--muted); font-size: 0.78rem; }

.fw { font-weight: 700; color: var(--purple); }

.vc2-item-edit-btn,
.vc2-item-del-btn {
  background: none;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 3px 7px;
  cursor: pointer;
  font-size: 0.85rem;
  margin: 0 2px;
  transition: background 0.1s;
}

.vc2-item-edit-btn:hover { background: var(--bg); border-color: var(--blue); color: var(--blue); }
.vc2-item-del-btn { color: #c0392b; border-color: #f5c0bb; }
.vc2-item-del-btn:hover { background: #fdf2f1; }
.vc2-table-empty { text-align: center; color: var(--muted); padding: 24px; font-size: 0.85rem; }

.vc2-bottom-totals {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  background: var(--bg);
}

.vc2-total-cell {
  padding: 7px 10px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  border-right: 1px solid var(--line);
  font-size: 0.76rem;
  color: var(--muted);
}

.vc2-total-cell:last-child { border-right: none; }
.vc2-total-cell strong { font-size: 0.88rem; font-weight: 700; color: var(--text); }
.vc2-total-cell--grand { background: var(--panel); }
.vc2-total-cell--grand strong { color: var(--purple); font-size: 0.95rem; }

.vc2-field-label {
  display: block;
  font-size: 0.74rem;
  font-weight: 700;
  color: #6b7280;
  margin-bottom: 4px;
  letter-spacing: 0.02em;
}

.vc2-action-bar {
  display: flex;
  margin-top: auto;
  background: var(--panel);
  border-top: 1px solid var(--line);
  flex-shrink: 0;
}

.vc2-action-btn {
  flex: 1;
  background: transparent;
  border: none;
  border-right: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 18px 6px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  text-transform: uppercase;
}

.vc2-action-btn:last-child { border-right: none; }
.vc2-action-btn:hover { background: var(--bg); color: var(--purple); }
.vc2-action-btn--fechar { color: var(--orange); font-weight: 800; }
.vc2-action-btn--fechar:hover { background: var(--orange); color: #fff; }

#vendas-btn-mesas    { background: #3b82f6; color: #fff; border-color: #2563eb; }
#vendas-btn-mesas:hover { background: #2563eb; color: #fff; }
#vendas-nova-comanda { background: #10b981; color: #fff; border-color: #059669; }
#vendas-nova-comanda:hover { background: #059669; color: #fff; }
#vendas-btn-fechar   { background: #ef4444; color: #fff; border-color: #dc2626; }
#vendas-btn-fechar:hover { background: #dc2626; color: #fff; }

.vc2-btn-sem-comanda      { background: var(--orange); border-color: var(--orange); color: #fff; }
.vc2-btn-sem-comanda:hover { background: var(--orange-dark); border-color: var(--orange-dark); color: #fff; }

#vc-nome-confirm { background: var(--orange); color: #fff; }
#vc-nome-confirm:hover { background: var(--orange-dark); color: #fff; }

/* Cores individuais dos botoes da barra de acoes */
#vendas-sem-comanda      { background: #3b82f6; color: #fff; border-right-color: rgba(0,0,0,0.1); }
#vendas-sem-comanda:hover { background: #2563eb; color: #fff; }

#vendas-nova-comanda      { background: #10b981; color: #fff; border-right-color: rgba(0,0,0,0.1); }
#vendas-nova-comanda:hover { background: #059669; color: #fff; }

#vendas-vincular-comanda      { background: var(--purple); color: #fff; border-right-color: rgba(0,0,0,0.1); }
#vendas-vincular-comanda:hover { background: #4a1070; color: #fff; }

#vendas-transferir-comanda      { background: #64748b; color: #fff; border-right-color: rgba(0,0,0,0.1); }
#vendas-transferir-comanda:hover { background: #475569; color: #fff; }

#vendas-btn-fechar      { background: #ef4444; color: #fff; font-weight: 800; border-right-color: rgba(0,0,0,0.1); }
#vendas-btn-fechar:hover { background: #dc2626; color: #fff; }

.vc2-transferir-tabs,
.vc2-agrupar-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.vc2-agrupar-tab {
  flex: 1;
  padding: 7px 12px;
  border-radius: 6px;
  border: 2px solid #d1d5db;
  background: #f3f4f6;
  color: #374151;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s, color 0.12s;
}

.vc2-agrupar-tab.active {
  border-color: var(--purple);
  background: var(--purple);
  color: #fff;
}

.vc2-agrupar-tab:not(.active):hover {
  border-color: var(--purple);
  color: var(--purple);
}

.vc2-transferir-tab {
  flex: 1;
  padding: 7px 12px;
  border-radius: 6px;
  border: 2px solid #d1d5db;
  background: #f3f4f6;
  color: #374151;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s, color 0.12s;
}

.vc2-transferir-tab.active {
  border-color: var(--purple);
  background: var(--purple);
  color: #fff;
}

.vc2-transferir-tab:not(.active):hover {
  border-color: var(--purple);
  color: var(--purple);
}

/* ══════════════════════════════════════════════════════
   Mapa de Mesas (merged from mapa_mesa.css)
   ══════════════════════════════════════════════════════ */

.mapa-mesa-shell {
  margin: -18px;
  padding: 20px 20px 0 24px;
}

.vendas-mesa-map-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.vendas-mesa-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1;
}

.mesa-filter-btn {
  padding: 5px 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #f5f5f8;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.mesa-filter-btn:hover,
.mesa-filter-btn.active {
  background: var(--orange);
  color: #fff;
  border-color: var(--orange);
}

.mesa-filter-btn[data-status-filter="disponivel"]:hover,
.mesa-filter-btn[data-status-filter="disponivel"].active { background: #10b981; border-color: #10b981; color: #fff; }

.mesa-filter-btn[data-status-filter="ocupado"]:hover,
.mesa-filter-btn[data-status-filter="ocupado"].active    { background: #ef4444; border-color: #ef4444; color: #fff; }

.mesa-filter-btn[data-status-filter="reservada"]:hover,
.mesa-filter-btn[data-status-filter="reservada"].active  { background: #3b82f6; border-color: #3b82f6; color: #fff; }

.mesa-filter-btn[data-status-filter="ociosa"]:hover,
.mesa-filter-btn[data-status-filter="ociosa"].active     { background: #9ca3af; border-color: #9ca3af; color: #fff; }

.vendas-mesa-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--orange) #f0f0f0;
  padding-right: 4px;
  padding-top: 8px;
}

.vendas-mesa-grid::-webkit-scrollbar { width: 5px; }
.vendas-mesa-grid::-webkit-scrollbar-track { background: #f0f0f0; border-radius: 3px; }
.vendas-mesa-grid::-webkit-scrollbar-thumb { background: var(--orange); border-radius: 3px; }

.venda-mesa-card {
  border-radius: 10px;
  background: var(--panel);
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow);
  text-align: left;
  padding: 0;
  border: 2px solid transparent;
  height: 166px;
}

.venda-mesa-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.vmc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  gap: 4px;
  background: transparent;
}

.vmc-num {
  font-size: 0.9rem;
  font-weight: 800;
  color: #fff;
}

.vmc-badge {
  font-size: 0.62rem;
  font-weight: 700;
  background: rgba(0,0,0,0.2);
  color: #fff;
  border-radius: 20px;
  padding: 2px 7px;
  white-space: nowrap;
  letter-spacing: 0.03em;
}

.vmc-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 8px 8px;
  gap: 4px;
  flex: 1;
  background: transparent;
}

.vmc-svg { width: 68px; height: 48px; }

.vmc-local {
  font-size: 0.68rem;
  color: var(--muted, #6f7782);
  font-weight: 600;
}

.vmc-total {
  font-size: 0.78rem;
  font-weight: 800;
  color: #ef4444;
}

.venda-mesa-card.status-disponivel { background: #10b981; border-color: #10b981; }
.venda-mesa-card.status-ocupado    { background: #ef4444; border-color: #ef4444; }
.venda-mesa-card.status-ociosa     { background: #9ca3af; border-color: #9ca3af; }
.venda-mesa-card.status-reservada  { background: #3b82f6; border-color: #3b82f6; }
.venda-mesa-card.status-agrupada   { background: #f59e0b; border-color: #f59e0b; }
.venda-mesa-card.status-manutencao { background: #eab308; border-color: #eab308; }
.venda-mesa-card.status-fechamento { background: var(--purple); border-color: var(--purple); }
.venda-mesa-card.status-inativa    { background: #9ca3af; border-color: #9ca3af; opacity: 0.6; }

.venda-mesa-card.status-disponivel .vmc-body { background: #f0fdf8; }
.venda-mesa-card.status-ocupado    .vmc-body { background: #fff5f5; }
.venda-mesa-card.status-ociosa     .vmc-body { background: #f9fafb; }
.venda-mesa-card.status-reservada  .vmc-body { background: #eff6ff; }
.venda-mesa-card.status-agrupada   .vmc-body { background: #fffbeb; }
.venda-mesa-card.status-manutencao .vmc-body { background: #fefce8; }
.venda-mesa-card.status-fechamento .vmc-body { background: #faf5ff; }

.venda-mesa-card.status-disponivel .vmc-svg circle,
.venda-mesa-card.status-disponivel .vmc-svg path,
.venda-mesa-card.status-disponivel .vmc-svg rect { fill: #10b981; opacity: 0.75; }

.venda-mesa-card.status-ocupado .vmc-svg circle,
.venda-mesa-card.status-ocupado .vmc-svg path,
.venda-mesa-card.status-ocupado .vmc-svg rect { fill: #ef4444; opacity: 0.7; }

.venda-mesa-card.status-ociosa .vmc-svg circle,
.venda-mesa-card.status-ociosa .vmc-svg path,
.venda-mesa-card.status-ociosa .vmc-svg rect { fill: #9ca3af; opacity: 0.6; }

.venda-mesa-card.status-reservada .vmc-svg circle,
.venda-mesa-card.status-reservada .vmc-svg path,
.venda-mesa-card.status-reservada .vmc-svg rect { fill: #3b82f6; opacity: 0.7; }

.venda-mesa-card.status-agrupada .vmc-svg circle,
.venda-mesa-card.status-agrupada .vmc-svg path,
.venda-mesa-card.status-agrupada .vmc-svg rect { fill: #f59e0b; opacity: 0.7; }

.venda-mesa-card.status-manutencao .vmc-svg circle,
.venda-mesa-card.status-manutencao .vmc-svg path,
.venda-mesa-card.status-manutencao .vmc-svg rect { fill: #eab308; opacity: 0.7; }

.venda-mesa-card.status-fechamento .vmc-svg circle,
.venda-mesa-card.status-fechamento .vmc-svg path,
.venda-mesa-card.status-fechamento .vmc-svg rect { fill: var(--purple); opacity: 0.7; }

.vmc-comanda-btn {
  width: 100%;
  padding: 5px 8px;
  border: none;
  border-top: 1px solid rgba(255,255,255,0.2);
  background: rgba(0,0,0,0.14);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.12s;
}

.vmc-comanda-btn:hover { background: rgba(0,0,0,0.26); }

@media (max-width: 820px) {
  .mapa-mesa-shell { margin: 0; padding: 0; }

  .vendas-mesa-map-toolbar {
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 8px;
    gap: 6px;
  }

  .vendas-mesa-map-toolbar .section-kicker { flex: 1; margin: 0; font-size: 0.78rem; }

  #mapa-mesa-refresh { order: 2; flex-shrink: 0; padding: 5px 12px; font-size: 0.75rem; }

  .vendas-mesa-filters {
    order: 3;
    flex: none;
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    scrollbar-width: none;
    gap: 5px;
  }

  .vendas-mesa-filters::-webkit-scrollbar { display: none; }

  .mesa-filter-btn {
    white-space: nowrap;
    flex-shrink: 0;
    padding: 4px 11px;
    font-size: 0.72rem;
  }

  .vendas-mesa-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    max-height: none;
    overflow-y: visible;
    padding-top: 6px;
    padding-right: 0;
  }

  .venda-mesa-card { height: 146px; }

  .vmc-header { padding: 7px 8px; }
  .vmc-num    { font-size: 0.8rem; }
  .vmc-badge  { font-size: 0.56rem; padding: 2px 5px; }
  .vmc-body   { padding: 8px 6px 6px; gap: 3px; }
  .vmc-svg    { width: 54px; height: 38px; }
  .vmc-local  { font-size: 0.6rem; }
  .vmc-total  { font-size: 0.7rem; }
}

@media (max-width: 480px) {
  .vendas-mesa-grid         { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .venda-mesa-card          { height: 120px; }
  .vmc-header               { padding: 5px 7px; }
  .vmc-num                  { font-size: 0.75rem; }
  .vmc-badge                { font-size: 0.52rem; padding: 2px 4px; }
  .vmc-body                 { padding: 6px 5px 4px; gap: 2px; }
  .vmc-svg                  { width: 44px; height: 30px; }
  .vmc-local                { font-size: 0.56rem; }
  .vmc-total                { font-size: 0.65rem; }
  .vendas-mesa-map-toolbar  { gap: 4px; }
  .mesa-filter-btn          { padding: 4px 9px; font-size: 0.68rem; }
}

/* ── Mobile: telefone (≤600px) — portado do pdv_off (comentarios originais
   mantidos, sao bugs reais ja resolvidos la: overlap de card, scroll que
   nao funcionava no Android, rodape empurrado pra fora da tela) ────── */
@media (max-width: 600px) {
  .vc2-modal { min-width: 0; width: calc(100% - 24px); }
  .vc2-modal-overlay { padding: 24px 12px; align-items: center; }

  /* Modal de itens vira tela cheia, igual app */
  .vc2-itens-modal-overlay .vc2-itens-modal,
  .vc2-modal-overlay .vc2-itens-modal {
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
  }
  .vc2-modal-overlay:has(.vc2-itens-modal) { padding: 0; }

  .vc2-items-table th,
  .vc2-items-table td { padding: 8px 6px; font-size: 0.82rem; }
  .vc2-bottom-totals { grid-template-columns: repeat(2, 1fr); }

  /* Cartao da mesa: altura fixa (193px) ficava esticada numa coluna
     estreita (3 por linha) - igual pdv_app, deixa a altura livre
     (cresce so o necessario pro conteudo: cabecalho + icone + texto). */
  .venda-mesa-card { height: auto; }
  .vmc-header { padding: 5px 7px; }
  .vmc-num  { font-size: 0.78rem; }
  .vmc-badge { font-size: 0.58rem; padding: 1px 6px; }
  .vmc-body { flex: none; gap: 1px; padding: 4px 0; }
  .vmc-svg  { width: 68px; height: 52px; }
  .vmc-total { font-size: 0.7rem; }

  /* .vc2-shell (altura auto, cresce com o conteudo) so funciona porque o
     desktop deixa a pagina toda rolar. No celular o pai (.vendas-shell)
     tem altura fixa + overflow:hidden - sem essa cadeia flex:1/min-height:0
     ate' o container que realmente deve rolar (a lista de cards), o
     conteudo que passa da altura fixa fica simplesmente cortado (sumia
     tudo que nao coubesse, empurrando os botoes MESAS/NOVA COMANDA/FECHAR
     TODAS pra fora da tela em vez de aparecer com scroll). */
  .vc2-shell {
    flex: 1;
    min-height: 0;
    height: auto;
    overflow: hidden;
  }
  /* .vc2-main tambem e' flex:1 dentro do vc2-shell acima, mas sem
     min-height:0 o padrao (min-height:auto) deixa esse item recusar
     encolher abaixo do tamanho do proprio conteudo em navegadores Android
     - cortava o card de baixo e sobrepunha o rodape MESAS/NOVA COMANDA/
     FECHAR TODAS em vez de deixar a area de cards rolar por dentro. */
  .vc2-main {
    min-height: 0;
  }
  /* Mesma estrutura que ja funciona na tela Mesa (#vm-view-global +
     .vcomanda-main): quem rola e' um DIV comum separado (nao o grid, nao
     o mesmo container do titulo/busca) - .vc2-section--cards vira so' um
     wrapper fixo (nao rola, overflow:hidden), titulo/busca ficam fixos no
     topo dentro dele (flex-shrink:0), e so' o .vc2-comanda-cards-scroll
     (por baixo, envolvendo so' o grid) e' quem tem flex:1/min-height:0/
     overflow-y:auto de verdade. Dar flex:1 direto no proprio grid
     (display:grid) fazia as linhas encolherem e sobreporem; e title/busca
     dentro do mesmo container que rola tambem impedia o toque de rolar de
     verdade no Android/iPhone - replicando a Mesa (que sempre funcionou)
     resolve os dois problemas de uma vez. */
  .vc2-section--cards {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin: 10px 0 0;
    border: none;
    border-radius: 0;
    background: transparent;
  }
  .vc2-section--cards .vc2-section-title,
  .vc-mesa-toolbar {
    flex-shrink: 0;
  }
  .vc2-section--cards .vc2-section-title { padding-top: 8px; border-bottom: none; }
  .vc2-comanda-cards-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    box-sizing: border-box;
  }

  /* Comandas da Mesa (drilldown): 2 colunas em vez de 1 empilhada -
     cada card tem 2 botoes de altura total (Lancar/Fechar), precisa de
     mais largura por card que os cartoes de mesa/comanda da lista
     principal (que ja usam 3 colunas), por isso 2 aqui. O grid fica com
     altura natural (sem flex/max-height) - quem rola e' o pai acima. */
  #vc-comanda-cards {
    grid-template-columns: repeat(2, 1fr);
    align-content: start;
    align-items: start;
    max-height: none;
    overflow: visible;
    gap: 8px;
    padding: 8px 12px 12px;
  }
  .vc2-comanda-open-btn,
  .vc2-comanda-fechar-btn,
  .vc2-comanda-action-btn { padding: 11px 6px; font-size: 0.82rem; }
  .vc2-add-comanda-card { min-height: 130px; }

  .vc-mesa-toolbar { flex-wrap: wrap; padding: 0 12px 8px; }
  .vc-mesa-toolbar .vcomanda-search-input { flex: 1 1 100%; }
  .vc-mesa-toolbar button { flex: 1; }

  /* Rodape com 3 botoes principais (igual pdv_app: Mesas azul / Nova
     Comanda verde / Fechar Todas vermelho) - texto menor pra caber. */
  .vc2-action-bar .vc2-action-btn { font-size: 0.68rem; padding: 14px 4px; }
}

/* ══════════════════════════════════════════════════════
   Cadastro de Mesas (merged from cadastro_mesa.css)
   ══════════════════════════════════════════════════════ */

/* ── Grid global de mesas: 6 por linha ────────────────── */

#vm-grid {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

#vm-grid .vc2-comanda-num {
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* ── Cores do cabeçalho do card por status ────────────── */

#vm-grid .vm-card--disponivel .vc2-comanda-card-head {
  background: #10b981;
}
#vm-grid .vm-card--disponivel .vc2-comanda-card-head:hover,
#vm-grid .vm-card--disponivel.vc2-comanda-card:hover .vc2-comanda-card-head {
  background: #059669;
}

#vm-grid .vm-card--ocupado .vc2-comanda-card-head {
  background: #ef4444;
}
#vm-grid .vm-card--ocupado.vc2-comanda-card:hover .vc2-comanda-card-head {
  background: #dc2626;
}

#vm-grid .vm-card--ociosa    .vc2-comanda-card-head { background: #9ca3af; }
#vm-grid .vm-card--reservada .vc2-comanda-card-head { background: #3b82f6; }
#vm-grid .vm-card--agrupada  .vc2-comanda-card-head { background: #f59e0b; }

/* ── Cadastro ─────────────────────────────────────────── */

#vm-view-cadastro {
  overflow: hidden;
  padding: 0;
  height: calc(100vh - var(--topbar-h));
  min-height: calc(100vh - var(--topbar-h));
  max-height: calc(100vh - var(--topbar-h));
}

.mesa-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
  padding: 4px 0;
}

.mesa-card {
  border: 1px solid #eaecf1;
  border-radius: 10px;
  padding: 14px 16px;
  background: #fafbfd;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mesa-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}

.mesa-numero {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--purple);
  line-height: 1.2;
}

.mesa-status-badge {
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}

.mesa-status-disponivel  { background: #e6f9ef; color: #1a7a45; }
.mesa-status-ocupado     { background: #fde8e8; color: #c0392b; }
.mesa-status-ociosa      { background: #f0f0f0; color: #555555; }
.mesa-status-reservada   { background: #e8f0fe; color: #1a56b0; }
.mesa-status-agrupada    { background: #fff3e0; color: #b35a00; }
.mesa-status-manutencao  { background: #fffde7; color: #8a6800; }
.mesa-status-fechamento  { background: #f3e8ff; color: #7b2d9e; }
.mesa-status-inativa     { background: #e8e8e8; color: #888888; }

.mesa-local    { font-size: 0.77rem; color: #888; margin: 0; }
.mesa-descricao { font-size: 0.82rem; color: #555; line-height: 1.4; margin: 0; }
.mesa-actions  { display: flex; gap: 6px; margin-top: 6px; }
