/* Fechamentos do Salarial (Administração, só ADM mestre).
   Cores por classe: a CSP do painel publicado bloqueia `style` embutido. */

.sfch-intro { margin: 6px 0 0; max-width: 720px; color: var(--muted, #647883); font-size: 13px; }

#sal-fech-conteudo { padding: 18px; }

.sfch-aviso { margin: 0; padding: 18px 4px; color: var(--muted, #647883); font-size: 14px; }
.sfch-erro { color: var(--red, #c7333b); font-weight: 700; }

/* Cartões dos meses */
.sfch-meses {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.sfch-mes {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--line, #dce5e9);
  border-top-width: 4px;
  border-radius: 8px;
  background: var(--surface, #fff);
  color: var(--ink, #11242f);
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.sfch-mes span { color: var(--muted, #647883); font-size: 12px; font-weight: 700; text-transform: uppercase; }
.sfch-mes strong { font-size: 20px; }
.sfch-mes small { color: var(--muted, #647883); font-size: 11px; }
.sfch-mes.sfch-ok { border-top-color: var(--green, #148448); }
.sfch-mes.sfch-quase { border-top-color: var(--gold, #d88a00); }
.sfch-mes.sfch-baixo { border-top-color: var(--red, #c7333b); }
.sfch-mes.is-active { outline: 2px solid var(--ink, #11242f); outline-offset: -1px; background: var(--page, #f1f5f7); }

/* Filtros */
.sfch-filtros { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-bottom: 10px; }
.sfch-filtros label { display: grid; gap: 4px; color: var(--muted, #647883); font-size: 12px; font-weight: 700; }
.sfch-filtros select,
.sfch-filtros input {
  min-width: 190px;
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid var(--line-strong, #c9d6dc);
  border-radius: 6px;
  background: var(--surface, #fff);
  color: var(--ink, #11242f);
  font: inherit;
  font-size: 14px;
}

.sfch-niveis { display: inline-flex; border: 1px solid var(--line-strong, #c9d6dc); border-radius: 6px; overflow: hidden; }
.sfch-nivel {
  min-height: 36px;
  padding: 6px 14px;
  border: 0;
  border-right: 1px solid var(--line-strong, #c9d6dc);
  background: var(--surface, #fff);
  color: var(--ink, #11242f);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.sfch-nivel:last-child { border-right: 0; }
.sfch-nivel.is-active { background: var(--ink, #11242f); color: #fff; }

.sfch-nota { margin: 0 0 10px; color: var(--muted, #647883); font-size: 12px; }

/* Tabela */
.sfch-tabela-caixa { overflow: auto; max-height: 70vh; border: 1px solid var(--line, #dce5e9); border-radius: 8px; }
.sfch-tabela { width: 100%; border-collapse: collapse; font-size: 13px; }
.sfch-tabela th,
.sfch-tabela td { padding: 7px 10px; border-bottom: 1px solid var(--line, #dce5e9); white-space: nowrap; }
.sfch-tabela thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--page, #f1f5f7);
  color: var(--muted, #647883);
  font-size: 11px;
  text-align: left;
  text-transform: uppercase;
}
.sfch-tabela tbody th {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 220px;
  background: var(--surface, #fff);
  text-align: left;
  font-weight: 700;
}
.sfch-tabela tbody th span { display: block; }
.sfch-tabela tbody th small { display: block; color: var(--muted, #647883); font-size: 11px; font-weight: 400; }
.sfch-tabela .num { text-align: right; font-variant-numeric: tabular-nums; }
.sfch-tabela td.sfch-ok { background: var(--green-soft, #e9f7ef); color: var(--green, #148448); font-weight: 700; }
.sfch-tabela td.sfch-quase { background: var(--gold-soft, #fff5dd); color: #8a5a00; font-weight: 700; }
.sfch-tabela td.sfch-baixo { background: var(--red-soft, #fff0f1); color: var(--red, #c7333b); font-weight: 700; }
.sfch-tabela .sfch-col-sel { box-shadow: inset 2px 0 0 var(--ink, #11242f), inset -2px 0 0 var(--ink, #11242f); }
.sfch-tabela .sfch-pos { color: var(--green, #148448); }
.sfch-tabela .sfch-neg { color: var(--red, #c7333b); }
.sfch-total th,
.sfch-total td { background: var(--page, #f1f5f7); font-weight: 800; }
.sfch-total th { background: var(--page, #f1f5f7) !important; }

@media (max-width: 760px) {
  #sal-fech-conteudo { padding: 12px; }
  .sfch-filtros select,
  .sfch-filtros input { min-width: 0; width: 100%; }
  .sfch-filtros label { flex: 1 1 140px; }
  .sfch-tabela tbody th { min-width: 160px; }
}

/* Gaveta de detalhes (reaproveita #sal-drawer de "Metas por marca") */
.sfch-evolucao-titulo { margin: 18px 0 8px; font-size: 14px; }
.sfch-evolucao { max-height: none; }
.sfch-evolucao .sfch-tabela tbody th { min-width: 120px; }
