/* ============================================================
   Brev · Central de Relatórios — identidade dark premium (#0b84ff)
   ============================================================ */

:root {
  --bg:          #eef1f6;
  --surface:     #ffffff;
  --surface-2:   #f5f7fb;
  --surface-3:   #eaeef5;
  --ink:         #10151f;
  --ink-soft:    #414b5c;
  --ink-faint:   #6b7688;
  --line:        #d9e0ec;
  --line-soft:   #e6ebf3;
  --accent:      #0b84ff;
  --accent-ink:  #ffffff;
  --accent-soft: #e3f0ff;
  --accent-line: #b9d8ff;
  --good:        #12a150;
  --good-soft:   #e2f5ea;
  --off:         #6b7688;
  --off-soft:    #edf0f5;
  --danger:      #d23b3b;
  --danger-soft: #fbe3e3;
  --shadow:      0 1px 2px rgba(16,21,31,.06), 0 14px 34px -14px rgba(16,21,31,.16);
  --radius:      14px;
}
:root:not([data-theme="light"]) {
  @media (prefers-color-scheme: dark) {
    --bg:          #080b12;
    --surface:     #10141d;
    --surface-2:   #151a25;
    --surface-3:   #1c2230;
    --ink:         #eef2f9;
    --ink-soft:    #b3bccc;
    --ink-faint:   #7d879a;
    --line:        #262e3d;
    --line-soft:   #1b212d;
    --accent:      #3d9bff;
    --accent-ink:  #06182e;
    --accent-soft: #12233a;
    --accent-line: #234a72;
    --good:        #3ecf7f;
    --good-soft:   #102a1c;
    --off:         #7d879a;
    --off-soft:    #1c2230;
    --danger:      #f06a6a;
    --danger-soft: #2e1616;
    --shadow:      0 1px 2px rgba(0,0,0,.4), 0 18px 44px -18px rgba(0,0,0,.65);
  }
}
:root[data-theme="dark"] {
  --bg:#080b12; --surface:#10141d; --surface-2:#151a25; --surface-3:#1c2230;
  --ink:#eef2f9; --ink-soft:#b3bccc; --ink-faint:#7d879a; --line:#262e3d; --line-soft:#1b212d;
  --accent:#3d9bff; --accent-ink:#06182e; --accent-soft:#12233a; --accent-line:#234a72;
  --good:#3ecf7f; --good-soft:#102a1c; --off:#7d879a; --off-soft:#1c2230;
  --danger:#f06a6a; --danger-soft:#2e1616;
  --shadow:0 1px 2px rgba(0,0,0,.4), 0 18px 44px -18px rgba(0,0,0,.65);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  font-size: 16px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column; min-height: 100%;
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

h1,h2,h3 { font-family:"Bricolage Grotesque","IBM Plex Sans",sans-serif; letter-spacing:-.02em; line-height:1.12; margin:0; text-wrap:balance; }
h1 { font-size: clamp(24px, 4vw, 32px); font-weight: 800; }
h2 { font-size: 19px; font-weight: 700; margin-bottom: 14px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
hr.sep { border: none; border-top: 1px solid var(--line-soft); margin: 22px 0; }

/* ---------- topbar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 26px; background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: baseline; gap: 8px; }
.brand:hover { text-decoration: none; }
.brand-dot {
  width: 30px; height: 30px; border-radius: 9px; background: var(--accent);
  color: var(--accent-ink); display: grid; place-items: center;
  font-family:"Bricolage Grotesque",sans-serif; font-weight: 800; font-size: 16px;
  align-self: center; box-shadow: 0 4px 14px -4px var(--accent);
}
.brand-name { font-family:"Bricolage Grotesque",sans-serif; font-weight: 800; font-size: 20px; color: var(--ink); letter-spacing:-.03em; }
.brand-sub  { color: var(--ink-faint); font-size: 14px; }
.topnav { display: flex; align-items: center; gap: 18px; }
.topnav a { color: var(--ink-soft); font-weight: 500; }
.topnav a:hover { color: var(--ink); text-decoration: none; }
.topuser { color: var(--ink-faint); font-size: 14px; }
.btn-sair {
  border: 1px solid var(--line); padding: 7px 14px; border-radius: 9px;
  color: var(--ink-soft) !important; font-size: 14px;
}
.btn-sair:hover { border-color: var(--accent-line); background: var(--surface-2); text-decoration: none; }

/* ---------- layout ---------- */
.conteudo { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 30px 26px 50px; }
.rodape { padding: 22px 26px; color: var(--ink-faint); font-size: 13px; border-top: 1px solid var(--line-soft); text-align: center; }
.subtitulo { color: var(--ink-soft); margin: 6px 0 0; }
.voltar { font-size: 14px; color: var(--ink-faint); }
.pagina-cabecalho { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }

/* ---------- botões ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font-family: inherit; font-size: 15px; font-weight: 600;
  padding: 11px 18px; border-radius: 10px; border: 1px solid transparent; transition: .15s;
}
.btn-primario { background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 18px -8px var(--accent); }
.btn-primario:hover { filter: brightness(1.06); text-decoration: none; }
.btn-secundario { background: var(--surface-2); color: var(--ink); border-color: var(--line); }
.btn-secundario:hover { border-color: var(--accent-line); text-decoration: none; }
.btn-perigo { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.btn-perigo:hover { filter: brightness(1.05); text-decoration: none; }
.btn-bloco { width: 100%; justify-content: center; }
.btn-icone {
  cursor: pointer; background: transparent; border: 1px solid var(--line);
  color: var(--ink-faint); width: 32px; height: 32px; border-radius: 8px; font-size: 14px;
}
.btn-icone:hover { border-color: var(--danger); color: var(--danger); }

/* ---------- flash ---------- */
.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 20px; font-size: 14.5px; border: 1px solid; }
.flash-ok   { background: var(--good-soft); color: var(--good); border-color: transparent; }
.flash-erro { background: var(--danger-soft); color: var(--danger); border-color: transparent; }

/* ---------- stats ---------- */
.stats { display: flex; gap: 14px; margin-bottom: 26px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 22px; min-width: 120px; }
.stat-num { display: block; font-family:"Bricolage Grotesque",sans-serif; font-weight: 800; font-size: 30px; }
.stat-lab { color: var(--ink-faint); font-size: 13px; }

/* ---------- tabela ---------- */
.tabela-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.tabela { border-collapse: collapse; width: 100%; min-width: 620px; font-size: 15px; }
.tabela th, .tabela td { text-align: left; padding: 14px 18px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.tabela th { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-faint); background: var(--surface-2); font-weight: 600; }
.tabela tr:last-child td { border-bottom: none; }
.tabela td strong { display: block; }
.td-sub { color: var(--ink-faint); font-size: 13px; }
.trunc { display: inline-block; max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.td-acao a { font-weight: 600; }

.pill { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.pill-ok  { background: var(--good-soft); color: var(--good); }
.pill-off { background: var(--off-soft); color: var(--off); }

/* ---------- cartões / formulário ---------- */
.grid-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.cartao { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.form { display: flex; flex-direction: column; gap: 15px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--ink-soft); }
.form label > span { font-weight: 500; }
.form input[type=text], .form input[type=email], .form input[type=password], .form input[type=url], .form input[type=number] {
  font-family: inherit; font-size: 15px; color: var(--ink);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px;
}
.form input:focus { border-color: var(--accent); background: var(--surface); }
.form label.check { flex-direction: row; align-items: center; gap: 9px; }
.form label.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.ajuda { color: var(--ink-faint); font-size: 13.5px; line-height: 1.5; }
.ajuda-vazio { padding: 14px; background: var(--surface-2); border-radius: 10px; text-align: center; }
.zona-perigo { margin-top: 4px; }

.lista-relatorios { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.lista-relatorios li {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 11px 14px;
}
.lista-relatorios li form { margin: 0; }
.form-inline-relatorio { background: var(--surface-2); border: 1px dashed var(--line); border-radius: var(--radius); padding: 16px; margin-top: 4px; }

/* ---------- login ---------- */
.tela-login { align-items: center; justify-content: center; background:
  radial-gradient(900px 500px at 80% -10%, var(--accent-soft), transparent 60%), var(--bg); }
.tela-login .conteudo { display: flex; align-items: center; justify-content: center; }
.login-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 34px; width: 100%; max-width: 400px; box-shadow: var(--shadow); }
.login-brand { display: flex; align-items: center; gap: 13px; margin-bottom: 6px; }
.brand-dot-lg { width: 42px; height: 42px; font-size: 22px; border-radius: 12px; }
.login-brand strong { display: block; font-family:"Bricolage Grotesque",sans-serif; font-size: 22px; letter-spacing:-.03em; }
.login-brand span { color: var(--ink-faint); font-size: 14px; }
.login-intro { color: var(--ink-soft); font-size: 14.5px; margin: 4px 0 22px; }

/* ---------- painel do cliente ---------- */
.painel-cabecalho { margin-bottom: 20px; }
.abas { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.aba { padding: 10px 16px; color: var(--ink-soft); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.aba:hover { color: var(--ink); text-decoration: none; }
.aba-ativa { color: var(--accent); border-bottom-color: var(--accent); }
.relatorio-frame {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
}
.relatorio-frame iframe { display: block; width: 100%; height: 78vh; min-height: 560px; border: 0; }

/* ---------- vazio ---------- */
.vazio { text-align: center; padding: 60px 20px; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }
.vazio p { margin: 0 0 14px; color: var(--ink-soft); }

/* ---------- KPIs ---------- */
.kpigrid { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; }
.painel-kpis { margin: 4px 0 22px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 15px 16px; box-shadow: var(--shadow); }
.kpi .lab { font-size: 12px; color: var(--ink-faint); letter-spacing:.04em; text-transform: uppercase; }
.kpi .val { font-family:"Bricolage Grotesque",sans-serif; font-weight: 800; font-size: 26px; margin: 6px 0 4px; font-variant-numeric: tabular-nums; }
.kpi-linha { display: flex; align-items: center; justify-content: space-between; }
.delta { font-size: 13px; font-weight: 600; }
.delta-up { color: var(--good); }
.delta-down { color: var(--danger); }
.delta-neutro { color: var(--ink-faint); }

.form-kpi { margin-top: 6px; }
.kpi-inputs { display: grid; grid-template-columns: 1.4fr 1fr 0.8fr 1fr 0.6fr; gap: 10px; margin-bottom: 12px; }
.kpi-inputs label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--ink-soft); }
.kpi-inputs input, .kpi-inputs select {
  font-family: inherit; font-size: 14px; color: var(--ink);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px;
}
.kpi-inputs input:focus, .kpi-inputs select:focus { border-color: var(--accent); }
.btn-icone-sm { width: 26px; height: 26px; font-size: 12px; }

/* ---------- logo white-label ---------- */
.painel-ident { display: flex; align-items: center; gap: 16px; }
.cliente-logo { max-height: 52px; max-width: 180px; width: auto; border-radius: 8px; }
.logo-atual { display: flex; align-items: center; gap: 14px; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; }
.logo-atual img { max-height: 44px; max-width: 130px; border-radius: 6px; }
.form input[type=file] { font-size: 13px; color: var(--ink-soft); }
.form select { font-family: inherit; font-size: 15px; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; }

/* ---------- login extras ---------- */
.login-links { text-align: center; margin: 16px 0 0; font-size: 14px; }

/* ---------- painel nativo (período, gráfico, seções) ---------- */
.periodo { display: flex; gap: 6px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px; }
.per { padding: 7px 15px; border-radius: 999px; font-size: 14px; color: var(--ink-soft); font-weight: 500; }
.per:hover { color: var(--ink); text-decoration: none; }
.per-ativo { background: var(--accent); color: var(--accent-ink); }
.per-ativo:hover { color: var(--accent-ink); }
.cartao-graf { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); margin-bottom: 26px; }
.graf-topo { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.graf-topo h2 { font-size: 18px; margin: 0; }
.sec-titulo { font-size: 19px; margin: 8px 0 12px; }
.painel-cabecalho { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

@media (max-width: 780px) {
  .grid-2col { grid-template-columns: 1fr; }
  .conteudo { padding: 22px 16px 40px; }
  .topbar { padding: 12px 16px; }
  .trunc { max-width: 180px; }
  .kpigrid { grid-template-columns: repeat(2,1fr); }
  .kpi-inputs { grid-template-columns: 1fr 1fr; }
}
