/* Estrutura das telas — celular primeiro */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.stripe { height: 4px; background: var(--acc); flex: none; }
.adminbar { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-2) var(--s-4); background: var(--ink); color: var(--surf); font-size: 14px; font-weight: 700; }
.adminbar .btn { min-height: 36px; border-color: currentColor; color: inherit; font-size: var(--t-sm); }

/* Cabeçalho */
.top { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: 10px var(--s-4) var(--s-2); }
.company { display: inline-flex; align-items: center; gap: 10px; height: var(--hit); padding: 0 var(--s-3) 0 var(--s-1); border: 0; border-radius: var(--r-md); background: var(--acc-soft); color: var(--acc-ink); font-weight: 700; font-size: var(--t-lg); cursor: pointer; }
.logo { width: 40px; height: 40px; border-radius: var(--r-sm); background: #FFFFFF; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.logo img { width: 36px; height: 36px; object-fit: contain; }
.top__nav, .top__actions { display: none; }

/* Navegação inferior (celular) */
.bottomnav { position: sticky; bottom: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: var(--s-1) 6px calc(var(--s-4) + env(safe-area-inset-bottom)); background: var(--surf); border-top: 1px solid var(--line); z-index: 2; }
.bottomnav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; border: 0; background: transparent; color: var(--ink-2); font-size: var(--t-xs); font-weight: 600; cursor: pointer; position: relative; }
.bottomnav button[aria-current="page"] { color: var(--acc-ink); font-weight: 700; }
.dot-count { position: absolute; top: 4px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--warn); color: var(--surf); font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }

/* Corpo */
.main { flex: 1; display: flex; flex-direction: column; gap: 18px; padding: var(--s-1) var(--s-4) var(--s-4); }
.col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.col__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3); }
.h1 { margin: 0; font-size: var(--t-2xl); font-weight: 700; letter-spacing: -0.02em; }
.h2 { margin: 0; font-size: var(--t-md); font-weight: 700; color: var(--ink-2); }
.h3 { margin: 6px 2px 0; font-size: var(--t-sm); font-weight: 600; color: var(--ink-2); }
.detail-col { display: none; }
.foot { margin: 0; font-size: var(--t-xs); color: var(--ink-2); }

