/* Fase 3a port */
/* ============================================================
   FiveDesk — Relatórios · Departamentos (expandido)
   Leitura executiva · Pareto · treemap · heatmap · tendência · risco
   Namespace .dep — depende de fivedesk-theme.css + dark.css
   ============================================================ */
#page-relatorios .relatorios-fd .dep{
  --p-blue:#007BFF; --p-blue-bg:rgba(0,123,255,.10);
  --p-ok:#15875b; --p-ok-dot:#1f9d57; --p-ok-bg:#e8f7ef;
  --p-warn:#b4790a; --p-warn-dot:#e0a106; --p-warn-bg:#fff3df;
  --p-bad:#cf3b40; --p-bad-dot:#e5484d; --p-bad-bg:#fdecec;
  --p-cost:#5b6a86;
  --p-elev-1:0 0.0625rem 0.125rem rgba(13,27,52,.06);
  --p-elev-2:0 0.625rem 1.625rem -0.875rem rgba(13,27,52,.20);
}
html[data-theme="dark"] #page-relatorios .relatorios-fd .dep{
  --p-blue:#7fb6ff; --p-blue-bg:rgba(59,155,255,.14);
  --p-ok:#3fc285; --p-ok-dot:#34d399; --p-ok-bg:rgba(31,157,87,.16);
  --p-warn:#f1b53d; --p-warn-dot:#e0a106; --p-warn-bg:rgba(224,161,6,.14);
  --p-bad:#f1797d; --p-bad-dot:#e5484d; --p-bad-bg:rgba(207,59,64,.16);
  --p-cost:#9aa7bd;
  --p-elev-2:0 0.75rem 1.875rem -1rem rgba(0,0,0,.6);
}
html[data-theme="cinza"] #page-relatorios .relatorios-fd .dep{
  --p-blue:#0b63d6; --p-blue-bg:rgba(11,99,214,.14);
  --p-ok:#0e4a2c; --p-ok-dot:#15683f; --p-ok-bg:rgba(21,104,63,.14);
  --p-warn:#6b3b08; --p-warn-dot:#8a5210; --p-warn-bg:rgba(138,82,11,.14);
  --p-bad:#6e1614; --p-bad-dot:#ef4444; --p-bad-bg:rgba(239,68,68,.14);
  --p-cost:#333b45;
  --p-elev-2:0 0.75rem 1.875rem -1rem rgba(0,0,0,.5);
}

/* Cabeçalho canônico (todas as páginas): total + rótulo; variação abaixo, canto direito. */
#page-relatorios .relatorios-fd .chart-card > .chart-head .ch-tot,
#page-relatorios .relatorios-fd .tickets-card > .tk-head .ch-tot,
#page-relatorios .relatorios-fd .chart-card.clientes > .tk-head .ch-tot,
#page-relatorios .relatorios-fd .fin-head-main > .chart-head .ch-tot{
  display:flex;
  flex-direction:column;
  flex-wrap:nowrap;
  align-items:flex-end;
  justify-content:flex-start;
  gap:0.25rem;
  text-align:right;
  margin-right:0.25rem;
}
#page-relatorios .relatorios-fd .chart-card > .chart-head .ch-tot .ch-tot-main,
#page-relatorios .relatorios-fd .tickets-card > .tk-head .ch-tot .ch-tot-main,
#page-relatorios .relatorios-fd .chart-card.clientes > .tk-head .ch-tot .ch-tot-main,
#page-relatorios .relatorios-fd .fin-head-main > .chart-head .ch-tot .ch-tot-main{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:0.125rem;
  min-width:0;
}
#page-relatorios .relatorios-fd .chart-card > .chart-head .ch-tot .ch-tot-cmp:empty,
#page-relatorios .relatorios-fd .tickets-card > .tk-head .ch-tot .ch-tot-cmp:empty,
#page-relatorios .relatorios-fd .chart-card.clientes > .tk-head .ch-tot .ch-tot-cmp:empty,
#page-relatorios .relatorios-fd .fin-head-main > .chart-head .ch-tot .ch-tot-cmp:empty{
  display:none;
}
#page-relatorios .relatorios-fd .chart-card > .chart-head .ch-tot .ch-delta,
#page-relatorios .relatorios-fd .chart-card > .chart-head .ch-tot .ch-delta.flat,
#page-relatorios .relatorios-fd .chart-card > .chart-head .ch-tot .ch-delta.up,
#page-relatorios .relatorios-fd .chart-card > .chart-head .ch-tot .ch-delta.down,
#page-relatorios .relatorios-fd .tickets-card > .tk-head .ch-tot .ch-delta,
#page-relatorios .relatorios-fd .tickets-card > .tk-head .ch-tot .ch-delta.flat,
#page-relatorios .relatorios-fd .tickets-card > .tk-head .ch-tot .ch-delta.up,
#page-relatorios .relatorios-fd .tickets-card > .tk-head .ch-tot .ch-delta.down,
#page-relatorios .relatorios-fd .chart-card.clientes > .tk-head .ch-tot .ch-delta,
#page-relatorios .relatorios-fd .chart-card.clientes > .tk-head .ch-tot .ch-delta.flat,
#page-relatorios .relatorios-fd .chart-card.clientes > .tk-head .ch-tot .ch-delta.up,
#page-relatorios .relatorios-fd .chart-card.clientes > .tk-head .ch-tot .ch-delta.down,
#page-relatorios .relatorios-fd .fin-head-main > .chart-head .ch-tot .ch-delta,
#page-relatorios .relatorios-fd .fin-head-main > .chart-head .ch-tot .ch-delta.flat,
#page-relatorios .relatorios-fd .fin-head-main > .chart-head .ch-tot .ch-delta.up,
#page-relatorios .relatorios-fd .fin-head-main > .chart-head .ch-tot .ch-delta.down{
  display:inline-flex;
  flex-direction:row;
  flex-wrap:nowrap;
  align-items:center;
  justify-content:flex-end;
  gap:0.25rem;
  margin:0;
  padding:0;
  align-self:flex-end;
  border-radius:0;
  background:transparent;
  color:var(--muted);
  font-size:0.65625rem;
  font-weight:700;
  letter-spacing:.02em;
  line-height:1.35;
  text-transform:none;
  white-space:nowrap;
}
#page-relatorios .relatorios-fd .chart-card > .chart-head .ch-tot .ch-delta svg,
#page-relatorios .relatorios-fd .tickets-card > .tk-head .ch-tot .ch-delta svg,
#page-relatorios .relatorios-fd .chart-card.clientes > .tk-head .ch-tot .ch-delta svg,
#page-relatorios .relatorios-fd .fin-head-main > .chart-head .ch-tot .ch-delta svg{
  width:0.6875rem;
  height:0.6875rem;
  flex:none;
  display:block;
}
#page-relatorios .relatorios-fd .chart-card > .chart-head .ch-tot .ch-delta .lbl,
#page-relatorios .relatorios-fd .chart-card > .chart-head .ch-tot .ch-delta .cmp-empty-lbl,
#page-relatorios .relatorios-fd .chart-card > .chart-head .ch-tot .ch-delta > span,
#page-relatorios .relatorios-fd .chart-card > .chart-head .ch-tot .ch-delta .delta,
#page-relatorios .relatorios-fd .tickets-card > .tk-head .ch-tot .ch-delta .lbl,
#page-relatorios .relatorios-fd .tickets-card > .tk-head .ch-tot .ch-delta .cmp-empty-lbl,
#page-relatorios .relatorios-fd .tickets-card > .tk-head .ch-tot .ch-delta > span,
#page-relatorios .relatorios-fd .tickets-card > .tk-head .ch-tot .ch-delta .delta,
#page-relatorios .relatorios-fd .chart-card.clientes > .tk-head .ch-tot .ch-delta .lbl,
#page-relatorios .relatorios-fd .chart-card.clientes > .tk-head .ch-tot .ch-delta .cmp-empty-lbl,
#page-relatorios .relatorios-fd .chart-card.clientes > .tk-head .ch-tot .ch-delta > span,
#page-relatorios .relatorios-fd .chart-card.clientes > .tk-head .ch-tot .ch-delta .delta,
#page-relatorios .relatorios-fd .fin-head-main > .chart-head .ch-tot .ch-delta .lbl,
#page-relatorios .relatorios-fd .fin-head-main > .chart-head .ch-tot .ch-delta .cmp-empty-lbl,
#page-relatorios .relatorios-fd .fin-head-main > .chart-head .ch-tot .ch-delta > span,
#page-relatorios .relatorios-fd .fin-head-main > .chart-head .ch-tot .ch-delta .delta{
  display:inline-flex;
  align-items:center;
  gap:0.25rem;
  font-size:inherit;
  font-weight:inherit;
  letter-spacing:inherit;
  text-transform:none;
  color:inherit;
  opacity:1;
  margin:0;
}
#page-relatorios .relatorios-fd .chart-card > .chart-head .ch-tot .ch-delta.up,
#page-relatorios .relatorios-fd .tickets-card > .tk-head .ch-tot .ch-delta.up,
#page-relatorios .relatorios-fd .chart-card.clientes > .tk-head .ch-tot .ch-delta.up,
#page-relatorios .relatorios-fd .fin-head-main > .chart-head .ch-tot .ch-delta.up{
  color:var(--rel-accent-strong, var(--muted));
}
#page-relatorios .relatorios-fd .chart-card > .chart-head .ch-tot .ch-delta.down,
#page-relatorios .relatorios-fd .tickets-card > .tk-head .ch-tot .ch-delta.down,
#page-relatorios .relatorios-fd .chart-card.clientes > .tk-head .ch-tot .ch-delta.down,
#page-relatorios .relatorios-fd .fin-head-main > .chart-head .ch-tot .ch-delta.down{
  color:#15804a;
}
#page-relatorios .relatorios-fd .chart-card > .chart-head .ch-tot [id$="CmpSlot"],
#page-relatorios .relatorios-fd .tickets-card > .tk-head .ch-tot [id$="CmpSlot"],
#page-relatorios .relatorios-fd .chart-card.clientes > .tk-head .ch-tot [id$="CmpSlot"],
#page-relatorios .relatorios-fd .fin-head-main > .chart-head .ch-tot [id$="CmpSlot"]{
  align-self:flex-end;
  text-align:right;
}
#page-relatorios .relatorios-fd .chart-card > .chart-head .ch-tot [id$="CmpSlot"] .cmp-line,
#page-relatorios .relatorios-fd .chart-card > .chart-head .ch-tot [id$="CmpSlot"] .cmp-empty,
#page-relatorios .relatorios-fd .tickets-card > .tk-head .ch-tot [id$="CmpSlot"] .cmp-line,
#page-relatorios .relatorios-fd .tickets-card > .tk-head .ch-tot [id$="CmpSlot"] .cmp-empty,
#page-relatorios .relatorios-fd .chart-card.clientes > .tk-head .ch-tot [id$="CmpSlot"] .cmp-line,
#page-relatorios .relatorios-fd .chart-card.clientes > .tk-head .ch-tot [id$="CmpSlot"] .cmp-empty,
#page-relatorios .relatorios-fd .fin-head-main > .chart-head .ch-tot [id$="CmpSlot"] .cmp-line,
#page-relatorios .relatorios-fd .fin-head-main > .chart-head .ch-tot [id$="CmpSlot"] .cmp-empty{
  justify-content:flex-end;
  margin-top:0;
  font-size:0.65625rem;
  font-weight:700;
  line-height:1.35;
  white-space:nowrap;
}

/* Tickets / Clientes: mesmo gap do chart-head de Incidentes (sem linha sob o título) */
#page-relatorios .relatorios-fd .tickets-card > .tk-head,
#page-relatorios .relatorios-fd .chart-card.clientes > .tk-head.clientes-head{
  display:flex;
  align-items:flex-start;
  gap:0.875rem;
  padding:1.375rem 1.625rem 0.875rem;
  border-bottom:0;
}
#page-relatorios .relatorios-fd .tickets-card > .tk-head .ch-act,
#page-relatorios .relatorios-fd .chart-card.clientes > .tk-head .ch-act{
  display:flex;
  gap:0.4375rem;
  flex:none;
}
#page-relatorios .relatorios-fd .tickets-card > .tk-head .ch-tot .ch-tot-main > b,
#page-relatorios .relatorios-fd .chart-card.clientes > .tk-head .ch-tot .ch-tot-main > b,
#page-relatorios .relatorios-fd .chart-card > .chart-head .ch-tot .ch-tot-main > b{
  font-size:2.125rem;
  font-weight:800;
  color:var(--ink);
  letter-spacing:-0.075rem;
  line-height:1;
  font-variant-numeric:tabular-nums;
}
#page-relatorios .relatorios-fd .tickets-card > .tk-head .ch-tot .ch-tot-lbl,
#page-relatorios .relatorios-fd .chart-card.clientes > .tk-head .ch-tot .ch-tot-lbl,
#page-relatorios .relatorios-fd .chart-card > .chart-head .ch-tot .ch-tot-lbl,
#page-relatorios .relatorios-fd .fin-head-main > .chart-head .ch-tot .ch-tot-lbl{
  font-size:0.65625rem;
  font-weight:700;
  letter-spacing:.06em;
  text-transform:uppercase;
  color:var(--muted);
  text-align:right;
}
#page-relatorios .relatorios-fd .fin-head-main > .chart-head .ch-tot b{
  font-size:1.75rem;
  letter-spacing:-0.0625rem;
  white-space:nowrap;
  line-height:1.05;
  color:var(--f-blue, var(--ink));
}

/* área extra (abaixo do gráfico empilhado principal) */
#page-relatorios .relatorios-fd #depExtra{ padding:0 1.375rem 1.375rem; }
#page-relatorios .relatorios-fd .dep-row{ display:grid; gap:1.375rem; margin-bottom:1.375rem; }
#page-relatorios .relatorios-fd .dep-row.r-full{ grid-template-columns:1fr; }
#page-relatorios .relatorios-fd .dpanel{ background:var(--surface); border:0.0625rem solid var(--line); border-radius:var(--radius-card); box-shadow:var(--p-elev-1); display:flex; flex-direction:column; overflow:hidden; }
#page-relatorios .relatorios-fd .dpanel .dp-head{ display:flex; align-items:flex-start; gap:0.6875rem; padding:1rem 1.125rem 0; }
#page-relatorios .relatorios-fd .dpanel .dp-ic{ width:2rem; height:2rem; border-radius:0.5625rem; background:var(--p-blue-bg); color:var(--p-blue); display:flex; align-items:center; justify-content:center; flex:none; }
#page-relatorios .relatorios-fd .dpanel .dp-ic svg{ width:1.0625rem; height:1.0625rem; }
#page-relatorios .relatorios-fd .dpanel .dp-head h3{ font-size:1rem; font-weight:800; letter-spacing:-0.01875rem; line-height:1.22; margin:0; color:var(--ink); text-align:left; }
#page-relatorios .relatorios-fd .dpanel .dp-head .dp-sub{ font-size:0.75rem; font-weight:500; line-height:1.4; color:var(--muted); margin-top:0.375rem; text-align:left; }
#page-relatorios .relatorios-fd .dep-inc-head-meta{
  display:flex; align-items:center; flex-wrap:wrap; gap:0; min-width:0; width:100%;
}
#page-relatorios .relatorios-fd .dep-inc-head-meta .dp-sub{ margin-top:0.0625rem; flex:none; white-space:nowrap; }
#page-relatorios .relatorios-fd .dep-inc-legend{
  display:flex; align-items:center; flex-wrap:wrap; gap:0.5rem 0.875rem;
  margin-left:0; min-width:0; flex:1 1 auto;
}
#page-relatorios .relatorios-fd #depSecConcentracao .dep-inc-head-meta{
  gap:0.5rem 0.875rem;
}
#page-relatorios .relatorios-fd .dep-inc-leg-item{
  display:inline-flex; align-items:center; gap:0.375rem; max-width:12rem;
}
#page-relatorios .relatorios-fd .dep-inc-leg-swatch{
  width:0.625rem; height:0.625rem; border-radius:0.1875rem; flex:none; box-shadow:inset 0 0 0 0.0625rem rgba(var(--rel-shadow-rgb),.08);
}
#page-relatorios .relatorios-fd .dep-inc-leg-t{
  font-size:0.6875rem; font-weight:700; color:var(--rel-ink-faint); white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
