import {
  LayoutDashboard,
  Users,
  Shield,
  FileText,
  Building2,
  GitBranch,
  Briefcase,
  UserCheck,
  FileSignature,
  CreditCard,
  Calculator,
  Calendar,
  Play,
  Wallet,
  PiggyBank,
  TrendingUp,
  Landmark,
  Send,
  CheckCircle,
  Database,
  Building,
  ShieldCheck,
  Layers,
  Star,
  Clock,
  type LucideIcon,
} from 'lucide-react';

export interface NavItem {
  name: string;
  href: string;
  icon: LucideIcon;
  badge?: number;
}

export interface NavModule {
  id: string;
  name: string;
  description: string;
  icon: LucideIcon;
  color: string;
  items: NavItem[];
}

export const modules: NavModule[] = [
  {
    id: 'dashboard',
    name: 'Dashboard',
    description: 'Visão geral do sistema',
    icon: LayoutDashboard,
    color: 'primary',
    items: [
      { name: 'Painel Principal', href: '/', icon: LayoutDashboard },
    ],
  },
  {
    id: 'admin',
    name: 'Administração',
    description: 'Utilizadores, perfis e auditoria',
    icon: Shield,
    color: 'admin',
    items: [
      { name: 'Utilizadores', href: '/admin/users', icon: Users },
      { name: 'Perfis e Permissões', href: '/admin/roles', icon: Shield },
      { name: 'Auditoria', href: '/admin/audit', icon: FileText },
    ],
  },
  {
    id: 'org',
    name: 'Organização',
    description: 'Estrutura do Estado',
    icon: Building2,
    color: 'org',
    items: [
      { name: 'Ministérios', href: '/org/ministries', icon: Building2 },
      { name: 'Unidades Orgânicas', href: '/org/units', icon: GitBranch },
      { name: 'Cargos e Posições', href: '/org/positions', icon: Briefcase },
    ],
  },
  {
    id: 'rh',
    name: 'RH & Folha',
    description: 'Recursos Humanos e Folha de Pagamento',
    icon: UserCheck,
    color: 'rh',
    items: [
      { name: 'Agentes', href: '/rh/agents', icon: Users },
      { name: 'Contratos', href: '/rh/contracts', icon: FileSignature },
      { name: 'Contas Bancárias', href: '/rh/bank-accounts', icon: CreditCard },
      { name: 'Grelha Salarial', href: '/rh/salary-grid', icon: Calculator },
      { name: 'Períodos de Folha', href: '/rh/payroll-periods', icon: Calendar },
      { name: 'Processamento', href: '/rh/payroll-runs', icon: Play },
      { name: 'Regras de Imposto', href: '/rh/tax-settings', icon: ShieldCheck },
      { name: 'Escalões de IRPS', href: '/rh/tax-brackets', icon: Layers },
      { name: 'Avaliações', href: '/rh/evaluations', icon: Star },
      { name: 'Gestão de Assiduidade', href: '/rh/attendance', icon: Clock },
    ],
  },
  {
    id: 'budget',
    name: 'Orçamento',
    description: 'Gestão orçamental',
    icon: Wallet,
    color: 'budget',
    items: [
      { name: 'Exercícios Fiscais', href: '/budget/fiscal-years', icon: Calendar },
      { name: 'Linhas Orçamentais', href: '/budget/lines', icon: PiggyBank },
      { name: 'Execução', href: '/budget/execution', icon: TrendingUp },
    ],
  },
  {
    id: 'treasury',
    name: 'Tesouraria',
    description: 'Pagamentos e transferências',
    icon: Landmark,
    color: 'treasury',
    items: [
      { name: 'Contas de Caixa', href: '/treasury/cash-accounts', icon: Wallet },
      { name: 'Planos de Tesouraria', href: '/treasury/plans', icon: Calendar },
      { name: 'Entradas', href: '/treasury/entries', icon: FileText },
      { name: 'Autorizações', href: '/treasury/authorizations', icon: ShieldCheck },
      { name: 'Ordens de Pagamento', href: '/treasury/orders', icon: FileText },
      { name: 'Lotes de Pagamento', href: '/treasury/batches', icon: Send },
      { name: 'Confirmações', href: '/treasury/confirmations', icon: CheckCircle },
      { name: 'Fluxo de Caixa', href: '/treasury/cash-flow', icon: TrendingUp },
      { name: 'Conciliação', href: '/treasury/reconciliation', icon: Layers },
    ],
  },
  {
    id: 'common',
    name: 'Dados Comuns',
    description: 'Dados partilhados',
    icon: Database,
    color: 'common',
    items: [
      { name: 'Bancos', href: '/common/banks', icon: Building },
    ],
  },
];
