:root {
  --primary-color: #3498db;
  --secondary-color: #855d0f;
  --accent-color: #FFF8F3;
  --text-color: #ecf0f1;
  --text-secondary-color: #000f1f;
  --background-color: #221B19;
  --success-color: #48bb78;
  --warning-color: #d69e2e;
  --danger-color: #e53e3e;
  --info-color: #3182ce;
  --gray-100: #f7fafc;
  --gray-200: #edf2f7;
  --gray-300: #e2e8f0;
  --gray-400: #cbd5e0;
  --gray-500: #a0aec0;
  --gray-600: #718096;
  --gray-700: #4a5568;
  --gray-800: #2d3748;
  --gray-900: #1a202c;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: url('/img/Fundo.png') no-repeat center center fixed;
  background-size: cover;
}

.menu-lateral {
  position: fixed;
  left: -250px;
  top: 0;
  width: 250px;
  height: 100%;
  background-color: var(--background-color);
  z-index: 1000 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 20px;
  transition: all 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.menu-lateral.ativo {
  left: 0;
}

.menu-lateral ul {
  list-style-type: none;
  padding: 0;
  width: 100%;
  margin-top: 20px;
}

.menu-lateral ul li {
  padding: 15px 30px;
}

.menu-lateral ul li a {
  text-decoration: none;
  color: var(--text-color);
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.menu-lateral ul li:hover {
  background-color: var(--secondary-color);
}

.menu-lateral::-webkit-scrollbar {
  width: 6px;
}

.menu-lateral::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
}

.menu-lateral::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

.logo-container {
  width: 100%;
  text-align: center;
}

.logo-menu {
  max-width: 180px;
  height: auto;
  border-radius: 10px;
}

.botao-menu {
  background-color: #221B19;
  position: fixed;
  left: 12px;
  top: 12px;
  z-index: 6;
  border-radius: 5px;
  font-size: 20px;
  border: none;
  padding: 8px 13px;
  cursor: pointer;
  color: #FFF8F3;
  transition: margin-left 0.5s ease;
}

.botao-menu:hover {
  background-color: #3a2e2b;
}

.botao-menu.ativo {
  left: 190px;
  top: 30px;
}

.conteudo {
  margin-left: 80px;
  padding: 40px;
  background-color: #FFF8F3; /* <- COR CLARA FIXA */
  background-size: cover;
  transition: 0.5s ease;
}

.conteudo.ativo {
  margin-left: 250px;
}

.conteudo h1,
.conteudo h2 {
  font-size: 20px;
  margin-bottom: 20px;
}

.background {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

.background.ativo {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

table {
  width: 100%;
  table-layout: fixed;
}

table th, table td {
  white-space: nowrap;
  padding: 8px 10px;
  border-bottom: 1px solid #ddd;
  border-collapse: collapse;
}

table th {
  background-color: #221B19;
  color: white;
}

table tr:nth-child(even) {
  background-color: #f9f9f9;
}

table tr:hover {
  background-color: #f1f1f1;
}

.form-container {
  display: block;
  width: 100%;
  max-width: 1500px;
  margin: 20px auto;
  padding: 20px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  position: relative !important;
  z-index: auto !important; /* Permitir que filhos tenham z-index próprio */
}

form {
  width: 100%;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px 25px;
  margin-top: 20px;
}

.form-grid input,
.form-grid select {
  width: 100%;
  padding: 12px;
  box-sizing: border-box;
  border-radius: 5px;
  border: 1px solid #ccc;
}

.form-grid .full-width {
  grid-column: 1 / -1;
}

/* Para campos que devem ocupar 2 colunas em desktop */
.form-grid .half-width {
  grid-column: span 2;
}

/* Media Queries para Responsividade */

/* Tablets - 2 colunas */
@media (max-width: 1024px) {
  .form-container {
    max-width: 95%;
    margin: 15px auto;
    padding: 15px;
  }
  
  .form-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px 20px;
  }
}

/* Tablets pequenos */
@media (max-width: 768px) {
  .form-container {
    margin: 10px;
    padding: 15px;
    border-radius: 8px;
  }
  
  .form-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px 15px;
  }
  
  .form-grid input,
  .form-grid select {
    padding: 10px;
    font-size: 16px; /* Evita zoom no iOS */
  }
}

/* Smartphones - 1 coluna */
@media (max-width: 480px) {
  .form-container {
    margin: 5px;
    padding: 12px;
    border-radius: 6px;
  }
  
  .form-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  
  .form-grid input,
  .form-grid select {
    padding: 12px;
    font-size: 16px;
  }
}

/* Para telas muito pequenas */
@media (max-width: 320px) {
  .form-container {
    margin: 2px;
    padding: 10px;
  }
  
  .form-grid {
    gap: 8px;
  }
  
  .form-grid input,
  .form-grid select {
    padding: 10px;
  }
}

@media (max-width: 480px) {
  .form-grid .half-width {
    grid-column: span 1;
  }
}

/* ========== TABELA DESPESAS ========== */

#tabelaDespesas {
  table-layout: fixed;
  width: 100%;
}

#tabelaDespesas th, #tabelaDespesas td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#tabelaDespesas th:nth-child(1),
#tabelaDespesas td:nth-child(1) {
  width: 100px;
  text-align: center;
}

#tabelaDespesas th:nth-child(2),
#tabelaDespesas td:nth-child(2) {
  width: auto;
  text-align: left;
}

#tabelaDespesas th:nth-child(3),
#tabelaDespesas td:nth-child(3) {
  width: 150px;
  text-align: center;
}

/* Container dos botões (seguindo padrão do fornecedor) */
#tabelaDespesas .btn-group {
  display: inline-flex;
  gap: 5px;
  justify-content: center;
  align-items: center;
}

/* Botões individuais */
#tabelaDespesas .btn-acao {
  padding: 5px 8px !important;
  font-size: 12px !important;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  transition: opacity 0.2s ease;
  white-space: nowrap;
  min-width: auto;
}

#tabelaDespesas .btn-editar {
  background: #221b19 !important;
  color: white !important;
}

#tabelaDespesas .btn-excluir {
  background: #dc3545 !important;
  color: white !important;
}

#tabelaDespesas .btn-acao:hover {
  opacity: 0.8;
}

/* Garantir que as células não tenham overflow visual */
#tabelaDespesas td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  padding: 8px 10px;
  border-bottom: 1px solid #ddd;
}

/* EXCEÇÃO: Coluna de descrição pode quebrar linha */
#tabelaDespesas td:nth-child(2) {
  white-space: normal;
  overflow: visible;
  text-overflow: initial;
  max-height: 60px;
  line-height: 1.4;
}

.form-grid input[name="nome"],
.form-grid input[name="endereco"],
.form-grid input[name="complemento"],
.form-grid input[name="bairro"],
.form-grid input[name="email"] {
  grid-column: span 3;
}

.actions {
  grid-column: span 3;
  display: flex;
  gap: 20px;
  justify-content: flex-start;
  margin-top: 20px;
}

.actions button {
  padding: 12px 24px;
  min-width: 120px;
  flex: 0 0 auto;
}

button, input[type="submit"] {
  padding: 10px 15px;
  background-color: #221B19;
  border: none;
  color: white;
  border-radius: 5px;
  cursor: pointer;
  transition: 0.3s;
}

button:hover, input[type="submit"]:hover {
  background-color: #3a2e2b;
}

.cards {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.card {
  flex: 1;
  min-width: 220px;
  background: #fff;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease;
}

.card:hover {
  transform: scale(1.03);
}

.card h3 {
  margin-bottom: 10px;
  color: var(--accent-color);
}

.card p {
  font-size: 18px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .form-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .menu-lateral {
    z-index: 9999 !important;;
    width: 250px;
  }
  .botao-menu.ativo {
    left: 260px;
  }
  .conteudo.ativo {
    margin-left: 270px;
  }
  .card {
    min-width: 100%;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .actions {
    flex-direction: column;
    grid-column: span 1;
  }
  .actions button {
    width: 100%;
  }
  table {
    min-width: 600px;
  }
  
  table th, table td {
    padding: 6px 8px;
    font-size: 13px;
  }
  
  /* Ocultar colunas menos importantes */
  .d-md-none {
    display: none !important;
  }
  
  /* Responsividade para despesas */
  #tabelaDespesas th:nth-child(1),
  #tabelaDespesas td:nth-child(1) {
    width: 60px;
    min-width: 60px;
  }
  
  #tabelaDespesas th:nth-child(3),
  #tabelaDespesas td:nth-child(3) {
    width: 100px;
    min-width: 100px;
  }
  
  #tabelaDespesas .btn-acao {
    padding: 4px 6px !important;
    font-size: 11px !important;
  }
}

@media (max-width: 480px) {
  #tabelaDespesas .btn-group {
    flex-direction: column;
    gap: 2px;
  }
  
  #tabelaDespesas .btn-acao {
    width: 100%;
    max-width: 70px;
  }
}

.mensagem-sucesso {
  background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%) !important;
  color: #155724 !important;
  padding: 15px 20px 15px 50px !important;
  border: none !important;
  border-left: 5px solid #28a745 !important;
  border-radius: 8px !important;
  margin: 15px 0 !important;
  font-weight: 600 !important;
  box-shadow: 0 4px 15px rgba(40, 167, 69, 0.2) !important;
  animation: mensagemEntrada 0.6s ease-out !important;
  position: relative;
}

.mensagem-sucesso::before {
  content: '✅';
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
}

.mensagem-erro {
  background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%) !important;
  color: #721c24 !important;
  padding: 15px 20px 15px 50px !important;
  border: none !important;
  border-left: 5px solid #dc3545 !important;
  border-radius: 8px !important;
  margin: 15px 0 !important;
  font-weight: 600 !important;
  box-shadow: 0 4px 15px rgba(220, 53, 69, 0.2) !important;
  animation: mensagemEntrada 0.6s ease-out !important;
  position: relative;
}

.mensagem-erro::before {
  content: '❌';
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
}

@keyframes mensagemEntrada {
  0% { 
    opacity: 0; 
    transform: translateY(-20px) scale(0.95); 
  }
  60% { 
    opacity: 1; 
    transform: translateY(3px) scale(1.02); 
  }
  100% { 
    opacity: 1; 
    transform: translateY(0) scale(1); 
  }
}

.hidden {
  display: none;
}

/* Botões finais */
.botoes-finais {
  display: flex;
  gap: 15px;
  margin-top: 30px;
}

