/* ===== Modulo de Mesas e Comandas ===== */

.mesas-topo { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:.5rem; }
.mesas-topo-acoes { display:flex; align-items:center; gap:.5rem; }

.mesas-resumo { display:flex; gap:.75rem; flex-wrap:wrap; margin:.5rem 0 1rem; }
.mr-chip { background:#f1f5f9; border-radius:10px; padding:.5rem .9rem; font-size:.85rem; color:#475569; display:flex; gap:.4rem; align-items:baseline; }
.mr-chip b { font-size:1.05rem; color:#0f172a; }
.mr-chip span { margin-left:auto; font-weight:600; }
.mr-chip.abertas { background:#dcfce7; }
.mr-chip.fechando { background:#efe7fe; }

/* Grade de cards de mesa */
.mesas-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:1rem; }

.mesa-card {
    --mc: #16a34a; --mc-bg:#f0fdf4;
    border:1px solid var(--mc); border-top:4px solid var(--mc);
    border-radius:12px; padding:.85rem 1rem; cursor:pointer; background:#fff;
    transition:transform .08s ease, box-shadow .12s ease;
}
.mesa-card:hover { transform:translateY(-2px); box-shadow:0 6px 16px rgba(0,0,0,.10); }
.mesa-card .mc-head { text-align:center; font-weight:700; color:var(--mc); padding-bottom:.4rem; border-bottom:1px solid #eef2f7; }
.mesa-card .mc-total { font-size:1.6rem; font-weight:700; color:#0f172a; margin-top:.4rem; }
.mesa-card .mc-pago { font-size:.78rem; color:#64748b; }
.mesa-card .mc-credito { font-size:.8rem; font-weight:700; color:#b45309; background:#fff7ed; border:1px solid #fed7aa; border-radius:6px; padding:.1rem .4rem; display:inline-block; margin-top:.15rem; }
.mesa-card .mc-foot { display:flex; justify-content:space-between; font-size:.78rem; color:#64748b; margin-top:.5rem; }

.mesa-card.status-aberta   { --mc:#16a34a; }
.mesa-card.status-fechando { --mc:#7c3aed; }
.mesa-card.status-fechada,
.mesa-card.status-cancelada { --mc:#94a3b8; }
.mesa-card.selecionada { box-shadow:0 0 0 3px color-mix(in srgb, var(--mc) 35%, #fff), 0 6px 16px rgba(0,0,0,.12); transform:translateY(-2px); }

/* Painel lateral do detalhe */
.mesa-painel { position:sticky; top:1rem; max-height:calc(100vh - 120px); overflow:auto; padding-right:2px; }

/* Detalhe da mesa */
.md-header { display:flex; justify-content:space-between; align-items:center; gap:1rem;
    border-radius:12px; padding:1rem 1.25rem; color:#fff; background:#16a34a; flex-wrap:wrap; }
.md-header.status-fechando { background:#7c3aed; }
.md-header.status-fechada, .md-header.status-cancelada { background:#64748b; }
.md-nome { font-size:1.3rem; font-weight:700; }
.md-sub { font-size:.85rem; opacity:.92; }
.md-totais { text-align:right; }
.md-total { font-size:1.7rem; font-weight:800; }
.md-pago { font-size:.82rem; opacity:.92; }

.md-sub { font-size:.85rem; opacity:.92; }
.md-edit-btn { border:none; background:rgba(255,255,255,.25); color:#fff; border-radius:6px; padding:0 .35rem; cursor:pointer; font-size:.8rem; line-height:1.4; }
.md-edit-btn:hover { background:rgba(255,255,255,.4); }

.md-acoes { display:flex; gap:.5rem; flex-wrap:wrap; margin:1rem 0; }

.pag-dividir { margin-top:.75rem; padding:.6rem .75rem; background:#f8fafc; border:1px solid #e5e9f0; border-radius:8px; }

.md-consumo { margin-bottom:1rem; }
.md-rodada { border:1px solid #e5e9f0; border-radius:10px; margin-bottom:.75rem; overflow:hidden; }
.md-rodada-head { display:flex; justify-content:space-between; background:#f8fafc; padding:.4rem .75rem; font-size:.82rem; color:#475569; font-weight:600; }
.md-rodada-itens { padding:.5rem; }

.md-pagamentos { background:#f8fafc; border-radius:10px; padding:.75rem 1rem; }
.md-rateio { background:#eef2ff; border-radius:8px; padding:.4rem .6rem; font-size:.85rem; margin-bottom:.5rem; }
.md-pag { display:flex; align-items:center; justify-content:space-between; gap:.5rem; padding:.3rem 0; border-bottom:1px dashed #e2e8f0; font-size:.88rem; }
.md-pag-x { border:none; background:transparent; color:#dc2626; cursor:pointer; font-size:.8rem; padding:0 .2rem; line-height:1; }
.md-pag-x:hover { color:#991b1b; }
.md-pag-hora { color:#94a3b8; font-size:.78rem; }
.md-pag.estorno { color:#b45309; font-weight:600; }
.md-pag-total { display:flex; justify-content:space-between; font-weight:700; margin-top:.5rem; color:#0f172a; }
.md-pag-credito { color:#b45309; }
.md-credito-txt { color:#fde68a; }
.md-credito-alert { border-left:4px solid #f59e0b; font-size:.9rem; }

/* Modais compartilhados */
.mesa-modal-backdrop { position:fixed; inset:0; background:rgba(15,23,42,.45); z-index:1050; }
.mesa-modal { position:fixed; z-index:1060; top:50%; left:50%; transform:translate(-50%,-50%);
    width:min(480px,94vw); max-height:90vh; overflow:auto; background:#fff; border-radius:14px;
    box-shadow:0 20px 60px rgba(0,0,0,.28); }
.mesa-modal.seletor { width:min(900px,96vw); }
.mesa-modal.comp { z-index:1070; }
.mesa-modal-head { display:flex; justify-content:space-between; align-items:center; padding:1rem 1.25rem; border-bottom:1px solid #eef2f7; }
.mesa-modal-head h5 { margin:0; }
.mesa-modal-corpo { padding:1.25rem; }
.mesa-modal-foot { display:flex; justify-content:flex-end; gap:.5rem; padding:1rem 1.25rem; border-top:1px solid #eef2f7; }

/* Seletor de produtos */
.seletor-corpo { display:grid; grid-template-columns:1fr 300px; gap:0; }
@media (max-width:720px){ .seletor-corpo { grid-template-columns:1fr; } }
.seletor-catalogo { padding:1rem; max-height:70vh; overflow:auto; border-right:1px solid #eef2f7; }
.seletor-cat { font-weight:700; color:#334155; margin:.75rem 0 .35rem; font-size:.85rem; text-transform:uppercase; letter-spacing:.02em; }
.seletor-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(148px,1fr)); gap:.6rem; }
.seletor-prod { display:flex; flex-direction:column; align-items:stretch; border:1px solid #e2e8f0; border-radius:10px; padding:.5rem; background:#fff; cursor:pointer; text-align:left; transition:box-shadow .12s, border-color .12s, transform .08s; }
.seletor-prod:hover { border-color:#94a3b8; box-shadow:0 4px 12px rgba(0,0,0,.08); transform:translateY(-1px); }
.sp-foto { position:relative; width:100%; aspect-ratio:4/3; border-radius:8px; overflow:hidden; background:#f1f5f9; display:flex; align-items:center; justify-content:center; margin-bottom:.4rem; }
.sp-foto img { width:100%; height:100%; object-fit:cover; }
.sp-emoji { font-size:2.2rem; line-height:1; }
.sp-esgotado { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; background:rgba(15,23,42,.55); color:#fff; font-size:.8rem; font-weight:700; }
.sp-nome { font-weight:600; font-size:.85rem; line-height:1.2; }
.sp-preco { font-size:.78rem; color:#16a34a; margin-top:.1rem; }

.sp-head-foto { width:64px; height:64px; flex:0 0 64px; border-radius:10px; overflow:hidden; background:#f1f5f9; display:flex; align-items:center; justify-content:center; }
.sp-head-foto img { width:100%; height:100%; object-fit:cover; }
.seletor-prod-head { display:flex; gap:.75rem; align-items:center; }
.seletor-prod.esgotado { opacity:.5; cursor:not-allowed; }
.seletor-prod-head { margin:.25rem 0 .5rem; }
.seletor-prod-head h5 { margin:0; }
.seletor-add-bar { display:flex; gap:.6rem; align-items:center; position:sticky; bottom:0; background:#fff; padding-top:.6rem; margin-top:.5rem; border-top:1px solid #eef2f7; }
.sc-qtd-txt { font-weight:700; color:#0f172a; }
.seletor-carrinho { padding:1rem; max-height:70vh; overflow:auto; background:#f8fafc; }
.sc-titulo { font-weight:700; margin-bottom:.5rem; }
.sc-item { border-bottom:1px solid #e2e8f0; padding:.4rem 0; }
.sc-item-top { display:flex; align-items:center; gap:.4rem; }
.sc-qtd { display:inline-flex; align-items:center; gap:.3rem; }
.sc-qtd button { border:none; background:#e2e8f0; border-radius:6px; width:22px; height:22px; cursor:pointer; }
.sc-nome { flex:1; font-size:.85rem; }
.sc-preco { font-size:.82rem; font-weight:600; }
.sc-remover { border:none; background:transparent; cursor:pointer; }
.sc-comp { font-size:.75rem; color:#64748b; padding-left:1.5rem; }
.sc-total { display:flex; justify-content:space-between; font-weight:700; margin-top:.5rem; padding-top:.5rem; border-top:2px solid #e2e8f0; }

/* Composicao */
.comp-corpo { padding:1.25rem; max-height:70vh; overflow:auto; }
.comp-grupo { margin-bottom:1rem; }
.comp-grupo-titulo { font-weight:700; margin-bottom:.4rem; }
.comp-obrig { font-size:.7rem; background:#fee2e2; color:#b91c1c; border-radius:6px; padding:.05rem .4rem; margin-left:.4rem; }
.comp-opcao { display:flex; align-items:center; gap:.5rem; padding:.3rem 0; cursor:pointer; }
.comp-opcao .comp-preco { margin-left:auto; color:#16a34a; font-size:.82rem; }
.comp-obs { margin-top:.75rem; }
