/* Painel de administração do Facyo. As cores e as fontes são as da landing (site/estilo.css). */
@font-face { font-family: 'Sora'; font-weight: 600; font-display: swap; src: url('/fontes/Sora_600SemiBold.ttf') format('truetype'); }
@font-face { font-family: 'DM Sans'; font-weight: 400; font-display: swap; src: url('/fontes/DMSans_400Regular.ttf') format('truetype'); }
@font-face { font-family: 'DM Sans'; font-weight: 500; font-display: swap; src: url('/fontes/DMSans_500Medium.ttf') format('truetype'); }
@font-face { font-family: 'DM Sans'; font-weight: 600; font-display: swap; src: url('/fontes/DMSans_600SemiBold.ttf') format('truetype'); }

:root {
  --ink: #16202b;
  --ground: #f1f5f9;
  --surface: #ffffff;
  --line: #d9e1ea;
  --muted: #5c6b7a;
  --accent: #2f6086;
  --accent-pressed: #1e466e;
  --accent-soft: #dce8f2;
  --success: #1e6b47;
  --success-soft: #ddefe6;
  --warning: #8a5a00;
  --warning-soft: #fdf1d8;
  --danger: #a3271f;
  --danger-soft: #fbe3e1;
  --display: 'Sora', -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --body: 'DM Sans', -apple-system, 'Helvetica Neue', Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e8eef4; --ground: #0e151c; --surface: #16202b; --line: #2a3846; --muted: #9aa8b8;
    --accent: #7fb0d8; --accent-pressed: #a7c9e6; --accent-soft: #1d3346;
    --success: #7fd1a6; --success-soft: #16352a; --warning: #f2c46b; --warning-soft: #3a2e12;
    --danger: #f19a92; --danger-soft: #3d1c1a;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--body); font-size: 15px; line-height: 1.45; color: var(--ink); background: var(--ground);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
h1, h2 { font-family: var(--display); font-weight: 600; letter-spacing: -0.02em; margin: 0; }
h1 { font-size: 24px; }
h2 { font-size: 15px; margin-bottom: 12px; }
button { font: inherit; color: inherit; cursor: pointer; }
/* 16px nos campos: abaixo disso o Safari do iPhone dá zoom na página ao tocar no campo. */
input { font: inherit; font-size: 16px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; width: 100%; }
input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
label, .rotulo { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 12px 0 6px; }
[hidden] { display: none !important; }

.botao { display: block; width: 100%; margin-top: 16px; padding: 12px; border: 0; border-radius: 10px; background: var(--accent); color: #fff; font-weight: 600; }
.botao:hover { background: var(--accent-pressed); }
.botao:disabled { opacity: 0.6; cursor: default; }
.botao-perigo { background: var(--danger-soft); color: var(--danger); }
.botao-perigo:hover { background: var(--danger-soft); filter: brightness(0.96); }
.botao-claro { background: var(--accent-soft); color: var(--accent-pressed); }
.botao-claro:hover { background: var(--accent-soft); filter: brightness(0.96); }
.link { background: none; border: 0; color: var(--accent); padding: 10px 0; }
.apoio { color: var(--muted); margin: 0; }
.nota { color: var(--muted); font-size: 12.5px; margin: 10px 0 0; }
.erro { color: var(--danger); margin: 12px 0 0; }

/* Entrar */
.entrar { max-width: 360px; margin: 12vh auto 0; padding: 0 16px; text-align: center; }
.entrar img { border-radius: 16px; margin-bottom: 12px; }
.entrar form { text-align: left; margin-top: 20px; }
.entrar .apoio { margin-top: 12px; }

/* Topo e abas */
.topo { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; background: var(--ground); border-bottom: 1px solid var(--line); }
.marca { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 600; }
.marca img { border-radius: 8px; }
.topo-acoes { display: flex; align-items: center; gap: 8px; }
.topo-acoes .apoio { font-size: 12px; }
.icone-botao { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: 13px; }
.abas { display: flex; gap: 4px; padding: 10px 16px 0; max-width: 1180px; margin: 0 auto; }
.abas button { flex: 1; max-width: 180px; background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 4px; color: var(--muted); font-weight: 600; }
.abas button[aria-selected='true'] { color: var(--ink); border-bottom-color: var(--accent); }
.aba { max-width: 1180px; margin: 0 auto; padding: 16px; }

/* Chips de período, filtros e durações */
.periodos, .filtros, .duracoes { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.periodos button, .filtros button, .duracoes button { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 500; }
.periodos button[aria-pressed='true'], .filtros button[aria-pressed='true'], .duracoes button[aria-pressed='true'] { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Cartões de números */
.cartoes { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; margin-bottom: 14px; }
.cartao { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.cartao b { display: block; font-family: var(--display); font-size: 26px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.cartao span { font-size: 12.5px; color: var(--muted); }
.cartao small { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }

.bloco { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 14px; min-width: 0; }
.grade-2 { display: grid; grid-template-columns: 1fr; gap: 0 14px; }
@media (min-width: 860px) { .grade-2 { grid-template-columns: 1fr 1fr; } }

/* Gráfico de barras dos cadastros */
.grafico { display: flex; align-items: flex-end; gap: 3px; height: 150px; padding-top: 18px; }
.grafico .barra { position: relative; flex: 1; min-width: 4px; background: var(--accent); border-radius: 3px 3px 0 0; }
.grafico .barra:hover { background: var(--accent-pressed); }
.grafico .barra span { position: absolute; top: -17px; left: 50%; transform: translateX(-50%); font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.grafico-eixo { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 6px; }

/* Funil e plataformas: barras horizontais */
.linha-barra { display: grid; grid-template-columns: minmax(110px, 38%) 1fr auto; align-items: center; gap: 10px; margin: 7px 0; font-size: 13.5px; }
.linha-barra .trilho { height: 10px; background: var(--ground); border-radius: 5px; overflow: hidden; }
.linha-barra .trilho i { display: block; height: 100%; background: var(--accent); border-radius: 5px; }
.linha-barra b { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 64px; text-align: right; }
.linha-barra b small { color: var(--muted); font-weight: 400; }

/* Lista de usuários */
.busca { margin-bottom: 10px; }
.lista { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 860px) { .lista { grid-template-columns: 1fr 1fr; } }
.usuario { text-align: left; width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; min-width: 0; }
.usuario:hover { border-color: var(--accent); }
.usuario .email { font-weight: 600; overflow-wrap: anywhere; }
.usuario .meta { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.usuario .uso { font-size: 12.5px; margin-top: 6px; color: var(--ink); }
.selos { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.selo { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--ground); color: var(--muted); }
.selo.ok { background: var(--success-soft); color: var(--success); }
.selo.cortesia { background: var(--accent-soft); color: var(--accent-pressed); }
.selo.alerta { background: var(--warning-soft); color: var(--warning); }
.selo.ruim { background: var(--danger-soft); color: var(--danger); }

.item { padding: 9px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.item:first-child { border-top: 0; padding-top: 0; }
.item .apoio { font-size: 12.5px; }
.item-linha { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.item-linha button { flex-shrink: 0; }
.mini { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; font-size: 12.5px; }
.vazio { color: var(--muted); font-size: 13.5px; margin: 0; }

/* Detalhe do usuário */
.detalhe { width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 48px); overflow-y: auto; overscroll-behavior: contain; border: 0; border-radius: 16px; padding: 0; background: var(--surface); color: var(--ink); }
.detalhe::backdrop { background: rgba(10, 16, 22, 0.45); }
.detalhe-corpo { padding: 18px; }
.detalhe-topo { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.detalhe-topo h2 { overflow-wrap: anywhere; margin: 0; }
.dados { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 14px 0 4px; font-size: 13.5px; }
.dados dt { color: var(--muted); }
.dados dd { margin: 0; overflow-wrap: anywhere; }
.contagens { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }
.contagens div { background: var(--ground); border-radius: 10px; padding: 8px 10px; }
.contagens b { display: block; font-family: var(--display); font-size: 18px; }
.contagens span { font-size: 12px; color: var(--muted); }
@media (max-width: 380px) {
  .contagens { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cartao b { font-size: 22px; }
}
.acoes-detalhe { display: grid; gap: 8px; margin-top: 8px; }
.acoes-detalhe .botao { margin-top: 0; }

.form-cortesia { max-width: 560px; }

.aviso { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 20;
  background: var(--ink); color: var(--surface); padding: 10px 16px; border-radius: 10px; font-size: 14px; max-width: calc(100vw - 32px); }
.aviso.erro { background: var(--danger); color: #fff; margin: 0; }