.btn-salvar {
  padding: 10px 20px;
  background: #333;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

.btn-voltar {
  padding: 10px 20px;
  background: #f0f0f0;
  color: #333;
  border: 1px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

.btn-salvar:hover {
  background: #555;
}

.btn-voltar:hover {
  background: #e0e0e0;
}

/* ========== SISTEMA DE CNPJ E FORMULÁRIOS MELHORADOS ========== */

/* Containers de entrada com botões */
.input-group {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}

.input-group input {
  flex: 1;
}

/* Botões de CNPJ */
.btn-cnpj,
.btn-outline-primary {
  flex-shrink: 0;
  padding: 8px 12px;
  background: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  white-space: nowrap;
  transition: all 0.3s ease;
}

.btn-cnpj:hover,
.btn-outline-primary:hover {
  background: #0056b3;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Seções do formulário organizadas */
.form-section {
  margin-bottom: 25px;
  padding: 20px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: #f8f9fa;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  position: relative !important;
  z-index: 1 !important; /* BAIXO - para ficar atrás do dropdown */
}

/* Seção de fornecedor tem prioridade maior */
.form-section:has(.fornecedor-search-container) {
    z-index: 1000 !important; /* ALTO - para container do fornecedor */
    overflow: visible !important; /* NOVO - permitir que dropdown saia da seção */
}

/* ALTERNATIVA se :has() não funcionar - aplicar classe manualmente */
.form-section.fornecedor-section {
    z-index: 1000 !important;
    overflow: visible !important;
}

.form-section h3 {
  margin: 0 0 20px 0;
  color: #495057;
  font-size: 18px;
  font-weight: 600;
  border-bottom: 2px solid #dee2e6;
  padding-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Linhas e colunas do formulário */
.form-row {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
  align-items: flex-end;
  flex-wrap: wrap;
}

/* Form-row também deve permitir overflow */
.form-row:has(.fornecedor-search-container) {
    z-index: 1000 !important;
    overflow: visible !important;
}

/* ALTERNATIVA para form-row */
.form-row.fornecedor-row {
    z-index: 1000 !important;
    overflow: visible !important;
}

.form-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  flex: 1 1 auto;
}

.form-col.col-2 {
  flex: 2 1 300px;
  min-width: 300px;
  max-width: 450px;
}

.form-col.col-3 {
  flex: 3 1 400px;
}

.form-col.col-auto {
  flex: 0 0 auto;
  width: auto;
  min-width: auto;
}

.form-col label {
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  margin-bottom: 0;
}

/* Informações sobre CNPJ */
.info-cnpj {
  background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
  border: 1px solid #2196f3;
  border-radius: 6px;
  padding: 15px;
  margin-bottom: 20px;
  font-size: 14px;
  color: #1565c0;
  animation: slideInDown 0.4s ease;
  box-shadow: 0 2px 8px rgba(33, 150, 243, 0.15);
}

.info-cnpj.hidden {
  display: none;
}

.info-cnpj strong {
  color: #0d47a1;
}

/* Animações */
@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Campo de UF em maiúsculo */
input[name="uf"] {
  text-transform: uppercase;
}

/* Loading específico para CNPJ */
.cnpj-loading-moderno {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(34, 27, 25, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  color: white;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.cnpj-loading-content {
  text-align: center;
  background: white;
  padding: 40px;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
  max-width: 400px;
  animation: slideIn 0.5s ease-out;
}

.cnpj-spinner {
  width: 60px;
  height: 60px;
  margin: 0 auto 20px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #221B19;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.cnpj-loading-title {
  font-size: 24px;
  font-weight: 600;
  color: #221B19;
  margin-bottom: 10px;
}

.cnpj-loading-message {
  font-size: 16px;
  color: #666;
  margin-bottom: 15px;
  line-height: 1.4;
}

.cnpj-loading-steps {
  text-align: left;
  margin-top: 15px;
}

.cnpj-step {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  font-size: 14px;
  color: #888;
  transition: color 0.3s ease;
}

.cnpj-step.active {
  color: #221B19;
  font-weight: 600;
}

.cnpj-step-icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ddd;
  margin-right: 10px;
  transition: all 0.3s ease;
}

.cnpj-step.active .cnpj-step-icon {
  background: #221B19;
  animation: pulse 1s infinite;
}

.cnpj-step.completed .cnpj-step-icon {
  background: #28a745;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

/* MELHORIAS VISUAIS DOS BOTÕES */
.form-actions button {
  padding: 12px 24px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  border-radius: 8px !important;
  transition: all 0.3s ease !important;
  border: none !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  position: relative;
  overflow: hidden;
}

/* Botão Salvar */
.form-actions button[type="submit"] {
  background: #28a745 !important;
  color: white !important;
}

.form-actions button[type="submit"]:hover {
  background: #218838 !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3) !important;
}

/* Botão Voltar */
.form-actions button[type="button"] {
  background: #6c757d !important;
  color: white !important;
}

.form-actions button[type="button"]:hover {
  background: #5a6268 !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3) !important;
}

.form-actions button[type="submit"]::before,
button[form="formFatura"]::before {
  display: none; /* Remove o ::before vazio */
}

/* Efeito ripple nos botões de ação */
.form-actions button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.4s, height 0.4s;
}

.form-actions button:hover::before {
  width: 120%;
  height: 120%;
}

.form-actions button:active {
  transform: translateY(-1px) !important;
  transition: transform 0.1s;
}

/* Estados de loading nos botões */
.btn-loading {
  opacity: 0.7 !important;
  pointer-events: none !important;
  position: relative !important;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

/* MENSAGENS DE FEEDBACK */
.mensagem-feedback {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 15px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  z-index: 10000;
  min-width: 300px;
  animation: slideInRight 0.5s ease-out;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.mensagem-info {
  background: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Auto esconder após 5 segundos */
.mensagem-feedback {
  animation: slideInRight 0.5s ease-out, fadeOut 0.5s ease-out 4.5s forwards;
}

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

/* Melhorias gerais nos inputs */
input[type="text"],
input[type="email"],
input[type="tel"],
select {
  transition: all 0.3s ease;
  font-size: 14px;
  padding: 10px 12px;
  border: 1px solid #ced4da;
  border-radius: 4px;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
select:focus {
  border-color: #007bff;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
  outline: none;
  transform: translateY(-1px);
}

/* Estados de validação melhorados */
input:invalid:not(:focus) {
  border-color: #dc3545;
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

input:valid:not(:focus) {
  border-color: #28a745;
}

/* Melhorias na tabela de fornecedores */
#tabelaFornecedores tbody tr {
  transition: all 0.2s ease;
}

#tabelaFornecedores tbody tr:hover {
  background-color: #f8f9fa;
  transform: scale(1.005);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Campos obrigatórios com indicador visual */
input:required,
select:required {
  position: relative;
}

input:required:not(:focus):invalid {
  border-left: 4px solid #dc3545;
}

/* Melhorias no campo de busca */
#campoBusca {
  border: 2px solid #dee2e6;
  border-radius: 6px;
  transition: all 0.3s ease;
  padding: 10px 15px;
  font-size: 14px;
}

#campoBusca:focus {
  border-color: #007bff;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
  outline: none;
  transform: translateY(-1px);
}

/* Responsividade melhorada para CNPJ */
@media (max-width: 768px) {
  .form-row {
    flex-direction: column;
    gap: 15px;
  }
  
  .input-group {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  
  .form-section {
    padding: 15px;
    margin-bottom: 20px;
  }
  
  .form-section h3 {
    font-size: 16px;
  }
  
  .btn-cnpj,
  .btn-outline-primary {
    width: 100%;
    margin-top: 5px;
  }
  
  .info-cnpj {
    padding: 12px;
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .form-section {
    padding: 10px;
    margin-bottom: 15px;
  }
  
  .form-col label {
    font-size: 11px;
  }
  
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  select {
    padding: 8px 10px;
    font-size: 13px;
  }
}

/* Melhorias nos placeholders */
::placeholder {
  color: #6c757d;
  opacity: 0.8;
  font-style: italic;
}

input:focus::placeholder {
  opacity: 0.5;
}

/* Indicadores visuais para tipos de pessoa */
.form-section[data-tipo="fisica"] {
  border-left: 4px solid #17a2b8;
}

.form-section[data-tipo="juridica"] {
  border-left: 4px solid #6f42c1;
}

/* Animação de carregamento suave */
.fade-in {
  animation: fadeIn 0.5s ease-in;
}

/* Tooltips informativos */
[data-tooltip] {
  position: relative;
  cursor: help;
}

[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: white;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  z-index: 1000;
  opacity: 0;
  animation: fadeIn 0.3s ease forwards;
}

[data-tooltip]:hover::before {
  content: '';
  position: absolute;
  bottom: 115%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #333;
  z-index: 1000;
}

/* Melhorias de acessibilidade */
input:focus,
select:focus,
button:focus {
  outline: 2px solid #007bff;
  outline-offset: 2px;
}

/* Estilo para colocar as seções TIPO DE PESSOA e DOCUMENTO lado a lado */
.sections-container {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.sections-container .form-section {
  flex: 1;
  margin-bottom: 0;
}

/* Responsividade para telas menores */
@media (max-width: 768px) {
  .sections-container {
    flex-direction: column;
    gap: 0;
  }
  
  .sections-container .form-section {
    margin-bottom: 20px;
  }
}

/* Cabeçalho do formulário com botões à direita */
.form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.form-header h1 {
  margin: 0;
}

.form-actions {
  display: flex;
  gap: 10px;
}

/* botão Buscar CNPJ */
#btn-consultar-cnpj {
  background: var(--background-color) !important;
  color: var(--text-color) !important;
  border: 2px solid var(--background-color) !important;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  font-weight: 600;
}

#btn-consultar-cnpj::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.6s;
}

#btn-consultar-cnpj:hover::before {
  left: 100%;
}

#btn-consultar-cnpj:hover {
  background: var(--secondary-color) !important;
  border-color: var(--secondary-color) !important;
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(34, 27, 25, 0.4);
}

#btn-consultar-cnpj:disabled {
  background: #6c757d !important;
  border-color: #6c757d !important;
  transform: none !important;
  animation: botaoCarregando 1.5s infinite;
  cursor: not-allowed;
}

#btn-consultar-cnpj:disabled::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  border: 2px solid transparent;
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes botaoCarregando {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

/* Valor total à esquerda */
.valor-total-container {
  margin: 20px 0;
}

.valor-total-display {
  text-align: left;
}

.valor-total-display label {
  font-size: 1.2em;
  font-weight: bold;
  color: #333;
}

/* Cabeçalho da seção com campo à direita */
.section-header-with-field {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 15px;
}

.section-header-with-field h3 {
  margin: 0;
}

.section-header-with-field .form-col {
  margin: 0;
  width: auto;
  min-width: 100px;
  max-width: 110px;
}

/* Garantir inputs com mesma largura */
.form-section input[type="password"],
.form-section input[type="email"],
.form-section input[type="text"] {
  width: auto;
  min-width: 300px !important;
  max-width: 450px !important;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.form-section select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  min-width: 150px !important;
  max-width: 300px !important;
}

.form-section input:focus,
.form-section select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-section input[type="date"],
.form-section input[type="number"] {
  width: auto !important;
  padding: 10px 12px !important;
  border-radius: 4px !important;
  font-size: 14px !important;
  height: auto !important;
  box-sizing: border-box !important;
  max-width: 150px !important;
  flex: none !important;
}

/* Remover borda vermelha de campos preenchidos */
input[type="date"]:not(:invalid):not(:placeholder-shown),
input[type="date"]:valid {
  border-color: #28a745 !important;
}

input[type="date"]:focus {
  border-color: #80bdff !important;
}

/* ESTILOS PARA PAGINAÇÃO */
.pagination-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  padding: 15px 0;
}

.pagination-info {
  font-size: 14px;
  color: #666;
}

.pagination {
  display: flex;
  gap: 5px;
  align-items: center;
}

.pagination button {
  padding: 8px 12px;
  border: 1px solid #5a5656;
  background: #5a5656;
  cursor: pointer;
  border-radius: 4px;
  font-size: 14px;
  transition: background-color 0.2s ease;
}

.pagination button:hover:not(:disabled) {
  background: #5a5656;
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination button.active {
  background: #221B19 !important;
  color: white !important;
  border-color: #221B19 !important;
  box-shadow: 0 2px 8px rgba(34, 27, 25, 0.3) !important;
  font-weight: 600;
}

.pagination button.active:hover {
  background: #3a2e2b !important;
  border-color: #3a2e2b !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(34, 27, 25, 0.4) !important;
}

.pagination-size {
  margin-left: 20px;
}

.pagination-size select {
  padding: 5px 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.pagination-size label {
  margin-right: 8px;
  font-size: 14px;
  color: #666;
}

/* BOTÕES DE AÇÃO NA TABELA */
.btn-acao {
  border: none;
  padding: 5px 8px !important;
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px !important;
  transition: opacity 0.2s ease;
  margin-right: 5px;
  min-width: auto !important;
  width: auto !important;
}

.btn-acao:hover {
  opacity: 0.8;
}

.btn-acao:last-child {
  margin-right: 0;
}

.btn-editar {
  background: #221b19 !important;
  color: white !important;
}

.btn-excluir {
  background: #dc3545 !important;
  color: white !important;
}

/* MODO ESCURO PARA PAGINAÇÃO */
.dark-mode .pagination button {
  background: #444;
  color: #fff;
  border-color: #666;
}

.dark-mode .pagination button:hover:not(:disabled) {
  background: #555;
}

.dark-mode .pagination button.active {
  background: #221B19;
  border-color: #221B19;
}

.dark-mode .pagination-info {
  color: #ccc;
}

.dark-mode .pagination-size select {
  background: #444;
  color: #fff;
  border-color: #666;
}

.dark-mode .pagination-size label {
  color: #ccc;
}

/* RESPONSIVIDADE MOBILE */
@media (max-width: 768px) {
  .pagination-container {
    flex-direction: column;
    gap: 15px;
  }
  
  .pagination {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .pagination-size {
    margin-left: 0;
  }
  
  #tabelaFornecedores th:nth-child(3), /* Nome */
  #tabelaFornecedores td:nth-child(3) {
    width: 25%;
  }
  
  #tabelaFornecedores th:nth-child(6), /* Email */
  #tabelaFornecedores td:nth-child(6) {
    width: 20%;
  }
  
  .btn-acao {
    padding: 4px 6px !important;
    font-size: 11px !important;
    margin-right: 3px !important;
  }
  
  #tabelaFornecedores td:nth-child(7) {
    flex-direction: column !important;
    gap: 2px !important;
  }
  
  .btn-acao {
    margin-right: 0 !important;
    width: 100% !important;
    max-width: 80px !important;
  }
}

/* Seletor de itens por página */
.table-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #666;
  font-weight: 500;
}

.table-controls select {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  background-color: white;
  cursor: pointer;
  transition: border-color 0.3s ease;
}

.table-controls select:focus {
  outline: none;
  border-color: #221B19;
  box-shadow: 0 0 0 2px rgba(34, 27, 25, 0.1);
}

/* Responsividade */
@media (max-width: 768px) {
  .table-controls {
    justify-content: center;
    margin-bottom: 10px;
  }
}

#tabelaClientes td:nth-child(8) {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: flex-start;
}

#tabelaClientes td:nth-child(7) button {
  flex: 0 1 auto;
  padding: 6px 10px;
  min-width: 70px;
}

/* teste*/

#tabelaClientes .btn-acao {
  border: none;
  padding: 5px 8px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
  transition: opacity 0.2s ease;
}

#tabelaClientes .btn-acao:hover {
  opacity: 0.8;
}

#tabelaClientes .btn-editar {
  background: #221b19;
  color: white;
  margin-right: 5px;
}

#tabelaClientes .btn-excluir {
  background: #dc3545;
  color: white;
}

/* ========== LARGURAS DAS COLUNAS CLIENTES ========== */

/* Tornar tabela com layout fixo para controle de larguras */
#tabelaClientes {
  table-layout: fixed;
}

/* Coluna ID - pequena */
#tabelaClientes th:nth-child(1),
#tabelaClientes td:nth-child(1) {
  width: 50px;
  text-align: center;
}

/* Coluna Tipo - pequena */
#tabelaClientes th:nth-child(2),
#tabelaClientes td:nth-child(2) {
  width: 80px;
  text-align: center;
}

/* Coluna Reg Tributário - média */
#tabelaClientes th:nth-child(3),
#tabelaClientes td:nth-child(3) {
  width: 120px;
  text-align: center;
}

/* Coluna Documento - média */
#tabelaClientes th:nth-child(4),
#tabelaClientes td:nth-child(4) {
  width: 150px;
  text-align: center;
}

