// CNV Work — Mega-menu navigation
// Sản phẩm: 7 module tab bên trái, mỗi tab show feature cards bên phải.

const MENU = [
  {
    label: 'Sản phẩm',
    href: '/products',
    modules: [
      {
        title: 'Sales & CRM',
        icon: 'briefcase',
        href: '/products/sales-crm',
        desc: 'Vòng đời khách hàng: lead → deal → hợp đồng → thanh toán.',
        features: [
          { name: 'Quản lý Lead', desc: 'Round-robin, scoring, phễu lead', icon: 'target' },
          { name: 'Pipeline Deal', desc: 'Kanban, forecast, stage tuỳ biến', icon: 'layout-grid' },
          { name: 'Báo giá đa cấp', desc: 'Template Google Docs, duyệt nhiều cấp', icon: 'file-text' },
          { name: 'Hợp đồng & Subscription', desc: 'Gia hạn tự động, MRR/ARR', icon: 'refresh-cw' },
          { name: 'Hoá đơn & Thanh toán', desc: 'Auto-link deal, dunning email', icon: 'dollar-sign' },
          { name: 'Khuyến mãi & Commission', desc: 'Coupon, rule chia hoa hồng', icon: 'gift' },
          { name: '360° Khách hàng', desc: 'Tree view, activities timeline', icon: 'building-2' },
          { name: '20+ Báo cáo CRM', desc: 'Pipeline, top sales, debt aging', icon: 'bar-chart-3' },
        ],
      },
      {
        title: 'Marketing & Automation',
        icon: 'megaphone',
        href: '/products/fulfillment-marketing',
        desc: 'Thu hút khách mới + tự động hoá vận hành.',
        features: [
          { name: 'Campaign đa kênh', desc: 'Email, social, event-based', icon: 'megaphone' },
          { name: 'Lead form public', desc: 'Embed iframe, Mini App Zalo', icon: 'flag' },
          { name: 'Automation flow', desc: 'No-code visual, 30+ trigger', icon: 'zap' },
          { name: 'Tracking ROI', desc: 'CPL, CAC, doanh thu/campaign', icon: 'trending-up' },
          { name: 'Events & Hội thảo', desc: 'Đăng ký, QR check-in', icon: 'calendar' },
          { name: 'Membership', desc: 'CLB/hiệp hội, phí định kỳ', icon: 'users' },
        ],
      },
      {
        title: 'Inbox & Hỗ trợ KH',
        icon: 'inbox',
        href: '/products/inbox-support',
        desc: 'Đa kênh chat + AI agent + Ticket SLA.',
        features: [
          { name: 'Inbox đa kênh', desc: 'Zalo OA, Facebook, Web widget', icon: 'inbox' },
          { name: 'AI Agent', desc: 'Multi-provider auto-fallback', icon: 'bot' },
          { name: 'Ticket SLA', desc: 'Escalation, auto-assign theo rule', icon: 'ticket-percent' },
          { name: 'Knowledge Base', desc: 'Markdown, sync Google Docs', icon: 'book-open' },
          { name: 'CSAT + Auto QC', desc: 'Claude Haiku review chất lượng', icon: 'scale' },
          { name: 'Web widget', desc: 'Nhúng website, custom theme', icon: 'globe' },
        ],
      },
      {
        title: 'Task & Dự án',
        icon: 'check-square',
        href: '/products/tasks',
        desc: 'Giao việc, theo dõi tiến độ, báo cáo hiệu suất.',
        features: [
          { name: 'Tasks Kanban', desc: 'Priority, deadline, subtask', icon: 'layout-grid' },
          { name: 'Projects', desc: 'Template library, deadline tổng', icon: 'package' },
          { name: 'Reminders', desc: 'Overdue alert, email push', icon: 'bell' },
          { name: 'Liên kết CRM', desc: 'Gắn task cho deal/lead/khách', icon: 'link' },
          { name: 'Báo cáo công việc', desc: 'Hiệu suất per team/cá nhân', icon: 'bar-chart-3' },
          { name: 'Comments & Mentions', desc: 'Trao đổi trong task', icon: 'inbox' },
        ],
      },
      {
        title: 'Phê duyệt',
        icon: 'check-square',
        href: '/products/approvals',
        desc: 'Workflow duyệt no-code, đa cấp, escalation.',
        features: [
          { name: 'Template builder', desc: 'Kéo thả các bước duyệt', icon: 'file-text' },
          { name: 'Conditional routing', desc: 'Theo giá trị, phòng ban', icon: 'network' },
          { name: 'Auto-escalate', desc: 'Quá hạn tự đẩy lên cấp trên', icon: 'trending-up' },
          { name: 'Approval inbox', desc: 'Hộp duyệt cá nhân', icon: 'inbox' },
          { name: 'Multi-channel push', desc: 'Mattermost + Email + In-app', icon: 'bell' },
          { name: 'Audit trail', desc: 'Ai duyệt gì, khi nào', icon: 'scale' },
        ],
      },
      {
        title: 'Nhân sự & Chấm công',
        icon: 'users',
        href: '/products/hr',
        desc: 'HR, GPS check-in, hợp đồng, lương, tài sản.',
        features: [
          { name: 'Tuyển dụng', desc: 'Campaign + Kanban ứng viên', icon: 'users' },
          { name: 'Onboarding/Offboarding', desc: 'Workflow tự động hoá', icon: 'refresh-cw' },
          { name: 'Chấm công GPS + QR', desc: 'Geofence 200m, ca linh hoạt', icon: 'target' },
          { name: 'Timesheet & nghỉ phép', desc: 'Multi-step duyệt', icon: 'calendar' },
          { name: 'Hợp đồng & Lương', desc: 'BHYT/BHXH, thuế TNCN', icon: 'file-text' },
          { name: 'Quản lý tài sản', desc: 'Giao, thu hồi, kiểm kê', icon: 'briefcase' },
          { name: 'Org Chart', desc: 'Tree view phòng ban', icon: 'network' },
        ],
      },
      {
        title: 'Báo cáo & Phân tích',
        icon: 'bar-chart-3',
        href: '/products/reports',
        desc: '20+ dashboard sẵn có + Data Warehouse tuỳ biến.',
        features: [
          { name: '20+ Dashboard', desc: 'Sales, marketing, HR, support', icon: 'bar-chart-3' },
          { name: 'Sales Performance', desc: 'Pipeline, commission, top sales', icon: 'trending-up' },
          { name: 'Marketing ROI', desc: 'Campaign, lead attribution', icon: 'megaphone' },
          { name: 'HR Analytics', desc: 'Turnover, attendance compliance', icon: 'users' },
          { name: 'Support SLA', desc: 'CSAT trends, FRT/ART', icon: 'scale' },
          { name: 'Data Warehouse', desc: 'Custom table + AI query (addon)', icon: 'package' },
        ],
      },
    ],
  },
  { label: 'Khách hàng', href: '#' },
  { label: 'Bảng giá', href: '/pricing' },
  { label: 'Về chúng tôi', href: '/about' },
  { label: 'Blog', href: '/blog' },
  { label: 'Tài liệu', href: 'https://huongdan.cnvwork.com', external: true },
  { label: 'Liên hệ', href: '/contact' },
];

