<!DOCTYPE html>

<!-- 言語属性を指定 -->
<html lang="ja">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>@yield('title') | So-Manager管理パネル</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <!-- CSRF Token -->
    <meta name="csrf-token" content="{{ csrf_token() }}">

    <!-- Font Awesome -->
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
    <!-- Ionicons -->
    <link rel="stylesheet" href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
    <!-- daterange picker -->
    <link rel="stylesheet" href="{{ asset('plugins/daterangepicker/daterangepicker-bs3.css') }}">
    <!-- iCheck for checkboxes and radio inputs -->
    <link rel="stylesheet" href="{{ asset('plugins/iCheck/all.css') }}">
    <!-- Bootstrap Color Picker -->
    <link rel="stylesheet" href="{{ asset('plugins/colorpicker/bootstrap-colorpicker.min.css') }}">
    <!-- Bootstrap time Picker -->
    <link rel="stylesheet" href="{{ asset('plugins/timepicker/bootstrap-timepicker.min.css') }}">
    <link rel="stylesheet" href="{{ asset('plugins/datepicker/datepicker3.css') }}">
    <!-- Select2 -->
    <link rel="stylesheet" href="{{ asset('plugins/select2/select2.min.css') }}">
    <!-- Theme style -->
    <link rel="stylesheet" href="{{ asset('dist/css/adminlte.min.css') }}">
    <link rel="stylesheet" href="{{ asset('plugins/datatables/dataTables.bootstrap4.css') }}">
    <!-- Google Font: Source Sans Pro -->
    <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet">

    <link rel="stylesheet" href="{{ asset('assets/css/style.css') }}">
    <!-- Styles -->
    <link href="{{ asset('css/app.css') }}" rel="stylesheet">
    <!-- kin 追加 -->
    <link href="{{ asset('assets/css/app.css') }}" rel="stylesheet">
    <link rel="stylesheet" href="{{ asset('plugins/summernote/summernote.min.css') }}">
</head>