/* Coluna NOME - DIMINUÍDA */
#tabelaClientes th:nth-child(5),
#tabelaClientes td:nth-child(5) {
  width: 400px;
  word-wrap: break-word;
  white-space: normal;
}

/* Coluna EMAIL - AUMENTADA */
#tabelaClientes th:nth-child(6),
#tabelaClientes td:nth-child(6) {
  width: 300px;
  word-wrap: break-word;
  white-space: normal;
}

/* Coluna Ações - fixa */
#tabelaClientes th:nth-child(7),
#tabelaClientes td:nth-child(7) {
  width: 100px;
  text-align: center;
}

/* ========== PADRONIZAÇÃO DOS BOTÕES DE AÇÃO ========== */

/* SOBRESCREVER todas as regras específicas de tabela */
#tabelaFornecedores td:nth-child(7) button,
#tabelaClientes td:nth-child(8) button,
#tabelaFaturas td:nth-child(8) button,
#tabelaDespesas td:nth-child(3) button,
#tabelaSubsidiarias td:nth-child(3) button,
#tabelaBancos td:nth-child(3) button,
#tabelaUsuarios td:nth-child(6) button,
#tabelaLocalidades td:nth-child(3) button,
.btn-acao {
  /* Tamanho */
  padding: 5px 8px !important;
  font-size: 12px !important;
  min-width: auto !important;
  width: auto !important;
  
  /* Visual consistente */
  border: none;
  border-radius: 3px;
  cursor: pointer;
  transition: opacity 0.2s ease;
  
  /* Espaçamento entre botões */
  margin-right: 5px;
}

/* Último botão sem margem direita */
#tabelaFornecedores td:nth-child(7) button:last-child,
#tabelaClientes td:nth-child(8) button:last-child,
#tabelaFaturas td:nth-child(8) button:last-child,
#tabelaDespesas td:nth-child(3) button:last-child,
#tabelaSubsidiarias td:nth-child(3) button:last-child,
#tabelaBancos td:nth-child(3) button:last-child,
#tabelaUsuarios td:nth-child(6) button:last-child,
#tabelaLocalidades td:nth-child(3) button:last-child {
  margin-right: 0;
}

/* Cores dos botões (manter como está) */
.btn-editar {
  background: #221b19 !important;
  color: white !important;
}

.btn-excluir {
  background: #dc3545 !important;
  color: white !important;
}

.btn-acao:hover {
  opacity: 0.8;
}

/* ========== CENTRALIZAÇÃO DA COLUNA AÇÕES ========== */

/* Centralizar a coluna de ações em todas as tabelas */
#tabelaFornecedores td:nth-child(7),
#tabelaClientes td:nth-child(8),
#tabelaFaturas td:nth-child(8),
#tabelaFaturaRecorrentes td:last-child(7),
#tabelaDespesas td:nth-child(3),
#tabelaSubsidiarias td:nth-child(3),
#tabelaBancos td:nth-child(3),
#tabelaUsuarios td:nth-child(6),
#tabelaLocalidades td:nth-child(3) {
  text-align: center !important;
  vertical-align: middle !important;
  padding: 8px !important;
  
  /* Layout flexível para botões lado a lado */
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 0 !important; /* Sem gap extra - usamos margin-right */
}

/* ========== REMOVER REGRAS CONFLITANTES ========== */

/* Anular regras específicas que estavam causando diferenças */
#tabelaClientes td:nth-child(8) button,
#tabelaFornecedores td:nth-child(9) button {
  flex: none !important;
  min-width: auto !important;
  padding: 5px 8px !important;
}

/* Remover display flex específico conflitante */
#tabelaFornecedores td:nth-child(9),
#tabelaClientes td:nth-child(8) {
  display: flex !important;
  justify-content: center !important;
  gap: 0 !important;
}

/* ========== CABEÇALHO DA COLUNA AÇÕES ========== */

/* Centralizar também o título "Ações" no cabeçalho */
#tabelaFornecedores th:nth-child(7),
#tabelaClientes th:nth-child(8),
#tabelaFaturas th:nth-child(8),
#tabelaDespesas th:nth-child(3),
#tabelaSubsidiarias th:nth-child(3),
#tabelaBancos th:nth-child(3),
#tabelaUsuarios th:nth-child(6),
#tabelaLocalidades th:nth-child(3),
#tabelaFaturaRecorrentes th:nth-child(7) {
  text-align: center !important;
}

#loading-global {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  width: auto !important;
  height: auto !important;
  max-width: 400px !important;
  max-height: 300px !important;
  background: rgba(0, 0, 0, 0.4) !important;
  z-index: 99999 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 0 !important;
  padding: 0 !important;
}

/* Container interno do loading */
#loading-global > div {
  background: white !important;
  padding: 30px !important;
  border-radius: 10px !important;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3) !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 200px !important;
  position: relative !important;
}

/* Texto do loading */
#loading-texto {
  font-size: 14px !important;
  color: #333 !important;
  text-align: center !important;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
  margin-top: 15px !important;
}

/* Loading CNPJ moderno */
#loading-global.cnpj-consulta > div {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%) !important;
  color: white !important;
  border: none !important;
  box-shadow: 0 15px 35px rgba(52, 152, 219, 0.4) !important;
}

/* ========== MELHORIAS LOADING CNPJ ========== */
#loading-global.cnpj-consulta {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%) !important;
  border: none !important;
  box-shadow: 0 15px 35px rgba(52, 152, 219, 0.4) !important;
  animation: loadingEntrada 0.4s ease-out;
}

#loading-global.cnpj-consulta #loading-texto {
  color: white !important;
  font-weight: 600 !important;
  text-shadow: 0 1px 3px rgba(0,0,0,0.2) !important;
}

#loading-global.cnpj-consulta .spinner,
#loading-global.cnpj-consulta > div > div:first-child {
  border-color: rgba(255,255,255,0.3) !important;
  border-top-color: white !important;
}

/* Garantir que não interfira com o resto da página */
body.loading-active {
  overflow: auto !important;
  pointer-events: auto !important;
}

/* Responsividade do loading */
@media (max-width: 768px) {
  #loading-global {
    max-width: 90% !important;
    padding: 0 10px !important;
  }
  
  #loading-global > div {
    padding: 20px !important;
    min-width: 250px !important;
  }
  
  #loading-texto {
    font-size: 13px !important;
  }
}

@keyframes loadingEntrada {
  from { 
    opacity: 0; 
    transform: translate(-50%, -50%) scale(0.8); 
  }
  to { 
    opacity: 1; 
    transform: translate(-50%, -50%) scale(1); 
  }
}

/* ========== NOTIFICAÇÃO DE SUCESSO CNPJ ========== */
.cnpj-sucesso-notificacao {
  position: fixed;
  top: 20px;
  right: 20px;
  background: linear-gradient(45deg, #28a745, #20c997);
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: 600;
  z-index: 10001;
  animation: notificacaoEntrada 0.5s ease-out, notificacaoSaida 0.5s ease-out 3.5s forwards;
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
  display: flex;
  align-items: center;
  gap: 8px;
}

.cnpj-sucesso-notificacao::before {
  content: '✅';
  font-size: 16px;
}

@keyframes notificacaoEntrada {
  from { 
    opacity: 0; 
    transform: translateX(100%); 
  }
  to { 
    opacity: 1; 
    transform: translateX(0); 
  }
}

@keyframes notificacaoSaida {
  to { 
    opacity: 0; 
    transform: translateX(100%); 
  }
}

/* ========== LOADING DURANTE SALVAMENTO ========== */
.form-salvando {
  position: relative;
  pointer-events: none;
  opacity: 0.8;
}

.form-salvando::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.9);
  z-index: 100;
  border-radius: 10px;
}

.form-salvando::before {
  content: '💾 Salvando dados...';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--background-color);
  color: var(--text-color);
  padding: 20px 30px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 16px;
  z-index: 101;
  animation: pulseSave 1.5s infinite;
  box-shadow: 0 8px 25px rgba(0,0,0,0.2);
  border: 2px solid var(--primary-color);
}

@keyframes pulseSave {
  0%, 100% { 
    transform: translate(-50%, -50%) scale(1); 
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
  }
  50% { 
    transform: translate(-50%, -50%) scale(1.05); 
    box-shadow: 0 12px 35px rgba(0,0,0,0.3);
  }
}

/* ========== TRANSIÇÕES SUAVES ENTRE SEÇÕES ========== */
#formSection:not(.hidden) {
  animation: entradaFormulario 0.5s ease-out;
}

#tabelaSection:not(.hidden) {
  animation: entradaTabela 0.5s ease-out;
}

@keyframes entradaFormulario {
  from { 
    opacity: 0; 
    transform: translateX(30px); 
  }
  to { 
    opacity: 1; 
    transform: translateX(0); 
  }
}

@keyframes entradaTabela {
  from { 
    opacity: 0; 
    transform: translateX(-30px); 
  }
  to { 
    opacity: 1; 
    transform: translateX(0); 
  }
}

/* Garantir opacidade total sempre */
.conteudo,
.conteudo.ativo {
  opacity: 1 !important;
  filter: none !important;
}

.conteudo *,
.conteudo h1,
.conteudo h2,
.conteudo table,
.conteudo .cards,
.conteudo .card,
.conteudo .form-container {
  opacity: 1 !important;
  filter: none !important;
}

/* ========== AJUSTES FINAIS FORNECEDORES - CORES E POSIÇÕES ========== */

/* 1. TÍTULO "Fornecedores Cadastrados" com cor #221B19 */
.table-container h1 {
  margin: 0;
  padding: 20px;
  background: #221B19 !important; /* Cor solicitada */
  color: white;
  font-size: 24px;
  font-weight: 600;
}

/* 2. BOTÕES "Exportar Excel" e "Novo Fornecedor" com cor #221B19 */
.filtros button {
  padding: 10px 15px;
  border: 1px solid #221B19 !important; /* Cor solicitada */
  background: #221B19 !important; /* Cor solicitada */
  color: white;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}

.filtros button:hover {
  background: #3a2e2b !important; /* Hover mais claro */
  border-color: #3a2e2b !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 3. MOVER "Itens por página" para alinhamento dos botões (Imagem 1) */
.toolbar {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  border: 1px solid #e9ecef;
  position: relative; /* Para posicionamento absoluto do seletor */
}

.filtros {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

/* Posicionar "Itens por página" no canto direito, alinhado com os botões */
.itens-por-pagina-toolbar {
  position: absolute;
  top: 15px;
  right: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 10;
}

.itens-por-pagina-toolbar label {
  font-weight: 600;
  color: #495057;
  font-size: 14px;
  white-space: nowrap;
}

.itens-por-pagina-toolbar select {
  padding: 8px 12px;
  border: 1px solid #ced4da;
  border-radius: 6px;
  background: white;
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.2s;
  min-width: 60px;
}

.itens-por-pagina-toolbar select:focus {
  outline: none;
  border-color: #221B19;
  box-shadow: 0 0 0 0.2rem rgba(34, 27, 25, 0.25);
}

/* 5. REMOVER controles de paginação antigos da toolbar */
.paginacao-controles {
  display: none !important; /* Esconder o controle antigo */
}

/* 6. REDESENHAR a navegação inferior (Imagem 2) */
.paginacao-navegacao {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 15px;
  background: #f8f9fa;
  border-radius: 0 0 8px 8px;
  margin-top: 0;
}

/* "Mostrando numero de registro */
.contador-inferior {
  color: #6c757d;
  font-size: 14px;
  font-weight: 500;
  order: 1;
}

/* 7. BOTÕES DE NAVEGAÇÃO com cor #221B19 e símbolos estilosos */
.paginacao-botoes {
  display: flex;
  align-items: center;
  background: #FFF8F3; /* Bege SVN */
  padding: 8px;
  border-radius: 25px; /* Bem arredondado */
  box-shadow: 0 4px 12px rgba(34, 27, 25, 0.4);
  order: 2;
  gap: 4; /* Espacamento botões */
}

/* Botão Prev (Anterior) */
.paginacao-botoes > button:first-child {
  background: #221B19 !important;
  color: white !important;
  border: none !important;
  padding: 10px 16px !important;
  border-radius: 20px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: auto !important;
  height: auto !important;
  margin-right: 4px;
}

/* Botão Next (Próxima) */
.paginacao-botoes > button:last-child {
  background: #221B19 !important;
  color: white !important;
  border: none !important;
  padding: 10px 16px !important;
  border-radius: 20px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: auto !important;
  height: auto !important;
  margin-left: 4px;
}

/* Hover dos botões Prev/Next */
.paginacao-botoes > button:first-child:hover,
.paginacao-botoes > button:last-child:hover {
  background: #3a2e2b !important; /* Cinza escuro no hover */
  transform: translateY(-1px);
}

/* Botões desabilitados */
.paginacao-botoes > button:first-child:disabled,
.paginacao-botoes > button:last-child:disabled {
  background: #3b424b !important; /* Cinza claro quando desabilitado */
  color: #fff !important;
  opacity: 0.6 !important;
  cursor: not-allowed !important;
  transform: none !important;
}

/* Área dos números (fica no meio) */
.numeros-pagina {
  display: flex;
  gap: 2px !important;
  margin: 0 !important;
  background: white;
  padding: 4px;
  border-radius: 18px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Números de página */
.numeros-pagina button {
  min-width: 36px !important;
  height: 36px !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  border-radius: 14px !important;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
  font-size: 14px;
  color: #221B19 !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Número ativo */
.numeros-pagina button.active {
  background: #221B19 !important; /* Mantém a cor solicitada anteriormente */
  color: white !important;
  box-shadow: 0 2px 6px rgba(34, 27, 25, 0.3) !important;
  font-weight: 600;
}

/* Hover dos números */
.numeros-pagina button:hover:not(.active) {
  background: #767b80 !important;
  color: #ffffff !important;
}

/* Lado direito vazio para balanceamento */
.paginacao-navegacao > div:last-child {
  order: 3;
  width: 200px; /* Mesmo tamanho do contador para balanceamento */
}

/* 8. RESPONSIVIDADE */
@media (max-width: 768px) {
  /* Toolbar responsivo */
  .toolbar {
    padding-bottom: 60px; /* Espaço extra para o seletor */
  }
  
  .itens-por-pagina-toolbar {
    position: relative;
    top: auto;
    right: auto;
    margin-top: 15px;
    width: 100%;
    justify-content: center;
  }
  
  /* Navegação responsiva */
  .paginacao-navegacao {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }
  
  .contador-inferior {
    order: 2;
  }
  
  .paginacao-botoes {
    order: 1;
    flex-wrap: wrap;
    justify-content: center;
    padding: 6px;
    border-radius: 20px;
  }
  
  .paginacao-botoes > button:first-child,
  .paginacao-botoes > button:last-child {
    padding: 8px 12px !important;
    font-size: 12px !important;
  }
  
  .numeros-pagina button {
    min-width: 32px !important;
    height: 32px !important;
    font-size: 13px;
  }
  
  .numeros-pagina {
    padding: 3px;
    border-radius: 16px;
  }
  
  .paginacao-navegacao > div:last-child {
    display: none; /* Ocultar div de balanceamento no mobile */
  }
}

/* ========== MELHORIAS FORNECEDOR V2.0 - ADICIONAIS ========== */

/* Indicadores de ação */
.acao-em-andamento {
  position: relative;
}

.acao-em-andamento::after {
  content: '⏳';
  position: absolute;
  right: -25px;
  top: 50%;
  transform: translateY(-50%);
  animation: spin 2s linear infinite;
  font-size: 14px;
}

.acao-concluida {
  animation: feedbackSucesso 0.8s ease-out;
}

@keyframes feedbackSucesso {
  0% { background-color: transparent; }
  30% { background-color: rgba(40, 167, 69, 0.1); transform: scale(1.02); }
  60% { background-color: rgba(40, 167, 69, 0.2); }
  100% { background-color: transparent; transform: scale(1); }
}

/* Acessibilidade melhorada */
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid var(--primary-color);
  outline-offset: 2px;
}

/* Otimização de performance */
.form-section,
.table-container,
#formSection,
#tabelaSection {
  will-change: transform, opacity;
}

/* 2. CONTAINER RESPONSIVO PARA TABELAS */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  margin-bottom: 1rem;
  -webkit-overflow-scrolling: touch;
}

.table-container {
  overflow-x: auto !important;
  width: 100% !important;
  position: relative;
  overflow-x: scroll;
  overflow-y: auto;
  
  /* Força barra sempre visível */
  scrollbar-width: auto; /* Firefox */
  -ms-overflow-style: scrollbar; /* IE */
}

.table-container::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 20px;
  height: 100%;
  background: linear-gradient(to left, rgba(255,255,255,0.8), transparent);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}

