/* ============================================================
   Nexus Prospector Pro — Estilos específicos por página
   ============================================================ */

/* ═══════════════════════════════════════
   DASHBOARD — index.html
   ═══════════════════════════════════════ */

.search-panel {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
}

.search-panel-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 120px;
  gap: 12px;
  margin-bottom: 16px;
}

.search-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 14px 16px;
  background: var(--bg3);
  border-radius: var(--radius);
  margin-bottom: 16px;
}

.filter-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
}

.search-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* Resultados de búsqueda */
.results-panel {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 20px;
}

.results-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg3);
}

.results-count {
  font-family: 'DM Mono', monospace;
  font-size: 0.8rem;
  color: var(--muted);
}

.results-count strong {
  color: var(--gold);
  font-weight: 700;
}

.results-actions {
  display: flex;
  gap: 8px;
}

/* Historial reciente */
.historial-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.historial-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  transition: background var(--transition);
}

.historial-item:last-child { border-bottom: none; }
.historial-item:hover { background: var(--bg3); }

.historial-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.historial-title {
  font-weight: 700;
  color: var(--text);
}

.historial-meta {
  font-size: 0.75rem;
  color: var(--muted);
  font-family: 'DM Mono', monospace;
}

.historial-stats {
  display: flex;
  gap: 12px;
  align-items: center;
}

.historial-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
}

.historial-stat-val { color: var(--text); font-weight: 700; }
.historial-stat-lbl { color: var(--muted); font-size: 0.65rem; }

/* Nombre del negocio en tabla */
.business-name {
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.business-address {
  font-size: 0.75rem;
  color: var(--muted);
}

/* Indicador de teléfono */
.phone-link {
  font-family: 'DM Mono', monospace;
  font-size: 0.82rem;
  color: var(--text);
}

/* ═══════════════════════════════════════
   PROSPECTOS — prospectos.html
   ═══════════════════════════════════════ */

.prospecto-name {
  font-weight: 700;
  color: var(--text);
}

.prospecto-city {
  font-size: 0.78rem;
  color: var(--muted);
}

/* Modal de detalle del prospecto */
.prospecto-modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.prospecto-field-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 4px;
}

.prospecto-field-val {
  font-size: 0.9rem;
  color: var(--text);
}

.message-preview {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  font-size: 0.875rem;
  color: var(--text);
  line-height: 1.6;
  white-space: pre-wrap;
  max-height: 220px;
  overflow-y: auto;
  font-family: 'Syne', sans-serif;
}

.message-preview.whatsapp {
  border-left: 3px solid #25D366;
}

.message-preview.instagram {
  border-left: 3px solid #E1306C;
}

.message-preview.email {
  border-left: 3px solid var(--blue);
}

.notas-entry {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}

.notas-entry:last-child { border-bottom: none; }
.notas-date { font-size: 0.72rem; color: var(--muted); font-family: 'DM Mono', monospace; }

/* ═══════════════════════════════════════
   PIPELINE — pipeline.html
   ═══════════════════════════════════════ */

.kanban-board {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  align-items: start;
  padding-bottom: 20px;
  overflow-x: auto;
  min-width: 0;
}

.kanban-col {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  min-height: 500px;
  display: flex;
  flex-direction: column;
  min-width: 200px;
}

.kanban-col-header {
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  background: var(--bg2);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  z-index: 1;
}

.kanban-col-title {
  font-size: 0.82rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.kanban-col-emoji { font-size: 1rem; }

.kanban-count {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  background: var(--bg3);
  padding: 2px 7px;
  border-radius: 10px;
  color: var(--muted);
}

.kanban-value {
  font-size: 0.72rem;
  color: var(--muted);
  font-family: 'DM Mono', monospace;
}

.kanban-value strong { color: var(--green); }

.kanban-cards {
  flex: 1;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}

.kanban-cards.drag-over {
  background: rgba(212, 168, 67, 0.05);
  border-radius: var(--radius);
}

/* Cards del Kanban */
.kanban-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  cursor: grab;
  transition: all var(--transition);
  animation: fadeIn 0.2s ease;
}

.kanban-card:hover {
  border-color: rgba(212, 168, 67, 0.3);
  box-shadow: var(--shadow-sm);
}

