/* Estilos para o módulo de Compras */
.compras-container {
  padding: 24px;
  max-width: 100%;
}

.compras-header {
  text-align: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 3px solid #1976d2;
}

.compras-header h2 {
  color: #1976d2;
  font-size: 28px;
  margin-bottom: 8px;
}

.compras-header p {
  color: #666;
  font-size: 15px;
}

/* Stats Section */
.stats-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 30px;
}

.stat-card {
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.3s ease;
  border-left: 4px solid #ccc;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.stat-icon {
  font-size: 32px;
  flex-shrink: 0;
}

.stat-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-label {
  font-size: 12px;
  color: #666;
  font-weight: 500;
  text-transform: uppercase;
}

.stat-value {
  font-size: 24px;
  font-weight: bold;
  color: #333;
}

.stat-total {
  border-left-color: #1976d2;
}

.stat-urgente {
  border-left-color: #d32f2f;
}

.stat-urgente .stat-value {
  color: #d32f2f;
}

.stat-recomendado {
  border-left-color: #f57c00;
}

.stat-recomendado .stat-value {
  color: #f57c00;
}

.stat-ok {
  border-left-color: #388e3c;
}

.stat-ok .stat-value {
  color: #388e3c;
}

.stat-comprar {
  border-left-color: #7b1fa2;
  background: linear-gradient(135deg, #f3e5f5 0%, #ffffff 100%);
}

.stat-comprar .stat-value {
  color: #7b1fa2;
}

/* Filters Section */
.filters-section {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  align-items: flex-end;
  background: #f8f9fa;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-group label {
  font-size: 13px;
  font-weight: 600;
  color: #555;
}

.filter-group select {
  padding: 10px 14px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  background: white;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 180px;
}

.filter-group select:focus {
  outline: none;
  border-color: #1976d2;
  box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
}

.btn-report {
  background: linear-gradient(135deg, #7b1fa2 0%, #9c27b0 100%);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(123, 31, 162, 0.3);
  margin-left: auto;
}

.btn-report:hover {
  background: linear-gradient(135deg, #6a1b9a 0%, #7b1fa2 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(123, 31, 162, 0.4);
}

/* Table */
.table-container {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow-x: auto;
  margin-bottom: 30px;
}

.compras-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.compras-table thead {
  background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
  color: white;
}

.compras-table th {
  padding: 14px 12px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.compras-table td {
  padding: 14px 12px;
  border-bottom: 1px solid #e0e0e0;
  vertical-align: middle;
}

.compras-table tbody tr {
  transition: background 0.2s ease;
}

.compras-table tbody tr:hover {
  background: #f5f9ff;
}

/* Status específicos das linhas */
.compras-table tbody tr.row-urgente {
  background: #ffebee;
  border-left: 4px solid #d32f2f;
}

.compras-table tbody tr.row-urgente:hover {
  background: #ffcdd2;
}

.compras-table tbody tr.row-recomendado {
  background: #fff3e0;
  border-left: 4px solid #f57c00;
}

.compras-table tbody tr.row-recomendado:hover {
  background: #ffe0b2;
}

.compras-table tbody tr.row-ok {
  background: #e8f5e9;
  border-left: 4px solid #388e3c;
}

.compras-table tbody tr.row-ok:hover {
  background: #c8e6c9;
}

/* Badges */
.badge-status {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

.badge-urgente {
  background: #ffcdd2;
  color: #b71c1c;
  border: 1px solid #ef5350;
}

.badge-recomendado {
  background: #ffe0b2;
  color: #e65100;
  border: 1px solid #ff9800;
}

.badge-ok {
  background: #c8e6c9;
  color: #1b5e20;
  border: 1px solid #66bb6a;
}

.badge-linha {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-linha.badge-master {
  background: #e3f2fd;
  color: #0d47a1;
  border: 1px solid #64b5f6;
}

.badge-linha.badge-ouro {
  background: #fff8e1;
  color: #f57f17;
  border: 1px solid #ffd54f;
}

.badge-linha.badge-sem_linha {
  background: #f5f5f5;
  color: #757575;
  border: 1px solid #bdbdbd;
}

/* Células especiais */
.numero-cell {
  text-align: center;
  font-weight: 600;
  color: #333;
}

.dimensoes-cell {
  font-size: 12px;
  color: #666;
  font-family: 'Courier New', monospace;
}

.comprar-col {
  background: rgba(123, 31, 162, 0.05);
  font-weight: bold;
}

.comprar-cell {
  text-align: center;
  font-weight: bold;
}

.comprar-quantidade {
  display: inline-block;
  padding: 6px 14px;
  background: linear-gradient(135deg, #7b1fa2 0%, #9c27b0 100%);
  color: white;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(123, 31, 162, 0.3);
}

.comprar-nao {
  color: #bdbdbd;
  font-size: 16px;
}

.motivo-cell {
  font-size: 12px;
  color: #666;
  font-style: italic;
}

/* Legenda */
.legenda-section {
  background: white;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.legenda-section h3 {
  color: #1976d2;
  margin-bottom: 16px;
  font-size: 18px;
}

.legenda-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 12px;
}

.legenda-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: #f9f9f9;
  border-radius: 8px;
}

.legenda-item span:last-child {
  font-size: 13px;
  color: #555;
}

/* Relatório */
.relatorio-compras {
  padding: 20px;
}

.relatorio-header {
  text-align: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 3px solid #7b1fa2;
}

.relatorio-header h3 {
  color: #7b1fa2;
  font-size: 24px;
  margin-bottom: 10px;
}

.relatorio-header p {
  color: #666;
  font-size: 14px;
  margin: 4px 0;
}

.relatorio-subtitle {
  font-style: italic;
}

.linha-section {
  margin-bottom: 30px;
}

.linha-title {
  margin-bottom: 12px;
  padding: 10px;
  background: #f5f5f5;
  border-left: 4px solid #7b1fa2;
  border-radius: 4px;
}

.relatorio-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

.relatorio-table th {
  background: #f5f5f5;
  padding: 12px 8px;
  text-align: left;
  font-weight: 600;
  color: #333;
  border: 1px solid #ddd;
  font-size: 12px;
}

.relatorio-table td {
  padding: 10px 8px;
  border: 1px solid #ddd;
  font-size: 13px;
}

.relatorio-table tbody tr:hover {
  background: #f9f9f9;
}

.linha-total {
  background: #f3e5f5 !important;
  font-weight: bold;
}

.linha-total td {
  font-size: 14px;
  padding: 14px 8px;
}

.relatorio-footer {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 3px solid #7b1fa2;
}

.total-geral {
  background: linear-gradient(135deg, #f3e5f5 0%, #e1bee7 100%);
  padding: 20px;
  border-radius: 12px;
  text-align: center;
  margin-bottom: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  font-size: 18px;
}

.total-geral strong {
  color: #7b1fa2;
  font-size: 24px;
}

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

.btn-print {
  background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
  color: white;
  border: none;
  padding: 12px 32px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(25, 118, 210, 0.3);
  transition: all 0.3s ease;
}

.btn-print:hover {
  background: linear-gradient(135deg, #1565c0 0%, #0d47a1 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(25, 118, 210, 0.4);
}

/* Mensagem vazia */
.no-data {
  text-align: center;
  padding: 60px 20px;
  color: #999;
  font-size: 16px;
}

/* Responsividade */
/* Destaque do filtro de hotelaria */
#hotel-filter {
  border: 2px solid #ab47bc;
}

#hotel-filter:focus {
  border-color: #7b1fa2;
  box-shadow: 0 0 0 3px rgba(123, 31, 162, 0.15);
}

@media (max-width: 768px) {
  .stats-section {
    grid-template-columns: 1fr;
  }

  .filters-section {
    flex-direction: column;
    padding: 16px;
  }

  .filter-group {
    width: 100%;
  }

  .filter-group select {
    min-width: 100%;
    width: 100%;
  }

  .btn-report {
    width: 100%;
    margin-left: 0;
  }

  .compras-table {
    font-size: 12px;
  }

  .compras-table th,
  .compras-table td {
    padding: 8px 6px;
  }

  .legenda-items {
    grid-template-columns: 1fr;
  }
}

/* Impressão */
@media print {
  .filters-section,
  .relatorio-actions,
  .modal-close,
  .modal-footer,
  .legenda-section {
    display: none !important;
  }

  .relatorio-table {
    page-break-inside: avoid;
  }

  .linha-section {
    page-break-inside: avoid;
  }
}