#loading-global,
.campo-preenchido-automatico,
.form-actions button {
  backface-visibility: hidden;
  transform-style: preserve-3d;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Responsividade específica para melhorias */
@media (max-width: 768px) {
  .cnpj-sucesso-notificacao {
    top: 10px;
    right: 10px;
    left: 10px;
    text-align: center;
  }

  #btn-consultar-cnpj:hover {
    transform: none;
  }
  
  .form-salvando::before {
    padding: 15px 20px;
    font-size: 14px;
  }
}

/* Modo escuro (opcional) */
@media (prefers-color-scheme: dark) {
  .campo-preenchido-automatico {
    background: linear-gradient(135deg, #1e3d1e 0%, #2d5a2d 50%, #2c2c2c 100%) !important;
    border-color: #4caf50 !important;
  }
  
  .cnpj-sucesso-notificacao {
    background: linear-gradient(45deg, #2e7d32, #388e3c);
  }
}

/* ========== CARD DESLIZANTE CNPJ ========== */
.slide-card-cnpj {
  position: fixed;
  bottom: 30px;
  left: 30px;
  background: white;
  padding: 20px 25px;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.15);
  border-left: 5px solid #28a745;
  display: flex;
  align-items: center;
  gap: 15px;
  transform: translateX(-150%);
  transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  z-index: 10000;
  max-width: 350px;
  min-width: 300px;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.slide-card-cnpj.show-cnpj {
  transform: translateX(0);
}

.slide-card-cnpj.hide-cnpj {
  transform: translateX(-150%);
  opacity: 0;
}

.icon-success-cnpj {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.icon-success-cnpj span {
  width: 45px;
  height: 45px;
  background: linear-gradient(45deg, #28a745, #20c997);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
  font-weight: bold;
  animation: bounceInCnpj 0.6s ease-out;
}

@keyframes bounceInCnpj {
  0% { transform: scale(0); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.card-content-cnpj {
  flex: 1;
}

.message-title-cnpj {
  font-size: 16px;
  color: #333;
  font-weight: 600;
  margin: 0 0 4px 0;
}

.message-subtitle-cnpj {
  font-size: 13px;
  color: #666;
  margin: 0;
  line-height: 1.3;
}

.close-btn-cnpj {
  background: none;
  border: none;
  color: #999;
  font-size: 18px;
  cursor: pointer;
  padding: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color 0.2s ease;
}

.close-btn-cnpj:hover {
  color: #666;
}

/* Responsividade */
@media (max-width: 768px) {
  .slide-card-cnpj {
    left: 10px;
    right: 10px;
    bottom: 20px;
    max-width: none;
    min-width: auto;
  }
}

/* ========== TABELA FORNECEDORES - LINHAS ZEBRADAS ELEGANTES ========== */
#tabelaFornecedores tbody tr:nth-child(even) {
  background-color: #FFF8F3 !important;
}

#tabelaFornecedores tbody tr:nth-child(odd) {
  background-color: #FFFFFF !important;
}

/* Hover mais elegante */
#tabelaFornecedores tbody tr:hover {
  background-color: #F0F8FF !important;
  transition: background-color 0.2s ease;
}

/* Garantir que as badges mantenham contraste */
#tabelaFornecedores .badge {
  position: relative;
  z-index: 1;
}

/* ======= ESTILO GERAL DO CARD PRINCIPAL ======= */
.card.card-recorrente {
  background-color: #f8f9fa;
  border-left: 6px solid #007bff;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.card.card-recorrente:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.card.card-recorrente h2 {
  font-size: 1.4rem;
  color: #343a40;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card.card-recorrente h2::before {
  content: '🔁';
  font-size: 1.6rem;
}

/* ======= BLOCO DE DADOS RESUMIDOS ======= */
#recorrenteStatus {
  font-size: 1rem;
  color: #495057;
  padding: 5px 0;
  line-height: 1.5;
}

#recorrenteStatus .linha {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px dashed #ccc;
}

#recorrenteStatus .linha:last-child {
  border-bottom: none;
}

#recorrenteStatus .localidade {
  font-weight: 600;
  color: #007bff;
}

/* ======= BOTÃO DE DETALHES ======= */
.btn-detalhes {
  margin-top: 10px;
  background-color: #e2e6ea;
  color: #343a40;
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.btn-detalhes:hover {
  background-color: #d6d8db;
}

/* ======= DETALHES EXPANDÍVEIS ======= */
.detalhes-collapse {
  transition: max-height 0.3s ease, opacity 0.3s ease;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
}

.detalhes-collapse.open {
  max-height: 500px;
  opacity: 1;
}

/* ======= CARDS DE LOCALIDADES NO DASHBOARD ======= */
/* ======= LAYOUT DO GRID RESPONSIVO ======= */
#dashboard-recorrentes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  margin-top: 20px;
}

/* ======= CARD INDIVIDUAL MODERNIZADO ======= */
#dashboard-recorrentes .card-recorrente {
  background: linear-gradient(145deg, #ffffff, #f8f9fa);
  border: 1px solid rgba(0, 123, 255, 0.1);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 
    0 4px 16px rgba(0, 123, 255, 0.08),
    0 1px 4px rgba(0, 0, 0, 0.06);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

/* Efeito glassmorphism sutil */
#dashboard-recorrentes .card-recorrente::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(0, 123, 255, 0.3), 
    transparent
  );
}

#dashboard-recorrentes .card-recorrente:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 
    0 12px 32px rgba(0, 123, 255, 0.15),
    0 4px 16px rgba(0, 0, 0, 0.1);
  border-color: rgba(0, 123, 255, 0.2);
}

/* ======= CABEÇALHO DO CARD ======= */
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

#dashboard-recorrentes .card-recorrente h2 {
  font-size: 1.25rem;
  color: #1a1a1a;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

#dashboard-recorrentes .card-recorrente h2::before {
  content: "📍";
  font-size: 1.1rem;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.1));
}

/* ======= ESTATÍSTICAS PRINCIPAIS ======= */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.stat-item {
  text-align: center;
  padding: 12px 8px;
  border-radius: 12px;
  background: rgba(0, 123, 255, 0.05);
  border: 1px solid rgba(0, 123, 255, 0.1);
  transition: all 0.2s ease;
}

.stat-item:hover {
  background: rgba(0, 123, 255, 0.1);
  transform: translateY(-1px);
}

