-- Migration: create table solicitudes_contacto
-- Run on the 'admin' database (used by app admin/conexion.php -> $pdo6)
CREATE TABLE IF NOT EXISTS `solicitudes_contacto` (
  `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
  `nombre` VARCHAR(200) NOT NULL,
  `email` VARCHAR(150) NOT NULL,
  `telefono` VARCHAR(50) DEFAULT NULL,
  `direccion` VARCHAR(255) DEFAULT NULL,
  `mensaje` TEXT,
  `ip` VARCHAR(45) DEFAULT NULL,
  `user_agent` VARCHAR(255) DEFAULT NULL,
  `origen` VARCHAR(50) DEFAULT NULL,
  `status` ENUM('new','in_progress','closed') NOT NULL DEFAULT 'new',
  `assigned_to` VARCHAR(100) DEFAULT NULL,
  `created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `processed_at` DATETIME DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_created_at` (`created_at`),
  KEY `idx_email` (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Example insert
-- INSERT INTO solicitudes_contacto (nombre,email,telefono,direccion,mensaje) VALUES ('Juan Perez','juan@example.com','04141234567','Colonia Tovar','Quisiera información sobre planes.');
