/* Balcão e caixa: operações, comandas e histórico no mesmo sistema visual. */
html body[data-brand="aura"][data-shell="panel"] .balcao-page {
  --closed-bg: var(--dash-surface);
  --closed-soft: var(--dash-muted-surface);
  --closed-line: var(--dash-border);
  --closed-ink: var(--dash-ink);
  --closed-muted: var(--dash-muted);
  --closed-accent: var(--dash-primary);
  --closed-avatar: var(--dash-subtle);
  --closed-ok: var(--dash-green);
  --closed-ok-bg: var(--dash-green-bg);
  --closed-danger: var(--dash-red);
  min-width: 0;
}
html body[data-brand="aura"][data-shell="panel"] .balcao-sections { display: grid; gap: 24px; min-width: 0; }
html body[data-brand="aura"][data-shell="panel"] .balcao-sections > div { min-width: 0; }
html body[data-brand="aura"][data-shell="panel"] .balcao-page .card { margin: 0; padding: 24px; min-width: 0; border: 1px solid var(--dash-border); background: var(--dash-surface); }
html body[data-brand="aura"][data-shell="panel"] .balcao-section-header { display: flex; flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 20px; margin: 0 0 20px; }
html body[data-brand="aura"][data-shell="panel"] .balcao-section-title { min-width: 0; flex: 1 1 260px; }
html body[data-brand="aura"][data-shell="panel"] .balcao-page h2 { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 0; font-size: 20px; line-height: 1.4; font-weight: 700; color: var(--dash-ink); }
html body[data-brand="aura"][data-shell="panel"] .balcao-section-title p { margin: 6px 0 0; color: var(--dash-muted); font-size: 13px; line-height: 1.6; }
html body[data-brand="aura"][data-shell="panel"] .balcao-page :is(.balcao-count,.closed-count,.balcao-status) { display: inline-flex; align-items: center; justify-content: center; flex: none; padding: 4px 10px; border-radius: 6px; background: var(--dash-muted-surface); color: var(--dash-muted); font-size: 12px; line-height: 20px; font-weight: 700; }
html body[data-brand="aura"][data-shell="panel"] .balcao-page :is(.balcao-count,.closed-count) { color: var(--dash-primary); background: var(--dash-subtle); }
html body[data-brand="aura"][data-shell="panel"] .balcao-status.is-open { background: var(--dash-green-bg); color: var(--dash-green); }
html body[data-brand="aura"][data-shell="panel"] .balcao-page .btn { min-height: 40px; height: auto; display: inline-flex; justify-content: center; align-items: center; gap: 7px; margin: 0; padding: 9px 14px; line-height: 1.4; }
html body[data-brand="aura"][data-shell="panel"] .balcao-page .btn > svg { flex: none; }
html body[data-brand="aura"][data-shell="panel"] .balcao-cash-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
html body[data-brand="aura"][data-shell="panel"] .balcao-cash .balcao-section-header:last-child { margin-bottom: 0; }
html body[data-brand="aura"][data-shell="panel"] .balcao-metrics { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 24px; padding-top: 20px; border-top: 1px solid var(--dash-border); }
html body[data-brand="aura"][data-shell="panel"] .balcao-metrics > div { display: grid; gap: 6px; min-width: 0; }
html body[data-brand="aura"][data-shell="panel"] .balcao-metrics span { color: var(--dash-muted); font-size: 13px; }
html body[data-brand="aura"][data-shell="panel"] .balcao-metrics strong { color: var(--dash-ink); font-size: clamp(22px,2.4vw,30px); line-height: 1.4; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
html body[data-brand="aura"][data-shell="panel"] .balcao-opening { max-width: 520px; }
html body[data-brand="aura"][data-shell="panel"] .balcao-opening form { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 16px; }
html body[data-brand="aura"][data-shell="panel"] .balcao-opening :is(.fld,.actions) { margin: 0; min-width: 0; grid-column: auto; }
html body[data-brand="aura"][data-shell="panel"] .balcao-opening .btn { min-height: 44px; }
html body[data-brand="aura"][data-shell="panel"] .balcao-cash-note p { margin: 8px 0 0; color: var(--dash-muted); line-height: 1.6; }
html body[data-brand="aura"][data-shell="panel"] .balcao-receipts-total { display: grid; gap: 4px; text-align: right; }
html body[data-brand="aura"][data-shell="panel"] .balcao-receipts-total span { font-size: 13px; color: var(--dash-muted); }
html body[data-brand="aura"][data-shell="panel"] .balcao-receipts-total strong { font-size: 24px; color: var(--dash-ink); font-variant-numeric: tabular-nums; }
html body[data-brand="aura"][data-shell="panel"] .balcao-footnote { margin: 16px 0 0; color: var(--dash-muted); font-size: 12px; line-height: 1.6; }

/* O ícone e o input compartilham uma única superfície e um único foco. */
html body[data-brand="aura"][data-shell="panel"] .balcao-page .balcao-search { display: flex; align-items: center; flex: 0 1 320px; width: 100%; min-width: 0; max-width: 320px; height: 44px; gap: 10px; margin: 0; padding: 0 14px; border: 1px solid var(--dash-control-border); border-radius: 8px; background: var(--dash-input); color: var(--dash-muted); }
html body[data-brand="aura"][data-shell="panel"] .balcao-search > svg { width: 18px; height: 18px; flex: none; }
html body[data-brand="aura"][data-shell="panel"] .balcao-page .balcao-search input { flex: 1 1 0; width: 0; min-width: 0; max-width: 100%; height: 100%; padding: 0!important; border: 0!important; border-radius: 0!important; background: transparent!important; color: var(--dash-ink); font-size: 14px; box-shadow: none!important; outline: none; }
html body[data-brand="aura"][data-shell="panel"] .balcao-page .balcao-search:focus-within { border-color: var(--dash-primary); outline: 0; box-shadow: var(--ring); }
html body[data-brand="aura"][data-shell="panel"] .balcao-page .balcao-search input::placeholder { color: var(--dash-muted); opacity: .85; }

html body[data-brand="aura"][data-shell="panel"] .balcao-page .cgrid { display: grid; grid-template-columns: repeat(auto-fill,minmax(min(100%,260px),1fr))!important; gap: 12px!important; margin: 0; }
html body[data-brand="aura"][data-shell="panel"] .balcao-page .ccard { display: grid; grid-template-columns: 44px minmax(0,1fr) 18px; align-items: center; gap: 12px!important; min-height: 88px; padding: 16px!important; border: 1px solid var(--dash-border); border-radius: 10px!important; background: var(--dash-surface); color: var(--dash-ink); text-align: left!important; box-shadow: none; }
html body[data-brand="aura"][data-shell="panel"] .balcao-page .ccard:hover { border-color: var(--dash-primary); background: var(--dash-hover); }
html body[data-brand="aura"][data-shell="panel"] .balcao-page .ccard:focus-visible { outline: 2px solid var(--dash-primary); outline-offset: 3px; }
html body[data-brand="aura"][data-shell="panel"] .balcao-page .ccard[aria-pressed="true"] { border-color: var(--dash-primary); background: var(--dash-subtle); }
html body[data-brand="aura"][data-shell="panel"] .balcao-page .ccard .ph { width: 44px!important; height: 44px; min-width: 0; aspect-ratio: 1; margin: 0!important; border-radius: 50%; background: var(--dash-subtle); color: var(--dash-primary); font-size: 16px!important; }
html body[data-brand="aura"][data-shell="panel"] .balcao-ticket-info { display: grid; gap: 5px; min-width: 0; }
html body[data-brand="aura"][data-shell="panel"] .balcao-page .ccard b { display: block; min-height: 0!important; margin: 0; color: var(--dash-ink); font-size: 14px!important; font-weight: 700; line-height: 1.45; overflow-wrap: anywhere; }
html body[data-brand="aura"][data-shell="panel"] .balcao-page .ccard small { margin: 0!important; font-size: 12px; font-weight: 400; color: var(--dash-muted); line-height: 1.5; overflow-wrap: anywhere; }
html body[data-brand="aura"][data-shell="panel"] .balcao-ticket-arrow { display: flex; color: var(--dash-muted); }
html body[data-brand="aura"][data-shell="panel"] .balcao-empty { grid-column: 1 / -1; padding: 32px 16px; text-align: center; border: 1px dashed var(--dash-control-border); border-radius: 10px; background: var(--dash-input); }
html body[data-brand="aura"][data-shell="panel"] .balcao-empty b { color: var(--dash-ink); font-weight: 600; }
html body[data-brand="aura"][data-shell="panel"] .balcao-empty p { margin: 6px 0 0; color: var(--dash-muted); font-size: 13px; line-height: 1.6; }

/* O histórico usa as cores do painel também quando vira cartões. */
html[data-theme] body[data-brand="aura"][data-shell="panel"] .balcao-page .closed-tickets {
  --closed-bg: var(--dash-surface); --closed-soft: var(--dash-muted-surface); --closed-line: var(--dash-border);
  --closed-ink: var(--dash-ink); --closed-muted: var(--dash-muted); --closed-accent: var(--dash-primary);
  --closed-avatar: var(--dash-subtle); --closed-ok: var(--dash-green); --closed-ok-bg: var(--dash-green-bg); --closed-danger: var(--dash-red);
  container: balcao-history / inline-size;
}
html body[data-brand="aura"][data-shell="panel"] .balcao-page :is(#ecl,.balcao-receipts) .scroll { border: 1px solid var(--dash-border); border-radius: 10px; max-width: 100%; }
html body[data-brand="aura"][data-shell="panel"] .balcao-page :is(#ecl,.balcao-receipts) table { width: 100%; min-width: 0; border-collapse: collapse; font-size: 13px; }
html body[data-brand="aura"][data-shell="panel"] .balcao-page :is(#ecl,.balcao-receipts) th { padding: 13px 14px; background: var(--dash-muted-surface); color: var(--dash-muted); font-size: 12px; font-weight: 700; text-transform: none; letter-spacing: 0; white-space: nowrap; }
html body[data-brand="aura"][data-shell="panel"] .balcao-page :is(#ecl,.balcao-receipts) td { padding: 16px 14px; border-bottom: 1px solid var(--dash-border); background: transparent; color: var(--dash-text); vertical-align: middle; }
html body[data-brand="aura"][data-shell="panel"] .balcao-page #ecl tr:last-child td { border-bottom: 0; }
html body[data-brand="aura"][data-shell="panel"] .balcao-page #ecl tbody tr:hover { background: var(--dash-hover); }
html body[data-brand="aura"][data-shell="panel"] .balcao-page #ecl :is(th,td):nth-child(4) { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
html body[data-brand="aura"][data-shell="panel"] .balcao-page .closed-person { gap: 10px; min-width: 150px; }
html body[data-brand="aura"][data-shell="panel"] .balcao-page .closed-person b { font-size: 13px; }
html body[data-brand="aura"][data-shell="panel"] .balcao-page .closed-person small { font-size: 12px; }
html body[data-brand="aura"][data-shell="panel"] .balcao-page .closed-total { color: var(--dash-ink); font-size: 14px; font-weight: 700; }
html body[data-brand="aura"][data-shell="panel"] .balcao-page #ecl :is(th,td):last-child { width: 260px; }
html body[data-brand="aura"][data-shell="panel"] .balcao-page .closed-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: nowrap; }
html body[data-brand="aura"][data-shell="panel"] .balcao-page .closed-actions .btn { min-height: 34px; padding: 7px 9px; font-size: 12px; gap: 5px; white-space: nowrap; }
html body[data-brand="aura"][data-shell="panel"] .balcao-page .closed-actions .closed-cancel { color: var(--dash-red); background: var(--dash-red-bg); border-color: transparent; }
html body[data-brand="aura"][data-shell="panel"] .balcao-page .closed-note { margin: 18px 0 0; padding-top: 16px; border-top: 1px solid var(--dash-border); font-size: 12px; line-height: 1.6; }
html body[data-brand="aura"][data-shell="panel"] .balcao-page #ecl > p { margin: 0; padding: 28px 16px; text-align: center; border: 1px dashed var(--dash-control-border); border-radius: 10px; background: var(--dash-input); color: var(--dash-muted); }
html body[data-brand="aura"][data-shell="panel"] .balcao-page #ecl .pager { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 18px; font-size: 12px; }
html body[data-brand="aura"][data-shell="panel"] .balcao-page #ecl .pager .rowbtns { display: flex!important; align-items: center; gap: 10px; width: auto; }
html body[data-brand="aura"][data-shell="panel"] .balcao-page #ecl .pager .btn { min-height: 36px; padding: 7px 12px; font-size: 12px; }
html body[data-brand="aura"][data-shell="panel"] .actions-bar:has(#newcmd) { display: flex!important; align-items: center; flex-wrap: wrap; gap: 10px; }
html body[data-brand="aura"][data-shell="panel"] .actions-bar:has(#newcmd) > .btn { min-height: 42px; height: auto; padding: 10px 16px; margin: 0; flex: none; font-size: 14px; line-height: 1.4; }

@container balcao-history (max-width: 800px) {
  html[data-theme] body[data-brand="aura"][data-shell="panel"] .balcao-page #ecl .scroll { border: 0; border-radius: 0; overflow: visible; background: transparent; }
  html[data-theme] body[data-brand="aura"][data-shell="panel"] .balcao-page #ecl :is(table,tbody,tr,td) { display: block; min-width: 0!important; max-width: 100%; width: 100%!important; box-sizing: border-box; }
  html[data-theme] body[data-brand="aura"][data-shell="panel"] .balcao-page #ecl thead { display: none; }
  html[data-theme] body[data-brand="aura"][data-shell="panel"] .balcao-page #ecl tbody { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,280px),1fr)); gap: 14px; }
  html[data-theme] body[data-brand="aura"][data-shell="panel"] .balcao-page #ecl tbody tr { display: grid; grid-template-columns: minmax(0,1fr) auto; grid-template-areas: "num num" "who who" "dt tot" "act act"; gap: 14px; align-items: start; margin: 0; padding: 16px; border: 1px solid var(--dash-border); border-radius: 10px; background: var(--dash-surface); }
  html[data-theme] body[data-brand="aura"][data-shell="panel"] .balcao-page #ecl tbody td { width: auto!important; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; text-align: left; }
  html[data-theme] body[data-brand="aura"][data-shell="panel"] .balcao-page #ecl td:nth-child(1) { grid-area: num; justify-self: stretch; }
  html[data-theme] body[data-brand="aura"][data-shell="panel"] .balcao-page #ecl td:nth-child(2) { grid-area: who; }
  html[data-theme] body[data-brand="aura"][data-shell="panel"] .balcao-page #ecl td:nth-child(3) { grid-area: dt; }
  html[data-theme] body[data-brand="aura"][data-shell="panel"] .balcao-page #ecl td:nth-child(4) { grid-area: tot; text-align: right; }
  html[data-theme] body[data-brand="aura"][data-shell="panel"] .balcao-page #ecl td:nth-child(5) { grid-area: act; width: 100%!important; }
  html[data-theme] body[data-brand="aura"][data-shell="panel"] .balcao-page #ecl .closed-mobile { display: inline; }
  html[data-theme] body[data-brand="aura"][data-shell="panel"] .balcao-page #ecl .closed-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
  html[data-theme] body[data-brand="aura"][data-shell="panel"] .balcao-page #ecl .closed-number { color: var(--dash-muted); font-size: 12px; }
  html[data-theme] body[data-brand="aura"][data-shell="panel"] .balcao-page #ecl .closed-status { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 6px; color: var(--dash-green); background: var(--dash-green-bg); font-size: 11px; font-weight: 600; }
  html[data-theme] body[data-brand="aura"][data-shell="panel"] .balcao-page #ecl .closed-field { display: block; margin-bottom: 5px; font-size: 11px; color: var(--dash-muted); text-transform: none; letter-spacing: 0; }
  html[data-theme] body[data-brand="aura"][data-shell="panel"] .balcao-page #ecl .closed-person { min-width: 0; }
  html[data-theme] body[data-brand="aura"][data-shell="panel"] .balcao-page #ecl .closed-actions { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; }
  html[data-theme] body[data-brand="aura"][data-shell="panel"] .balcao-page #ecl .closed-actions .btn { grid-column: auto; min-height: 40px; width: 100%; padding: 8px 4px; font-size: 11px; gap: 4px; border-radius: 8px; }
  html[data-theme] body[data-brand="aura"][data-shell="panel"] .balcao-page #ecl .closed-reopen { background: var(--dash-subtle); border-color: transparent; color: var(--dash-primary); }
  html[data-theme] body[data-brand="aura"][data-shell="panel"] .balcao-page #ecl .closed-cancel { background: var(--dash-red-bg); border-color: transparent; color: var(--dash-red); }
}

@media(max-width:700px) {
  html body[data-brand="aura"][data-shell="panel"] .balcao-sections { gap: 16px; }
  html[data-theme] body[data-brand="aura"][data-shell="panel"] .balcao-page .card { padding: 18px; border: 1px solid var(--dash-border); border-radius: 14px; background: var(--dash-surface); }
  html body[data-brand="aura"][data-shell="panel"] .balcao-page h2 { font-size: 18px; }
  html body[data-brand="aura"][data-shell="panel"] .balcao-section-header { align-items: stretch; flex-direction: column; gap: 16px; }
  html body[data-brand="aura"][data-shell="panel"] .balcao-section-title { flex-basis: auto; }
  html body[data-brand="aura"][data-shell="panel"] .balcao-page .balcao-search { flex: none; max-width: none; }
  html body[data-brand="aura"][data-shell="panel"] .balcao-cash-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  html body[data-brand="aura"][data-shell="panel"] .balcao-cash-actions .btn { padding: 10px 6px; font-size: 12px; min-height: 44px; }
  html body[data-brand="aura"][data-shell="panel"] .balcao-metrics { gap: 16px; padding-top: 16px; }
  html body[data-brand="aura"][data-shell="panel"] .balcao-metrics strong { font-size: 22px; }
  html body[data-brand="aura"][data-shell="panel"] .balcao-receipts-total { text-align: left; }
  html body[data-brand="aura"][data-shell="panel"] .balcao-page #ecl .pager { align-items: stretch; flex-direction: column; }
  html body[data-brand="aura"][data-shell="panel"] .balcao-page #ecl .pager .rowbtns { display: grid!important; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr)!important; width: 100%; }
  html body[data-brand="aura"][data-shell="panel"] .actions-bar:has(#newcmd) { display: grid!important; grid-template-columns: repeat(2,minmax(0,1fr))!important; width: 100%; }
  html body[data-brand="aura"][data-shell="panel"] .actions-bar:has(#newcmd) > .btn { width: 100%!important; min-width: 0; min-height: 44px; padding: 10px 8px; font-size: 13px; }
  html body[data-brand="aura"][data-shell="panel"] .actions-bar:has(#newcmd) > #newcmd { order: -1; height: auto; font-size: 13px; }
}
@media(max-width:380px) {
  html[data-theme] body[data-brand="aura"][data-shell="panel"] .balcao-page .card { padding: 14px; }
  html body[data-brand="aura"][data-shell="panel"] .balcao-opening form { grid-template-columns: minmax(0,1fr); }
  html body[data-brand="aura"][data-shell="panel"] .balcao-opening .btn { width: 100%; }
  html body[data-brand="aura"][data-shell="panel"] .balcao-metrics { grid-template-columns: minmax(0,1fr); }
}
