body.admin { background: var(--ground); }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login { width: min(400px, 100%); padding: 28px; display: flex; flex-direction: column; gap: 14px; }

.shell { display: flex; flex-wrap: wrap; min-height: 100vh; }
.side {
  flex: 1 1 230px; max-width: 250px; background: var(--ink); color: var(--mc-creme); padding: 18px 12px; display: flex; flex-direction: column; gap: 4px;
}
.product { font-family: var(--display); font-size: 20px; font-weight: 700; letter-spacing: -0.01em; color: var(--mc-creme); padding: 4px 10px 14px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 10px; margin: 0 2px 4px; border: 1px solid var(--mc-grafite-2); border-radius: 12px; }
.brand .mark { width: 38px; height: 38px; border-radius: 11px; background: var(--accent); color: var(--on-accent); display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 800; overflow: hidden; flex-shrink: 0; }
.brand .mark img { width: 100%; height: 100%; object-fit: cover; }
.brand .t { display: flex; flex-direction: column; min-width: 0; }
.brand .t strong { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand .t span { font-size: 12px; color: var(--mc-texto-sobre-escuro); }
.nav a { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 12px; border-radius: 10px; color: var(--mc-creme); text-decoration: none; font-weight: 700; font-size: 16px; }
.nav a:hover { background: var(--mc-grafite-2); }
.nav a.active { background: var(--mc-verde); color: var(--mc-grafite); }
.nav-group { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--mc-texto-sobre-escuro); padding: 14px 12px 6px; }
.side .foot { margin-top: auto; padding: 12px 8px 0; font-size: 14px; color: var(--mc-texto-sobre-escuro); display: flex; flex-direction: column; gap: 8px; }
.side .foot button { background: transparent; border: 1px solid var(--mc-linha-escura); color: var(--mc-creme); border-radius: 10px; min-height: 38px; cursor: pointer; font-weight: 700; }

.main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 22px; border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 30; }
.topbar h1 { font-size: 22px; }
.content { padding: 20px 22px 60px; display: flex; flex-direction: column; gap: 16px; }
.menu-toggle { display: none; }

/* Topo: interruptor "Recebendo pedidos" em destaque; botões secundários discretos. */
.switch.pill { padding: 0 14px 0 7px; min-height: 40px; border-radius: 999px; background: var(--soft); color: var(--ink-2); }
.switch.pill:has(input:checked) { background: var(--ok-soft); color: var(--ok); }
.drawer-only { display: none; }
.side .foot .btn { justify-content: flex-start; border-color: var(--mc-linha-escura); background: transparent; color: var(--mc-creme); }

