:root {
  --bs-primary: #34495e;
}

/* ── Dashboard ───────────────────────────────────────────────────────────── */

.dashboard-wrapper {
  max-width: 1400px;
  margin: 0 auto;
}

.dashboard-logo {
  width: 44px;
  height: 44px;
  font-size: 1.3rem;
  background: linear-gradient(135deg, #34495e, #1abc9c);
  color: #fff;
  flex-shrink: 0;
}

.dashboard-group-title {
  font-size: .7rem;
  letter-spacing: .08em;
  border-bottom: 1px solid #dee2e6;
  padding-bottom: .4rem;
}

.dashboard-card {
  color: #2c3e50;
  border-radius: 12px !important;
  transition: transform .15s, box-shadow .15s, border-color .15s;
  border-color: #dee2e6 !important;
}

.dashboard-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .08) !important;
  border-color: #34495e !important;
  color: #34495e;
}

.dashboard-card-icon {
  font-size: 1.8rem;
  line-height: 1;
}

.dashboard-card-label {
  color: inherit;
  font-size: .8rem !important;
}

.dashboard-footer-logo {
  height: 32px;
  width: auto;
  opacity: .35;
  filter: grayscale(1);
  transition: opacity .2s;
}

.dashboard-footer-logo:hover {
  opacity: .6;
}

/* Configurações Gerais e Fonte */
body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  font-size: 12px;
  margin: 0;
  padding: 0;
}

.dt-container > div {
  overflow: auto;
}

.dt-container > div > div {
  padding: 0;
}

