/* Relatório — matriz mês × bloco, colapsável. Padrão mockup-v2 (light, limpo). */

.rel-loading {
  padding: 2.5rem;
  text-align: center;
  color: var(--text-mut);
  font-size: .85rem;
}

.rel-matrix-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: .65rem;
  overflow: auto;
}

.rel-matrix {
  width: 100%;
  border-collapse: collapse;
  font-size: .72rem;
  white-space: nowrap;
}

.rel-matrix thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-2);
  font-size: .58rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 700;
  color: var(--text-dim);
  padding: .55rem .5rem;
}

.rel-c { padding: .42rem .5rem; text-align: right; }
.num { font-variant-numeric: tabular-nums; letter-spacing: -.01em; }

/* coluna de rótulo fixa à esquerda */
.rel-label-th,
.rel-label {
  position: sticky;
  left: 0;
  z-index: 1;
  text-align: left !important;
  background: var(--surface);
  min-width: 240px;
  max-width: 240px;
}
.rel-label-th { z-index: 3; background: var(--surface-2); }

.rel-month-th { min-width: 64px; }
.rel-total-th, .rel-total-col {
  border-left: 1px solid var(--border-2);
  min-width: 76px;
}

/* linhas */
.rel-row { border-bottom: 1px solid var(--border); }
.rel-row:last-child { border-bottom: none; }

.rel-strong { font-weight: 700; }
.rel-zero { color: var(--text-dim); }
.pos { color: #059669; }
.neg { color: #dc2626; }

/* caret */
.rel-caret {
  display: inline-block;
  width: 1rem;
  color: var(--text-dim);
  font-size: .7rem;
}
.rel-caret-sm { width: .9rem; font-size: .6rem; }

/* bloco (linha-pai) */
.rel-group { cursor: pointer; background: var(--surface-2); }
.rel-group .rel-label { background: var(--surface-2); font-weight: 700; }
.rel-group:hover { background: var(--bg-2); }
.rel-group:hover .rel-label { background: var(--bg-2); }
.rel-group-name { font-weight: 700; color: var(--text); }

/* barra de cor por tipo de bloco */
.rel-group .rel-label { border-left: 3px solid transparent; }
.rel-group.rel-rec  .rel-label { border-left-color: #10b981; }
.rel-group.rel-desp .rel-label { border-left-color: #f43f5e; }
.rel-group.rel-mix  .rel-label { border-left-color: #6366f1; }

/* centro (nível 1) */
.rel-centro .rel-label { background: var(--surface); }
.rel-clickable { cursor: pointer; }
.rel-clickable:hover .rel-label { background: var(--bg-2); }
.rel-indent1 { padding-left: 1.4rem; }
.rel-centro-cod {
  display: inline-block;
  font-size: .6rem;
  font-weight: 700;
  color: var(--text-dim);
  background: var(--bg-3);
  border-radius: .25rem;
  padding: .04rem .3rem;
  margin-right: .4rem;
  font-variant-numeric: tabular-nums;
}
.rel-centro-name { color: var(--text-mut); font-weight: 600; }

/* categoria (nível 2) */
.rel-cat { background: var(--surface); }
.rel-cat .rel-label { background: var(--surface); color: var(--text-mut); }
.rel-indent2 { padding-left: 2.6rem; color: var(--text-mut); }
.rel-cat .num { font-weight: 500; }

/* linha de resultado */
.rel-resultado {
  background: var(--bg-3);
  border-top: 2px solid var(--border-2);
}
.rel-resultado .rel-label {
  background: var(--bg-3);
  font-weight: 800;
}
.rel-resultado .rel-group-name { font-weight: 800; }
.rel-resultado .num { font-weight: 800; }
