/* Relatórios: indicadores e gráficos. Texto sempre em tinta de texto; cor só nas marcas. */

.reports [data-content] {
  transition: opacity 0.2s;
}

.reports [data-content].is-loading {
  opacity: 0.55;
}

.sk-kpi {
  height: 150px;
  border-radius: var(--r-m);
}

.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.kpi {
  display: grid;
  align-content: start;
  gap: 9px;
  min-width: 0;
  padding: 18px;
  border-radius: var(--r-m);
  background: var(--surface);
  border: 1px solid var(--line);
}

.kpi-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
}

.kpi-value {
  font-family: var(--font-display);
  font-stretch: 66%;
  font-weight: 800;
  font-size: clamp(42px, 4vw, 60px);
  line-height: 0.95;
  font-variant-numeric: tabular-nums;
}

.kpi-value small {
  margin: 0 0.35em 0 0.06em;
  font-size: 0.4em;
  font-stretch: 90%;
  font-weight: 700;
  color: var(--text-2);
}

.kpi-value.is-late {
  color: var(--late);
}

.kpi-foot {
  color: var(--text-2);
  font-size: 12.5px;
}

.kpi-bar {
  height: 6px;
  border-radius: 6px;
  background: var(--surface-3);
  overflow: hidden;
}

.kpi-bar i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--ok);
  transition: width 0.6s var(--ease);
}

.kpi-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin: 14px 0;
  border-radius: var(--r-m);
  background: var(--surface);
  border: 1px solid var(--line);
}

.kpi-strip > div {
  display: grid;
  gap: 4px;
  padding: 12px 16px;
  border-left: 1px solid var(--line);
  min-width: 0;
}

.kpi-strip > div:first-child {
  border-left: 0;
}

.kpi-strip span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--text-3);
}

.kpi-strip b {
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.dot::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-3);
}

.dot-ok::before {
  background: var(--ok);
}

.dot-warn::before {
  background: var(--warn);
}

.dot-late::before {
  background: var(--late);
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
}

.span-4 {
  grid-column: span 4;
}

.span-6 {
  grid-column: span 6;
}

.span-8 {
  grid-column: span 8;
}

.chart-panel {
  container-type: inline-size;
}

.chart-panel .panel-head {
  flex-wrap: wrap;
}

.table-scroll {
  overflow-x: auto;
}

.slow-table td {
  white-space: nowrap;
}

.chart {
  position: relative;
  min-height: 200px;
}

/* SVG */
.chart-svg {
  display: block;
  overflow: visible;
  font-family: var(--font-ui);
}

.chart-svg .grid {
  stroke: var(--line);
  stroke-width: 1;
}

.chart-svg .axis {
  fill: var(--text-3);
  font-size: 11px;
}

.chart-svg .hit {
  fill: transparent;
}

.chart-svg .bar {
  fill: var(--info);
}

.chart-svg .bar,
.chart-svg .seg,
.chart-svg .dot {
  transition: opacity 0.15s;
}

.chart-svg:hover .mark-g .bar,
.chart-svg:hover .mark-g .seg {
  opacity: 0.45;
}

.chart-svg .mark-g:hover .bar,
.chart-svg .mark-g:hover .seg {
  opacity: 1;
}

.chart-svg .fill-ok {
  fill: var(--ok);
}

.chart-svg .fill-warn {
  fill: var(--warn);
}

.chart-svg .fill-late {
  fill: var(--late);
}

.chart-svg .fill-neutral {
  fill: var(--line-3);
}

.chart-svg .line {
  fill: none;
  stroke: var(--info);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.chart-svg .dot {
  fill: var(--surface);
  stroke: var(--info);
  stroke-width: 2;
}

.chart-svg .mark-g:hover .dot {
  fill: var(--info);
}

.chart-svg .threshold {
  stroke-width: 1.5;
  stroke-dasharray: 4 4;
}

.chart-svg .threshold.warn {
  stroke: var(--warn);
}

.chart-svg .threshold.late {
  stroke: var(--late);
}

.chart-svg .threshold-label {
  font-size: 10.5px;
  font-weight: 700;
  fill: var(--text-2);
}

/* legenda */
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 12px;
  color: var(--text-2);
}