#page-relatorios .relatorios-fd .dpanel .dp-head .sp{ flex:1; }
#page-relatorios .relatorios-fd .dpanel .dp-body{ padding:1rem 1.125rem 1.375rem; flex:1; }

/* divisória de seção */
#page-relatorios .relatorios-fd .dep-sec-l{ display:flex; align-items:center; gap:0.5625rem; font-size:0.6875rem; font-weight:800; letter-spacing:.08em; text-transform:uppercase; color:var(--rel-ink-muted); margin:0.5rem 0.125rem 1.125rem; }
#page-relatorios .relatorios-fd .dep-sec-l::after{ content:""; flex:1; height:0.0625rem; background:var(--line); }

/* ===== LEITURA EXECUTIVA (ranking de concentração) ===== */
#page-relatorios .relatorios-fd .dep-exec{ display:grid; grid-template-columns:repeat(3,1fr); gap:0.8125rem; }
#page-relatorios .relatorios-fd #depExec .dx-card{
  background:linear-gradient(
    148deg,
    color-mix(in srgb, #f4f9ff 90%, var(--rel-surface)) 0%,
    color-mix(in srgb, #c9ddf2 48%, #e6f0fa) 42%,
    color-mix(in srgb, #dce9f7 72%, var(--rel-surface)) 68%,
    color-mix(in srgb, #b8d0eb 38%, #edf4fc) 100%
  );
  border:0.0625rem solid color-mix(in srgb, var(--p-blue) 16%, var(--line));
  box-shadow:
    0 0.0625rem 0.125rem rgba(var(--rel-shadow-rgb),.07),
    inset 0 0.0625rem 0 rgba(255,255,255,.78),
    inset 0 -0.0625rem 0 rgba(var(--rel-shadow-rgb),.05);
}
#page-relatorios .relatorios-fd #depExec .dx-card:hover{
  box-shadow:
    0 0.5rem 1.375rem -0.625rem rgba(var(--rel-shadow-rgb),.22),
    inset 0 0.0625rem 0 rgba(255,255,255,.85),
    inset 0 -0.0625rem 0 rgba(var(--rel-shadow-rgb),.05);
}
#page-relatorios .relatorios-fd #depExec .dx-card .dx-ic{
  background:color-mix(in srgb, var(--rel-surface) 62%, var(--p-blue-bg));
  box-shadow:inset 0 0.0625rem 0 rgba(255,255,255,.9);
}
#page-relatorios .relatorios-fd #depExec .dx-card.tone-blue .dx-ic,
#page-relatorios .relatorios-fd #depExec .dx-card.tone-cost .dx-ic{
  color:var(--p-blue);
}
html[data-theme="dark"] #page-relatorios .relatorios-fd #depExec .dx-card{
  background:linear-gradient(
    148deg,
    color-mix(in srgb, #1a2d4a 88%, #243a5c) 0%,
    color-mix(in srgb, #2a4470 70%, #1e3354) 50%,
    color-mix(in srgb, #1f3558 85%, #2d4a72) 100%
  );
  border-color:color-mix(in srgb, var(--p-blue) 28%, var(--line));
  box-shadow:
    0 0.0625rem 0.125rem rgba(0,0,0,.35),
    inset 0 0.0625rem 0 rgba(255,255,255,.08);
}
/* Nublado: superfície clara elevada + tipografia navy (não reutilizar o degradê da Noite) */
html[data-theme="cinza"] #page-relatorios .relatorios-fd #depExec .dx-card{
  background:linear-gradient(
    148deg,
    color-mix(in srgb, var(--rel-cloud-surface-raised,#b2b9c2) 88%, #d7dee6) 0%,
    color-mix(in srgb, var(--rel-cloud-surface-raised,#b2b9c2) 72%, #c5ced8) 48%,
    color-mix(in srgb, var(--rel-cloud-surface,#9fa7b1) 82%, #b8c1cb) 100%
  );
  border:0.0625rem solid rgba(var(--rel-cloud-navy-rgb,23,59,87), 0.30);
  box-shadow:var(--rel-cloud-shadow-card, 0 0.125rem 0.3125rem rgba(20,24,29,.16)), inset 0 0.0625rem 0 rgba(255,255,255,.42);
}
html[data-theme="cinza"] #page-relatorios .relatorios-fd #depExec .dx-card .dx-ic{
  background:rgba(var(--rel-cloud-navy-rgb,23,59,87), 0.14);
  color:var(--rel-cloud-navy,#173b57);
  box-shadow:inset 0 0.0625rem 0 rgba(255,255,255,.55);
}
html[data-theme="cinza"] #page-relatorios .relatorios-fd #depExec .dx-card.tone-blue .dx-ic,
html[data-theme="cinza"] #page-relatorios .relatorios-fd #depExec .dx-card.tone-cost .dx-ic{
  color:var(--rel-cloud-navy,#173b57);
}
html[data-theme="dark"] #page-relatorios .relatorios-fd #depExec .dx-card .dx-k{
  color:color-mix(in srgb, var(--muted) 85%, #b8c9e0);
}
html[data-theme="cinza"] #page-relatorios .relatorios-fd #depExec .dx-card .dx-k{
  color:var(--rel-cloud-navy,#173b57);
}
html[data-theme="dark"] #page-relatorios .relatorios-fd #depExec .dx-card .dx-v{
  color:#e8f0fa;
}
html[data-theme="cinza"] #page-relatorios .relatorios-fd #depExec .dx-card .dx-v{
  color:var(--rel-cloud-navy-deep,#0b2234);
}
html[data-theme="cinza"] #page-relatorios .relatorios-fd #depExec .dx-card .dx-x{
  color:var(--rel-ink-3,#333b45);
}
#page-relatorios .relatorios-fd .dx-card{ display:flex; align-items:flex-start; gap:0.75rem; padding:0.875rem 0.9375rem; border:0.0625rem solid var(--line); border-radius:var(--radius-card); background:var(--surface); box-shadow:var(--p-elev-1); transition:.16s; }
#page-relatorios .relatorios-fd .dx-card:hover{ box-shadow:var(--p-elev-2); transform:translateY(-0.125rem); }
#page-relatorios .relatorios-fd .dx-ic{ width:2.125rem; height:2.125rem; border-radius:0.625rem; flex:none; display:flex; align-items:center; justify-content:center; }
#page-relatorios .relatorios-fd .dx-ic svg{ width:1.125rem; height:1.125rem; }
#page-relatorios .relatorios-fd .dx-card.tone-blue .dx-ic{ background:var(--p-blue-bg); color:var(--p-blue); }
#page-relatorios .relatorios-fd .dx-card.tone-ok .dx-ic{ background:var(--p-ok-bg); color:var(--p-ok); }
#page-relatorios .relatorios-fd .dx-card.tone-warn .dx-ic{ background:var(--p-warn-bg); color:var(--p-warn); }
#page-relatorios .relatorios-fd .dx-card.tone-bad .dx-ic{ background:var(--p-bad-bg); color:var(--p-bad); }
#page-relatorios .relatorios-fd .dx-card.tone-cost .dx-ic{ background:rgba(var(--rel-ink-faint-rgb),.12); color:var(--p-cost); }
#page-relatorios .relatorios-fd .dx-tx{ min-width:0; flex:1; }
#page-relatorios .relatorios-fd .dx-k{ font-size:0.65625rem; font-weight:800; letter-spacing:.05em; text-transform:uppercase; color:var(--rel-ink-muted); }
#page-relatorios .relatorios-fd .dx-v{ font-size:0.9375rem; font-weight:800; color:var(--ink); letter-spacing:-0.0125rem; margin-top:0.1875rem; line-height:1.2; }
#page-relatorios .relatorios-fd .dx-card.tone-bad .dx-v{ color:var(--p-bad); } #page-relatorios .relatorios-fd .dx-card.tone-ok .dx-v{ color:var(--p-ok); }
#page-relatorios .relatorios-fd .dx-x{ font-size:0.71875rem; font-weight:600; color:var(--muted); margin-top:0.1875rem; font-variant-numeric:tabular-nums; }

/* ===== PARETO ===== */
#page-relatorios .relatorios-fd .pareto-wrap{ position:relative; }
#page-relatorios .relatorios-fd .pareto-wrap svg{ width:100%; display:block; overflow:visible; }
#page-relatorios .relatorios-fd .pareto-wrap .gl{ stroke:var(--line); stroke-width:1; }
#page-relatorios .relatorios-fd .pareto-wrap .g80{ stroke:var(--p-warn-dot); stroke-width:1.4; stroke-dasharray:5 4; opacity:.7; }
#page-relatorios .relatorios-fd .pareto-wrap .g80t{ fill:var(--p-warn); font-weight:800; }
#page-relatorios .relatorios-fd .pareto-wrap .axlab{ font-size:0.6875rem; font-weight:600; fill:var(--rel-ink-muted); }
#page-relatorios .relatorios-fd .pareto-wrap .pbar{ fill:var(--p-blue); opacity:.42; transition:opacity .14s; }
#page-relatorios .relatorios-fd .pareto-wrap .pbar.hot{ fill:var(--p-blue); opacity:1; }
#page-relatorios .relatorios-fd .pareto-wrap .pbv{ font-size:0.6875rem; font-weight:800; fill:var(--rel-ink-3); font-variant-numeric:tabular-nums; }
#page-relatorios .relatorios-fd .pareto-wrap .pline{ fill:none; stroke:var(--p-warn-dot); stroke-width:2.6; stroke-linejoin:round; stroke-linecap:round; }
#page-relatorios .relatorios-fd .pareto-wrap .pdot{ fill:var(--p-warn-dot); stroke:var(--surface); stroke-width:1.5; }
#page-relatorios .relatorios-fd .pareto-wrap .pcum{ font-size:0.625rem; font-weight:800; fill:var(--p-warn); font-variant-numeric:tabular-nums; }
#page-relatorios .relatorios-fd .pareto-wrap .pxl{ font-size:0.65625rem; font-weight:600; fill:var(--rel-icon-muted); }
#page-relatorios .relatorios-fd .pareto-wrap .hit{ fill:transparent; cursor:pointer; }
#page-relatorios .relatorios-fd .dep-tip{ position:absolute; pointer-events:none; background:var(--ink); color:#fff; border-radius:0.625rem; padding:0.5625rem 0.75rem; font-size:0.75rem; box-shadow:var(--p-elev-2); opacity:0; transition:opacity .12s; z-index:6; white-space:nowrap; transform:translate(-50%,0); }
#page-relatorios .relatorios-fd .dep-tip .t{ font-weight:800; margin-bottom:0.3125rem; }
#page-relatorios .relatorios-fd .dep-tip .r{ display:flex; align-items:center; justify-content:space-between; gap:1rem; margin-top:0.1875rem; }
#page-relatorios .relatorios-fd .dep-tip .r b{ font-variant-numeric:tabular-nums; }
#page-relatorios .relatorios-fd .pareto-legend{ display:flex; align-items:center; gap:1.125rem; margin-bottom:0.75rem; }
#page-relatorios .relatorios-fd .pareto-legend .pl{ display:inline-flex; align-items:center; gap:0.4375rem; font-size:0.75rem; font-weight:700; color:var(--rel-ink-3); }
#page-relatorios .relatorios-fd .pareto-legend .pl .sw{ width:0.75rem; height:0.75rem; border-radius:0.1875rem; }
#page-relatorios .relatorios-fd .pareto-legend .pl .sw.bar{ background:var(--p-blue); } #page-relatorios .relatorios-fd .pareto-legend .pl .sw.cum{ width:1rem; height:0.1875rem; border-radius:0.125rem; background:var(--p-warn-dot); }
#page-relatorios .relatorios-fd .dep-note{ margin-top:1.125rem; padding:0.75rem 1rem; border-radius:var(--radius-card); background:var(--p-warn-bg); border:0.0625rem solid color-mix(in srgb,var(--p-warn-dot) 22%,var(--line)); font-size:0.78125rem; font-weight:600; color:#6b5208; display:flex; align-items:center; gap:0.5625rem; }
html[data-theme="dark"] #page-relatorios .relatorios-fd .dep-note{ color:#f1d08a; }
html[data-theme="cinza"] #page-relatorios .relatorios-fd .dep-note{ color:#6b3b08; }
#page-relatorios .relatorios-fd .dep-note b{ font-weight:800; }
#page-relatorios .relatorios-fd .dep-note::before{ content:""; width:0.4375rem; height:0.4375rem; border-radius:50%; background:var(--p-warn-dot); flex:none; }

/* ===== Incidentes (KPIs + pilha horizontal) ===== */
#page-relatorios .relatorios-fd .dep-inc-root{ min-height:0; }
#page-relatorios .relatorios-fd .dep-inc-split{
  display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:0.875rem; align-items:start;
}
#page-relatorios .relatorios-fd .dep-inc-kpis{
  --dep-inc-kpi-bar-h: 0.25rem;
  --dep-inc-kpi-row-slot: 2.125rem;
  --dep-inc-kpi-list-pad-y: 1.25rem;
  display:grid; grid-template-columns:1fr 1fr; grid-template-rows:1fr 1fr; gap:0.625rem;
  min-width:0; height:auto; align-self:start; align-items:stretch;
}
#page-relatorios .relatorios-fd .dep-inc-kpi{
  min-height:0; height:100%; padding:0; border:0.0625rem solid var(--line); border-radius:var(--radius-card);
  background:var(--surface); box-shadow:var(--p-elev-1); display:flex; flex-direction:column; min-width:0;
  overflow:hidden;
}
/* Cabeçalho Top 5: caixa fixa (paridade nos 4 cards / todos os temas).
   Subtítulo reserva 2 linhas — textos curtos não encolhem a faixa. */
#page-relatorios .relatorios-fd .dep-inc-kpi-head{
  --dep-inc-kpi-head-pad-y: 0.75rem;
  --dep-inc-kpi-head-pad-x: 0.875rem;
  --dep-inc-kpi-sub-lines: 2;
  flex:none;
  display:flex;
  flex-direction:column;
  justify-content:flex-start;
  box-sizing:border-box;
  width:100%;
  min-height:calc(
    var(--dep-inc-kpi-head-pad-y) * 2
    + (0.78125rem * 1.3)
    + 0.25rem
    + (0.6875rem * 1.4 * var(--dep-inc-kpi-sub-lines))
  );
  padding:var(--dep-inc-kpi-head-pad-y) var(--dep-inc-kpi-head-pad-x);
  margin:0;
  background:var(--blue,#007bff);
  border-bottom:0.0625rem solid color-mix(in srgb, var(--blue,#007bff) 78%, #003f88);
  box-shadow:inset 0 0.0625rem 0 rgba(255,255,255,.78);
}
html[data-theme="dark"] #page-relatorios .relatorios-fd .dep-inc-kpi-head{
  box-shadow:inset 0 0.0625rem 0 rgba(255,255,255,.08);
}
#page-relatorios .relatorios-fd .dep-inc-kpi-t{
  margin:0; font-size:0.78125rem; font-weight:800; letter-spacing:-0.0125rem; color:var(--ink); line-height:1.3;
  flex:none;
}
#page-relatorios .relatorios-fd .dep-inc-kpi-s{
  margin:0.25rem 0 0; font-size:0.6875rem; font-weight:600; color:var(--muted); line-height:1.4;
  flex:none;
  min-height:calc(1.4em * 2);
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
  line-clamp:2;
  overflow:hidden;
}
#page-relatorios .relatorios-fd .dep-inc-kpi-head .dep-inc-kpi-t{ color:#fff; }
#page-relatorios .relatorios-fd .dep-inc-kpi-head .dep-inc-kpi-s{ color:rgba(255,255,255,.84); }
#page-relatorios .relatorios-fd .dep-inc-kpi-list{
  margin:0; padding:0.625rem 0.75rem 0.625rem; list-style:none; flex:1 1 auto;
  min-height:calc(var(--dep-inc-kpi-row-slot) * 5 + var(--dep-inc-kpi-list-pad-y));
  display:flex; flex-direction:column; justify-content:flex-start; gap:0;
}
#page-relatorios .relatorios-fd .dep-inc-kpi-list:has(> .dep-inc-kpi-empty){
  justify-content:center;
  align-items:center;
}
#page-relatorios .relatorios-fd .dep-inc-kpi-item{
  padding:0.1875rem 0.3125rem; border-radius:0.4375rem; transition:background .14s ease;
  min-height:var(--dep-inc-kpi-row-slot); box-sizing:border-box;
}
#page-relatorios .relatorios-fd .dep-inc-kpi-item:hover{
  background:color-mix(in srgb, var(--p-blue) 5%, transparent);
}
#page-relatorios .relatorios-fd .dep-inc-kpi-row{
  display:grid; grid-template-columns:1.375rem minmax(0,1fr) auto; align-items:center; gap:0.5rem 0.625rem;
}
#page-relatorios .relatorios-fd .dep-inc-kpi-list li.dep-inc-kpi-empty{
  display:flex; align-items:center; justify-content:center;
  width:100%;
  flex:1 1 auto;
  min-height:calc(var(--dep-inc-kpi-row-slot) * 5);
  padding:0.5rem 0.75rem; box-sizing:border-box;
  text-align:center;
}
#page-relatorios .relatorios-fd .dep-inc-kpi-rank{
  width:1.375rem; height:1.375rem; border-radius:0.4375rem; font-size:0.6875rem; font-weight:800;
  display:flex; align-items:center; justify-content:center; flex:none;
}
#page-relatorios .relatorios-fd .dep-inc-kpi-rank--1{
  background:color-mix(in srgb, var(--p-blue) 16%, var(--p-blue-bg));
  color:color-mix(in srgb, var(--p-blue) 92%, var(--ink));
}
#page-relatorios .relatorios-fd .dep-inc-kpi-rank--2{
  background:var(--p-blue-bg); color:var(--p-blue);
}
#page-relatorios .relatorios-fd .dep-inc-kpi-rank--3{
  background:color-mix(in srgb, var(--p-blue-bg) 55%, var(--surface));
  color:color-mix(in srgb, var(--p-blue) 70%, var(--muted));
}
#page-relatorios .relatorios-fd .dep-inc-kpi-rank--4{
  background:color-mix(in srgb, var(--p-blue-bg) 38%, var(--surface));
  color:color-mix(in srgb, var(--p-blue) 58%, var(--muted));
}
#page-relatorios .relatorios-fd .dep-inc-kpi-rank--5{
  background:color-mix(in srgb, var(--p-blue-bg) 22%, var(--surface));
  color:color-mix(in srgb, var(--p-blue) 48%, var(--muted));
}
#page-relatorios .relatorios-fd .dep-inc-kpi-n{
  min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
  font-size:0.71875rem; font-weight:600; color:#5a6a82; line-height:1.2;
}
#page-relatorios .relatorios-fd .dep-inc-kpi-v{
  flex:none; font-size:0.78125rem; font-variant-numeric:tabular-nums; font-weight:800;
  color:var(--ink); text-align:right; min-width:2.5rem; line-height:1.2;
}
#page-relatorios .relatorios-fd .dep-inc-kpi-metric{
  display:inline-flex; align-items:center; justify-content:flex-end; gap:0.375rem; flex-wrap:nowrap; max-width:100%;
}
#page-relatorios .relatorios-fd .dep-inc-kpi-cnt{
  flex:none; font-size:0.78125rem; font-weight:800; font-variant-numeric:tabular-nums; color:var(--ink); min-width:1.5ch; text-align:right;
}
#page-relatorios .relatorios-fd .dep-inc-kpi-bar{
  margin:0.25rem 0 0 2rem; height:var(--dep-inc-kpi-bar-h); min-height:var(--dep-inc-kpi-bar-h); max-height:var(--dep-inc-kpi-bar-h);
  border-radius:62.4375rem; overflow:hidden; flex-shrink:0;
  background:color-mix(in srgb, var(--p-blue) 8%, var(--line));
}
#page-relatorios .relatorios-fd .dep-inc-kpi-bar-fill{
  display:block; height:100%; min-height:var(--dep-inc-kpi-bar-h); border-radius:inherit;
  background:linear-gradient(90deg, color-mix(in srgb, var(--p-blue) 55%, var(--rel-surface)), var(--p-blue));
  transition:width .35s cubic-bezier(.22,1,.36,1);
}
html[data-theme="cinza"] #page-relatorios .relatorios-fd .dep-inc-kpi-bar-fill{ background:linear-gradient(90deg, color-mix(in srgb, var(--p-blue) 55%, var(--surface)), var(--p-blue)); }
#page-relatorios .relatorios-fd .dep-inc-delta{
  display:inline-flex; align-items:center; gap:0.1875rem; flex:none;
  padding:0.125rem 0.4375rem; border-radius:0.375rem; font-size:0.65625rem; font-weight:800;
  font-variant-numeric:tabular-nums; white-space:nowrap; line-height:1.25;
}
#page-relatorios .relatorios-fd .dep-inc-delta-arr{ font-size:0.6875rem; line-height:1; }
#page-relatorios .relatorios-fd .dep-inc-delta--up{
  background:color-mix(in srgb, var(--p-bad) 11%, var(--surface));
  color:color-mix(in srgb, var(--p-bad) 82%, #7a3535);
}
#page-relatorios .relatorios-fd .dep-inc-delta--down{
  background:color-mix(in srgb, var(--p-ok) 11%, var(--surface));
  color:color-mix(in srgb, var(--p-ok) 82%, #2d5a40);
}
#page-relatorios .relatorios-fd .dep-inc-kpi-empty{
  grid-column:1/-1;
  justify-content:center!important;
  align-items:center!important;
  text-align:center;
  color:var(--muted)!important;
  font-weight:600!important;
}
#page-relatorios .relatorios-fd .dep-inc-stack-card{
  --dep-inc-chart-pad:0.875rem;
  --dep-inc-bar-gap:0.5rem;
  --dep-inc-row-h:2.125rem;
  --dep-inc-visible-max:20;
  --dep-inc-label-col:9rem;
  align-self:start;
  box-sizing:border-box;
  min-width:0; border:0.0625rem solid var(--line); border-radius:var(--radius-card); background:var(--surface); box-shadow:var(--p-elev-1);
  display:flex; flex-direction:column; overflow:hidden;
  height:var(--dep-inc-stack-max-h, auto);
  max-height:var(--dep-inc-stack-max-h, none);
  min-height:0;
}
#page-relatorios .relatorios-fd .dep-inc-stack-scroll{
  padding:0.75rem var(--dep-inc-chart-pad) 0.625rem;
  flex:1 1 auto; min-height:0;
  max-height:none;
  overflow-x:hidden; overflow-y:hidden;
  scrollbar-gutter:stable; scrollbar-width:thin; scrollbar-color:var(--rel-scroll-thumb) transparent;
}
#page-relatorios .relatorios-fd .dep-inc-stack-card--scroll .dep-inc-stack-scroll{
  overflow-y:auto; padding-right:calc(var(--dep-inc-chart-pad) - 0.25rem);
}
#page-relatorios .relatorios-fd .dep-inc-stack-scroll::-webkit-scrollbar{ width:0.25rem; }
#page-relatorios .relatorios-fd .dep-inc-stack-scroll::-webkit-scrollbar-track{ background:transparent; }
#page-relatorios .relatorios-fd .dep-inc-stack-scroll::-webkit-scrollbar-thumb{
  background:var(--rel-scroll-thumb); border-radius:62.4375rem;
}
#page-relatorios .relatorios-fd .dep-inc-stack-scroll::-webkit-scrollbar-thumb:hover{ background:var(--rel-scroll-thumb-hover); }
#page-relatorios .relatorios-fd .dep-inc-stack{ display:flex; flex-direction:column; gap:0; position:relative; }
#page-relatorios .relatorios-fd .dep-inc-lbl-measure{
  position:absolute; left:0; top:0; visibility:hidden; pointer-events:none;
  max-width:none; width:max-content;
}
#page-relatorios .relatorios-fd .dep-inc-row{
  display:grid;
  grid-template-columns:var(--dep-inc-label-col, 9rem) minmax(0, 1fr);
  column-gap:var(--dep-inc-bar-gap, 0.625rem);
  align-items:center;
  min-height:var(--dep-inc-row-h); padding:0.3125rem 0;
  border-bottom:0.0625rem solid color-mix(in srgb, var(--line) 65%, transparent);
}
#page-relatorios .relatorios-fd .dep-inc-row:last-child{ border-bottom:0; }
#page-relatorios .relatorios-fd .dep-inc-lbl{
  min-width:0; max-width:100%;
  font-size:0.75rem; font-weight:700; color:var(--ink); text-align:left; line-height:1.25;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
