/* Estilos personalizados para o sistema FILIADOS */

/* Variáveis de cores */
:root {
  --primary-color: #28a745;
  --primary-dark: #218838;
  --primary-light: #e9f7ef;
  --secondary-color: #17a2b8;
  --secondary-dark: #138496;
  --secondary-light: #e3f4f6;
  --success-color: #28a745;
  --info-color: #17a2b8;
  --warning-color: #ffc107;
  --danger-color: #dc3545;
  --light-color: #f8f9fa;
  --dark-color: #343a40;
  --gray-100: #f8f9fa;
  --gray-200: #e9ecef;
  --gray-300: #dee2e6;
  --gray-400: #ced4da;
  --gray-500: #adb5bd;
  --gray-600: #6c757d;
  --gray-700: #495057;
  --gray-800: #343a40;
  --gray-900: #212529;
}

.align-items-center {
  align-items: center !important;
  text-align: center !important;
}

/* Estilos gerais */
body {
  font-family: 'Roboto', sans-serif;
  color: var(--gray-800);
  background-color: #f5f5f5;
}

/* Cabeçalho */
header {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Navbar */
.navbar-dark .navbar-nav .nav-link.text-success {
  color: var(--primary-color) !important;
  font-weight: 500;
}

.navbar-dark .navbar-nav .nav-link.text-success:hover {
  color: var(--primary-dark) !important;
}

.navbar .nav-link.active {
  color: #020202 !important;
  background-color: rgba(20, 21, 21, 0.1) !important;
  border-radius: 0.25rem;
}

/* Classes específicas para usar com Bootstrap */
.bg-gray-100 {
  background-color: var(--gray-100) !important;
}

.bg-gray-200 {
  background-color: var(--gray-200) !important;
}

.bg-gray-300 {
  background-color: var(--gray-300) !important;
}

.bg-gray-400 {
  background-color: var(--gray-400) !important;
}

.bg-gray-500 {
  background-color: var(--gray-500) !important;
}

.bg-gray-600 {
  background-color: var(--gray-600) !important;
}

.bg-gray-700 {
  background-color: var(--gray-700) !important;
}

.bg-gray-800 {
  background-color: var(--gray-800) !important;
}

.bg-gray-900 {
  background-color: var(--gray-900) !important;
}

.text-gray-100 {
  color: var(--gray-100) !important;
}

.text-gray-200 {
  color: var(--gray-200) !important;
}

.text-gray-300 {
  color: var(--gray-300) !important;
}

.text-gray-400 {
  color: var(--gray-400) !important;
}

.text-gray-500 {
  color: var(--gray-500) !important;
}

.text-gray-600 {
  color: var(--gray-600) !important;
}

.text-gray-700 {
  color: var(--gray-700) !important;
}

.text-gray-800 {
  color: var(--gray-800) !important;
}

.text-gray-900 {
  color: var(--gray-900) !important;
}

/* Cards */
.card {
  transition: transform 0.2s, box-shadow 0.2s;
  border-radius: 0.5rem;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1) !important;
}

