<!DOCTYPE html>
<html lang="<?= service('request')->getLocale() ?>" dir="<?= service('request')->getLocale() === 'ar' ? 'rtl' : 'ltr' ?>">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title><?= $title ?? lang('App.dashboard') ?></title>
    <?php $isRtl = service('request')->getLocale() === 'ar'; ?>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/<?= $isRtl ? 'bootstrap.rtl.min.css' : 'bootstrap.min.css' ?>" rel="stylesheet">
    <?php if ($isRtl): ?>
        <link href="https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700&display=swap" rel="stylesheet">
        <style>body{font-family:'Tajawal',sans-serif;}</style>
    <?php endif; ?>
    <style>body{background:#f5f6fa;}</style>
</head>
<body>
<nav class="navbar navbar-light bg-white shadow-sm px-4 mb-4">
    <span class="navbar-brand">نظام حسابات الاستضافة</span>
    <div class="d-flex gap-3 align-items-center">
        <a href="/client/dashboard"><?= lang('App.dashboard') ?></a>
        <a href="/client/invoices"><?= lang('App.my_invoices') ?></a>
        <a href="/client/services"><?= lang('App.my_services') ?></a>
        <a href="?lang=<?= $isRtl ? 'en' : 'ar' ?>"><?= $isRtl ? 'English' : 'العربية' ?></a>
        <form method="post" action="/client/logout" class="m-0">
            <?= csrf_field() ?>
            <button class="btn btn-sm btn-outline-dark"><?= lang('App.logout') ?></button>
        </form>
    </div>
</nav>
<div class="container">
    <?= $this->renderSection('content') ?>
</div>
</body>
</html>