.stat-number {
  font-size: 1.8rem;
  font-weight: 800;
  color: #007bff;
  display: block;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.75rem;
  color: #6c757d;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ======= CORES ESPECÍFICAS PARA CADA ESTATÍSTICA ======= */
.stat-item.total .stat-number {
  color: #6f42c1;
}
.stat-item.total {
  background: rgba(111, 66, 193, 0.05);
  border-color: rgba(111, 66, 193, 0.1);
}

.stat-item.pendentes .stat-number {
  color: #dc3545;
}
.stat-item.pendentes {
  background: rgba(220, 53, 69, 0.05);
  border-color: rgba(220, 53, 69, 0.1);
}

.stat-item.lancadas .stat-number {
  color: #28a745;
}
.stat-item.lancadas {
  background: rgba(40, 167, 69, 0.05);
  border-color: rgba(40, 167, 69, 0.1);
}

/* ======= INFORMAÇÕES SECUNDÁRIAS ======= */
.card-details {
  display: grid;
  gap: 8px;
  margin-bottom: 20px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px dashed rgba(0, 123, 255, 0.15);
  font-size: 0.9rem;
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  font-weight: 600;
  color: #495057;
}

.detail-value {
  font-weight: 500;
  color: #212529;
  text-align: right;
}

/* ======= PROGRESS BAR PARA PROPORÇÃO ======= */
.progress-container {
  margin: 16px 0;
}

.progress-label {
  font-size: 0.8rem;
  color: #6c757d;
  margin-bottom: 6px;
  font-weight: 600;
}

.progress-bar {
  height: 6px;
  background: rgba(0, 123, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #28a745, #20c997);
  border-radius: 3px;
  transition: width 0.8s ease;
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(255,255,255,0.3), 
    transparent
  );
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ======= AÇÕES (BOTÕES) MODERNIZADAS ======= */
.card-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.action-btn {
  flex: 1;
  background: linear-gradient(135deg, #007bff, #0056b3);
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
  background: linear-gradient(135deg, #0056b3, #003f7f);
}

.action-btn:active {
  transform: translateY(0);
}

/* ======= BADGE DE STATUS FLUTUANTE ======= */
.status-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  backdrop-filter: blur(10px);
}

.status-badge.mixed {
  background: linear-gradient(135deg, #ffc107, #fd7e14);
  color: #212529;
}

.status-badge.all-completed {
  background: linear-gradient(135deg, #28a745, #20c997);
  color: #fff;
}

.status-badge.all-pending {
  background: linear-gradient(135deg, #dc3545, #c82333);
  color: #fff;
}

/* ======= RESPONSIVIDADE ======= */
@media (max-width: 768px) {
  #dashboard-recorrentes {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .card-actions {
    flex-direction: column;
  }
  
  #dashboard-recorrentes .card-recorrente {
    padding: 20px 16px;
  }
}

/* ======= CARD RESUMO PRINCIPAL - ESTILO CORPORATIVO ======= */
.card-recorrente-destaque {
  position: relative;
  padding: 0;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 
    0 2px 12px rgba(0, 0, 0, 0.08),
    0 1px 3px rgba(0, 0, 0, 0.06);
  margin-bottom: 32px;
  border: 1px solid #e9ecef;
  overflow: hidden;
  transition: all 0.3s ease;
}

.card-recorrente-destaque:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 4px 20px rgba(0, 0, 0, 0.12),
    0 2px 6px rgba(0, 0, 0, 0.08);
}

/* ======= CABEÇALHO CORPORATIVO ======= */
.corporate-header {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  color: #2c3e50;
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #dee2e6;
}

.corporate-header h2 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.corporate-header .header-icon {
  width: 24px;
  height: 24px;
  background: rgba(0, 123, 255, 0.1);
  border: 1px solid rgba(0, 123, 255, 0.2);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.corporate-header {
  background: rgba(0, 123, 255, 0.1);
  border: 1px solid rgba(0, 123, 255, 0.2);
  color: #007bff;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

/* ======= CORPO DO CARD CORPORATIVO ======= */
.corporate-body {
  padding: 24px;
}

/* ======= MÉTRICAS PRINCIPAIS ======= */
.corporate-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid #e9ecef;
}

.metric-item {
  text-align: center;
  padding: 16px;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid #007bff;
  transition: all 0.2s ease;
}

.metric-item:hover {
  background: #e9ecef;
  transform: translateY(-1px);
}

.metric-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #2c3e50;
  display: block;
  margin-bottom: 4px;
}

.metric-label {
  font-size: 0.8rem;
  color: #6c757d;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric-sublabel {
  font-size: 0.75rem;
  color: #868e96;
  margin-top: 2px;
}

/* ======= CORES ESPECÍFICAS PARA MÉTRICAS ======= */
.metric-item.localidade {
  border-left-color: #6f42c1;
}
.metric-item.localidade .metric-value {
  color: #6f42c1;
}

.metric-item.fornecedor {
  border-left-color: #fd7e14;
}
.metric-item.fornecedor .metric-value {
  color: #fd7e14;
}

.metric-item.vencimento {
  border-left-color: #e83e8c;
}
.metric-item.vencimento .metric-value {
  color: #e83e8c;
}

.metric-item.status {
  border-left-color: #20c997;
}
.metric-item.status .metric-value {
  color: #20c997;
}

/* ======= DETALHES SECUNDÁRIOS ======= */
.corporate-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.detail-group {
  background: #ffffff;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 16px;
}

.detail-group-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: #495057;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid #e9ecef;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 0.9rem;
}

.detail-row:not(:last-child) {
  border-bottom: 1px dotted #dee2e6;
}

.detail-label {
  font-weight: 500;
  color: #6c757d;
}

.detail-value {
  font-weight: 600;
  color: #212529;
  text-align: right;
}

/* ======= STATUS INDICATOR ======= */
.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
}

.status-indicator.pendente {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
}

.status-indicator.lancado {
  background: #d1e7dd;
  color: #0f5132;
  border: 1px solid #a3cfbb;
}

.status-indicator.parcial {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f1aeb5;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

/* ======= RESPONSIVIDADE CORPORATIVA ======= */
@media (max-width: 768px) {
  .corporate-header {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }
  
  .corporate-metrics {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .corporate-details {
    grid-template-columns: 1fr;
  }
  
  .corporate-actions {
    flex-direction: column;
  }
  
  .corporate-body {
    padding: 20px 16px;
  }
}

/* ======= BOTÃO DE REFRESH ======= */
.refresh-button {
  background: rgba(0, 123, 255, 0.1);
  border: 1px solid rgba(0, 123, 255, 0.2);
  color: #007bff;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.refresh-button:hover {
  background: rgba(0, 123, 255, 0.2);
  color: #0056b3;
}

/* ======= ESTADOS DE LOADING CORPORATIVO ======= */
.corporate-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #dee2e6;
  font-size: 1rem;
  color: #6c757d;
  font-weight: 500;
}

.corporate-loading::before {
  content: '⏳';
  margin-right: 8px;
  animation: spin 2s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ======= ALERTS CORPORATIVOS ======= */
.alert {
  padding: 16px;
  border-radius: 6px;
  border: 1px solid;
  font-size: 0.9rem;
  margin: 16px 0;
}

.alert strong {
  font-weight: 600;
}

.alert.alert-info {
  background: #cff4fc;
  border-color: #b8daff;
  color: #055160;
}

.alert.alert-danger {
  background: #f8d7da;
  border-color: #f1aeb5;
  color: #721c24;
}

.alert.alert-warning {
  background: #fff3cd;
  border-color: #ffeaa7;
  color: #856404;
}

.alert.alert-success {
  background: #d1e7dd;
  border-color: #a3cfbb;
  color: #0f5132;
}

/* ======= HIDDEN CLASS PARA COLLAPSE ======= */
.hidden {
  display: none !important;
}

/* ======= MELHORIAS NO STATUS BADGE DOS CARDS INFERIORES ======= */
.status-badge.mixed {
  background: linear-gradient(135deg, #ffc107, #fd7e14);
  color: #212529;
}

.status-badge.all-completed {
  background: linear-gradient(135deg, #28a745, #20c997);
  color: #fff;
}

.status-badge.all-pending {
  background: linear-gradient(135deg, #dc3545, #c82333);
  color: #fff;
}

.status-badge.empty {
  background: linear-gradient(135deg, #6c757d, #5a6268);
  color: #fff;
}

/* ======= ANIMAÇÕES SUTIS PARA ELEMENTOS CORPORATIVOS ======= */
.metric-item {
  animation: fadeInUp 0.3s ease forwards;
}

.metric-item:nth-child(1) { animation-delay: 0.1s; }
.metric-item:nth-child(2) { animation-delay: 0.2s; }
.metric-item:nth-child(3) { animation-delay: 0.3s; }
.metric-item:nth-child(4) { animation-delay: 0.4s; }

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.detail-group {
  animation: slideIn 0.4s ease forwards;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ======= HOVER EFFECTS CORPORATIVOS ======= */
.metric-item:hover .metric-value {
  transform: scale(1.05);
  transition: transform 0.2s ease;
}

.detail-group:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.2s ease;
}

/* ======= TIPOGRAFIA CORPORATIVA ======= */
.corporate-header h2 {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  letter-spacing: -0.5px;
}

.metric-label,
.detail-group-title {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 600;
}

.detail-value {
  font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
  font-variant-numeric: tabular-nums;
}

/* ======= SCROLL BAR CUSTOMIZADA PARA DETALHES ======= */
.corporate-details::-webkit-scrollbar {
  width: 6px;
}

.corporate-details::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.corporate-details::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.corporate-details::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/*verificar depois se posso remover */
.card-recorrente-destaque h2 {
  display: flex;
  align-items: center;
  font-size: 1.4rem;
  margin-bottom: 1rem;
  color: #333;
  gap: 0.5rem;
}

.card-recorrente-destaque .linha {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px dashed #ddd;
  font-size: 0.95rem;
}

.card-recorrente-destaque .linha span:first-child {
  font-weight: 600;
  color: #555;
}

.card-recorrente-destaque .linha span:last-child {
  font-weight: 500;
  color: #222;
  text-align: right;
}

.card-recorrente-destaque .btn-detalhes {
  margin-top: 20px;
  background-color: #212529;
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s ease;
  border: none;
}
.card-recorrente-destaque .btn-detalhes:hover {
  background-color: #343a40;
}

.card-recorrente-destaque .detalhes-collapse {
  margin-top: 1rem;
  padding-top: 0.5rem;
  border-top: 1px solid #ccc;
}

.card-recorrente-destaque .acoes {
  margin-top: 1rem;
  display: flex;
  gap: 10px;
}
.card-recorrente-destaque .acoes .acao {
  background: #0d6efd;
  color: white;
  border: none;
  padding: 6px 10px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.85rem;
}
.card-recorrente-destaque .acoes .acao:hover {
  background: #0b5ed7;
}

/* ======= ESTILOS GERAIS ======= */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #fef9f6;
  color: #343a40;
  padding: 2rem;
}

h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.acoes {
  margin-top: 10px;
  display: flex;
  gap: 8px;
}

.acao {
  background-color: #007bff;
  color: #fff;
  padding: 6px 10px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
}

.btn-detalhes {
  margin-top: 12px;
  background-color: #343a40;
  color: #fff;
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ----------- TABELA FATURAS RECORRENTES ----------- */
.form-col-recorrentes {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 140px;
}

/* Melhorias na tabela */
#tabelaFaturaRecorrentes tbody tr {
  transition: all 0.2s ease;
}

#tabelaFaturaRecorrentes tbody tr:hover {
  background-color: #f8f9fa;
  transform: scale(1.005);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* RESPONSIVIDADE PARA TEXTO LONGO */
#tabelaFaturaRecorrentes td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#tabelaFaturaRecorrentes {
  width: 100%;
  table-layout: fixed;
}

/* LOCALIDADE */
#tabelaFaturaRecorrentes th:nth-child(1),
#tabelaFaturaRecorrentes td:nth-child(1) {
  width: 120px; 
  text-align: left;
}
/* FORNECEDOR */
#tabelaFaturaRecorrentes th:nth-child(2),
#tabelaFaturaRecorrentes td:nth-child(2) {
  width: 150px; 
}
/* CATEGORIA */
#tabelaFaturaRecorrentes th:nth-child(3),
#tabelaFaturaRecorrentes td:nth-child(3) {
  width: 50px;
}
/* DESCRIÇÃO */
#tabelaFaturaRecorrentes th:nth-child(4),
#tabelaFaturaRecorrentes td:nth-child(4) {
  width: 100px; 
}
/* DIA VENC. */
#tabelaFaturaRecorrentes th:nth-child(5),
#tabelaFaturaRecorrentes td:nth-child(5) {
  width: 35px; 
  text-align: center;
}
/* STATUS */
#tabelaFaturaRecorrentes th:nth-child(6),
#tabelaFaturaRecorrentes td:nth-child(6) {
  width: 30px; 
  text-align: center;
}
 /* AÇÕES */
#tabelaFaturaRecorrentes th:nth-child(7),
#tabelaFaturaRecorrentes td:nth-child(7) {
  width: 30px;
  text-align: center;
}

/* ========================================
   SCANNER MODERNO - DESIGN BANCÁRIO
   Adicione este código ao final do seu styles.css
   ======================================== */

/* ===== VARIÁVEIS DO SCANNER ===== */
.scanner-modal {
  --scanner-primary: #007bff;
  --scanner-success: #00c853;
  --scanner-error: #ff5252;
  --scanner-warning: #ffa726;
  --scanner-dark: #1a1a1a;
  --scanner-light: #f5f5f5;
  --scanner-backdrop: rgba(0, 0, 0, 0.9);
  --scanner-radius: 16px;
  --scanner-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== ESTRUTURA BASE ===== */
.scanner-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: var(--scanner-transition);
}

.scanner-modal.show {
  opacity: 1;
  visibility: visible;
}

.scanner-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--scanner-backdrop);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* ===== DIALOG PRINCIPAL ===== */
.scanner-dialog {
  position: relative;
  background: white;
  border-radius: var(--scanner-radius);
  width: 90%;
  max-width: 480px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  transform: scale(0.9) translateY(20px);
  transition: var(--scanner-transition);
}

.scanner-modal.show .scanner-dialog {
  transform: scale(1) translateY(0);
}

.scanner-dialog.manual {
  max-width: 520px;
}

/* ===== DIALOG DA CÂMERA (AJUSTADO) ===== */
.scanner-dialog.camera-dialog {
  max-width: 600px;
  width: 90%;
  max-height: 85vh;
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* ===== HEADER ===== */
.scanner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #e0e0e0;
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

.scanner-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--scanner-dark);
  margin: 0;
  flex: 1;
  text-align: center;
}

.scanner-header-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--scanner-primary), #0056b3);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  margin-right: 16px;
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.scanner-back,
.scanner-close {
  background: none;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #666;
  transition: var(--scanner-transition);
}

.scanner-back:hover,
.scanner-close:hover {
  background: #f0f0f0;
  color: var(--scanner-dark);
}

/* ===== BODY ===== */
.scanner-body {
  padding: 24px;
  overflow-y: auto;
  max-height: calc(90vh - 80px);
}

