/* Relatórios (22/10/2026, padrão SigX). Só os tokens verdes de app.css; reaproveita os cartões da Visão geral (dash-*). */
.rel{--rel-glass:rgba(255,255,255,.78);display:grid;gap:14px;min-width:0}
.rel .sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.rel-print-head{display:none}

/* Escolha do relatório: trilho de vidro com seis botões */
.rel-tabs{display:flex;gap:6px;padding:6px;border-radius:16px;background:var(--rel-glass);border:1px solid var(--tv-green-line);box-shadow:0 6px 22px color-mix(in srgb,var(--tv-green-deep) 7%,transparent);overflow-x:auto;scrollbar-width:none;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}
.rel-tabs::-webkit-scrollbar{display:none}
.rel-tabs button{flex:1 0 auto;display:flex;align-items:center;justify-content:center;gap:7px;border:0;background:none;padding:10px 11px;border-radius:11px;color:var(--ink2);font-weight:700;font-size:13.5px;white-space:nowrap;transition:background .18s ease-out,color .18s ease-out}
.rel-tabs button svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round;flex:none}
.rel-tabs button:hover{background:var(--tv-green-wash);color:var(--tv-green-deep)}
.rel-tabs button.is-on{background:var(--tv-green-grad);color:#fff;box-shadow:0 4px 14px color-mix(in srgb,var(--tv-green-deep) 28%,transparent)}
.rel-tabs button:focus-visible,.rel button:focus-visible,.rel select:focus-visible,.rel input:focus-visible,.rel th:focus-visible{outline:3px solid #1d7a45;outline-offset:2px}
.rel-desc{margin:-4px 2px 0;color:var(--ink2);font-size:14px}

/* Barra de período e filtros */
.rel-bar{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"period export" "filters filters";gap:12px 16px;padding:14px 16px!important;border-radius:16px}
.rel-period{grid-area:period;display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;min-width:0}
.rel-period[hidden]{display:none}
.rel-bar.no-period{grid-template-areas:"filters export"}
.rel-bar.no-period .rel-filters{border-top:0;padding-top:0}
.rel-filters{grid-area:filters;display:flex;align-items:center;gap:8px 12px;min-width:0;padding-top:12px;border-top:1px solid var(--tv-green-line)}
.rel-export{grid-area:export;display:flex;gap:8px;align-items:flex-start;justify-content:flex-end}
.rel-bar-label{font-size:12.5px;font-weight:800;color:var(--ink2);white-space:nowrap}
.rel-dates{display:flex;align-items:center;gap:6px;color:var(--ink3);font-size:13px}
.rel-dates input{border:1px solid var(--tv-green-line);background:#fff;border-radius:10px;padding:7px 9px;color:var(--ink);font-size:13.5px;min-height:38px}
.rel-shortcuts{display:flex;flex-wrap:wrap;gap:6px}
.rel-pill{border:1px solid var(--tv-green-line);background:rgba(255,255,255,.85);color:var(--ink2);border-radius:99px;padding:7px 12px;font-size:13px;font-weight:700;min-height:36px}
.rel-pill:hover{border-color:var(--tv-green-mid);color:var(--tv-green-deep)}
.rel-pill.is-on{background:var(--tv-green-soft);border-color:var(--tv-green);color:var(--tv-green-deep)}
.rel-pill[hidden]{display:none}
.rel-chips{display:flex;flex-wrap:wrap;gap:8px;min-width:0}
.rel-chip{position:relative;display:inline-flex;align-items:center;gap:6px;max-width:100%;min-height:38px;padding:6px 10px 6px 12px;border:1px dashed var(--tv-green-mid);border-radius:99px;background:rgba(255,255,255,.7);font-size:13px;cursor:pointer}
.rel-chip:hover{border-style:solid;background:#fff}
.rel-chip-k{color:var(--ink2);font-weight:700;white-space:nowrap}
.rel-chip-v{color:var(--ink);font-weight:800;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:220px}
.rel-chip svg{width:15px;height:15px;fill:none;stroke:var(--ink3);stroke-width:2.2;flex:none}
.rel-chip select{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer;font-size:16px}
.rel-chip.is-on{border-style:solid;border-color:var(--tv-green);background:var(--tv-green-soft)}
.rel-chip.is-on .rel-chip-v{color:var(--tv-green-deep)}
.rel-chip.is-need{border-style:solid;border-color:var(--tv-green-strong);box-shadow:0 0 0 3px color-mix(in srgb,var(--tv-green) 18%,transparent)}
.rel-chip:focus-within{outline:3px solid #1d7a45;outline-offset:2px}
.rel-clear{border:0;background:none;color:var(--tv-green-strong);font-weight:700;font-size:13px;padding:6px 4px;text-decoration:underline;text-underline-offset:3px}
.rel-btn{display:inline-flex;align-items:center;gap:7px;border:1px solid var(--tv-green-line);background:#fff;color:var(--tv-green-deep);font-weight:800;font-size:13.5px;padding:8px 13px;border-radius:11px;min-height:38px}
.rel-btn svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.rel-btn:hover:not(:disabled){background:var(--tv-green-deep);border-color:var(--tv-green-deep);color:#fff}
.rel-btn:disabled{opacity:.45;cursor:not-allowed}
.rel-meta{margin:-4px 2px 0;color:var(--ink3);font-size:12.5px;font-weight:600;min-height:18px;display:flex;align-items:center;gap:8px}
.rel-spin{width:13px;height:13px;border-radius:50%;border:2px solid var(--tv-green-line);border-top-color:var(--tv-green);animation:rel-spin .8s linear infinite}
@keyframes rel-spin{to{transform:rotate(360deg)}}

/* Corpo */
.rel-body{display:grid;gap:14px;min-width:0}
.rel-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.rel-kpis.is-5{grid-template-columns:repeat(5,minmax(0,1fr))}
.rel-kpi{cursor:default!important;padding:16px 16px 14px!important}
.rel-kpi:hover{transform:none!important}
.rel-kpi strong{font-size:27px!important}
.rel-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;align-items:stretch}
.rel-card{min-width:0;padding:16px 18px!important;border-radius:18px}
.rel-span2{grid-column:span 2}
.rel-sub{margin:16px 0 8px;font-size:13.5px;color:var(--ink2)}
.rel-hint{margin:10px 0 0;font-size:12px;color:var(--ink3)}
.rel-note{margin:-2px 2px 0;font-size:12.5px;color:var(--ink2)}
.rel-muted{color:var(--ink3)}
.rel-empty{margin:0}
.rel-empty.is-bad{border-color:var(--bad-soft);background:#fff8f8}

/* Gráfico */
.rel-chart{display:block;max-width:100%;overflow:visible}
.rel-chart .g{stroke:var(--line);stroke-width:1;stroke-dasharray:2 4}
.rel-chart .g0{stroke:#cbd8d6;stroke-width:1}
.rel-chart .ax{fill:var(--ink3);font-size:11px;font-weight:600;font-family:inherit}
.rel-chart .bar{fill:var(--tv-green);opacity:.88}
.rel-chart .bar.is-top{fill:var(--tv-green-deep)}
.rel-chart .avg{fill:none;stroke:var(--tv-green-deep);stroke-width:2;stroke-linejoin:round;stroke-linecap:round}
.rel-chart .max{stroke:#e59a2f;stroke-width:1.5;stroke-dasharray:5 4}
.rel-chart .area{fill:color-mix(in srgb,var(--tv-green) 16%,transparent)}
.rel-chart .ln{fill:none;stroke:var(--tv-green-strong);stroke-width:2;stroke-linejoin:round}
.rel-chart .dot{fill:#fff;stroke:var(--tv-green-strong);stroke-width:2}
.rel-chart .hit{fill:transparent}
.rel-chart .hit:hover{fill:color-mix(in srgb,var(--tv-green) 9%,transparent)}
.rel-legend{display:flex;flex-wrap:wrap;gap:6px 16px;margin-top:8px;font-size:12px;color:var(--ink2);font-weight:600}
.rel-legend span{display:inline-flex;align-items:center;gap:6px}
.rel-legend span::before{content:"";width:18px;height:0;border-top:2px solid var(--tv-green-deep)}
.rel-legend .lg-max::before{border-top:2px dashed #e59a2f}
.rel-donut{grid-template-columns:120px minmax(0,1fr)!important}
.rel-donut svg{width:120px!important;height:120px!important}
.dash-legend button.is-on{background:var(--tv-green-soft);box-shadow:inset 0 0 0 1px var(--tv-green)}

/* Ranking */
.rel-rank{list-style:none;margin:0;padding:0;display:grid;gap:10px}
.rel-rank li{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;align-items:center}
.rel-rank .dash-meter{margin:4px 0 0}
.rel-rank strong{font-size:14px;color:var(--ink);white-space:nowrap}

/* Disco */
.rel-disk{display:flex;height:16px;border-radius:99px;background:var(--tv-green-soft);overflow:hidden;gap:2px}
.rel-disk b{display:block;height:100%}
.rel-disk .is-lib{background:var(--tv-green-strong)}
.rel-disk .is-other{background:var(--tv-green-mid)}
.rel-disk-legend{list-style:none;margin:10px 0 0;padding:0;display:flex;flex-wrap:wrap;gap:6px 18px;font-size:12.5px;color:var(--ink2)}
.rel-disk-legend li{display:flex;align-items:center;gap:6px}
.rel-disk-legend i{width:10px;height:10px;border-radius:3px}
.rel-disk-legend .is-lib{background:var(--tv-green-strong)}.rel-disk-legend .is-other{background:var(--tv-green-mid)}.rel-disk-legend .is-free{background:var(--tv-green-soft);box-shadow:inset 0 0 0 1px var(--tv-green-line)}
.rel-disk-legend b{color:var(--ink)}
.rel-alert{display:flex;gap:12px;align-items:flex-start;padding:13px 16px;border-radius:14px;border:1px solid var(--warn-soft);background:color-mix(in srgb,var(--warn-soft) 70%,#fff)}
.rel-alert svg{width:22px;height:22px;flex:none;fill:none;stroke:var(--warn);stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.rel-alert b{display:block;color:var(--ink);font-size:14.5px}
.rel-alert small{display:block;color:var(--ink2);font-size:13px;margin-top:2px;line-height:1.4}
.rel-alert.is-bad{border-color:#f6c9cf;background:color-mix(in srgb,var(--bad-soft) 70%,#fff)}
.rel-alert.is-bad svg{stroke:var(--bad)}

/* Comprovante */
.rel-pick{display:grid;grid-template-columns:auto minmax(0,1fr);gap:8px 16px;align-items:center;padding:24px!important}
.rel-pick>svg{width:44px;height:44px;fill:none;stroke:var(--tv-green-strong);stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.rel-pick h2{margin:0 0 4px;font-size:19px}
.rel-pick p{margin:0;color:var(--ink2);max-width:62ch}
.rel-bigselect{grid-column:1/-1}
.rel-bigselect select{width:100%;max-width:440px;min-height:46px;border:1px solid var(--tv-green);border-radius:12px;padding:10px 12px;background:#fff;color:var(--ink);font-weight:700}
.rel-proof-head{display:flex;justify-content:space-between;gap:16px;padding:18px 20px;border-radius:18px;color:#fff;background:radial-gradient(420px 180px at 92% 0%,rgba(125,193,83,.55),transparent 70%),var(--tv-green-grad);box-shadow:0 10px 28px color-mix(in srgb,var(--tv-green-deep) 25%,transparent)}
.rel-insights{margin:0;padding:0 0 0 18px;display:grid;gap:8px;font-size:13.5px;line-height:1.45;color:var(--ink)}
.rel-insights li::marker{color:var(--tv-green)}
.rel-compare{width:100%;border-collapse:collapse;font-size:13.5px}
.rel-compare th{text-align:left;font-size:12px;font-weight:700;color:var(--ink3);padding:8px 10px;border-bottom:1.5px solid var(--line)}
.rel-compare td{padding:10px;border-bottom:1px solid var(--line)}
.rel-compare .n{text-align:right;font-variant-numeric:tabular-nums}
.rel-var{font-weight:800}.rel-var.is-up{color:var(--tv-green-deep)}.rel-var.is-down{color:var(--bad)}
.rel-proof-head span{font-size:12.5px;font-weight:700;opacity:.9}
.rel-proof-head h2{margin:2px 0 4px;font-size:24px;letter-spacing:-.01em}
.rel-proof-head p{margin:0;font-size:13.5px;opacity:.92}

/* Problemas */
.rel-probs{list-style:none;margin:0;padding:0;display:grid;gap:8px}
.rel-probs>li{border:1px solid var(--tv-green-line);border-radius:13px;background:rgba(255,255,255,.7);overflow:hidden}
.rel-probs>li.is-open{border-color:var(--tv-green-mid)}
.rel-prob{display:grid;grid-template-columns:auto minmax(0,1fr) auto auto 18px;gap:12px;align-items:center;width:100%;border:0;background:none;padding:12px 14px;text-align:left;color:inherit}
.rel-prob:hover{background:var(--tv-green-wash)}
.rel-prob>svg{width:18px;height:18px;fill:none;stroke:var(--ink3);stroke-width:2;transition:transform .18s ease-out}
.is-open>.rel-prob>svg{transform:rotate(180deg)}
.rel-prob-t b,.rel-prob-n b{display:block;font-size:14px;color:var(--ink)}
.rel-prob-t small{display:block;font-size:12.5px;color:var(--ink2);line-height:1.4;margin-top:2px}
.rel-prob-n{text-align:right;white-space:nowrap}
.rel-prob-n small{font-size:12px;color:var(--ink3)}
.rel-prob-detail{padding:4px 14px 14px 36px}
.rel-prob-detail ul{list-style:none;margin:0 0 10px;padding:0;display:grid;gap:4px;max-height:260px;overflow:auto}
.rel-prob-detail li{display:flex;justify-content:space-between;gap:12px;font-size:13px;padding:5px 0;border-bottom:1px dashed var(--line)}
.rel-prob-detail li span{color:var(--ink2);text-align:right}

/* Tabela */
.rel-tablecard{padding:0!important;border-radius:18px;overflow:hidden}
.rel-tablehead{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;padding:14px 16px}
.rel-tablehead h2{margin:0;font-size:15.5px}
.rel-seg{display:flex;gap:4px;padding:4px;border-radius:12px;background:var(--tv-green-wash);border:1px solid var(--tv-green-line);overflow-x:auto;max-width:100%}
.rel-seg button{border:0;background:none;padding:7px 12px;border-radius:9px;font-weight:700;font-size:13px;color:var(--ink2);white-space:nowrap}
.rel-seg button.is-on{background:#fff;color:var(--tv-green-deep);box-shadow:0 1px 4px color-mix(in srgb,var(--tv-green-deep) 14%,transparent)}
.rel-search{display:flex;align-items:center;gap:6px;border:1px solid var(--tv-green-line);background:#fff;border-radius:11px;padding:0 10px;min-height:38px;flex:0 1 260px}
.rel-search svg{width:16px;height:16px;fill:none;stroke:var(--ink3);stroke-width:2;flex:none}
.rel-search input{border:0;outline:0;background:none;min-width:0;width:100%;padding:8px 0;font-size:14px;color:var(--ink)}
.rel-tablewrap{overflow-x:auto;border-top:1px solid var(--tv-green-line)}
.rel-table{width:100%;border-collapse:collapse;font-size:13.5px}
.rel-table th{letter-spacing:0;text-transform:none;position:sticky;top:0;background:var(--tv-green-wash);text-align:left;font-size:12.5px;font-weight:800;color:var(--ink2);padding:10px 12px;white-space:nowrap;cursor:pointer;user-select:none;border-bottom:1px solid var(--tv-green-line)}
.rel-table th:hover{color:var(--tv-green-deep)}
.rel-table th i{font-style:normal;font-size:9px;margin-left:5px;color:var(--tv-green)}
.rel-table td{padding:10px 12px;border-bottom:1px solid #edf3f1;color:var(--ink);vertical-align:middle}
.rel-table tbody tr:hover td{background:rgba(234,246,238,.55)}
.rel-table .num{text-align:right;font-variant-numeric:tabular-nums}
.rel-table th.num{text-align:right}
.rel-name{font-weight:700}
.rel-pos{display:inline-grid;place-items:center;min-width:24px;height:24px;border-radius:7px;background:var(--tv-green-wash);color:var(--tv-green-deep);font-weight:800;font-size:12px}
.rel-tag{display:inline-block;margin-left:6px;padding:1px 7px;border-radius:99px;background:#eef2f2;color:var(--ink2);font-size:11px;font-weight:700}
.rel-tag.is-warn{background:var(--warn-soft);color:var(--warn)}
.rel-state{display:inline-block;padding:3px 9px;border-radius:99px;font-size:12px;font-weight:700;background:#eef2f2;color:var(--ink2);white-space:nowrap}
.rel-state.is-ok{background:var(--ok-soft);color:var(--ok)}
.rel-state.is-free{background:var(--warn-soft);color:var(--warn)}
.rel-state.is-bad{background:var(--bad-soft);color:var(--bad)}
.rel-state.is-warn{background:var(--warn-soft);color:var(--warn)}
.rel-state.is-info{background:var(--tv-green-soft);color:var(--tv-green-deep)}
.rel-status{display:inline-flex;align-items:center;gap:7px;font-weight:700;white-space:nowrap}
.rel-status i{width:9px;height:9px;border-radius:50%;background:var(--ink3)}
.rel-status.is-online i{background:var(--tv-green)}.rel-status.is-away i{background:#e59a2f}.rel-status.is-offline i{background:var(--bad)}
.rel-meter{display:inline-flex;align-items:center;gap:8px;font-weight:800;white-space:nowrap}
.rel-meter i{display:block;width:70px;height:6px;border-radius:99px;background:var(--tv-green-soft);overflow:hidden}
.rel-meter b{display:block;height:100%;border-radius:inherit;background:var(--tv-green)}
.rel-meter.is-warn b{background:#e59a2f}.rel-meter.is-bad b{background:var(--bad)}
.rel-meter.is-bad{color:var(--bad)}
.rel-none{text-align:center;color:var(--ink2);padding:22px!important}
.rel-more{display:block;width:calc(100% - 32px);margin:12px 16px 16px;border:1px dashed var(--tv-green-mid);background:var(--tv-green-wash);color:var(--tv-green-deep);font-weight:800;border-radius:12px;padding:11px;min-height:44px}
.rel-more small{font-weight:600;color:var(--ink2)}
.rel-more:hover{border-style:solid}

/* Carregando */
.rel-skeleton{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}
.rel-skeleton i,.rel-skeleton b{display:block;height:96px;border-radius:16px;background:linear-gradient(90deg,rgba(255,255,255,.6),rgba(234,246,238,.9),rgba(255,255,255,.6));background-size:200% 100%;animation:rel-shine 1.2s ease-in-out infinite}
.rel-skeleton b{grid-column:1/-1;height:260px}
@keyframes rel-shine{to{background-position:-200% 0}}
@media (prefers-reduced-motion:reduce){.rel-skeleton i,.rel-skeleton b,.rel-spin{animation:none}.rel-tabs button,.rel-prob>svg{transition:none}}

/* Telas menores */
@media (max-width:1180px){.rel-kpis.is-5{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media (max-width:1000px){.rel-grid{grid-template-columns:1fr}.rel-span2{grid-column:auto}.rel-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:760px){
  .rel-bar,.rel-bar.no-period{grid-template-columns:1fr;grid-template-areas:"period" "filters" "export"}
  .rel-export{justify-content:stretch}.rel-export .rel-btn{flex:1;justify-content:center}
  .rel-filters{flex-direction:column;align-items:flex-start}
  .rel-tabs button{flex:0 0 auto;padding:9px 12px}
  .rel-kpis,.rel-kpis.is-5{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .rel-kpis.is-5 .rel-kpi:last-child{grid-column:1/-1}
  .rel-kpi strong{font-size:23px!important}
  .rel-table .hide-m{display:none}
  .rel-chip-v{max-width:150px}
  .rel-prob{grid-template-columns:auto minmax(0,1fr) 18px;row-gap:6px}
  .rel-prob-n,.rel-prob .dash-badge{grid-column:2}
  .rel-prob-n{text-align:left}
  .rel-prob-detail{padding-left:14px}
  .rel-proof-head h2{font-size:20px}
  .rel-search{flex:1 1 100%}
  .rel-skeleton{grid-template-columns:1fr 1fr}
}

/* PDF (janela de impressão): só o relatório, com cabeçalho da Invista TV e todas as linhas das tabelas */
@media print{
  @page{size:A4;margin:12mm}
  body.rel-printing{background:#fff!important;visibility:hidden}
  body.rel-printing #report,body.rel-printing #report *{visibility:visible}
  body.rel-printing #report{position:absolute;left:0;top:0;width:100%;margin:0;padding:0}
  body.rel-printing #report .pagetop,body.rel-printing .rel-tabs,body.rel-printing .rel-bar,body.rel-printing .rel-meta,body.rel-printing .rel-desc,
  body.rel-printing .dash-link,body.rel-printing .rel-hint,body.rel-printing .rel-more,body.rel-printing .rel-search,body.rel-printing [data-rel-seen],body.rel-printing .rel-alert{display:none!important}
  body.rel-printing .rel-print-head{display:flex;align-items:center;gap:14px;padding:0 0 10px;border-bottom:2px solid var(--tv-green)}
  body.rel-printing .rel-print-head img{height:34px}
  body.rel-printing .rel-print-head b{display:block;font-size:17px;color:var(--ink)}
  body.rel-printing .rel-print-head span{display:block;font-size:11px;color:var(--ink2)}
  body.rel-printing .panel{box-shadow:none!important;background:#fff!important;border:1px solid #d8e6dd!important;break-inside:avoid}
  body.rel-printing .rel-tablecard{break-inside:auto}
  body.rel-printing .rel-grid{grid-template-columns:2fr 1fr}
  body.rel-printing .rel-span2{grid-column:auto}
  body.rel-printing .rel-kpis{grid-template-columns:repeat(4,1fr)}
  body.rel-printing .rel-kpis.is-5{grid-template-columns:repeat(5,1fr)}
  body.rel-printing .rel-kpi strong{font-size:17px!important;white-space:normal!important}
  body.rel-printing .rel-table{font-size:10.5px}
  body.rel-printing .rel-table{width:100%;table-layout:auto}
  body.rel-printing .rel-table th,body.rel-printing .rel-table td{padding:4px 5px!important;white-space:normal!important;min-width:0!important}
  body.rel-printing .rel-table .rel-meter{min-width:0!important;width:auto!important}
  body.rel-printing .rel-table .hide-m{display:table-cell}
  body.rel-printing .rel-table th{position:static}
  body.rel-printing .rel-table tr{break-inside:avoid}
  body.rel-printing .rel-tablewrap{overflow:visible}
  body.rel-printing .rel-proof-head{-webkit-print-color-adjust:exact;print-color-adjust:exact}
  body.rel-printing .rel-chart{max-width:100%;height:auto}
  body.rel-printing .rel-chart,body.rel-printing .rel-disk,body.rel-printing .dash-meter,body.rel-printing .rel-meter{-webkit-print-color-adjust:exact;print-color-adjust:exact}
}
