/**
 * PT-INTEGRATION.CSS
 * Estilos para la integración con Pricing Tool en Thor
 */

/* ═══════════════════════════════════════════════════════════════════════════
   SECCIÓN PT EN MODAL
   ═══════════════════════════════════════════════════════════════════════════ */

.pt-integration-section {
  margin-top: 24px;
  border-top: 1px solid #e5e7eb;
  padding-top: 24px;
}

.pt-section {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
}

.pt-section-vinculada {
  border-color: #10b981;
  background: linear-gradient(to bottom, #f0fdf4, #ffffff);
}

.pt-section-disabled {
  opacity: 0.7;
  background: #f9fafb;
}

/* Header */
.pt-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
}

.pt-section-header h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #1f2937;
}

/* Badges */
.pt-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 20px;
}

.pt-badge-green {
  background: #d1fae5;
  color: #059669;
}

.pt-badge-gray {
  background: #f3f4f6;
  color: #6b7280;
}

.pt-badge-orange {
  background: #ffedd5;
  color: #ea580c;
}

/* Body */
.pt-section-body {
  padding: 20px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   OFERTA VINCULADA
   ═══════════════════════════════════════════════════════════════════════════ */

.pt-oferta-card {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
}

.pt-oferta-info {
  flex: 1;
  min-width: 250px;
}

.pt-oferta-code {
  font-size: 18px;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 4px;
}

.pt-oferta-org {
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 12px;
}

.pt-oferta-details {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.pt-detail {
  font-size: 13px;
  color: #374151;
}

.pt-detail strong {
  color: #6b7280;
  font-weight: 500;
}

.pt-estado {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}

.pt-estado-aprobada {
  background: #d1fae5;
  color: #059669;
}

.pt-estado-en-dynamics {
  background: #dbeafe;
  color: #2563eb;
}

.pt-oferta-meta {
  font-size: 12px;
  color: #9ca3af;
}

.pt-oferta-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ═══════════════════════════════════════════════════════════════════════════
   BUSCADOR
   ═══════════════════════════════════════════════════════════════════════════ */

.pt-search-form {
  margin-bottom: 16px;
}

.pt-search-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.pt-input {
  flex: 1;
  padding: 10px 14px;
  font-size: 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #ffffff;
  color: #1f2937;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.pt-input:focus {
  outline: none;
  border-color: #f97316;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.pt-input::placeholder {
  color: #9ca3af;
}

.pt-select {
  flex: 1;
  padding: 10px 14px;
  font-size: 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #ffffff;
  color: #1f2937;
  cursor: pointer;
}

.pt-select:focus {
  outline: none;
  border-color: #f97316;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

/* ═══════════════════════════════════════════════════════════════════════════
   BOTONES
   ═══════════════════════════════════════════════════════════════════════════ */

.pt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  white-space: nowrap;
}

.pt-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.pt-btn-primary {
  background: linear-gradient(135deg, #f97316, #ea580c);
  color: #ffffff;
}

.pt-btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #ea580c, #c2410c);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

.pt-btn-secondary {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #d1d5db;
}

.pt-btn-secondary:hover:not(:disabled) {
  background: #e5e7eb;
}

.pt-btn-danger {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.pt-btn-danger:hover:not(:disabled) {
  background: #fee2e2;
}

.pt-btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESULTADOS DE BÚSQUEDA
   ═══════════════════════════════════════════════════════════════════════════ */

.pt-search-results {
  margin-top: 16px;
}

.pt-results-header {
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.pt-results-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
}

.pt-result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  transition: all 0.2s;
}

.pt-result-item:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}

.pt-result-info {
  flex: 1;
  min-width: 0;
}

.pt-result-code {
  font-size: 14px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 2px;
}

.pt-result-org {
  font-size: 13px;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.pt-result-details {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: #9ca3af;
}

.pt-has-pdf {
  color: #059669;
}

.pt-no-results {
  padding: 24px;
  text-align: center;
  color: #6b7280;
  font-size: 14px;
  background: #f9fafb;
  border-radius: 8px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SECCIÓN MANUAL
   ═══════════════════════════════════════════════════════════════════════════ */

.pt-manual-section {
  margin-top: 20px;
}

.pt-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  color: #9ca3af;
  font-size: 12px;
}

.pt-divider::before,
.pt-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e5e7eb;
}

.pt-manual-section .pt-select {
  margin-bottom: 8px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   TEXTO HELPERS
   ═══════════════════════════════════════════════════════════════════════════ */

.pt-text-muted {
  color: #6b7280;
  font-size: 14px;
  line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 640px) {
  .pt-oferta-card {
    flex-direction: column;
  }
  
  .pt-oferta-actions {
    width: 100%;
    justify-content: flex-start;
  }
  
  .pt-search-row {
    flex-direction: column;
  }
  
  .pt-btn {
    width: 100%;
  }
}