/* ===== OPÇÕES DO MENU ===== */
.scanner-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.scanner-option-btn {
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: var(--scanner-radius);
  padding: 24px 16px;
  cursor: pointer;
  transition: var(--scanner-transition);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.scanner-option-btn:hover {
  border-color: var(--scanner-primary);
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.scanner-option-btn.camera {
  background: linear-gradient(135deg, #e3f2fd 0%, #f3e5ff 100%);
  border-color: #b8daff;
}

.scanner-option-btn.manual {
  background: linear-gradient(135deg, #e8f5e9 0%, #f3e5ff 100%);
  border-color: #c3e9d0;
}

.option-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--scanner-primary);
}

.option-title {
  display: block;
  font-size: 16px;
  font-weight: 600;
  color: var(--scanner-dark);
  margin-bottom: 4px;
}

.option-desc {
  display: block;
  font-size: 13px;
  color: #666;
}

/* ===== HISTÓRICO ===== */
.scanner-history-section {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid #e0e0e0;
}

.scanner-history-section h4 {
  font-size: 14px;
  font-weight: 600;
  color: #666;
  margin: 0 0 12px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.scanner-history {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #f8f9fa;
  border-radius: 10px;
  cursor: pointer;
  transition: var(--scanner-transition);
  border: 1px solid transparent;
}

.history-item:hover {
  background: #e9ecef;
  border-color: var(--scanner-primary);
  transform: translateX(4px);
}

.history-item.latest {
  background: linear-gradient(135deg, #e3f2fd 0%, #f3e5ff 100%);
  border-color: #b8daff;
}

.history-icon {
  font-size: 20px;
  width: 32px;
  text-align: center;
}

.history-info {
  flex: 1;
}

.history-code {
  font-family: 'Courier New', monospace;
  font-size: 14px;
  font-weight: 600;
  color: var(--scanner-dark);
}

.history-meta {
  display: flex;
  gap: 12px;
  margin-top: 2px;
}

.history-type,
.history-time {
  font-size: 12px;
  color: #666;
}

.history-type {
  background: #e0e0e0;
  padding: 2px 8px;
  border-radius: 4px;
}

.history-delete {
  background: none;
  border: none;
  font-size: 20px;
  color: #999;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.history-delete:hover {
  background: #f0f0f0;
  color: #666;
}

/* ===== CONTAINER DA CÂMERA (AJUSTADO) ===== */
.camera-container {
  position: relative;
  width: 100%;
  height: 400px;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
}

/* ===== VIEWPORT COM EFEITO SPOTLIGHT ===== */
.scanner-viewport.boleto-viewport {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
}

.scanner-viewport.boleto-viewport video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scanner-viewport.boleto-viewport canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ===== OVERLAY - ESTRUTURA CORRETA ===== */
.scanner-overlay.boleto-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
  /* SEM BACKGROUND AQUI! */
  background: none;
}

/* ===== FRAME COM EFEITO SPOTLIGHT - TÉCNICA DO BOX-SHADOW ===== */
.scanner-frame.boleto-frame {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 85%;
  max-width: 400px;
  height: 120px;
  
  /* TÉCNICA DO BOX-SHADOW PARA CRIAR MÁSCARA */
  background: transparent;
  border: 3px solid #2196F3;
  border-radius: 12px;
  
  /* Sombra gigante que cobre tudo exceto a área do frame */
  box-shadow: 
    /* Sombra externa gigante que escurece tudo */
    0 0 0 9999px rgba(0, 0, 0, 0.75),
    /* Brilho interno do frame */
    inset 0 0 0 2px rgba(255, 255, 255, 0.2),
    /* Glow azul */
    0 0 20px rgba(33, 150, 243, 0.6);
  
  z-index: 11;
}

/* ===== CORNERS DO FRAME ===== */
.scanner-frame.boleto-frame .scanner-corner {
  position: absolute;
  width: 30px;
  height: 30px;
  border: 3px solid #ffffff;
  background: rgba(33, 150, 243, 0.4);
  box-shadow: 
    0 0 10px rgba(33, 150, 243, 0.8),
    0 0 20px rgba(33, 150, 243, 0.4);
  z-index: 12;
}

.scanner-frame.boleto-frame .scanner-corner.tl {
  top: -10px;
  left: -10px;
  border-right: none;
  border-bottom: none;
  border-top-left-radius: 8px;
}

.scanner-frame.boleto-frame .scanner-corner.tr {
  top: -10px;
  right: -10px;
  border-left: none;
  border-bottom: none;
  border-top-right-radius: 8px;
}

.scanner-frame.boleto-frame .scanner-corner.bl {
  bottom: -10px;
  left: -10px;
  border-right: none;
  border-top: none;
  border-bottom-left-radius: 8px;
}

.scanner-frame.boleto-frame .scanner-corner.br {
  bottom: -10px;
  right: -10px;
  border-left: none;
  border-top: none;
  border-bottom-right-radius: 8px;
}

/* ===== LINHA DE SCAN ===== */
.scanner-guide.boleto-guide {
  position: absolute;
  top: 50%;
  left: 10%;
  right: 10%;
  height: 3px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 87, 34, 0.4) 10%,
    rgba(255, 87, 34, 1) 45%,
    rgba(255, 87, 34, 1) 55%,
    rgba(255, 87, 34, 0.4) 90%,
    transparent 100%
  );
  transform: translateY(-50%);
  border-radius: 2px;
  box-shadow: 
    0 0 15px rgba(255, 87, 34, 1),
    0 0 30px rgba(255, 87, 34, 0.6);
  animation: scanLineAnimation 2s ease-in-out infinite;
  z-index: 13;
}

@keyframes scanLineAnimation {
  0%, 100% {
    opacity: 0.5;
    transform: translateY(-50%) scaleX(0.8);
  }
  50% {
    opacity: 1;
    transform: translateY(-50%) scaleX(1);
  }
}

/* ===== HINT POSICIONADA ABAIXO DA ÁREA DE CAPTURA ===== */
.scanner-hint.boleto-hint {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 12px 24px;
  border-radius: 25px;
  font-size: 14px;
  text-align: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  z-index: 14;
  display: flex;
  align-items: center;
  gap: 8px;
}

.scanner-hint.boleto-hint .hint-icon {
  font-size: 20px;
}

.scanner-hint.boleto-hint .hint-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}

.scanner-hint.boleto-hint .hint-text strong {
  font-weight: 600;
  font-size: 14px;
}

.scanner-hint.boleto-hint .hint-text span {
  font-size: 12px;
  opacity: 0.8;
}

/* ===== STATUS SECTION ===== */
.scanner-status-section {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 16px;
  margin-top: 16px;
  border: 1px solid #e0e0e0;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #424242;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2196F3;
  animation: pulse 1.5s ease-in-out infinite;
}

.status-indicator.scanning .status-dot {
  background: #2196F3;
}

.status-indicator.warning .status-dot {
  background: #FF9800;
}

.status-indicator.error .status-dot {
  background: #F44336;
}

.status-indicator.success .status-dot {
  background: #4CAF50;
}

.status-indicator.info .status-dot {
  background: #2196F3;
}

@keyframes pulse {
  0%, 100% { 
    opacity: 1; 
    transform: scale(1); 
  }
  50% { 
    opacity: 0.5; 
    transform: scale(1.2); 
  }
}

/* ===== CÓDIGO DETECTADO ===== */
.codigo-detectado {
  margin-top: 12px;
  padding: 12px;
  background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
  border-radius: 8px;
  border: 1px solid #2196F3;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.codigo-label {
  font-size: 12px;
  font-weight: 600;
  color: #1976D2;
  margin-bottom: 4px;
}

.codigo-valor {
  font-family: 'Courier New', monospace;
  font-size: 14px;
  font-weight: 600;
  color: #2c3e50;
  background: rgba(255, 255, 255, 0.7);
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid rgba(33, 150, 243, 0.3);
  word-break: break-all;
  cursor: pointer;
  transition: all 0.2s ease;
}

.codigo-valor:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: scale(1.02);
}

/* ===== CONTROLES DO SCANNER ===== */
.scanner-controls {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px;
  margin-top: 16px;
}

.scanner-control-btn {
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  color: #424242;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  min-width: 100px;
  justify-content: center;
}

.scanner-control-btn:hover {
  background: #e9ecef;
  border-color: #2196F3;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.scanner-control-btn.primary {
  background: #2196F3;
  color: white;
  border-color: #1976D2;
}

.scanner-control-btn.primary:hover {
  background: #1976D2;
  box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

/* ===== ANIMAÇÃO DE SCANNING ATIVO ===== */
.scanner-viewport.scanning .scanner-frame {
  animation: framePulse 3s ease-in-out infinite;
}

@keyframes framePulse {
  0%, 100% {
    border-color: rgba(33, 150, 243, 1);
  }
  50% {
    border-color: rgba(76, 175, 80, 1);
    box-shadow: 
      0 0 0 9999px rgba(0, 0, 0, 0.75),
      inset 0 0 0 2px rgba(255, 255, 255, 0.3),
      0 0 30px rgba(76, 175, 80, 0.8);
  }
}

/* ===== INPUT MANUAL ===== */
.manual-input-section {
  text-align: center;
}

.input-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e3f2fd 0%, #f3e5ff 100%);
  border-radius: 20px;
  color: var(--scanner-primary);
  box-shadow: 0 8px 24px rgba(0, 123, 255, 0.2);
}

.input-group {
  margin-bottom: 20px;
}

.scanner-input {
  width: 100%;
  padding: 16px 20px;
  font-size: 18px;
  font-family: 'Courier New', monospace;
  text-align: center;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  background: #f8f9fa;
  transition: var(--scanner-transition);
  letter-spacing: 2px;
}

.scanner-input:focus {
  outline: none;
  border-color: var(--scanner-primary);
  background: white;
  box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.1);
}

.input-helper {
  font-size: 13px;
  color: #666;
  margin-top: 8px;
}

/* ===== CODE PREVIEW ===== */
.code-preview {
  display: none;
  margin: 20px 0;
  padding: 16px;
  background: #f8f9fa;
  border-radius: 10px;
  border: 1px solid #e0e0e0;
}

.preview-status {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}

.preview-status.valid {
  color: var(--scanner-success);
}

.preview-status.invalid {
  color: var(--scanner-error);
}

.preview-info {
  display: flex;
  justify-content: center;
  gap: 20px;
  font-size: 13px;
  color: #666;
}

.preview-formatted {
  font-family: 'Courier New', monospace;
  font-size: 14px;
  background: white;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #ddd;
  word-break: break-all;
  line-height: 1.6;
  color: #2c3e50;
  letter-spacing: 0.5px;
  margin-top: 12px;
}

/* ===== MANUAL ACTIONS ===== */
.manual-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.scanner-btn {
  flex: 1;
  padding: 14px 24px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--scanner-transition);
  position: relative;
  overflow: hidden;
}

.scanner-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.scanner-btn:active::before {
  width: 200px;
  height: 200px;
}

.scanner-btn.primary {
  background: var(--scanner-primary);
  color: white;
}

.scanner-btn.primary:hover {
  background: #0056b3;
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 123, 255, 0.3);
}

.scanner-btn.secondary {
  background: #e0e0e0;
  color: var(--scanner-dark);
}

.scanner-btn.secondary:hover {
  background: #d0d0d0;
}

.scanner-btn.tertiary {
  background: #f8f9fa;
  color: var(--scanner-primary);
  border: 1px solid var(--scanner-primary);
}

.scanner-btn.tertiary:hover {
  background: #e3f2fd;
}

/* ===== CODE EXAMPLES ===== */
.code-examples {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid #e0e0e0;
}

.code-examples h4 {
  font-size: 14px;
  font-weight: 600;
  color: #666;
  margin: 0 0 12px 0;
}

.example-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.example-item {
  display: flex;
  flex-direction: column;
  padding: 12px;
  background: #f8f9fa;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--scanner-transition);
  border: 1px solid transparent;
  gap: 4px;
}

.example-item:hover {
  background: #e9ecef;
  border-color: var(--scanner-primary);
  transform: translateX(4px);
}

.example-type {
  font-size: 12px;
  font-weight: 600;
  background: var(--scanner-primary);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  align-self: flex-start;
}

.example-code {
  font-family: 'Courier New', monospace;
  font-size: 13px;
  color: #666;
}

.example-desc {
  font-size: 11px;
  color: #999;
}

/* ===== MODAL DE CONFIRMAÇÃO ===== */
.scanner-confirmation-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100001;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.scanner-confirmation-modal.show {
  opacity: 1;
  visibility: visible;
}

