CREATE TABLE users (
    id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,

    -- Identity
    first_name VARCHAR(100) NOT NULL,
    last_name VARCHAR(100) NOT NULL,
    email VARCHAR(255) NOT NULL,
    phone VARCHAR(50) NULL,

    -- Business context
    company_name VARCHAR(255) NOT NULL,
    industry VARCHAR(100) NOT NULL,
    referral_source VARCHAR(100) NULL,

    -- Auth
    password_hash VARCHAR(255) NOT NULL,

    -- Roles / status
    role ENUM('owner', 'admin', 'team') NOT NULL DEFAULT 'owner',
    status ENUM('active', 'inactive', 'pending') NOT NULL DEFAULT 'active',

    -- Future-proofing (multi-user accounts)
    account_id INT UNSIGNED NULL,

    -- Timestamps
    created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
    updated_at DATETIME NULL ON UPDATE CURRENT_TIMESTAMP,

    -- Constraints
    UNIQUE KEY uniq_email (email),
    INDEX idx_account_id (account_id),
    INDEX idx_role (role)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
