<!doctype html>
@php($rtl = app()->getLocale() === 'ar')
<html lang="{{ app()->getLocale() }}" dir="{{ $rtl ? 'rtl' : 'ltr' }}" data-bs-theme="{{ session('theme', 'light') }}">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>@yield('title', 'MediBook Admin') — MediBook AI</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap{{ $rtl ? '.rtl' : '' }}.min.css" rel="stylesheet">
    <link href="{{ asset('css/medibook.css') }}" rel="stylesheet">
    <meta name="theme-color" content="#0B3142">
</head>
<body class="mb-admin">
<nav class="navbar navbar-expand-md mb-admin-bar px-3">
    <a class="navbar-brand fw-bold" href="{{ route('admin.dashboard') }}">🦷 MediBook <span class="badge text-bg-light">Admin</span></a>
    <div class="navbar-nav flex-row gap-2 ms-auto">
        <a class="nav-link {{ request()->routeIs('admin.dashboard') ? 'active' : '' }}" href="{{ route('admin.dashboard') }}">{{ __('Dashboard') }}</a>
        <a class="nav-link {{ request()->routeIs('admin.payments.*') ? 'active' : '' }}" href="{{ route('admin.payments.index') }}">{{ __('Payments') }}</a>
        <a class="nav-link {{ request()->routeIs('admin.activity.*') ? 'active' : '' }}" href="{{ route('admin.activity.index') }}">{{ __('Activity') }}</a>
        <a class="nav-link {{ request()->routeIs('admin.plans.*') ? 'active' : '' }}" href="{{ route('admin.plans.index') }}">{{ __('Plan') }}</a>
        <form method="POST" action="{{ route('logout') }}">@csrf<button class="btn btn-sm mb-btn-ghost">{{ __('Log out') }}</button></form>
    </div>
</nav>

<main class="container-fluid p-3 p-md-4" style="max-width:1200px">
    @if(session('status'))
        <div class="alert alert-success">{{ session('status') }}</div>
    @endif
    @yield('content')
</main>
@stack('page-scripts')
</body>
</html>