.confirmation-dialog {
  background: white;
  border-radius: 16px;
  padding: 32px;
  max-width: 450px;
  width: 90%;
  text-align: center;
  transform: scale(0.9) translateY(20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.scanner-confirmation-modal.show .confirmation-dialog {
  transform: scale(1) translateY(0);
}

.confirmation-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  background: linear-gradient(135deg, #4CAF50, #2E7D32);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 40px;
  animation: confirmationPulse 0.5s ease;
}

@keyframes confirmationPulse {
  0% { transform: scale(0); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.confirmation-title {
  font-size: 24px;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 16px;
}

.confirmation-code {
  background: #f8f9fa;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 24px;
  font-family: 'Courier New', monospace;
  font-size: 16px;
  font-weight: 600;
  color: #2c3e50;
  word-break: break-all;
  line-height: 1.6;
}

.confirmation-info {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 24px;
  font-size: 14px;
}

.info-badge {
  background: #e3f2fd;
  color: #1976D2;
  padding: 6px 16px;
  border-radius: 20px;
  font-weight: 600;
}

.confirmation-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.confirmation-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.confirmation-btn.primary {
  background: #2196F3;
  color: white;
  flex: 1;
}

.confirmation-btn.primary:hover {
  background: #1976D2;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.confirmation-btn.secondary {
  background: #e0e0e0;
  color: #666;
}

.confirmation-btn.secondary:hover {
  background: #d0d0d0;
}

/* ===== SUCCESS OVERLAY ===== */
.scanner-success-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 200, 83, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.scanner-success-content {
  text-align: center;
  color: white;
}

.success-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: successPulse 0.5s ease;
}

@keyframes successPulse {
  0% { transform: scale(0); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.scanner-success-content h3 {
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 16px 0;
}

.success-code {
  font-family: 'Courier New', monospace;
  font-size: 18px;
  background: rgba(255, 255, 255, 0.2);
  padding: 12px 20px;
  border-radius: 8px;
  margin-bottom: 8px;
}

.success-type {
  font-size: 14px;
  opacity: 0.9;
}

/* ===== ERROR OVERLAY ===== */
.scanner-error-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
}

.error-content {
  text-align: center;
  padding: 24px;
}

.error-content svg {
  color: var(--scanner-error);
  margin-bottom: 16px;
}

.error-content h3 {
  font-size: 20px;
  font-weight: 600;
  color: var(--scanner-dark);
  margin: 0 0 8px 0;
}

.error-content p {
  font-size: 14px;
  color: #666;
  margin: 0 0 20px 0;
}

.error-suggestions {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 16px;
  margin: 20px 0;
  text-align: left;
  border: 1px solid #e0e0e0;
}

.suggestion {
  color: #424242;
  margin-bottom: 8px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.suggestion:last-child {
  margin-bottom: 0;
}

/* ===== TOAST NOTIFICATIONS ===== */
.scanner-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: white;
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  z-index: 100001;
  display: flex;
  align-items: center;
  gap: 12px;
  transform: translateX(400px);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.scanner-toast.show {
  transform: translateX(0);
}

.scanner-toast.error {
  border-left: 4px solid var(--scanner-error);
}

.scanner-toast.warning {
  border-left: 4px solid var(--scanner-warning);
}

.scanner-toast.success {
  border-left: 4px solid var(--scanner-success);
}

.scanner-toast.info {
  border-left: 4px solid var(--scanner-primary);
}

.toast-icon {
  font-size: 20px;
}

.toast-message {
  font-size: 14px;
  font-weight: 500;
  color: var(--scanner-dark);
}

/* ===== SCANNER NOTIFICATION ===== */
.scanner-notification {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--scanner-dark);
  color: white;
  padding: 12px 24px;
  border-radius: 30px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  z-index: 100001;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.scanner-notification.show {
  transform: translateX(-50%) translateY(0);
}

.scanner-notification.success {
  background: var(--scanner-success);
}

/* ===== INFO BOLETO ===== */
.scanner-info-boleto {
  background: linear-gradient(135deg, #E3F2FD 0%, #F3E5F5 100%);
  border: 2px solid #2196F3;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 4px 12px rgba(33, 150, 243, 0.1);
}

.scanner-info-boleto .info-icon {
  font-size: 2.2rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
  animation: boletoIconPulse 2s ease-in-out infinite;
}

@keyframes boletoIconPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.scanner-info-boleto .info-text strong {
  color: #1976D2;
  font-weight: 700;
  font-size: 16px;
}

.scanner-info-boleto .info-text span {
  color: #424242;
  font-size: 14px;
  line-height: 1.4;
}

/* ===== INTEGRAÇÃO COM FORMULÁRIO ===== */
.campo-preenchido-automatico {
  animation: highlightField 2s ease !important;
}

@keyframes highlightField {
  0% { background: #ffffff; }
  50% { background: #e8f5e8; box-shadow: 0 0 20px rgba(40, 167, 69, 0.3); }
  100% { background: #f0fff0; }
}

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


@media (max-width: 768px) {
  #prestacaoCodigo {
    min-width: 100% !important;
    font-size: 11px !important;
  }

  .scanner-dialog {
    width: 95%;
    max-height: 95vh;
  }
  
  .scanner-dialog.camera-dialog {
    width: 95%;
    max-width: none;
    max-height: 90vh;
  }
  
  .camera-container {
    height: 300px;
  }
  
  .scanner-options {
    grid-template-columns: 1fr;
  }
  
  .scanner-frame.boleto-frame {
    width: 90%;
    max-width: 350px;
    height: 100px;
  }
  
  .scanner-frame.boleto-frame .scanner-corner {
    width: 25px;
    height: 25px;
    border-width: 2px;
  }
  
  .scanner-hint.boleto-hint {
    font-size: 12px;
    padding: 10px 16px;
    bottom: 15px;
  }
  
  .scanner-corner {
    width: 30px;
    height: 30px;
  }
  
  .scanner-toast {
    top: auto;
    bottom: 20px;
    right: 20px;
    left: 20px;
    transform: translateY(100px);
  }
  
  .scanner-toast.show {
    transform: translateY(0);
  }
  
  .example-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .manual-actions {
    flex-direction: column;
  }
  
  .scanner-input {
    font-size: 16px;
    letter-spacing: 1px;
  }
  
  .scanner-controls {
    gap: 8px;
  }
  
  .scanner-control-btn {
    padding: 8px 12px;
    font-size: 12px;
    min-width: 80px;
  }
}

@media (max-width: 480px) {
  .camera-container {
    height: 250px;
  }
  
  .scanner-frame.boleto-frame {
    width: 95%;
    max-width: 300px;
    height: 80px;
  }
  
  .scanner-corner {
    width: 20px;
    height: 20px;
  }
  
  .scanner-hint.boleto-hint {
    font-size: 11px;
    padding: 8px 12px;
    bottom: 10px;
  }
  
  .scanner-controls {
    flex-direction: column;
    align-items: stretch;
  }
  
  .scanner-control-btn {
    justify-content: center;
    min-width: auto;
  }
  
  .codigo-valor {
    font-size: 12px;
    padding: 6px 8px;
  }
  
  .example-desc {
    font-size: 11px;
  }
  
  .scanner-info-boleto {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }
  
  .scanner-info-boleto .info-icon {
    font-size: 2rem;
  }
}

/* ===== ANIMAÇÕES ===== */
.scanner-viewport.scanning::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(0, 123, 255, 0.1) 50%,
    transparent 100%
  );
  animation: scanEffect 2s linear infinite;
  pointer-events: none;
}

@keyframes scanEffect {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100%); }
}

/* ===== ACESSIBILIDADE ===== */
.scanner-modal *:focus {
  outline: 2px solid var(--scanner-primary);
  outline-offset: 2px;
}

.scanner-modal button:focus {
  outline-offset: -2px;
}

/* ===== DARK MODE ===== */
@media (prefers-color-scheme: dark) {
  .scanner-dialog {
    background: #1a1a1a;
    color: white;
  }
  
  .scanner-dialog.camera-dialog {
    background: #1a1a1a;
    color: white;
  }
  
  .scanner-header {
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    border-bottom-color: #333;
  }
  
  .scanner-option-btn {
    background: #2a2a2a;
    border-color: #333;
    color: white;
  }
  
  .scanner-option-btn:hover {
    background: #333;
    border-color: var(--scanner-primary);
  }
  
  .scanner-input {
    background: #2a2a2a;
    border-color: #333;
    color: white;
  }
  
  .code-preview,
  .history-item,
  .example-item {
    background: #2a2a2a;
    border-color: #333;
  }
  
  .scanner-frame.boleto-frame {
    border-color: rgba(100, 181, 246, 0.9);
    box-shadow: 
      0 0 0 9999px rgba(0, 0, 0, 0.85),
      inset 0 0 0 2px rgba(255, 255, 255, 0.1),
      0 0 25px rgba(100, 181, 246, 0.6);
  }
  
  .scanner-corner {
    border-color: rgba(255, 255, 255, 0.8);
    background: rgba(100, 181, 246, 0.3);
  }
  
  .scanner-status-section {
    background: #2a2a2a;
    border-color: #444;
  }

  .codigo-detectado {
    background: linear-gradient(135deg, #1a237e 0%, #3f51b5 100%);
    border-color: #3f51b5;
  }
  
  .codigo-label {
    color: #bbdefb;
  }
  
  .codigo-valor {
    background: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
    border-color: rgba(100, 181, 246, 0.3);
  }
  
  .codigo-valor:hover {
    background: rgba(255, 255, 255, 0.15);
  }
  
  .scanner-control-btn {
    background: #2a2a2a;
    border-color: #444;
    color: white;
  }
  
  .scanner-control-btn:hover {
    background: #333;
    border-color: #3f51b5;
  }
  
  .scanner-control-btn.primary {
    background: #3f51b5;
    border-color: #303f9f;
  }
  
  .scanner-control-btn.primary:hover {
    background: #303f9f;
  }
  
  .confirmation-dialog {
    background: #1a1a1a;
    color: white;
  }
  
  .confirmation-code {
    background: #2a2a2a;
    border-color: #444;
    color: #e0e0e0;
  }
  
  .scanner-info-boleto {
    background: linear-gradient(135deg, #1a237e 0%, #3f51b5 100%);
    border-color: #3f51b5;
  }
  
  .scanner-info-boleto .info-text strong {
    color: #bbdefb;
  }
  
  .scanner-info-boleto .info-text span {
    color: #e1f5fe;
  }
}

/* ===== CLASSE HELPER PARA AJUSTE MANUAL ===== */
.scanner-frame.area-ajustada {
  border-color: rgba(76, 175, 80, 0.9) !important;
  background: rgba(76, 175, 80, 0.08) !important;
  box-shadow: 
    0 0 0 9999px rgba(0, 0, 0, 0.75),
    inset 0 0 0 2px rgba(255, 255, 255, 0.4),
    0 0 25px rgba(76, 175, 80, 0.6) !important;
}

.scanner-frame.area-ajustada .scanner-corner {
  border-color: #c8e6c9 !important;
  background: rgba(76, 175, 80, 0.3) !important;
}

.scanner-option-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.scanner-option-btn.disabled .option-title {
    color: #999;
}
/* ===== FIM DO BLOCO DO SCANNER ===== */

/* ===== SISTEMA DE BUSCA AVANÇADA PARA FORNECEDORES ===== */

/* Container principal do campo de busca */
.fornecedor-search-container {
    position: relative;
    width: 100%;
    max-width: 380px !important;
    min-width: 300px;
}

/* Campo de busca principal */
.fornecedor-search-input {
  width: 100% !important;
  padding: 12px 40px 12px 16px !important;
  box-sizing: border-box !important;
}

.fornecedor-search-input:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
  background: #f8f9ff;
}

.fornecedor-search-input.has-value {
  border-color: #28a745;
  background: #f8fff8;
}

/* Ícone de busca */
.search-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
}

.fornecedor-search-input:focus + .search-icon {
    color: #007bff;
}

/* Dropdown de resultados */
.fornecedor-dropdown {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    background: white !important;
    border: 2px solid #dee2e6 !important;
    border-top: none !important;
    border-radius: 0 0 8px 8px !important;
    max-height: 700px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    z-index: 9999 !important; /* ALTÍSSIMO para ficar por cima */
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25) !important; /* SOMBRA MAIOR */
    transform: scaleY(0);
    transform-origin: top;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    visibility: hidden;
}

.fornecedor-dropdown.show {
    transform: scaleY(1) !important;
    opacity: 1 !important;
    visibility: visible !important;
    z-index: 9999 !important; /* MANTER z-index quando visível */
}

/* Itens do dropdown */
.dropdown-item {
    padding: 15px 16px !important; /* AUMENTADO de 12px para 15px */
    cursor: pointer;
    border-bottom: 1px solid #f8f9fa;
    transition: all 0.2s ease;
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important; /* AUMENTADO de 4px para 6px */
    min-height: 60px !important; /* NOVO - altura mínima para cada item */
    word-wrap: break-word !important; /* NOVO - quebrar palavras longas */
    animation: slideInDown 0.2s ease forwards;
}

.dropdown-item:nth-child(1) { animation-delay: 0.05s; }
.dropdown-item:nth-child(2) { animation-delay: 0.1s; }
.dropdown-item:nth-child(3) { animation-delay: 0.15s; }
.dropdown-item:nth-child(4) { animation-delay: 0.2s; }
.dropdown-item:nth-child(5) { animation-delay: 0.25s; }

.dropdown-item:hover {
    background: #f8f9fa !important;
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important; /* NOVO */
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item.selected {
    background: #e3f2fd !important;
    border-left: 4px solid #007bff !important;
}

/* Overlay transparente atrás do dropdown quando aberto */
.dropdown-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: transparent !important;
    z-index: 9998 !important; /* Um abaixo do dropdown */
    display: none !important;
}

.dropdown-overlay.active {
    display: block !important;
}

/* NOVO - Indicador de mais resultados */
.dropdown-has-more {
    padding: 8px 16px;
    text-align: center;
    color: #007bff;
    font-size: 12px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    cursor: pointer;
}

.dropdown-has-more:hover {
    background: #e9ecef;
}

/* Nome do fornecedor */
.item-name {
    font-weight: 600 !important;
    color: #212529 !important;
    font-size: 15px !important; /* AUMENTADO de 14px */
    line-height: 1.4 !important; /* NOVO */
    word-break: keep-all !important; /* NOVO - manter palavras juntas quando possível */
    overflow-wrap: break-word !important; /* NOVO - quebrar apenas se necessário */
}

/* Informações adicionais */
.item-info {
    font-size: 13px !important; /* AUMENTADO de 12px */
    color: #6c757d !important;
    display: flex !important;
    flex-wrap: wrap !important; /* NOVO - permitir quebra de linha */
    gap: 8px 12px !important; /* AUMENTADO - vertical/horizontal */
    align-items: center !important; /* NOVO */
    line-height: 1.3 !important; /* NOVO */
}

.item-doc {
    font-family: 'Courier New', monospace;
    font-family: 'Courier New', monospace !important;
    background: #f8f9fa !important;
    padding: 3px 8px !important; /* AUMENTADO de 2px 6px */
    border-radius: 4px !important;
    font-weight: 500 !important; /* NOVO */
    white-space: nowrap !important; /* NOVO - não quebrar CPF/CNPJ */
}

/* Email */
.item-email {
    color: #495057 !important;
    font-style: italic !important;
    max-width: 200px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

/* Destacar texto encontrado */
.highlight {
    background: #ffeb3b !important;
    font-weight: bold !important;
    padding: 2px 3px !important; /* AUMENTADO de 1px 2px */
    border-radius: 3px !important; /* AUMENTADO de 2px */
    box-shadow: 0 1px 3px rgba(255, 235, 59, 0.5) !important; /* NOVO */
}

/* Estados especiais */
.dropdown-loading {
    padding: 30px 20px !important; /* AUMENTADO */
    text-align: center !important;
    color: #6c757d !important;
    font-style: italic !important;
    font-size: 14px !important; /* NOVO */
}

.dropdown-loading::before {
    content: '⏳ ';
    animation: spin 1s linear infinite;
    font-size: 18px !important; /* NOVO */
    display: block !important;
    margin-bottom: 8px !important;
}

.dropdown-empty {
    padding: 30px 20px !important; /* AUMENTADO */
    text-align: center !important;
    color: #6c757d !important;
    font-style: italic !important;
    font-size: 14px !important; /* NOVO */
}

.dropdown-empty::before {
    content: '🔍 ';
    font-size: 24px !important; /* AUMENTADO */
    display: block !important;
    margin-bottom: 8px !important;
}

/* Seção de favoritos */
.dropdown-section {
    padding: 10px 16px 6px 16px !important; /* AUMENTADO */
    font-size: 12px !important; /* AUMENTADO de 11px */
    font-weight: 700 !important;
    color: #495057 !important;
    background: #f8f9fa !important;
    border-bottom: 1px solid #e9ecef !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    position: sticky !important; /* NOVO - seções grudadas no topo */
    top: 0 !important;
    z-index: 10 !important;
}

.dropdown-section.recentes {
    color: #1976d2 !important;
    background: linear-gradient(135deg, #e3f2fd, #ffffff) !important; /* NOVO */
}

.dropdown-section.todos {
    color: #388e3c !important;
    background: linear-gradient(135deg, #e8f5e9, #ffffff) !important; /* NOVO */
}

/* Badge de tipo de pessoa */
.tipo-badge {
    font-size: 11px !important; /* AUMENTADO de 10px */
    padding: 3px 8px !important; /* AUMENTADO de 2px 6px */
    border-radius: 12px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    white-space: nowrap !important; /* NOVO */
}

.tipo-badge.fisica {
    background: #c8e6c9 !important;
    color: #2e7d32 !important;
}

.tipo-badge.juridica {
    background: #ffcdd2 !important;
    color: #c62828 !important;
}

/* Input hidden para compatibilidade */
.fornecedor-hidden-input {
    display: none;
}

/* Contador de resultados */
.search-counter {
    position: absolute;
    right: 35px;
    top: 50%;
    transform: translateY(-50%);
    background: #e3f2fd;
    color: #1976d2;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.search-counter.show {
    opacity: 1;
}

/* Botão de limpar */
.clear-button {
    position: absolute;
    right: 35px;
    top: 50%;
    transform: translateY(-50%);
    background: #6c757d;
    color: white;
    border: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 12px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.clear-button:hover {
    background: #495057;
    transform: translateY(-50%) scale(1.1);
}

.clear-button.show {
    display: flex;
}

/* Animações */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scrollbar personalizada */
.fornecedor-dropdown::-webkit-scrollbar {
    width: 8px !important; /* AUMENTADO de 6px */
}

.fornecedor-dropdown::-webkit-scrollbar-track {
    background: #f1f1f1 !important;
    border-radius: 4px !important; /* AUMENTADO de 3px */
}

.fornecedor-dropdown::-webkit-scrollbar-thumb {
    background: #c1c1c1 !important;
    border-radius: 4px !important; /* AUMENTADO de 3px */
    border: 1px solid #f1f1f1 !important; /* NOVO */
}

.fornecedor-dropdown::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8 !important;
}

#fornecedor_search {
  width: 100% !important;
  min-width: 150px !important; /* ou o tamanho que desejar */
  max-width: 650px !important;
  padding-right: 50px !important; /* Espaço para botões */
}

/* Responsividade - MELHORADA */
@media (max-width: 768px) {
    .fornecedor-dropdown {
        max-height: 300px !important; /* REDUZIDO para mobile */
        left: -10px !important; /* NOVO - expandir um pouco */
        right: -10px !important;
    }

    .dropdown-item {
        padding: 12px 14px !important;
        min-height: 50px !important;
    }

    .item-info {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 4px !important;
    }

    .item-name {
        font-size: 14px !important;
    }

    .item-info {
        font-size: 12px !important;
    }
}

/* ========== DASHBOARD FATURAS RECORRENTES - CSS MODERNO ========== */

/* VARIÁVEIS CSS GLOBAIS */
:root {
  /* Cores principais inspiradas na imagem */
  --primary-blue: #4f46e5;
  --primary-pink: #ec4899;
  --primary-orange: #f97316;
  --primary-green: #10b981;
  --primary-purple: #8b5cf6;
  
  /* Cores de suporte */
  --success-color: #22c55e;
  --warning-color: #eab308;
  --danger-color: #ef4444;
  --info-color: #3b82f6;
  
  /* Tons de cinza modernos */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  
  /* Sombras modernas */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  
  /* Bordas */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
}

/* RESET E BASE */
.dashboard-container {
  padding: 20px;
  background: var(--gray-50);
  min-height: 100vh;
}

/* HEADER PRINCIPAL */
.dashboard-header-spa {
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-purple) 100%);
  color: white;
  padding: 30px;
  border-radius: var(--radius-xl);
  margin-bottom: 24px;
  box-shadow: var(--shadow-xl);
  position: relative;
  overflow: hidden;
}

.dashboard-header-spa::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  border-radius: 50%;
  transform: translate(50%, -50%);
}

.dashboard-header-spa h2 {
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.dashboard-header-spa p {
  font-size: 1.125rem;
  opacity: 0.9;
  margin: 0;
}

/* CONTAINER PRINCIPAL */
.dashboard-embed-container {
  background: white;
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--gray-200);
}

/* FILTROS + ALERTAS INTEGRADOS */
.filters-alerts-bar {
  background: linear-gradient(135deg, var(--gray-50) 0%, white 100%) !important;
  padding: 20px !important;
  border-radius: var(--radius-lg) !important;
  border: 2px solid var(--gray-200) !important;
  margin-bottom: 24px !important;
  box-shadow: var(--shadow-md) !important;
}

.filters-alerts-bar .row {
  display: flex !important;
  flex-wrap: nowrap !important;
  margin: 0 !important;
  gap: 20px !important;
  align-items: flex-start !important;
}

/* COLUNA DOS FILTROS - 65% */
.filters-alerts-bar .col-lg-7 {
  flex: 0 0 65% !important;
  max-width: 65% !important;
  padding: 0 !important;
  margin: 0 !important;
}

.filters-alerts-bar .col-lg-7 .row {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 15px !important;
}

.filters-alerts-bar .col-lg-7 .col-md-4 {
  flex: 1 1 30% !important;
  min-width: 150px !important;
  padding: 0 !important;
}

/* COLUNA DOS ALERTAS - 35% */
.filters-alerts-bar .col-lg-5 {
  flex: 0 0 35% !important;
  max-width: 35% !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
}

/* Alertas compactos */
#alertas-container {
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  gap: 8px !important;
}

#alertas-container .alert {
  margin-bottom: 0 !important;
  padding: 12px 16px !important;
  border-radius: 8px !important;
  font-size: 0.875rem !important;
  font-weight: 500 !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  box-shadow: 0 2px 4px rgba(0,0,0,0.08) !important;
}

