/* Relatórios: lista, período, resumo, números, gráfico e tabelas */
.rel-grupo + .rel-grupo { margin-top: var(--s5); }
.rel-grupo-t { margin: 0 0 var(--s2); font: 600 14px/20px var(--font, inherit); color: var(--ink-muted); letter-spacing: 0; text-transform: none; }
.rel-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--s3); }
.rel-card { display: flex; align-items: center; gap: var(--s3); min-width: 0; padding: var(--s4); background: var(--surface-raised); border-radius: var(--r-lg) 0 var(--r-lg) 0; color: var(--ink); text-decoration: none; }
.rel-card:hover { background: var(--surface-high); }
.rel-ic { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: var(--r-sm) 0 var(--r-sm) 0; background: var(--surface); color: var(--ink); }
.rel-ic svg, .rel-ic i { width: 22px; height: 22px; }
.rel-card-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rel-card-tx b { font-weight: 600; overflow-wrap: anywhere; }
.rel-card-tx small { color: var(--ink-muted); font-size: var(--fs-md); line-height: 20px; overflow-wrap: anywhere; }
.rel-card .chev { flex: none; color: var(--ink-muted); }

.rel-voltar { margin: 0 0 var(--s2) calc(-1 * var(--s1)); min-height: 32px; }
.rel-per { margin-top: calc(-1 * var(--s3)); }
.rel-resumo { margin: 0 0 var(--s5); font-size: var(--fs-xl); line-height: 27px; max-width: 72ch; overflow-wrap: anywhere; }

.rel-nums { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--s3); margin-bottom: var(--s5); }
.rel-num { background: var(--surface-raised); border-radius: var(--r-lg) 0 var(--r-lg) 0; padding: var(--s4); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rel-num span { color: var(--ink-muted); font-size: var(--fs-md); line-height: 20px; overflow-wrap: anywhere; }
.rel-num b { font-size: var(--fs-2xl); line-height: 30px; font-weight: 700; overflow-wrap: anywhere; }
.rel-num small { font-size: var(--fs-sm); line-height: 18px; color: var(--ink-muted); overflow-wrap: anywhere; }
.rel-num small.pos { color: var(--accent-text); font-weight: 600; }
.rel-num small.neg { color: var(--danger); font-weight: 600; }

.rel-bloco { margin-bottom: var(--s4); display: flex; flex-direction: column; gap: var(--s3); }
.rel-txt { margin: calc(-1 * var(--s2)) 0 0; font-size: var(--fs-md); line-height: 20px; }

/* gráfico */
.rel-c0 { fill: var(--accent-text); background: var(--accent-text); }
.rel-c1 { fill: var(--line); background: var(--line); }
.rel-leg { display: flex; gap: var(--s4); flex-wrap: wrap; font-size: var(--fs-sm); color: var(--ink-muted); }
.rel-leg span { display: inline-flex; align-items: center; gap: 6px; }
.rel-leg i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.rel-graf { position: relative; padding-top: 18px; min-width: 0; }
.rel-graf svg { display: block; width: 100%; height: 180px; overflow: visible; }
.rel-max { position: absolute; top: 0; left: 0; font-size: var(--fs-xs); line-height: 16px; color: var(--ink-muted); }
.rel-base { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.rel-grade { stroke: var(--line-soft); stroke-width: 1; stroke-dasharray: 4 4; vector-effect: non-scaling-stroke; }
.rel-xl { display: grid; margin-top: 6px; font-size: var(--fs-xs); line-height: 16px; color: var(--ink-muted); }
.rel-xl span { white-space: nowrap; overflow: visible; text-align: left; min-width: 0; }
/* Funil: blocos empilhados de cantos arredondados (do verde escuro ao claro), nome e número dentro,
   selo com quantos passaram da etapa anterior */
.rel-funil { width: 100%; max-width: 560px; margin: var(--s2) auto 0; }
.rel-funil svg { display: block; width: 100%; height: auto; overflow: visible; }
.rel-funil.deitado { max-width: 1000px; }
.rel-funil.deitado .rel-fn-n { font-size: 20px; }
.rel-funil.deitado .rel-fn-v { font-size: 34px; }
.rel-fn-n { font-size: 21px; font-weight: 600; }
.rel-fn-v { font-size: 31px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.rel-fn-selo rect { fill: #18191c; stroke: var(--surface-raised); stroke-width: 3; }
.rel-fn-selo text { fill: #aaf101; font-size: var(--fs-base); font-weight: 700; }
.rel-fn-leg { text-align: center; margin: var(--s3) 0 0; }
@media (prefers-reduced-motion: no-preference) {
  .rel-fn-bloco { animation: relFnEntra .5s cubic-bezier(.2, .8, .2, 1) both; animation-delay: var(--d, 0s); transform-box: fill-box; transform-origin: center; }
}
@keyframes relFnEntra { from { opacity: 0; transform: translateY(10px) scale(.96); } }
@media (max-width: 560px) {
  .rel-fn-n { font-size: 26px; }
  .rel-fn-v { font-size: 36px; }
  .rel-fn-selo text { font-size: var(--fs-2xl); }
}
.rel-hbars { display: flex; flex-direction: column; gap: var(--s2); }
.rel-hrow { display: grid; grid-template-columns: minmax(80px, 160px) minmax(0, 1fr) auto; align-items: center; gap: var(--s3); min-height: 28px; }
.rel-hl { font-size: var(--fs-md); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.rel-htrack { height: 18px; background: var(--surface-high); border-radius: 4px; overflow: hidden; min-width: 0; }
.rel-htrack i { display: block; height: 100%; border-radius: 4px; }
.rel-hrow b { font-size: var(--fs-md); font-variant-numeric: tabular-nums; text-align: right; min-width: 48px; }

/* tabelas */
.rel-tw { margin: 0 calc(-1 * var(--s2)); padding: 0 var(--s2); }
.rel-table th.dir, .rel-table td.dir { text-align: right; font-variant-numeric: tabular-nums; }
.rel-table td { vertical-align: top; }
.rel-table td:not(.dir) { white-space: normal; overflow-wrap: anywhere; min-width: 96px; }
.rel-table td:first-child { min-width: 88px; }
.rel-click { cursor: pointer; }
.rel-click:hover td { background: var(--surface-high); }
.rel-link { appearance: none; background: none; border: 0; padding: 0; margin: 0; font: inherit; color: var(--ink); font-weight: 600; text-align: left; cursor: pointer; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; overflow-wrap: anywhere; }
.rel-link:hover { text-decoration-color: currentColor; }

/* carregando */
.rel-carregando { display: flex; flex-direction: column; gap: var(--s3); }
.rel-carregando p { margin: 0; }
.rel-sk { display: block; height: 72px; border-radius: var(--r-lg) 0 var(--r-lg) 0; background: var(--surface-raised); animation: rel-pulso 1.2s ease-in-out infinite; }
.rel-sk.curto { height: 180px; }
@keyframes rel-pulso { 50% { opacity: .55; } }

@media (max-width: 860px) {
  .rel-resumo { font-size: var(--fs-lg); line-height: 24px; }
  .rel-nums { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); }
  .rel-num { padding: var(--s3); }
  .rel-num b { font-size: var(--fs-xl); line-height: 24px; }
  .rel-cards { grid-template-columns: minmax(0, 1fr); }
  .rel-graf svg { height: 140px; }
  .rel-hrow { grid-template-columns: minmax(64px, 96px) minmax(0, 1fr) auto; gap: var(--s2); }
  .rel-bloco { padding: var(--s4); }
}