/* Itens da caixa de entrada e linhas de pedido */
.inbox-item { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); padding: 10px var(--s-3) 10px 14px; border-bottom: 1px solid var(--line); }
.inbox-item__icon { flex: none; width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-size: var(--t-sm); font-weight: 700; }
.inbox-item__text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.inbox-item__text span { font-size: var(--t-sm); color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Ação secundária (Descartar/Abrir) visível também no celular, em linha própria abaixo do texto. */
.inbox-item__actions { display: flex; gap: var(--s-1); width: 100%; justify-content: flex-end; }

.row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--s-3); min-height: 56px; padding: 6px 14px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; cursor: pointer; }
.row[aria-current="true"] { background: var(--acc-soft); }
.row__id { font: 500 var(--t-xs) var(--f-mono); color: var(--ink-2); }
.row__name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row__pay, .row__num-col { display: none; }
.row__end { display: flex; flex-direction: column-reverse; align-items: flex-end; } /* DOM: tag, valor */
.row__value { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.row__tag { font-size: var(--t-xs); font-weight: 700; }

/* Detalhe */
.detail { display: flex; flex-direction: column; gap: 14px; }
.detail__value { font-size: var(--t-3xl); font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.dl { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px var(--s-4); align-items: center; }
.dl dt { color: var(--ink-2); } .dl dd { margin: 0; text-align: right; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tabs { display: flex; gap: 2px; padding: 3px; background: var(--surf-2); border-radius: var(--r-md); }
.tabs button { flex: 1 1 auto; min-width: 0; min-height: var(--hit); padding: 4px 6px; border: 0; border-radius: 9px; background: transparent; color: var(--ink-2); font-size: var(--t-sm); font-weight: 700; white-space: nowrap; cursor: pointer; }
.tabs button:focus-visible { outline-offset: -3px; }
.tabs button[aria-selected="true"] { background: var(--surf); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,0.12); }
.tabs__n { display: block; font-size: 15px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.tabs button[aria-selected="true"] .tabs__n { color: var(--acc-ink); }

/* Desktop: cabeçalho completo + três colunas */
@media (min-width: 1024px) {
  .top { padding: var(--s-3) var(--s-6); background: var(--surf); border-bottom: 1px solid var(--line); }
  .top__nav, .top__actions { display: flex; align-items: center; gap: var(--s-1); }
  .top__actions { gap: 14px; }
  .top__nav button { min-height: 40px; padding: 0 var(--s-3); border: 0; border-radius: 10px; background: transparent; color: var(--ink-2); font-weight: 600; cursor: pointer; }
  .top__nav button[aria-current="page"] { background: var(--acc-soft); color: var(--acc-ink); font-weight: 700; }
  .top__left { display: flex; align-items: center; gap: var(--s-5); }
  .bottomnav { display: none; }
  .main { flex-direction: row; flex-wrap: wrap; align-items: flex-start; gap: var(--s-5); padding: var(--s-5) var(--s-6); }
  .col--inbox { flex: 1 1 300px; max-width: 360px; }
  /* Recebimentos: a coluna de cards fica presa no alto e rola por dentro; a página rola só pelo painel da direita */
  .col--fixa { position: sticky; top: var(--s-5); align-self: flex-start; max-height: calc(100dvh - 2 * var(--s-5)); }
  .col--rolagem { overflow-y: auto; min-height: 0; padding-right: 4px; scrollbar-gutter: stable; }
  .col--list { flex: 999 1 440px; }
  .detail-col { display: flex; flex: 1 1 340px; max-width: 420px; padding: var(--s-5); }
  .inbox-item { flex-wrap: wrap; }
  .inbox-item__actions { width: 100%; justify-content: flex-end; }
  .inbox-item__actions .btn--ghost { display: inline-flex; }
  .row { grid-template-columns: 64px minmax(0, 1fr) auto 120px; min-height: 52px; padding: 0 var(--s-4); }
  .row__num-col { display: block; }
  .row__id--mobile { display: none; }
  .row__pay { display: block; font-size: var(--t-xs); color: var(--ink-2); }
  .row__end { display: contents; }
  .row__value { text-align: right; }
  .detail__value { font-size: var(--t-4xl); }
}

/* Número do pedido abre a edição no Bling em nova aba */
.row__link { color: inherit; text-decoration: underline dotted; text-underline-offset: 3px; }
.row__link:hover { color: var(--acc-ink); text-decoration-style: solid; }

/* Avisos flutuantes: confirmação curta (toast) e faixa de modo teste */
.toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 5; max-width: calc(100% - 32px);
  padding: var(--s-3) var(--s-4); border-radius: var(--r-md); background: var(--ink); color: var(--surf); font-weight: 600; box-shadow: 0 6px 24px rgba(0,0,0,0.18);
  animation: subir 220ms cubic-bezier(0.22, 1, 0.36, 1); }
.teste { position: fixed; left: 50%; top: 8px; transform: translateX(-50%); z-index: 5; padding: 6px 14px; border-radius: 999px;
  background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn-line); font-size: var(--t-sm); font-weight: 700; white-space: nowrap; pointer-events: none; }
@keyframes subir { from { opacity: 0; transform: translate(-50%, 8px); } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } }
@media (min-width: 1024px) { .toast { bottom: var(--s-8); } .teste { left: auto; right: var(--s-6); top: auto; bottom: var(--s-3); transform: none; } }

/* contador de novos recebidos ao lado do rótulo da aba no cabeçalho (desktop) */
.top__nav .dot-count { position: static; display: inline-flex; margin-left: 6px; vertical-align: 1px; }

/* Recebidos: pagador + meta à esquerda, valor à direita — mesma composição no celular e no desktop */
.rec { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--s-3); min-height: 60px; padding: 8px 16px; border-bottom: 1px solid var(--line); }
.rec:last-child, .row:last-child, .inbox-item:last-child { border-bottom: 0; }
.rec__info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rec__meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: var(--t-sm); color: var(--ink-2); }
.rec__valor { display: flex; flex-direction: column; align-items: flex-end; }

/* Páginas de coluna única (Recebidos, Conta, Equipe): centralizadas e esticadas também no desktop */
.main--pagina { flex-direction: column; align-items: stretch; width: 100%; max-width: var(--largura, 880px); margin: 0 auto; }
@media (min-width: 1024px) { .main--pagina { flex-direction: column; flex-wrap: nowrap; align-items: stretch; } }