#page-relatorios .relatorios-fd .dep-inc-track{
  min-width:0; width:100%;
  display:flex; align-items:center; gap:var(--dep-inc-bar-gap, 0.625rem); height:1.5rem;
}
#page-relatorios .relatorios-fd .dep-inc-bar-wrap{ flex:1 1 0; min-width:0; height:100%; display:flex; align-items:center; }
#page-relatorios .relatorios-fd .dep-inc-bar{
  display:flex; height:100%; min-width:0.375rem; max-width:100%; border-radius:0.4375rem; overflow:hidden;
  box-shadow:inset 0 0 0 0.0625rem rgba(var(--rel-shadow-rgb),.06); transition:width .35s cubic-bezier(.22,1,.36,1);
}
#page-relatorios .relatorios-fd .dep-inc-seg{ min-width:0.1875rem; height:100%; transition:opacity .12s; }
#page-relatorios .relatorios-fd .dep-inc-seg:hover{ filter:brightness(1.06); }
#page-relatorios .relatorios-fd .dep-inc-val{
  flex:none; font-size:0.78125rem; font-weight:800; font-variant-numeric:tabular-nums; color:var(--rel-ink-3);
  min-width:2ch; text-align:right;
}
#page-relatorios .relatorios-fd .dep-inc-stack-note{ margin:0; border-radius:0 0 0.8125rem 0.8125rem; border-left:0; border-right:0; border-bottom:0; }
#page-relatorios .relatorios-fd .dep-inc-stack-scroll:has(.dep-inc-empty){
  display:flex;
  align-items:stretch;
  justify-content:center;
}
#page-relatorios .relatorios-fd .dep-inc-stack:has(> .dep-inc-empty){
  flex:1 1 auto;
  min-height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
}
#page-relatorios .relatorios-fd .dep-inc-empty{
  margin:0;
  padding:1.5rem 1rem;
  width:100%;
  box-sizing:border-box;
  font-size:0.8125rem;
  font-weight:600;
  color:var(--muted);
  text-align:center;
  line-height:1.4;
}
@media (max-width: 0px) /* ui-scale-freeze: was 1100px */{
  #page-relatorios .relatorios-fd .dep-inc-split{ grid-template-columns:1fr; }
  #page-relatorios .relatorios-fd .dep-inc-kpis{ height:auto; grid-template-rows:auto; }
}
@media (max-width:680px){
  #page-relatorios .relatorios-fd .dep-inc-kpis{ grid-template-columns:1fr; grid-template-rows:auto; }
  #page-relatorios .relatorios-fd .dep-inc-row{
    grid-template-columns:1fr; row-gap:0.375rem; min-height:auto; padding:0.625rem 0;
  }
  #page-relatorios .relatorios-fd .dep-inc-lbl{ max-width:100%; }
  #page-relatorios .relatorios-fd .dep-inc-track{ width:100%; }
  #page-relatorios .relatorios-fd .dep-inc-val{ text-align:left; }
}

