/* Visual do sistema. Os seletores começam com "body" pra valerem por cima das classes
   do Tailwind, que é carregado pela internet e injeta o CSS dele depois deste. */

:root {
  --marca: #7b2ff7;
  --marca-escura: #6420d6;
  --marca-clara: #f1eaff;
  --destaque: #f7a12b;
  --fundo: #f4f5fa;
  --borda: #e7e8f0;
  --menu: #111633;
}

body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
body.bg-slate-50 { background-color: var(--fundo); }

/* ---------- Estrutura: menu lateral + conteúdo ---------- */

body .app { display: flex; min-height: 100vh; }
body .conteudo { flex: 1; min-width: 0; }

body .menu {
  width: 224px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 14px 14px 20px;
  background: #fff;
  border-right: 1px solid var(--borda);
}
body .marca img { display: block; width: 168px; max-width: 100%; margin: 0 auto; }
body .menu-itens { display: flex; flex-direction: column; gap: 4px; }
body .menu-rodape { margin-top: auto; padding: 0 8px; font-size: 11.5px; color: #8a879a; }

body button.secao-btn {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 500;
  color: #4a4858;
  text-align: left;
  white-space: nowrap;
  transition: background-color 0.15s, color 0.15s;
}
body button.secao-btn svg { width: 19px; height: 19px; flex-shrink: 0; }
body button.secao-btn:hover { background: var(--marca-clara); color: var(--marca-escura); }
body button.secao-btn.ativo { background: var(--marca); color: #fff; box-shadow: 0 6px 16px rgba(123, 47, 247, 0.28); }

@media (max-width: 860px) {
  body .app { flex-direction: column; }
  body .menu { width: 100%; height: auto; position: static; flex-direction: row; align-items: center; gap: 12px; padding: 10px 12px; overflow-x: auto; }
  body .menu-itens { flex-direction: row; }
  body .marca img { width: 92px; }
  body .menu-rodape { display: none; }
}

/* ---------- Sub-abas em formato de pílula ---------- */

body nav:has(> .tab-btn), body nav:has(> .promo-tab-btn), body nav:has(> .rank-tab-btn), body nav:has(> .integ-btn) {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  width: fit-content;
  max-width: 100%;
  padding: 4px;
  background: #fff;
  border: 1px solid var(--borda);
  border-radius: 13px;
}
body button.tab-btn, body button.promo-tab-btn, body button.rank-tab-btn, body button.integ-btn {
  border: 0;
  border-radius: 9px;
  transition: background-color 0.15s, color 0.15s;
}
body button.tab-btn:hover, body button.promo-tab-btn:hover, body button.rank-tab-btn:hover, body button.integ-btn:hover { background: var(--marca-clara); }
body button.tab-btn.bg-white, body button.promo-tab-btn.bg-white, body button.rank-tab-btn.bg-white, body button.integ-btn.bg-white {
  background-color: var(--marca);
  color: #fff;
}

/* ---------- Cartões, botões e campos ---------- */

body .bg-white.rounded-xl {
  border-color: var(--borda);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(17, 22, 51, 0.04), 0 4px 14px rgba(17, 22, 51, 0.04);
}

body button { transition: filter 0.15s, background-color 0.15s; }
body button.bg-slate-900, body button.bg-indigo-600 { background-color: var(--marca); }
body button.bg-slate-900:hover, body button.bg-indigo-600:hover { background-color: var(--marca-escura); }

body input:not([type="checkbox"]):not([type="file"]), body select, body textarea { border-radius: 10px; border-color: #d9dbe7; }
body input:focus-visible, body select:focus-visible, body textarea:focus-visible, body button:focus-visible {
  outline: 2px solid rgba(123, 47, 247, 0.55);
  outline-offset: 1px;
}

/* ---------- Dashboard ---------- */

body .filtros {
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--borda);
  border-radius: 16px;
}
body button.dash-periodo { border-color: transparent; background-color: #f1f2f8; }
body button.dash-periodo.bg-slate-900 { background-color: var(--marca); }

body .cartao { position: relative; overflow: hidden; }
body .cartao-valor { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
body .cartao.cartao-destaque { background: linear-gradient(135deg, #6420d6, #8b3dfa); border-color: transparent; }
body .cartao.cartao-destaque p { color: #fff; }
body .cartao.cartao-destaque p:not(.cartao-valor) { color: rgba(255, 255, 255, 0.85); }
body .detalhe-valor { font-variant-numeric: tabular-nums; }
body #dash-detalhes { border-radius: 16px; }

body #dash-produtos, body #dash-vendas, body #dash-ads-anuncios { font-size: 12.5px; font-variant-numeric: tabular-nums; }
body #dash-produtos thead th, body #dash-vendas thead th, body #dash-ads-anuncios thead th {
  padding-top: 9px;
  padding-bottom: 9px;
  background: #f7f8fc;
  font-size: 10.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
body #dash-produtos tbody td, body #dash-vendas tbody td, body #dash-ads-anuncios tbody td { padding-top: 9px; padding-bottom: 9px; }
body #dash-produtos tbody tr:hover, body #dash-vendas tbody tr:hover, body #dash-ads-anuncios tbody tr:hover { background: #f8f8ff; }

/* ---------- Rankings ---------- */

body .rank-linha { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid #f1eff8; }
body .rank-pos {
  display: grid; place-items: center; width: 22px; height: 22px; flex-shrink: 0;
  border-radius: 50%; background: #f1eff8; color: #3c3a4a; font-size: 11px; font-weight: 600;
}
body .rank-pos-1 { background: var(--destaque); color: #0d0d12; }
body .rank-pos-2, body .rank-pos-3 { background: #e9dfff; color: #4c1d95; }
body .rank-foto { width: 42px; height: 42px; flex-shrink: 0; border-radius: 10px; background: #f4f2fa; object-fit: cover; border: 1px solid var(--borda); }
body .rank-loja { display: grid; place-items: center; background: var(--marca-clara); color: var(--marca-escura); font-size: 12px; font-weight: 700; }
body .rank-barra { height: 3px; margin-top: 4px; border-radius: 2px; background: #f1eff8; }
body .rank-barra span { display: block; height: 3px; border-radius: 2px; background: var(--marca); }
body a.text-indigo-600, body button.text-indigo-600 { color: var(--marca-escura); }

body #dash-ads-anuncios td:first-child { min-width: 320px; }
