/* ═══════════════════════════════════════════════════════════════════════════
   A moldura do site da administração (admin.boompass.com.br)

   Os componentes (botão, tabela, cartão, aba, campo) são os de tema.css — o
   mesmo vocabulário do painel do organizador, para quem já usa um não
   estranhar o outro. Daqui sai só a MOLDURA: a lateral, o topo, a gaveta do
   celular e a tela de entrada.

   Tudo branco desde 04/10/2026 (dono: "muda a cor do site pra branco, esse
   azul não tá legal"). O que separa o admin do site oficial, de relance, é o
   selo verde "ADMIN" ao lado da marca e a etiqueta de ambiente no topo.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --adm-lateral: 16rem;
  --adm-faixa: 4.25rem;
  --adm-topo: 3.5rem;
  --adm-fundo-lateral: #ffffff;
  --adm-fundo-lateral-alto: hsl(220 16% 96%);
  --adm-texto-lateral: hsl(222 15% 30%);
  --adm-texto-lateral-forte: hsl(222 30% 8%);
  --adm-titulo-lateral: hsl(220 9% 52%);
  --adm-borda-lateral: var(--border);
  /* Quanto a lateral empurra o conteúdo. Recolhida, só a faixa de ícones. */
  --adm-recuo: var(--adm-faixa);
}
body.adm--fixo { --adm-recuo: var(--adm-lateral); }

html, body { font-size: 16px; }
body.adm { min-height: 100dvh; background: var(--bg-fundo); }

.bp-pular {
  position: absolute; left: .75rem; top: -5rem; z-index: 100;
  background: var(--card); color: var(--fg-forte); padding: .5rem .875rem;
  border-radius: var(--radius); box-shadow: var(--sombra-2); font-weight: 600;
}
.bp-pular:focus { top: .75rem; }

/* ── Lateral ─────────────────────────────────────────────────────────────── */

