/* O caixa navega as mesas pela Visão geral. A comanda aberta merece toda a
   largura útil, sem uma coluna lateral comprimindo itens e ações. */
#operationPage.layout{display:block;max-width:1480px;margin:0 auto}
#operationPage .table-actions{display:none}
#operationPage .workspace{width:100%;min-width:0}
#operationPage #tabView{min-width:0}
#operationPage #tabView>.panel-title{align-items:flex-start}
#operationPage #tabItems .item{min-width:0}

@media(max-width:760px){
  #operationPage .workspace{padding:13px}
  #operationPage #tabView>.panel-title{gap:10px}
  #operationPage #tabView>.panel-title .button-row{justify-content:flex-start;width:100%}
}

.workforce-profile,.workforce-shift{padding:13px 0;border-bottom:1px solid var(--edge)}
.workforce-profile .button-row,.workforce-shift .button-row{justify-content:flex-start;flex-wrap:wrap;margin-top:9px}
.workforce-profile .button-row button,.workforce-shift .button-row button{padding:8px 10px}
.shift-edit-form{margin-top:12px;padding:12px;border:1px solid #715034;border-radius:10px;background:#1b120f}
.shift-edit-form .button-row{margin-top:12px}
.workforce-shift.is-open{border-left:3px solid var(--accent);padding-left:10px}
@media(max-width:760px){.workforce-profile .finance-row,.workforce-shift .finance-row{align-items:flex-start;flex-direction:column}.workforce-profile .button-row button,.workforce-shift .button-row button{width:100%}.shift-edit-form{display:grid;gap:2px}}

/* Cartões de mesa: resumo operacional para o caixa, sem abrir a comanda. */
.dashboard-table-grid .dashboard-table-button.table-rich{align-items:stretch;background:linear-gradient(145deg,#271712,#1b100d);border:1px solid #5b392b;border-left:5px solid #8b6250;border-radius:14px;color:#fff7ef;display:flex;flex-direction:column;gap:8px;justify-content:flex-start;min-height:210px;padding:15px;text-align:left}
.dashboard-table-grid .dashboard-table-button.table-rich:hover,.dashboard-table-grid .dashboard-table-button.table-rich:focus-visible{border-color:#f5ad3b;box-shadow:0 0 0 2px rgba(245,173,59,.2);transform:translateY(-2px)}
.dashboard-table-grid .dashboard-table-button.table-rich.is-active{border-left-color:#4db77a}.dashboard-table-grid .dashboard-table-button.table-rich.has-new{border-left-color:#f4ad3d;box-shadow:0 0 0 1px rgba(244,173,61,.45),0 0 20px rgba(244,173,61,.12)}
.table-rich-header,.table-rich-footer{align-items:center;display:flex;justify-content:space-between;gap:10px}.table-rich-number{font-size:1.14rem;font-weight:850}.table-rich-status{background:#39231a;border-radius:999px;color:#f9ca77;font-size:.74rem;font-weight:800;padding:5px 8px;text-transform:uppercase}.has-new .table-rich-status{background:#9a5818;color:#fff}
.table-rich-client{font-size:.98rem;line-height:1.25;min-height:2.45em;overflow:hidden}.table-rich-detail{color:#d9c5b8;font-size:.82rem;line-height:1.35;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.table-rich-footer{border-top:1px solid #523629;margin-top:auto;padding-top:10px}.table-rich-footer strong{color:#f6b142;font-size:1.18rem}.table-rich-footer small{color:#d6c2b5;font-size:.73rem;max-width:54%;text-align:right}.table-rich-action{color:#f7ba54;font-size:.82rem;font-weight:800}
@media(max-width:700px){.dashboard-table-grid .dashboard-table-button.table-rich{min-height:184px;padding:12px}.table-rich-number{font-size:1rem}.table-rich-client{font-size:.88rem}.table-rich-detail{font-size:.74rem}.table-rich-footer strong{font-size:1rem}}

.dashboard-table-grid .dashboard-table-button.table-rich{position:relative;overflow:visible}
.table-rich-main{align-items:stretch;background:transparent;border:0;color:inherit;cursor:pointer;display:flex;flex:1;flex-direction:column;gap:8px;min-width:0;padding:0;text-align:left;width:100%}
.table-rich-main:focus-visible{outline:2px solid #f5ad3b;outline-offset:4px}
.table-tabs-menu{background:#17100d;border:1px solid #a86d28;border-radius:10px;box-shadow:0 13px 25px rgba(0,0,0,.45);display:flex;flex-direction:column;gap:6px;left:10px;opacity:0;padding:10px;pointer-events:none;position:absolute;right:10px;top:calc(100% - 4px);transform:translateY(-7px);transition:opacity .16s ease,transform .16s ease;visibility:hidden;z-index:20}
.table-rich:hover .table-tabs-menu,.table-rich:focus-within .table-tabs-menu{opacity:1;pointer-events:auto;transform:translateY(0);visibility:visible}
.table-tabs-menu>span{color:#f2b44c;font-size:.72rem;font-weight:850;letter-spacing:.06em;text-transform:uppercase}.table-tabs-menu button{background:#2a1913;border:1px solid #60402f;border-radius:7px;color:#fff7ef;cursor:pointer;font-size:.82rem;padding:9px;text-align:left}.table-tabs-menu button:hover,.table-tabs-menu button:focus-visible{background:#4a2c1b;border-color:#f5ad3b}.table-tabs-menu button b{float:right;color:#f5ad3b}
.table-tabs-empty{color:#ddc7b8;font-size:.8rem;line-height:1.4}.table-rich-menu-hint{border-top:1px dashed #684530;color:#f5ba55;font-size:.75rem;font-weight:800;margin-top:2px;padding-top:8px}
@media(max-width:700px){.table-tabs-menu{left:5px;right:5px}.table-tabs-menu button{font-size:.78rem}}

/* Mapa de mesas: leitura confortável no computador e toque seguro no celular. */
.dashboard-tables .dashboard-table-grid{grid-template-columns:repeat(auto-fill,minmax(285px,1fr));gap:16px}
.dashboard-table-grid .dashboard-table-button.table-rich{gap:10px;min-height:238px;padding:17px}
.table-rich-header{align-items:flex-start}.table-rich-number{font-size:1.22rem;line-height:1.1}.table-rich-status{line-height:1.15;max-width:138px;text-align:center}
.table-rich-client{min-height:0;overflow:visible}.table-rich-detail{overflow:visible;text-overflow:clip;white-space:normal}.table-rich-footer small{line-height:1.28;max-width:50%}
.table-rich-main{gap:10px}.table-rich-action{background:#4b2b18;border-radius:8px;padding:8px 10px;text-align:center}
.table-rich-menu-toggle{align-items:center;background:transparent;border:0;border-top:1px dashed #684530;color:#f5ba55;cursor:pointer;display:flex;font-size:.78rem;font-weight:800;justify-content:space-between;margin-top:1px;padding:9px 0 0;text-align:left;width:100%}.table-rich-menu-toggle span{font-size:1rem;transition:transform .16s ease}.table-rich.menu-open .table-rich-menu-toggle span{transform:rotate(180deg)}
.table-rich-no-tabs{border-top:1px dashed #684530;color:#bca79b;font-size:.76rem;padding-top:10px}
.dashboard-tabs-dialog{background:#251712;border:1px solid #b67829;border-radius:16px;color:#fff8f3;max-width:520px;padding:0;width:min(92vw,520px)}.dashboard-tabs-dialog::backdrop{background:rgba(10,5,3,.72);backdrop-filter:blur(3px)}.dashboard-tabs-dialog-head{align-items:center;border-bottom:1px solid #60402f;display:flex;justify-content:space-between;padding:20px 20px 14px}.dashboard-tabs-dialog-head h3{margin:2px 0 0}.dashboard-tabs-dialog>.muted{display:block;line-height:1.45;margin:15px 20px}.dashboard-tabs-dialog-list{display:grid;gap:9px;padding:0 20px 20px}.dashboard-tabs-dialog-list button{align-items:center;background:#1a100d;border:1px solid #654331;border-radius:10px;color:#fff8f3;cursor:pointer;display:flex;justify-content:space-between;padding:14px;text-align:left}.dashboard-tabs-dialog-list button:hover,.dashboard-tabs-dialog-list button:focus-visible{border-color:#f5ad3b;background:#342015}.dashboard-tabs-dialog-list button span{display:grid;gap:3px}.dashboard-tabs-dialog-list button small{color:#d7c0b2}.dashboard-tabs-dialog-list button b{color:#f5ba55;font-size:1.15rem}.dashboard-tabs-dialog-list button.tab-pending{border-color:#eeb041;box-shadow:0 0 0 1px rgba(238,176,65,.28)}
.table-rich.menu-open .table-tabs-menu{opacity:1;pointer-events:auto;transform:translateY(0);visibility:visible}
@media(max-width:700px){.dashboard-tables .dashboard-table-grid{gap:11px;grid-template-columns:repeat(2,minmax(0,1fr))}.dashboard-table-grid .dashboard-table-button.table-rich{min-height:236px;padding:13px}.table-rich-status{font-size:.67rem;max-width:96px;padding:5px 6px}.table-rich-client{font-size:.9rem}.table-rich-detail{font-size:.75rem}.table-rich-footer small{font-size:.7rem}.table-rich-action{font-size:.78rem;padding:8px}.table-rich-menu-toggle{font-size:.72rem}}
@media(max-width:520px){.dashboard-tables .dashboard-table-grid{grid-template-columns:1fr}.dashboard-table-grid .dashboard-table-button.table-rich{min-height:0}.table-rich-status{max-width:145px}.table-rich-client{font-size:1rem}.table-rich-detail{font-size:.83rem}}

/* Tela da mesa: o caixa precisa reconhecer onde está e agir sem procurar botões. */
#operationPage .workspace #selectedTable{background:linear-gradient(145deg,#302019,#241713);border:1px solid #815436;border-radius:16px;padding:22px}
#operationPage .workspace #selectedTable .selected-table-head{align-items:flex-start;border-bottom:1px solid #5d3d2d;margin-bottom:14px;padding-bottom:15px}
#operationPage .workspace #selectedTable h2{font-size:1.65rem;margin:4px 0 0}.selected-table-head .button-row{align-items:center;gap:9px}.selected-table-head .button-row button{min-height:42px}
#selectedTableInfo{background:#18100d;border-left:4px solid #e7a63b;border-radius:8px;color:#ead6c4;margin:0 0 16px;padding:13px 14px}
#selectedTable #tabChoices{display:grid;gap:10px;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));margin-top:16px}
#selectedTable #tabChoices button{align-items:flex-start;background:#1b120f;border:1px solid #67432e;border-radius:11px;display:flex;flex-direction:column;gap:5px;padding:14px;text-align:left}#selectedTable #tabChoices button:hover{border-color:#f3ae3d;background:#342015}
#selectedTable #addTabForm{background:#1b120f;border:1px solid #704a31;border-radius:12px;margin-top:16px;padding:17px}
@media(max-width:700px){#operationPage .workspace #selectedTable{border-radius:12px;padding:15px}.selected-table-head .button-row{width:100%}.selected-table-head .button-row button{flex:1}.selected-table-head{gap:12px}#operationPage .workspace #selectedTable h2{font-size:1.38rem}#selectedTable #tabChoices{grid-template-columns:1fr}}

/* Cabeçalho da comanda: identidade clara, atalhos próximos e leitura rápida. */
#operationPage .workspace #tabView{background:linear-gradient(145deg,#2d1d17,#251713);border:1px solid #765039;border-radius:16px;padding:22px}
#operationPage .workspace #tabView>.panel-title{border-bottom:1px solid #5d3d2d;margin-bottom:16px;padding-bottom:16px}#tabMeta{color:#f3b54b;font-size:.78rem;font-weight:850;letter-spacing:.09em}#tabTitle{font-size:1.7rem;margin:5px 0 0}
#tabView>.panel-title .button-row{gap:9px;justify-content:flex-end}
#tabView #tabItems>.hint{background:#17100d;border-left:4px solid #9e724b;border-radius:8px;padding:14px}#tabView>hr{border-color:#5a3a2b;margin:22px 0}
@media(max-width:800px){#operationPage .workspace #tabView{border-radius:12px;padding:15px}#tabView>.panel-title .button-row{justify-content:flex-start;width:100%}#tabView>.panel-title .button-row button{flex:1;min-height:42px}#tabTitle{font-size:1.4rem}}
@media(max-width:520px){#tabView>.panel-title .button-row{display:grid;grid-template-columns:1fr 1fr}#tabView>.panel-title .button-row button:last-child{grid-column:1/-1}#tabView>.panel-title .button-row button{font-size:.78rem;padding:9px 7px}}

/* Escolha de comandas: tela intermediária do caixa, antes de abrir um cliente. */
#selectedTable #tabChoices{display:block;margin-top:20px}.tab-choice-heading{align-items:center;border-bottom:1px solid #5b3b2c;display:flex;justify-content:space-between;margin-bottom:13px;padding-bottom:12px}.tab-choice-heading h3{font-size:1.05rem;margin:4px 0 0}.tab-choice-heading>span{background:#51301a;border-radius:999px;color:#f6bc59;font-size:.78rem;font-weight:850;padding:7px 10px}.tab-choice-grid{display:grid;gap:12px;grid-template-columns:repeat(auto-fit,minmax(245px,1fr))}
#selectedTable #tabChoices .tab-choice-card{align-items:flex-start;background:linear-gradient(145deg,#21140f,#18100d);border:1px solid #714a31;border-left:4px solid #e5a33b;border-radius:12px;color:#fff7f0;display:flex;gap:6px;padding:15px;text-align:left}.tab-choice-card:hover,.tab-choice-card:focus-visible{background:#342015;border-color:#f5b247;transform:translateY(-1px)}.tab-choice-number{color:#efb047;font-size:.75rem;font-weight:900;letter-spacing:.08em}.tab-choice-card strong{font-size:1.05rem}.tab-choice-card small{color:#d9c3b5;line-height:1.3}.tab-choice-card b{color:#f1b34b;font-size:.82rem;margin-top:4px}
#selectedTable #tabChoices .tab-choice-card.tab-choice-pending{animation:tab-choice-new-order-pulse 1.1s ease-in-out infinite;background:linear-gradient(145deg,#4a2a16,#20120d);border-color:#f7b548;border-left-color:#ffd16b;box-shadow:0 0 0 1px rgba(247,181,72,.35),0 0 20px rgba(245,174,61,.22)}.tab-choice-alert{align-items:center;background:#e34c3e;border-radius:999px;color:#fff;display:inline-flex;font-size:.7rem;font-weight:900;gap:6px;letter-spacing:.035em;margin:2px 0 3px;padding:5px 8px;text-transform:uppercase}.tab-choice-alert i{animation:tab-choice-alert-light .9s ease-in-out infinite alternate;background:#fff4bf;border-radius:50%;box-shadow:0 0 8px #fff4bf;height:7px;width:7px}@keyframes tab-choice-new-order-pulse{0%,100%{box-shadow:0 0 0 1px rgba(247,181,72,.3),0 0 13px rgba(245,174,61,.16);filter:brightness(1)}50%{box-shadow:0 0 0 2px rgba(255,208,107,.92),0 0 31px rgba(245,174,61,.56);filter:brightness(1.13)}}@keyframes tab-choice-alert-light{to{box-shadow:0 0 15px 4px #fff4bf;opacity:.5;transform:scale(.8)}}
.selected-table-head .table-add-tab{align-items:flex-start;background:linear-gradient(135deg,#f5b447,#df9224);border:1px solid #ffc869;border-radius:11px;color:#211308;display:flex;flex-direction:column;font-weight:900;gap:2px;min-width:175px;padding:10px 14px;text-align:left}.selected-table-head .table-add-tab:hover{background:linear-gradient(135deg,#ffca68,#efaa3a);border-color:#ffdc93}.selected-table-head .table-add-tab span{font-size:.92rem}.selected-table-head .table-add-tab small{color:#56300b;font-size:.7rem;font-weight:700}
#goHomeFromTable{background:#45291a;border-color:#d99a3e;color:#fff5e5;font-weight:850;min-height:52px}#goHomeFromTable:hover,#goHomeFromTable:focus-visible{background:#613a20;border-color:#ffd17a;box-shadow:0 0 0 2px rgba(245,177,63,.22)}
@media(max-width:700px){.tab-choice-heading{align-items:flex-start;gap:10px}.tab-choice-heading h3{font-size:.96rem}.tab-choice-grid{grid-template-columns:1fr}.tab-choice-card{min-height:112px}}

/* Baixa rápida: retirada financeira fica separada do estoque, mas no mesmo
   ponto operacional para o caixa não esquecer de registrá-la. */
.cash-withdrawal-panel{align-items:end;background:linear-gradient(120deg,#21150f,#17110e);border:1px solid #80542f;border-radius:12px;display:grid;gap:14px;grid-template-columns:minmax(220px,.85fr) minmax(0,1.65fr);padding:15px}.cash-withdrawal-panel h3{margin:2px 0 5px}.cash-withdrawal-panel p:not(.eyebrow){color:var(--muted);font-size:.86rem;margin:0}.cash-withdrawal-form{align-items:end;display:grid;gap:10px;grid-template-columns:minmax(120px,.55fr) minmax(190px,1.45fr) auto}.cash-withdrawal-form label{margin:0}.cash-withdrawal-form button{align-self:end;min-height:43px;white-space:nowrap}@media(max-width:760px){.cash-withdrawal-panel,.cash-withdrawal-form{grid-template-columns:1fr}.cash-withdrawal-form button{width:100%}}

/* Alerta de lançamento novo: chama atenção sem esconder o conteúdo da mesa. */
@keyframes table-new-order-pulse{0%,100%{box-shadow:0 0 0 1px rgba(244,173,61,.45),0 0 12px rgba(244,173,61,.1);filter:brightness(1)}50%{box-shadow:0 0 0 2px rgba(255,199,93,.95),0 0 30px rgba(244,173,61,.52);filter:brightness(1.16)}}
.dashboard-table-grid .dashboard-table-button.table-rich.has-new{animation:table-new-order-pulse 1.15s ease-in-out infinite}
.table-tabs-menu button{align-items:center;display:flex;justify-content:space-between}.table-tabs-menu button span{min-width:0}.table-tabs-menu button em{color:#ffce76;font-size:.72rem;font-style:normal;font-weight:900;margin-left:4px;white-space:nowrap}.table-tabs-menu button.tab-pending{animation:table-new-order-pulse 1.05s ease-in-out infinite;background:#5b3118;border-color:#f7b548;color:#fff}.table-tabs-menu button.tab-pending:hover,.table-tabs-menu button.tab-pending:focus-visible{background:#70411d;border-color:#ffe09b}
@media(prefers-reduced-motion:reduce){.dashboard-table-grid .dashboard-table-button.table-rich.has-new,.table-tabs-menu button.tab-pending,.tab-choice-card.tab-choice-pending,.tab-choice-alert i{animation:none}}

/* Fechamento de comanda: espaço real para dividir itens sem apertar controles. */
dialog#paymentDialog{width:min(920px,calc(100vw - 40px));max-width:920px;max-height:calc(100dvh - 32px);padding:22px;overflow:auto}
#paymentDialog form{min-width:0}#paymentDialog #paymentExtras{margin:14px 0}#paymentDialog .payment-item-picker{padding:16px}#paymentDialog .payment-item-list{max-height:min(38vh,360px);padding-right:4px}
#paymentDialog .shared-payment-row{display:grid;grid-template-columns:minmax(220px,1fr) minmax(350px,430px);align-items:center;gap:18px;padding:14px 16px}
#paymentDialog .shared-payment-controls{display:grid;align-items:end;gap:10px;width:100%;text-align:left}#paymentDialog .portion-payment-controls{grid-template-columns:48px 150px 104px;justify-content:end}#paymentDialog .unit-payment-controls{grid-template-columns:48px 72px 104px;justify-content:end}
#paymentDialog .shared-payment-controls label{min-width:0;margin:0;color:var(--muted);font-size:.78rem;line-height:1.15}#paymentDialog .shared-payment-controls label input{min-width:0;width:100%;margin-top:5px;text-align:right;font-variant-numeric:tabular-nums}
#paymentDialog .shared-payment-controls button{width:100%;height:46px;min-height:46px;padding:7px 9px;font-size:.95rem;white-space:nowrap}#paymentDialog .shared-payment-controls button:first-child{font-size:1.35rem}#paymentDialog .payment-item-subtotal{margin-top:14px;padding-top:12px;border-top:1px solid var(--edge)}
#paymentDialog .payment-unit-count{display:grid;place-items:center;min-height:46px;border:1px solid #684731;border-radius:9px;background:#17100d;color:#ffd17a;font-variant-numeric:tabular-nums;white-space:nowrap}
@media(max-width:760px){dialog#paymentDialog{width:calc(100vw - 12px);max-width:none;max-height:calc(100dvh - 12px);padding:15px;border-radius:14px}#paymentDialog .payment-item-picker{padding:12px}#paymentDialog .payment-item-list{max-height:34vh}#paymentDialog .shared-payment-row{grid-template-columns:1fr;gap:12px;padding:13px}#paymentDialog .portion-payment-controls{grid-template-columns:48px minmax(0,1fr) 94px;gap:8px;justify-content:stretch}#paymentDialog .unit-payment-controls{grid-template-columns:48px 72px 94px;gap:8px;justify-content:start}#paymentDialog .shared-payment-controls button{height:48px;min-height:48px;padding:6px}}