/* ===== Visão geral: leitura executiva acima do gráfico + legenda em card ===== */
#page-relatorios .relatorios-fd #depSecVisao .dep-panel-body > .dep-visao-exec-top{
  padding:0 0.875rem 0.875rem;
}
#page-relatorios .relatorios-fd #depSecVisao .dep-panel-body > .dep-visao-exec-top #depExec,
#page-relatorios .relatorios-fd #depSecVisao .dep-panel-body > .dep-visao-exec-top .dep-exec{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:0.8125rem;
}
#page-relatorios .relatorios-fd .dep-inner-panel .dep-visao-chart-body{
  --dep-plot-bar-h:33.825rem;
  --dep-plot-pad-y:1.25rem;
  --dep-plot-pad-bottom:0;
  --dep-plot-axis-stroke:0.078125rem;
  --dep-leg-visible:15;
  --dep-leg-row-h:1.875rem;
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(12.5rem,15.5rem);
  gap:0.875rem;
  padding:0 0.875rem 0.875rem;
  align-items:stretch;
}
#page-relatorios .relatorios-fd .dep-inner-panel .dep-visao-chart-body .legend.dep-leg-card{
  position:relative;
  /* Alinha ao plot: topo = linha do máximo do eixo Y; base = eixo X (0). Pad Y do gráfico fica acima do card. */
  --dep-leg-axis-h:calc(
    var(--dep-plot-bar-h, 33.825rem)
    - var(--dep-plot-pad-y, 1.25rem)
    - var(--dep-plot-pad-bottom, 0)
  );
  align-self:start;
  margin-top:var(--dep-plot-pad-y, 1.25rem);
  height:var(--dep-leg-axis-h);
  min-height:var(--dep-leg-axis-h);
  max-height:var(--dep-leg-axis-h);
  box-sizing:border-box;
  --dep-leg-head-h:2.75rem;
  background:color-mix(in srgb, var(--field) 88%, #c8cfd9 12%);
  border:0.0625rem solid color-mix(in srgb, var(--line) 92%, #aeb9c8);
  border-radius:var(--radius-card);
  box-shadow:var(--p-elev-1);
  backdrop-filter:none;
  overflow:hidden;
}
html[data-theme="dark"] #page-relatorios .relatorios-fd .dep-inner-panel .dep-visao-chart-body .legend.dep-leg-card{
  background:color-mix(in srgb, var(--field) 70%, #1a2438);
  border-color:var(--line);
}
html[data-theme="cinza"] #page-relatorios .relatorios-fd .dep-inner-panel .dep-visao-chart-body .legend.dep-leg-card{
  /* Nublado eleva em vez de escurecer: o parceiro da mistura e claro. */
  background:color-mix(in srgb, var(--field) 70%, #b8bfc7);
  border-color:var(--line);
}
#page-relatorios .relatorios-fd .dep-inner-panel .dep-visao-chart-body .legend.dep-leg-card h4{
  position:static;
  top:auto;
  left:auto;
  margin:0;
  font-size:0.625rem;
  font-weight:800;
  letter-spacing:.09em;
  text-transform:uppercase;
  color:#8a97ad;
}
html[data-theme="cinza"] #page-relatorios .relatorios-fd .dep-inner-panel .dep-visao-chart-body .legend.dep-leg-card h4{ color:var(--rel-ink-muted); }
#page-relatorios .relatorios-fd .dep-inner-panel .dep-visao-chart-body .legend.dep-leg-card .dep-leg-head,
#page-relatorios .relatorios-fd .legend.dep-leg-card .dep-leg-head{
  position:absolute;
  top:0;
  left:0;
  right:0;
  z-index:1;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:0.625rem;
  min-height:var(--dep-leg-head-h, 2.75rem);
  height:var(--dep-leg-head-h, 2.75rem);
  padding:0 0.75rem 0 1rem;
  box-sizing:border-box;
}
#page-relatorios .relatorios-fd .dep-inner-panel .dep-visao-chart-body .legend.dep-leg-card .dep-leg-sort,
#page-relatorios .relatorios-fd .legend.dep-leg-card .dep-leg-sort{
  display:flex;
  align-items:center;
  flex:none;
}
#page-relatorios .relatorios-fd .dep-inner-panel .dep-visao-chart-body .legend.dep-leg-card .dep-leg-sort-btn,
#page-relatorios .relatorios-fd .legend.dep-leg-card .dep-leg-sort-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:2.125rem;
  height:1.875rem;
  padding:0;
  border:0.0625rem solid color-mix(in srgb, var(--line) 92%, #aeb9c8);
  border-radius:0.5rem;
  background:rgba(var(--rel-surface-rgb),.75);
  color:#6b7a92;
  cursor:pointer;
  transition:background .15s ease,color .15s ease,box-shadow .15s ease,border-color .15s ease;
}
#page-relatorios .relatorios-fd .dep-inner-panel .dep-visao-chart-body .legend.dep-leg-card .dep-leg-sort-btn svg,
#page-relatorios .relatorios-fd .legend.dep-leg-card .dep-leg-sort-btn svg{
  width:1.125rem;
  height:1.125rem;
  pointer-events:none;
  transform:rotate(0deg);
  transform-origin:center;
  transition:transform .18s ease,color .15s ease;
}
#page-relatorios .relatorios-fd .dep-inner-panel .dep-visao-chart-body .legend.dep-leg-card .dep-leg-sort-btn.is-asc svg,
#page-relatorios .relatorios-fd .legend.dep-leg-card .dep-leg-sort-btn.is-asc svg{
  transform:rotate(180deg);
  color:var(--accent,#0a78f0);
}
#page-relatorios .relatorios-fd .dep-inner-panel .dep-visao-chart-body .legend.dep-leg-card .dep-leg-sort-btn.is-desc svg,
#page-relatorios .relatorios-fd .legend.dep-leg-card .dep-leg-sort-btn.is-desc svg{
  transform:rotate(0deg);
  color:var(--accent,#0a78f0);
}
#page-relatorios .relatorios-fd .dep-inner-panel .dep-visao-chart-body .legend.dep-leg-card .dep-leg-sort-btn:hover,
#page-relatorios .relatorios-fd .legend.dep-leg-card .dep-leg-sort-btn:hover{
  background:var(--rel-surface);
  color:var(--ink,#0d1b2a);
  box-shadow:var(--shadow-1,0 0.0625rem 0.1875rem rgba(13,40,80,.12));
}
html[data-theme="cinza"] #page-relatorios .relatorios-fd .dep-inner-panel .dep-visao-chart-body .legend.dep-leg-card .dep-leg-sort-btn:hover,html[data-theme="cinza"] #page-relatorios .relatorios-fd .legend.dep-leg-card .dep-leg-sort-btn:hover{ background:var(--surface); }
#page-relatorios .relatorios-fd .dep-inner-panel .dep-visao-chart-body .legend.dep-leg-card .dep-leg-sort-btn.on,
#page-relatorios .relatorios-fd .legend.dep-leg-card .dep-leg-sort-btn.on{
  background:color-mix(in srgb, var(--accent,#0a78f0) 12%, var(--rel-surface));
  border-color:color-mix(in srgb, var(--accent,#0a78f0) 35%, var(--line));
  color:var(--accent,#0a78f0);
}
html[data-theme="cinza"] #page-relatorios .relatorios-fd .dep-inner-panel .dep-visao-chart-body .legend.dep-leg-card .dep-leg-sort-btn.on,html[data-theme="cinza"] #page-relatorios .relatorios-fd .legend.dep-leg-card .dep-leg-sort-btn.on{ border-color:var(--rel-ink-3); }
html[data-theme="dark"] #page-relatorios .relatorios-fd .dep-inner-panel .dep-visao-chart-body .legend.dep-leg-card .dep-leg-sort-btn,
html[data-theme="cinza"] #page-relatorios .relatorios-fd .dep-inner-panel .dep-visao-chart-body .legend.dep-leg-card .dep-leg-sort-btn,
html[data-theme="dark"] #page-relatorios .relatorios-fd .legend.dep-leg-card .dep-leg-sort-btn,
html[data-theme="cinza"] #page-relatorios .relatorios-fd .legend.dep-leg-card .dep-leg-sort-btn{
  background:color-mix(in srgb, var(--field) 85%, #1a2438);
  border-color:var(--line);
  color:var(--muted,#9aa7bd);
}
html[data-theme="dark"] #page-relatorios .relatorios-fd .dep-inner-panel .dep-visao-chart-body .legend.dep-leg-card .dep-leg-sort-btn.on,
html[data-theme="cinza"] #page-relatorios .relatorios-fd .dep-inner-panel .dep-visao-chart-body .legend.dep-leg-card .dep-leg-sort-btn.on,
html[data-theme="dark"] #page-relatorios .relatorios-fd .legend.dep-leg-card .dep-leg-sort-btn.on,
html[data-theme="cinza"] #page-relatorios .relatorios-fd .legend.dep-leg-card .dep-leg-sort-btn.on{
  background:color-mix(in srgb, var(--accent,#0a78f0) 22%, var(--field));
  color:var(--accent,#5eb0ff);
}
#page-relatorios .relatorios-fd .dep-inner-panel .dep-visao-chart-body .legend.dep-leg-card .leg-list{
  top:var(--dep-leg-head-h, 2.75rem);
  bottom:0.625rem;
  overflow-y:auto;
  overflow-x:hidden;
  overscroll-behavior:contain;
  scrollbar-width:thin;
  scrollbar-color:rgba(148,163,184,.32) transparent;
}
#page-relatorios .relatorios-fd .dep-inner-panel .dep-visao-chart-body .legend.dep-leg-card .leg-list::-webkit-scrollbar{
  width:0.3125rem;
}
#page-relatorios .relatorios-fd .dep-inner-panel .dep-visao-chart-body .legend.dep-leg-card .leg-list::-webkit-scrollbar-track{
  background:transparent;
}
#page-relatorios .relatorios-fd .dep-inner-panel .dep-visao-chart-body .legend.dep-leg-card .leg-list::-webkit-scrollbar-thumb{
  background:rgba(var(--rel-neutral-rgb),.28);
  border-radius:62.4375rem;
  border:0.0625rem solid transparent;
  background-clip:padding-box;
}
#page-relatorios .relatorios-fd .dep-inner-panel .dep-visao-chart-body .legend.dep-leg-card .leg-list::-webkit-scrollbar-thumb:hover{
  background:rgba(var(--rel-neutral-rgb),.42);
  background-clip:padding-box;
}
#page-relatorios.relatorios-print-focus .dep-inner-panel .dep-visao-chart-body .legend.dep-leg-card{
  min-height:auto;
  max-height:none;
  height:auto;
}
#page-relatorios.relatorios-print-focus .dep-inner-panel .dep-visao-chart-body .legend.dep-leg-card .leg-list{
  position:static;
  top:auto;
  bottom:auto;
  overflow:visible;
  max-height:none;
  margin-top:2.5rem;
  padding:0 0.875rem 0.875rem 0.5rem;
}
#page-relatorios .relatorios-fd .dep-inner-panel .plot.dep-plot-patched{
  grid-template-columns:2.875rem minmax(0,1fr);
  grid-template-rows:auto;
  min-width:0;
  min-height:calc(var(--dep-plot-bar-h, 33.825rem) + 2.875rem);
  border-left:0.0625rem solid var(--line);
}
#page-relatorios .relatorios-fd .dep-inner-panel .plot.dep-plot-patched .yaxis{
  grid-column:1;
  grid-row:1;
  height:var(--dep-plot-bar-h, 33.825rem);
  position:relative;
}
#page-relatorios .relatorios-fd .dep-inner-panel .plot.dep-plot-patched .dep-plot-col2{
  grid-column:2;
  grid-row:1;
  min-width:0;
  overflow-x:auto;
  overflow-y:hidden;
  scrollbar-width:thin;
  scrollbar-color:var(--rel-scroll-thumb) transparent;
}
#page-relatorios .relatorios-fd .dep-inner-panel .plot.dep-plot-patched .dep-plot-col2::-webkit-scrollbar{ height:0.25rem; }
#page-relatorios .relatorios-fd .dep-inner-panel .plot.dep-plot-patched .dep-plot-col2::-webkit-scrollbar-thumb{
  background:var(--rel-scroll-thumb); border-radius:62.4375rem;
}
#page-relatorios .relatorios-fd .dep-inner-panel .plot.dep-plot-patched .dep-plot-col2::-webkit-scrollbar-thumb:hover{
  background:var(--rel-scroll-thumb-hover);
}
#page-relatorios .relatorios-fd .dep-inner-panel .plot.dep-plot-patched .dep-plot-x-band{
  min-width:max(100%, calc(var(--dept-cols, 4) * var(--dept-slot-w, 7rem) + (var(--dept-cols, 4) - 1) * var(--dept-col-gap, 1.5rem)));
  display:flex;
  flex-direction:column;
  align-items:stretch;
}
#page-relatorios .relatorios-fd .dep-inner-panel .plot.dep-plot-patched .dep-plot-x-band .gridbars{
  height:var(--dep-plot-bar-h, 33.825rem);
  flex:none;
  overflow:hidden;
}
#page-relatorios .relatorios-fd .dep-inner-panel .plot.dep-plot-patched .dep-plot-x-band .gridbars .bars,
#page-relatorios .relatorios-fd .dep-inner-panel .plot.dep-plot-patched .dep-plot-x-band .gridbars .annot{
  top:var(--dep-plot-pad-y, 1.25rem);
  bottom:var(--dep-plot-pad-bottom, 0);
}
/* Rótulos do eixo X: sempre abaixo da linha base — nunca sobre a pilha. */
#page-relatorios .relatorios-fd .dep-inner-panel .plot.dep-plot-patched .dep-plot-x-band .xrow{
  display:grid;
  grid-template-columns:repeat(var(--dept-cols, 4), minmax(0, 1fr));
  justify-items:stretch;
  column-gap:var(--dept-col-gap, 1.5rem);
  padding:0.875rem 2% 0.625rem;
  align-items:start;
  min-height:3.6em;
  flex:none;
  position:relative;
  z-index:1;
  margin:0;
  top:auto;
  bottom:auto;
  transform:none;
  /* Superfície do painel (adapta Dia/Nublado/Noite) — mascara qualquer residual da pilha. */
  background:var(--surface);
}
#page-relatorios .relatorios-fd .dep-inner-panel .plot.dep-plot-patched .bars{
  display:grid;
  grid-template-columns:repeat(var(--dept-cols, 4), minmax(0, 1fr));
  justify-items:stretch;
  align-items:end;
  column-gap:var(--dept-col-gap, 1.5rem);
  padding:0 2%;
}
#page-relatorios .relatorios-fd .dep-inner-panel .plot.dep-plot-patched .xlab{
  flex:none;
  width:100%;
  max-width:none;
  min-width:0;
  justify-self:stretch;
  text-align:center;
  padding:0 0.25rem;
  box-sizing:border-box;
}
#page-relatorios .relatorios-fd .dep-inner-panel .plot.dep-plot-patched .xlab .xt{
  display:block;
  width:100%;
  text-align:center;
  text-wrap:balance;
  overflow-wrap:break-word;
  line-height:1.25;
}
#page-relatorios .relatorios-fd .dep-inner-panel .plot.dep-plot-patched .xlab:nth-child(even){
  padding-top:1.2em;
}
#page-relatorios .relatorios-fd .dep-inner-panel .plot.plot-dept-scroll .dep-plot-x-band .bars,
#page-relatorios .relatorios-fd .dep-inner-panel .plot.plot-dept-scroll .dep-plot-x-band .xrow{
  grid-template-columns:repeat(var(--dept-cols, 4), var(--dept-slot-w, 4.75rem));
  justify-content:start;
  column-gap:var(--dept-col-gap, 1.25rem);
  padding-left:0.625rem;
  padding-right:0.625rem;
}
#page-relatorios .relatorios-fd .dep-inner-panel .plot.dep-plot-patched .col{
  flex:none;
  width:100%;
  max-width:none;
  min-width:0;
  justify-self:stretch;
}
@media (max-width: 0px) /* ui-scale-freeze: was 1100px */{
  #page-relatorios .relatorios-fd .dep-inner-panel .dep-visao-chart-body{
    grid-template-columns:1fr;
  }
}

/* entrada coreografada */
@keyframes dep-up{ from{ opacity:0; transform:translateY(0.625rem);} to{ opacity:1; transform:none; } }
#page-relatorios .relatorios-fd .dep .danim{ animation:dep-up .5s both cubic-bezier(.22,1,.36,1); }
#page-relatorios .relatorios-fd .dep .danim.settled{ animation:none!important; opacity:1!important; transform:none!important; }
@media (prefers-reduced-motion: reduce){ .dep *{ animation-duration:.001ms!important; transition-duration:.001ms!important; } }

@media (max-width: 0px) /* ui-scale-freeze: was 1180px */{ .dep-exec{ grid-template-columns:repeat(2,1fr); } }
@media (max-width:680px){ .dep-exec{ grid-template-columns:1fr; } }

