<!DOCTYPE html>
<html lang="tr">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="csrf-token" content="{{ csrf_token() }}">
    <title>@yield('title', 'Admin Panel') — Askeri Platform</title>

    <!-- Google Fonts -->
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">

    @vite(['resources/css/app.css', 'resources/js/app.js'])

    @stack('styles')

    <style>
        *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

        :root {
            --sidebar-w: 260px;
            --header-h: 60px;
            --sidebar-bg: #0f172a;
            --sidebar-border: rgba(255,255,255,0.06);
            --sidebar-text: rgba(255,255,255,0.65);
            --sidebar-text-hover: #fff;
            --sidebar-active-bg: rgba(59,130,246,0.18);
            --sidebar-active-text: #60a5fa;
            --sidebar-active-border: #3b82f6;
            
            /* Primary Colors */
            --accent: #3b82f6;
            --accent-dark: #2563eb;
            --primary: #3b82f6;
            --secondary: #8b5cf6;
            --danger: #ef4444;
            --danger-light: #fee2e2;
            --danger-dark: #dc2626;
            --success: #10b981;
            --success-light: #d1fae5;
            --warning: #f59e0b;
            --warning-light: #fef3c7;
            
            /* Neutral Gray Scale */
            --gray-50: #f9fafb;
            --gray-100: #f3f4f6;
            --gray-200: #e5e7eb;
            --gray-300: #d1d5db;
            --gray-400: #9ca3af;
            --gray-500: #6b7280;
            --gray-600: #4b5563;
            --gray-700: #374151;
            --gray-800: #1f2937;
            --gray-900: #111827;
            
            /* Base Colors */
            --bg: #f1f5f9;
            --surface: #fff;
            --border: #e2e8f0;
            --text: #0f172a;
            --text-muted: #64748b;
            --radius: 10px;
            --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
            --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
        }

        html, body { height: 100%; font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; }

        /* ─── Layout ─── */
        .admin-wrap { display: flex; height: 100vh; overflow: hidden; }

        /* ─── Sidebar ─── */
        .sidebar {
            width: var(--sidebar-w);
            background: var(--sidebar-bg);
            display: flex;
            flex-direction: column;
            flex-shrink: 0;
            height: 100vh;
            overflow-y: auto;
            overflow-x: hidden;
            scrollbar-width: thin;
            scrollbar-color: rgba(255,255,255,0.1) transparent;
            position: fixed;
            left: 0; top: 0; bottom: 0;
            z-index: 100;
            transition: transform 0.3s ease;
        }
        .sidebar::-webkit-scrollbar { width: 4px; }
        .sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

        /* Brand */
        .sidebar-brand {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 20px 20px 16px;
            border-bottom: 1px solid var(--sidebar-border);
            text-decoration: none;
        }
        .brand-icon {
            width: 36px; height: 36px;
            background: linear-gradient(135deg, #3b82f6, #8b5cf6);
            border-radius: 9px;
            display: flex; align-items: center; justify-content: center;
            font-size: 18px;
            flex-shrink: 0;
        }
        .brand-text { color: #fff; }
        .brand-text strong { display: block; font-size: 14px; font-weight: 700; }
        .brand-text span { font-size: 11px; color: rgba(255,255,255,0.4); font-weight: 400; }

        /* Nav */
        .sidebar-nav { flex: 1; padding: 12px 10px; }

        .nav-section {
            font-size: 10px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            color: rgba(255,255,255,0.3);
            padding: 16px 10px 6px;
        }

        .nav-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 9px 12px;
            border-radius: 8px;
            color: var(--sidebar-text);
            text-decoration: none;
            font-size: 13.5px;
            font-weight: 500;
            transition: all 0.15s;
            cursor: pointer;
            border: none;
            background: transparent;
            width: 100%;
            position: relative;
        }
        .nav-item:hover { background: rgba(255,255,255,0.06); color: var(--sidebar-text-hover); }
        .nav-item.active {
            background: var(--sidebar-active-bg);
            color: var(--sidebar-active-text);
            font-weight: 600;
        }
        .nav-item.active::before {
            content: '';
            position: absolute;
            left: 0; top: 50%;
            transform: translateY(-50%);
            width: 3px; height: 20px;
            background: var(--sidebar-active-border);
            border-radius: 0 3px 3px 0;
        }
        .nav-item svg { width: 17px; height: 17px; flex-shrink: 0; }
        .nav-item .nav-label { flex: 1; }
        .nav-item .nav-arrow {
            width: 14px; height: 14px;
            transition: transform 0.2s;
            color: rgba(255,255,255,0.3);
        }
        .nav-item.open .nav-arrow { transform: rotate(180deg); }

        /* Sub-menu */
        .nav-children {
            overflow: hidden;
            max-height: 0;
            transition: max-height 0.25s ease;
        }
        .nav-children.open { max-height: 500px; }
        .nav-children .nav-item {
            padding-left: 38px;
            font-size: 13px;
        }
        .nav-children .nav-item svg { width: 14px; height: 14px; }

        /* Badge */
        .nav-badge {
            background: rgba(59,130,246,0.25);
            color: #93c5fd;
            font-size: 10px;
            font-weight: 700;
            padding: 1px 6px;
            border-radius: 10px;
        }

        /* Sidebar footer */
        .sidebar-footer {
            padding: 12px 10px;
            border-top: 1px solid var(--sidebar-border);
        }
        .user-row {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 8px 10px;
            border-radius: 8px;
            cursor: default;
        }
        .user-avatar {
            width: 34px; height: 34px;
            background: linear-gradient(135deg, #3b82f6, #8b5cf6);
            border-radius: 8px;
            display: flex; align-items: center; justify-content: center;
            font-size: 14px; font-weight: 700; color: #fff;
            flex-shrink: 0;
        }
        .user-info { flex: 1; min-width: 0; }
        .user-name { font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .user-role { font-size: 11px; color: rgba(255,255,255,0.4); text-transform: capitalize; }
        .logout-btn {
            width: 30px; height: 30px;
            border: none; background: rgba(255,255,255,0.06);
            border-radius: 7px; cursor: pointer;
            display: flex; align-items: center; justify-content: center;
            color: rgba(255,255,255,0.4);
            transition: all 0.15s;
            flex-shrink: 0;
        }
        .logout-btn:hover { background: rgba(239,68,68,0.15); color: #f87171; }
        .logout-btn svg { width: 15px; height: 15px; }

        /* ─── Main ─── */
        .admin-main {
            flex: 1;
            margin-left: var(--sidebar-w);
            display: flex;
            flex-direction: column;
            min-height: 100vh;
            overflow: hidden;
        }

        /* Header */
        .admin-header {
            height: var(--header-h);
            background: var(--surface);
            border-bottom: 1px solid var(--border);
            display: flex;
            align-items: center;
            padding: 0 24px;
            gap: 16px;
            position: sticky;
            top: 0;
            z-index: 50;
            flex-shrink: 0;
        }
        .header-toggle {
            display: none;
            width: 36px; height: 36px;
            border: 1px solid var(--border);
            background: transparent;
            border-radius: 8px;
            cursor: pointer;
            align-items: center; justify-content: center;
            color: var(--text-muted);
        }
        .header-toggle svg { width: 18px; height: 18px; }
        .header-breadcrumb {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 14px;
        }
        .breadcrumb-home { color: var(--text-muted); text-decoration: none; }
        .breadcrumb-home:hover { color: var(--accent); }
        .breadcrumb-sep { color: var(--border); font-size: 12px; }
        .breadcrumb-current { font-weight: 600; color: var(--text); }
        .header-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
        .header-action-btn {
            display: flex; align-items: center; gap: 6px;
            padding: 7px 14px;
            background: transparent;
            border: 1px solid var(--border);
            border-radius: 8px;
            color: var(--text-muted);
            font-size: 13px;
            font-weight: 500;
            cursor: pointer;
            text-decoration: none;
            transition: all 0.15s;
        }
        .header-action-btn svg { width: 15px; height: 15px; }
        .header-action-btn:hover { border-color: var(--accent); color: var(--accent); }
        .header-action-btn.primary {
            background: var(--accent);
            border-color: var(--accent);
            color: white;
        }
        .header-action-btn.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: white; }

        /* Content */
        .admin-content {
            flex: 1;
            padding: 24px;
            overflow-y: auto;
            overflow-x: hidden;
        }

        /* ─── Common Components ─── */
        /* Page header */
        .page-header {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 16px;
            margin-bottom: 24px;
            flex-wrap: wrap;
        }
        .page-title { font-size: 22px; font-weight: 700; color: var(--text); }
        .page-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 3px; }
        .page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

        /* Cards */
        .card {
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            box-shadow: var(--shadow);
        }
        .card-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 16px 20px;
            border-bottom: 1px solid var(--border);
            gap: 12px;
        }
        .card-title { font-size: 14px; font-weight: 600; color: var(--text); }
        .card-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
        .card-body { padding: 20px; }
        .card-footer {
            padding: 14px 20px;
            border-top: 1px solid var(--border);
            background: #f8fafc;
            border-radius: 0 0 var(--radius) var(--radius);
            display: flex;
            align-items: center;
            justify-content: flex-end;
            gap: 8px;
        }

        /* Info Card - alias for card with built-in padding */
        .info-card {
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            box-shadow: var(--shadow);
            padding: 20px;
            margin-bottom: 24px;
        }
        .info-card h2 {
            font-size: 15px;
            font-weight: 700;
            color: var(--text);
            margin-bottom: 16px;
            padding-bottom: 10px;
            border-bottom: 1px solid var(--border);
        }
        .info-card h3 {
            font-size: 13px;
            font-weight: 600;
            color: var(--text);
            margin-bottom: 10px;
        }

        /* Page Title Block (used in some views as container) */
        .page-title-block {
            margin-bottom: 24px;
        }
        .page-title-block h1 {
            font-size: 22px;
            font-weight: 700;
            color: var(--text);
            line-height: 1.3;
        }
        .page-title-block p {
            font-size: 13px;
            color: var(--text-muted);
            margin-top: 4px;
        }

        /* Stat cards */
        .stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
        .stat-card {
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            padding: 20px;
            display: flex;
            align-items: flex-start;
            gap: 14px;
        }
        .stat-icon {
            width: 44px; height: 44px;
            border-radius: 10px;
            display: flex; align-items: center; justify-content: center;
            font-size: 20px;
            flex-shrink: 0;
        }
        .stat-info .stat-value { font-size: 24px; font-weight: 700; color: var(--text); line-height: 1.2; }
        .stat-info .stat-label { font-size: 12px; color: var(--text-muted); margin-top: 3px; }

        /* Buttons */
        .btn {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 8px 16px;
            border-radius: 8px;
            font-size: 13px;
            font-weight: 600;
            text-decoration: none;
            border: 1px solid transparent;
            cursor: pointer;
            transition: all 0.15s;
            white-space: nowrap;
        }
        .btn svg { width: 15px; height: 15px; }
        .btn-primary { background: var(--accent); color: white; border-color: var(--accent); }
        .btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: white; }
        .btn-secondary { background: #f8fafc; color: var(--text-muted); border-color: var(--border); }
        .btn-secondary:hover { background: var(--border); color: var(--text); }
        .btn-danger { background: #fee2e2; color: #dc2626; border-color: #fecaca; }
        .btn-danger:hover { background: #fecaca; }
        .btn-success { background: #dcfce7; color: #16a34a; border-color: #bbf7d0; }
        .btn-warning { background: #fef3c7; color: #d97706; border-color: #fde68a; }
        .btn-sm { padding: 5px 10px; font-size: 12px; }
        .btn-icon { padding: 7px; }

        /* Form elements */
        .form-group { margin-bottom: 18px; }
        .form-label { display: block; font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 6px; }
        .form-label .required { color: #ef4444; margin-left: 3px; }
        .form-hint { font-size: 11px; color: var(--text-muted); margin-top: 5px; }
        .form-control {
            display: block; width: 100%;
            padding: 9px 12px;
            font-size: 13px;
            font-family: inherit;
            color: var(--text);
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: 8px;
            transition: border-color 0.15s, box-shadow 0.15s;
            outline: none;
        }
        .form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59,130,246,0.12); }
        .form-control::placeholder { color: #94a3b8; }
        textarea.form-control { resize: vertical; min-height: 100px; }
        .form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 14px; padding-right: 32px; }
        .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
        .form-check { display: flex; align-items: center; gap: 8px; }
        .form-check input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; border-radius: 4px; accent-color: var(--accent); }
        .form-check label { font-size: 13px; color: var(--text); cursor: pointer; }

        /* Alert / info box */
        .alert { padding: 12px 16px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; display: flex; align-items: flex-start; gap: 10px; }
        .alert-info { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
        .alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
        .alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
        .alert-danger { background: #fff1f2; color: #be123c; border: 1px solid #fecdd3; }
        .alert-icon { flex-shrink: 0; font-size: 16px; margin-top: 1px; }

        /* Tables */
        .table-wrap { overflow-x: auto; }
        .table { width: 100%; border-collapse: collapse; font-size: 13px; }
        .table thead th { padding: 10px 14px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); background: #f8fafc; border-bottom: 1px solid var(--border); white-space: nowrap; }
        .table tbody td { padding: 12px 14px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
        .table tbody tr:last-child td { border-bottom: none; }
        .table tbody tr:hover td { background: #fafbfc; }

        /* Badge */
        .badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 600; white-space: nowrap; }
        .badge-green { background: #dcfce7; color: #16a34a; }
        .badge-red { background: #fee2e2; color: #dc2626; }
        .badge-yellow { background: #fef3c7; color: #d97706; }
        .badge-blue { background: #dbeafe; color: #1d4ed8; }
        .badge-gray { background: #f1f5f9; color: #64748b; }
        .badge-purple { background: #f3e8ff; color: #7c3aed; }

        /* Toggle */
        .toggle { position: relative; display: inline-block; width: 42px; height: 23px; cursor: pointer; }
        .toggle input { display: none; }
        .toggle-track { position: absolute; inset: 0; background: #cbd5e1; border-radius: 23px; transition: background 0.2s; }
        .toggle-thumb { position: absolute; width: 17px; height: 17px; background: #fff; border-radius: 50%; top: 3px; left: 3px; transition: transform 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
        .toggle input:checked ~ .toggle-track { background: #22c55e; }
        .toggle input:checked ~ .toggle-thumb { transform: translateX(19px); }
        .toggle-maintenance input:checked ~ .toggle-track { background: #f59e0b; }

        /* Divider */
        .divider { height: 1px; background: var(--border); margin: 20px 0; }

        /* Empty state */
        .empty-state { text-align: center; padding: 60px 24px; }
        .empty-icon { font-size: 48px; margin-bottom: 16px; display: block; }
        .empty-title { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
        .empty-desc { font-size: 13px; color: var(--text-muted); max-width: 320px; margin: 0 auto 20px; }

        /* Toast */
        #admin-toast {
            position: fixed;
            bottom: 24px; right: 24px;
            background: #1e293b;
            color: #fff;
            padding: 12px 18px;
            border-radius: 10px;
            font-size: 13px;
            font-weight: 500;
            box-shadow: var(--shadow-md);
            z-index: 9999;
            transform: translateY(10px);
            opacity: 0;
            transition: all 0.3s;
            pointer-events: none;
            max-width: 320px;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        #admin-toast.show { opacity: 1; transform: translateY(0); }
        #admin-toast.success { background: #166534; }
        #admin-toast.error { background: #991b1b; }
        #admin-toast.warning { background: #92400e; }

        /* Session flash */
        .flash-msg {
            padding: 12px 16px;
            border-radius: 8px;
            font-size: 13px;
            font-weight: 500;
            margin-bottom: 20px;
            display: flex;
            align-items: center;
            gap: 10px;
        }
        .flash-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
        .flash-error { background: #fff1f2; color: #be123c; border: 1px solid #fecdd3; }

        /* Overlay */
        .sidebar-overlay {
            display: none;
            position: fixed; inset: 0;
            background: rgba(0,0,0,0.5);
            z-index: 99;
        }

        /* Responsive */
        @media (max-width: 768px) {
            .sidebar {
                transform: translateX(-100%);
            }
            .sidebar.open {
                transform: translateX(0);
                box-shadow: var(--shadow-md);
            }
            .admin-main { margin-left: 0; }
            .header-toggle { display: flex; }
            .sidebar-overlay.active { display: block; }
            .form-row { grid-template-columns: 1fr; }
            .page-header { flex-direction: column; align-items: flex-start; }
            .admin-content { padding: 16px; }
        }
    </style>
</head>
<body>
<div id="admin-toast"></div>
<div class="sidebar-overlay" id="sidebarOverlay"></div>

<div class="admin-wrap">
    {{-- ═══════════════════════════════════════════ --}}
    {{-- SIDEBAR                                     --}}
    {{-- ═══════════════════════════════════════════ --}}
    <aside class="sidebar" id="sidebar">
        {{-- Brand --}}
        <a href="{{ route('admin.dashboard') }}" class="sidebar-brand">
            <div class="brand-icon">⭐</div>
            <div class="brand-text">
                <strong>Askeri Platform</strong>
                <span>Admin Panel</span>
            </div>
        </a>

        {{-- Navigation --}}
        <nav class="sidebar-nav">
            {{-- Dashboard --}}
            <a href="{{ route('admin.dashboard') }}"
               class="nav-item {{ request()->routeIs('admin.dashboard') ? 'active' : '' }}">
                <svg fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
                    <rect x="3" y="3" width="7" height="7" rx="1"/><rect x="14" y="3" width="7" height="7" rx="1"/><rect x="3" y="14" width="7" height="7" rx="1"/><rect x="14" y="14" width="7" height="7" rx="1"/>
                </svg>
                <span class="nav-label">Dashboard</span>
            </a>

            {{-- Ana Sayfa --}}
            <a href="{{ route('admin.homepage.index') }}"
               class="nav-item {{ request()->routeIs('admin.homepage.*') ? 'active' : '' }}">
                <svg fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
                    <path stroke-linecap="round" stroke-linejoin="round" d="M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6"/>
                </svg>
                <span class="nav-label">Ana Sayfa Widget</span>
            </a>

            {{-- Modüller --}}
            <a href="{{ url('admin/modules') }}"
               class="nav-item {{ request()->routeIs('admin.modules.*') ? 'active' : '' }}">
                <svg fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
                    <path stroke-linecap="round" stroke-linejoin="round" d="M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4"/>
                </svg>
                <span class="nav-label">Modül Yönetimi</span>
            </a>

            {{-- ─── Blog ─── --}}
            <div class="nav-section">İÇERİK</div>
            @php $blogOpen = request()->routeIs('admin.blog.*') || request()->routeIs('admin.blog-categories.*') || request()->routeIs('admin.blog-comments.*') || request()->routeIs('admin.seo.*'); @endphp
            <button class="nav-item {{ $blogOpen ? 'active open' : '' }}" onclick="toggleMenu('blog')">
                <svg fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
                    <path stroke-linecap="round" stroke-linejoin="round" d="M19 20H5a2 2 0 01-2-2V6a2 2 0 012-2h10a2 2 0 012 2v1m2 13a2 2 0 01-2-2V7m2 13a2 2 0 002-2V9a2 2 0 00-2-2h-2m-4-3H9M7 16h6M7 8h6v4H7V8z"/>
                </svg>
                <span class="nav-label">Blog</span>
                <svg class="nav-arrow" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5">
                    <path stroke-linecap="round" stroke-linejoin="round" d="M19 9l-7 7-7-7"/>
                </svg>
            </button>
            <div id="menu-blog" class="nav-children {{ $blogOpen ? 'open' : '' }}">
                <a href="{{ route('admin.blog.index') }}" class="nav-item {{ request()->routeIs('admin.blog.index') ? 'active' : '' }}">
                    <svg fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"/></svg>
                    <span class="nav-label">Yazılar</span>
                </a>
                <a href="{{ route('admin.blog.create') }}" class="nav-item">
                    <svg fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M12 4v16m8-8H4"/></svg>
                    <span class="nav-label">Yeni Yazı</span>
                </a>
                <a href="{{ route('admin.blog-categories.index') }}" class="nav-item {{ request()->routeIs('admin.blog-categories.*') ? 'active' : '' }}">
                    <svg fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M7 7h.01M7 3h5c.512 0 1.024.195 1.414.586l7 7a2 2 0 010 2.828l-7 7a2 2 0 01-2.828 0l-7-7A1.994 1.994 0 013 12V7a4 4 0 014-4z"/></svg>
                    <span class="nav-label">Kategoriler</span>
                </a>
                <a href="{{ route('admin.blog-comments.index') }}" class="nav-item {{ request()->routeIs('admin.blog-comments.*') ? 'active' : '' }}">
                    <svg fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"/></svg>
                    <span class="nav-label">Yorumlar</span>
                </a>
                <a href="{{ route('admin.seo.index') }}" class="nav-item {{ request()->routeIs('admin.seo.*') ? 'active' : '' }}">
                    <svg fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"/></svg>
                    <span class="nav-label">SEO</span>
                </a>
            </div>

            {{-- Forum --}}
            @php $forumOpen = request()->routeIs('admin.forum-categories.*') || request()->routeIs('admin.forum-topics.*') || request()->routeIs('admin.forum-posts.*'); @endphp
            <button class="nav-item {{ $forumOpen ? 'active open' : '' }}" onclick="toggleMenu('forum')">
                <svg fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
                    <path stroke-linecap="round" stroke-linejoin="round" d="M17 8h2a2 2 0 012 2v6a2 2 0 01-2 2h-2v4l-4-4H9a1.994 1.994 0 01-1.414-.586m0 0L11 14h4a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2v4l.586-.586z"/>
                </svg>
                <span class="nav-label">Forum</span>
                <svg class="nav-arrow" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5">
                    <path stroke-linecap="round" stroke-linejoin="round" d="M19 9l-7 7-7-7"/>
                </svg>
            </button>
            <div id="menu-forum" class="nav-children {{ $forumOpen ? 'open' : '' }}">
                <a href="{{ route('admin.forum-categories.index') }}" class="nav-item {{ request()->routeIs('admin.forum-categories.*') ? 'active' : '' }}">
                    <svg fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M7 7h.01M7 3h5c.512 0 1.024.195 1.414.586l7 7a2 2 0 010 2.828l-7 7a2 2 0 01-2.828 0l-7-7A1.994 1.994 0 013 12V7a4 4 0 014-4z"/></svg>
                    <span class="nav-label">Kategoriler</span>
                </a>
                <a href="{{ route('admin.forum-topics.index') }}" class="nav-item {{ request()->routeIs('admin.forum-topics.*') ? 'active' : '' }}">
                    <svg fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z"/></svg>
                    <span class="nav-label">Konular</span>
                </a>
                <a href="{{ route('admin.forum-posts.index') }}" class="nav-item {{ request()->routeIs('admin.forum-posts.*') ? 'active' : '' }}">
                    <svg fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M7 8h10M7 12h4m1 8l-4-4H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-3l-3 3z"/></svg>
                    <span class="nav-label">Gönderiler</span>
                </a>
            </div>

            {{-- Kütüphane --}}
            @php $libOpen = request()->routeIs('admin.library-categories.*') || request()->routeIs('admin.library-contents.*') || request()->routeIs('admin.library-comments.*'); @endphp
            <button class="nav-item {{ $libOpen ? 'active open' : '' }}" onclick="toggleMenu('library')">
                <svg fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
                    <path stroke-linecap="round" stroke-linejoin="round" d="M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253"/>
                </svg>
                <span class="nav-label">Kütüphane</span>
                <svg class="nav-arrow" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5">
                    <path stroke-linecap="round" stroke-linejoin="round" d="M19 9l-7 7-7-7"/>
                </svg>
            </button>
            <div id="menu-library" class="nav-children {{ $libOpen ? 'open' : '' }}">
                <a href="{{ route('admin.library-contents.index') }}" class="nav-item {{ request()->routeIs('admin.library-contents.*') ? 'active' : '' }}">
                    <svg fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"/></svg>
                    <span class="nav-label">İçerikler</span>
                </a>
                <a href="{{ route('admin.library-categories.index') }}" class="nav-item {{ request()->routeIs('admin.library-categories.*') ? 'active' : '' }}">
                    <svg fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M7 7h.01M7 3h5c.512 0 1.024.195 1.414.586l7 7a2 2 0 010 2.828l-7 7a2 2 0 01-2.828 0l-7-7A1.994 1.994 0 013 12V7a4 4 0 014-4z"/></svg>
                    <span class="nav-label">Kategoriler</span>
                </a>
                <a href="{{ route('admin.library-comments.index') }}" class="nav-item {{ request()->routeIs('admin.library-comments.*') ? 'active' : '' }}">
                    <svg fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M7 8h10M7 12h4m1 8l-4-4H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-3l-3 3z"/></svg>
                    <span class="nav-label">Yorumlar</span>
                </a>
            </div>

            {{-- Mülakat --}}
            @php $intOpen = request()->routeIs('admin.interview-categories.*') || request()->routeIs('admin.interview-questions.*') || request()->routeIs('admin.interview-flashcards.*') || request()->routeIs('admin.simulation-questions.*'); @endphp
            <button class="nav-item {{ $intOpen ? 'active open' : '' }}" onclick="toggleMenu('interview')">
                <svg fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
                    <path stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-3 7h3m-3 4h3m-6-4h.01M9 16h.01"/>
                </svg>
                <span class="nav-label">Mülakat</span>
                <svg class="nav-arrow" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5">
                    <path stroke-linecap="round" stroke-linejoin="round" d="M19 9l-7 7-7-7"/>
                </svg>
            </button>
            <div id="menu-interview" class="nav-children {{ $intOpen ? 'open' : '' }}">
                <a href="{{ route('admin.interview-categories.index') }}" class="nav-item {{ request()->routeIs('admin.interview-categories.*') ? 'active' : '' }}">
                    <svg fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M7 7h.01M7 3h5c.512 0 1.024.195 1.414.586l7 7a2 2 0 010 2.828l-7 7a2 2 0 01-2.828 0l-7-7A1.994 1.994 0 013 12V7a4 4 0 014-4z"/></svg>
                    <span class="nav-label">Kategoriler</span>
                </a>
                <a href="{{ route('admin.interview-questions.index') }}" class="nav-item {{ request()->routeIs('admin.interview-questions.*') ? 'active' : '' }}">
                    <svg fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"/></svg>
                    <span class="nav-label">Sorular</span>
                </a>
                <a href="{{ route('admin.interview-flashcards.index') }}" class="nav-item {{ request()->routeIs('admin.interview-flashcards.*') ? 'active' : '' }}">
                    <svg fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10"/></svg>
                    <span class="nav-label">Flashcard</span>
                </a>
                <a href="{{ route('admin.simulation-questions.index') }}" class="nav-item {{ request()->routeIs('admin.simulation-questions.*') ? 'active' : '' }}">
                    <svg fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"/></svg>
                    <span class="nav-label">Simülasyon Soruları</span>
                </a>
            </div>

            {{-- Sohbet --}}
            @php $chatOpen = request()->routeIs('admin.chat-rooms.*') || request()->routeIs('admin.chat-categories.*'); @endphp
            <button class="nav-item {{ $chatOpen ? 'active open' : '' }}" onclick="toggleMenu('chat')">
                <svg fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
                    <path stroke-linecap="round" stroke-linejoin="round" d="M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"/>
                </svg>
                <span class="nav-label">Sohbet</span>
                <svg class="nav-arrow" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5">
                    <path stroke-linecap="round" stroke-linejoin="round" d="M19 9l-7 7-7-7"/>
                </svg>
            </button>
            <div id="menu-chat" class="nav-children {{ $chatOpen ? 'open' : '' }}">
                <a href="{{ route('admin.chat-categories.index') }}" class="nav-item {{ request()->routeIs('admin.chat-categories.*') ? 'active' : '' }}">
                    <svg fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M7 7h.01M7 3h5c.512 0 1.024.195 1.414.586l7 7a2 2 0 010 2.828l-7 7a2 2 0 01-2.828 0l-7-7A1.994 1.994 0 013 12V7a4 4 0 014-4z"/></svg>
                    <span class="nav-label">Kategoriler</span>
                </a>
                <a href="{{ route('admin.chat-rooms.index') }}" class="nav-item {{ request()->routeIs('admin.chat-rooms.*') ? 'active' : '' }}">
                    <svg fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6"/></svg>
                    <span class="nav-label">Odalar</span>
                </a>
            </div>

            {{-- ─── Yönetim ─── --}}
            <div class="nav-section">YÖNETİM</div>

            <a href="{{ route('admin.adsense.index') }}" class="nav-item {{ request()->routeIs('admin.adsense.*') ? 'active' : '' }}">
                <svg fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
                    <path stroke-linecap="round" stroke-linejoin="round" d="M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"/>
                </svg>
                <span class="nav-label">AdSense</span>
            </a>

            <a href="{{ route('admin.users.index') }}" class="nav-item {{ request()->routeIs('admin.users.*') ? 'active' : '' }}">
                <svg fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
                    <path stroke-linecap="round" stroke-linejoin="round" d="M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197M13 7a4 4 0 11-8 0 4 4 0 018 0z"/>
                </svg>
                <span class="nav-label">Kullanıcılar</span>
            </a>

            <a href="{{ route('admin.menus.index') }}" class="nav-item {{ request()->routeIs('admin.menus.*') ? 'active' : '' }}">
                <svg fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
                    <path stroke-linecap="round" stroke-linejoin="round" d="M4 6h16M4 12h16M4 18h16"/>
                </svg>
                <span class="nav-label">Menü Yönetimi</span>
            </a>

            <a href="{{ route('admin.sidebars.index') }}" class="nav-item {{ request()->routeIs('admin.sidebars.*') ? 'active' : '' }}">
                <svg fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
                    <path stroke-linecap="round" stroke-linejoin="round" d="M9 17V7m0 10a2 2 0 01-2 2H5a2 2 0 01-2-2V7a2 2 0 012-2h2a2 2 0 012 2m0 10a2 2 0 002 2h2a2 2 0 002-2M9 7a2 2 0 012-2h2a2 2 0 012 2m0 10V7m0 10a2 2 0 002 2h2a2 2 0 002-2V7a2 2 0 00-2-2h-2a2 2 0 00-2 2"/>
                </svg>
                <span class="nav-label">Sidebar Yönetimi</span>
            </a>

            <a href="{{ route('admin.header-footer.index') }}" class="nav-item {{ request()->routeIs('admin.header-footer.*') ? 'active' : '' }}">
                <svg fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
                    <path stroke-linecap="round" stroke-linejoin="round" d="M3 4h18M3 8h18M3 12h10M3 16h6M3 20h18"/>
                </svg>
                <span class="nav-label">Header/Footer</span>
            </a>

            <a href="{{ route('admin.themes.index') }}" class="nav-item {{ request()->routeIs('admin.themes.*') ? 'active' : '' }}">
                <svg fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
                    <path stroke-linecap="round" stroke-linejoin="round" d="M7 21a4 4 0 01-4-4V5a2 2 0 012-2h4a2 2 0 012 2v12a4 4 0 01-4 4zm0 0h12a2 2 0 002-2v-4a2 2 0 00-2-2h-2.343M11 7.343l1.657-1.657a2 2 0 012.828 0l2.829 2.829a2 2 0 010 2.828l-8.486 8.485M7 17h.01"/>
                </svg>
                <span class="nav-label">Tema Yönetimi</span>
            </a>

            <a href="{{ route('admin.ai-settings.index') }}" class="nav-item {{ request()->routeIs('admin.ai-settings.*') ? 'active' : '' }}">
                <svg fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
                    <path stroke-linecap="round" stroke-linejoin="round" d="M13 10V3L4 14h7v7l9-11h-7z"/>
                </svg>
                <span class="nav-label">AI Yönetimi</span>
            </a>

            <a href="{{ route('admin.homepage-layouts.index') }}" class="nav-item {{ request()->routeIs('admin.homepage-layouts.*') ? 'active' : '' }}">
                <svg fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
                    <path stroke-linecap="round" stroke-linejoin="round" d="M4 5a1 1 0 011-1h14a1 1 0 011 1v2a1 1 0 01-1 1H5a1 1 0 01-1-1V5zM4 13a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H5a1 1 0 01-1-1v-6zM16 13a1 1 0 011-1h2a1 1 0 011 1v6a1 1 0 01-1 1h-2a1 1 0 01-1-1v-6z"/>
                </svg>
                <span class="nav-label">Homepage Layout</span>
            </a>

            <a href="{{ url('admin/pages') }}" class="nav-item {{ request()->routeIs('admin.pages.*') ? 'active' : '' }}">
                <svg fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
                    <path stroke-linecap="round" stroke-linejoin="round" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"/>
                </svg>
                <span class="nav-label">Statik Sayfalar</span>
            </a>

            <a href="{{ route('admin.settings.index') }}" class="nav-item {{ request()->routeIs('admin.settings.*') ? 'active' : '' }}">
                <svg fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
                    <path stroke-linecap="round" stroke-linejoin="round" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"/>
                    <path stroke-linecap="round" stroke-linejoin="round" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"/>
                </svg>
                <span class="nav-label">Ayarlar</span>
            </a>

            {{-- Siteyi Görüntüle --}}
            <a href="{{ url('/') }}" target="_blank" class="nav-item" style="margin-top:8px;border-top:1px solid rgba(255,255,255,0.06);padding-top:12px;">
                <svg fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
                    <path stroke-linecap="round" stroke-linejoin="round" d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"/>
                </svg>
                <span class="nav-label">Siteyi Görüntüle</span>
            </a>
        </nav>

        {{-- Footer --}}
        <div class="sidebar-footer">
            <div class="user-row">
                <div class="user-avatar">{{ strtoupper(substr(auth()->user()->name, 0, 1)) }}</div>
                <div class="user-info">
                    <div class="user-name">{{ auth()->user()->name }}</div>
                    <div class="user-role">{{ ucfirst(auth()->user()->role ?? 'admin') }}</div>
                </div>
                <form method="POST" action="{{ route('logout') }}">
                    @csrf
                    <button type="submit" class="logout-btn" title="Çıkış Yap">
                        <svg fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
                            <path stroke-linecap="round" stroke-linejoin="round" d="M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1"/>
                        </svg>
                    </button>
                </form>
            </div>
        </div>
    </aside>

    {{-- ═══════════════════════════════════════════ --}}
    {{-- MAIN                                        --}}
    {{-- ═══════════════════════════════════════════ --}}
    <div class="admin-main">
        {{-- Header --}}
        <header class="admin-header">
            <button class="header-toggle" onclick="toggleSidebar()" id="sidebarToggle">
                <svg fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
                    <path stroke-linecap="round" stroke-linejoin="round" d="M4 6h16M4 12h16M4 18h16"/>
                </svg>
            </button>
            <div class="header-breadcrumb">
                <a href="{{ route('admin.dashboard') }}" class="breadcrumb-home">
                    <svg style="width:16px;height:16px;vertical-align:middle;" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
                        <path stroke-linecap="round" stroke-linejoin="round" d="M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6"/>
                    </svg>
                </a>
                <span class="breadcrumb-sep">/</span>
                <span class="breadcrumb-current">@yield('header-title', 'Dashboard')</span>
            </div>
            <div class="header-right">
                @yield('header-actions')
            </div>
        </header>

        {{-- Content --}}
        <main class="admin-content">
            {{-- Flash messages --}}
            @if(session('success'))
                <div class="flash-msg flash-success">
                    <svg style="width:16px;height:16px;flex-shrink:0;" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M5 13l4 4L19 7"/></svg>
                    {{ session('success') }}
                </div>
            @endif
            @if(session('error'))
                <div class="flash-msg flash-error">
                    <svg style="width:16px;height:16px;flex-shrink:0;" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12"/></svg>
                    {{ session('error') }}
                </div>
            @endif
            @if($errors->any())
                <div class="flash-msg flash-error">
                    <svg style="width:16px;height:16px;flex-shrink:0;" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"/></svg>
                    <div>
                        @foreach($errors->all() as $error)
                            <div>{{ $error }}</div>
                        @endforeach
                    </div>
                </div>
            @endif

            @yield('content')
        </main>
    </div>
</div>

@stack('scripts')
@yield('scripts')

<script>
// ── Sidebar toggle (mobile) ──
function toggleSidebar() {
    const sidebar = document.getElementById('sidebar');
    const overlay = document.getElementById('sidebarOverlay');
    sidebar.classList.toggle('open');
    overlay.classList.toggle('active');
}
document.getElementById('sidebarOverlay').addEventListener('click', function() {
    document.getElementById('sidebar').classList.remove('open');
    this.classList.remove('active');
});

// ── Sub-menu toggle ──
function toggleMenu(key) {
    const children = document.getElementById('menu-' + key);
    const btn = children.previousElementSibling;
    const isOpen = children.classList.contains('open');
    children.classList.toggle('open', !isOpen);
    btn.classList.toggle('open', !isOpen);
}

// ── Toast notification (global) ──
function showToast(message, type) {
    type = type || 'success';
    const toast = document.getElementById('admin-toast');
    const icons = { success: '✅', error: '❌', warning: '⚠️' };
    toast.innerHTML = '<span>' + (icons[type] || '') + '</span><span>' + message + '</span>';
    toast.className = 'show ' + type;
    clearTimeout(toast._timer);
    toast._timer = setTimeout(function() {
        toast.className = '';
    }, 3500);
}
</script>
</body>
</html>
