<!doctype html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>@yield('title', 'SaaSShop 商家后台')</title>
    <link rel="stylesheet" href="/css/admin-base.css">
    <link rel="stylesheet" href="/css/merchant-admin.css">
</head>
<body>
<div class="layout layout-topnav">
    <aside class="sidebar">
        <h2 class="sidebar-title">SaaSShop</h2>
        <div class="muted">商家后台 / Merchant Console</div>

        <div class="group-title">总览</div>
        <a href="/merchant-admin">商家仪表盘</a>

        <div class="group-title">店铺运营</div>
        <a href="/merchant-admin/products">商品管理</a>
        <a href="/merchant-admin/product-categories">商品分类</a>
        <a href="/merchant-admin/orders">订单管理</a>
        <a href="/merchant-admin/users">用户管理</a>

        <div class="group-title">切换入口</div>
        <a href="/admin">总台管理</a>
        <a href="/">返回首页</a>
        <form method="post" action="/merchant-admin/logout" class="logout-form">@csrf <button type="submit">退出登录</button></form>
    </aside>
    <main class="content">
        <div class="top">
            <div>
                <h1 class="page-title">@yield('page_title', '商家后台')</h1>
                <div class="muted">当前登录：{{ session('admin_name') }}（{{ session('admin_email') }}） / 商家 ID：{{ session('admin_merchant_id') }}</div>
                <div class="badge">当前作用域：商家管理员</div>
            </div>
        </div>
        @if(session('success'))
            <div class="flash">{{ session('success') }}</div>
        @endif
        @if(session('warning'))
            <div class="warning">{{ session('warning') }}</div>
        @endif
        @if($errors->any())
            <div class="error-box">
                <strong>提交失败：</strong>
                <ul class="list-indent">
                    @foreach($errors->all() as $error)
                        <li>{{ $error }}</li>
                    @endforeach
                </ul>
            </div>
        @endif
        @yield('content')
    </main>
</div>
</body>
</html>
