/* Tabela Principal */
#tblCompras {
  width: 100% !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  margin-bottom: 0 !important;
}

/* Cabeçalho da Tabela */
#tblCompras thead th {
  background-color: #f8fafc !important;
  color: #64748b !important;
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  padding: 14px 18px !important;
  border-bottom: 1px solid #e2e8f0 !important;
  white-space: nowrap !important;
}

/* Linhas e Transições */
#tblCompras tbody tr {
  transition: background-color 0.15s ease-in-out !important;
}

#tblCompras tbody tr:hover {
  background-color: #f1f5f9 !important; /* Destaque no Hover */
}

/* Células de Dados */
#tblCompras tbody td {
  padding: 14px 18px !important;
  font-size: 0.875rem !important;
  color: #334155 !important;
  border-bottom: 1px solid #f1f5f9 !important;
  vertical-align: middle !important;
}

#tblCompras tbody tr:last-child td {
  border-bottom: none !important;
}

/* Links dos Pedidos e Fornecedores */
#tblCompras tbody td a {
  color: #2563eb !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  transition: color 0.15s ease !important;
}

#tblCompras tbody td a:hover {
  color: #1d4ed8 !important;
  text-decoration: underline !important;
}

/* Badges de Status Modernas (Bootstrap 5 Pastel / Soft Badges) */
.badge {
  padding: 6px 12px !important;
  font-size: 0.725rem !important;
  font-weight: 600 !important;
  border-radius: 9999px !important;
  letter-spacing: 0.025em !important;
  display: inline-block !important;
}

/* Badge APROVADO */
.badge-success, .bg-success {
  background-color: #dcfce7 !important;
  color: #15803d !important;
  border: 1px solid #bbf7d0 !important;
}

/* Badge RASCUNHO */
.badge-secondary, .bg-secondary {
  background-color: #ffc107 !important;
  color: #6c757d !important;
  border: 1px solid #e2e8f0 !important;
}

/* Botões de Ação na Tabela */
#tblCompras .btn-link {
  color: #64748b !important;
  border-radius: 6px !important;
  padding: 6px 10px !important;
  transition: all 0.2s ease !important;
}

#tblCompras .btn-link:hover {
  background-color: #e2e8f0 !important;
  color: #0f172a !important;
}




/* =========================================================
   DESIGN SYSTEM - FORMULÁRIOS E ABAS (AdminLTE 4)
   ========================================================= */

/* Estilização das Abas (Tabs) */
.nav-tabs {
    border-bottom: 2px solid #e2e8f0 !important;
}

.nav-tabs .nav-link {
    color: #64748b !important;
    font-weight: 500 !important;
    border: none !important;
    padding: 12px 20px !important;
    transition: all 0.2s ease !important;
}

.nav-tabs .nav-link.active {
    color: #0d6efd !important;
    border-bottom: 2px solid #0d6efd !important;
    background: transparent !important;
}

/* Estilização de Labels e Inputs */
label {
    font-size: 0.75rem !important;
    text-transform: uppercase !important;
    font-weight: 700 !important;
    color: #64748b !important;
    margin-bottom: 6px !important;
    letter-spacing: 0.02em !important;
}

.form-control, .form-select {
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    font-size: 0.9rem !important;
    padding: 10px 14px !important;
}

.form-control:focus {
    border-color: #0d6efd !important;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1) !important;
}

/* Integração Select2 com Bootstrap 5 */
.select2-container--classic .select2-selection--single {
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    height: 42px !important;
    padding: 6px !important;
}

/* Tabela de Itens (Uniformizar com a de Compras) */
.tblItens, .tblAddItem {
    width: 100% !important;
    table-layout: fixed !important;
}

.tblItens thead th, .tblAddItem thead th {
    background-color: #f8fafc !important;
    color: #64748b !important;
    font-size: 0.70rem !important;
    text-transform: uppercase !important;
    padding: 12px 10px !important;
    border-bottom: 2px solid #e2e8f0 !important;
}

.tblItens tbody td {
    padding: 12px 10px !important;
    border-bottom: 1px solid #f1f5f9 !important;
    font-size: 0.85rem !important;
}

/* Botões de Ação na Tabela */
.btnAddItemGrade, .btnSetLnItem {
    color: #0d6efd !important;
    border: 1px solid #d1d5db !important;
    background: #ffffff !important;
    font-weight: 600 !important;
    padding: 8px 16px !important;
    border-radius: 8px !important;
}

.btnAddItemGrade:hover, .btnSetLnItem:hover {
    background: #f8fafc !important;
}







/* =========================================================
   CONTAINER DE BUSCA COM AUTOCOMPLETE DROPDOWN
   ========================================================= */

.busca-container {
  position: relative !important;
  width: 100%;
}

/* Esconde o resultado por padrão */
.busca-container .resultado-busca {
  position: absolute !important;
  top: 100% !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 1050 !important; /* Fica por cima dos outros campos */
  background-color: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1) !important;
  max-height: 240px !important; /* Limita a altura */
  overflow-y: auto !important; /* Adiciona scroll se tiver muitos resultados */
  margin-top: 4px !important;
  display: none; /* Controlado via JS */
}

/* Itens da lista de sugestões */
.busca-container .resultado-busca .item-sugestao {
  padding: 10px 14px !important;
  font-size: 0.85rem !important;
  color: #334155 !important;
  cursor: pointer !important;
  border-bottom: 1px solid #f1f5f9 !important;
  transition: background-color 0.15s ease, color 0.15s ease !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.busca-container .resultado-busca .item-sugestao:last-child {
  border-bottom: none !important;
}

/* Efeito Hover e Foco no Item */
.busca-container .resultado-busca .item-sugestao:hover,
.busca-container .resultado-busca .item-sugestao.active {
  background-color: #f1f5f9 !important;
  color: #2563eb !important;
  font-weight: 500 !important;
}