.eli-tabela {
  width: 100%;
}

.eli-tabela__table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 12px;
  overflow: visible;
}

.eli-tabela__tbody {
  overflow: visible;
}

.eli-tabela__tbody .eli-tabela__tr--zebra .eli-tabela__td {
  background: rgba(15, 23, 42, 0.02);
}

.eli-tabela__th,
.eli-tabela__td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  vertical-align: top;
}

.eli-tabela__th {
  text-align: left;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.03);
}

.eli-tabela__th--ordenavel {
  padding: 0;
}

.eli-tabela__th--ordenavel .eli-tabela__th-botao {
  padding: 10px 12px;
}

.eli-tabela__th-botao {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  background: transparent;
  border: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: left;
  transition: color 0.2s ease;
}

.eli-tabela__th-botao:hover,
.eli-tabela__th-botao:focus-visible {
  color: rgba(15, 23, 42, 0.85);
}

.eli-tabela__th-botao:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.45);
  outline-offset: 2px;
}

.eli-tabela__th-botao--ativo {
  color: rgba(37, 99, 235, 0.95);
}

.eli-tabela__th-texto {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
}

.eli-tabela__th-icone {
  flex-shrink: 0;
}

.eli-tabela__th-icone--oculto {
  opacity: 0;
}

.eli-tabela__tr:last-child .eli-tabela__td {
  border-bottom: none;
}

.eli-tabela__td--clicavel {
  cursor: pointer;
}

.eli-tabela__td--clicavel:hover {
  background: rgba(0, 0, 0, 0.03);
}



.eli-tabela--erro {
  border: 1px solid rgba(220, 53, 69, 0.35);
  border-radius: 12px;
  padding: 12px;
}

.eli-tabela--carregando {
  border: 1px dashed rgba(0, 0, 0, 0.25);
  border-radius: 12px;
  padding: 12px;
  opacity: 0.8;
}

.eli-tabela__erro-titulo {
  font-weight: 700;
  margin-bottom: 4px;
}

.eli-tabela__erro-mensagem {
  opacity: 0.9;
}

.eli-tabela--vazio {
  border: 1px dashed rgba(0, 0, 0, 0.25);
  border-radius: 12px;
  padding: 12px;
  opacity: 0.8;
}

.eli-tabela__th--acoes {
  text-align: right;
  white-space: nowrap;
}

.eli-tabela__td--acoes {
  white-space: nowrap;
  overflow: visible;
}

.eli-tabela__acoes-container {
  display: flex;
  justify-content: flex-end;
  position: relative;
  z-index: 1;
}

.eli-tabela__acoes-container--aberto {
  z-index: 200;
}

.eli-tabela__cabecalho {
  width: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;

  /* Altura padrão para controles do cabeçalho (busca e botões)
   * - Mantém alinhamento visual entre input de busca e ações
   * - Pode ser sobrescrita via CSS no consumidor, se necessário
   */
  --eli-tabela-cabecalho-controle-altura: 34px;

  /* Borda dos controles do cabeçalho: menos "pílula", mais quadrado.
   * Ajuste fino via CSS no consumidor, se necessário.
   */
  --eli-tabela-cabecalho-controle-radius: 8px;
}

.eli-tabela__acoes-cabecalho {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}

.eli-tabela__acoes-cabecalho-botao {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: var(--eli-tabela-cabecalho-controle-altura);
  padding: 0 14px;
  border-radius: var(--eli-tabela-cabecalho-controle-radius);
  border: none;
  background: rgba(37, 99, 235, 0.12);
  color: rgba(37, 99, 235, 0.95);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.eli-tabela__acoes-cabecalho-botao:hover,
.eli-tabela__acoes-cabecalho-botao:focus-visible {
  background: rgba(37, 99, 235, 0.2);
}

.eli-tabela__acoes-cabecalho-botao:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.35);
  outline-offset: 2px;
}

.eli-tabela__acoes-cabecalho-icone {
  display: inline-block;
}

.eli-tabela__acoes-cabecalho-rotulo {
  line-height: 1;
}

.eli-tabela__acoes-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  border: none;
  background: transparent;
  color: rgba(15, 23, 42, 0.72);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.eli-tabela__acoes-toggle-icone {
  display: block;
}

.eli-tabela__acoes-toggle:hover,
.eli-tabela__acoes-toggle:focus-visible {
  background-color: rgba(15, 23, 42, 0.08);
  color: rgba(15, 23, 42, 0.95);
}

.eli-tabela__acoes-toggle:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.45);
  outline-offset: 2px;
}

.eli-tabela__acoes-toggle:disabled {
  cursor: default;
  color: rgba(148, 163, 184, 0.8);
  background: transparent;
}

.eli-tabela__acoes-menu {
  min-width: 180px;
  padding: 6px 0;
  margin: 0;
  list-style: none;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18);
  z-index: 1000;
}

.eli-tabela__acoes-item {
  margin: 0;
}

.eli-tabela__acoes-item-botao {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border: none;
  background: transparent;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.eli-tabela__acoes-item-botao:hover,
.eli-tabela__acoes-item-botao:focus-visible {
  background-color: rgba(15, 23, 42, 0.06);
}

.eli-tabela__acoes-item-botao:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: -2px;
}

.eli-tabela__acoes-item-icone {
  flex-shrink: 0;
}

.eli-tabela__acoes-item-texto {
  flex: 1;
  text-align: left;
}

/* =========================
 * Expander (colunas invisíveis)
 * ========================= */

.eli-tabela__th--expander,
.eli-tabela__td--expander {
  width: 42px;
  padding: 6px 8px;
  text-align: center;
  vertical-align: middle;
}

.eli-tabela__expander-botao {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 9999px;
  border: none;
  background: transparent;
  color: rgba(15, 23, 42, 0.72);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.eli-tabela__expander-botao:hover,
.eli-tabela__expander-botao:focus-visible {
  background-color: rgba(15, 23, 42, 0.08);
  color: rgba(15, 23, 42, 0.95);
}

.eli-tabela__expander-botao:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.45);
  outline-offset: 2px;
}

.eli-tabela__expander-botao--ativo {
  background-color: rgba(15, 23, 42, 0.06);
  color: rgba(15, 23, 42, 0.95);
}

.eli-tabela__td--detalhes {
  padding: 12px;
}

.eli-tabela__tr--detalhes .eli-tabela__td {
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.eli-tabela__detalhes {
  display: grid;
  gap: 10px;
  padding-left: 4px;
}

.eli-tabela__detalhe {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 10px;
  align-items: start;
}

.eli-tabela__detalhe-rotulo {
  font-weight: 600;
  color: rgba(15, 23, 42, 0.85);
}

.eli-tabela__detalhe-valor {
  min-width: 0;
}

@media (max-width: 720px) {
  .eli-tabela__detalhe {
    grid-template-columns: 1fr;
  }
}
