<!DOCTYPE html>
<html lang="<?= getLang() ?>" dir="<?= isRTL() ? 'rtl' : 'ltr' ?>">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Admin Dashboard | HelperLink</title>
    <!-- Bootstrap CSS -->
    <?php if (isRTL()): ?>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.rtl.min.css">
    <link href="https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700&display=swap" rel="stylesheet">
    <?php else: ?>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
    <?php endif; ?>
    <!-- FontAwesome -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <!-- Chart.js -->
    <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
    
    <style>
        :root {
            --primary: #2F6BFF;
            --primary-light: #DCE8FF;
            --primary-hover: #2555CC;
            --bg-main: #F5F7FB;
            --card-bg: #FFFFFF;
            
            --text-primary: #111827;
            --text-secondary: #6B7280;
            --text-light: #9CA3AF;
            
            --success: #16A34A;
            --success-bg: #DCFCE7;
            --warning: #F59E0B;
            --warning-bg: #FEF3C7;
            --danger: #EF4444;
            --danger-bg: #FEE2E2;
            --info: #0EA5E9;
            
            --radius-card: 20px;
            --radius-input: 12px;
            --radius-btn: 14px;
            
            --shadow-soft: 0 8px 24px rgba(0,0,0,0.05);
            --shadow-hover: 0 12px 30px rgba(47,107,255,0.12);
            
            --font-main: '<?= isRTL() ? 'Cairo' : 'Inter' ?>', sans-serif;
            --sidebar-width: 260px;
        }

        body {
            background-color: var(--bg-main);
            font-family: var(--font-main);
            color: var(--text-primary);
            margin: 0;
            padding: 0;
        }

        /* Typography */
        h1, h2, h3, h4, h5, h6 { font-weight: 600; color: var(--text-primary); }
        h2 { font-size: 28px; font-weight: 700; }
        .section-title { font-size: 20px; font-weight: 600; }
        .card-title { font-size: 16px; font-weight: 600; margin-bottom: 0;}
        body { font-size: 14px; }
        .small-meta { font-size: 12px; color: var(--text-secondary); }

        /* Cards */
        .card {
            border: none;
            border-radius: var(--radius-card);
            box-shadow: var(--shadow-soft);
            background: var(--card-bg);
            transition: transform 0.2s, box-shadow 0.2s;
        }
        
        .card-hover:hover {
            box-shadow: var(--shadow-hover);
            transform: translateY(-2px);
        }

        /* Buttons */
        .btn {
            border-radius: var(--radius-btn);
            font-weight: 500;
            padding: 10px 20px;
            transition: all 0.3s ease;
        }
        .btn-primary {
            background-color: var(--primary);
            border: none;
            color: white;
            box-shadow: 0 4px 12px rgba(47,107,255,0.2);
        }
        .btn-primary:hover {
            background-color: var(--primary-hover);
            box-shadow: var(--shadow-hover);
            transform: translateY(-1px);
        }
        .btn-secondary {
            background-color: white;
            border: 1px solid var(--primary);
            color: var(--primary);
        }
        .btn-danger {
            background-color: var(--danger-bg);
            color: var(--danger);
            border: none;
        }

        /* Inputs */
        .form-control, .form-select {
            height: 48px;
            border-radius: var(--radius-input);
            border: 1px solid #E5E7EB;
            padding: 0 16px;
            background: white;
        }
        .form-control:focus, .form-select:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 4px rgba(47,107,255,0.12);
        }

        /* Badges */
        .badge {
            padding: 6px 12px;
            border-radius: 50rem;
            font-weight: 500;
        }
        .badge-success { background: var(--success-bg); color: var(--success); }
        .badge-warning { background: var(--warning-bg); color: var(--warning); }
        .badge-danger { background: var(--danger-bg); color: var(--danger); }
        .badge-info { background: #E0F2FE; color: var(--info); }
        .badge-secondary { background: #F3F4F6; color: var(--text-secondary); }

        /* Tables */
        .table-container {
            background: var(--card-bg);
            border-radius: var(--radius-card);
            box-shadow: var(--shadow-soft);
            padding: 24px;
        }
        .table { margin-bottom: 0; }
        .table th {
            border-bottom: 2px solid #F3F4F6;
            color: var(--text-secondary);
            font-weight: 500;
            padding: 16px;
        }
        .table td {
            vertical-align: middle;
            padding: 16px;
            border-bottom: 1px solid #F3F4F6;
        }
        .table tbody tr:hover {
            background-color: #F9FAFB;
        }
        
        /* Layout */
        .wrapper {
            display: flex;
            min-height: 100vh;
        }

        .main-panel {
            flex: 1;
            display: flex;
            flex-direction: column;
            width: calc(100% - var(--sidebar-width));
        }

        /* Top Navbar */
        .top-navbar {
            background: var(--card-bg);
            height: 72px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 32px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.02);
            z-index: 10;
        }
        
        .content {
            padding: 32px;
            flex: 1;
        }

        html[dir="rtl"] .sidebar {
            border-right: none;
            border-left: 1px solid #E5E7EB;
        }

        /* Mobile & Tablet Responsive Adjustments */
        @media (max-width: 991.98px) {
            .sidebar {
                position: fixed;
                top: 0;
                bottom: 0;
                left: calc(-1 * var(--sidebar-width));
                transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
                z-index: 1050;
                height: 100vh;
            }
            
            html[dir="rtl"] .sidebar {
                left: auto;
                right: calc(-1 * var(--sidebar-width));
                transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            }

            .sidebar.show {
                left: 0;
            }
            html[dir="rtl"] .sidebar.show {
                right: 0;
            }

            .main-panel {
                width: 100% !important;
            }

            .sidebar-overlay {
                display: none;
                position: fixed;
                top: 0;
                left: 0;
                right: 0;
                bottom: 0;
                background: rgba(17, 24, 39, 0.5);
                backdrop-filter: blur(4px);
                z-index: 1040;
                opacity: 0;
                transition: opacity 0.3s ease;
            }
            .sidebar-overlay.show {
                display: block;
                opacity: 1;
            }
        }

        @media (max-width: 767.98px) {
            .content {
                padding: 16px;
            }
            .top-navbar {
                padding: 0 16px;
            }
            .table-container {
                padding: 16px;
            }
            h2 {
                font-size: 22px;
            }
        }
    </style>
</head>
<body>
<div class="wrapper">