/* Configuração da Fonte de Ícones */
@font-face {
  font-family: "fonticon";
  src:
    url("/static/fonts/fonticon.woff") format("woff"),
    url("/static/fonts/fonticon.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}

.font-icon {
  font-family: "fonticon";
  font-size: 14px;
  vertical-align: middle;
  text-align: center;
}

/* Cabeçalho da Tabela */
.datatable thead th {
  background-color: #34495e !important; /* Azul acinzentado escuro */
  color: white !important;
  font-weight: 600 !important;
  padding: 8px 10px !important;
  border: 0.5px solid #2c3e50 !important;
  text-align: left !important;
  white-space: nowrap !important;
}

/* Linha de Filtros (Logo abaixo do header) */
.filter-row td {
  background-color: #ebedef;
  padding: 4px 6px;
  border-bottom: 2px solid #bdc3c7;
}

/* Wrapper do Campo de Filtro */
.filter-wrapper {
  display: flex;
  align-items: center;
  background: white;
  min-height: 28px;
}

/* Compact Select2 for filters */
.filter-wrapper .select2-container--default .select2-selection--multiple {
  border: none;
  min-height: 26px;
  padding: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.select2-container--default
  .select2-selection--multiple
  .select2-selection__rendered {
  padding: 0 5px;
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}

.select2-container--default
  .select2-selection--multiple
  .select2-selection__choice {
  margin-top: 2px;
  margin-bottom: 2px;
  padding: 0 4px;
  font-size: 10px;
  background-color: #34495e !important;
  color: white;
  border: none;
}

.select2-container--default
  .select2-selection--multiple
  .select2-selection__choice__remove {
  color: white;
  margin-right: 3px;
  background-color: #4b5563 !important;
  position: relative;
  left: -4px;
  margin: 0;
}

.filter-wrapper
  .select2-container--default
  .select2-selection--multiple
  .select2-search--inline
  .select2-search__field {
  margin-top: 0;
  height: 24px;
  font-size: 11px;
}

/* Container principal do dropdown */
.select2-dropdown {
  border: 1px solid #d1d5db !important;
  border-radius: 4px !important;
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

/* Estilo de cada opção (item da lista) */
.select2-results__option {
  padding: 8px 12px !important;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  font-size: 14px;
  color: #333;
  display: flex;
  align-items: center;
  transition: background 0.2s ease;
}

/* Espaçamento para o ícone (caso você adicione via template) */
.select2-results__option i,
.select2-results__option img {
  margin-right: 10px;
  width: 18px;
  text-align: center;
  color: #4b5563;
}

/* Estado de Hover (Passar o mouse) */
.select2-results__option--highlighted[aria-selected] {
  background-color: #f3f4f6 !important; /* Cinza bem claro */
  color: #111827 !important;
}

/* Estado Selecionado (Exatamente como o 'Contains' na sua imagem) */
.select2-results__option[aria-selected="true"] {
  background-color: #3d5467 !important; /* Azul acinzentado escuro */
  color: white !important;
}

/* Remove o padding padrão da lista */
.select2-results__options {
  padding: 0 !important;
}

.select2-dropdown {
  min-width: 160px;
}

.filter-wrapper
  .select2-container--default.select2-container--focus
  .select2-selection--multiple {
  border: none !important;
}

/* Botão do Operador (Ícone de Funil/Lupa) */
.op-btn {
  background: transparent;
  color: #555;
  border: none;
  padding: 0 5px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.op-btn:hover {
  background-color: #f0f0f0;
  color: #000;
}

/* Input de Pesquisa */
.column-search {
  border: none;
  padding: 7px 5px;
  width: 100%;
  height: 100%;
  outline: none;
  font-size: 11px;
  color: #333;
  min-width: 20px;
}

/* Estilo das Células do Corpo */
.datatable tbody td {
  font-size: 11px !important;
  padding: 6px 10px !important;
  border: 0.5px solid #dee2e6 !important;
  color: #2c3e50 !important;
  white-space: nowrap !important;
}

/* Zebra Striping (Linhas alternadas) */
.datatable tbody tr:nth-child(even) {
  background-color: #f9f9f9 !important;
}

.datatable tbody tr:nth-child(odd) {
  background-color: #ffffff !important;
}

.datatable tbody tr:hover {
  background-color: #e8f4fd !important; /* Destaque azul claro ao passar o mouse */
}

/* Links dentro da tabela */
.datatable a {
  color: #1a73e8 !important;
  text-decoration: none !important;
}

.datatable a:hover {
  text-decoration: underline !important;
}

/* Menu Dropdown de Filtros */
.custom-filter-menu {
  display: none;
  position: absolute;
  background: white;
  border: 1px solid #999;
  box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.2);
  list-style: none;
  padding: 0;
  margin: 0;
  z-index: 10000;
  min-width: 180px;
}

.custom-filter-menu li {
  padding: 6px 12px;
  cursor: pointer;
  font-size: 12px;
}

.custom-filter-menu li:hover {
  background-color: #34495e;
  color: white;
}

.custom-filter-menu li.active {
  background-color: #34495e;
  color: white;
}

/* Feedback de Filtro Ativo */
.column-search.filter-active {
  background-color: #fff9c4 !important; /* Amarelo muito claro para indicar filtro ativo */
  font-weight: bold;
}

/* --- Informação da Tabela (Mostrando X de Y) --- */
.dt-info {
  font-size: 11px;
  color: #7f8c8d; /* Cinza médio para não distrair */
  font-style: italic;
  margin-top: 8px;
}

/* --- Paginação (Estilo Customizado) --- */
.pagination {
  margin-top: 10px;
  gap: 2px; /* Espaço entre os botões */
}

/* Estilo Base dos Links de Página */
.btn,
.page-item .page-link {
  color: #34495e !important;
  background-color: #fff;
  border: 1px solid #dee2e6;
  padding: 5px 10px;
  font-size: 11px;
  transition: all 0.2s ease;
  cursor: pointer;
  text-decoration: none;
}

/* Hover nos botões */
.btn:hover,
.page-item:not(.disabled):not(.active) .page-link:hover {
  background-color: #ebedef !important;
  border-color: #bdc3c7;
  color: #2c3e50 !important;
}

/* Estado Ativo (Página Atual) */
.page-item.active .page-link {
  background-color: #34495e !important; /* Mesmo azul do header */
  border-color: #34495e !important;
  color: white !important;
  font-weight: 600;
}

/* Estado Desativado (Anterior/Próximo quando bloqueados) */
.page-item.disabled .page-link {
  color: #bdc3c7 !important;
  background-color: #f8f9fa !important;
  border-color: #dee2e6;
  cursor: not-allowed;
}

/* Ajuste específico para as setas/textos de navegação */
.page-link.first,
.page-link.last,
.page-link.previous,
.page-link.next {
  font-weight: 500;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.5px;
}

/* Elemento de Elipse (...) */
.page-item.disabled .page-link.ellipsis {
  background: transparent !important;
  border: none !important;
}

/* Uniformizar a paginação */
.pagination .page-item .page-link {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 28px; /* Define uma altura fixa para todos */
  min-width: 28px; /* Garante que os números sejam quadrados */
  transition: all 0.2s;
}

div.dt-container div.dt-info {
  padding: 0;
}

/* --- Estilização do Search e Length (Topo da Tabela) --- */

/* Labels e Texto Geral */
.dt-length label,
.dt-search label {
  font-size: 11px;
  color: #2c3e50;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Estilo do Dropdown (Select) */
.dt-length select.form-select {
  font-size: 11px !important;
  padding: 4px 24px 4px 8px !important;
  border: 1px solid #dee2e6 !important;
  border-radius: 4px;
  color: #34495e;
  background-color: #fff;
  height: 30px;
  cursor: pointer;
}

.dt-length select.form-select:focus {
  border-color: #34495e !important;
  box-shadow: 0 0 0 0.2rem rgba(52, 73, 94, 0.15);
  outline: none;
}

/* Estilo do Campo de Busca (Input) */
.dt-search input.form-control {
  font-size: 11px !important;
  padding: 6px 10px !important;
  border: 1px solid #dee2e6 !important;
  border-radius: 4px;
  color: #333;
  width: 200px; /* Ajuste conforme necessário */
  height: 30px;
  transition: border-color 0.2s;
}

.dt-search input.form-control:focus {
  border-color: #34495e !important;
  box-shadow: 0 0 0 0.2rem rgba(52, 73, 94, 0.15);
  outline: none;
}

.row.mt-2.justify-content-between {
  align-items: flex-end !important;
}

tr.odd td:first-child,
tr.even td:first-child {
  padding-left: 4em;
}

.dtrg-level-1 > th {
  padding-left: 2.5em;
}
.dtrg-level-2 > th {
  padding-left: 5em;
}
.dtrg-level-3 > th {
  padding-left: 7.5em;
}
.dtrg-level-4 > th {
  padding-left: 10em;
}
.dtrg-level-5 > th {
  padding-left: 12.5em;
}

.select2-selection__choice {
  /* Garante que novos itens não sejam empurrados para posições fixas */
  float: none !important;
}