/* Botões */
.btn-success {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-success:hover {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
}

/* Tabelas */
.table thead th {
  background-color: var(--gray-200);
  border-bottom: 2px solid var(--gray-600);
  color: var(--gray-800);
  font-weight: 600;
}

.table-hover tbody tr:hover {
  background-color: var(--gray-100);
}

/* Formulários */
.form-control:focus {
  border-color: var(--gray-600);
  box-shadow: 0 0 0 0.2rem rgba(100, 100, 100, 0.25);
}

.form-label {
  font-weight: 500;
  color: var(--gray-700);
}

/* Paginação */
.page-item.active .page-link {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.page-link {
  color: var(--primary-color);
}

.page-link:hover {
  color: var(--primary-dark);
}

/* Alertas */
.alert-success {
  background-color: var(--gray-200);
  border-color: var(--gray-600);
  color: var(--gray-800);
}

/* Badges */
.badge-success {
  background-color: var(--primary-color);
}

.badge-info {
  background-color: var(--secondary-color);
}

/* Rodapé */
footer {
  box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
}

footer a {
  transition: color 0.2s;
}

footer a:hover {
  text-decoration: none;
  opacity: 0.8;
}

/* Responsividade */
@media (max-width: 768px) {
  .card {
    margin-bottom: 1rem;
  }

  .table-responsive {
    border: 0;
  }
}

/* Ícones Bootstrap */
@import url("../../bootstrap/bootstrap-icons/font/bootstrap-icons.css");

/* Animações */
.fade-in {
  animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* Utilitários */
.bg-success-subtle {
  background-color: var(--gray-200);
}

.text-success {
  color: var(--gray-700) !important;
}

.border-success {
  border-color: var(--gray-600) !important;
}

/* Estilos para o dashboard */
.dashboard-card {
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.dashboard-card .card-header {
  background-color: var(--gray-200);
  border-bottom: 1px solid var(--gray-400);
  color: var(--gray-800);
}

/* Estilos para tabelas de dados */
.data-table th {
  white-space: nowrap;
}

.data-table .actions {
  white-space: nowrap;
  width: 120px;
}

/* Estilos para formulários de filtro */
.filter-form {
  background-color: var(--gray-100);
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

/* Estilos para status */
.status-badge {
  padding: 0.35em 0.65em;
  border-radius: 50rem;
  display: inline-block;
  font-size: 0.75em;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

.status-active {
  background-color: var(--success-color);
  color: white;
}

.status-inactive {
  background-color: var(--gray-500);
  color: white;
}

.status-pending {
  background-color: var(--warning-color);
  color: var(--dark-color);
}

.status-retired {
  background-color: var(--info-color);
  color: white;
}

/* Estilos para tooltips */
.custom-tooltip {
  position: relative;
  display: inline-block;
}

.custom-tooltip:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

.tooltip-text {
  visibility: hidden;
  width: 120px;
  background-color: var(--dark-color);
  color: white;
  text-align: center;
  border-radius: 6px;
  padding: 5px;
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: 50%;
  margin-left: -60px;
  opacity: 0;
  transition: opacity 0.3s;
}

.tooltip-text::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: var(--dark-color) transparent transparent transparent;
}

.m-0 {
  margin-left: 10px !important;
}

.table thead th {
  font-size: 14px;
  text-align: center;
}

#previewMapeamentoCSV .table thead th,
#previewRapidoRegex .table thead th,
#previewGruposRegex .table thead th,
#previewRapidoDados .table thead th,
#previewMapeamentoPosicao .table thead th,
#cardCamposPosicao .table thead th {
  text-align: left !important;
}

#previewRapidoDados code {
  color: #000 !important;
}

.card-body {
  font-size: 14px !important;
  /* min-height: 117px !important; */
}

#filiadoTabContent .card-body {
  min-height: 117px !important;
}

.align-items-end {
  align-items: start !important;
}

/* ============================================
   ESTILOS PARA FILTROS DE AGÊNCIAS
   ============================================ */

/* Card de filtros */
.card .card-header {
  border-bottom: 1px solid #dee2e6;
}

.card .card-header h5 {
  color: #495057;
  font-weight: 600;
}

/* Formulário de filtros */
#filtroForm .form-label {
  font-weight: 500;
  color: #495057;
  margin-bottom: 0.5rem;
}

#filtroForm .form-control,
#filtroForm .form-select {
  border: 1px solid #ced4da;
  border-radius: 0.375rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

#filtroForm .form-control:focus,
#filtroForm .form-select:focus {
  border-color: #80bdff;
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Botões do filtro */
#filtroForm .btn {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
}

#filtroForm .btn-primary {
  background-color: #007bff;
  border-color: #007bff;
}

#filtroForm .btn-primary:hover {
  background-color: #0056b3;
  border-color: #004085;
}

#filtroForm .btn-secondary {
  background-color: #6c757d;
  border-color: #6c757d;
}

#filtroForm .btn-secondary:hover {
  background-color: #545b62;
  border-color: #4e555b;
}

/* ============================================
   ESTILOS PARA PAGINAÇÃO
   ============================================ */

