/* ============================================================================
   BIPAGEM SYSTEM
   ============================================================================ */

.bipagem-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

.bipagem-container h4 {
  color: #333;
  margin: 0px 0px 15px 0px;
  padding: 10px 15px;
  background: #f8f9fa;
  border-left: 4px solid #c21a26;
  font-size: 1.2em;
  font-family: 'Rubik', sans-serif;
  border-radius: 6px;
}

/* Seção de Cliente */
.bipagem-cliente-section {
  margin-bottom: 30px;
}

.bipagem-cliente-search {
  position: relative;
  max-width: 100%;
}

#bipagem-cliente-input {
  width: 100%;
  padding: 14px 48px 14px 36px;
  border: 2px solid #c21a26;
  border-radius: 12px;
  font-size: 16px;
  transition: all 0.3s;
}

#bipagem-suggestions-container {
  position: absolute;
  width: 100%;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  max-height: 375px;
  overflow-y: auto;
  border-radius: 8px;
  margin-top: 4px;
}

#bipagem-suggestions-container ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

#bipagem-suggestions-container li {
  padding: 10px;
  cursor: pointer;
  border-bottom: 1px solid #eee;
  transition: background-color .2s;
}

#bipagem-suggestions-container li:hover {
  background-color: #f8f9fa;
}

.cliente-selecionado-bipagem {
  background: #e7f5eb;
  border: 2px solid #28a745;
  border-radius: 6px;
  padding: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cliente-info .cliente-nome {
  font-weight: 600;
  color: #333;
  display: block;
  font-size: 1.1em;
}

.cliente-info .cliente-codigo {
  color: #666;
  font-size: 0.9em;
}

.trocar-cliente-btn {
  background: #6c757d;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 8px 16px;
  cursor: pointer;
  font-weight: 500;
  transition: background-color .2s;
}

.trocar-cliente-btn:hover {
  background: #5a6268;
}

/* Seção de Notas Fiscais */

.bipagem-notas-section {
  margin-bottom: 30px;
}

.notas-info {
  text-align: center;
}

.baixar-notas-btn {
  background: #007bff;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 15px 25px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: all .3s ease;
  margin-top: 15px;
}

.baixar-notas-btn:hover {
  background: #0056b3;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 123, 255, .3);
}

.baixar-notas-btn:disabled {
  background: #6c757d;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.download-status {
  margin-top: 15px;
  border-radius: 4px;
  text-align: center;
}

.download-status .success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.download-status .error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

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

/* Seção de Configuração */

.data-base-config {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 6px;
  border-left: 4px solid #c21a26;
}

.data-base-config label {
  font-weight: 600;
  color: #333;
}

#dias-base {
  padding: 8px 12px;
  border: 2px solid #dee2e6;
  border-radius: 4px;
  font-size: 16px;
  width: 100px;
}

#dias-base:focus {
  border-color: #c21a26;
  outline: none;
}

.confirmar-dias-btn {
  background: #c21a26;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 10px 20px;
  cursor: pointer;
  font-weight: 600;
  transition: background-color .2s;
  margin-top: 15px;
}

.confirmar-dias-btn:hover {
  background: #a50d17;
}

.data-base-config label,
.data-base-config #dias-base,
.data-base-config .confirmar-dias-btn {
  vertical-align: middle;
}

.data-base-info {
  display: block;
  margin-top: 10px;
  color: #666;
  font-style: italic;
}

/* Seção de Bipagem */

.bipagem-config-section {
  margin-bottom: 30px;
}



.bipagem-controls {
  text-align: center;
}

.iniciar-bipagem-btn {
  background: #28a745;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 15px 25px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: all .3s ease;
  width: 100%;
  justify-content: center;
}

.iniciar-bipagem-btn:hover {
  background: #218838;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(40, 167, 69, .3);
}

.parar-bipagem-btn {
  background: #dc3545;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 15px 25px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: all .3s ease;
  width: 100%;
  justify-content: center;
}

.parar-bipagem-btn:hover {
  background: #c82333;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(220, 53, 69, .3);
}

/* Campo de entrada para bipador bluetooth */
.entrada-bipagem {
  margin-top: 20px;
  padding: 20px;
  background: #fff;
  border: 2px solid #c21a26;
  border-radius: 6px;
  text-align: center;
}

.entrada-bipagem label {
  display: block;
  font-weight: 600;
  color: #333;
  margin-bottom: 10px;
  font-size: 1.1em;
}

#isbn-input {
  width: 100%;
  max-width: 400px;
  padding: 15px;
  border: 2px solid #dee2e6;
  border-radius: 4px;
  font-size: 18px;
  font-family: 'Courier New', monospace;
  text-align: center;
  letter-spacing: 1px;
}

#isbn-input:focus {
  border-color: #c21a26;
  outline: none;
  box-shadow: 0 0 0 3px rgba(194, 26, 38, .2);
}

/* Resultado da Bipagem */
.resultado-bipagem {
  margin-top: 20px;
  padding: 20px;
  background: #fff;
  border: 2px solid #dee2e6;
  border-radius: 8px;
  display: none;
}

