/* Tabelas de Listagem, Badges de Serviço e Estados de Carregamento */

.tabela-container {
  background: var(--fundo-card);
  border-radius: var(--raio-bloco);
  border: 1px solid var(--borda-suave);
  overflow: hidden;
  box-shadow: var(--sombra-card);
  transition: all 0.3s ease;
}

.tabela-cabecalho {
  padding: 22px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--borda-suave);
  background: var(--fundo-card);
}

.tabela-titulo {
  font-size: 1.35rem;
  color: var(--texto-principal);
  font-weight: 800;
  letter-spacing: -0.4px;
}

.tabela-subtitulo {
  font-size: 0.88rem;
  color: var(--texto-secundario);
  margin-top: 2px;
}

.seletor-busca,
.seletor-por-pagina {
  height: 42px;
  padding: 0 14px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--texto-input);
  background-color: var(--fundo-input);
  border: 1.5px solid var(--borda-input);
  border-radius: 12px;
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.seletor-busca:focus,
.seletor-por-pagina:focus {
  border-color: var(--cor-borda-foco);
  box-shadow: 0 0 0 3px var(--sombra-foco);
}

.tabela-scroll {
  width: 100%;
  overflow-x: auto;
}

.tabela-processos {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.tabela-processos th {
  background-color: var(--fundo-readonly);
  padding: 12px 14px;
  font-size: 0.70rem;
  font-weight: 800;
  color: var(--texto-secundario);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border-bottom: 1px solid var(--borda-suave);
  white-space: nowrap;
}

.tabela-processos td {
  padding: 12px 14px;
  font-size: 0.80rem;
  border-bottom: 1px solid var(--borda-suave);
  color: var(--texto-principal);
  vertical-align: middle;
}

.linha-processo {
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s ease, transform 0.1s ease;
}

.linha-processo:hover {
  background-color: rgba(124, 58, 237, 0.12) !important;
}

.tabela-processos tr:hover {
  background-color: rgba(124, 58, 237, 0.12) !important;
}

.linha-processo.linha-selecionada-abrir {
  background-color: rgba(124, 58, 237, 0.3) !important;
}

@keyframes pulsarFocoLinha {
  0% {
    box-shadow: inset 4px 0 0 #7c3aed, 0 0 0 0 rgba(124, 58, 237, 0.45);
  }
  50% {
    box-shadow: inset 4px 0 0 #7c3aed, 0 0 0 4px rgba(124, 58, 237, 0.18);
  }
  100% {
    box-shadow: inset 4px 0 0 #7c3aed, 0 0 0 0 rgba(124, 58, 237, 0);
  }
}

.linha-processo.linha-retorno-foco {
  background-color: rgba(124, 58, 237, 0.28) !important;
  box-shadow: inset 4px 0 0 #a855f7;
  animation: pulsarFocoLinha 1.4s ease-out 2;
  outline: none;
}

.texto-nome {
  font-size: 0.80rem;
  font-weight: 700;
  color: var(--cor-link);
}

.texto-data {
  font-size: 0.80rem;
  color: var(--texto-secundario);
  font-weight: 600;
  white-space: nowrap;
}

.texto-mono {
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 0.80rem;
  font-weight: 600;
  letter-spacing: 0.4px;
  white-space: nowrap;
  color: var(--texto-principal);
}

.badge-placa {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-family: 'Consolas', 'Courier New', monospace;
  font-weight: 700;
  font-size: 0.78rem;
  background-color: var(--fundo-input);
  color: var(--texto-principal);
  letter-spacing: 0.8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--borda-input);
  white-space: nowrap;
}

/* Badges de Tipo de Serviço (Design System Moderno) */
.badge-servico {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  white-space: nowrap;
  transition: all 0.2s ease;
}

/* Cores das Badges de Serviço — Modo Claro (Padrão) */
.badge-transferencia {
  background-color: #eff6ff !important;
  color: #1d4ed8 !important;
  border: 1px solid #bfdbfe !important;
}

.badge-emplacamento {
  background-color: #f5f3ff !important;
  color: #6d28d9 !important;
  border: 1px solid #ddd6fe !important;
}

.badge-2avia {
  background-color: #fefce8 !important;
  color: #a16207 !important;
  border: 1px solid #fef08a !important;
}

.badge-alteracao {
  background-color: #ecfeff !important;
  color: #0e7490 !important;
  border: 1px solid #a5f3fc !important;
}

.badge-baixa {
  background-color: #fef2f2 !important;
  color: #b91c1c !important;
  border: 1px solid #fecaca !important;
}

.badge-padrao {
  background-color: #f1f5f9 !important;
  color: #475569 !important;
  border: 1px solid #cbd5e1 !important;
}

/* Cores das Badges de Serviço — Modo Escuro */
html[data-theme="dark"] .badge-transferencia {
  background-color: rgba(59, 130, 246, 0.16) !important;
  color: #93c5fd !important;
  border: 1px solid rgba(59, 130, 246, 0.35) !important;
}

html[data-theme="dark"] .badge-emplacamento {
  background-color: rgba(139, 92, 246, 0.18) !important;
  color: #d8b4fe !important;
  border: 1px solid rgba(139, 92, 246, 0.4) !important;
}

html[data-theme="dark"] .badge-2avia {
  background-color: rgba(234, 179, 8, 0.16) !important;
  color: #fde047 !important;
  border: 1px solid rgba(234, 179, 8, 0.35) !important;
}

html[data-theme="dark"] .badge-alteracao {
  background-color: rgba(6, 182, 212, 0.16) !important;
  color: #67e8f9 !important;
  border: 1px solid rgba(6, 182, 212, 0.35) !important;
}

html[data-theme="dark"] .badge-baixa {
  background-color: rgba(239, 68, 68, 0.16) !important;
  color: #fca5a5 !important;
  border: 1px solid rgba(239, 68, 68, 0.35) !important;
}

html[data-theme="dark"] .badge-padrao {
  background-color: rgba(148, 163, 184, 0.14) !important;
  color: #cbd5e1 !important;
  border: 1px solid rgba(148, 163, 184, 0.25) !important;
}

/* Spinner e Estado Vazio */
.tabela-carregando {
  text-align: center;
  padding: 40px;
  color: var(--texto-secundario);
}

.spinner-carregando {
  width: 32px;
  height: 32px;
  margin: 0 auto 12px;
  border: 3px solid var(--borda-suave);
  border-top-color: var(--cor-primaria);
  border-radius: 50%;
  animation: girar 0.7s linear infinite;
}

.tabela-vazio {
  text-align: center;
  padding: 40px;
  color: var(--texto-secundario) !important;
}