/* Informações de paginação */
.pagination-info {
  background-color: #f8f9fa;
  padding: 0.75rem 1rem;
  border-radius: 0.375rem;
  border: 1px solid #e9ecef;
  margin-bottom: 1rem;
}

.pagination-info strong {
  color: #495057;
  font-weight: 600;
}

/* Controles de paginação */
.pagination {
  margin-bottom: 0;
}

.pagination .page-link {
  color: #007bff;
  background-color: #fff;
  border: 1px solid #dee2e6;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
}

.pagination .page-link:hover {
  color: #0056b3;
  background-color: #e9ecef;
  border-color: #dee2e6;
}

.pagination .page-item.active .page-link {
  color: #fff !important;
  background-color: #3a4a40;
  border-color: #3a4a40;
  font-weight: 600;
}

.pagination .page-item.disabled a.page-link {
  color: #6c757d;
  background-color: #fff;
  border-color: #dee2e6;
}

/* Paginação pequena no topo */
.pagination-sm .page-link {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}

/* ============================================
   ESTILOS PARA TABELA DE AGÊNCIAS
   ============================================ */

/* Tabela responsiva com scroll suave */
.table-responsive {
  border-radius: 0.375rem;
  border: 1px solid #dee2e6;
}

.table th {
  background-color: #f8f9fa;
  border-bottom: 2px solid #dee2e6;
  font-weight: 600;
  color: #495057;
  font-size: 0.875rem;
  padding: 0.75rem;
}

.table td {
  padding: 0.75rem;
  font-size: 0.875rem;
  vertical-align: middle;
}

.table-striped>tbody>tr:nth-of-type(odd)>td {
  background-color: rgba(0, 0, 0, 0.02);
}

.table-hover>tbody>tr:hover>td {
  background-color: rgba(0, 123, 255, 0.05);
}

/* Badges na tabela */
.table .badge {
  font-size: 0.75rem;
  padding: 0.375rem 0.5rem;
  font-weight: 500;
}

.table .badge.bg-success {
  background-color: #198754 !important;
  min-width: 84.73px;
}

.table .badge.bg-danger {
  background-color: #dc3545 !important;
  min-width: 84.73px;
}

.table .badge.bg-secondary {
  min-width: 84.73px;
}


/* Botões de ação na tabela */
.table .btn-group .btn {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  font-weight: 500;
}

.table .btn-sm {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 0.2rem;
  color: #000 !important;
}

/* ============================================
   RESPONSIVIDADE
   ============================================ */

@media (max-width: 768px) {

  /* Filtros em dispositivos móveis */
  #filtroForm .col-md-3,
  #filtroForm .col-md-4,
  #filtroForm .col-md-2 {
    margin-bottom: 1rem;
  }

  /* Paginação em dispositivos móveis */
  .pagination {
    justify-content: center;
  }

  .pagination .page-link {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
  }

  /* Tabela em dispositivos móveis */
  .table {
    font-size: 0.8rem;
  }

  .table th,
  .table td {
    padding: 0.5rem;
  }
}

/* ============================================
   UTILIDADES EXTRAS
   ============================================ */

/* Loading state para filtros */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Destaque para registros encontrados */
.highlight-search {
  background-color: #fff3cd !important;
  border-left: 3px solid #ffc107;
}