/* ===== Mapa hierárquico (Categoria › Departamento) ===== */
#page-relatorios .relatorios-fd .dep-treemap{ display:flex; gap:0.625rem; width:100%; min-height:18.75rem; align-items:stretch; }
#page-relatorios .relatorios-fd .dep-tree-empty{ margin:0; padding:1.5rem 0.75rem; text-align:center; font-size:0.8125rem; color:var(--muted); width:100%; }
#page-relatorios .relatorios-fd .tr-col{ min-width:0; display:flex; flex-direction:column; gap:0.5rem; flex:1 1 0; }
#page-relatorios .relatorios-fd .tr-head{ display:flex; align-items:center; gap:0.4375rem; padding:0 0.125rem; min-height:1.375rem; }
#page-relatorios .relatorios-fd .tr-head .tr-dot{ width:0.5625rem; height:0.5625rem; border-radius:50%; flex:none; }
#page-relatorios .relatorios-fd .tr-head .tr-dn{ font-size:0.75rem; font-weight:800; color:var(--ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; flex:1; min-width:0; }
#page-relatorios .relatorios-fd .tr-head .tr-dv{ font-size:0.75rem; font-weight:800; color:var(--muted); margin-left:auto; font-variant-numeric:tabular-nums; flex:none; }
#page-relatorios .relatorios-fd .tr-canvas{ position:relative; flex:1; width:100%; min-height:12.5rem; border-radius:var(--radius-card); overflow:hidden; background:color-mix(in srgb, var(--field) 88%, var(--line)); }
#page-relatorios .relatorios-fd .tr-g{ position:absolute; box-sizing:border-box; border-radius:var(--radius-card); padding:0.625rem 0.6875rem; cursor:pointer; overflow:hidden;
  display:flex; flex-direction:column; justify-content:flex-end; gap:0.125rem; transition:filter .14s, box-shadow .14s; border:0.0625rem solid rgba(255,255,255,.35); }
html[data-theme="cinza"] #page-relatorios .relatorios-fd .tr-g{ border:0.0625rem solid var(--rel-line); }
#page-relatorios .relatorios-fd .tr-g--lite{ background:color-mix(in srgb, var(--tr-cat, var(--p-blue)) 16%, var(--rel-surface)); color:#1a2840; border-color:color-mix(in srgb, var(--tr-cat, var(--p-blue)) 22%, transparent); }
html[data-theme="cinza"] #page-relatorios .relatorios-fd .tr-g--lite{ border-color:var(--rel-line); }
#page-relatorios .relatorios-fd .tr-g--lead{ background:var(--tr-cat, var(--p-blue)); color:#fff; border-color:transparent; box-shadow:inset 0 0.0625rem 0 rgba(255,255,255,.18); }
#page-relatorios .relatorios-fd .tr-g:hover{ filter:brightness(1.04); z-index:2; box-shadow:0 0.25rem 0.875rem rgba(var(--rel-shadow-rgb),.12); }
#page-relatorios .relatorios-fd .tr-gn{ font-size:0.71875rem; font-weight:700; line-height:1.2; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; position:relative; z-index:2; }
#page-relatorios .relatorios-fd .tr-gv{ font-size:1.375rem; font-weight:800; font-variant-numeric:tabular-nums; line-height:1; position:relative; z-index:2; }
#page-relatorios .relatorios-fd .tr-g--lead .tr-gn,
#page-relatorios .relatorios-fd .tr-g--lead .tr-gv{ text-shadow:0 0.0625rem 0.125rem rgba(var(--rel-shadow-pure-rgb),.18); }
#page-relatorios .relatorios-fd .tr-g--lite .tr-gv{ font-size:1.125rem; color:color-mix(in srgb, var(--tr-cat, var(--p-blue)) 72%, #1a2840); }
#page-relatorios .relatorios-fd .dep-tip .tsub{ margin-top:0.375rem; padding-top:0.375rem; border-top:0.0625rem solid rgba(255,255,255,.15); font-size:0.65625rem; font-weight:600; opacity:.92; max-width:17.5rem; white-space:normal; line-height:1.5; }
html[data-theme="cinza"] #page-relatorios .relatorios-fd .dep-tip .tsub{ border-top:0.0625rem solid var(--rel-line); }
#page-relatorios .relatorios-fd .dep-tip .tsub .tsub-lbl{ display:block; font-size:0.5625rem; font-weight:800; letter-spacing:.06em; text-transform:uppercase; opacity:.75; margin-bottom:0.1875rem; }
html[data-theme="dark"] #page-relatorios .relatorios-fd .tr-g--lite,
html[data-theme="cinza"] #page-relatorios .relatorios-fd .tr-g--lite{
  background:color-mix(in srgb, var(--tr-cat, var(--p-blue)) 22%, var(--surface));
  color:var(--ink);
}

/* ===== HEATMAP ===== */
#page-relatorios .relatorios-fd .hm-toggle{ display:inline-flex; gap:0.1875rem; background:var(--field); border:0.0625rem solid var(--line); border-radius:var(--radius-card, 0.25rem); padding:0.1875rem; }
#page-relatorios .relatorios-fd .hm-toggle button{ height:1.75rem; padding:0 0.8125rem; border:0; border-radius:var(--radius-card, 0.25rem); background:none; font-family:inherit; font-size:0.75rem; font-weight:700; color:var(--muted); cursor:pointer; transition:.14s; box-shadow:none; }
#page-relatorios .relatorios-fd .hm-toggle button.on{ background:var(--surface); color:var(--p-blue); box-shadow:none; }
#page-relatorios .relatorios-fd .dep-heat-tools{ display:flex; align-items:center; justify-content:flex-end; margin:0 0 0.625rem; }
#page-relatorios .relatorios-fd .dep-heat-leg{ display:flex; align-items:center; flex-wrap:wrap; gap:0.5rem; font-size:0.6875rem; font-weight:700; color:var(--muted); }
#page-relatorios .relatorios-fd .dep-heat-leg-lbl{ white-space:nowrap; }
#page-relatorios .relatorios-fd .dep-heat-leg .scale{ display:flex; gap:0.1875rem; }
#page-relatorios .relatorios-fd .dep-heat-leg .scale i{ width:1.125rem; height:0.6875rem; border-radius:0.125rem; border:0.0625rem solid rgba(var(--rel-shadow-rgb),.06); }
#page-relatorios .relatorios-fd .dep-heat-meta{ margin:0 0 0.5rem; font-size:0.6875rem; font-weight:700; color:var(--muted); text-align:right; }
#page-relatorios .relatorios-fd .dep-heat{
  --hm-label-w:10.75rem; --hm-col-w:3.5rem; --hm-total-w:3.5rem; --hm-cell-h:3.25rem;
  display:block; overflow:hidden;
}
#page-relatorios .relatorios-fd .dep-heat.dep-heat--has-totals .hm-row{
  grid-template-columns:var(--hm-label-w) repeat(var(--hm-cols, 7), var(--hm-col-w)) var(--hm-total-w);
}
#page-relatorios .relatorios-fd .dep-heat-scroll{
  overflow:auto; max-height:min(58vh, 30rem); padding-bottom:0.25rem;
  -webkit-overflow-scrolling:touch;
  scrollbar-width:thin;
  scrollbar-color:var(--rel-scroll-thumb) transparent;
}
#page-relatorios .relatorios-fd .dep-heat-scroll::-webkit-scrollbar{
  width:0.25rem;
  height:0.25rem;
}
#page-relatorios .relatorios-fd .dep-heat-scroll::-webkit-scrollbar-track{
  background:transparent;
}
#page-relatorios .relatorios-fd .dep-heat-scroll::-webkit-scrollbar-thumb{
  background:var(--rel-scroll-thumb);
  border-radius:62.4375rem;
}
#page-relatorios .relatorios-fd .dep-heat-scroll::-webkit-scrollbar-thumb:hover{
  background:var(--rel-scroll-thumb-hover);
}
#page-relatorios .relatorios-fd .dep-heat-grid{ display:flex; flex-direction:column; gap:0.3125rem; width:max-content; min-width:100%; }
#page-relatorios .relatorios-fd .hm-row{
  display:grid;
  grid-template-columns:var(--hm-label-w) repeat(var(--hm-cols, 7), var(--hm-col-w));
  gap:0.3125rem; align-items:stretch;
}
#page-relatorios .relatorios-fd .hm-head .hm-ch{
  width:var(--hm-col-w); max-width:var(--hm-col-w); box-sizing:border-box;
}
#page-relatorios .relatorios-fd .hm-head .hm-ch-tot{
  width:var(--hm-total-w); max-width:var(--hm-total-w);
}
#page-relatorios .relatorios-fd .hm-head{
  position:sticky; top:0; z-index:5;
  background:var(--surface);
  box-shadow:0 0.0625rem 0 var(--line);
}
#page-relatorios .relatorios-fd .hm-head .hm-ch{ background:var(--surface); }
#page-relatorios .relatorios-fd .hm-corner,
#page-relatorios .relatorios-fd .hm-rh{
  position:sticky; left:0; z-index:4;
  background:var(--surface);
  box-shadow:0.0625rem 0 0 color-mix(in srgb, var(--line) 85%, transparent);
}
#page-relatorios .relatorios-fd .hm-head .hm-corner{ z-index:6; }
#page-relatorios .relatorios-fd .hm-head .hm-ch{
  font-size:0.625rem; font-weight:700; color:var(--rel-ink-muted); line-height:1.2;
  display:flex; align-items:center; justify-content:center; text-align:center;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  padding:0 0.4375rem; min-height:2.25rem; box-sizing:border-box;
}
#page-relatorios .relatorios-fd .hm-rh{ display:flex; align-items:center; gap:0.4375rem; min-width:0; font-size:0.75rem; font-weight:700; color:var(--ink); padding-right:0.375rem; }
#page-relatorios .relatorios-fd .hm-rh .hm-dot{ width:0.5rem; height:0.5rem; border-radius:0.1875rem; flex:none; }
#page-relatorios .relatorios-fd .hm-rh .hm-rn{ min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#page-relatorios .relatorios-fd .hm-head .hm-ch-tot,
#page-relatorios .relatorios-fd .hm-rh-tot{
  justify-content:center; font-size:0.625rem; font-weight:800; color:var(--muted); letter-spacing:.02em;
  text-transform:uppercase;
}
#page-relatorios .relatorios-fd .hm-foot{
  position:sticky; bottom:0; z-index:5;
  background:var(--surface);
  box-shadow:0 -0.0625rem 0 var(--line);
  padding-top:0.3125rem;
  box-sizing:border-box;
}
#page-relatorios .relatorios-fd .hm-foot .hm-rh{ z-index:7; }
#page-relatorios .relatorios-fd .hm-cell.hm-tot{
  width:var(--hm-total-w); max-width:var(--hm-total-w); height:var(--hm-cell-h); min-height:var(--hm-cell-h);
  font-size:0.75rem; font-weight:800;
  background:color-mix(in srgb, var(--field) 55%, var(--surface));
  border:0.0625rem solid color-mix(in srgb, var(--line) 90%, transparent);
  color:var(--rel-ink-3); cursor:default; pointer-events:none;
}
#page-relatorios .relatorios-fd .hm-cell.hm-tot-grand{
  background:color-mix(in srgb, var(--p-blue-bg) 45%, var(--surface));
  color:var(--ink); font-size:0.78125rem;
}
#page-relatorios .relatorios-fd .dep-heat.dep-heat--compact .hm-cell{
  height:var(--hm-cell-h); min-height:var(--hm-cell-h); font-size:0.71875rem;
}
#page-relatorios .relatorios-fd .dep-heat.dep-heat--compact .hm-ch,
#page-relatorios .relatorios-fd .dep-heat.dep-heat--compact .hm-rh{
  font-size:0.65625rem;
}
#page-relatorios .relatorios-fd .hm-cell{
  width:var(--hm-col-w); max-width:var(--hm-col-w); height:var(--hm-cell-h); min-height:var(--hm-cell-h);
  border-radius:0.5625rem; display:flex; align-items:center; justify-content:center; font-size:0.78125rem; font-weight:800;
  color:var(--rel-ink-2); font-variant-numeric:tabular-nums; cursor:pointer; transition:box-shadow .12s; border:0.0625rem solid rgba(var(--rel-shadow-rgb),.04);
  box-sizing:border-box;
}
@media (prefers-reduced-motion: reduce){
  #page-relatorios .relatorios-fd .hm-cell{ transition:none; }
}
#page-relatorios .relatorios-fd .hm-cell.dark{ color:#fff; text-shadow:0 0.0625rem 0.125rem rgba(var(--rel-shadow-pure-rgb),.2); }
#page-relatorios .relatorios-fd .hm-cell:not(.empty):not(.hm-tot):hover{
  z-index:2;
  box-shadow:var(--p-elev-2);
}
#page-relatorios .relatorios-fd #depSecHeatmap .dep-tip.fixed{ transform:translate(-50%,-118%); max-width:min(20rem, 92vw); white-space:normal; }
#page-relatorios .relatorios-fd .hm-cell:not(.empty):not(.hm-tot):focus-visible{
  box-shadow:inset 0 0 0 0.125rem color-mix(in srgb, var(--p-blue) 65%, transparent);
  outline:none; z-index:2;
}
#page-relatorios .relatorios-fd .dep-table .dt-row--heat-focus{}
/* Grid legado (não tabela detalhada): expand departamento */
#page-relatorios .relatorios-fd .dep-table:not(.dep-detail-tablewrap) .dt-row.lvl1.open{
  background:var(--p-blue-bg);
  border-top-color:color-mix(in srgb, var(--p-blue) 12%, var(--line));
}
html[data-theme="cinza"] #page-relatorios .relatorios-fd .dep-table:not(.dep-detail-tablewrap) .dt-row.lvl1.open{ border-top-color:var(--rel-ink-3); }
#page-relatorios .relatorios-fd .dep-table:not(.dep-detail-tablewrap) .dt-row.lvl2:not([hidden]){
  background:color-mix(in srgb, var(--p-blue-bg) 55%, var(--surface));
  border-top-color:color-mix(in srgb, var(--p-blue) 8%, var(--line));
}
html[data-theme="cinza"] #page-relatorios .relatorios-fd .dep-table:not(.dep-detail-tablewrap) .dt-row.lvl2:not([hidden]){ border-top-color:var(--rel-line); }
#page-relatorios .relatorios-fd .dep-table:not(.dep-detail-tablewrap) .dt-row.lvl2:not([hidden]) .dt-name{
  color:color-mix(in srgb, var(--p-blue) 45%, var(--ink));
}
#page-relatorios .relatorios-fd .dep-table:not(.dep-detail-tablewrap) .dt-row.lvl2:not([hidden]) .dt-sub-tick{
  border-color:color-mix(in srgb, var(--p-blue) 40%, transparent);
}
html[data-theme="cinza"] #page-relatorios .relatorios-fd .dep-table:not(.dep-detail-tablewrap) .dt-row.lvl2:not([hidden]) .dt-sub-tick{ border-color:var(--rel-line); }
#page-relatorios .relatorios-fd .hm-cell.empty{ background:color-mix(in srgb, var(--field) 88%, var(--surface)); color:transparent; font-size:0; cursor:default; pointer-events:none; }
#page-relatorios .relatorios-fd .hm-cell.empty:hover{ transform:none; box-shadow:none; outline:none; }
html[data-theme="dark"] #page-relatorios .relatorios-fd .hm-cell{ color:#dce6f5; }
html[data-theme="cinza"] #page-relatorios .relatorios-fd .hm-cell{ color:#14181d; }
html[data-theme="dark"] #page-relatorios .relatorios-fd .hm-head,
html[data-theme="dark"] #page-relatorios .relatorios-fd .hm-head .hm-ch,
html[data-theme="dark"] #page-relatorios .relatorios-fd .hm-corner,
html[data-theme="dark"] #page-relatorios .relatorios-fd .hm-rh{
  background:var(--surface);
}
html[data-theme="cinza"] #page-relatorios .relatorios-fd .hm-head,html[data-theme="cinza"] #page-relatorios .relatorios-fd .hm-head .hm-ch,html[data-theme="cinza"] #page-relatorios .relatorios-fd .hm-corner,html[data-theme="cinza"] #page-relatorios .relatorios-fd .hm-rh{
  background:var(--surface);
}