.kanban-card.dragging {
  opacity: 0.5;
  cursor: grabbing;
  transform: rotate(2deg);
  box-shadow: var(--shadow);
}

.kanban-card-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.3;
}

.kanban-card-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.73rem;
  color: var(--muted);
  font-family: 'DM Mono', monospace;
  margin-bottom: 10px;
}

.kanban-card-meta span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.kanban-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.dias-badge {
  font-size: 0.68rem;
  font-family: 'DM Mono', monospace;
  color: var(--muted);
}

.kanban-card-actions {
  display: flex;
  gap: 4px;
}

/* Colores por etapa en kanban */
.kanban-col[data-etapa="nuevo"]      .kanban-col-header { border-top: 3px solid var(--blue); }
.kanban-col[data-etapa="contactado"] .kanban-col-header { border-top: 3px solid var(--gold); }
.kanban-col[data-etapa="interesado"] .kanban-col-header { border-top: 3px solid var(--purple); }
.kanban-col[data-etapa="negociando"] .kanban-col-header { border-top: 3px solid var(--orange); }
.kanban-col[data-etapa="cerrado"]    .kanban-col-header { border-top: 3px solid var(--green); }
.kanban-col[data-etapa="perdido"]    .kanban-col-header { border-top: 3px solid var(--red); }

/* Totales del pipeline */
.pipeline-totals {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.pipeline-total-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}

.pipeline-total-label {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
  font-weight: 700;
}

.pipeline-total-val {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--green);
  font-family: 'DM Mono', monospace;
}

/* ═══════════════════════════════════════
   PLANTILLAS — plantillas.html
   ═══════════════════════════════════════ */

.plantillas-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 20px;
  align-items: start;
}

.plantillas-list {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.plantillas-list-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.plantilla-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
}

.plantilla-item:last-child { border-bottom: none; }
.plantilla-item:hover { background: var(--bg3); }
.plantilla-item.active { background: rgba(212, 168, 67, 0.08); }

.plantilla-item-name {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.plantilla-item-meta {
  display: flex;
  gap: 6px;
  align-items: center;
}

.plantilla-editor {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.plantilla-editor-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.plantilla-editor-body {
  padding: 20px;
}

.variables-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.variable-chip {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 0.75rem;
  font-family: 'DM Mono', monospace;
  color: var(--gold);
  cursor: pointer;
  transition: all var(--transition);
}

.variable-chip:hover {
  background: rgba(212, 168, 67, 0.1);
  border-color: var(--gold);
}

.preview-panel {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 12px;
}

.preview-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 10px;
}

.preview-content {
  white-space: pre-wrap;
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--text);
}

/* ═══════════════════════════════════════
   CONFIG — config.html
   ═══════════════════════════════════════ */

.config-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  max-width: 900px;
}

.config-section {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.config-section-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.config-section-header h3 {
  font-size: 1rem;
}

.config-section-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.api-key-wrap {
  position: relative;
}

.api-key-wrap .input {
  padding-right: 44px;
  font-family: 'DM Mono', monospace;
  font-size: 0.82rem;
  letter-spacing: 0.05em;
}

.api-key-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
}

.api-key-toggle:hover { color: var(--text); }

.test-result {
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.test-result.success {
  background: rgba(61, 186, 122, 0.1);
  border: 1px solid rgba(61, 186, 122, 0.2);
  color: var(--green);
}

.test-result.error {
  background: rgba(224, 92, 92, 0.1);
  border: 1px solid rgba(224, 92, 92, 0.2);
  color: var(--red);
}

.usage-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}

.usage-stat:last-child { border-bottom: none; }
.usage-stat-label { color: var(--muted); }
.usage-stat-val { font-family: 'DM Mono', monospace; color: var(--text); font-weight: 700; }

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

@media (max-width: 1200px) {
  .kanban-board {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .plantillas-grid {
    grid-template-columns: 1fr;
  }

  .config-grid {
    grid-template-columns: 1fr;
  }

  .pipeline-totals {
    grid-template-columns: 1fr;
  }
}

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

  .kanban-board {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }

  .prospecto-modal-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .kanban-board {
    grid-template-columns: minmax(220px, 1fr);
  }
}
