/* Gestão de mesas; não interfere no terminal de atendimento ou nas frentes de caixa. */
#tab-comandas { --text-main: #192a40; --text-muted: #526174; --text-dim: #526174; --border-card: #d8dfe7; background: #f5f6f8; color: var(--text-main); }
#tab-comandas > .view-container { padding: 12px 20px !important; gap: 10px; height: 100% !important; min-height:0; }
#tab-comandas .view-header { align-items: flex-start !important; margin: 0 !important; }
#tab-comandas .view-header :is(div,h2,p) { text-align: left !important; }
#tab-comandas .view-header h2 { justify-content: flex-start !important; font-size: 23px !important; font-weight: 700 !important; line-height: 1.2; letter-spacing: -.025em; }
#tab-comandas .view-header p { display:none; }
#tab-comandas #comandas-header-icone { display: none; }
#tab-comandas .comandas-metrics { margin: 0 !important; gap: 0 !important; background:#fff; border:1px solid #d8dfe7; border-radius:8px; }
#tab-comandas .summary-metric-card { padding: 8px 12px !important; border:0 !important; border-radius:0 !important; box-shadow: none !important; min-width: 0; gap: 4px; flex-direction:row !important; align-items:center; }
#tab-comandas .summary-metric-card + .summary-metric-card { border-left:1px solid #d8dfe7 !important; }
#tab-comandas .summary-metric-card > span:last-child { display:none; }
#tab-comandas .summary-metric-card > span { color: #526174 !important; font-size: 12px !important; line-height: 1.4; text-transform: none !important; letter-spacing: 0 !important; }
#tab-comandas .summary-metric-card > strong { color: #192a40 !important; font-size: 16px !important; font-weight: 700 !important; font-variant-numeric: tabular-nums; white-space:nowrap; }
#tab-comandas .comandas-toolbar { flex-wrap: wrap !important; margin: 0 !important; gap: 12px !important; }
#tab-comandas #comandas-filtros-bar { flex-wrap: wrap; }
#tab-comandas .comanda-filtro-btn { min-height: 40px; padding: 10px 14px; font-size: 13px; border-radius: 6px; }
#tab-comandas .comanda-filtro-btn.active { background: #192a40; color: #fff; box-shadow: none; }
#tab-comandas :is(.btn-comandas-cadastrar-action,.btn-primary-action) { min-height: 42px; height: auto !important; padding: 10px 14px !important; border-radius: 7px; background: #192a40 !important; color: #fff !important; box-shadow: none; font-size: 13px !important; }
#tab-comandas #comandas-busca-mesa-input { min-height: 42px; font-size: 13px !important; border-color: #aebbc9; }
#tab-comandas .comandas-workspace { gap: 16px !important; }
#tab-comandas .data-table-card { border: 1px solid #d8dfe7 !important; border-radius: 12px !important; box-shadow: none; }
#tab-comandas #comandas-grid-container { grid-template-columns: repeat(auto-fill,minmax(170px,1fr)) !important; gap: 12px !important; }
#tab-comandas .comanda-card-item { padding: 14px !important; min-height: 112px !important; border-width: 1px !important; border-radius: 8px !important; box-shadow: none !important; gap: 8px; }
#tab-comandas .comanda-card-item:hover { outline: 2px solid #526174; outline-offset: -2px; }
#tab-comandas .comanda-card-item > div:nth-child(2) > span { color: #526174 !important; }
#tab-comandas .comanda-card-item > div:last-child > strong { font-size: 15px !important; color: #226447 !important; }
#tab-comandas #comanda-detalhes-painel { padding: 10px !important; overflow: hidden !important; }
#tab-comandas .comanda-detalhe-shell { flex: 1; height: 100%; min-height: 0; overflow: hidden; }
#tab-comandas .comanda-detalhe-resumo > div { flex-wrap: wrap; gap: 8px; }
#tab-comandas .comanda-detalhe-resumo > div:last-child { grid-template-columns: repeat(3,minmax(0,1fr)) !important; }
#tab-comandas .comanda-detalhe-resumo .btn-primary-action { min-height:34px; padding:7px 8px !important; font-size:12px !important; }
#tab-comandas .comanda-itens-scroll { flex:1; min-height:60px; overflow:auto; scrollbar-color: #96a3b1 #edf0f4; }
#tab-comandas :is(input,button,[tabindex]):focus-visible { outline: 3px solid #2466bd; outline-offset: 2px; }
#tab-comandas ::selection { background: #ffcdac; color: #192a40; }
@media(max-width:1100px) {
  #tab-comandas > .view-container { padding: 20px !important; }
  #tab-comandas .view-header h2 { font-size: 24px !important; }
}
@media(max-width:900px) {
  #tab-comandas { overflow: auto !important; }
  #tab-comandas > .view-container { height: auto !important; min-height: 100%; padding: 16px !important; overflow: visible; }
  #tab-comandas .comandas-workspace { grid-template-columns: minmax(0,1fr) !important; flex: none !important; }
  #tab-comandas #comandas-grid-container { max-height: 50vh; }
  #tab-comandas #comanda-detalhes-painel { min-height: 440px !important; overflow: visible !important; }
  #tab-comandas .comanda-detalhe-shell { height: auto; overflow: visible; }
  #tab-comandas .comanda-itens-scroll { max-height: 45vh; flex: none; }
  #tab-comandas .comandas-metrics { grid-template-columns: repeat(2,minmax(0,1fr)) !important; }
  #tab-comandas .summary-metric-card > strong { font-size: 20px !important; }
  #tab-comandas .comandas-toolbar > div:last-child { flex-wrap: wrap; justify-content: flex-start !important; }
  #tab-comandas .comandas-toolbar > div:last-child > div { flex: 1 1 200px !important; }
  #tab-comandas #comandas-filtros-bar { flex-shrink: 1 !important; }
  #tab-comandas #comandas-grid-container { grid-template-columns: repeat(auto-fill,minmax(150px,1fr)) !important; }
}
@media(min-width:901px) and (max-height:700px) {
  #tab-comandas > .view-container { padding:8px 12px !important; gap:6px; }
  #tab-comandas .view-header h2 { font-size:19px !important; }
  #tab-comandas .summary-metric-card { padding:5px 8px !important; }
  #tab-comandas .comanda-filtro-btn { min-height:32px; padding:6px 10px; }
  #tab-comandas .comanda-detalhe-resumo > div { gap:4px; }
}
/* A conta QR usa o mesmo painel de detalhes das demais mesas. */
.comanda-qr .comanda-qr-status { margin:6px 0 0; font-size:11px; line-height:1.4; color:var(--text-muted); overflow-wrap:anywhere; }
.comanda-qr .comanda-qr-lancador { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.comanda-qr-lancador strong { display:block; font-size:11px; color:var(--text-dim); text-transform:uppercase; }
.comanda-qr-lancador span { display:block; margin-top:4px; font-size:11px; color:var(--text-muted); }
.comanda-qr-lancador button { height:36px; font-size:12px; background:#10b981; color:white; flex-shrink:0; }
.comanda-qr-item-nota { margin-top:4px; font-size:11px; line-height:1.4; color:var(--text-muted); overflow-wrap:anywhere; }
.comanda-qr button:disabled { cursor:not-allowed; }
.comanda-qr-status:empty { display:none; }
.comanda-qr-limites { margin:0 0 6px; color:var(--text-muted); font-size:10px; line-height:1.3; }