/* ===== TENDÊNCIA TEMPORAL ===== */
#page-relatorios .relatorios-fd .trend-legend{ display:flex; flex-wrap:wrap; gap:0.875rem; margin-bottom:0.875rem; }
#page-relatorios .relatorios-fd .trend-legend .tlg{ display:inline-flex; align-items:center; gap:0.4375rem; font-size:0.75rem; font-weight:700; color:var(--rel-ink-3); }
#page-relatorios .relatorios-fd .trend-legend .tlg .sw{ width:0.875rem; height:0.1875rem; border-radius:0.125rem; }
#page-relatorios .relatorios-fd .dep-trend{ position:relative; }
#page-relatorios .relatorios-fd .dep-trend svg{ width:100%; display:block; overflow:visible; }
#page-relatorios .relatorios-fd .dep-trend .gl{ stroke:var(--line); stroke-width:1; }
#page-relatorios .relatorios-fd .dep-trend .axlab{ font-size:0.6875rem; font-weight:600; fill:var(--rel-ink-muted); }
#page-relatorios .relatorios-fd .dep-trend .txl{ font-size:0.6875rem; font-weight:600; fill:var(--rel-icon-muted); }
#page-relatorios .relatorios-fd .dep-trend .tl{ fill:none; stroke-width:2.6; stroke-linejoin:round; stroke-linecap:round; }
#page-relatorios .relatorios-fd .dep-trend .tguide{ stroke:var(--p-blue); stroke-width:1.2; stroke-dasharray:4 4; opacity:.5; }
#page-relatorios .relatorios-fd .dep-trend .hit{ fill:transparent; cursor:crosshair; }
#page-relatorios .relatorios-fd .dep-tip .r .d{ width:0.5625rem; height:0.5625rem; border-radius:0.1875rem; display:inline-block; margin-right:0.375rem; vertical-align:middle; }
#page-relatorios .relatorios-fd .dep-tip .r span{ display:inline-flex; align-items:center; }

/* ===== MATRIZ DE RISCO ===== */
#page-relatorios .relatorios-fd .dep-risk{ position:relative; }
#page-relatorios .relatorios-fd .dep-risk svg{ width:100%; display:block; overflow:visible; }
#page-relatorios .relatorios-fd .dep-risk .quad{ opacity:.5; }
#page-relatorios .relatorios-fd .dep-risk .quad.q-bad{ fill:var(--p-bad-bg); } #page-relatorios .relatorios-fd .dep-risk .quad.q-warn{ fill:var(--p-warn-bg); } #page-relatorios .relatorios-fd .dep-risk .quad.q-ok{ fill:var(--p-ok-bg); }
#page-relatorios .relatorios-fd .dep-risk .qlabel{ font-size:0.625rem; font-weight:800; letter-spacing:.03em; text-transform:uppercase; fill:var(--rel-ink-muted); }
#page-relatorios .relatorios-fd .dep-risk .axline{ stroke:var(--line); stroke-width:1.4; }
#page-relatorios .relatorios-fd .dep-risk .axtick{ font-size:0.625rem; font-weight:600; fill:var(--rel-ink-muted); }
#page-relatorios .relatorios-fd .dep-risk .axtitle{ font-size:0.6875rem; font-weight:800; fill:var(--rel-ink-faint); }
#page-relatorios .relatorios-fd .dep-risk .bub{ cursor:pointer; }
#page-relatorios .relatorios-fd .dep-risk .bub circle{ stroke:var(--surface); stroke-width:2; transition:.14s; }
#page-relatorios .relatorios-fd .dep-risk .bub:hover circle{ filter:brightness(1.08); }
#page-relatorios .relatorios-fd .dep-risk .bub text{ font-size:0.6875rem; font-weight:800; fill:#fff; text-anchor:middle; pointer-events:none; }
#page-relatorios .relatorios-fd .dep-tip.fixed{ position:fixed; transform:translate(-50%,-118%); }

/* ===== TABELA DETALHADA (hierárquica) ===== */
#page-relatorios .relatorios-fd .dep-detail-tablewrap{
  --dep-detail-row-h:2.75rem;
  --dep-detail-thead-h:var(--fd-list-thead-h, 3.125rem);
  --dep-detail-foot-h:var(--fd-list-pager-h, 3.125rem);
  --dep-detail-visible:15;
  --dep-detail-body-h:calc(var(--dep-detail-row-h) * var(--dep-detail-visible));
  --dep-detail-visible-h:calc(
    var(--dep-detail-thead-h)
    + var(--dep-detail-body-h)
    + var(--dep-detail-foot-h)
  );
  /* Paridade Lista de tickets: mesma faixa de cabeçalho/rodapé */
  --tk-thead-grad:var(--fd-list-thead-grad, linear-gradient(145deg, #163f9a 0%, #1a4db8 30%, #2f6fe0 64%, #5aa0ff 100%));
  --tk-thead-edge:var(--fd-list-thead-edge, inset 0 0.0625rem 0 rgba(255,255,255,.34), inset 0 -0.0625rem 0 rgba(8,32,90,.16));
  /* Hierarquia expand: categoria → departamento → incidente (sem seleção = branco) */
  --dep-hier-cat:color-mix(in srgb, #9eb4cf 26%, var(--surface));
  --dep-hier-dept:color-mix(in srgb, #9eb4cf 12%, var(--surface));
  --dep-hier-inc:color-mix(in srgb, #9eb4cf 5%, var(--surface));
  --dep-hier-line:color-mix(in srgb, var(--p-blue) 72%, var(--line));
  border:0.0625rem solid var(--line);
  border-left:0.0625rem solid var(--line);
  border-radius:var(--radius-card);
  box-shadow:none;
  background:var(--surface);
  isolation:isolate;
  /* Scroll só no tbody — cabeçalho/rodapé fixos (paridade tickets). */
  overflow:hidden;
  display:flex;
  flex-direction:column;
  min-height:var(--dep-detail-visible-h);
  max-height:var(--dep-detail-visible-h);
  height:var(--dep-detail-visible-h);
  position:relative;
  scrollbar-gutter:auto;
}
#page-relatorios .relatorios-fd .dep-detail-tablewrap.tk-tablewrap{
  overflow:hidden;
  scrollbar-gutter:auto;
}
#page-relatorios .relatorios-fd .dep-detail-tablewrap:hover{
  box-shadow:none;
}
/* Cabeçalho = thead com o mesmo degradê da Lista de tickets (sem ::before). */
#page-relatorios .relatorios-fd .dep-detail-tablewrap.tk-tablewrap::before,
#page-relatorios .relatorios-fd .dep-detail-tablewrap::before{
  content:none !important;
  display:none !important;
  height:0 !important;
  margin:0 !important;
}
/* Rodapé azul — mesma faixa da paginação da Lista de tickets */
#page-relatorios .relatorios-fd .dep-detail-tablewrap.tk-tablewrap::after,
#page-relatorios .relatorios-fd .dep-detail-tablewrap::after{
  content:"" !important;
  display:block !important;
  position:static;
  flex:none;
  width:100%;
  height:var(--dep-detail-foot-h);
  min-height:var(--dep-detail-foot-h);
  max-height:var(--dep-detail-foot-h);
  margin:0;
  box-sizing:border-box;
  pointer-events:none;
  background:var(--tk-thead-grad);
  box-shadow:var(--tk-thead-edge);
  border-radius:0 0 var(--radius-card, 0.25rem) var(--radius-card, 0.25rem);
}
#page-relatorios .relatorios-fd .dep-detail-tablewrap.tk-tablewrap::-webkit-scrollbar,
#page-relatorios .relatorios-fd .dep-detail-tablewrap::-webkit-scrollbar{
  width:0;
  height:0;
}
#page-relatorios .relatorios-fd .dep-detail-table{
  width:100%;
  min-width:0 !important;
  height:auto;
  min-height:0;
  flex:1 1 auto;
  border-collapse:separate;
  border-spacing:0;
  font-size:0.8125rem;
  table-layout:fixed;
  display:flex;
  flex-direction:column;
}
#page-relatorios .relatorios-fd .dep-detail-table thead{
  position:static;
  z-index:4;
  flex:0 0 auto;
  display:block;
  width:100%;
  background:var(--tk-thead-grad);
  box-shadow:var(--tk-thead-edge);
}
#page-relatorios .relatorios-fd .dep-detail-table thead tr.dep-detail-colrow{
  display:table;
  width:100%;
  table-layout:fixed;
  background:transparent;
}
#page-relatorios .relatorios-fd .dep-detail-table thead th{
  background:transparent;
  color:#fff;
  position:static;
  z-index:4;
  height:var(--dep-detail-thead-h);
  max-height:var(--dep-detail-thead-h);
  padding:0 0.5rem;
  line-height:1.2;
  font-size:0.75rem;
  font-weight:700;
  vertical-align:middle;
  white-space:nowrap;
  border-right:0;
  border-bottom:0;
  box-sizing:border-box;
  text-shadow:0 0.0625rem 0 rgba(var(--rel-shadow-deep-rgb, 8, 32, 90), .18);
}
html[data-theme="cinza"] #page-relatorios .relatorios-fd .dep-detail-table thead th{ border-right:0; }
#page-relatorios .relatorios-fd .dep-detail-table thead th:first-child{
  border-radius:var(--radius-card) 0 0 0;
}
#page-relatorios .relatorios-fd .dep-detail-table thead th:last-child{
  border-radius:0 var(--radius-card) 0 0;
  border-right:0;
}
#page-relatorios .relatorios-fd .dep-detail-table thead th.sorted{
  background:transparent;
}
#page-relatorios .relatorios-fd .dep-detail-table thead th.sorted::after{
  content:"▲";
  font-size:0.5625rem;
  margin-left:0.3125rem;
  display:inline-block;
  vertical-align:middle;
  opacity:1;
  color:#fff;
  text-shadow:
    0 0 0.3125rem rgba(255, 255, 255, 1),
    0 0 0.75rem rgba(255, 255, 255, 0.85),
    0 0 1.125rem rgba(190, 216, 229, 0.95);
}
#page-relatorios .relatorios-fd .dep-detail-table thead th.sorted.desc::after{
  content:"▼";
}
#page-relatorios .relatorios-fd .dep-detail-table thead th:hover{
  background:rgba(var(--rel-surface-rgb),.10);
}
html[data-theme="cinza"] #page-relatorios .relatorios-fd .dep-detail-table thead th.sorted{
  background:transparent;
  color:#fff;
}
#page-relatorios .relatorios-fd .dep-detail-table thead th.dep-th-hierarchy{
  text-align:left;
  padding-left:0.75rem;
  width:38%;
}
#page-relatorios .relatorios-fd .dep-detail-table thead th:not(.dep-th-hierarchy){
  text-align:center;
  padding-left:0.5rem;
  padding-right:0.5rem;
}
#page-relatorios .relatorios-fd .dep-detail-table thead th.dep-th-draggable{
  cursor:grab;
}
#page-relatorios .relatorios-fd .dep-detail-table thead th.dep-th-dragging{
  opacity:.82;
  cursor:grabbing;
}
/* Corpo: única área com scroll; barra só ao exceder as 15 linhas visíveis. */
#page-relatorios .relatorios-fd .dep-detail-table tbody{
  display:block;
  flex:1 1 auto;
  width:100%;
  min-height:0;
  height:var(--dep-detail-body-h);
  max-height:var(--dep-detail-body-h);
  overflow-x:hidden;
  overflow-y:auto;
  scrollbar-gutter:auto;
  scrollbar-width:thin;
  scrollbar-color:var(--rel-scroll-thumb, rgba(10,120,240,.28)) transparent;
}
#page-relatorios .relatorios-fd .dep-detail-table tbody::-webkit-scrollbar{ width:0.25rem; }
#page-relatorios .relatorios-fd .dep-detail-table tbody::-webkit-scrollbar-track{ background:transparent; }
#page-relatorios .relatorios-fd .dep-detail-table tbody::-webkit-scrollbar-thumb{
  background:var(--rel-scroll-thumb, rgba(10,120,240,.28));
  border-radius:62.4375rem;
}
#page-relatorios .relatorios-fd .dep-detail-table tbody::-webkit-scrollbar-thumb:hover{
  background:var(--rel-scroll-thumb-hover, rgba(10,120,240,.42));
}
#page-relatorios .relatorios-fd .dep-detail-table tbody tr.dt-row,
#page-relatorios .relatorios-fd .dep-detail-table tbody tr.dep-detail-empty-row{
  display:table;
  width:100%;
  table-layout:fixed;
}
#page-relatorios .relatorios-fd .dep-detail-table tbody tr.dt-row[hidden]{
  display:none !important;
}
#page-relatorios .relatorios-fd .dep-detail-table tbody tr.dt-row[data-toggle]{
  cursor:pointer;
}
#page-relatorios .relatorios-fd .dep-detail-table tbody tr.dt-row[data-toggle]:hover td{
  background:color-mix(in srgb, var(--field) 65%, var(--surface));
}
#page-relatorios .relatorios-fd .dep-detail-table tbody tr.dt-row[data-toggle] .dt-exp{
  pointer-events:none;
}
#page-relatorios .relatorios-fd .dep-detail-table tbody td{
  border-bottom:0.0625rem solid var(--line);
  vertical-align:middle;
  box-sizing:border-box;
  height:var(--dep-detail-row-h);
  max-height:var(--dep-detail-row-h);
  padding:0 0.5rem;
}
#page-relatorios .relatorios-fd .dep-detail-table tbody td.dt-name{
  /* Vence o .dt-name{display:flex} genérico: td flex vira célula anônima, desalinha as colunas e deixa faixa branca. */
  display:table-cell;
  text-align:left;
  padding-left:0.75rem;
  width:38%;
  max-width:38%;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  position:relative;
  z-index:0;
  background:inherit;
  box-shadow:none;
  /* Neutraliza sticky/sombra global de .tk-table (acompanhamento.css). */
  left:auto !important;
}
#page-relatorios .relatorios-fd .dep-detail-table tbody td.dt-name .dt-exp{
  display:inline-flex;
  vertical-align:middle;
  margin-right:0.5625rem;
}
#page-relatorios .relatorios-fd .dep-detail-table tbody td.dt-name .dt-sub-tick{
  display:inline-block;
  vertical-align:middle;
  margin-right:0.5rem;
}
#page-relatorios .relatorios-fd .dep-detail-table tbody tr.dt-row.lvl1 td.dt-name{
  padding-left:1.5rem;
}
#page-relatorios .relatorios-fd .dep-detail-table tbody tr.dt-row.lvl2 td.dt-name{
  padding-left:2.75rem;
}
#page-relatorios .relatorios-fd .dep-detail-table tbody td.dt-name .dt-dot{
  vertical-align:middle;
  margin-right:0.5625rem;
  width:0.5625rem;
  height:0.5625rem;
  min-width:0.5625rem;
  min-height:0.5625rem;
  max-width:0.5625rem;
  max-height:0.5625rem;
  border-radius:0.1875rem;
  flex:none;
  display:inline-block;
  box-sizing:border-box;
}
#page-relatorios .relatorios-fd .dep-detail-table tbody td.dt-name b{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  font-weight:800;
  background:transparent;
  box-shadow:none;
}
#page-relatorios .relatorios-fd .dep-detail-table tbody td.dt-c{
  text-align:center;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
