Months of cross-border fighting killed 500 Afghan civilians: UN