/* App do vendedor: feito para celular primeiro (APK Android e iPhone pela tela inicial). */
:root {
  --fundo: #f2f6f4;
  --cartao: #ffffff;
  --texto: #0c2119;
  --suave: #5b6e64;
  --linha: #dfe8e3;
  --marca: #1fa855;
  --marca-2: #0e8a6e;
  --escuro: #0b1a14;
  --ok: #1a8f4c;
  --aviso: #b26b00;
  --ruim: #c0392b;
  --raio: 16px;
  --sombra: 0 6px 24px rgba(12, 33, 25, .08);
  --topo: env(safe-area-inset-top, 0px);
  --base: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--fundo); color: var(--texto); font: 15px/1.45 Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; -webkit-tap-highlight-color: transparent; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--marca-2); }
svg { width: 20px; height: 20px; flex: none; }
.app { min-height: 100dvh; max-width: 560px; margin: 0 auto; }

/* Cabeçalho escuro com o resumo */
.topo { background: radial-gradient(120% 140% at 0% 0%, #154b33 0%, var(--escuro) 60%); color: #fff; padding: calc(18px + var(--topo)) 18px 22px; border-radius: 0 0 26px 26px; }
.topo-linha { display: flex; align-items: center; gap: 12px; }
.topo img { width: 40px; height: 40px; border-radius: 12px; }
.topo h1 { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -.01em; }
.topo small { display: block; color: #a9c7b8; font-size: 12.5px; }
.topo .sair { margin-left: auto; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); color: #fff; border-radius: 12px; padding: 8px 12px; font-size: 13px; cursor: pointer; }
.saldos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.saldo { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); border-radius: 14px; padding: 12px; }
.saldo span { display: block; font-size: 12px; color: #a9c7b8; }
.saldo b { font-size: 21px; font-weight: 800; letter-spacing: -.02em; }
.saldo.destaque b { color: #5ff0a0; }

.conteudo { padding: 16px 16px calc(96px + var(--base)); }
.cartao { background: var(--cartao); border: 1px solid var(--linha); border-radius: var(--raio); box-shadow: var(--sombra); padding: 16px; margin-bottom: 14px; }
.cartao h2 { margin: 0 0 10px; font-size: 16px; font-weight: 700; }
.muted { color: var(--suave); }
.pequeno { font-size: 13px; }

/* Botões */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 14px; padding: 13px 16px; font-weight: 700; cursor: pointer; text-decoration: none; min-height: 48px; }
.btn.primario { background: linear-gradient(135deg, var(--marca), var(--marca-2)); color: #fff; box-shadow: 0 8px 20px rgba(31,168,85,.28); }
.btn.claro { background: #fff; color: var(--texto); border: 1px solid var(--linha); }
.btn.zap { background: #25d366; color: #06301a; }
.btn.largo { width: 100%; }
.btn:disabled { opacity: .6; cursor: default; }
.link { background: none; border: 0; color: var(--marca-2); font-weight: 600; padding: 6px 0; cursor: pointer; }

/* Formulários */
form label { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 0; }
form input, form select { display: block; width: 100%; margin-top: 6px; padding: 13px 14px; border: 1px solid var(--linha); border-radius: 12px; background: #fff; font-size: 16px; }
form input:focus, form select:focus { outline: 2px solid rgba(31,168,85,.35); border-color: var(--marca); }
.duas { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.erro { color: var(--ruim); font-size: 13.5px; margin: 10px 0 0; }
.acoes { display: grid; gap: 10px; margin-top: 16px; }

/* Entrada */
.entrada { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: calc(24px + var(--topo)) 18px calc(24px + var(--base)); background: radial-gradient(120% 70% at 0% 0%, #154b33 0%, var(--escuro) 55%); }
.entrada .marca { text-align: center; color: #fff; margin-bottom: 18px; }
.entrada .marca img { width: 72px; height: 72px; border-radius: 20px; box-shadow: 0 10px 30px rgba(37,211,102,.35); }
.entrada .marca h1 { margin: 12px 0 2px; font-size: 24px; font-weight: 800; }
.entrada .marca p { margin: 0; color: #a9c7b8; }
.entrada .cartao { margin: 0; }
.rodape { text-align: center; color: #7f9e8f; font-size: 12px; margin-top: 16px; }

/* Listas */
.lista { list-style: none; margin: 0; padding: 0; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--linha); }
.item:last-child { border-bottom: 0; }
.item .ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: #e8f6ee; color: var(--marca-2); flex: none; }
.item .meio { flex: 1; min-width: 0; }
.item .meio b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .meio small { color: var(--suave); }
.item .valor { text-align: right; font-weight: 700; white-space: nowrap; }
.selo { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 999px; }
.selo.ativo, .selo.paga { background: #e3f6ea; color: var(--ok); }
.selo.teste, .selo.pendente, .selo.enviando, .selo.enviada { background: #fff3dc; color: var(--aviso); }
.selo.vencido, .selo.falhou { background: #fde8e6; color: var(--ruim); }
.vazio { text-align: center; color: var(--suave); padding: 22px 8px; }

.regras { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.regra { background: #f4faf6; border: 1px solid #d6efe0; border-radius: 12px; padding: 12px; }
.regra b { display: block; font-size: 20px; color: var(--marca-2); }
.regra span { font-size: 12.5px; color: var(--suave); }
/* Meta do mês: barra de progresso. Regras do programa: espaço entre os itens. */
.barra { height: 12px; background: #e6efe9; border-radius: 999px; overflow: hidden; }
.barra span { display: block; height: 100%; background: var(--marca); border-radius: 999px; transition: width .4s; }
.regras-lista li { margin-bottom: 8px; }

.credenciais { background: #f4faf6; border: 1px dashed #9fd8b7; border-radius: 12px; padding: 12px; font-size: 14px; word-break: break-word; }
.credenciais code { font-size: 15px; font-weight: 700; }

/* Barra de abas no rodapé */
.abas { position: fixed; left: 0; right: 0; bottom: 0; background: rgba(255,255,255,.96); backdrop-filter: blur(10px); border-top: 1px solid var(--linha); padding: 6px 8px calc(6px + var(--base)); display: flex; justify-content: center; z-index: 5; }
.abas-dentro { display: grid; grid-template-columns: repeat(4, 1fr); width: 100%; max-width: 560px; }
.aba { background: none; border: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; font-size: 11.5px; font-weight: 600; color: var(--suave); cursor: pointer; }
.aba.ativa { color: var(--marca-2); }
.aba svg { width: 22px; height: 22px; }

.flutuante { position: fixed; right: max(16px, calc(50% - 264px)); bottom: calc(82px + var(--base)); z-index: 6; border-radius: 18px; padding: 14px 18px; }

.toasts { position: fixed; left: 50%; transform: translateX(-50%); top: calc(12px + var(--topo)); z-index: 20; display: grid; gap: 8px; width: min(92vw, 420px); }
.toast { background: var(--escuro); color: #fff; padding: 12px 14px; border-radius: 12px; box-shadow: var(--sombra); font-size: 14px; }
.toast.ruim { background: var(--ruim); }
.carregando { display: grid; place-items: center; min-height: 60dvh; color: var(--suave); }

/* Sininho dos avisos no topo, com a bolinha de quantos são novos. */
.topo .sino { margin-left: auto; position: relative; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); color: #fff; border-radius: 12px; width: 40px; height: 38px; display: grid; place-items: center; cursor: pointer; }
.topo .sino + .sair { margin-left: 0; }
.bolinha { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: #ff3b30; color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; }
.avisos { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px; }
.aviso { border: 1px solid var(--linha); border-radius: 12px; padding: 10px 12px; background: #fff; }
.aviso.novo { border-color: #9fd8b7; background: #f4faf6; }
.aviso p { margin: 0 0 4px; }
.cartao-aviso { border-color: #9fd8b7; }
.cartao-aviso h2 { display: flex; align-items: center; gap: 8px; color: var(--marca-2); }
/* Quem está vendendo: posição no lugar do ícone, e a linha do próprio vendedor destacada. */
.ranking .posicao { font-weight: 800; font-size: 14px; }
.ranking .item.eu .meio b { color: var(--marca-2); }

/* Chave Pix: tipo reconhecido sozinho, embaixo do campo. */
.tipo-pix { display: block; margin-top: 6px; }
.erro-inline { color: var(--ruim); }

/* Computador: o app aparece dentro de um celular desenhado, centralizado (no celular de verdade, tela cheia).
   O transform da moldura faz a barra de abas e os botões fixos ficarem presos ao celular, não à janela. */
@media (min-width: 760px) and (min-height: 640px) {
  html, body { height: 100%; }
  body { display: grid; place-items: center; background: radial-gradient(circle at 50% 20%, #1d5c3d, #07120d 70%); }
  .moldura { position: relative; width: 390px; height: min(844px, calc(100dvh - 40px)); border-radius: 46px; border: 12px solid #0b0f0d;
    box-shadow: 0 0 0 2px #2b3a33, 0 30px 80px rgba(0,0,0,.55); overflow: hidden; transform: translateZ(0); background: var(--fundo); }
  .moldura::before { content: ''; position: absolute; top: 8px; left: 50%; transform: translateX(-50%); width: 110px; height: 26px; border-radius: 16px; background: #0b0f0d; z-index: 30; }
  .moldura .app { height: 100%; min-height: 0; overflow-y: auto; max-width: none; }
  .moldura .entrada { min-height: 100%; padding-top: 48px; }
  .moldura .abas-dentro { max-width: none; }
}

/* Barra de status do celular desenhado (só no computador) e sem barra de rolagem visível dentro dele. */
.barra-status { display: none; }
@media (min-width: 760px) and (min-height: 640px) {
  .barra-status { display: flex; position: absolute; top: 0; left: 0; right: 0; height: 44px; padding: 0 26px 0 30px; align-items: center; justify-content: space-between; z-index: 31; color: #fff; font: 600 14px Inter, system-ui, sans-serif; pointer-events: none; mix-blend-mode: difference; }
  .icones-status { display: flex; align-items: center; gap: 6px; }
  .icones-status svg { fill: currentColor; }
  .operadora { font-size: 12px; font-weight: 600; }
  .moldura .app { scrollbar-width: none; }
  .moldura .app::-webkit-scrollbar { display: none; }
  .moldura::before { top: 9px; width: 96px; height: 24px; }
}