@media (max-width: 860px) {
  .side { max-width: none; flex-basis: 100%; padding: 10px 12px; display: none; }
  .side.open { display: flex; }
  .menu-toggle { display: inline-flex; }
  .content { padding: 16px 14px 60px; }
  .topbar { padding: 10px 14px; gap: 8px; flex-wrap: nowrap; }
  .topbar h1 { font-size: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .topbar .spacer { min-width: 0; }
  .topbar .switch, .topbar .btn { flex-shrink: 0; }
  /* No celular: só o ícone do som; avisos e "Ver cardápio" ficam no rodapé do menu. */
  .topbar .tb-label, .topbar .tb-wide { display: none; }
  .topbar .btn.small:has(.tb-label) { width: 44px; min-height: 44px; padding: 0; }
  .drawer-only { display: inline-flex; }
}
/* Celular estreito: o interruptor mostra só a chave (o nome continua no aria-label e no title),
   para o título da tela caber inteiro. */
@media (max-width: 420px) {
  .topbar .switch.pill { padding: 0 7px; }
  .topbar .switch.pill > span { display: none; }
}

.switch { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; cursor: pointer; min-height: 44px; }
.switch input { appearance: none; width: 46px; height: 26px; border-radius: 999px; background: var(--mc-neutro); position: relative; cursor: pointer; transition: background .15s; flex-shrink: 0; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked { background: var(--ok); }
.switch input:checked::after { transform: translateX(20px); }

.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.kpi { padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.kpi .l { font-size: 14px; font-weight: 700; color: var(--muted); }
.kpi .v { font-family: var(--display); font-size: 28px; font-weight: 800; }
.kpi .s { font-size: 14px; color: var(--ink-2); font-weight: 600; }
.kpi.highlight { background: var(--ok); border-color: var(--ok); color: #fff; }
.kpi.highlight .l, .kpi.highlight .s { color: #D9F2EE; }

.panel { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.panel h2 { font-size: 18px; }
.panel-row { display: flex; flex-wrap: wrap; gap: 14px; }
.panel-row > * { flex: 1 1 320px; min-width: 0; }

.tabs-line { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs-line button { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.tabs-line button.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.tabs-line .n { background: var(--soft); color: var(--ink); border-radius: 999px; padding: 0 7px; font-size: 12px; min-width: 22px; }
.tabs-line button.active .n { background: var(--mc-grafite-2); color: #fff; }
/* Pedidos: seletor "Em andamento / Histórico do dia" e filtros de status. */
.seg { display: inline-flex; align-self: flex-start; gap: 2px; padding: 3px; border-radius: 12px; background: var(--soft); }
.seg button { min-height: 40px; padding: 0 16px; border: 0; border-radius: 10px; background: transparent; color: var(--ink-2); font-weight: 700; font-size: 14px; cursor: pointer; }
.seg button.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(27, 34, 38, .14); }
.status-tabs button { font-size: 15px; }
@media (max-width: 860px) {
  /* Uma linha que rola para o lado, em vez de 3 linhas de filtros. */
  .status-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: -5px -14px; padding: 5px 14px; }
  .status-tabs::-webkit-scrollbar { display: none; }
  .status-tabs button { flex: 0 0 auto; font-size: 14px; }
}

.order { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; border-top: 5px solid var(--line-2); }
.order.s-aguardando_pagamento { border-top-color: #A8A29E; }
.order.s-novo { border-top-color: var(--info); }
.order.s-preparando { border-top-color: var(--warn); }
.order.s-pronto { border-top-color: var(--ok); }
.order.s-saiu { border-top-color: #7C3AED; }
.order .head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.order .num { font-family: var(--display); font-size: 22px; font-weight: 800; }
.order .meta { font-size: 14px; color: var(--muted); font-weight: 600; }
.order .items { display: flex; flex-direction: column; gap: 2px; font-size: 16px; }
.order .items .note { color: var(--warn); font-weight: 700; font-size: 14px; padding-left: 18px; }
.order .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.late { color: #fff; background: var(--danger); }
/* Cartão de pedido (2.5): ação principal + WhatsApp, impressão e "Mais". */
.order-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--line); }
.order-foot .btn.main { flex: 1 1 170px; min-height: 44px; padding: 0 14px; font-size: 15px; white-space: nowrap; }
.order-wait { flex: 1 1 170px; display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 14px; font-weight: 700; color: var(--muted); }
.order-tools { display: flex; gap: 8px; margin-left: auto; }
.courier-row { display: flex; align-items: center; gap: 10px; }
.courier-row label { font-size: 14px; font-weight: 700; color: var(--ink-2); }
.courier-row .input { flex: 1; min-width: 0; }
.sheet-list { display: flex; flex-direction: column; }
.sheet-group { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 12px 0 2px; }
.sheet-group:first-child { margin-top: 0; }
.sheet-action { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 0 8px; border: 0; border-bottom: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--ink); font-weight: 700; font-size: 16px; text-align: left; text-decoration: none; cursor: pointer; }
.sheet-action:hover { background: var(--soft); }
.sheet-action.danger { color: var(--danger); border-bottom: 0; }
.wa-msg { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; width: 100%; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); color: var(--ink); text-align: left; cursor: pointer; }
.wa-msg:hover { border-color: var(--mc-verde-escuro); }
.wa-msg strong { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.wa-msg .txt { font-size: 14px; font-weight: 500; color: var(--ink-2); white-space: pre-wrap; }

table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-size: 13px; color: var(--muted); font-weight: 800; padding: 10px 10px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
table.t td { padding: 10px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t td.num, table.t th.num { text-align: right; white-space: nowrap; }
.table-wrap { overflow-x: auto; }

.menu-cat { padding: 0; overflow: hidden; }
.menu-cat .cat-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 16px; background: var(--ground); border-bottom: 1px solid var(--line); }
.menu-item { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.menu-item:last-child { border-bottom: 0; }
.menu-item .thumb { width: 52px; height: 52px; border-radius: 10px; background: #F3E8DC; color: #9A6B47; display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0; }
.menu-item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.menu-item .info { flex: 1 1 200px; min-width: 0; }
.menu-item .info .n { font-weight: 800; }
.menu-item .info .d { font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toggles { display: flex; gap: 6px; flex-wrap: wrap; }
.tg { min-height: 34px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); font-size: 13px; font-weight: 800; cursor: pointer; }
.tg.on-available { background: var(--ok-soft); color: var(--ok); border-color: #BFE3DD; }
.tg.off-available { background: #EEE8E2; color: var(--ink-2); }
.tg.on-new { background: #E8F0FF; color: #1E40AF; border-color: #C7D7FE; }
.tg.on-featured { background: var(--warn-soft); color: var(--warn); border-color: #F5D9B3; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 200px; border-bottom: 1px solid var(--line-2); padding-top: 18px; }
.bars .b { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; height: 100%; min-width: 0; }
.bars .bar { width: 100%; max-width: 46px; background: var(--mc-verde); border-radius: 8px 8px 0 0; }
.bars .bar.max { background: var(--mc-verde-escuro); }
.bars .v { font-size: 12px; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.bars-x { display: flex; gap: 6px; }
.bars-x span { flex: 1; text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); min-width: 0; overflow: hidden; }
.hbar { height: 10px; background: var(--soft); border-radius: 999px; overflow: hidden; }
.hbar > div { height: 100%; background: var(--mc-verde-escuro); border-radius: 999px; }

.pdv { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.pdv .catalog { flex: 999 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.pdv .ticket { flex: 1 1 340px; min-width: 0; position: sticky; top: 80px; }
.pdv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.pdv-item { text-align: left; min-height: 84px; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; display: flex; flex-direction: column; gap: 6px; }
.pdv-item:disabled { opacity: .5; cursor: not-allowed; }
.pdv-item .n { font-weight: 800; font-size: 16px; line-height: 1.25; }
.pdv-item .p { font-weight: 700; color: var(--ink-2); margin-top: auto; }
.ticket-line { display: flex; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.ticket-line .info { flex: 1; min-width: 0; }
.qty { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--line-2); border-radius: 10px; }
.qty button { width: 34px; height: 34px; border: 0; background: transparent; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.qty span { min-width: 20px; text-align: center; font-weight: 800; }

/* Mensagens de WhatsApp (Configurações, P2c) */
.wa-editor .wa-legend { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 0; font-size: 14px; color: var(--ink-2); }
.wa-editor .wa-legend dt { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; font-weight: 700; color: var(--ink); }
.wa-editor .wa-legend dd { margin: 0; }
.wa-list { display: flex; flex-direction: column; gap: 10px; }
.wa-item { border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); }
.wa-item.has-error { border-color: var(--danger); }
.wa-item summary { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 52px; padding: 10px 14px; cursor: pointer; list-style: none; font-weight: 700; font-size: 15px; }
.wa-item summary::-webkit-details-marker { display: none; }
.wa-item summary::after { content: ''; margin-left: auto; width: 9px; height: 9px; border-right: 2px solid var(--ink-2); border-bottom: 2px solid var(--ink-2); transform: rotate(45deg); transition: transform .15s; }
.wa-item[open] summary::after { transform: rotate(-135deg); }
.wa-item summary:focus-visible { outline: 3px solid var(--ui-focus-ring); outline-offset: 2px; border-radius: 12px; }
.wa-dirty { font-size: 12px; font-weight: 700; color: var(--warn); }
.wa-body { display: flex; flex-direction: column; gap: 10px; padding: 0 14px 14px; }
.wa-ta { min-height: 110px; line-height: 1.45; }
.wa-meta { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.wa-count { margin-left: auto; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.wa-count.near { color: var(--warn); font-weight: 700; }
.wa-vars { display: flex; flex-wrap: wrap; gap: 6px; }
.wa-var { min-height: 36px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--soft); color: var(--ink); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; font-weight: 600; cursor: pointer; }
.wa-var:hover { border-color: var(--mc-verde-escuro); }
.wa-prev-wrap { display: flex; flex-direction: column; gap: 6px; }
.wa-prev-title { font-size: 13px; font-weight: 700; color: var(--muted); }
.wa-preview { white-space: pre-wrap; padding: 10px 12px; border-radius: 10px; background: var(--soft); color: var(--ink); font-size: 14px; line-height: 1.45; }
.wa-preview.off { color: var(--muted); font-style: italic; }
.wa-compare { display: flex; flex-direction: column; gap: 14px; }
.wa-compare-item { display: flex; flex-direction: column; gap: 6px; }
.wa-compare .wa-preview { max-height: 40vh; overflow-y: auto; overflow-wrap: anywhere; }
.wa-savebar { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-wrap: wrap; margin: 0 -20px -18px; padding: 12px 20px; border-top: 1px solid var(--line); background: var(--surface); border-radius: 0 0 var(--radius) var(--radius); }
.wa-status { font-size: 14px; color: var(--muted); }
.wa-status.pending { color: var(--warn); font-weight: 700; }
/* C7 — Primeiros passos (restaurantes do cadastro automático) */
.steps-trial { display: flex; flex-direction: column; gap: 4px; background: var(--ok-soft); border-color: transparent; }
.steps-progress { display: flex; flex-direction: column; gap: 8px; }
.steps-track { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.steps-fill { height: 100%; background: var(--ok); border-radius: 999px; }
.step-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.step-item { display: grid; grid-template-columns: 32px 1fr auto; gap: 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.step-item:last-child { border-bottom: 0; }
.step-dot { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line-2); display: flex; align-items: center; justify-content: center; color: var(--surface); }
.step-item.done .step-dot { background: var(--ok); border-color: var(--ok); }
.step-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.step-tag { margin-left: 8px; font-size: 12px; vertical-align: middle; }
@media (max-width: 520px) { .step-item { grid-template-columns: 32px 1fr; } .step-item > .btn { grid-column: 2; justify-self: start; } }
.auto-pause { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 12px 16px 0; padding: 12px 14px; border-radius: 12px; background: var(--warn-soft); color: #6B3D00; font-size: 14px; }
.auto-pause .btn { margin-left: auto; }
.plan-note { margin: 12px 16px 0; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft, #E8F5EE); color: inherit; font-size: 14px; line-height: 1.45; }
.pro-only p { margin: 8px 0 0; }
.login .forgot-link { align-self: center; padding: 10px 4px; min-height: 44px; display: inline-flex; align-items: center; color: var(--ui-link); font-weight: 600; }

/* Etapa 4: assinatura */
.consent { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0 4px; }
.consent input { margin-top: 4px; flex: none; }
.consent-text { font-size: 14px; line-height: 1.45; }
fieldset.plain { border: 0; padding: 0; margin: 0 0 12px; }
fieldset.plain legend { font-weight: 600; margin-bottom: 6px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
