:root {
  color-scheme: light;
  --fundo: #eef0f7;
  --mancha-1: #c9c2ff; --mancha-2: #b4ecdf; --mancha-3: #ffd9c4;
  --vidro: rgba(255, 255, 255, .58);
  --vidro-forte: rgba(255, 255, 255, .78);
  --borda: rgba(255, 255, 255, .85);
  --linha: rgba(20, 20, 40, .08);
  --sombra: 0 10px 30px rgba(40, 40, 90, .08), 0 1px 2px rgba(40, 40, 90, .06);
  --texto: #14131c;
  --texto-2: #55536a;
  --texto-3: #8a889c;
  --acento: #5b3df5;
  --serie: #2a78d6;
  --trilho: rgba(42, 120, 214, .12);
  --bom: #16803c; --bom-fundo: rgba(22, 128, 60, .12);
  --ruim: #c62828; --ruim-fundo: rgba(198, 40, 40, .1);
  --alerta: #8a5a00; --alerta-fundo: rgba(237, 161, 0, .16);
  --raio: 20px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --fundo: #0b0c11;
    --mancha-1: #3a2a8c; --mancha-2: #0f5446; --mancha-3: #6b2f1c;
    --vidro: rgba(30, 32, 42, .55);
    --vidro-forte: rgba(38, 40, 52, .8);
    --borda: rgba(255, 255, 255, .09);
    --linha: rgba(255, 255, 255, .08);
    --sombra: 0 10px 30px rgba(0, 0, 0, .35);
    --texto: #f1f0f6;
    --texto-2: #b6b4c7;
    --texto-3: #848298;
    --acento: #9d8cff;
    --serie: #3987e5;
    --trilho: rgba(57, 135, 229, .16);
    --bom: #4cc27a; --bom-fundo: rgba(76, 194, 122, .14);
    --ruim: #ff6b6b; --ruim-fundo: rgba(255, 107, 107, .14);
    --alerta: #f2c14e; --alerta-fundo: rgba(242, 193, 78, .14);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --fundo: #0b0c11; --mancha-1: #3a2a8c; --mancha-2: #0f5446; --mancha-3: #6b2f1c;
  --vidro: rgba(30, 32, 42, .55); --vidro-forte: rgba(38, 40, 52, .8); --borda: rgba(255, 255, 255, .09);
  --linha: rgba(255, 255, 255, .08); --sombra: 0 10px 30px rgba(0, 0, 0, .35);
  --texto: #f1f0f6; --texto-2: #b6b4c7; --texto-3: #848298; --acento: #9d8cff; --serie: #3987e5; --trilho: rgba(57, 135, 229, .16);
  --bom: #4cc27a; --bom-fundo: rgba(76, 194, 122, .14); --ruim: #ff6b6b; --ruim-fundo: rgba(255, 107, 107, .14); --alerta: #f2c14e; --alerta-fundo: rgba(242, 193, 78, .14);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; background: var(--fundo); color: var(--texto);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--acento); }
[hidden] { display: none !important; }

.fundo { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.fundo i { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .75; }
.fundo i:nth-child(1) { width: 55vw; height: 55vw; left: -12vw; top: -14vw; background: var(--mancha-1); }
.fundo i:nth-child(2) { width: 45vw; height: 45vw; right: -10vw; top: 20vh; background: var(--mancha-2); }
.fundo i:nth-child(3) { width: 50vw; height: 50vw; left: 20vw; bottom: -25vw; background: var(--mancha-3); }

.vidro {
  background: var(--vidro); border: 1px solid var(--borda); box-shadow: var(--sombra);
  -webkit-backdrop-filter: blur(24px) saturate(170%); backdrop-filter: blur(24px) saturate(170%);
  border-radius: var(--raio);
}

/* entrada */
.entrada { min-height: 100dvh; display: grid; place-items: center; padding: 16px; }
.cartao-entrada { width: 100%; max-width: 360px; padding: 32px 26px; text-align: center; }
.marca { font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.cartao-entrada input {
  width: 100%; margin: 22px 0 12px; padding: 14px 16px; font-size: 16px; border-radius: 14px;
  border: 1px solid var(--linha); background: var(--vidro-forte); color: var(--texto); outline: none;
}
.cartao-entrada input:focus { border-color: var(--acento); box-shadow: 0 0 0 3px color-mix(in srgb, var(--acento) 22%, transparent); }
.botao { width: 100%; padding: 13px; border: 0; border-radius: 14px; background: var(--texto); color: var(--fundo); font-weight: 600; }
.erro { color: var(--ruim); min-height: 20px; margin: 10px 0 0; font-size: 14px; }

/* layout */
#app { max-width: 1120px; margin: 0 auto; padding: 18px 16px 28px; }
.topo { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
h1 { margin: 0; font-size: 30px; letter-spacing: -.025em; line-height: 1.1; }
h2 { margin: 0 0 12px; font-size: 16px; letter-spacing: -.01em; }
h3 { margin: 18px 0 10px; font-size: 13px; color: var(--texto-2); font-weight: 600; }
.sub { margin: 4px 0 0; color: var(--texto-2); font-size: 13.5px; }
.acoes-topo { display: flex; gap: 8px; }
.icone-botao { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--borda); background: var(--vidro); display: grid; place-items: center; -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
.icone-botao.ligado { color: var(--acento); }
.icone-botao.girando svg { animation: girar 1s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }

.abas { display: flex; gap: 4px; padding: 4px; margin-bottom: 12px; border-radius: 14px; overflow-x: auto; scrollbar-width: none; }
.abas button { flex: 1; white-space: nowrap; border: 0; background: transparent; padding: 9px 12px; border-radius: 10px; font-weight: 600; font-size: 14px; color: var(--texto-2); }
.abas button[aria-selected="true"] { background: var(--vidro-forte); color: var(--texto); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }

.filtros { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar, .abas::-webkit-scrollbar { display: none; }
.chips button { flex: none; border: 1px solid var(--borda); background: var(--vidro); padding: 7px 13px; border-radius: 99px; font-size: 13.5px; color: var(--texto-2); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.chips button.ativo { background: var(--texto); color: var(--fundo); border-color: transparent; }

/* indicadores */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 12px; }
.kpi { padding: 14px 16px; min-width: 0; }
.kpi .rotulo { font-size: 12.5px; color: var(--texto-2); }
.kpi .valor { font-size: 22px; font-weight: 700; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .det { font-size: 12px; color: var(--texto-3); margin-top: 2px; }
.kpi.heroi { grid-column: 1 / -1; }
.kpi.heroi .valor { font-size: 38px; }
@media (min-width: 760px) {
  .kpis { grid-template-columns: repeat(4, 1fr); }
  .kpi.heroi { grid-column: span 2; grid-row: span 2; display: flex; flex-direction: column; justify-content: center; }
  .kpi.heroi .valor { font-size: 48px; }
}

.bloco { padding: 16px; margin-bottom: 12px; min-width: 0; }
.bloco-topo { display: flex; justify-content: space-between; align-items: baseline; }
.link-botao { border: 0; background: none; color: var(--acento); font-size: 13.5px; padding: 0; }
.duas { display: grid; gap: 12px; }
@media (min-width: 760px) { .duas { grid-template-columns: 1fr 1fr; align-items: start; } .duas .bloco { margin-bottom: 0; } .duas { margin-bottom: 12px; } }

/* gráfico de barras */
.grafico { position: relative; height: 190px; }
.grafico svg { display: block; width: 100%; height: 100%; overflow: visible; }
.grafico .grade { stroke: var(--linha); stroke-width: 1; }
.grafico .eixo { fill: var(--texto-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.grafico .barra { fill: var(--serie); }
.grafico .alvo { fill: transparent; }
.grafico .alvo:hover + .barra, .grafico .barra.foco { opacity: .78; }
.vazio { color: var(--texto-3); font-size: 14px; padding: 18px 0; text-align: center; }
.tabela-serie table, .tabela { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.tabela-serie td, .tabela-serie th { padding: 6px 4px; border-bottom: 1px solid var(--linha); text-align: right; }
.tabela-serie td:first-child, .tabela-serie th:first-child { text-align: left; }

/* barras horizontais */
.linha-barra { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 7px 0; align-items: center; }
.linha-barra .nome { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 14px; }
.linha-barra .nome span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.linha-barra .num { font-weight: 600; font-variant-numeric: tabular-nums; font-size: 14px; text-align: right; }
.linha-barra .num small { color: var(--texto-3); font-weight: 400; margin-left: 6px; }
.linha-barra .trilho { grid-column: 1 / -1; height: 6px; border-radius: 4px; background: var(--trilho); overflow: hidden; }
.linha-barra .trilho i { display: block; height: 100%; border-radius: 4px; background: var(--serie); }

.selo { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18); width: 26px; height: 26px; flex: none; border-radius: 8px; color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; }

.assinantes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 760px) { .assinantes { grid-template-columns: repeat(4, 1fr); } }
.assinante { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--vidro-forte); }
.assinante b { font-size: 20px; font-variant-numeric: tabular-nums; display: block; line-height: 1.1; }
.assinante span { font-size: 12.5px; color: var(--texto-2); }
.rodape-dado { color: var(--texto-3); font-size: 13px; text-align: center; margin: 4px 0 0; }

/* lista de vendas */
.venda { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--linha); }
.venda:last-child { border-bottom: 0; }
.venda .meio { min-width: 0; }
.venda .t { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.venda .d { font-size: 12.5px; color: var(--texto-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.venda .v { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; font-size: 14px; }
.venda .v .estado { display: block; margin-top: 3px; }
.estado { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 99px; white-space: nowrap; display: inline-block; }
.estado.pago { background: var(--bom-fundo); color: var(--bom); }
.estado.reembolsado, .estado.chargeback { background: var(--ruim-fundo); color: var(--ruim); }
.estado.aguardando { background: var(--alerta-fundo); color: var(--alerta); }
.estado.recusado, .estado.cancelado { background: var(--linha); color: var(--texto-2); }
.riscado { text-decoration: line-through; color: var(--texto-3); }

/* sites */
.sites { display: grid; gap: 12px; }
@media (min-width: 860px) { .sites { grid-template-columns: 1fr 1fr; } }
.site { padding: 16px; min-width: 0; }
.site-topo { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.site-topo .selo { width: 44px; height: 44px; border-radius: 12px; font-size: 20px; }
.site-topo b { font-size: 17px; display: block; }
.site-topo span { font-size: 13px; color: var(--texto-2); }
.site-info { font-size: 12.5px; color: var(--texto-2); margin: -4px 0 10px; }
.acesso { padding: 10px 12px; border-radius: 14px; background: var(--vidro-forte); margin-bottom: 8px; }
.acesso-topo { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.acesso-topo .rot { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 8px; min-width: 0; }
.acesso-topo .rot span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.abrir { flex: none; text-decoration: none; font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 99px; background: var(--texto); color: var(--fundo); }
.url { font-size: 12.5px; color: var(--texto-3); word-break: break-all; margin-top: 2px; }
.credencial { display: flex; align-items: center; gap: 8px; margin-top: 7px; font-size: 13px; flex-wrap: wrap; }
.credencial .k { color: var(--texto-2); width: 54px; flex: none; }
.credencial code { font: 600 13px "SF Mono", Menlo, monospace; background: var(--linha); padding: 2px 8px; border-radius: 6px; word-break: break-all; }
.mini { border: 1px solid var(--linha); background: transparent; border-radius: 8px; padding: 2px 8px; font-size: 12px; color: var(--texto-2); }
.nota { font-size: 12.5px; color: var(--texto-2); margin-top: 6px; }
.ponto { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.ponto.ok { background: var(--bom); } .ponto.fora { background: var(--ruim); } .ponto.nd { background: var(--texto-3); }
.status-txt { font-size: 11.5px; font-weight: 600; flex: none; }
.status-txt.ok { color: var(--bom); } .status-txt.fora { color: var(--ruim); }
.pendencia { font-size: 13px; padding: 9px 12px; border-radius: 12px; background: var(--alerta-fundo); color: var(--texto); margin-top: 8px; }
.pendencia b { color: var(--alerta); }

/* atualizações */
.linha-tempo { list-style: none; margin: 0; padding: 0; }
.linha-tempo li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--linha); }
.linha-tempo li:last-child { border-bottom: 0; }
.linha-tempo .q { font-size: 12.5px; color: var(--texto-2); margin-bottom: 2px; }
.linha-tempo .x { font-size: 14px; }

.rodape { color: var(--texto-3); font-size: 12.5px; text-align: center; margin-top: 18px; }
.dica {
  position: fixed; z-index: 20; pointer-events: none; padding: 8px 10px; border-radius: 10px; font-size: 12.5px;
  background: var(--vidro-forte); border: 1px solid var(--borda); box-shadow: var(--sombra); color: var(--texto);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.dica b { display: block; font-size: 14px; }
.toast {
  position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0;
  padding: 10px 16px; border-radius: 99px; background: var(--texto); color: var(--fundo); font-size: 14px; transition: .25s; pointer-events: none; max-width: calc(100vw - 32px);
}
.toast.mostrar { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