<body class="hold-transition sidebar-mini">
    <div class="wrapper">
        <!-- Navbar -->
        <nav class="main-header navbar navbar-expand bg-white navbar-light border-bottom">


            <!-- SEARCH FORM -->
            <!--
        <form class="form-inline ml-3">
          <div class="input-group input-group-sm">
            <input class="form-control form-control-navbar" type="search" placeholder="Search" aria-label="Search">
            <div class="input-group-append">
              <button class="btn btn-navbar" type="submit">
                <i class="fa fa-search"></i>
              </button>
            </div>
          </div>
        </form>
        -->

            <!-- Right navbar links -->
            <ul class="navbar-nav ml-3">
                <!-- ハード異常 件数表示（ドロップダウン任意表示：ここでは件数バッジのみ簡易） -->
                <li class="nav-item dropdown">
                    <a class="nav-link text-danger" data-toggle="dropdown" href="#">
                        <i class="fa fa-exclamation-circle"></i>
                        <span class="d-none d-md-inline">ハード異常:</span>
                        {{ $hardCount ?? 0 }}件
                        @if (!empty($hardLatest))
                            <small class="d-none d-md-inline">
                                最新:{{ \Carbon\Carbon::parse($hardLatest)->format('Y/m/d H:i') }}
                            </small>
                        @endif
                    </a>
                    @if (!empty($latestHards) && count($latestHards))
                        <div class="dropdown-menu dropdown-menu-lg dropdown-menu-right">
                            <span class="dropdown-header">
                                ハード異常 {{ $hardCount }}件（未/進行中）
                            </span>
                            <div class="dropdown-divider"></div>
                            @foreach ($latestHards as $hq)
                                <a href="{{ route('information', ['type' => 'hard', 'status' => 'untreated', 'period' => 'all']) }}"
                                    class="dropdown-item" style="white-space:normal;">
                                    {{ Str::limit($hq->que_comment ?? 'ハード異常', 40) }}
                                    <span class="float-right text-muted text-sm">
                                        {{ \Carbon\Carbon::parse($hq->created_at)->diffForHumans() }}
                                    </span>
                                </a>
                                <div class="dropdown-divider"></div>
                            @endforeach
                            <a href="{{ route('information', ['type' => 'hard', 'period' => 'all']) }}"
                                class="dropdown-item dropdown-footer">
                                すべてを見る
                            </a>
                        </div>
                    @endif
                </li>

                <!-- タスク 件数 + ドロップダウン最新5件 -->
                <li class="nav-item dropdown">
                    <a class="nav-link" data-toggle="dropdown" href="#">
                        <i class="fa fa-bell-o"></i>
                        <span class="d-none d-md-inline">タスク:</span>
                        {{ $taskCount ?? 0 }}件
                        @if (!empty($taskLatest))
                            <small class="d-none d-md-inline">
                                最新:{{ \Carbon\Carbon::parse($taskLatest)->format('Y/m/d H:i') }}
                            </small>
                        @endif
                    </a>
                    @if (!empty($latestTasks) && count($latestTasks))
                        <div class="dropdown-menu dropdown-menu-lg dropdown-menu-right">
                            <span class="dropdown-header">
                                タスク {{ $taskCount }}件（未/進行中）
                            </span>
                            <div class="dropdown-divider"></div>
                            @foreach ($latestTasks as $tq)
                                <a href="{{ route('information', ['type' => 'task', 'status' => 'untreated', 'period' => 'all']) }}"
                                    class="dropdown-item" style="white-space:normal;">
                                    {{ Str::limit($tq->que_comment ?? 'タスク', 40) }}
                                    <span class="float-right text-muted text-sm">
                                        {{ \Carbon\Carbon::parse($tq->created_at)->diffForHumans() }}
                                    </span>
                                </a>
                                <div class="dropdown-divider"></div>
                            @endforeach
                            <a href="{{ route('information', ['type' => 'task', 'period' => 'all']) }}"
                                class="dropdown-item dropdown-footer">
                                過去のタスクを全て見る
                            </a>
                        </div>
                    @endif
                </li>
            </ul>
            <ul class="navbar-nav ml-auto">
                <li class="nav-item">
                    <a class="nav-link" style="margin-left:20px;">
                        {{ __('ようこそ、:ope_name様', ['ope_name' => Auth::user()->ope_name]) }}
                    </a>
                </li>

                <li class="nav-item">
                    <a class="nav-link" href="/logout"><i class="fa fa-sign-out"></i> {{ __('ログアウト') }}</a>
                </li>
            </ul>
        </nav>
        <!-- /.navbar -->

        <!-- Main Sidebar Container -->
        <aside class="main-sidebar sidebar-dark-primary bg-success elevation-4">
            <!-- Brand Logo -->
            <a href="/home" class="brand-link">
                <img src="{{ asset('assets/img/so-rin_logo.png') }}" alt="Logo" class="brand-image"
                    style="opacity: .8">
                <span class="brand-text font-weight-light">So-Manager</span>
            </a>
            <div class="sidebar">
                @php
                    // タグ・シール管理
                    $tagRoutes = [
                        'tags', // 例: タグ・シール管理のroute名
                    ];
                    // 集計業務
                    $aggregateRoutes = [
                        'aggregate', // 例: 集計業務のroute名
                    ];
                    // 決済マスタ
                    $settlementRoutes = [
                        'settlement1',
                        'settlement2', // 決済マスタの各route名
                    ];
                    // システムマスタ
                    $systemRoutes = [
                        'system1',
                        'system2', // システムマスタの各route名
                    ];

                @endphp

                <!-- Sidebar Menu -->
                <nav class="mt-2">
                    <ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu"
                        data-accordion="false">

                        @if (!$isSorin)
                            <!-- 非ソーリンユーザー用: 運営元メニューを親として構造変更 -->
                            @if ($visibleCities && $visibleCities->count() > 0)
                                @php
                                    // 現在のページが属する city_id を判定
                                    // 1. ルートパラメータから city_id を取得（city_dashboard など）
                                    // 2. ない場合は、visibleCities の最初の city_id を使用（非ソーリンユーザーは1つのみ）
                                    $currentCityId =
                                        request()->route('city_id') ?? ($visibleCities->first()?->city_id ?? null);

                                    // 現在のページが都市管理ページか通常ページかを判定
                                    $isCityRoute =
                                        request()->routeIs('city_dashboard') ||
                                        str_contains(request()->url(), '/city/');

                                    // 現在のルート名を取得（ハイライト判定用）
                                    $currentRoute = app('router')->currentRouteName();

                                    // 非ソーリンユーザーが閲覧可能なページのルート名
                                    $visibleRoutes = [
                                        'city_dashboard', // 自治体ダッシュボード
                                        'information', // 常時表示インフォメーション
                                        'tagissue', // タグ発行キュー処理、履歴表示
                                        'seals', // シール発行履歴
                                        'periodical', // 定期利用・契約状況
                                        'contractor', // 契約者一覧
                                        'contractor_List', // 未更新者一覧
                                        'update_candidate', // 更新予定者一覧
                                        'reservation', // 予約者一覧
                                        'personal', // 本人確認手動処理
                                        'using_status', // 区画別利用率状況
                                        'news', // 一時売り上げ入力 / 最新ニュース登録
                                        'users', // 利用者マスタ
                                        'regularcontracts', // 定期契約マスタ
                                        'reserves', // 定期予約マスタ
                                        'usertypes', // 利用者分類マスタ
                                        'parks', // 駐輪場マスタ
                                        'pricelist', // 料金一覧表
                                        'prices', // 駐輪場所、料金マスタ
                                        'psections', // 車種区分マスタ
                                    ];

                                    $paymentRoutes = ['tax', 'payments', 'settlement_transactions'];
                                    $systemRoutes = ['opes', 'devices', 'operator_ques', 'settings', 'mail_templates'];
                                    $masterRoutes = ['inv_settings'];
                                    $current = app('router')->currentRouteName();

                                @endphp
                                <li class="nav-item has-treeview menu-open">
                                    <a href="#" class="nav-link active">
                                        <i class="nav-icon fa fa-map-marker"></i>
                                        <p>
                                            {{ __('運営元メニュー') }}
                                            <i class="right fa fa-angle-down"></i>
                                        </p>
                                    </a>
                                    <ul class="nav nav-treeview" style="display: block;">
                                        @foreach ($visibleCities as $city)
                                            <li
                                                class="nav-item has-treeview @if ($currentCityId == $city->city_id) menu-open @endif">
                                                <a href="#"
                                                    class="nav-link @if ($currentCityId == $city->city_id) active @endif">
                                                    <i class="nav-icon fa fa-building-o"></i>
                                                    <span style="margin-left:10px;">{{ $city->city_name }}</span>
                                                    <i class="right fa fa-angle-down"></i>
                                                </a>
                                                <ul class="nav nav-treeview"
                                                    style="display: @if ($currentCityId == $city->city_id) block @else none @endif; margin-left: 20px;">
                                                    <!-- SWA-03, SWA-04: ホーム -->
                                                    <li class="nav-item has-treeview @if (in_array($currentRoute, ['city_dashboard', 'information'])) menu-open @endif">
                                                        <a href="#" class="nav-link @if (in_array($currentRoute, ['city_dashboard', 'information'])) active @endif">
                                                            <i class="nav-icon fa fa-home"></i>
                                                            <p>ホーム<i class="right fa fa-angle-down"></i></p>
                                                        </a>
                                                        <ul class="nav nav-treeview" style="display: @if (in_array($currentRoute, ['city_dashboard', 'information'])) block @else none @endif;">
                                                            <li class="nav-item">
                                                                <a href="{{ route('city_dashboard', ['city_id' => $city->city_id]) }}" class="nav-link @if ($currentRoute === 'city_dashboard' && $currentCityId == $city->city_id) active @endif">
                                                                    <span style="margin-left:20px;">ダッシュボード</span>
                                                                </a>
                                                            </li>
                                                            <li class="nav-item">
                                                                <a href="{{ route('information') }}" class="nav-link @if ($currentRoute === 'information') active @endif">
                                                                    <span style="margin-left:20px;">常時表示インフォメーション</span>
                                                                </a>
                                                            </li>
                                                        </ul>
                                                    </li>

                                                    <!-- SWA-05, SWA-06, SWA-07: タグ・シール管理 -->
                                                    <li class="nav-item has-treeview @if (in_array($currentRoute, ['tag.reissue', 'seal.reissue', 'seals', 'tagissue'])) menu-open @endif">
                                                        <a href="#" class="nav-link @if (in_array($currentRoute, ['tag.reissue', 'seal.reissue', 'seals', 'tagissue'])) active @endif">
                                                            <i class="nav-icon fa fa-repeat"></i>
                                                            <p>タグ・シール管理<i class="right fa fa-angle-down"></i></p>
                                                        </a>
                                                        <ul class="nav nav-treeview" style="display: @if (in_array($currentRoute, ['tag.reissue', 'seal.reissue', 'seals', 'tagissue'])) block @else none @endif;">
                                                            <li class="nav-item">
                                                                <a href="{{ route('tag.reissue') }}" class="nav-link @if ($currentRoute === 'tag.reissue') active @endif">
                                                                    <span style="margin-left:20px;">タグ再発行</span>
                                                                </a>
                                                            </li>
                                                            <li class="nav-item">
                                                                <a href="{{ route('seal.reissue') }}" class="nav-link @if ($currentRoute === 'seal.reissue') active @endif">
                                                                    <span style="margin-left:20px;">シール再発行</span>
                                                                </a>
                                                            </li>
                                                            <li class="nav-item">
                                                                <a href="{{ route('seals', ['city_id' => $city->city_id]) }}" class="nav-link @if ($currentRoute === 'seals') active @endif">
                                                                    <span style="margin-left:20px;">シール発行履歴</span>
                                                                </a>
                                                            </li>
                                                            <li class="nav-item">
                                                                <a href="{{ route('tagissue', ['city_id' => $city->city_id]) }}" class="nav-link @if ($currentRoute === 'tagissue') active @endif">
                                                                    <span style="margin-left:20px;">タグ発行キュー処理、履歴表示</span>
                                                                </a>
                                                            </li>
                                                        </ul>
                                                    </li>

                                                    <!-- SWA-08〜SWA-15: 定期駐輪管理 -->
                                                    @php
                                                        $parkingRoutes = ['periodical', 'contractor', 'contractor_List', 'update_candidate', 'reservation', 'personal', 'refund', 'using_status'];
                                                    @endphp
                                                    <li class="nav-item has-treeview @if (in_array($currentRoute, $parkingRoutes)) menu-open @endif">
                                                        <a href="#" class="nav-link @if (in_array($currentRoute, $parkingRoutes)) active @endif">
                                                            <i class="nav-icon fa fa-repeat"></i>
                                                            <p>定期駐輪管理<i class="right fa fa-angle-down"></i></p>
                                                        </a>
                                                        <ul class="nav nav-treeview" style="display: @if (in_array($currentRoute, $parkingRoutes)) block @else none @endif;">
                                                            <li class="nav-item">
                                                                <a href="{{ route('contractor', ['city_id' => $city->city_id]) }}" class="nav-link @if ($currentRoute === 'contractor') active @endif">
                                                                    <span style="margin-left:20px;">契約者一覧</span>
                                                                </a>
                                                            </li>
                                                            <li class="nav-item">
                                                                <a href="{{ route('contractor_List', ['city_id' => $city->city_id]) }}" class="nav-link @if ($currentRoute === 'contractor_List') active @endif">
                                                                    <span style="margin-left:20px;">未更新者一覧</span>
                                                                </a>
                                                            </li>
                                                            <li class="nav-item">
                                                                <a href="{{ route('update_candidate', ['city_id' => $city->city_id]) }}" class="nav-link @if ($currentRoute === 'update_candidate') active @endif">
                                                                    <span style="margin-left:20px;">更新予定者一覧</span>
                                                                </a>
                                                            </li>
                                                            <li class="nav-item">
                                                                <a href="{{ route('reservation', ['city_id' => $city->city_id]) }}" class="nav-link @if ($currentRoute === 'reservation') active @endif">
                                                                    <span style="margin-left:20px;">予約者一覧</span>
                                                                </a>
                                                            </li>
                                                            <li class="nav-item">
                                                                <a href="{{ route('personal', ['city_id' => $city->city_id]) }}" class="nav-link @if ($currentRoute === 'personal') active @endif">
                                                                    <span style="margin-left:20px;">本人確認手動処理</span>
                                                                </a>
                                                            </li>
                                                            <li class="nav-item">
                                                                <a href="{{ route('refund') }}" class="nav-link @if ($currentRoute === 'refund') active @endif">
                                                                    <span style="margin-left:20px;">返金処理</span>
                                                                </a>
                                                            </li>
                                                            <li class="nav-item">
                                                                <a href="{{ route('periodical', ['city_id' => $city->city_id]) }}" class="nav-link @if ($currentRoute === 'periodical') active @endif">
                                                                    <span style="margin-left:20px;">定期利用・契約状況</span>
                                                                </a>
                                                            </li>
                                                            <li class="nav-item">
                                                                <a href="{{ route('using_status', ['city_id' => $city->city_id]) }}" class="nav-link @if ($currentRoute === 'using_status') active @endif">
                                                                    <span style="margin-left:20px;">区画別利用率状況</span>
                                                                </a>
                                                            </li>
                                                        </ul>
                                                    </li>

                                                    <!-- SWA-17, SWA-18: 集計業務 -->
                                                    <li class="nav-item has-treeview @if (in_array($currentRoute, ['sales.report', 'sales.detail'])) menu-open @endif">
                                                        <a href="#" class="nav-link @if (in_array($currentRoute, ['sales.report', 'sales.detail'])) active @endif">
                                                            <i class="nav-icon fa fa-calculator"></i>
                                                            <p>集計業務<i class="right fa fa-angle-down"></i></p>
                                                        </a>
                                                        <ul class="nav nav-treeview" style="display: @if (in_array($currentRoute, ['sales.report', 'sales.detail'])) block @else none @endif;">
                                                            <li class="nav-item">
                                                                <a href="{{ route('sales.report') }}" class="nav-link @if ($currentRoute === 'sales.report') active @endif">
                                                                    <span style="margin-left:20px;">売上年報／月報／日報</span>
                                                                </a>
                                                            </li>
                                                            <li class="nav-item">
                                                                <a href="{{ route('sales.detail') }}" class="nav-link @if ($currentRoute === 'sales.detail') active @endif">
                                                                    <span style="margin-left:20px;">売上詳細</span>
                                                                </a>
                                                            </li>
                                                        </ul>
                                                    </li>

                                                    <!-- SWA-19: 一般ウェブ管理 -->
                                                    <li class="nav-item has-treeview @if ($currentRoute === 'news') menu-open @endif">
                                                        <a href="#" class="nav-link @if ($currentRoute === 'news') active @endif">
                                                            <i class="nav-icon fa fa-globe"></i>
                                                            <p>一般ウェブ管理<i class="right fa fa-angle-down"></i></p>
                                                        </a>
                                                        <ul class="nav nav-treeview" style="display: @if ($currentRoute === 'news') block @else none @endif;">
                                                            <li class="nav-item">
                                                                <a href="{{ route('news', ['city_id' => $city->city_id]) }}" class="nav-link @if ($currentRoute === 'news') active @endif">
                                                                    <span style="margin-left:20px;">最新ニュース登録</span>
                                                                </a>
                                                            </li>
                                                        </ul>
                                                    </li>

                                                    <!-- SWA-20〜SWA-23: 利用者マスタ -->
                                                    @php
                                                        $userRoutes = ['users', 'regularcontracts', 'reserves', 'usertypes'];
                                                    @endphp
                                                    <li class="nav-item has-treeview @if (in_array($currentRoute, $userRoutes)) menu-open @endif">
                                                        <a href="#" class="nav-link @if (in_array($currentRoute, $userRoutes)) active @endif">
                                                            <i class="nav-icon fa fa-users"></i>
                                                            <p>利用者マスタ<i class="right fa fa-angle-down"></i></p>
                                                        </a>
                                                        <ul class="nav nav-treeview" style="display: @if (in_array($currentRoute, $userRoutes)) block @else none @endif;">
                                                            <li class="nav-item">
                                                                <a href="{{ route('users', ['city_id' => $city->city_id]) }}" class="nav-link @if ($currentRoute === 'users') active @endif">
                                                                    <span style="margin-left:20px;">利用者マスタ</span>
                                                                </a>
                                                            </li>
                                                            <li class="nav-item">
                                                                <a href="{{ route('regularcontracts', ['city_id' => $city->city_id]) }}" class="nav-link @if ($currentRoute === 'regularcontracts') active @endif">
                                                                    <span style="margin-left:20px;">定期契約マスタ</span>
                                                                </a>
                                                            </li>
                                                            <li class="nav-item">
                                                                <a href="{{ route('reserves', ['city_id' => $city->city_id]) }}" class="nav-link @if ($currentRoute === 'reserves') active @endif">
                                                                    <span style="margin-left:20px;">定期空き予約マスタ</span>
                                                                </a>
                                                            </li>
                                                            <li class="nav-item">
                                                                <a href="{{ route('usertypes', ['city_id' => $city->city_id]) }}" class="nav-link @if ($currentRoute === 'usertypes') active @endif">
                                                                    <span style="margin-left:20px;">利用者分類マスタ</span>
                                                                </a>
                                                            </li>
                                                        </ul>
                                                    </li>

                                                    <!-- SWA-24〜SWA-37: 駐輪場マスタ -->
                                                    @php
                                                        $priceRoutes = ['parks', 'city', 'pricelist', 'prices', 'psections', 'ptype', 'zones', 'pplaces', 'stations', 'regular_types', 'terms', 'print_areas', 'contract_allowable_cities', 'jurisdiction.parking'];
                                                    @endphp
                                                    <li class="nav-item has-treeview @if (in_array($currentRoute, $priceRoutes)) menu-open @endif">
                                                        <a href="#" class="nav-link @if (in_array($currentRoute, $priceRoutes)) active @endif">
                                                            <i class="nav-icon fa fa-th"></i>
                                                            <p>駐輪場マスタ<i class="right fa fa-angle-down"></i></p>
                                                        </a>
                                                        <ul class="nav nav-treeview" style="display: @if (in_array($currentRoute, $priceRoutes)) block @else none @endif;">
                                                            <li class="nav-item">
                                                                <a href="{{ route('city', ['city_id' => $city->city_id]) }}" class="nav-link @if ($currentRoute === 'city') active @endif">
                                                                    <span style="margin-left:20px;">市区マスタ</span>
                                                                </a>
                                                            </li>
                                                            
                                                            <li class="nav-item">
                                                                <a href="{{ route('parks', ['city_id' => $city->city_id]) }}"
                                                                class="nav-link {{ request()->routeIs('parks') ? 'active' : '' }}">
                                                                    <span style="margin-left:20px;">駐輪場マスタ</span>
                                                                </a>
                                                            </li>

                                                            <li class="nav-item">
                                                                <a href="{{ route('pricelist', ['city_id' => $city->city_id]) }}" class="nav-link @if ($currentRoute === 'pricelist') active @endif">
                                                                    <span style="margin-left:20px;">料金一覧表</span>
                                                                </a>
                                                            </li>
                                                            <li class="nav-item">
                                                                <a href="{{ route('prices', ['city_id' => $city->city_id]) }}" class="nav-link @if ($currentRoute === 'prices') active @endif">
                                                                    <span style="margin-left:20px;">駐輪場所・料金マスタ</span>
                                                                </a>
                                                            </li>
                                                            <li class="nav-item">
                                                                <a href="{{ route('psections', ['city_id' => $city->city_id]) }}" class="nav-link @if ($currentRoute === 'psections') active @endif">
                                                                    <span style="margin-left:20px;">車種区分マスタ</span>
                                                                </a>
                                                            </li>
                                                            <li class="nav-item">
                                                                <a href="{{ route('ptype') }}" class="nav-link @if ($currentRoute === 'ptype') active @endif">
                                                                    <span style="margin-left:20px;">駐輪分類マスタ</span>
                                                                </a>
                                                            </li>
                                                            <li class="nav-item">
                                                                <a href="{{ route('zones') }}" class="nav-link @if ($currentRoute === 'zones') active @endif">
                                                                    <span style="margin-left:20px;">ゾーンマスタ</span>
                                                                </a>
                                                            </li>
                                                            <li class="nav-item">
                                                                <a href="{{ route('pplaces') }}" class="nav-link @if ($currentRoute === 'pplaces') active @endif">
                                                                    <span style="margin-left:20px;">駐輪車室マスタ</span>
                                                                </a>
                                                            </li>
                                                            <li class="nav-item">
                                                                <a href="{{ route('stations') }}" class="nav-link @if ($currentRoute === 'stations') active @endif">
                                                                    <span style="margin-left:20px;">近傍駅マスタ</span>
                                                                </a>
                                                            </li>
                                                            <li class="nav-item">
                                                                <a href="{{ route('regular_types') }}" class="nav-link @if ($currentRoute === 'regular_types') active @endif">
                                                                    <span style="margin-left:20px;">定期種別マスタ</span>
                                                                </a>
                                                            </li>
                                                            <li class="nav-item">
                                                                <a href="{{ route('terms') }}" class="nav-link @if ($currentRoute === 'terms') active @endif">
                                                                    <span style="margin-left:20px;">利用規約マスタ</span>
                                                                </a>
                                                            </li>
                                                            <li class="nav-item">
                                                                <a href="{{ route('print_areas') }}" class="nav-link @if ($currentRoute === 'print_areas') active @endif">
                                                                    <span style="margin-left:20px;">シール印刷範囲マスタ</span>
                                                                </a>
                                                            </li>
                                                            <li class="nav-item">
                                                                <a href="{{ route('contract_allowable_cities') }}" class="nav-link @if ($currentRoute === 'contract_allowable_cities') active @endif">
                                                                    <span style="margin-left:20px;">契約許容市区マスタ</span>
                                                                </a>
                                                            </li>
                                                            <li class="nav-item">
                                                                <a href="{{ route('jurisdiction.parking') }}" class="nav-link @if ($currentRoute === 'jurisdiction.parking') active @endif">
                                                                    <span style="margin-left:20px;">駐輪規定読込記録</span>
                                                                </a>
                                                            </li>
                                                        </ul>
                                                    </li>

                                                    <!-- SWA-38: 決済マスタ -->
                                                    <li class="nav-item has-treeview @if ($current === 'settlement_transactions') menu-open @endif">
                                                        <a href="#" class="nav-link @if ($current === 'settlement_transactions') active @endif">
                                                            <i class="nav-icon fa fa-credit-card"></i>
                                                            <p>決済マスタ<i class="right fa fa-angle-down"></i></p>
                                                        </a>
                                                        <ul class="nav nav-treeview" style="display: @if ($current === 'settlement_transactions') block @else none @endif;">
                                                            <li class="nav-item">
                                                                <a href="{{ route('settlement_transactions') }}" class="nav-link @if ($current === 'settlement_transactions') active @endif">
                                                                    <span style="margin-left:20px;">決済トランザクション</span>
                                                                </a>
                                                            </li>
                                                        </ul>
                                                    </li>

                                                    <!-- SWA-39〜SWA-42: システムマスタ -->
                                                    @php
                                                        $systemRoutes = ['opes', 'devices', 'operator_ques', 'settings', 'mail_templates'];
                                                    @endphp
                                                    <li class="nav-item has-treeview @if (in_array($current, $systemRoutes)) menu-open @endif">
                                                        <a href="#" class="nav-link @if (in_array($current, $systemRoutes)) active @endif">
                                                            <i class="nav-icon fa fa-cogs"></i>
                                                            <p>システムマスタ<i class="right fa fa-angle-down"></i></p>
                                                        </a>
                                                        <ul class="nav nav-treeview" style="display: @if (in_array($current, $systemRoutes)) block @else none @endif;">
                                                            <li class="nav-item">
                                                                <a href="{{ route('opes') }}" class="nav-link @if ($current === 'opes') active @endif">
                                                                    <span style="margin-left:20px;">オペレーターマスタ</span>
                                                                </a>
                                                            </li>
                                                            <li class="nav-item">
                                                                <a href="{{ route('devices') }}" class="nav-link @if ($current === 'devices') active @endif">
                                                                    <span style="margin-left:20px;">デバイス管理マスタ</span>
                                                                </a>
                                                            </li>
                                                            <li class="nav-item">
                                                                <a href="{{ route('operator_ques') }}" class="nav-link @if ($current === 'operator_ques') active @endif">
                                                                    <span style="margin-left:20px;">オペレータキュー</span>
                                                                </a>
                                                            </li>
                                                            <li class="nav-item">
                                                                <a href="{{ route('mail_templates') }}" class="nav-link @if ($current === 'mail_templates') active @endif">
                                                                    <span style="margin-left:20px;">メール送信テンプレート</span>
                                                                </a>
                                                            </li>
                                                        </ul>
                                                    </li>

                                                    <!-- SWA-43〜SWA-45: マスタ管理 -->
                                                    @php
                                                        $masterRoutes = ['inv_settings', 'lottery.master', 'lottery.setting'];
                                                    @endphp
                                                    <li class="nav-item has-treeview @if (in_array($current, $masterRoutes)) menu-open @endif">
                                                        <a href="#" class="nav-link @if (in_array($current, $masterRoutes)) active @endif">
                                                            <i class="nav-icon fa fa-object-group"></i>
                                                            <p>マスタ管理<i class="right fa fa-angle-down"></i></p>
                                                        </a>
                                                        <ul class="nav nav-treeview" style="display: @if (in_array($current, $masterRoutes)) block @else none @endif;">
                                                            <li class="nav-item">
                                                                <a href="{{ route('inv_settings') }}" class="nav-link @if ($current === 'inv_settings') active @endif">
                                                                    <span style="margin-left:20px;">インボイス設定</span>
                                                                </a>
                                                            </li>
                                                            <li class="nav-item">
                                                                <a href="{{ route('lottery.master') }}" class="nav-link @if ($current === 'lottery.master') active @endif">
                                                                    <span style="margin-left:20px;">駐輪場抽選応募マスタ</span>
                                                                </a>
                                                            </li>
                                                            <li class="nav-item">
                                                                <a href="{{ route('lottery.setting') }}" class="nav-link @if ($current === 'lottery.setting') active @endif">
                                                                    <span style="margin-left:20px;">抽選申込設定マスタ</span>
                                                                </a>
                                                            </li>
                                                        </ul>
                                                    </li>

                                                </ul>
                                            </li>
                                        @endforeach
                                    </ul>
                                </li>
                            @endif
                        @else
                            <!-- ソーリンユーザー用: 設計書（SWA-03〜SWA-45）に合わせたメニュー構造 -->
                            @php
                                $current = app('router')->currentRouteName();
                                
                                // 各グループに含まれるルート名
                                $homeRoutes = ['dashboard', 'information'];
                                $tagSealRoutes = ['tag.reissue', 'seal.reissue', 'seals', 'tagissue'];
                                $parkingRoutes = ['contractor', 'contractor_List', 'update_candidate', 'reservation', 'personal', 'refund', 'periodical', 'using_status'];
                                $aggregateRoutes = ['sales.report', 'sales.detail'];
                                $webRoutes = ['news'];
                                $userRoutes = ['users', 'regularcontracts', 'reserves', 'usertypes'];
                                $parkMasterRoutes = ['city', 'parks', 'pricelist', 'prices', 'psections', 'ptype', 'zones', 'pplaces', 'stations', 'regular_types', 'terms', 'print_areas', 'contract_allowable_cities', 'jurisdiction.parking'];
                                $paymentRoutes = ['tax', 'payments', 'settlement_transactions'];
                                $systemRoutes = ['opes', 'devices', 'operator_ques', 'settings', 'mail_templates'];
                                $masterRoutes = ['inv_settings', 'lottery.master', 'lottery.setting'];
                            @endphp

                            <!-- SWA-03, SWA-04: ホーム -->
                            <li class="nav-item has-treeview @if (in_array($current, $homeRoutes)) menu-open @endif">
                                <a href="#" class="nav-link @if (in_array($current, $homeRoutes)) active @endif">
                                    <i class="nav-icon fa fa-home"></i>
                                    <p>ホーム<i class="right fa fa-angle-down"></i></p>
                                </a>
                                <ul class="nav nav-treeview" style="display: @if (in_array($current, $homeRoutes)) block @else none @endif;">
                                    <li class="nav-item">
                                        <a href="{{ route('dashboard') }}" class="nav-link @if ($current === 'dashboard') active @endif">
                                            <span style="margin-left:20px;">ダッシュボード</span>
                                        </a>
                                    </li>
                                    <li class="nav-item">
                                        <a href="{{ route('information') }}" class="nav-link @if ($current === 'information') active @endif">
                                            <span style="margin-left:20px;">常時表示インフォメーション</span>
                                        </a>
                                    </li>
                                </ul>
                            </li>

                            <!-- SWA-05, SWA-06, SWA-07: タグ・シール管理 -->
                            <li class="nav-item has-treeview @if (in_array($current, $tagSealRoutes)) menu-open @endif">
                                <a href="#" class="nav-link @if (in_array($current, $tagSealRoutes)) active @endif">
                                    <i class="nav-icon fa fa-repeat"></i>
                                    <p>タグ・シール管理<i class="right fa fa-angle-down"></i></p>
                                </a>
                                <ul class="nav nav-treeview" style="display: @if (in_array($current, $tagSealRoutes)) block @else none @endif;">
                                    <li class="nav-item">
                                        <a href="{{ route('tag.reissue') }}" class="nav-link @if ($current === 'tag.reissue') active @endif">
                                            <span style="margin-left:20px;">タグ再発行</span>
                                        </a>
                                    </li>
                                    <li class="nav-item">
                                        <a href="{{ route('seal.reissue') }}" class="nav-link @if ($current === 'seal.reissue') active @endif">
                                            <span style="margin-left:20px;">シール再発行</span>
                                        </a>
                                    </li>
                                    <li class="nav-item">
                                        <a href="{{ route('seals') }}" class="nav-link @if ($current === 'seals') active @endif">
                                            <span style="margin-left:20px;">シール発行履歴</span>
                                        </a>
                                    </li>
                                    <li class="nav-item">
                                        <a href="{{ route('tagissue')}}" class="nav-link @if ($current === 'tagissue') active @endif">
                                            <span style="margin-left:20px;">タグ発行キュー処理、履歴表示</span>
                                        </a>
                                    </li>
                                </ul>
                            </li>

                            <!-- SWA-08〜SWA-15: 定期駐輪管理 -->
                            <li class="nav-item has-treeview @if (in_array($current, $parkingRoutes)) menu-open @endif">
                                <a href="#" class="nav-link @if (in_array($current, $parkingRoutes)) active @endif">
                                    <i class="nav-icon fa fa-repeat"></i>
                                    <p>定期駐輪管理<i class="right fa fa-angle-down"></i></p>
                                </a>
                                <ul class="nav nav-treeview" style="display: @if (in_array($current, $parkingRoutes)) block @else none @endif;">
                                    <li class="nav-item">
                                        <a href="{{ route('contractor') }}" class="nav-link @if ($current === 'contractor') active @endif">
                                            <span style="margin-left:20px;">契約者一覧</span>
                                        </a>
                                    </li>
                                    <li class="nav-item">
                                        <a href="{{ route('contractor_List') }}" class="nav-link @if ($current === 'contractor_List') active @endif">
                                            <span style="margin-left:20px;">未更新者一覧</span>
                                        </a>
                                    </li>
                                    <li class="nav-item">
                                        <a href="{{ route('update_candidate') }}" class="nav-link @if ($current === 'update_candidate') active @endif">
                                            <span style="margin-left:20px;">更新予定者一覧</span>
                                        </a>
                                    </li>
                                    <li class="nav-item">
                                        <a href="{{ route('reservation') }}" class="nav-link @if ($current === 'reservation') active @endif">
                                            <span style="margin-left:20px;">予約者一覧</span>
                                        </a>
                                    </li>
                                    <li class="nav-item">
                                        <a href="{{ route('personal') }}" class="nav-link @if ($current === 'personal') active @endif">
                                            <span style="margin-left:20px;">本人確認手動処理</span>
                                        </a>
                                    </li>
                                    <li class="nav-item">
                                        <a href="{{ route('refund') }}" class="nav-link @if ($current === 'refund') active @endif">
                                            <span style="margin-left:20px;">返金処理</span>
                                        </a>
                                    </li>
                                    <li class="nav-item">
                                        <a href="{{ route('periodical') }}" class="nav-link @if ($current === 'periodical') active @endif">
                                            <span style="margin-left:20px;">定期利用・契約状況</span>
                                        </a>
                                    </li>
                                    <li class="nav-item">
                                        <a href="{{ route('using_status') }}" class="nav-link @if ($current === 'using_status') active @endif">
                                            <span style="margin-left:20px;">区画別利用率状況</span>
                                        </a>
                                    </li>
                                </ul>
                            </li>

                            <!-- SWA-17, SWA-18: 集計業務 -->
                            <li class="nav-item has-treeview @if (in_array($current, $aggregateRoutes)) menu-open @endif">
                                <a href="#" class="nav-link @if (in_array($current, $aggregateRoutes)) active @endif">
                                    <i class="nav-icon fa fa-calculator"></i>
                                    <p>集計業務<i class="right fa fa-angle-down"></i></p>
                                </a>
                                <ul class="nav nav-treeview" style="display: @if (in_array($current, $aggregateRoutes)) block @else none @endif;">
                                    <li class="nav-item">
                                        <a href="{{ route('sales.report') }}" class="nav-link @if ($current === 'sales.report') active @endif">
                                            <span style="margin-left:20px;">売上年報／月報／日報</span>
                                        </a>
                                    </li>
                                    <li class="nav-item">
                                        <a href="{{ route('sales.detail') }}" class="nav-link @if ($current === 'sales.detail') active @endif">
                                            <span style="margin-left:20px;">売上詳細</span>
                                        </a>
                                    </li>
                                </ul>
                            </li>

                            <!-- SWA-19: 一般ウェブ管理 -->
                            <li class="nav-item has-treeview @if (in_array($current, $webRoutes)) menu-open @endif">
                                <a href="#" class="nav-link @if (in_array($current, $webRoutes)) active @endif">
                                    <i class="nav-icon fa fa-globe"></i>
                                    <p>一般ウェブ管理<i class="right fa fa-angle-down"></i></p>
                                </a>
                                <ul class="nav nav-treeview" style="display: @if (in_array($current, $webRoutes)) block @else none @endif;">
                                    <li class="nav-item">
                                        <a href="{{ route('news') }}" class="nav-link @if ($current === 'news') active @endif">
                                            <span style="margin-left:20px;">最新ニュース登録</span>
                                        </a>
                                    </li>
                                </ul>
                            </li>

                            <!-- SWA-20〜SWA-23: 利用者マスタ -->
                            <li class="nav-item has-treeview @if (in_array($current, $userRoutes)) menu-open @endif">
                                <a href="#" class="nav-link @if (in_array($current, $userRoutes)) active @endif">
                                    <i class="nav-icon fa fa-users"></i>
                                    <p>利用者マスタ<i class="right fa fa-angle-down"></i></p>
                                </a>
                                <ul class="nav nav-treeview" style="display: @if (in_array($current, $userRoutes)) block @else none @endif;">
                                    <li class="nav-item">
                                        <a href="{{ route('users') }}" class="nav-link @if ($current === 'users') active @endif">
                                            <span style="margin-left:20px;">利用者マスタ</span>
                                        </a>
                                    </li>
                                    <li class="nav-item">
                                        <a href="{{ route('regularcontracts') }}" class="nav-link @if ($current === 'regularcontracts') active @endif">
                                            <span style="margin-left:20px;">定期契約マスタ</span>
                                        </a>
                                    </li>
                                    <li class="nav-item">
                                        <a href="{{ route('reserves') }}" class="nav-link @if ($current === 'reserves') active @endif">
                                            <span style="margin-left:20px;">定期空き予約マスタ</span>
                                        </a>
                                    </li>
                                    <li class="nav-item">
                                        <a href="{{ route('usertypes') }}" class="nav-link @if ($current === 'usertypes') active @endif">
                                            <span style="margin-left:20px;">利用者分類マスタ</span>
                                        </a>
                                    </li>
                                </ul>
                            </li>

                            <!-- SWA-24〜SWA-37: 駐輪場マスタ -->
                            <li class="nav-item has-treeview @if (in_array($current, $parkMasterRoutes)) menu-open @endif">
                                <a href="#" class="nav-link @if (in_array($current, $parkMasterRoutes)) active @endif">
                                    <i class="nav-icon fa fa-th"></i>
                                    <p>駐輪場マスタ<i class="right fa fa-angle-down"></i></p>
                                </a>
                                <ul class="nav nav-treeview" style="display: @if (in_array($current, $parkMasterRoutes)) block @else none @endif;">
                                    <li class="nav-item">
                                        <a href="{{ route('city') }}" class="nav-link @if ($current === 'city') active @endif">
                                            <span style="margin-left:20px;">市区マスタ</span>
                                        </a>
                                    </li>
                                    <li class="nav-item">
                                        <a href="{{ route('parks') }}" class="nav-link @if ($current === 'parks') active @endif">
                                            <span style="margin-left:20px;">駐輪場マスタ</span>
                                        </a>
                                    </li>
                                    <li class="nav-item">
                                        <a href="{{ route('pricelist') }}" class="nav-link @if ($current === 'pricelist') active @endif">
                                            <span style="margin-left:20px;">料金一覧表</span>
                                        </a>
                                    </li>
                                    <li class="nav-item">
                                        <a href="{{ route('prices') }}" class="nav-link @if ($current === 'prices') active @endif">
                                            <span style="margin-left:20px;">駐輪場所・料金マスタ</span>
                                        </a>
                                    </li>
                                    <li class="nav-item">
                                        <a href="{{ route('psections') }}" class="nav-link @if ($current === 'psections') active @endif">
                                            <span style="margin-left:20px;">車種区分マスタ</span>
                                        </a>
                                    </li>
                                    <li class="nav-item">
                                        <a href="{{ route('ptype') }}" class="nav-link @if ($current === 'ptype') active @endif">
                                            <span style="margin-left:20px;">駐輪分類マスタ</span>
                                        </a>
                                    </li>
                                    <li class="nav-item">
                                        <a href="{{ route('zones') }}" class="nav-link @if ($current === 'zones') active @endif">
                                            <span style="margin-left:20px;">ゾーンマスタ</span>
                                        </a>
                                    </li>
                                    <li class="nav-item">
                                        <a href="{{ route('pplaces') }}" class="nav-link @if ($current === 'pplaces') active @endif">
                                            <span style="margin-left:20px;">駐輪車室マスタ</span>
                                        </a>
                                    </li>
                                    <li class="nav-item">
                                        <a href="{{ route('stations') }}" class="nav-link @if ($current === 'stations') active @endif">
                                            <span style="margin-left:20px;">近傍駅マスタ</span>
                                        </a>
                                    </li>
                                    <li class="nav-item">
                                        <a href="{{ route('regular_types') }}" class="nav-link @if ($current === 'regular_types') active @endif">
                                            <span style="margin-left:20px;">定期種別マスタ</span>
                                        </a>
                                    </li>
                                    <li class="nav-item">
                                        <a href="{{ route('terms') }}" class="nav-link @if ($current === 'terms') active @endif">
                                            <span style="margin-left:20px;">利用規約マスタ</span>
                                        </a>
                                    </li>
                                    <li class="nav-item">
                                        <a href="{{ route('print_areas') }}" class="nav-link @if ($current === 'print_areas') active @endif">
                                            <span style="margin-left:20px;">シール印刷範囲マスタ</span>
                                        </a>
                                    </li>
                                    <li class="nav-item">
                                        <a href="{{ route('contract_allowable_cities') }}" class="nav-link @if ($current === 'contract_allowable_cities') active @endif">
                                            <span style="margin-left:20px;">契約許容市区マスタ</span>
                                        </a>
                                    </li>
                                    <li class="nav-item">
                                        <a href="{{ route('jurisdiction.parking') }}" class="nav-link @if ($current === 'jurisdiction.parking') active @endif">
                                            <span style="margin-left:20px;">駐輪規定読込記録</span>
                                        </a>
                                    </li>
                                </ul>
                            </li>

                            <!-- SWA-38: 決済マスタ -->
                            <li class="nav-item has-treeview @if (in_array($current, $paymentRoutes)) menu-open @endif">
                                <a href="#" class="nav-link @if (in_array($current, $paymentRoutes)) active @endif">
                                    <i class="nav-icon fa fa-credit-card"></i>
                                    <p>決済マスタ<i class="right fa fa-angle-down"></i></p>
                                </a>
                                <ul class="nav nav-treeview" style="display: @if (in_array($current, $paymentRoutes)) block @else none @endif;">
                                    <li class="nav-item">
                                        <a href="{{ route('settlement_transactions') }}" class="nav-link @if ($current === 'settlement_transactions') active @endif">
                                            <span style="margin-left:20px;">決済トランザクション</span>
                                        </a>
                                    </li>
                                </ul>
                            </li>

                            <!-- SWA-39〜SWA-42: システムマスタ -->
                            <li class="nav-item has-treeview @if (in_array($current, $systemRoutes)) menu-open @endif">
                                <a href="#" class="nav-link @if (in_array($current, $systemRoutes)) active @endif">
                                    <i class="nav-icon fa fa-cogs"></i>
                                    <p>システムマスタ<i class="right fa fa-angle-down"></i></p>
                                </a>
                                <ul class="nav nav-treeview" style="display: @if (in_array($current, $systemRoutes)) block @else none @endif;">
                                    <li class="nav-item">
                                        <a href="{{ route('opes') }}" class="nav-link @if ($current === 'opes') active @endif">
                                            <span style="margin-left:20px;">オペレーターマスタ</span>
                                        </a>
                                    </li>
                                    <li class="nav-item">
                                        <a href="{{ route('devices') }}" class="nav-link @if ($current === 'devices') active @endif">
                                            <span style="margin-left:20px;">デバイス管理マスタ</span>
                                        </a>
                                    </li>
                                    <li class="nav-item">
                                        <a href="{{ route('operator_ques') }}" class="nav-link @if ($current === 'operator_ques') active @endif">
                                            <span style="margin-left:20px;">オペレータキュー</span>
                                        </a>
                                    </li>
                                    <li class="nav-item">
                                        <a href="{{ route('mail_templates') }}" class="nav-link @if ($current === 'mail_templates') active @endif">
                                            <span style="margin-left:20px;">メール送信テンプレート</span>
                                        </a>
                                    </li>
                                </ul>
                            </li>

                            <!-- SWA-43〜SWA-45: マスタ管理 -->
                            <li class="nav-item has-treeview @if (in_array($current, $masterRoutes)) menu-open @endif">
                                <a href="#" class="nav-link @if (in_array($current, $masterRoutes)) active @endif">
                                    <i class="nav-icon fa fa-object-group"></i>
                                    <p>マスタ管理<i class="right fa fa-angle-down"></i></p>
                                </a>
                                <ul class="nav nav-treeview" style="display: @if (in_array($current, $masterRoutes)) block @else none @endif;">
                                    <li class="nav-item">
                                        <a href="{{ route('inv_settings') }}" class="nav-link @if ($current === 'inv_settings') active @endif">
                                            <span style="margin-left:20px;">インボイス設定</span>
                                        </a>
                                    </li>
                                    <li class="nav-item">
                                        <a href="{{ route('lottery.master') }}" class="nav-link @if ($current === 'lottery.master') active @endif">
                                            <span style="margin-left:20px;">駐輪場抽選応募マスタ</span>
                                        </a>
                                    </li>
                                    <li class="nav-item">
                                        <a href="{{ route('lottery.setting') }}" class="nav-link @if ($current === 'lottery.setting') active @endif">
                                            <span style="margin-left:20px;">抽選申込設定マスタ</span>
                                        </a>
                                    </li>
                                </ul>
                            </li>
                            <!-- ソーリンユーザー用: 運営元メニュー（全自治体表示） -->
                            @if ($visibleCities && $visibleCities->count() > 0)
                                @php
                                    $currentCityId = request()->route('city_id');
                                    $isCityRoute =
                                        request()->routeIs('city_dashboard') ||
                                        str_contains(request()->url(), '/city/');
                                @endphp
                                <li
                                    class="nav-item has-treeview @if ($isCityRoute) menu-open @endif">
                                    <a href="#"
                                        class="nav-link @if ($isCityRoute) active @endif">
                                        <i class="nav-icon fa fa-map-marker"></i>
                                        <p>
                                            {{ __('運営元メニュー') }}
                                            <i class="right fa fa-angle-down"></i>
                                        </p>
                                    </a>
                                    <ul class="nav nav-treeview"
                                        style="display: @if ($isCityRoute) block @else none @endif;">
                                        @foreach ($visibleCities as $city)
                                            <li class="nav-item">
                                                <a href="{{ route('city_dashboard', ['city_id' => $city->city_id]) }}"
                                                    class="nav-link @if ($currentCityId == $city->city_id && request()->routeIs('city_dashboard')) active @endif">
                                                    <i class="nav-icon fa fa-building-o"></i>
                                                    <span style="margin-left:10px;">{{ $city->city_name }}</span>
                                                </a>
                                            </li>
                                        @endforeach
                                    </ul>
                                </li>
                            @endif
                        @endif
                        <!-- OU END -->

                    </ul>
                </nav>
                <!-- /.sidebar-menu -->
            </div>
            <!-- /.sidebar -->
        </aside>

        <!-- Content Wrapper. Contains page content -->
        <div class="content-wrapper">
            @yield('content')
        </div>
        <!-- /.content-wrapper -->

        @stack('scripts')

        <!-- Main Footer -->
        <footer class="main-footer" style="margin-left:270px;">
            <strong>Copyright &copy; 2018 <a href="./index2.html">So-Manager for back office by so-rin
                    Co.,Ltd.</a></strong> All rights reserved.
        </footer>

        <!-- Control Sidebar -->
        <aside class="control-sidebar control-sidebar-dark">
            <!-- Control sidebar content goes here -->
        </aside>
        <!-- /.control-sidebar -->
    </div>
    <!-- ./wrapper -->

    <!-- jQuery -->
    <script src="{{ asset('plugins/jquery/jquery.min.js') }}"></script>
    <script src="{{ asset('plugins/summernote/summernote.min.js') }}"></script>
    <script src="{{ asset('plugins/bootstrap/js/bootstrap.bundle.min.js') }}"></script>
    <script src="{{ asset('plugins/select2/js/select2.full.min.js') }}"></script>
    <script src="{{ asset('plugins/moment/moment.min.js') }}"></script>
    <script src="{{ asset('plugins/inputmask/jquery.inputmask.min.js') }}"></script>
    <script src="{{ asset('plugins/daterangepicker/daterangepicker.js') }}"></script>
    <script src="{{ asset('plugins/bootstrap-colorpicker/js/bootstrap-colorpicker.min.js') }}"></script>
    <script src="{{ asset('plugins/bootstrap-switch/js/bootstrap-switch.min.js') }}"></script>
    <script src="{{ asset('plugins/bootstrap-switch/js/bootstrap-switch.min.js') }}"></script>
    <script src="{{ asset('plugins/datatables/jquery.dataTables.min.js') }}"></script>
    <script src="{{ asset('plugins/datatables-bs4/js/dataTables.bootstrap4.min.js') }}"></script>
    <script src="{{ asset('plugins/datatables-responsive/js/dataTables.responsive.min.js') }}"></script>
    <script src="{{ asset('plugins/datatables-responsive/js/responsive.bootstrap4.min.js') }}"></script>
    <script src="{{ asset('plugins/datatables-buttons/js/dataTables.buttons.min.js') }}"></script>
    <script src="{{ asset('plugins/datatables-buttons/js/buttons.bootstrap4.min.js') }}"></script>
    <script src="{{ asset('plugins/jszip/jszip.min.js') }}"></script>
    <script src="{{ asset('plugins/pdfmake/pdfmake.min.js') }}"></script>
    <script src="{{ asset('plugins/pdfmake/vfs_fonts.js') }}"></script>
    <script src="{{ asset('plugins/datatables-buttons/js/buttons.html5.min.js') }}"></script>
    <script src="{{ asset('plugins/datatables-buttons/js/buttons.print.min.js') }}"></script>
    <script src="{{ asset('plugins/datatables-buttons/js/buttons.colVis.min.js') }}"></script>
    <script src="{{ asset('plugins/adminlte/js/adminlte.min.js') }}"></script>
    <script src="{{ asset('plugins/chart.js/Chart.min.js') }}"></script>
    <script src="{{ asset('plugins/sparklines/jquery.sparkline.min.js') }}"></script>
    <script src="{{ asset('plugins/jqueryKnob/jquery.knob.min.js') }}"></script>
    <script src="{{ asset('plugins/moment/moment.min.js') }}"></script>
    <script src="{{ asset('plugins/fullcalendar/index.global.min.js') }}"></script>
    <script src="{{ asset('plugins/tempusdominus-bootstrap-4/js/tempusdominus-bootstrap-4.min.js') }}"></script>
    <script src="{{ asset('plugins/filterramework/jquery.filter_input.js') }}"></script>
    <script src="{{ asset('plugins/filterramework/jquery.csv.min.js') }}"></script>

    <script>
        $(document).ready(function() {
            $('#table-users-list').DataTable({
                responsive: true,
                lengthChange: false,
                autoWidth: false,
                buttons: ["csv", "excel", "pdf", "print"]
            }).buttons().container().appendTo('#table-users-list_wrapper .col-md-6:eq(0)');
        });
    </script>

    <script>
        $(document).ready(function() {
            $('#list-all').DataTable({
                responsive: true,
                lengthChange: false,
                autoWidth: false,
                buttons: ["csv", "excel", "pdf", "print"]
            }).buttons().container().appendTo('#list-all_wrapper .col-md-6:eq(0)');
        });
    </script>

    <script>
        $(document).ready(function() {
            $('#table-list').DataTable({
                responsive: true,
                lengthChange: false,
                autoWidth: false,
                buttons: ["csv", "excel", "pdf", "print"]
            }).buttons().container().appendTo('#table-list_wrapper .col-md-6:eq(0)');
        });
    </script>

    <script>
        $(document).ready(function() {
            $('#table-form-list').DataTable({
                responsive: true,
                lengthChange: false,
                autoWidth: false,
                buttons: ["csv", "excel", "pdf", "print"]
            }).buttons().container().appendTo('#table-form-list_wrapper .col-md-6:eq(0)');
        });
    </script>

    <script>
        $(document).ready(function() {
            $('#example1').DataTable({
                responsive: true,
                lengthChange: false,
                autoWidth: false,
                buttons: ["csv", "excel", "pdf", "print"]
            }).buttons().container().appendTo('#example1_wrapper .col-md-6:eq(0)');
        });
    </script>

    <script>
        $(document).ready(function() {
            $('#example2').DataTable({
                responsive: true,
                lengthChange: false,
                autoWidth: false,
                buttons: ["csv", "excel", "pdf", "print"]
            }).buttons().container().appendTo('#example2_wrapper .col-md-6:eq(0)');
        });
    </script>

    <script>
        $.ajaxSetup({
            headers: {
                'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
            }
        });
    </script>

    <script>
        $(function() {
            $('[data-toggle="tooltip"]').tooltip()
            $('[data-toggle="popover"]').popover({
                showInputs: false
            })
        });
    </script>

    <!-- Scripts -->
    <script src="{{ asset('js/app.js') }}" defer></script>

    <style>
        .main-sidebar {
            width: 280px;
        }

        .content-wrapper {
            margin-left: 280px;
        }
    </style>

    <!-- Bootstrap 4 -->
    <script src="{{ asset('plugins/bootstrap/js/bootstrap.bundle.min.js') }}"></script>
    <!-- Select2 -->
    <script src="{{ asset('plugins/select2/select2.full.min.js') }}"></script>
    <!-- InputMask -->
    <script src="{{ asset('plugins/input-mask/jquery.inputmask.js') }}"></script>
    <script src="{{ asset('plugins/input-mask/jquery.inputmask.date.extensions.js') }}"></script>
    <script src="{{ asset('plugins/input-mask/jquery.inputmask.extensions.js') }}"></script>
    <!-- date-range-picker -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.2/moment.min.js"></script>
    <script src="{{ asset('plugins/daterangepicker/daterangepicker.js') }}"></script>
    <script src="{{ asset('plugins/datepicker/bootstrap-datepicker.js') }}"></script>
    <script src="{{ asset('plugins/datepicker/locales/bootstrap-datepicker.ja.js') }}"></script>

    <!-- bootstrap color picker -->
    <script src="{{ asset('plugins/colorpicker/bootstrap-colorpicker.min.js') }}"></script>
    <!-- bootstrap time picker -->
    <script src="{{ asset('plugins/timepicker/bootstrap-timepicker.min.js') }}"></script>
    <!-- SlimScroll 1.3.0 -->
    <script src="{{ asset('plugins/slimScroll/jquery.slimscroll.min.js') }}"></script>
    <!-- iCheck 1.0.1 -->
    <script src="{{ asset('plugins/iCheck/icheck.min.js') }}"></script>
    <!-- FastClick -->
    <script src="{{ asset('plugins/fastclick/fastclick.js') }}"></script>
    <!-- AdminLTE App -->
    <script src="{{ asset('dist/js/adminlte.min.js') }}"></script>
    <!-- AdminLTE for demo purposes -->
    <script src="{{ asset('dist/js/demo.js') }}"></script>
    <!-- Page script -->
    <script>
        $(function() {
            //Initialize Select2 Elements
            $('.select2').select2();

            //Datemask dd/mm/yyyy
            $('#datemask').inputmask('dd/mm/yyyy', {
                'placeholder': 'dd/mm/yyyy'
            })
            //Datemask2 mm/dd/yyyy
            $('#datemask2').inputmask('mm/dd/yyyy', {
                'placeholder': 'mm/dd/yyyy'
            })
            //Money Euro
            $('[data-mask]').inputmask()

            //Date range picker
            $('#reservation').daterangepicker()
            //Date range picker with time picker
            $('#reservationtime').daterangepicker({
                timePicker: true,
                timePickerIncrement: 30,
                format: 'MM/DD/YYYY h:mm A'
            })
            //Date range as a button
            $('#daterange-btn').daterangepicker({
                    ranges: {
                        '今日': [moment(), moment()],
                        '昨日': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
                        '最新の１週間': [moment().subtract(6, 'days'), moment()],
                        '最新の30日': [moment().subtract(29, 'days'), moment()],
                        '今月': [moment().startOf('month'), moment().endOf('month')],
                        '先月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month')
                            .endOf('month')
                        ]
                    },
                    startDate: moment().subtract(29, 'days'),
                    endDate: moment()
                },
                function(start, end) {
                    $('#reportrange span').html(start.format('MMMM D, YYYY') + ' - ' + end.format(
                        'MMMM D, YYYY'))
                }
            )

            //iCheck for checkbox and radio inputs
            $('input[type="checkbox"].minimal, input[type="radio"].minimal').iCheck({
                checkboxClass: 'icheckbox_minimal-blue',
                radioClass: 'iradio_minimal-blue'
            })
            //Red color scheme for iCheck
            $('input[type="checkbox"].minimal-red, input[type="radio"].minimal-red').iCheck({
                checkboxClass: 'icheckbox_minimal-red',
                radioClass: 'iradio_minimal-red'
            })
            //Flat red color scheme for iCheck
            $('input[type="checkbox"].flat-red, input[type="radio"].flat-red').iCheck({
                checkboxClass: 'icheckbox_flat-green',
                radioClass: 'iradio_flat-green'
            })

            //Colorpicker
            $('.my-colorpicker1').colorpicker()
            //color picker with addon
            $('.my-colorpicker2').colorpicker()

            //Timepicker
            $('.timepicker').timepicker({
                showInputs: false
            })
        });
    </script>

</body>

</html>
