/* Visual do sistema. Todas as cores saem das variáveis abaixo: mexer no tema é mexer só aqui.
   Tema escuro em PRETO e cinzas neutros (sem azul). */
@import url(fonts/inter.css);

:root {
  --fundo: #f5f5f3; --sup: #ffffff; --sup-2: #fafaf9; --sup-3: #f0f0ee;
  --borda: #e5e5e2; --borda-forte: #d1d1cd;
  --texto: #18181b; --texto-2: #52525b; --texto-3: #8a8a93;
  --primario: #18181b; --primario-texto: #ffffff; --primario-hover: #303036;
  --destaque: #0f8a5f; --destaque-fundo: #e6f5ee;
  --perigo: #c62828; --perigo-fundo: #fdecec; --aviso: #a15c00; --aviso-fundo: #fdf3e0; --info-fundo: #efefed;
  --sombra: 0 1px 2px rgba(0,0,0,.05), 0 8px 24px rgba(0,0,0,.06);
  --sombra-alta: 0 24px 60px rgba(0,0,0,.18);
  --raio: 12px; --raio-p: 8px;
  color-scheme: light;
}
:root[data-tema="escuro"] {
  --fundo: #0a0a0a; --sup: #131313; --sup-2: #181818; --sup-3: #1f1f1f;
  --borda: #262626; --borda-forte: #383838;
  --texto: #f2f2f2; --texto-2: #b4b4b4; --texto-3: #7d7d7d;
  --primario: #f2f2f2; --primario-texto: #0a0a0a; --primario-hover: #d6d6d6;
  --destaque: #34d399; --destaque-fundo: #10261d;
  --perigo: #f87171; --perigo-fundo: #2a1414; --aviso: #fbbf24; --aviso-fundo: #2a2010; --info-fundo: #1c1c1c;
  --sombra: 0 1px 2px rgba(0,0,0,.5), 0 8px 24px rgba(0,0,0,.4);
  --sombra-alta: 0 24px 60px rgba(0,0,0,.7);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fundo); color: var(--texto); font: 14px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 22px; font-weight: 650; letter-spacing: -.02em; }
h2 { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
h3 { font-size: 13px; font-weight: 600; }
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.mut { color: var(--texto-2); } .mut2 { color: var(--texto-3); } .peq { font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--texto); outline-offset: 2px; }

/* Botões */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: var(--raio-p); border: 1px solid var(--borda-forte); background: var(--sup); font-weight: 550; white-space: nowrap; transition: background .12s, border-color .12s, opacity .12s; text-decoration: none; }
.btn:hover { background: var(--sup-3); }
.btn.pri { background: var(--primario); color: var(--primario-texto); border-color: var(--primario); }
.btn.pri:hover { background: var(--primario-hover); border-color: var(--primario-hover); }
.btn.per { color: var(--perigo); border-color: color-mix(in srgb, var(--perigo) 40%, var(--borda)); }
.btn.per:hover { background: var(--perigo-fundo); }
.btn.liso { border-color: transparent; background: transparent; }
.btn.liso:hover { background: var(--sup-3); }
.btn.p { height: 32px; padding: 0 10px; font-size: 13px; }
.btn.bloco { width: 100%; height: 44px; }
.btn[disabled] { opacity: .55; cursor: default; }
.btn svg, .ico svg { width: 16px; height: 16px; flex: none; }
.ico { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: var(--raio-p); border: 0; background: transparent; color: var(--texto-2); }
.ico:hover { background: var(--sup-3); color: var(--texto); }
.girando { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: giro .7s linear infinite; }
@keyframes giro { to { transform: rotate(360deg); } }

/* Campos */
.campo { display: grid; gap: 6px; }
.campo > label, .rotulo { font-size: 12.5px; font-weight: 550; color: var(--texto-2); }
.inp { width: 100%; height: 40px; padding: 0 12px; border-radius: var(--raio-p); border: 1px solid var(--borda-forte); background: var(--sup); outline: 0; transition: border-color .12s, box-shadow .12s; }
textarea.inp { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; }
.inp:focus { border-color: var(--texto); box-shadow: 0 0 0 3px color-mix(in srgb, var(--texto) 12%, transparent); }
.inp::placeholder { color: var(--texto-3); }
.com-olho { position: relative; }
.com-olho .inp { padding-right: 44px; }
.com-olho .ico { position: absolute; right: 3px; top: 3px; }
.grade2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grade3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.pilha { display: grid; gap: 14px; }
.linha { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cresce { flex: 1; min-width: 0; }
.marcar { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--texto-2); cursor: pointer; }
.marcar input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--primario); flex: none; }