#page-relatorios .relatorios-fd .dep-detail-table tbody td.dt-c .dt-pill{
  margin-left:auto;
  margin-right:auto;
}
#page-relatorios .relatorios-fd .dep-detail-table tbody tr.dep-detail-empty-row{
  cursor:default;
}
#page-relatorios .relatorios-fd .dep-detail-table tbody tr.dep-detail-empty-row:hover td{
  background:transparent !important;
}
#page-relatorios .relatorios-fd .dep-table:not(.dep-detail-tablewrap){ display:block; }
#page-relatorios .relatorios-fd .dep-detail-tablewrap.dep-table{
  display:flex;
  flex-direction:column;
}
#page-relatorios .relatorios-fd .dt-row{
  display:grid;
  grid-template-columns:minmax(13.75rem,2.2fr) repeat(5,minmax(4.5rem,1fr));
  gap:0.75rem;
  align-items:center;
  padding:0.625rem 0.5rem;
  border-top:0.0625rem solid var(--line);
}
#page-relatorios .relatorios-fd .dep-detail-table .dt-row,
#page-relatorios .relatorios-fd .dep-detail-table tbody tr.dt-row{
  /* table (não table-row): tbody é block com scroll; cada tr vira tabela de largura total. */
  display:table !important;
  width:100%;
  table-layout:fixed;
  padding:0;
  border-top:0;
  gap:0;
  grid-template-columns:none;
}
/* O estado recolhido precisa vencer o display:table acima. */
#page-relatorios .relatorios-fd .dep-detail-table tbody tr.dt-row[hidden]{
  display:none !important;
}
#page-relatorios .relatorios-fd .dt-row.dt-head{ border-top:0; padding:0.25rem 0.5rem 0.625rem; }
#page-relatorios .relatorios-fd .dt-row.dt-head .dt-name, #page-relatorios .relatorios-fd .dt-row.dt-head .dt-c{ font-size:0.65625rem; font-weight:800; letter-spacing:.05em; text-transform:uppercase; color:var(--rel-ink-muted); }
#page-relatorios .relatorios-fd .dt-name{ display:flex; align-items:center; gap:0.5625rem; min-width:0; font-size:0.8125rem; color:var(--ink); }
#page-relatorios .relatorios-fd .dt-name b{ font-weight:800; }
#page-relatorios .relatorios-fd .dt-c{ font-size:0.8125rem; font-weight:700; color:var(--rel-ink-3); text-align:right; font-variant-numeric:tabular-nums; }
#page-relatorios .relatorios-fd .dt-c.num{ color:var(--ink); font-weight:800; }
#page-relatorios .relatorios-fd .dt-exp{ width:1.375rem; height:1.375rem; border-radius:0.375rem; border:0.0625rem solid var(--line); background:var(--surface); color:var(--rel-icon-muted); display:flex; align-items:center; justify-content:center; cursor:pointer; flex:none; transition:.14s; }
#page-relatorios .relatorios-fd .dt-exp svg{ width:0.8125rem; height:0.8125rem; transition:transform .2s; }
#page-relatorios .relatorios-fd .dt-row.open > .dt-name .dt-exp{ color:var(--p-blue); border-color:rgba(var(--rel-accent-rgb),.35); }
html[data-theme="cinza"] #page-relatorios .relatorios-fd .dt-row.open > .dt-name .dt-exp{ border-color:var(--rel-ink-3); }
#page-relatorios .relatorios-fd .dt-row.open > .dt-name .dt-exp svg{ transform:rotate(90deg); }
#page-relatorios .relatorios-fd .dep-table:not(.dep-detail-tablewrap) .dt-row.lvl1.open > .dt-name .dt-exp{
  color:var(--p-blue);
  border-color:rgba(var(--rel-accent-rgb),.35);
}
html[data-theme="cinza"] #page-relatorios .relatorios-fd .dep-table:not(.dep-detail-tablewrap) .dt-row.lvl1.open > .dt-name .dt-exp{ border-color:var(--rel-ink-3); }
#page-relatorios .relatorios-fd .dep-table:not(.dep-detail-tablewrap) .dt-row.lvl2:not([hidden]) .dt-c{
  color:color-mix(in srgb, var(--p-blue) 55%, var(--ink));
}
#page-relatorios .relatorios-fd .dt-dot{ width:0.5625rem; height:0.5625rem; border-radius:0.1875rem; flex:none; }
#page-relatorios .relatorios-fd .dep-detail-table tbody tr.dt-row.lvl0 td{
  background:var(--surface);
}
#page-relatorios .relatorios-fd .dep-detail-table tbody tr.dt-row.lvl0 td.dt-name{
  background:var(--surface);
}
#page-relatorios .relatorios-fd .dep-detail-table tbody tr.dt-row.lvl0.open td{
  background:var(--dep-hier-cat);
}
#page-relatorios .relatorios-fd .dep-detail-table tbody tr.dt-row.lvl0.open td.dt-name{
  background:var(--dep-hier-cat);
}
#page-relatorios .relatorios-fd .dep-detail-table tbody tr.dt-row.lvl1 td{
  background:var(--dep-hier-dept);
}
#page-relatorios .relatorios-fd .dep-detail-table tbody tr.dt-row.lvl1 td.dt-name{
  background:var(--dep-hier-dept);
}
#page-relatorios .relatorios-fd .dep-detail-table tbody tr.dt-row.lvl1.open td{
  background:color-mix(in srgb, var(--dep-hier-cat) 35%, var(--dep-hier-dept));
}
#page-relatorios .relatorios-fd .dep-detail-table tbody tr.dt-row.lvl1.open td.dt-name{
  background:color-mix(in srgb, var(--dep-hier-cat) 35%, var(--dep-hier-dept));
}
#page-relatorios .relatorios-fd .dep-detail-table tbody tr.dt-row.lvl2 td{
  background:var(--dep-hier-inc);
}
#page-relatorios .relatorios-fd .dep-detail-table tbody tr.dt-row.lvl2 td.dt-name{
  background:var(--dep-hier-inc);
}
#page-relatorios .relatorios-fd .dt-row.lvl0{ background:var(--surface); }
#page-relatorios .relatorios-fd .dt-row.lvl1 .dt-name{ padding-left:0.875rem; font-size:0.78125rem; color:var(--rel-ink-2); }
#page-relatorios .relatorios-fd .dt-row.lvl1{ background:var(--field); }
#page-relatorios .relatorios-fd .dt-row.lvl2 .dt-name{ padding-left:3.25rem; font-size:0.75rem; color:var(--muted); }
#page-relatorios .relatorios-fd .dt-row.lvl2{ background:var(--surface); }
#page-relatorios .relatorios-fd .dep-detail-table tbody tr.dt-row.lvl0.open .dt-name,
#page-relatorios .relatorios-fd .dep-detail-table tbody tr.dt-row.lvl0.open .dt-c,
#page-relatorios .relatorios-fd .dep-detail-table tbody tr.dt-row.lvl1 .dt-c,
#page-relatorios .relatorios-fd .dep-detail-table tbody tr.dt-row.lvl2 .dt-c{
  color:var(--rel-ink-3);
}
#page-relatorios .relatorios-fd .dep-detail-table tbody tr.dt-row.lvl0.open .dt-c.num,
#page-relatorios .relatorios-fd .dep-detail-table tbody tr.dt-row.lvl1 .dt-c.num,
#page-relatorios .relatorios-fd .dep-detail-table tbody tr.dt-row.lvl2 .dt-c.num{
  color:var(--ink);
}
#page-relatorios .relatorios-fd .dt-sub-tick{
  width:0.75rem;
  height:0.6875rem;
  border-left:0.125rem solid var(--dep-hier-line, var(--p-blue));
  border-bottom:0.125rem solid var(--dep-hier-line, var(--p-blue));
  border-bottom-left-radius:0.1875rem;
  flex:none;
  margin-right:0.25rem;
  opacity:1;
}
#page-relatorios .relatorios-fd .dep-detail-table.tk-table tbody tr.dt-row{
  background:transparent !important;
  box-shadow:none !important;
}
#page-relatorios .relatorios-fd .dep-detail-table.tk-table tbody tr.dt-row:hover{
  background:transparent !important;
  box-shadow:none !important;
}
/* Mata hover claro global de .tk-table (acompanhamento.css) e sticky fantasma na 1ª coluna. */
#page-relatorios .relatorios-fd .dep-detail-table.tk-table tbody tr.dt-row:hover td:first-child{
  box-shadow:none !important;
  position:static !important;
  left:auto !important;
}
#page-relatorios .relatorios-fd .dep-detail-table tbody tr.dt-row[data-toggle]:hover td{
  background:color-mix(in srgb, var(--field) 65%, var(--surface));
}
#page-relatorios .relatorios-fd .dep-detail-table tbody tr.dt-row.lvl0.open[data-toggle]:hover td{
  background:color-mix(in srgb, var(--field) 40%, var(--dep-hier-cat));
}
#page-relatorios .relatorios-fd .dep-detail-table tbody tr.dt-row.lvl1[data-toggle]:hover td{
  background:color-mix(in srgb, var(--field) 40%, var(--dep-hier-dept));
}
#page-relatorios .relatorios-fd .dep-detail-table tbody tr.dt-row.lvl1.open[data-toggle]:hover td{
  background:color-mix(in srgb, var(--field) 35%, color-mix(in srgb, var(--dep-hier-cat) 35%, var(--dep-hier-dept)));
}
#page-relatorios .relatorios-fd .dep-detail-table tbody tr.dt-row.lvl2:not([hidden]) .dt-name{
  color:var(--rel-ink-2);
}
#page-relatorios .relatorios-fd .dt-pill{ display:inline-flex; padding:0.125rem 0.5625rem; border-radius:62.4375rem; font-size:0.71875rem; font-weight:800; font-variant-numeric:tabular-nums; }
#page-relatorios .relatorios-fd .dt-pill.ok{ background:var(--p-ok-bg); color:var(--p-ok); } #page-relatorios .relatorios-fd .dt-pill.warn{ background:var(--p-warn-bg); color:var(--p-warn); } #page-relatorios .relatorios-fd .dt-pill.bad{ background:var(--p-bad-bg); color:var(--p-bad); }
#page-relatorios .relatorios-fd .dt-pill.na{ background:color-mix(in srgb, var(--field) 92%, var(--muted)); color:var(--muted); font-weight:700; font-size:0.6875rem; letter-spacing:.01em; }
#page-relatorios .relatorios-fd .hm-cell-na{ font-size:0.625rem; font-weight:700; color:var(--muted); background:color-mix(in srgb, var(--field) 90%, var(--line)); justify-content:center; text-align:center; line-height:1.15; padding:0.25rem 0.125rem; }
#page-relatorios .relatorios-fd .dt-d{ font-size:0.75rem; font-weight:800; font-variant-numeric:tabular-nums; }
#page-relatorios .relatorios-fd .dt-d.up{ color:var(--p-bad); } #page-relatorios .relatorios-fd .dt-d.down{ color:var(--p-ok); } #page-relatorios .relatorios-fd .dt-d.flat{ color:var(--rel-ink-muted); }
@media (max-width:860px){
  #page-relatorios .relatorios-fd .dep-table:not(.dep-detail-tablewrap) .dt-row{
    grid-template-columns:minmax(8.75rem,1.6fr) repeat(3,1fr);
  }
  #page-relatorios .relatorios-fd .dep-table:not(.dep-detail-tablewrap) .dt-row .dt-c:nth-child(5),
  #page-relatorios .relatorios-fd .dep-table:not(.dep-detail-tablewrap) .dt-row .dt-c:nth-child(6){
    display:none;
  }
}

/* Sprint 2 — exec-cards: reduz padding em telas comprimidas */
@media (max-width: 0px) /* ui-scale-freeze: was 1400px */{
  #page-relatorios .relatorios-fd .dx-card{ padding:0.6875rem 0.8125rem; }
}

/* Sprint 2 — treemap compact: bloco pequeno exibe só o número */
#page-relatorios .relatorios-fd .tr-g--compact .tr-gn{ display:none; }
#page-relatorios .relatorios-fd .tr-g--compact .tr-gv{ font-size:0.6875rem; font-weight:800; }

