/* ==========================================================================
   Componentes: botões, busca, tabelas, abas, cards, modais, formulários e
   o grid da Demonstração de resultado.
   ========================================================================== */

/* --------------------------------------------------------------- botões -- */
.btn {
  display: inline-block;
  padding: 7px 12px 9px;
  border: 0;
  border-radius: 3px;
  font-family: var(--fonte-btn);
  font-size: 14px;
  line-height: 16px;
  color: #fff;
  background: #9aa4ae;
}
.btn:hover { filter: brightness(.94); }
.btn-primario { background: var(--teal); }
.btn-primario:hover { background: var(--teal-escuro); }
.btn-azul { background: var(--azul); }
.btn-azul:hover { background: var(--azul-escuro); }
.btn-claro { background: #fff; color: #7b8794; border: 1px solid #dfe3e6; }
.btn-claro:hover { background: #f6f8f9; }
.btn-pequeno { padding: 4px 9px 5px; font-size: 12px; }
.btn-caixa-alta {
  padding: 6px 14px 7px;
  font-size: 12px;
  letter-spacing: .4px;
  text-transform: uppercase;
}

.link-icone {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: #6f7b8a;
  font-size: 11px;
}
.link-icone svg { width: 20px; height: 20px; fill: currentColor; }
.link-icone:hover { color: var(--azul); }

/* ---------------------------------------------------------------- busca -- */
.busca { position: relative; width: 300px; }
.busca input {
  width: 100%;
  height: 37px;
  padding: 6px 30px 6px 11px;
  border: 1px solid var(--borda);
  border-radius: 2px;
  background: #fff;
  font-family: var(--fonte-btn);
  font-size: 13px;
  color: var(--texto-forte);
  outline: none;
}
.busca input:focus { border-color: #c9d2da; }
.busca .lupa {
  position: absolute;
  right: 9px; top: 50%;
  transform: translateY(-50%);
  color: #9aa4ae;
  pointer-events: none;
}
.busca .lupa svg { width: 14px; height: 14px; fill: currentColor; display: block; }

/* -------------------------------------------------------------- tabelas -- */
table.lista {
  width: 100%;
  background: #fff;
  border-collapse: collapse;
}
table.lista th {
  padding: 12px;
  font-family: "Droid Sans", Arial, Helvetica, sans-serif;
  font-size: 12px;
  font-weight: bold;
  color: #2e2e2e;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid #f0f2f4;
}
table.lista th .ordenar {
  display: inline-block;
  width: 8px; height: 8px;
  margin-right: 6px;
  border: 1px solid #b7bec6;
  transform: rotate(45deg);
  vertical-align: middle;
}
table.lista td {
  padding: 7px 12px;
  font-size: 12px;
  color: var(--texto-tabela);
  border-bottom: 1px solid #f4f6f7;
}
table.lista tbody tr:hover td { background: #f7f9fa; }
table.lista td.vazio-tabela { color: var(--texto-tabela); font-size: 12px; padding: 7px; }

/* ----------------------------------------------------------------- abas -- */
.abas {
  display: flex;
  align-items: flex-end;
  list-style: none;
  margin: 0 0 0 0;
  padding: 0 0 0 12px;
  background: var(--tabs-bar);
}
.abas li a {
  display: block;
  padding: 15px 7px;
  font-size: 13px;
  color: var(--tab-idle);
}
.abas li.ativa a {
  background: #fff;
  color: var(--tab-ativa);
  border-radius: 3px 3px 0 0;
}
.abas + .conteudo-aba { background: #fff; padding: 14px 12px; }

/* abas do módulo Performance (pílulas azuis à direita) */
.abas-performance {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  padding-right: 8px;
}
.abas-performance a {
  padding: 7px 14px;
  font-size: 13px;
  color: var(--azul);
  border-radius: 3px;
}
.abas-performance a.ativa { background: var(--azul); color: #fff; }

.barra-modulo {
  display: flex;
  align-items: center;
  background: var(--tabs-bar);
  padding: 6px 0 6px 10px;
}
.barra-modulo .titulo-modulo {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  padding: 10px 14px;
  margin: -6px 0 -6px -10px;
}
.barra-modulo .titulo-modulo a {
  font-size: 13px;
  color: var(--azul);
  text-decoration: underline;
}

/* ---------------------------------------------------------------- cards -- */
.cards { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.card-indicador {
  position: relative;
  width: 330px;
  background: var(--card-cinza);
  color: #fff;
  font-family: var(--fonte-titulo);
  padding: 12px 14px 0;
}
.card-indicador .titulo { font-size: 12px; font-weight: 700; }
.card-indicador .corpo { display: flex; align-items: center; justify-content: space-between; }
.card-indicador .detalhe { font-size: 11px; line-height: 15px; margin-top: 6px; }
.card-indicador .detalhe .bolinha {
  display: inline-block;
  width: 8px; height: 8px;
  margin: 0 4px 0 6px;
  border-radius: 50%;
  background: var(--vermelho);
}
.card-indicador .numero { font-size: 30px; font-weight: 300; line-height: 34px; }
.card-indicador .rodape {
  margin: 10px -14px 0;
  padding: 4px 14px;
  background: var(--card-cinza-rodape);
  font-size: 11px;
  font-weight: 700;
}

/* --------------------------------------------------------------- modais -- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  z-index: 50;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px;
  overflow-y: auto;
}
.modal {
  background: #fff;
  width: 760px;
  max-width: 100%;
  box-shadow: 0 5px 22px rgba(0, 0, 0, .4);
}
.modal.largo { width: 1420px; }
.modal.medio { width: 560px; }
.modal.estreito { width: 285px; }
.modal .modal-titulo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px 16px;
  font-family: var(--fonte-titulo);
  font-size: 18px;
  font-weight: 300;
  color: #4b4b4b;
}
.modal .modal-titulo svg { width: 20px; height: 20px; fill: currentColor; }
.modal .modal-corpo { background: #eef1f3; padding: 18px 20px; }
.modal .modal-corpo.branco { background: #fff; }
.modal .modal-rodape {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  background: #f7f8f9;
}
.modal .modal-topo-direita {
  position: absolute;
  top: 16px; right: 20px;
  display: flex;
  gap: 8px;
}
.modal-wrapper { position: relative; }

/* ---------------------------------------------------------- formulários -- */
.campo { margin-bottom: 14px; }
.campo label { display: block; margin-bottom: 5px; font-size: 12px; color: #7b8794; }
.campo input[type="text"],
.campo input[type="email"],
.campo input[type="password"],
.campo input[type="date"],
.campo textarea,
.campo select {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid #dfe3e6;
  border-radius: 2px;
  font-family: var(--fonte-btn);
  font-size: 13px;
  color: var(--texto-forte);
  background: #fff;
  outline: none;
}
.campo textarea { min-height: 74px; resize: vertical; }
.campo select { height: 34px; }
.campo.estreito { max-width: 352px; }

.opcoes-status { display: flex; gap: 4px; flex-wrap: wrap; }
.opcoes-status button {
  padding: 5px 10px;
  border: 1px solid #e0e4e7;
  border-radius: 2px;
  background: #eef1f3;
  font-size: 12px;
  color: #6f7b8a;
}
.opcoes-status button.ativo { background: var(--azul); border-color: var(--azul); color: #fff; }

.check {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 0;
  font-size: 13px;
  color: var(--texto);
  cursor: pointer;
}
.check input { display: none; }
.check .caixa {
  width: 15px; height: 15px;
  border: 1px solid #c8ced4;
  border-radius: 2px;
  background: #fff;
  flex: none;
  position: relative;
}
.check input:checked + .caixa { background: var(--teal); border-color: var(--teal); }
.check input:checked + .caixa::after {
  content: "";
  position: absolute;
  left: 4px; top: 1px;
  width: 4px; height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.check.radio .caixa { border-radius: 50%; }
.check.radio input:checked + .caixa { background: #fff; border: 4px solid var(--teal); }
.check.radio input:checked + .caixa::after { display: none; }

.arvore { list-style: none; margin: 0; padding: 0 0 0 18px; }
.arvore.raiz { padding-left: 0; }
.arvore li { margin: 2px 0; }
.arvore .no { display: flex; align-items: center; gap: 6px; }
.arvore .expandir {
  width: 13px; height: 13px;
  border: 1px solid #b7bec6;
  background: #fff;
  font-size: 11px;
  line-height: 10px;
  color: #6f7b8a;
  text-align: center;
  flex: none;
  padding: 0;
}
.caixa-arvore {
  height: 260px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #e2e6e9;
  padding: 10px;
}
.titulo-filtro {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-family: var(--fonte-titulo);
  font-size: 17px;
  font-weight: 300;
  color: #7b8794;
}
.titulo-filtro svg {
  width: 15px;
  height: 15px;
  flex: none;
  fill: currentColor;
}

/* ------------------------------------------------------------- DRE grid -- */
.bloco-dre {
  background: #fff;
  overflow-x: auto;
}
table.dre {
  border-collapse: collapse;
  font-size: 11px;
  width: max-content;
  min-width: 100%;
}
table.dre th {
  background: var(--azul-grid);
  color: #fff;
  font-family: "Droid Sans", Arial, Helvetica, sans-serif;
  font-size: 12px;
  font-weight: normal;
  text-align: center;
  padding: 4px 6px;
  border: 1px solid #0b587f;
  white-space: nowrap;
}
table.dre th.grupo { border-bottom: 1px solid #2a7ba6; }
table.dre th.conta {
  background: #fff;
  border: 0;
  width: 355px;
  min-width: 355px;
}
table.dre td {
  padding: 5px 6px;
  border: 1px solid var(--borda-grid);
  color: #343434;
  text-align: right;
  white-space: nowrap;
  font-family: "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
}
table.dre td.conta {
  text-align: left;
  width: 355px;
  min-width: 355px;
  position: sticky;
  left: 0;
  background: #fff;
  z-index: 1;
}
table.dre tr.total td { background: var(--roxo-total); color: #fff; font-weight: 700; }
table.dre tr.total td.conta { background: var(--roxo-total); }
table.dre tr.filha td { background: #fbfcfd; }
table.dre tr.filha td.conta { background: #fbfcfd; }
table.dre tr:hover td:not(.conta) { filter: brightness(.985); }
table.dre .rotulo-conta { display: flex; align-items: center; gap: 6px; }
table.dre .expandir {
  width: 13px; height: 13px;
  flex: none;
  border: 1px solid #b7bec6;
  background: #fff;
  color: #6f7b8a;
  font-size: 11px;
  line-height: 10px;
  text-align: center;
  padding: 0;
}
table.dre tr.total .expandir { border-color: #fff; background: transparent; color: #fff; }
/* No original o valor negativo não muda de cor: só ganha os parênteses. */

.indicadores-rodape {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  font-family: var(--fonte-titulo);
  font-size: 24px;
  font-weight: 300;
  color: #9aa4ae;
  cursor: pointer;
}

/* seletor de competência do topo direito */
.seletor-competencia { display: flex; align-items: center; }
.seletor-competencia .campo-mes {
  height: 32px;
  min-width: 92px;
  padding: 0 12px;
  border: 1px solid #dfe3e6;
  border-right: 0;
  background: #fff;
  font-size: 13px;
  color: #4b4b4b;
  display: flex;
  align-items: center;
}
.seletor-competencia .abre-calendario {
  height: 32px;
  width: 32px;
  border: 0;
  background: var(--azul);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.seletor-competencia .abre-calendario svg { width: 16px; height: 16px; fill: currentColor; }
.acumular {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: 14px;
  font-size: 13px;
  color: #8a95a1;
}

/* -------------------------------------------------------------- toast ---- */
.toast {
  position: fixed;
  top: 74px; right: 18px;
  z-index: 80;
  min-width: 240px;
  padding: 12px 16px;
  background: #2f3a45;
  color: #fff;
  font-size: 13px;
  border-radius: 3px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
}
.toast.erro { background: #b94a48; }
.toast.info { background: var(--azul); }

/* --------------------------------------------------------- paginação ----- */
.paginacao {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 10px 4px 0;
  font-size: 12px;
  color: var(--texto-tabela);
}
.paginacao button {
  border: 1px solid #dfe3e6;
  background: #fff;
  color: #6f7b8a;
  width: 24px; height: 24px;
  border-radius: 2px;
}
.paginacao input {
  width: 42px;
  height: 26px;
  text-align: center;
  border: 1px solid #dfe3e6;
  border-radius: 2px;
}

/* --------------------------------------------------------- realizados ---- */
.realizados-painel { background: #fff; padding: 14px 12px; }
.realizados-filtros {
  display: grid;
  grid-template-columns: repeat(5, minmax(135px, 1fr)) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}
.realizados-filtros .campo { margin: 0; }
.realizados-filtros input,
.realizados-filtros select {
  width: 100%;
  height: 34px;
  border: 1px solid #dfe3e6;
  border-radius: 2px;
  background: #fff;
  color: #596573;
  padding: 6px 8px;
}
.realizados-acoes { display: flex; gap: 6px; }
.alerta-divergente {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border-left: 4px solid #d9534f;
  background: #fff4f3;
  color: #a94442;
  font-size: 13px;
}
.status-realizado {
  display: inline-block;
  min-width: 78px;
  padding: 3px 8px;
  border-radius: 10px;
  text-align: center;
  font-size: 11px;
}
.status-realizado.processado { background: #e7f5ee; color: #248557; }
.status-realizado.divergente { background: #fdeceb; color: #b5423e; }
.linha-realizado { cursor: pointer; }
.tabela-realizados { overflow-x: auto; }
.realizados-rodape {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  color: #7b8794;
  font-size: 12px;
}
.detalhe-realizado {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 20px;
}
.detalhe-realizado div { min-width: 0; }
.detalhe-realizado dt { color: #8994a0; font-size: 11px; margin-bottom: 3px; }
.detalhe-realizado dd { color: #43505d; font-size: 13px; margin: 0; overflow-wrap: anywhere; }
.detalhe-realizado .largura-total { grid-column: 1 / -1; }
.motivo-divergente { padding: 10px; background: #fff4f3; border-left: 3px solid #d9534f; }

@media (max-width: 1100px) {
  .realizados-filtros { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
}

/* ------------------------------------------------------------- kanban ---- */
.kanban { display: flex; gap: 12px; overflow-x: auto; padding: 4px 0 10px; }
.kanban .coluna { width: 250px; flex: none; background: #eef1f3; border-radius: 3px; }
.kanban .coluna h4 {
  padding: 10px 12px;
  font-family: var(--fonte-titulo);
  font-size: 13px;
  font-weight: 600;
  color: #6f7b8a;
  border-bottom: 1px solid #e2e6e9;
}
.kanban .cartao {
  margin: 8px;
  padding: 10px;
  background: #fff;
  border-left: 3px solid var(--teal);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
  font-size: 12px;
  color: var(--texto-tabela);
}
.kanban .cartao .nome { font-weight: bold; color: #45505c; margin-bottom: 4px; }
.kanban .coluna .sem-itens { padding: 12px; font-size: 12px; color: #9aa4ae; }

/* -------------------------------------------------------------- rodapé --- */
.em-breve {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 7px;
  border-radius: 9px;
  background: #dfe4e8;
  color: #7b8794;
  font-size: 11px;
}