// Inserted after "Sản phẩm" so the order in the rendered nav is:
// Sản phẩm · Tích hợp · Khách hàng · Bảng giá · Tài liệu
MENU.splice(1, 0, {
  label: 'Tích hợp',
  href: '/integrations',
  integrations: true, // custom render in MegaNav
});

// All module data — used by landing + product pages
const MODULES = [
  { group: 'Sales & CRM', name: 'Quản lý Lead', desc: 'Round-robin, scoring, phễu lead', icon: '🎯' },
  { group: 'Sales & CRM', name: 'Pipeline Deal', desc: 'Kanban, forecast, stage tuỳ chỉnh', icon: '📊' },
  { group: 'Sales & CRM', name: 'Báo giá', desc: 'Template + duyệt nhiều cấp', icon: '📋' },
  { group: 'Sales & CRM', name: 'Subscription', desc: 'Gia hạn, thanh toán định kỳ', icon: '🔄' },
  { group: 'Marketing', name: 'Campaign & Lead form', desc: 'Landing + form thu lead', icon: '📣' },
  { group: 'Marketing', name: 'Automation Flow', desc: 'Trigger → Action trực quan', icon: '🧩' },
  { group: 'Support', name: 'Ticket', desc: 'Phân luồng thông minh', icon: '🎫' },
  { group: 'Support', name: 'Inbox đa kênh', desc: 'Zalo, FB, Email, Web', icon: '📬' },
  { group: 'HR', name: 'Tuyển dụng', desc: 'JD, ứng viên, onboarding', icon: '👥' },
  { group: 'HR', name: 'Chấm công GPS', desc: 'Ca làm, OT, nghỉ phép', icon: '🕒' },
  { group: 'HR', name: 'Tài sản', desc: 'Giao, thu hồi, kiểm kê', icon: '💼' },
  { group: 'Operations', name: 'Tasks', desc: 'Kanban, subtask, deadline', icon: '✅' },
  { group: 'Operations', name: 'Phê duyệt', desc: 'Workflow đa cấp', icon: '✅' },
  { group: 'Reports', name: '20+ Dashboard', desc: 'Sẵn có, tuỳ chỉnh dễ', icon: '📈' },
];

Object.assign(window, { MENU, MODULES });