/* Sprint 5 — distribuição executiva: leitura sem reticências */
#page-relatorios .relatorios-fd .dep-treemap{
  display:block;
  width:100%;
  min-height:33.75rem;
  align-items:stretch;
}
#page-relatorios .relatorios-fd .dep-dist-shell{
  display:block;
  width:100%;
}
#page-relatorios .relatorios-fd .dep-dist-shell--full .dep-dist-main{
  width:100%;
}
#page-relatorios .relatorios-fd .dep-dist-main{
  display:flex;
  flex-direction:column;
  gap:1rem;
  min-width:0;
}
#page-relatorios .relatorios-fd .dep-dist-metrics--bar{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:0.75rem;
}
#page-relatorios .relatorios-fd .dep-dist-nav{
  display:flex;
  flex-wrap:wrap;
  gap:0.5rem;
  padding:0.125rem 0 0.25rem;
  border-bottom:0.0625rem solid var(--line);
}
#page-relatorios .relatorios-fd .dep-dist-nav-btn{
  display:inline-flex;
  flex-direction:column;
  align-items:flex-start;
  gap:0.125rem;
  max-width:min(100%,13.75rem);
  padding:0.5rem 0.75rem;
  border:0.0625rem solid var(--line);
  border-radius:0.625rem;
  background:var(--surface);
  cursor:pointer;
  font:inherit;
  text-align:left;
  transition:border-color .15s, box-shadow .15s, background .15s;
}
#page-relatorios .relatorios-fd .dep-dist-nav-btn:hover{
  border-color:color-mix(in srgb, var(--p-blue) 40%, var(--line));
}
html[data-theme="cinza"] #page-relatorios .relatorios-fd .dep-dist-nav-btn:hover{ border-color:var(--rel-ink-3); }
#page-relatorios .relatorios-fd .dep-dist-nav-btn.on{
  border-color:var(--p-blue);
  background:color-mix(in srgb, var(--p-blue-bg) 55%, var(--surface));
  box-shadow:0 0 0 0.0625rem color-mix(in srgb, var(--p-blue) 25%, transparent);
}
html[data-theme="cinza"] #page-relatorios .relatorios-fd .dep-dist-nav-btn.on{ border-color:var(--rel-ink-3); }
#page-relatorios .relatorios-fd .dep-dist-nav-lbl{
  font-size:0.78125rem;
  font-weight:800;
  color:var(--ink);
  line-height:1.2;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  max-width:100%;
}
#page-relatorios .relatorios-fd .dep-dist-nav-meta{
  font-size:0.65625rem;
  font-weight:600;
  color:var(--muted);
  line-height:1.2;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  max-width:100%;
}
#page-relatorios .relatorios-fd .dep-dist-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:1rem;
  align-items:stretch;
}
#page-relatorios .relatorios-fd .dep-cat-card{
  display:flex;
  flex-direction:column;
  min-height:calc(7.5rem + var(--cat-vol, 0.5) * 17.5rem);
  border:0.0625rem solid var(--line);
  border-radius:var(--radius-card);
  background:var(--surface);
  box-shadow:var(--p-elev-1,0 0.0625rem 0.125rem rgba(13,27,52,.06));
  overflow:hidden;
  transition:box-shadow .2s, border-color .2s;
}
#page-relatorios .relatorios-fd .dep-cat-card--focus{
  border-color:color-mix(in srgb, var(--p-blue) 45%, var(--line));
  box-shadow:0 0.5rem 1.5rem -0.75rem rgba(var(--rel-ink-rgb),.22);
}
html[data-theme="cinza"] #page-relatorios .relatorios-fd .dep-cat-card--focus{ border-color:var(--rel-line); }
#page-relatorios .relatorios-fd .dep-cat-card-head{
  display:flex;
  align-items:center;
  gap:0.625rem;
  padding:0.75rem 0.875rem;
  border-bottom:0.0625rem solid var(--line);
  background:color-mix(in srgb, var(--field) 40%, var(--surface));
}
#page-relatorios .relatorios-fd .dep-cat-dot{
  width:0.625rem;
  height:0.625rem;
  border-radius:0.1875rem;
  flex:none;
}
#page-relatorios .relatorios-fd .dep-cat-title{
  flex:1;
  margin:0;
  font-size:0.875rem;
  font-weight:800;
  line-height:1.2;
  color:var(--ink);
  overflow-wrap:anywhere;
}
#page-relatorios .relatorios-fd .dep-cat-total{
  flex:none;
  font-size:1.125rem;
  font-weight:800;
  font-variant-numeric:tabular-nums;
  color:var(--ink);
}
#page-relatorios .relatorios-fd .dep-cat-total small{
  font-size:0.6875rem;
  font-weight:700;
  color:var(--muted);
  margin-left:0.25rem;
}
#page-relatorios .relatorios-fd .dep-cat-card-body{
  flex:1;
  display:flex;
  flex-direction:column;
  gap:0.625rem;
  padding:0.75rem;
  min-height:0;
}
#page-relatorios .relatorios-fd .dep-dept-child{
  display:flex;
  flex-direction:column;
  flex:calc(0.35 + var(--dept-vol, 0.5) * 1.2) 1 0;
  min-height:calc(3.5rem + var(--dept-vol, 0.5) * 4.5rem);
  border:0.0625rem solid var(--line);
  border-radius:0.625rem;
  background:var(--surface);
  overflow:hidden;
  transition:border-color .15s, box-shadow .15s;
}
#page-relatorios .relatorios-fd .dep-dept-child--focus{
  border-color:var(--p-blue);
  box-shadow:0 0 0 0.125rem color-mix(in srgb, var(--p-blue) 22%, transparent);
}
html[data-theme="cinza"] #page-relatorios .relatorios-fd .dep-dept-child--focus{ border-color:var(--rel-line); }
#page-relatorios .relatorios-fd .dep-dept-child-head{
  display:grid;
  grid-template-columns:1fr auto;
  gap:0.25rem 0.625rem;
  align-items:start;
  padding:0.5rem 0.625rem;
  border-bottom:0.0625rem solid color-mix(in srgb, var(--line) 80%, transparent);
  background:color-mix(in srgb, var(--field) 55%, var(--surface));
}
#page-relatorios .relatorios-fd .dep-dept-child-head b{
  font-size:0.78125rem;
  font-weight:800;
  color:var(--ink);
  line-height:1.2;
  overflow-wrap:anywhere;
}
#page-relatorios .relatorios-fd .dep-dept-child-meta{
  grid-column:1;
  font-size:0.65625rem;
  font-weight:600;
  color:var(--muted);
}
#page-relatorios .relatorios-fd .dep-dept-child-v{
  grid-column:2;
  grid-row:1 / span 2;
  font-size:0.9375rem;
  font-weight:800;
  font-variant-numeric:tabular-nums;
  text-align:right;
  color:var(--ink);
}
#page-relatorios .relatorios-fd .dep-dept-child-v small{
  display:block;
  font-size:0.625rem;
  font-weight:700;
  color:var(--muted);
}
#page-relatorios .relatorios-fd .dep-dept-inc-grid{
  flex:1;
  display:flex;
  flex-wrap:wrap;
  align-content:flex-start;
  gap:0.375rem;
  padding:0.5rem;
  min-height:2.5rem;
}
#page-relatorios .relatorios-fd .dep-inc-child{
  flex:calc(var(--inc-flex, 1) * 1) 1 7.5rem;
  min-width:min(100%,7.5rem);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:0.5rem;
  padding:0.375rem 0.5rem;
  border-radius:0.5rem;
  background:color-mix(in srgb, var(--p-blue-bg) 35%, var(--surface));
  border:0.0625rem solid color-mix(in srgb, var(--line) 90%, transparent);
  font-size:0.6875rem;
}
#page-relatorios .relatorios-fd .dep-inc-child--empty{
  flex:1 1 100%;
  justify-content:center;
  color:var(--muted);
  font-weight:600;
  background:var(--field);
}
#page-relatorios .relatorios-fd .dep-inc-child-name{
  font-weight:700;
  color:var(--ink);
  line-height:1.2;
  overflow-wrap:anywhere;
}
#page-relatorios .relatorios-fd .dep-inc-child-v{
  font-weight:800;
  font-variant-numeric:tabular-nums;
  color:var(--p-blue);
  flex:none;
}
#page-relatorios .relatorios-fd .dep-dist-main-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:0.875rem;
  min-height:3rem;
  padding:0 0.125rem;
}
#page-relatorios .relatorios-fd .dep-dist-main-head span{
  display:block;
  margin-bottom:0.25rem;
  font-size:0.625rem;
  font-weight:800;
  letter-spacing:.06em;
  text-transform:uppercase;
  color:var(--rel-ink-muted);
}
#page-relatorios .relatorios-fd .dep-dist-main-head strong{
  display:block;
  font-size:1.125rem;
  line-height:1.14;
  color:var(--ink);
  overflow-wrap:anywhere;
}
#page-relatorios .relatorios-fd .dep-dist-main-head b{
  flex:none;
  font-size:1.75rem;
  line-height:1;
  color:var(--p-warn-dot);
  font-variant-numeric:tabular-nums;
}
#page-relatorios .relatorios-fd .dep-dist-map{
  display:flex;
  gap:0.625rem;
  align-items:stretch;
  min-width:0;
  overflow-x:auto;
  padding-bottom:0.125rem;
}
#page-relatorios .relatorios-fd .dep-dist-map .tr-col{
  min-width:8.25rem;
}
#page-relatorios .relatorios-fd .dep-dist-map .tr-head{
  align-items:flex-start;
  min-height:2.125rem;
}
#page-relatorios .relatorios-fd .dep-dist-map .tr-head .tr-dn{
  white-space:normal;
  overflow:visible;
  text-overflow:clip;
  line-height:1.16;
  overflow-wrap:anywhere;
}
#page-relatorios .relatorios-fd .dep-dist-map .tr-canvas{
  min-height:22.5rem;
  border-radius:0.5625rem;
}
#page-relatorios .relatorios-fd .dep-dist-map .tr-g{
  gap:0.1875rem;
  padding:0.75rem;
}
#page-relatorios .relatorios-fd .dep-dist-map .tr-gn{
  order:1;
  font-size:0.75rem;
  font-weight:800;
  line-height:1.14;
  white-space:normal;
  overflow:visible;
  text-overflow:clip;
  overflow-wrap:anywhere;
}
#page-relatorios .relatorios-fd .dep-dist-map .tr-gv{
  order:2;
  font-size:1.5rem;
}
#page-relatorios .relatorios-fd .dep-dist-map .tr-gmeta{
  order:3;
  font-size:0.65625rem;
  font-weight:800;
  line-height:1.1;
  opacity:.78;
}
#page-relatorios .relatorios-fd .dep-dist-map .tr-g--compact{
  justify-content:center;
  padding:0.5rem 0.5625rem;
}
#page-relatorios .relatorios-fd .dep-dist-map .tr-g--compact .tr-gv{
  font-size:1rem;
}
#page-relatorios .relatorios-fd .dep-dist-map .tr-g--compact .tr-gmeta{
  font-size:0.59375rem;
}
#page-relatorios .relatorios-fd .dep-dist-map .tr-g--tiny{
  align-items:center;
  justify-content:center;
  padding:0;
  border-radius:0.5rem;
}
#page-relatorios .relatorios-fd .dep-dist-map .tr-g--tiny .tr-gv{
  font-size:0.75rem;
}
#page-relatorios .relatorios-fd .dep-dist-map .tr-g--tiny .tr-gmeta{
  display:none;
}
#page-relatorios .relatorios-fd .dep-dist-aside{
  display:flex;
  flex-direction:column;
  gap:0.875rem;
  min-width:0;
  padding-left:1rem;
  border-left:0.0625rem solid var(--line);
}
#page-relatorios .relatorios-fd .dep-dist-metrics{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:0.5rem;
}
#page-relatorios .relatorios-fd .dep-dist-metric{
  min-height:4.5rem;
  padding:0.625rem 0.6875rem;
  border:0.0625rem solid var(--line);
  border-radius:0.5rem;
  background:color-mix(in srgb, var(--field) 72%, var(--surface));
}
#page-relatorios .relatorios-fd .dep-dist-metric span{
  display:block;
  font-size:0.625rem;
  font-weight:800;
  letter-spacing:.05em;
  text-transform:uppercase;
  color:var(--rel-ink-muted);
}
#page-relatorios .relatorios-fd .dep-dist-metric strong{
  display:block;
  margin-top:0.3125rem;
  font-size:1.375rem;
  line-height:1;
  color:var(--ink);
  font-variant-numeric:tabular-nums;
}
#page-relatorios .relatorios-fd .dep-dist-metric small{
  display:block;
  margin-top:0.3125rem;
  font-size:0.6875rem;
  font-weight:700;
  line-height:1.15;
  color:var(--muted);
  overflow-wrap:anywhere;
}
#page-relatorios .relatorios-fd .dep-dist-rank-card h4{
  margin:0 0 0.625rem;
  font-size:0.8125rem;
  line-height:1.2;
  color:var(--ink);
}
#page-relatorios .relatorios-fd .dep-dist-rank{
  display:flex;
  flex-direction:column;
  gap:0.625rem;
  margin:0;
  padding:0;
  list-style:none;
}
#page-relatorios .relatorios-fd .dep-dist-rank-row{
  display:grid;
  grid-template-columns:1.5rem minmax(0,1fr) auto;
  gap:0.5625rem;
  align-items:start;
}
#page-relatorios .relatorios-fd .dep-dist-rank-pos{
  width:1.5rem;
  height:1.5rem;
  border-radius:0.4375rem;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:color-mix(in srgb, var(--p-warn-dot) 12%, var(--surface));
  color:var(--p-warn-dot);
  font-size:0.6875rem;
  font-weight:900;
  font-variant-numeric:tabular-nums;
}
#page-relatorios .relatorios-fd .dep-dist-rank-copy{
  display:flex;
  flex-direction:column;
  gap:0.25rem;
  min-width:0;
}
#page-relatorios .relatorios-fd .dep-dist-rank-copy b{
  font-size:0.75rem;
  line-height:1.18;
  color:var(--ink);
  overflow-wrap:anywhere;
}
#page-relatorios .relatorios-fd .dep-dist-rank-copy small{
  font-size:0.65625rem;
  line-height:1.2;
  color:var(--muted);
  overflow-wrap:anywhere;
}
#page-relatorios .relatorios-fd .dep-dist-rank-track{
  height:0.3125rem;
  border-radius:62.4375rem;
  overflow:hidden;
  background:color-mix(in srgb, var(--field) 88%, var(--line));
}
#page-relatorios .relatorios-fd .dep-dist-rank-track i{
  display:block;
  height:100%;
  border-radius:inherit;
}
#page-relatorios .relatorios-fd .dep-dist-rank-val{
  min-width:2.625rem;
  text-align:right;
  font-size:0.9375rem;
  font-weight:900;
  line-height:1;
  color:var(--ink);
  font-variant-numeric:tabular-nums;
}
#page-relatorios .relatorios-fd .dep-dist-rank-val small{
  display:block;
  margin-top:0.25rem;
  font-size:0.625rem;
  font-weight:800;
  color:var(--muted);
}
#page-relatorios .relatorios-fd .dep-dist-note{
  margin:0;
  padding:0.75rem;
  border-radius:0.5rem;
  background:color-mix(in srgb, var(--p-warn-bg) 46%, var(--surface));
  color:#3d4b62;
  font-size:0.75rem;
  line-height:1.45;
}
#page-relatorios .relatorios-fd .dep-dist-note b{
  color:var(--p-warn-dot);
}
html[data-theme="dark"] #page-relatorios .relatorios-fd .dep-dist-note,
html[data-theme="cinza"] #page-relatorios .relatorios-fd .dep-dist-note{
  color:var(--ink);
}
@media (max-width: 0px) /* ui-scale-freeze: was 1180px */{
  #page-relatorios .relatorios-fd .dep-dist-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  #page-relatorios .relatorios-fd .dep-dist-metrics--bar{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}
@media (max-width:760px){
  #page-relatorios .relatorios-fd .dep-dist-grid{
    grid-template-columns:1fr;
  }
  #page-relatorios .relatorios-fd .dep-dist-metrics--bar{
    grid-template-columns:1fr;
  }
}

/* Nublado — cabeçalho Top 5: banda gelo institucional (upgrade visual só neste tema). */
html[data-theme="cinza"] #page-relatorios .relatorios-fd .dep-inc-kpi-head{
  background:
    linear-gradient(180deg, rgba(255,255,255,.10), transparent 42%),
    var(--rel-cloud-ice-band, linear-gradient(105deg, #24475d, #315f78 56%, #477b98));
  border-bottom:0.0625rem solid rgba(11, 34, 52, 0.42);
  box-shadow:
    inset 0 0.0625rem 0 rgba(255,255,255,.22),
    inset 0 -0.0625rem 0 rgba(11, 34, 52, 0.28);
}
html[data-theme="cinza"] #page-relatorios .relatorios-fd .dep-inc-kpi-head .dep-inc-kpi-t{
  color:#f7fbff;
  letter-spacing:-0.015625rem;
  text-shadow:0 0.0625rem 0 rgba(8, 22, 34, .35);
}
html[data-theme="cinza"] #page-relatorios .relatorios-fd .dep-inc-kpi-head .dep-inc-kpi-s{
  color:rgba(226, 236, 244, .88);
  font-weight:500;
}
