/// Format a due date relative to today in German.
///
/// Returns labels like "Heute", "Morgen", "in X Tagen",
/// "Uberfaellig seit 1 Tag", "Uberfaellig seit X Tagen".
///
/// Both [dueDate] and [today] are compared as date-only (ignoring time).
String formatRelativeDate(DateTime dueDate, DateTime today) {
  final diff =
      DateTime(dueDate.year, dueDate.month, dueDate.day)
          .difference(DateTime(today.year, today.month, today.day))
          .inDays;

  if (diff == 0) return 'Heute';
  if (diff == 1) return 'Morgen';
  if (diff > 1) return 'in $diff Tagen';
  if (diff == -1) return 'Uberfaellig seit 1 Tag';
  return 'Uberfaellig seit ${diff.abs()} Tagen';
}