/* Animação suave para mudanças */
.fade-in {
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* ============================================
   ESTILOS PARA ORDENAÇÃO DA TABELA
   ============================================ */

/* Headers ordenáveis */
.sortable-header {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.5rem 0.25rem;
  transition: all 0.2s ease;
  border-radius: 0.25rem;
}

.sortable-header:hover {
  color: #007bff !important;
  text-decoration: none !important;
  background-color: rgba(0, 123, 255, 0.05);
}

/* Setas ativas (coluna sendo ordenada) */
.sort-arrow-active {
  color: #007bff !important;
  font-size: 1.2rem !important;
  font-weight: bold !important;
  text-shadow: 0 1px 2px rgba(0, 123, 255, 0.3);
}

/* Setas inativas (colunas não ordenadas) */
.sort-arrow-inactive {
  color: #6c757d !important;
  opacity: 0.6;
  font-size: 1.1rem !important;
  font-weight: normal !important;
}

.sortable-header:hover .sort-arrow-inactive {
  opacity: 1;
  color: #007bff !important;
}

.sortable-header:hover .sort-arrow-active {
  transform: scale(1.1);
}

/* Texto do header */
.sortable-header span {
  flex-grow: 1;
  text-align: left;
}

/* Headers da tabela com ordenação */
.table th .sortable-header {
  min-height: 2rem;
  width: 100%;
}

/* Indicador visual para coluna ativa */
.table th:has(.sort-arrow-active) {
  background-color: #e7f3ff !important;
  border-bottom-color: #007bff !important;
  border-bottom-width: 3px !important;
}

/* Fallback para navegadores que não suportam :has() */
.table th.active-sort {
  background-color: #e7f3ff !important;
  border-bottom-color: #007bff !important;
  border-bottom-width: 3px !important;
}

/* Efeito hover na coluna inteira */
.table th:hover {
  background-color: rgba(0, 123, 255, 0.02) !important;
}

/* Centralização para colunas específicas */
.table th.text-center .sortable-header {
  justify-content: center;
}

.table th.text-center .sortable-header span {
  text-align: center;
}

/* ============================================
   RESPONSIVIDADE PARA ORDENAÇÃO
   ============================================ */

@media (max-width: 768px) {
  .sortable-header {
    font-size: 0.8rem;
    padding: 0.25rem;
  }

  .sort-arrow-active {
    font-size: 1rem !important;
  }

  .sort-arrow-inactive {
    font-size: 0.9rem !important;
  }
}

@media (max-width: 576px) {
  .sortable-header span {
    font-size: 0.75rem;
  }
}


/* Modal Adicionar cobrança */
div#modalCobrancaMultipla.modal.fade.show {
  z-index: 1056;
}

.foto-actions.mt-auto {
  margin-top: 0.5rem !important;
}

/* Estilo para links com hover underline nas tabelas */
.hover-underline:hover {
  text-decoration: underline !important;
}

/* Estilos específicos para tabelas de listagem */
.table .text-dark:hover {
  text-decoration: underline !important;
}

/* Status badges clicáveis */
.status-toggle {
  cursor: pointer;
  transition: all 0.2s ease;
}

.status-toggle:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* ============================================
   FIX GLOBAL DE MENUS (Z-INDEX) - AGRESSIVO
   ============================================ */
/* 1. Garantir que a Navbar e Barra Lateral estejam no TOPO ABSOLUTO */
/* HIERARQUIA: Header (User) > Navbar (Menu) > Content */

/* Header onde fica o usuário (Topo Máximo) */
header,
header.bg-gray-800 {
  position: relative;
  z-index: 20005 !important;
  /* Maior que a navbar */
  overflow: visible !important;
}

/* Navbar e Sidebar (Topo Secundário) */
nav.navbar,
header.main-header,
aside.main-sidebar,
.sidebar {
  position: relative;
  /* Ou fixed/sticky, mas com z-index alto */
  z-index: 20000 !important;
  overflow: visible !important;
  /* CRUCIAL: Permitir que dropdowns saiam da caixa */
}

/* 2. Garantir que os Dropdowns tenham z-index superior à Navbar */
.dropdown-menu {
  z-index: 20001 !important;
}

/* 3. Rebaixar todo o conteúdo principal */
body .container-fluid,
body .main-content,
body .content-wrapper,
body .card,
div#wrapper,
main {
  position: relative;
  /* z-index: 1 !important; */
  /* Baixo, mas positivo para funcionalidade interna */
}

/* 4. Fix específico para Tooltips e Modais (acima de tudo) */
.modal-backdrop {
  z-index: 20050 !important;
}

.modal {
  z-index: 20060 !important;
}

.tooltip {
  z-index: 20070 !important;
}

/* 5. Prevenir contexts de empilhamento acidentais na Navbar */
.navbar-nav,
.nav-item {
  position: static;
  /* Permite que o dropdown se posicione relativo à navbar/janela */
}

/* 6. Correção específica para o conteiner de abas que pode estar cobrindo */
.method-tabs {
  position: relative;
  z-index: 1;
}