.chart-legend li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.chart-legend i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.chart-legend .lg-ok {
  background: var(--ok);
}

.chart-legend .lg-warn {
  background: var(--warn);
}

.chart-legend .lg-late {
  background: var(--late);
}

.chart-legend .lg-line {
  height: 2px;
  border-radius: 2px;
  background: var(--info);
}

/* rosca */
.donut-wrap {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 22px;
}

.donut {
  position: relative;
  width: 184px;
  height: 184px;
}

.donut svg {
  transform: rotate(-90deg);
}

.donut-seg,
.donut-empty {
  fill: none;
}

.donut-empty {
  stroke: var(--surface-3);
}

.stroke-ok {
  stroke: var(--ok);
}

.stroke-warn {
  stroke: var(--warn);
}

.stroke-late {
  stroke: var(--late);
}

.donut-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  pointer-events: none;
}

.donut-center b {
  font-family: var(--font-display);
  font-stretch: 68%;
  font-weight: 800;
  font-size: 40px;
  line-height: 1;
}

.donut-center span {
  margin-top: 4px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
}

.donut-legend {
  display: grid;
  gap: 12px;
}

.donut-legend li {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.donut-legend b {
  font-weight: 700;
  white-space: nowrap;
}

/* painel estreito: rosca em cima, legenda embaixo */
@container (max-width: 520px) {
  .donut-wrap {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
  }

  .donut-legend {
    width: 100%;
  }
}

.donut-legend em {
  min-width: 42px;
  text-align: right;
  font-style: normal;
  color: var(--text-3);
  font-size: 12px;
}

/* barras horizontais */
.hbars {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 13px;
}

.hbar {
  min-width: 0;
}

.hbar-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.hbar-rank {
  width: 18px;
  color: var(--text-3);
  font-size: 12px;
}

.hbar-img {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  object-fit: cover;
}

.hbar-name {
  flex: 1;
  min-width: 0;
  font-weight: 600;
}

.hbar-value {
  color: var(--text-2);
  font-size: 12.5px;
  white-space: nowrap;
}

.hbar-track {
  height: 8px;
  border-radius: 8px;
  background: var(--surface-3);
  overflow: hidden;
}

.hbar-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--info);
  transition: width 0.6s var(--ease);
}

.is-ranked .hbar-track {
  margin-left: 28px;
}

.slow-table th,
.slow-table td {
  padding: 9px 10px;
}

.chart-tip {
  position: fixed;
  z-index: 99;
  display: grid;
  gap: 2px;
  max-width: 280px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #1f252d;
  border: 1px solid var(--line-3);
  box-shadow: var(--shadow-2);
  font-size: 12px;
  color: var(--text-2);
  pointer-events: none;
}

.chart-tip strong {
  color: var(--text);
  font-size: 12.5px;
}

@media (max-width: 1200px) {
  .kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kpi-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .kpi-strip > div:nth-child(4) {
    border-left: 0;
  }

  .kpi-strip > div:nth-child(n + 4) {
    border-top: 1px solid var(--line);
  }

  .span-4,
  .span-6,
  .span-8 {
    grid-column: span 6;
  }

  .span-8 {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .kpi-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kpi-strip > div:nth-child(odd) {
    border-left: 0;
  }

  .kpi-strip > div:nth-child(4) {
    border-left: 1px solid var(--line);
  }

  .kpi-strip > div:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .span-4,
  .span-6,
  .span-8 {
    grid-column: 1 / -1;
  }

  .donut-wrap {
    grid-template-columns: 1fr;
    justify-items: center;
  }
}