.adm-lateral {
  position: fixed; inset: 0 auto 0 0; width: var(--adm-lateral); z-index: 40;
  display: flex; flex-direction: column;
  background: var(--adm-fundo-lateral); color: var(--adm-texto-lateral);
  border-right: 1px solid var(--adm-borda-lateral);
  transition: width .22s cubic-bezier(.2, .7, .2, 1), box-shadow .22s ease;
  overflow: hidden;
}
.adm-lateral__topo {
  display: flex; align-items: center; justify-content: space-between; gap: .25rem;
  height: var(--adm-topo); padding: 0 .875rem 0 1.0625rem; flex: none;
  border-bottom: 1px solid var(--adm-borda-lateral);
}
.adm-marca { display: flex; align-items: center; gap: .625rem; color: var(--adm-texto-lateral-forte); text-decoration: none; min-width: 0; }
.adm-marca img { flex: none; }
.adm-marca span { display: flex; align-items: baseline; gap: .375rem; white-space: nowrap; }
.adm-marca b { font-size: 1rem; letter-spacing: -.01em; }
.adm-marca small {
  font-size: .625rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em;
  color: var(--primary-fg); background: var(--primary); padding: .125rem .375rem; border-radius: 4px;
}
.adm-lateral__fixar, .adm-lateral__fechar {
  background: none; border: 0; color: var(--adm-titulo-lateral); flex: none;
  width: 2.125rem; height: 2.125rem; border-radius: var(--radius); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.adm-lateral__fixar:hover, .adm-lateral__fechar:hover { background: var(--adm-fundo-lateral-alto); color: var(--adm-texto-lateral-forte); }
.adm-lateral__fixar[aria-pressed="true"] { color: #0b5a35; background: var(--primary-suave); }
.adm-lateral__fixar svg { transition: transform .15s; }
.adm-lateral__fixar[aria-pressed="true"] svg { transform: rotate(45deg); }
.adm-lateral__fechar { display: none; }

.adm-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: .75rem .625rem 1rem; display: flex; flex-direction: column; gap: .25rem; }
.adm-nav__grupo { display: flex; flex-direction: column; gap: .125rem; }
.adm-nav__titulo {
  display: flex; align-items: center; gap: .625rem; width: 100%; text-align: left;
  background: none; border: 0; cursor: pointer; font-family: inherit;
  font-size: .625rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em;
  color: var(--adm-titulo-lateral); padding: .5rem .625rem; border-radius: 8px; white-space: nowrap;
}
.adm-nav__titulo-texto { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* O ícone do grupo só aparece com o menu recolhido (ver abaixo). */
.adm-nav__titulo-icone { display: none; }
.adm-nav__titulo:hover { color: var(--adm-texto-lateral-forte); background: var(--adm-fundo-lateral-alto); }
.adm-nav__titulo:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.adm-nav__titulo > svg { width: 14px; height: 14px; transition: transform .15s; flex: none; }
.adm-nav__titulo[aria-expanded="true"] > svg { transform: rotate(180deg); }
.adm-nav__itens { display: flex; flex-direction: column; gap: .125rem; }
.adm-nav__titulo[aria-expanded="false"] + .adm-nav__itens { display: none; }
.adm-nav__item {
  display: flex; align-items: center; gap: .625rem; white-space: nowrap;
  padding: .5rem .625rem; border-radius: 8px;
  color: var(--adm-texto-lateral); text-decoration: none; font-size: .875rem; font-weight: 500;
  transition: background .12s, color .12s;
}
.adm-nav__item svg { flex: none; opacity: .8; }
.adm-nav__texto { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.adm-nav__item:hover { background: var(--adm-fundo-lateral-alto); color: var(--adm-texto-lateral-forte); }
.adm-nav__item:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.adm-nav__item[aria-current="page"] {
  background: var(--primary-suave); color: #0b3d25; font-weight: 650;
  box-shadow: inset 3px 0 0 var(--primary);
}
.adm-nav__item[aria-current="page"] svg { color: #0b5a35; opacity: 1; }
.adm-nav__item--breve { color: var(--adm-titulo-lateral); }
.adm-nav__selo {
  font-size: .5625rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  padding: .125rem .375rem; border-radius: 999px;
  border: 1px solid var(--border-forte); color: var(--adm-titulo-lateral);
}

.adm-lateral__rodape { flex: none; border-top: 1px solid var(--adm-borda-lateral); padding: .75rem 1rem 1rem; white-space: nowrap; }
.adm-lateral__rodape:empty { display: none; }
.adm-conta { display: flex; align-items: center; gap: .625rem; min-width: 0; }
.adm-conta__avatar {
  flex: none; width: 2rem; height: 2rem; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary); color: var(--primary-fg); font-weight: 700; font-size: .875rem;
}
.adm-conta__textos { display: flex; flex-direction: column; min-width: 0; }
.adm-conta__textos b { color: var(--adm-texto-lateral-forte); font-size: .8125rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-conta__textos small { font-size: .6875rem; color: var(--adm-titulo-lateral); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-conta__rodape { display: flex; align-items: center; justify-content: space-between; margin-top: .625rem; }
.adm-conta__sair { color: var(--adm-texto-lateral-forte); font-size: .8125rem; font-weight: 600; text-decoration: none; }
.adm-conta__sair:hover { color: #0b5a35; }
.adm-conta__versao { font-size: .6875rem; color: var(--adm-titulo-lateral); font-variant-numeric: tabular-nums; }

/* ── Menu recolhido (computador com mouse) ───────────────────────────────── */
/* Dono, 04/10/2026: "menu que feche sozinho; se passar o mouse em cima ele
   abre; fixa igual à intranet". Sem o alfinete, a lateral é uma faixa de
   ícones; o mouse em cima (ou o Tab chegando nela) abre por cima do
   conteúdo, sem empurrá-lo, e sair fecha. Com o alfinete, fica aberta e o
   conteúdo anda para o lado. Só onde há mouse de verdade: no tablet sem
   mouse e no celular vale a gaveta do ☰. */
@media (min-width: 64rem) and (hover: hover) and (pointer: fine) {
  body:not(.adm--fixo):not(.adm--lateral-aberta) .adm-lateral:not(:has(:focus-visible)) { width: var(--adm-faixa); }
  body:not(.adm--fixo):is(.adm--lateral-aberta) .adm-lateral, body:not(.adm--fixo) .adm-lateral:has(:focus-visible) { box-shadow: 0 12px 40px hsl(220 20% 20% / .16); }

  body:not(.adm--fixo):not(.adm--lateral-aberta) .adm-lateral:not(:has(:focus-visible)) :is(
    .adm-marca span, .adm-lateral__fixar, .adm-nav__texto, .adm-nav__selo,
    .adm-nav__titulo-texto, .adm-nav__titulo > svg, .adm-conta__textos, .adm-conta__rodape) { display: none; }
  /* Recolhido: um ícone por grupo, centrado; os itens dos grupos somem. */
  body:not(.adm--fixo):not(.adm--lateral-aberta) .adm-lateral:not(:has(:focus-visible)) .adm-nav__titulo-icone { display: inline-flex; }
  body:not(.adm--fixo):not(.adm--lateral-aberta) .adm-lateral:not(:has(:focus-visible)) .adm-nav__titulo {
    justify-content: center; padding: .5rem; color: var(--adm-texto-lateral);
  }
  body:not(.adm--fixo):not(.adm--lateral-aberta) .adm-lateral:not(:has(:focus-visible)) [data-grupo] .adm-nav__itens { display: none; }
  body:not(.adm--fixo):not(.adm--lateral-aberta) .adm-lateral:not(:has(:focus-visible)) .adm-nav__item { justify-content: center; padding: .5rem; }
  body:not(.adm--fixo):not(.adm--lateral-aberta) .adm-lateral:not(:has(:focus-visible)) .adm-nav__grupo--atual .adm-nav__titulo {
    background: var(--primary-suave); color: #0b5a35; box-shadow: inset 3px 0 0 var(--primary);
  }
  body:not(.adm--fixo):not(.adm--lateral-aberta) .adm-lateral:not(:has(:focus-visible)) .adm-lateral__topo { padding: 0; justify-content: center; }
  body:not(.adm--fixo):not(.adm--lateral-aberta) .adm-lateral:not(:has(:focus-visible)) .adm-lateral__rodape { padding: .75rem 0 1rem; display: flex; justify-content: center; }
}
/* Computador sem mouse fino (tela de toque grande): vale a gaveta, e o
   conteúdo não reserva a faixa. */
@media (min-width: 64rem) and (not ((hover: hover) and (pointer: fine))) {
  :root { --adm-recuo: 0px; }
}

/* ── Corpo e topo ────────────────────────────────────────────────────────── */

.adm-corpo { margin-left: var(--adm-recuo); min-height: 100dvh; transition: margin-left .18s ease; display: flex; flex-direction: column; }
.adm-topo {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: .75rem;
  height: var(--adm-topo); padding: 0 1.5rem;
  background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--border);
}
.adm-topo__menu {
  display: none; background: none; border: 0; color: var(--fg); cursor: pointer;
  width: 2.5rem; height: 2.5rem; border-radius: var(--radius); margin-left: -.5rem;
  align-items: center; justify-content: center;
}
.adm-topo__menu:hover { background: var(--secondary); }
.adm-topo__titulo { font-weight: 650; color: var(--fg-forte); font-size: .9375rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-ambiente {
  font-size: .6875rem; font-weight: 700; padding: .25rem .5rem; border-radius: 999px;
  background: color-mix(in srgb, var(--warning) 16%, transparent); color: var(--warning);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warning) 40%, transparent);
  white-space: nowrap;
}
.adm-ambiente--local { background: color-mix(in srgb, var(--info) 14%, transparent); color: var(--info); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--info) 35%, transparent); }
.adm-topo__site {
  display: inline-flex; align-items: center; gap: .375rem; font-size: .8125rem; font-weight: 550;
  color: var(--muted-fg); text-decoration: none; padding: .375rem .625rem; border-radius: var(--radius);
}
.adm-topo__site:hover { background: var(--secondary); color: var(--fg); }

.adm-miolo { flex: 1; outline: none; }
.adm-carregando { padding: 2rem 2.25rem; color: var(--muted-fg); }
html.bp-navegando .adm-miolo { opacity: .6; transition: opacity .15s .15s; }

/* As vistas que vieram de /plataforma trazem a casca do painel antigo
   (.bp-shell > .bp-main > .bp-pagina). Aqui a casca é a moldura do admin:
   as duas de fora viram blocos neutros, sem altura mínima nem fundo próprio. */
.adm-miolo .bp-shell { display: block; min-height: 0; background: none; }
.adm-miolo .bp-main { padding-top: 0; }
.adm-miolo .bp-pagina { padding-top: 1.75rem; }

/* ── Avisos no miolo (sem acesso, falha, 404) ────────────────────────────── */

.adm-aviso { max-width: 34rem; margin: 12vh auto 0; padding: 0 1.25rem; text-align: center; }
.adm-aviso h1 { font-size: 1.375rem; color: var(--fg-forte); margin: 0 0 .625rem; }
.adm-aviso p { color: var(--muted-fg); line-height: 1.6; margin: 0 0 1.5rem; font-size: .9375rem; }
.adm-aviso__acoes { display: flex; gap: .625rem; justify-content: center; flex-wrap: wrap; }

/* ── Layout de entrada: sem lateral, sem topo ────────────────────────────── */

body[data-layout="entrada"] .adm-lateral,
body[data-layout="entrada"] .adm-topo,
body[data-layout="carregando"] .adm-lateral,
body[data-layout="carregando"] .adm-topo { display: none; }
body[data-layout="entrada"] .adm-corpo,
body[data-layout="carregando"] .adm-corpo { margin-left: 0; }
body[data-layout="entrada"] { background: var(--bg-fundo); }
body[data-layout="entrada"] .adm-aviso { background: var(--card); border-radius: var(--radius-lg); padding: 2rem 1.75rem; box-shadow: var(--sombra-3); }

/* ── Etiquetas de situação ───────────────────────────────────────────────── */

.adm-etiqueta {
  display: inline-flex; align-items: center; gap: .25rem; white-space: nowrap;
  font-size: .6875rem; font-weight: 650; padding: .1875rem .5rem; border-radius: 999px;
}
.adm-etiqueta--ok { background: color-mix(in srgb, var(--primary) 22%, transparent); color: #0b5a35; }
.adm-etiqueta--aviso { background: color-mix(in srgb, var(--warning) 16%, transparent); color: hsl(32 90% 30%); }
.adm-etiqueta--erro { background: color-mix(in srgb, var(--destructive) 12%, transparent); color: var(--destructive); }
.adm-etiqueta--neutro { background: var(--secondary); color: var(--muted-fg); box-shadow: inset 0 0 0 1px var(--border); }
.adm-etiqueta--info { background: color-mix(in srgb, var(--info) 12%, transparent); color: var(--info); }

/* ── Peças comuns das telas novas ────────────────────────────────────────── */

.adm-mudo { color: var(--muted-fg); font-size: .75rem; line-height: 1.45; }
.adm-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.adm-secao { font-size: 1rem; margin: 0 0 .75rem; color: var(--fg-forte); }
.adm-intro { margin: 0; font-size: .875rem; color: var(--muted-fg); line-height: 1.6; max-width: 72ch; }
.adm-linha-clicavel { cursor: pointer; }
.adm-linha-clicavel:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.adm-filtros { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-bottom: .75rem; }
.adm-filtros .bp-input[type="search"] { flex: 1 1 16rem; min-width: 0; }
.adm-filtros .bp-select, .adm-filtros .bp-input[type="date"] { width: auto; flex: 0 1 auto; }
.adm-carregando-lista { padding: 1.5rem; color: var(--muted-fg); font-size: .875rem; }

/* Diálogo de detalhe (pedido, comprador): largo e rolável por dentro. */
dialog.adm-detalhe { width: min(52rem, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); padding: 0; }
dialog.adm-detalhe .corpo { overflow-y: auto; max-height: calc(100dvh - 2rem); }
/* Coluna flex com altura máxima: sem isto, as tabelas (overflow: auto)
   encolhem até sumir em vez de o diálogo rolar. */
dialog.adm-detalhe .corpo > * { flex-shrink: 0; }
.adm-detalhe__topo { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.adm-detalhe__topo h2 { margin: 0; font-size: 1.125rem; }
.adm-grade-dados { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: .75rem 1.25rem; margin: 0; }
.adm-grade-dados div { min-width: 0; }
.adm-grade-dados dt { font-size: .625rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted-fg); }
.adm-grade-dados dd { margin: .125rem 0 0; font-size: .875rem; color: var(--fg); overflow-wrap: anywhere; }
.adm-detalhe h3 { font-size: .875rem; margin: .5rem 0 .25rem; color: var(--fg-forte); }

/* Tabela que vira cartões no celular (mesmo padrão de .po-resp). */
@media (max-width: 47.99rem) {
  .adm-resp table, .adm-resp tbody, .adm-resp tr, .adm-resp td { display: block; width: 100%; }
  .adm-resp thead { display: none; }
  .adm-resp tr { padding: .75rem .875rem; border-bottom: 1px solid var(--border); }
  .adm-resp tbody tr:last-child { border-bottom: 0; }
  .adm-resp td { border: 0 !important; padding: .1875rem 0; text-align: left !important; white-space: normal; }
  .adm-resp td[data-rotulo]::before {
    content: attr(data-rotulo); display: block; font-size: .625rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .07em; color: var(--muted-fg);
  }
}

/* ── Celular: a lateral vira gaveta ──────────────────────────────────────── */

@media (max-width: 63.99rem), (not ((hover: hover) and (pointer: fine))) {
  .adm-lateral { transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--sombra-3); width: min(18rem, 86vw); }
  body.adm--menu-aberto .adm-lateral { transform: none; }
  .adm-lateral__fechar { display: inline-flex; }
  /* Na gaveta não há o que fixar: ela abre pelo ☰ e fecha sozinha ao navegar. */
  .adm-lateral__fixar { display: none; }
  .adm-veu { position: fixed; inset: 0; z-index: 35; background: hsl(222 25% 4% / .55); }
  .adm-veu[hidden] { display: none; }
  .adm-corpo { margin-left: 0; }
  .adm-topo { padding: 0 1rem; }
  .adm-topo__menu { display: inline-flex; }
  .adm-topo__site span { display: none; }
  .adm-miolo .bp-pagina { padding: 1.25rem 1rem 3rem; }
}

@media (prefers-reduced-motion: reduce) {
  .adm-lateral { transition: none; }
}

/* Cartão de número que leva a uma tela (Visão geral). */
a.bp-numero { text-decoration: none; color: inherit; }
a.bp-numero:hover { border-color: var(--border-forte); }

/* Só para leitor de tela. */
.adm-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Um tamanho de título para todas as telas do admin, a Visão geral inclusive. */
.adm-miolo h1 { font-size: 1.5rem; letter-spacing: -.02em; line-height: 1.2; }

.adm-detalhe__acoes { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