.resultado-display {
  text-align: center;
}

.produto-info {
  margin-bottom: 15px;
}

.produto-isbn {
  display: block;
  font-family: 'Courier New', monospace;
  font-size: 1.1em;
  font-weight: 600;
  color: #333;
  margin-bottom: 5px;
}

.produto-isbn-lista {
  font-family: 'Courier New', monospace;
  font-size: 14px;
  color: #666;
  background: #f8f9fa;
  padding: 4px 8px;
  border-radius: 3px;
  border: 1px solid #dee2e6;
  white-space: nowrap;
  align-self: center;
  margin-left: 10px;
}

.produto-nome {
  display: block;
  color: #666;
  font-size: 0.95em;
}

.decisao-display {
  padding: 15px;
  border-radius: 6px;
  font-size: 1.5em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.decisao-detalhes {
  display: block;
  font-size: 0.9em;
  margin-top: 8px;
  color: #666;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.decisao-texto.fica {
  background: #d4edda;
  color: #155724;
  border: 2px solid #c3e6cb;
}

.decisao-texto.devolucao {
  background: #fff3cd;
  color: #856404;
  border: 2px solid #ffeaa7;
}

.decisao-texto.nao-encontrado {
  background: #f8d7da;
  color: #721c24;
  border: 2px solid #f5c6cb;
}

.decisao-texto.quantidade-excedida {
  background: #fff3cd;
  color: #856404;
  border: 2px solid #ffeaa7;
}

/* Atualização da grid de estatísticas para acomodar 3 items */
.bipagem-stats {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 20px;
}

.stat-card {
  display: flex;
  align-items: center;
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 15px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
}

.stat-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin-right: 15px;
  flex-shrink: 0;
}

.total-card .stat-icon {
  background: #c21a26;
}

.livros-card .stat-icon {
  background: #1976d2;
}

.outros-card .stat-icon {
  background: #7b1fa2;
}

.stat-content {
  flex: 1;
  min-width: 0;
}

.stat-title {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin-bottom: 5px;
}

.stat-details {
  display: flex;
  gap: 15px;
  font-size: 14px;
  color: #666;
}

.stat-details span {
  white-space: nowrap;
}

.stat-details strong {
  color: #333;
}

/* Container do botão zerar */
.bipagem-zerar-container {
  text-align: start;
  margin-bottom: 20px;
}

/* Botão Zerar Bipagem */
.zerar-bipagem-btn {
  background: #dc3545;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all .3s ease;
}

.zerar-bipagem-btn:hover {
  background: #c82333;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(220, 53, 69, .3);
}

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

/* Container da Lista de Produtos */
.lista-produtos-bipados-container {
  margin-top: 20px;
  background: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  border-left: 4px solid #c21a26;
}

.lista-produtos-bipados-container h4 {
  margin-top: 0;
  margin-bottom: 15px;
  color: #333;
  font-size: 1.1em;
}

/* Lista de Produtos */
.lista-produtos-bipados {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  max-height: 400px;
  overflow-y: auto;
}

.lista-vazia {
  padding: 30px;
  text-align: center;
  color: #6c757d;
  font-style: italic;
}

/* Item da Lista */
.produto-bipado-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 15px;
  border-bottom: 1px solid #e9ecef;
  transition: background-color .2s ease;
}

.produto-bipado-item:hover {
  background-color: #f8f9fa;
}

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

