/* Ofertou: estilos do painel. Tokens do referencia/DESIGN.md */
:root {
  --fundo: #0B0C0F;
  --barra: #101216;
  --cartao: #16181D;
  --cartao-interno: #1D2027;
  --borda: #2A2E36;
  --texto: #F2F3F5;
  --texto-2: #A3A9B3;
  --texto-3: #D5D9DF;
  --laranja: #FF7A1A;
  --laranja-texto: #FF8F42;
  --sobre-laranja: #1A0B02;
  --verde: #22C55E;
  --verde-texto: #4ADE80;
  --sobre-verde: #04200D;
  --ambar: #F5B800;
  --vermelho: #F87171;
  --vermelho-fundo: rgba(248, 113, 113, 0.12);
  --raio-cartao: 14px;
  --raio: 10px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fundo);
  color: var(--texto);
  font-family: 'Poppins', 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.45;
}
a { color: var(--laranja-texto); }
a:hover { color: #FFB27A; }
input::placeholder, textarea::placeholder { color: #8A909A; }
img { max-width: 100%; }
h1, h2, h3 { margin: 0; }
h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 18px; font-weight: 600; }
h3 { font-size: 16px; font-weight: 600; }
p { margin: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { flex: 0 0 auto; }
:focus-visible { outline: 2px solid var(--laranja-texto); outline-offset: 2px; }

/* ---------- Estrutura ---------- */
.app { display: flex; min-height: 100vh; }
.lateral {
  width: 240px; flex: 0 0 240px; background: var(--barra); border-right: 1px solid var(--borda);
  padding: 22px 16px; display: flex; flex-direction: column; gap: 26px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.lateral .logo img { width: 150px; display: block; }
.menu { display: flex; flex-direction: column; gap: 4px; }
.menu a {
  display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 14px; border-radius: var(--raio);
  text-decoration: none; font-size: 15px; color: var(--texto-3); font-weight: 500;
}
.menu a:hover { background: var(--cartao); color: var(--texto); }
.menu a.ativo { background: var(--laranja); color: var(--sobre-laranja); font-weight: 700; }
.menu a .contador { margin-left: auto; }
.menu a.ativo .contador { background: var(--sobre-laranja); color: var(--laranja); }
.contador {
  background: var(--laranja); color: var(--sobre-laranja); border-radius: 999px; padding: 1px 8px;
  font-size: 12px; font-weight: 700; line-height: 1.5;
}
.status-robo {
  margin-top: auto; background: var(--cartao); border: 1px solid var(--borda); border-radius: 12px; padding: 14px;
  display: flex; flex-direction: column; gap: 6px; font-size: 13px;
}
.status-robo strong { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.status-robo span { color: var(--texto-2); }
.ponto { width: 8px; height: 8px; border-radius: 999px; background: var(--verde-texto); display: inline-block; flex: 0 0 auto; }
.ponto.ambar { background: var(--ambar); }
.ponto.vermelho { background: var(--vermelho); }
.ponto.cinza { background: #6B7280; }

.principal { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.topo {
  display: flex; align-items: center; gap: 16px; padding: 14px 32px; border-bottom: 1px solid var(--borda);
  background: var(--barra); position: sticky; top: 0; z-index: 20;
}
.topo .logo-celular { display: none; }
.busca {
  flex: 0 1 420px; display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 14px; border-radius: var(--raio);
  background: var(--cartao); border: 1px solid var(--borda); color: var(--texto-2);
}
.busca input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--texto); font: inherit; font-size: 14px; outline: none; }
.topo-direita { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.sino {
  position: relative; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--raio); color: var(--texto);
}
.sino:hover { background: var(--cartao); color: var(--texto); }
.sino .contador { position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; font-size: 11px; display: inline-flex; align-items: center; justify-content: center; }
.quem { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--texto); }
.avatar {
  width: 40px; height: 40px; border-radius: 999px; background: var(--cartao-interno); border: 1px solid var(--borda);
  display: inline-flex; align-items: center; justify-content: center; color: var(--texto);
}
.quem-texto { display: flex; flex-direction: column; font-size: 13px; line-height: 1.3; }
.quem-texto span { color: var(--texto-2); }
.link-sair { font-size: 13px; min-height: 44px; display: inline-flex; align-items: center; background: none; border: 0; color: var(--laranja-texto); font: inherit; cursor: pointer; padding: 0; }

.conteudo { padding: 28px 32px 40px; display: flex; flex-direction: column; gap: 22px; max-width: 1400px; width: 100%; }
.cabecalho { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; }
.cabecalho > div:first-child { display: flex; flex-direction: column; gap: 4px; }
.subtitulo { color: var(--texto-2); font-size: 15px; }

.menu-celular { display: none; }

/* ---------- Componentes ---------- */
.cartao { background: var(--cartao); border: 1px solid var(--borda); border-radius: var(--raio-cartao); padding: 20px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.cartao-interno { background: var(--cartao-interno); border: 1px solid var(--borda); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.cartao-titulo { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.cartao-titulo h2 { display: flex; align-items: center; gap: 10px; }
.grade { display: grid; grid-template-columns: repeat(auto-fit, minmax(var(--min, 210px), 1fr)); gap: 16px; }
.linha { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.linha > * { flex: 1 1 var(--base, 320px); min-width: 0; }
.pilha { display: flex; flex-direction: column; gap: var(--gap, 12px); }
.entre { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.mudo { color: var(--texto-2); }
.pequeno { font-size: 13px; }
.mini { font-size: 12px; }
.verde { color: var(--verde-texto); }
.laranja { color: var(--laranja-texto); }
.ambar { color: var(--ambar); }
.vermelho { color: var(--vermelho); }
.forte { font-weight: 700; }
.centro { text-align: center; }
.vazio { color: var(--texto-2); text-align: center; padding: 28px 12px; font-size: 14px; }
.divisor { border: 0; border-top: 1px solid var(--borda); margin: 0; width: 100%; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px;
  border: 0; border-radius: var(--raio); background: var(--laranja); color: var(--sobre-laranja); font: inherit;
  font-weight: 700; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: #FF8A33; color: var(--sobre-laranja); }
.btn.sec { background: var(--cartao-interno); color: var(--texto); border: 1px solid var(--borda); font-weight: 600; padding: 0 18px; }
.btn.sec:hover { background: #262A33; color: var(--texto); }
.btn.verde-btn { background: var(--verde); color: var(--sobre-verde); }
.btn.verde-btn:hover { background: #2FD86B; }
.btn.perigo { background: transparent; color: var(--vermelho); border: 1px solid rgba(248, 113, 113, 0.5); font-weight: 600; }
.btn.perigo:hover { background: var(--vermelho-fundo); }
.btn.grande { min-height: 52px; font-size: 16px; }
.btn.bloco { width: 100%; }
.btn.pequeno-btn { min-height: 38px; padding: 0 14px; font-size: 14px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.acoes { display: flex; flex-wrap: wrap; gap: 8px; }
form.inline { display: inline; margin: 0; }

.selo {
  display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 4px 11px; font-size: 12px; font-weight: 600;
  white-space: nowrap; background: rgba(255, 122, 26, 0.16); color: var(--laranja-texto); width: fit-content;
}
.selo.cheio { background: var(--laranja); color: var(--sobre-laranja); }
.selo.verde { background: rgba(34, 197, 94, 0.15); color: var(--verde-texto); }
.selo.verde-cheio { background: var(--verde); color: var(--sobre-verde); }
.selo.ambar { background: rgba(245, 184, 0, 0.15); color: var(--ambar); }
.selo.vermelho { background: var(--vermelho-fundo); color: var(--vermelho); }
.selo.cinza { background: var(--cartao-interno); color: var(--texto-2); border: 1px solid var(--borda); }
.selo.vip { background: linear-gradient(90deg, #F5B800, #FF7A1A); color: var(--sobre-laranja); }

.campo { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.campo label, .rotulo { font-size: 14px; font-weight: 600; color: var(--texto); }
.campo .ajuda { font-size: 12px; color: var(--texto-2); }
.entrada, .campo input:not([type=checkbox]):not([type=radio]), .campo select, .campo textarea {
  min-height: 46px; width: 100%; border: 1px solid var(--borda); border-radius: var(--raio); padding: 0 14px;
  font: inherit; background: var(--fundo); color: var(--texto);
}
.campo textarea { padding: 12px 14px; min-height: 140px; resize: vertical; line-height: 1.5; }
.campo input:focus, .campo select:focus, .campo textarea:focus { border-color: var(--laranja); outline: none; }
.grupo-entrada { display: flex; gap: 8px; }
.grupo-entrada > input { flex: 1; min-width: 0; }
.opcao { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; padding: 10px 0; cursor: pointer; font-size: 14px; }
.opcao input { width: 18px; height: 18px; accent-color: var(--laranja); margin-top: 2px; flex: 0 0 auto; }
.opcao-cartao { border: 1px solid var(--borda); border-radius: 12px; padding: 14px 16px; background: var(--cartao-interno); }
.opcao-cartao:has(input:checked) { border-color: var(--laranja); background: rgba(255, 122, 26, 0.08); }
.opcao-cartao strong { display: block; }
.opcao-cartao span span { color: var(--texto-2); font-size: 13px; }

.alerta {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px;
  background: rgba(245, 184, 0, 0.1); border: 1px solid rgba(245, 184, 0, 0.4); border-radius: 12px; padding: 14px 18px; font-size: 14px;
}
.alerta strong { color: var(--ambar); }
.alerta.ok { background: rgba(34, 197, 94, 0.1); border-color: rgba(34, 197, 94, 0.4); }
.alerta.ok strong { color: var(--verde-texto); }
.alerta.erro { background: var(--vermelho-fundo); border-color: rgba(248, 113, 113, 0.45); }
.alerta.erro strong { color: var(--vermelho); }
.alerta.info { background: rgba(255, 122, 26, 0.08); border-color: rgba(255, 122, 26, 0.35); }
.alerta.info strong { color: var(--laranja-texto); }

.aviso-flutuante {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 24px; z-index: 100; max-width: min(560px, calc(100% - 24px));
  background: var(--cartao-interno); border: 1px solid var(--borda); border-left: 4px solid var(--verde); border-radius: 12px;
  padding: 14px 18px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5); font-size: 14px; animation: subir .25s ease-out;
}
.aviso-flutuante.erro { border-left-color: var(--vermelho); }
@keyframes subir { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }

.abas { display: flex; gap: 6px; background: var(--cartao); border: 1px solid var(--borda); border-radius: 12px; padding: 5px; overflow-x: auto; width: fit-content; max-width: 100%; }
.abas a, .abas button {
  min-height: 40px; padding: 0 16px; border: 0; border-radius: 8px; background: transparent; color: var(--texto);
  font: inherit; font-size: 14px; display: inline-flex; align-items: center; text-decoration: none; white-space: nowrap; cursor: pointer;
}
.abas a.ativo, .abas button.ativo { background: var(--laranja); color: var(--sobre-laranja); font-weight: 700; }

.kpi { gap: 10px; }
.kpi .rotulo-kpi { color: var(--texto-2); font-size: 14px; }
.kpi .valor { font-size: 28px; font-weight: 700; white-space: nowrap; }
.kpi .linha-kpi { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.kpi .variacao { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; }

.tabela-rolagem { overflow-x: auto; margin: 0 -4px; }
table.tabela { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabela th { text-align: left; color: var(--texto-2); font-weight: 500; font-size: 13px; padding: 10px 12px; border-bottom: 1px solid var(--borda); white-space: nowrap; }
.tabela td { padding: 12px; border-bottom: 1px solid var(--borda); vertical-align: middle; }
.tabela tr:last-child td { border-bottom: 0; }
.tabela .num { text-align: right; white-space: nowrap; }

/* Cartão de produto: branco com foto em cima e selo de desconto verde */
.produto { background: #FFFFFF; color: #16181D; border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.produto .foto { height: 130px; border-radius: 10px; background: #F1F2F4; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.produto .foto img { width: 100%; height: 100%; object-fit: contain; }
.produto .nome { font-size: 14px; line-height: 1.35; min-height: 38px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.produto s { font-size: 12px; color: #6B7280; }
.produto .preco { font-size: 20px; font-weight: 700; }
.produto .comissao { font-size: 12px; color: #0F7A3A; font-weight: 600; }
.produto .info { font-size: 12px; color: #5C636E; }
.desconto { background: #16A34A; color: #FFFFFF; border-radius: 999px; padding: 2px 8px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.foto-mini { width: 52px; height: 52px; flex: 0 0 52px; border-radius: 10px; background: #F1F2F4; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.foto-mini img { width: 100%; height: 100%; object-fit: contain; }

/* Ícone redondo colorido */
.bolinha { width: 40px; height: 40px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; color: #16181D; }
.bolinha.verde { background: var(--verde); } .bolinha.ambar { background: var(--ambar); } .bolinha.laranja { background: var(--laranja); }
.bolinha.cinza { background: var(--cartao-interno); color: var(--texto-2); border: 1px solid var(--borda); }
.bolinha.vermelho { background: var(--vermelho); }
.quadrado { border-radius: 12px; width: 42px; height: 42px; }

.passos { display: flex; flex-direction: column; gap: 12px; }
.passo { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; }
.passo .n { width: 28px; height: 28px; flex: 0 0 28px; border-radius: 999px; background: rgba(255, 122, 26, 0.16); color: var(--laranja-texto); font-weight: 700; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; }

/* Barra de progresso */
.barra-prog { height: 8px; border-radius: 999px; background: var(--cartao-interno); overflow: hidden; }
.barra-prog > span { display: block; height: 100%; background: var(--laranja); border-radius: 999px; }

/* Telas sem menu (login, convite, instalar) */
.tela-solo { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 28px 18px; }
.tela-solo .caixa { width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 22px; }

.login { display: flex; flex-wrap: wrap; min-height: 100vh; }
.login-form { flex: 1 1 420px; padding: 56px 56px 40px; display: flex; flex-direction: column; justify-content: center; gap: 28px; background: var(--barra); }
.login-form > * { width: 100%; max-width: 440px; margin: 0 auto; }
.login-hero {
  flex: 1.3 1 520px; padding: 56px; display: flex; flex-direction: column; justify-content: center; gap: 40px;
  background: radial-gradient(ellipse at 70% 40%, rgba(255, 122, 26, 0.28), rgba(11, 12, 15, 0) 60%), var(--fundo);
}
.login-hero h2 { font-size: 34px; line-height: 1.15; font-weight: 800; color: var(--laranja-texto); font-style: italic; }
.login-hero p { font-size: 16px; line-height: 1.6; color: var(--texto-3); }
.celular {
  flex: 0 0 230px; height: 440px; border-radius: 34px; border: 6px solid #2B2F37; background: #0E1013; padding: 18px 14px;
  display: flex; flex-direction: column; gap: 12px; box-shadow: 0 30px 80px rgba(255, 122, 26, 0.25);
}
.recursos { display: flex; flex-wrap: wrap; gap: 16px; }
.recursos div { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; font-size: 13px; font-weight: 500; flex: 1 1 90px; }
.recursos .circulo { width: 52px; height: 52px; border-radius: 999px; border: 1px solid rgba(255, 122, 26, 0.5); background: rgba(255, 122, 26, 0.1); color: var(--laranja-texto); display: inline-flex; align-items: center; justify-content: center; }

/* Prévia do post no WhatsApp */
.whats { background: #0B141A; border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.whats-balao { background: #1F2C34; border-radius: 10px; padding: 8px; max-width: 340px; display: flex; flex-direction: column; gap: 8px; }
.whats-balao .foto { height: 170px; border-radius: 8px; background: #F1F2F4; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.whats-balao .foto img { width: 100%; height: 100%; object-fit: contain; }
.whats-texto { white-space: pre-wrap; font-size: 14px; line-height: 1.5; color: #E9EDEF; padding: 0 4px 4px; word-break: break-word; }
.whats-texto .link { color: #53BDEB; }

/* Score */
.anel { position: relative; width: 132px; height: 132px; flex: 0 0 auto; }
.anel .centro-anel { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.anel strong { font-size: 32px; }

/* Lista com linhas separadas */
.lista > * { padding: 12px 0; border-top: 1px solid var(--borda); }
.lista > *:first-child { border-top: 0; }

/* Notificações */
.notif { display: flex; align-items: flex-start; gap: 14px; padding: 16px; border-top: 1px solid var(--borda); }
.notif.nao-lida { background: rgba(255, 122, 26, 0.06); }
.notif .corpo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.notif .msg { font-size: 14px; color: #C9CED6; line-height: 1.5; }
.notif .marca { width: 9px; height: 9px; border-radius: 999px; background: var(--laranja); flex: 0 0 auto; margin-top: 6px; }
.dia-grupo { padding: 14px 16px 8px; font-size: 13px; font-weight: 600; color: var(--texto-2); border-top: 1px solid var(--borda); }
.dia-grupo:first-child { border-top: 0; }

/* Chave liga/desliga */
.chave { position: relative; display: inline-flex; width: 46px; height: 26px; flex: 0 0 auto; }
.chave input { opacity: 0; width: 0; height: 0; position: absolute; }
.chave span { position: absolute; inset: 0; background: var(--borda); border-radius: 999px; transition: .2s; cursor: pointer; }
.chave span::before { content: ''; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 999px; transition: .2s; }
.chave input:checked + span { background: var(--laranja); }
.chave input:checked + span::before { transform: translateX(20px); }

.qr { background: #fff; border-radius: 12px; padding: 12px; width: 220px; height: 220px; display: flex; align-items: center; justify-content: center; }
.qr img, .qr svg { width: 100%; height: 100%; }

dialog { background: var(--cartao); color: var(--texto); border: 1px solid var(--borda); border-radius: 16px; padding: 22px; max-width: min(520px, calc(100% - 24px)); width: 100%; }
dialog::backdrop { background: rgba(0, 0, 0, 0.6); }

/* ---------- Celular ---------- */
@media (max-width: 900px) {
  .lateral { display: none; }
  .topo { padding: 10px 14px; gap: 10px; }
  .topo .logo-celular { display: block; }
  .topo .logo-celular img { height: 30px; width: auto; display: block; }
  .busca { display: none; }
  .quem-texto, .link-sair { display: none; }
  .conteudo { padding: 18px 14px 110px; gap: 18px; }
  h1 { font-size: 24px; }
  .menu-celular {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--barra); border-top: 1px solid var(--borda);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around;
  }
  .menu-celular a, .menu-celular button {
    flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 52px; justify-content: center;
    font-size: 11px; color: var(--texto-2); text-decoration: none; border: 0; background: none; font-family: inherit; position: relative; cursor: pointer;
  }
  .menu-celular a.ativo { color: var(--laranja-texto); font-weight: 600; }
  .menu-celular .contador { position: absolute; top: 2px; left: 55%; font-size: 10px; padding: 0 6px; }
  .gaveta { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, 0.6); display: none; }
  .gaveta.aberta { display: block; }
  .gaveta nav { position: absolute; left: 0; right: 0; bottom: 0; background: var(--barra); border-radius: 18px 18px 0 0; padding: 18px 14px calc(18px + env(safe-area-inset-bottom)); }
  .login-form { padding: 36px 20px; }
  .login-hero { display: none; }
  .tabela-celular thead { display: none; }
  .tabela-celular tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 12px 0; border-bottom: 1px solid var(--borda); }
  .tabela-celular td { border: 0; padding: 0; }
}
@media (min-width: 901px) { .gaveta { display: none !important; } }
[hidden] { display: none !important; }