/* Seletor próprio (no lugar do select do navegador) */
.sel { position: relative; }
.sel-btn { width: 100%; height: 40px; padding: 0 34px 0 12px; text-align: left; border-radius: var(--raio-p); border: 1px solid var(--borda-forte); background: var(--sup); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sel-btn::after { content: ""; position: absolute; right: 13px; top: 15px; width: 7px; height: 7px; border-right: 1.5px solid var(--texto-2); border-bottom: 1.5px solid var(--texto-2); transform: rotate(45deg); }
.sel.aberto .sel-btn { border-color: var(--texto); }
.sel-lista { position: absolute; z-index: 60; left: 0; right: 0; top: calc(100% + 4px); max-height: 260px; overflow: auto; padding: 4px; background: var(--sup); border: 1px solid var(--borda-forte); border-radius: var(--raio-p); box-shadow: var(--sombra); min-width: max-content; }
.sel-op { display: block; width: 100%; padding: 8px 10px; border: 0; background: transparent; border-radius: 6px; text-align: left; }
.sel-op:hover, .sel-op.foco { background: var(--sup-3); }
.sel-op.ativa { font-weight: 600; }
.sel.p .sel-btn { height: 34px; font-size: 13px; }
.sel.p .sel-btn::after { top: 12px; }

/* Cartões, etiquetas, avisos */
.cartao { background: var(--sup); border: 1px solid var(--borda); border-radius: var(--raio); padding: 20px; }
.tag { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 550; background: var(--info-fundo); color: var(--texto-2); white-space: nowrap; }
.tag.ok { background: var(--destaque-fundo); color: var(--destaque); }
.tag.av { background: var(--aviso-fundo); color: var(--aviso); }
.tag.er { background: var(--perigo-fundo); color: var(--perigo); }
.aviso { padding: 12px 14px; border-radius: var(--raio-p); background: var(--aviso-fundo); color: var(--aviso); font-size: 13.5px; }
.aviso.er { background: var(--perigo-fundo); color: var(--perigo); }
.aviso.ok { background: var(--destaque-fundo); color: var(--destaque); }
.aviso.neutro { background: var(--info-fundo); color: var(--texto-2); }
.vazio { padding: 48px 20px; text-align: center; color: var(--texto-3); }
.vazio b { display: block; color: var(--texto); font-size: 15px; margin-bottom: 4px; font-weight: 600; }

/* Tabela */
.tabela-caixa { background: var(--sup); border: 1px solid var(--borda); border-radius: var(--raio); overflow: auto; }
table.tab { width: 100%; border-collapse: collapse; }
.tab th { text-align: left; font-size: 12px; font-weight: 550; color: var(--texto-3); padding: 10px 14px; border-bottom: 1px solid var(--borda); white-space: nowrap; background: var(--sup-2); position: sticky; top: 0; }
.tab td { padding: 11px 14px; border-bottom: 1px solid var(--borda); vertical-align: middle; }
.tab tr:last-child td { border-bottom: 0; }
.tab td:first-child { min-width: 190px; }
.tab tbody tr.clic { cursor: pointer; }
.tab tbody tr.clic:hover { background: var(--sup-2); }
.dir { text-align: right !important; }

/* Avatar */
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--sup-3); color: var(--texto-2); display: inline-grid; place-items: center; font-size: 12px; font-weight: 600; overflow: hidden; flex: none; border: 1px solid var(--borda); }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.g { width: 72px; height: 72px; font-size: 22px; }

/* Janela (só fecha pelos botões) */
.veu { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.5); display: grid; place-items: center; padding: 16px; overflow: auto; }
.janela { width: 100%; max-width: 520px; background: var(--sup); border: 1px solid var(--borda); border-radius: 14px; box-shadow: var(--sombra-alta); max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
.janela.larga { max-width: 760px; }
.janela-topo { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--borda); }
.janela-corpo { padding: 20px; overflow: auto; }
.janela-pe { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--borda); flex-wrap: wrap; }

/* Avisos rápidos */
.torradas { position: fixed; z-index: 200; right: 16px; bottom: 16px; display: grid; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.torrada { padding: 12px 14px; border-radius: 10px; background: var(--primario); color: var(--primario-texto); box-shadow: var(--sombra-alta); font-size: 13.5px; animation: sobe .18s ease-out; }
.torrada.er { background: var(--perigo); color: #fff; }
@keyframes sobe { from { opacity: 0; transform: translateY(8px); } }

/* Páginas de entrada (login, cadastro, afiliado) */
.entrada { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); }
.entrada-form { display: grid; place-items: center; padding: 32px 20px; }
.entrada-caixa { width: 100%; max-width: 400px; }
.entrada-caixa.larga { max-width: 520px; }
.entrada-lado { background: #0a0a0a; color: #f2f2f2; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.entrada-lado::before { content: ""; position: absolute; inset: 0; background: radial-gradient(600px 400px at 85% 10%, rgba(255,255,255,.09), transparent 60%), radial-gradient(500px 500px at 0% 100%, rgba(52,211,153,.12), transparent 60%); }
.entrada-lado > * { position: relative; }
.entrada-lado h2 { font-size: 34px; line-height: 1.12; letter-spacing: -.03em; font-weight: 650; max-width: 14em; }
.entrada-lado li { margin: 10px 0; color: #b4b4b4; }
.entrada-lado ul { padding-left: 18px; margin: 20px 0 0; }
.marca { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; font-size: 16px; letter-spacing: -.01em; text-decoration: none; }
.marca i { width: 26px; height: 26px; border-radius: 8px; background: var(--primario); display: block; position: relative; }
.marca i::after { content: ""; position: absolute; inset: 7px; border-radius: 3px; background: var(--primario-texto); }
.entrada-lado .marca i { background: #f2f2f2; } .entrada-lado .marca i::after { background: #0a0a0a; }
.lk { background: none; border: 0; padding: 0; color: var(--texto); font-weight: 550; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.tema-canto { position: fixed; top: 14px; left: 14px; z-index: 5; }
@media (max-width: 900px) {
  .entrada { grid-template-columns: 1fr; } .entrada-lado { display: none; }
  .grade2, .grade3 { grid-template-columns: 1fr; }
}