/* Informações do Produto na Lista */
.produto-info-lista {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.produto-nome-lista {
  flex: 1;
  color: #333;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Badge do Grupo */
.produto-grupo-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.produto-grupo-badge.livros {
  background: #e3f2fd;
  color: #1976d2;
  border: 1px solid #90caf9;
}

.produto-grupo-badge.outros {
  background: #f3e5f5;
  color: #7b1fa2;
  border: 1px solid #ce93d8;
}

/* Botão Remover */
.remover-produto-btn {
  background: #FFD7D7;
  border: 1px solid #dc3545;
  color: #dc3545;
  border-radius: 4px;
  padding: 6px 8px;
  cursor: pointer;
  transition: all .2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: 10px;
}

.remover-produto-btn:hover {
  background: #dc3545;
  color: #fff;
  transform: scale(1.05);
}

.remover-produto-btn:active {
  transform: scale(0.95);
}

.remover-produto-btn svg {
  width: 16px;
  height: 16px;
  display: block;
}

/* Scrollbar personalizada para a lista */
.lista-produtos-bipados::-webkit-scrollbar {
  width: 8px;
}

.lista-produtos-bipados::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.lista-produtos-bipados::-webkit-scrollbar-thumb {
  background: #c21a26;
  border-radius: 4px;
}

.lista-produtos-bipados::-webkit-scrollbar-thumb:hover {
  background: #a50d17;
}

/* Badge de Decisão */
.produto-decisao-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  margin-left: 10px;
}

.produto-decisao-badge.fica {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.produto-decisao-badge.devolucao {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
}

/* Botão Editar Decisão */
.editar-decisao-btn {
  background: #e9ecef;
  border: 1px solid #6c757d;
  color: #6c757d;
  border-radius: 4px;
  padding: 6px 8px;
  cursor: pointer;
  transition: all .2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: 10px;
}

.editar-decisao-btn:hover {
  background: #6c757d;
  color: #fff;
  transform: scale(1.05);
}

.editar-decisao-btn:active {
  transform: scale(0.95);
}

.editar-decisao-btn svg {
  width: 16px;
  height: 16px;
  display: block;
}

/* Seção do Relatório de Devolução */
.relatorio-devolucao-section {
  margin-bottom: 20px;
}

.relatorio-info {
  text-align: center;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 6px;
  border-left: 4px solid #ffc107;
  margin-top: 15px;
}

.relatorio-devolucao-btn {
  background: #ffc107;
  color: #333;
  border: none;
  border-radius: 6px;
  padding: 12px 20px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all .3s ease;
  margin-bottom: 10px;
}

.relatorio-devolucao-btn:hover {
  background: #e0a800;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(255, 193, 7, .4);
  color: #333;
}

.relatorio-devolucao-btn:disabled {
  background: #6c757d;
  color: #fff;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.relatorio-devolucao-btn svg {
  flex-shrink: 0;
}

.aviso-data-bipagem {
  display: block;
  font-size: 14px;
  color: #666;
  font-style: italic;
  margin-top: 8px;
  padding: 8px;
  background: #fff;
  border-radius: 4px;
  border: 1px solid #dee2e6;
}

/* Adicionar na seção de bipagem do style.css */

.modo-data-base {
  margin-bottom: 15px;
}

.modo-data-base label {
  display: inline-block;
  margin-right: 20px;
  font-weight: 600;
  color: #333;
  cursor: pointer;
}

.modo-data-base input[type="radio"] {
  margin-right: 5px;
}

.controle-data-base label {
  display: block;
  font-weight: 600;
  color: #333;
  margin-bottom: 15px;
}

#data-especifica {
  padding: 8px 12px;
  border: 2px solid #dee2e6;
  border-radius: 4px;
  font-size: 16px;
  width: 200px;
}

#data-especifica:focus {
  border-color: #c21a26;
  outline: none;
}

/* Filtros para produtos bipados */
.filtros-produtos-container {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 6px;
  margin-bottom: 15px;
  border: 1px solid #dee2e6;
}

.filtro-pesquisa {
  margin-bottom: 15px;
}

.filtro-pesquisa input[type="text"] {
  width: 100%;
  padding: 8px 12px;
  border: 2px solid #dee2e6;
  border-radius: 4px;
  font-size: 16px;
}

.filtro-pesquisa input[type="text"]:focus {
  border-color: #c21a26;
  outline: none;
}

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

.filtro-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 16px;
  color: #333;
}

.filtro-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.teste-massivo-btn {
  margin-top: 20px;
  background: #ff6b35;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 15px 25px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: all .3s ease;
  width: 100%;
  justify-content: center;
}

.teste-massivo-btn:hover {
  background: #e55a2b;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(255, 107, 53, .3);
}

.teste-massivo-btn:disabled {
  background: #6c757d;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Paginação */
.paginacao-container {
  margin-top: 20px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 6px;
  border-top: 1px solid #dee2e6;
}

.paginacao-info {
  text-align: center;
  margin-bottom: 15px;
  color: #666;
  font-size: 16px;
}

.paginacao-navegacao {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 10px;
}

.paginacao-numeros {
  display: flex;
  justify-content: center;
  gap: 5px;
  flex-wrap: wrap;
}



.pag-btn {
  background: #fff;
  border: 1px solid #dee2e6;
  color: #495057;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s ease;
  min-width: 40px;
}

.pag-btn:hover:not(.disabled) {
  background: #e9ecef;
  border-color: #adb5bd;
}

.pag-btn.active {
  background: #c21a26;
  border-color: #c21a26;
  color: #fff;
}

.pag-btn.disabled {
  background: #f8f9fa;
  color: #6c757d;
  cursor: not-allowed;
  opacity: 0.6;
}

/* Modal de Anotação */
.modal-anotacao-bipagem {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

.modal-anotacao-content {
  background: white;
  padding: 30px;
  border-radius: 8px;
  max-width: 500px;
  width: 90%;
  position: relative;
}

.modal-anotacao-content h3 {
  margin: 0 0 20px 0;
  color: #333;
}

.fechar-modal-anotacao {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #666;
}

.fechar-modal-anotacao:hover {
  color: #333;
}

#texto-anotacao-bipagem {
  width: 100%;
  padding: 10px;
  border: 2px solid #dee2e6;
  border-radius: 4px;
  font-size: 16px;
  resize: vertical;
}

.modal-anotacao-buttons {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.modal-anotacao-buttons button {
  flex: 1;
  padding: 10px;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.enviar-anotacao-btn {
  background: #c21a26;
  color: white;
  border: none;
}

.enviar-anotacao-btn:hover {
  background: #a50d17;
}

.copiar-texto-btn {
  background: #6c757d;
  color: white;
  border: none;
}

.copiar-texto-btn:hover {
  background: #5a6268;
}