#alertas-container .alert-danger {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%) !important;
  color: #991b1b !important;
  border-left: 4px solid #dc2626 !important;
  border: none !important;
}

#alertas-container .alert-warning {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%) !important;
  color: #92400e !important;
  border-left: 4px solid #f59e0b !important;
  border: none !important;
}

/* Inputs dos filtros */
.filters-alerts-bar .form-label {
  font-weight: 600 !important;
  color: var(--gray-700) !important;
  font-size: 0.875rem !important;
  margin-bottom: 6px !important;
  display: block !important;
}

.filters-alerts-bar .form-select,
.filters-alerts-bar .form-control {
  border: 2px solid var(--gray-200) !important;
  border-radius: 8px !important;
  padding: 10px 12px !important;
  font-size: 0.9rem !important;
  transition: all 0.2s ease !important;
  background: white !important;
  width: 100% !important;
}

.filters-alerts-bar .form-select:focus,
.filters-alerts-bar .form-control:focus {
  outline: none !important;
  border-color: var(--primary-blue) !important;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1) !important;
}

/* RESPONSIVO ESPECÍFICO */
@media (max-width: 1199px) {
  .filters-alerts-bar .row {
    flex-wrap: wrap !important;
    flex-direction: column !important;
  }
  
  .filters-alerts-bar .col-lg-7,
  .filters-alerts-bar .col-lg-5 {
    flex: 0 0 100% !important;
    max-width: 100% !important;
  }
  
  .filters-alerts-bar .col-lg-7 {
    margin-bottom: 20px !important;
  }
}

@media (max-width: 767px) {
  .filters-alerts-bar .col-lg-7 .row {
    flex-direction: column !important;
  }
  
  .filters-alerts-bar .col-lg-7 .col-md-4 {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    margin-bottom: 15px !important;
  }
  
  .filters-alerts-bar {
    padding: 16px !important;
  }
}

/* AJUSTES EXTRAS PARA GARANTIR LAYOUT */
.filters-alerts-bar * {
  box-sizing: border-box !important;
}
/* KPIS - ESTILO MODERNO INSPIRADO NA IMAGEM */
.kpis-row {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -12px 24px -12px;
}

.kpis-row > .col-xl-2 {
  padding: 0 12px;
  margin-bottom: 24px;
}

@media (min-width: 1200px) {
  .kpis-row > .col-xl-2 {
    flex: 0 0 16.666667%;
    max-width: 16.666667%;
  }
}

.kpi-card {
  background: white;
  border-radius: var(--radius-xl);
  padding: 24px;
  height: 140px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-md);
}

.kpi-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

/* Gradientes inspirados na imagem */
.kpi-card.kpi-blue {
  background: linear-gradient(135deg, var(--primary-blue) 0%, #6366f1 100%);
  color: white;
}

.kpi-card.kpi-green {
  background: linear-gradient(135deg, var(--primary-green) 0%, #059669 100%);
  color: white;
}

.kpi-card.kpi-yellow {
  background: linear-gradient(135deg, var(--warning-color) 0%, #ca8a04 100%);
  color: white;
}

.kpi-card.kpi-red {
  background: linear-gradient(135deg, var(--danger-color) 0%, #dc2626 100%);
  color: white;
}

.kpi-card.kpi-purple {
  background: linear-gradient(135deg, var(--primary-purple) 0%, #7c3aed 100%);
  color: white;
}

.kpi-card.kpi-pink {
  background: linear-gradient(135deg, var(--primary-pink) 0%, #db2777 100%);
  color: white;
}

/* Ícone posicionado no canto superior direito */
.kpi-card .kpi-icon {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 1.5rem;
  opacity: 0.8;
}

.kpi-card .kpi-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.kpi-card .kpi-valor {
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.kpi-card .kpi-titulo {
  font-size: 0.875rem;
  font-weight: 500;
  opacity: 0.9;
  text-transform: capitalize;
  letter-spacing: 0.025em;
}

.kpi-card .kpi-subtitulo {
  font-size: 0.75rem;
  opacity: 0.8;
  margin-top: 0.25rem;
}

/* Para cards brancos (se necessário) */
.kpi-card.kpi-white {
  background: white;
  color: var(--gray-800);
  border: 2px solid var(--gray-200);
}

.kpi-card.kpi-white .kpi-icon {
  color: var(--primary-blue);
}

/* GRÁFICOS - GRID MODERNO */
.charts-grid {
  margin-bottom: 24px;
}

.charts-grid .chart-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  overflow: hidden;
}

.charts-grid .chart-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.charts-grid .card-header {
  background: linear-gradient(135deg, var(--gray-50) 0%, white 100%);
  border-bottom: 1px solid var(--gray-200);
  padding: 20px 24px;
}

.charts-grid .card-header h6 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gray-800);
  margin: 0;
}

.charts-grid .card-body {
  padding: 24px;
}

/* TABELAS */
.tables-section .card {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.tables-section .card-header {
  background: linear-gradient(135deg, var(--gray-50) 0%, white 100%);
  border-bottom: 1px solid var(--gray-200);
  padding: 20px 24px;
}

.tables-section .card-header h6 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gray-800);
  margin: 0;
}

/* ESTATÍSTICAS ADICIONAIS */
.stats-additional .stats-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  overflow: hidden;
}

.stats-additional .stats-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.stats-additional .card-body {
  padding: 24px;
  text-align: center;
}

.stats-additional .card-body i {
  color: var(--primary-blue);
  margin-bottom: 16px;
}

.stats-additional .card-body h3 {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 8px;
}

.stats-additional .card-body p {
  font-size: 0.875rem;
  color: var(--gray-600);
  font-weight: 500;
  margin: 0;
}

/* LOADING */
#dashboard-loading {
  padding: 60px 20px;
}

.spinner-border {
  width: 3rem;
  height: 3rem;
  border-width: 0.3em;
}

/* BOTÕES */
.btn {
  border-radius: var(--radius-md);
  font-weight: 500;
  padding: 10px 20px;
  transition: all 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-blue) 0%, #6366f1 100%);
  border: none;
}

.btn-outline-primary {
  border: 2px solid var(--primary-blue);
  color: var(--primary-blue);
}

.btn-outline-primary:hover {
  background: var(--primary-blue);
  color: white;
}

/* FULLSCREEN */
.dashboard-fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gray-50);
  z-index: 99999;
  padding: 20px;
}

.dashboard-fullscreen .dashboard-embed-container {
  height: calc(100vh - 140px);
  margin: 0;
  overflow: auto;
}

/* RESPONSIVIDADE */
@media (max-width: 1199px) {
  .filters-alerts-bar .row {
    flex-direction: column;
  }
  
  .filters-alerts-bar .col-lg-7 {
    margin-bottom: 20px;
  }
}

@media (max-width: 991px) {
  .kpis-row > .col-xl-2 {
    flex: 0 0 50%;
    max-width: 50%;
  }
}

@media (max-width: 767px) {
  .dashboard-container {
    padding: 15px;
  }
  
  .dashboard-header-spa {
    padding: 20px;
  }
  
  .dashboard-header-spa h2 {
    font-size: 1.875rem;
  }
  
  .filters-alerts-bar {
    padding: 16px;
  }
  
  .kpis-row > .col-xl-2 {
    flex: 0 0 100%;
    max-width: 100%;
  }
  
  .kpi-card {
    height: 120px;
    padding: 20px;
  }
  
  .kpi-card .kpi-valor {
    font-size: 1.875rem;
  }
}

/* ANIMAÇÕES SUAVES */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.kpi-card {
  animation: fadeInUp 0.6s ease-out;
}

.chart-card {
  animation: fadeInUp 0.8s ease-out;
}

/* UTILITÁRIOS */
.text-muted {
  color: var(--gray-500) !important;
}

.mb-0 { margin-bottom: 0 !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }

.me-1 { margin-right: 0.25rem !important; }
.me-2 { margin-right: 0.5rem !important; }