<?php
declare(strict_types=1);

if (!function_exists('h')) {
    function h($v): string {
        return htmlspecialchars((string)$v, ENT_QUOTES, 'UTF-8');
    }
}

if (!function_exists('u')) {
    function u(string $path = ''): string {
        $base = '/HLG-Justice-Hub/';
        return $base . ltrim($path, '/');
    }
}

$logo        = $logo ?? 'https://hamdanlegalgroup.ae/wp-content/uploads/2026/02/logomail.png';
$name        = $name ?? ($_SESSION['name'] ?? 'مستخدم النظام');
$role        = strtoupper((string)($_SESSION['role'] ?? 'STAFF'));
$currentPath = trim(str_replace('\\', '/', parse_url($_SERVER['REQUEST_URI'] ?? '', PHP_URL_PATH) ?? ''), '/');
$isFinancial = str_contains($currentPath, '/financial/');
?>
