/* Painel de vendas. Claro e limpo, com a identidade 21Go (marinho + laranja). */
:root {
  --azul: #0c1330;
  --laranja: #f2911d;
  --laranja-2: #d67a0f;
  --laranja-fundo: #fff3e2;
  --verde: #0f9d58;
  --verde-fundo: #e1f5ea;
  --cinza-fundo: #eef0f5;
  --vermelho: #d92d20;
  --fundo: #f5f6fa;
  --superficie: #fff;
  --borda: #e5e8f0;
  --texto: #101a3d;
  --texto-2: #66728f;
  --raio: 14px;
  --sombra: 0 1px 2px rgba(16, 26, 61, .05), 0 6px 20px rgba(16, 26, 61, .05);
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; } /* sem isto, classes com "display: grid/flex" ignoram o atributo hidden */
body { margin: 0; background: var(--fundo); color: var(--texto); font: 14px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif; }
button, input, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2 { margin: 0; letter-spacing: -.02em; }
.sr-so { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid #1d4ed8; outline-offset: 2px; }

/* ---------- entrar ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(900px 480px at 50% -80px, #26327a, var(--azul) 65%); }
.login-caixa { width: min(380px, 100%); background: #fff; border-radius: 18px; padding: 30px 26px 26px; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); display: flex; flex-direction: column; gap: 12px; }
.marca-grande { text-align: center; }
.logo-painel-grande { display: block; width: 210px; max-width: 70%; height: auto; margin: 0 auto 8px; border-radius: 14px; }
.logo-painel { display: block; width: 150px; height: auto; border-radius: 12px; }
.marca { flex-direction: column; align-items: flex-start; gap: 6px; }
.marca-grande { font-weight: 800; font-size: 26px; letter-spacing: -.03em; color: var(--azul); text-align: center; }
.marca-grande b { color: #a7b400; }
.marca-grande span { display: block; font-size: 12px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--texto-2); margin-top: 2px; }
.login-sub { margin: 0 0 4px; text-align: center; color: var(--texto-2); }
.login-caixa input { height: 48px; padding: 0 14px; border: 1.5px solid var(--borda); border-radius: 11px; font-size: 16px; background: #f8f9fc; }
.login-caixa input:focus { outline: none; border-color: var(--laranja); box-shadow: 0 0 0 4px rgba(242, 145, 29, .18); background: #fff; }
.dica { margin: 0; padding: 8px 11px; border-radius: 9px; background: #f1f5ff; color: #3b4a7a; font-size: 12.5px; border: 1px dashed #b8c5ee; }
.erro { margin: 0; color: var(--vermelho); font-weight: 600; font-size: 13px; min-height: 0; }
.erro:empty { display: none; }
.botao { height: 48px; border: 0; border-radius: 11px; background: var(--laranja); color: #1b1200; font-weight: 800; font-size: 15.5px; cursor: pointer; transition: background .12s; }
.botao:hover { background: #f69d34; }
.botao:disabled { opacity: .6; cursor: progress; }

/* ---------- estrutura ---------- */
.app { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.lateral { position: sticky; top: 0; height: 100vh; background: var(--superficie); border-right: 1px solid var(--borda); padding: 22px 16px; display: flex; flex-direction: column; gap: 18px; }
.marca { font-weight: 800; font-size: 25px; letter-spacing: -.03em; color: var(--azul); padding: 0 8px; display: flex; align-items: baseline; gap: 8px; }
.marca b { color: #a7b400; }
.marca small { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--texto-2); font-weight: 700; }
.saldo { background: var(--fundo); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 3px; }
.saldo span { font-size: 12.5px; color: var(--texto-2); }
.saldo strong { font-size: 21px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.menu { display: flex; flex-direction: column; gap: 3px; }
.grupo { margin: 4px 8px 6px; font-size: 12px; color: var(--texto-2); }
.menu a { display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: 10px; font-weight: 600; color: #2a3558; }
.menu a:hover { background: var(--fundo); }
.menu a[aria-current="page"] { background: var(--laranja-fundo); color: var(--azul); }
.menu a[aria-current="page"]::after { content: ""; margin-left: auto; width: 7px; height: 7px; border-top: 2px solid var(--laranja); border-right: 2px solid var(--laranja); transform: rotate(45deg); }
.lateral-rodape { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.selo-demo { align-self: flex-start; padding: 4px 10px; border-radius: 999px; background: #fff3d6; color: #7a5200; font-size: 12px; font-weight: 700; }
.sair { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 0; background: none; border-radius: 10px; color: var(--texto-2); cursor: pointer; font-weight: 600; }
.sair:hover { background: var(--fundo); color: var(--texto); }

.principal { min-width: 0; }
.faixa-demo { background: #fff3d6; color: #7a5200; text-align: center; padding: 7px 14px; font-size: 12.5px; font-weight: 600; }
.conteudo { max-width: 1160px; margin: 0 auto; padding: 30px 34px 60px; outline: none; }

.pagina-cab { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.pagina-cab h1 { font-size: 27px; }
.pagina-cab p { margin: 3px 0 0; color: var(--texto-2); }
.botao-claro { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 15px; border: 1px solid var(--borda); border-radius: 10px; background: #fff; font-weight: 700; cursor: pointer; }
.botao-claro:hover { background: var(--fundo); }

/* ---------- cartões do resumo ---------- */
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.card { background: var(--superficie); border: 1px solid var(--borda); border-radius: var(--raio); padding: 18px; box-shadow: var(--sombra); }
.card .rotulo { color: var(--texto-2); font-size: 13px; font-weight: 600; }
.card .valor { font-size: 27px; font-weight: 800; letter-spacing: -.03em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.card .nota { color: var(--texto-2); font-size: 12.5px; margin-top: 2px; }
.card.destaque { background: var(--azul); color: #fff; border-color: var(--azul); }
.card.destaque .rotulo, .card.destaque .nota { color: #aab4d8; }

.painel { background: var(--superficie); border: 1px solid var(--borda); border-radius: var(--raio); box-shadow: var(--sombra); padding: 20px; margin-bottom: 18px; }
.painel.sem-margem { padding: 0; overflow: hidden; }
.painel-cab { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.painel h2 { font-size: 16px; }
.painel-cab a { color: var(--laranja-2); font-weight: 700; }

/* ---------- gráfico ---------- */
.grafico { position: relative; height: 210px; padding-left: 8px; }
.grafico-grade { position: absolute; inset: 0 0 24px 0; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.grafico-grade i { display: block; border-top: 1px dashed var(--borda); }
.grafico-grade em { position: absolute; top: -9px; left: 0; font-style: normal; font-size: 11px; color: var(--texto-2); background: var(--superficie); padding-right: 6px; }
.grafico-barras { position: relative; height: 100%; display: flex; align-items: stretch; gap: 8px; }
.coluna { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; cursor: default; }
.coluna .area { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.barra { width: min(34px, 70%); min-height: 3px; border-radius: 7px 7px 3px 3px; background: linear-gradient(180deg, #f6a53d, var(--laranja)); transition: filter .12s; }
.coluna:hover .barra { filter: brightness(1.08) saturate(1.1); }
.barra.zero { background: var(--borda); }
.coluna span { height: 24px; display: flex; align-items: center; font-size: 11px; color: var(--texto-2); font-variant-numeric: tabular-nums; }

/* ---------- filtros e tabela ---------- */
.filtros { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.busca { flex: 1 1 280px; display: flex; align-items: center; gap: 9px; height: 42px; padding: 0 13px; background: #fff; border: 1px solid var(--borda); border-radius: 10px; color: var(--texto-2); }
.busca:focus-within { border-color: var(--laranja); box-shadow: 0 0 0 3px rgba(242, 145, 29, .16); }
.busca input { flex: 1; min-width: 0; border: 0; outline: none; background: none; height: 100%; color: var(--texto); }
.filtros select { height: 42px; padding: 0 12px; background: #fff; border: 1px solid var(--borda); border-radius: 10px; cursor: pointer; }

.tabela { width: 100%; border-collapse: collapse; }
.tabela th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--texto-2); padding: 13px 16px; border-bottom: 1px solid var(--borda); white-space: nowrap; }
.tabela td { padding: 13px 16px; border-bottom: 1px solid var(--borda); vertical-align: middle; }
.tabela tr:last-child td { border-bottom: 0; }
.tabela tbody tr[data-venda] { cursor: pointer; }
.tabela tbody tr[data-venda]:hover { background: #fafbfd; }
.tabela tbody tr[data-venda]:focus-visible { outline-offset: -2px; }
.principal-linha b { display: block; font-weight: 600; }
.produto { display: block; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.secundaria { display: block; font-size: 12px; color: var(--texto-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 230px; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.placa { display: inline-block; padding: 2px 8px; border: 1.5px solid #cdd3e3; border-radius: 6px; background: #fff; font-weight: 800; letter-spacing: .06em; font-size: 12.5px; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; white-space: nowrap; }
.seta { color: #9aa4bd; width: 28px; }
.selo { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.selo.pago { background: var(--verde-fundo); color: #0b7a43; }
.selo.pendente { background: #ffe6c7; color: #9a5a00; }
.selo.expirado { background: var(--cinza-fundo); color: #55607d; }
@keyframes destacar { from { background: #fff3d6; } to { background: transparent; } }
tr.destaque td { animation: destacar 2.6s ease-out; }
.vazio { padding: 46px 20px; text-align: center; color: var(--texto-2); }
.vazio b { display: block; color: var(--texto); font-size: 15px; margin-bottom: 4px; }

.paginacao { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--borda); color: var(--texto-2); font-size: 13px; }
.paginacao div { display: flex; gap: 8px; }
.paginacao button { height: 34px; padding: 0 14px; border: 1px solid var(--borda); border-radius: 9px; background: #fff; font-weight: 600; cursor: pointer; }
.paginacao button:disabled { opacity: .45; cursor: default; }

/* ---------- links de pagamento ---------- */
.novo-link { display: grid; grid-template-columns: 1.3fr 1.5fr 160px auto; gap: 12px; align-items: end; }
.novo-link label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--texto-2); }
.novo-link input { height: 42px; padding: 0 12px; border: 1px solid var(--borda); border-radius: 10px; background: #fff; font-size: 14.5px; color: var(--texto); }
.novo-link input:focus { outline: none; border-color: var(--laranja); box-shadow: 0 0 0 3px rgba(242, 145, 29, .16); }
.novo-link .botao { height: 42px; padding: 0 20px; display: inline-flex; align-items: center; gap: 7px; font-size: 14.5px; }
.link-campo { display: flex; align-items: center; gap: 6px; }
.link-campo input { width: 250px; max-width: 100%; height: 34px; padding: 0 10px; border: 1px solid var(--borda); border-radius: 8px; background: #fafbfd; font-size: 12.5px; color: var(--texto-2); }
.mini { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border: 1px solid var(--borda); border-radius: 8px; background: #fff; cursor: pointer; color: var(--texto-2); flex: none; }
.mini:hover { background: var(--fundo); color: var(--texto); }
.mini.ok { color: var(--verde); border-color: #9bd8b8; }
.chave { position: relative; display: inline-block; width: 42px; height: 24px; flex: none; }
.chave input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; }
.chave i { position: absolute; inset: 0; border-radius: 999px; background: #c9cfdf; transition: background .15s; pointer-events: none; }
.chave i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.chave input:checked + i { background: var(--verde); }
.chave input:checked + i::after { transform: translateX(18px); }
.chave input:focus-visible + i { outline: 2px solid #1d4ed8; outline-offset: 2px; }

/* ---------- detalhe da venda ---------- */
.fundo { position: fixed; inset: 0; background: rgba(12, 19, 48, .45); z-index: 40; }
.gaveta { position: fixed; top: 0; right: 0; bottom: 0; width: min(460px, 100%); background: #fff; z-index: 50; box-shadow: -12px 0 40px rgba(12, 19, 48, .22); display: flex; flex-direction: column; animation: entrar .2s cubic-bezier(.2, .8, .3, 1); }
@keyframes entrar { from { transform: translateX(40px); opacity: 0; } }
.gaveta-cab { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--borda); }
.gaveta-cab h2 { font-size: 17px; }
.gaveta-corpo { flex: 1; overflow-y: auto; padding: 20px 22px 30px; display: flex; flex-direction: column; gap: 22px; }
.gaveta .topo-venda { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.gaveta .topo-venda strong { font-size: 28px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.bloco h3 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--texto-2); }
.dados { border: 1px solid var(--borda); border-radius: 12px; overflow: hidden; }
.dado { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; }
.dado + .dado { border-top: 1px solid var(--borda); }
.dado > span { color: var(--texto-2); flex: none; }
.dado > div { display: flex; align-items: center; gap: 7px; min-width: 0; text-align: right; font-weight: 600; overflow-wrap: anywhere; }
.dado .mini { width: 28px; height: 28px; }
.linha-tempo { list-style: none; margin: 0; padding: 0 0 0 4px; }
.linha-tempo li { position: relative; padding: 0 0 14px 22px; }
.linha-tempo li::before { content: ""; position: absolute; left: 0; top: 5px; width: 9px; height: 9px; border-radius: 50%; background: #c3cadc; }
.linha-tempo li::after { content: ""; position: absolute; left: 4px; top: 16px; bottom: -3px; width: 1px; background: var(--borda); }
.linha-tempo li:last-child::after { display: none; }
.linha-tempo li.pago::before { background: var(--verde); }
.linha-tempo b { display: block; font-weight: 600; }
.linha-tempo small { color: var(--texto-2); }

/* ---------- avisos ---------- */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 80; display: flex; flex-direction: column; gap: 9px; align-items: flex-end; }
.toast { display: flex; align-items: center; gap: 10px; max-width: min(360px, calc(100vw - 36px)); padding: 12px 15px; border-radius: 12px; background: var(--azul); color: #fff; box-shadow: 0 12px 34px rgba(12, 19, 48, .35); animation: entrar .22s ease-out; font-weight: 600; }
.toast .pino { width: 10px; height: 10px; border-radius: 50%; background: var(--laranja); flex: none; }
.toast.pago .pino { background: #38d583; }

/* ---------- celular ---------- */
.abas-mobile { display: none; }
@media (max-width: 1000px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } .novo-link { grid-template-columns: 1fr 1fr; } .novo-link .botao { grid-column: 1 / -1; justify-content: center; } }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .lateral { display: none; }
  .conteudo { padding: 20px 14px 96px; }
  .pagina-cab h1 { font-size: 23px; }
  .abas-mobile {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(4, 1fr);
    background: #fff; border-top: 1px solid var(--borda); padding: 6px 6px max(6px, env(safe-area-inset-bottom));
  }
  .abas-mobile a, .abas-mobile button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 2px; border: 0; background: none; border-radius: 10px; font-size: 11.5px; font-weight: 600; color: var(--texto-2); cursor: pointer; }
  .abas-mobile a[aria-current="page"] { color: var(--azul); background: var(--laranja-fundo); }
  .toasts { bottom: 82px; right: 12px; left: 12px; align-items: stretch; }

  /* tabela vira lista de cartões */
  .tabela, .tabela tbody, .tabela tr, .tabela td { display: block; }
  .tabela thead { display: none; }
  .tabela tbody tr[data-venda] { position: relative; padding: 14px 16px; border-bottom: 1px solid var(--borda); }
  .tabela tr:last-child { border-bottom: 0; }
  .tabela td { padding: 0; border: 0; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 3px 0; }
  .tabela td[data-rotulo]::before { content: attr(data-rotulo); color: var(--texto-2); font-size: 12px; flex: none; }
  .tabela td.seta { display: none; }
  .tabela td.cliente { display: block; margin-bottom: 6px; }
  .tabela td.cliente::before { display: none; }
  .secundaria, .produto { max-width: 100%; }
  .link-campo input { width: 100%; }
  .link-campo { width: 100%; }
}
@media (max-width: 640px) { .coluna:nth-child(even) span { visibility: hidden; } .grafico-barras { gap: 5px; } }
@media (max-width: 520px) { .cards { grid-template-columns: 1fr 1fr; gap: 10px; } .card { padding: 14px; } .card .valor { font-size: 22px; } .novo-link { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .gaveta, .toast, tr.destaque td { animation: none; } }
