Modern RTL Medical Dashboard Header & Sidebar Redesign

Answered using AI by Vibe Coding

Code Question:

try redesign this header and work this sidebar good with modren dsign , without add any sample daata , i want redesign with tailwind and bbotstabe if want or no , [<!DOCTYPE html>

<html lang="ar" dir="rtl"> <head>     <meta charset="UTF-8">     <meta name="viewport" content="width=device-width, initial-scale=1.0">     <title>نظام السجل الطبي الموحد</title>     <!-- Google Font: Cairo -->     <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Cairo:300,400,400i,700&display=fallback">     <!-- Font Awesome -->     <link rel="stylesheet" href=" https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css ">     <!-- Bootstrap 5 -->     <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css " rel="stylesheet">     <!-- AdminLTE style -->     <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/adminlte.min.css ">     <!-- Custom CSS -->     <style>         :root {             --primary-color: #3b
Code Solution:
<!DOCTYPE html>
<html lang="ar" dir="rtl">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>نظام السجل الطبي الموحد</title>
    <!-- Google Font: Tajawal -->
    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Tajawal:300,400,500,700&display=swap">
    <!-- Tailwind CSS -->
    <script src="https://cdn.tailwindcss.com"></script>
    <!-- Font Awesome -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/js/all.min.js"></script>
    <style>
        body {
            font-family: 'Tajawal', sans-serif;
            background: #f8fafc;
        }
        * {
            scrollbar-width: thin;
            scrollbar-color: #cbd5e1 #f1f5f9;
        }
        ::-webkit-scrollbar {
            width: 6px;
        }
        ::-webkit-scrollbar-track {
            background: #f1f5f9;
        }
        ::-webkit-scrollbar-thumb {
            background: #cbd5e1;
            border-radius: 3px;
        }
        .sidebar-transition {
            transition: all 0.3s ease;
        }
        .backdrop-blur {
            backdrop-filter: blur(8px);
        }
        .content-transition {
            transition: margin-right 0.3s ease;
        }
    </style>
</head>
<body class="bg-gray-50">
    <!-- Header -->
    <header class="fixed top-0 left-0 right-0 bg-white/90 backdrop-blur shadow-sm border-b border-gray-100 z-40">
        <div class="flex items-center justify-between h-16 px-4 sm:px-6">
            <!-- Mobile Menu Toggle -->
            <button id="sidebarToggle" class="lg:hidden p-2 rounded-lg text-gray-600 hover:bg-gray-100 transition-colors">
                <i class="fas fa-bars text-lg"></i>
            </button>

            <!-- Logo -->
            <div class="flex items-center space-x-3">
                <div class="w-10 h-10 bg-blue-600 rounded-lg flex items-center justify-center">
                    <i class="fas fa-heartbeat text-white text-lg"></i>
                </div>
                <div class="hidden sm:block">
                    <h1 class="text-lg font-bold text-gray-900">السجل الطبي</h1>
                    <p class="text-xs text-gray-500">نظام إلكتروني متكامل</p>
                </div>
            </div>

            <!-- Search -->
            <div class="flex-1 max-w-md mx-4">
                <div class="relative">
                    <input type="text" 
                           placeholder="بحث سريع..." 
                           class="w-full pl-10 pr-4 py-2 bg-gray-50 border border-gray-200 rounded-xl text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent">
                    <i class="fas fa-search absolute left-3 top-1/2 -translate-y-1/2 text-gray-400"></i>
                </div>
            </div>

            <!-- User Menu -->
            <div class="flex items-center space-x-3">
                <!-- Notifications -->
                <button class="relative p-2 rounded-lg text-gray-600 hover:bg-gray-100 transition-colors">
                    <i class="fas fa-bell text-lg"></i>
                    <span class="absolute top-1 right-1 w-2 h-2 bg-red-500 rounded-full"></span>
                </button>
                
                <!-- User -->
                <div class="flex items-center space-x-2 cursor-pointer group">
                    <div class="w-8 h-8 bg-gradient-to-br from-blue-500 to-purple-600 rounded-full flex items-center justify-center">
                        <span class="text-white text-sm font-medium">د</span>
                    </div>
                    <div class="hidden md:block">
                        <p class="text-sm font-medium text-gray-900">د. أحمد محمد</p>
                        <p class="text-xs text-gray-500">إداري</p>
                    </div>
                    <i class="fas fa-chevron-down text-xs text-gray-400 group-hover:text-gray-600 transition-colors"></i>
                </div>
            </div>
        </div>
    </header>

    <!-- Sidebar -->
    <aside id="sidebar" class="fixed top-16 right-0 h-[calc(100vh-64px)] w-64 bg-white shadow-xl sidebar-transition z-30 -translate-x-full lg:translate-x-0">
        <!-- User Profile -->
        <div class="p-4 border-b border-gray-100">
            <div class="flex items-center space-x-3">
                <div class="w-12 h-12 bg-gradient-to-br from-blue-500 to-purple-600 rounded-xl flex items-center justify-center">
                    <i class="fas fa-user-md text-white text-lg"></i>
                </div>
                <div>
                    <h3 class="font-semibold text-gray-900">د. أحمد محمد</h3>
                    <p class="text-xs text-gray-500">المستشفى الجامعي</p>
                </div>
            </div>
        </div>

        <!-- Navigation -->
        <nav class="p-4 space-y-1 overflow-y-auto h-[calc(100vh-140px)]">
            <!-- Dashboard -->
            <a href="#" class="flex items-center space-x-3 px-3 py-2.5 rounded-xl text-blue-600 bg-blue-50 hover:bg-blue-100 transition-colors">
                <i class="fas fa-home w-5 text-center"></i>
                <span class="font-medium">الرئيسية</span>
            </a>

            <!-- Patients -->
            <a href="#" class="flex items-center space-x-3 px-3 py-2.5 rounded-xl text-gray-700 hover:bg-gray-50 transition-colors">
                <i class="fas fa-users w-5 text-center text-green-600"></i>
                <span>المرضى</span>
            </a>

            <!-- Appointments -->
            <a href="#" class="flex items-center space-x-3 px-3 py-2.5 rounded-xl text-gray-700 hover:bg-gray-50 transition-colors">
                <i class="fas fa-calendar-alt w-5 text-center text-purple-600"></i>
                <span>المواعيد</span>
                <span class="mr-auto bg-purple-100 text-purple-600 text-xs px-2 py-0.5 rounded-full">12</span>
            </a>

            <!-- Medical Records -->
            <a href="#" class="flex items-center space-x-3 px-3 py-2.5 rounded-xl text-gray-700 hover:bg-gray-50 transition-colors">
                <i class="fas fa-file-medical w-5 text-center text-orange-600"></i>
                <span>السجلات الطبية</span>
            </a>

            <!-- Reports -->
            <a href="#" class="flex items-center space-x-3 px-3 py-2.5 rounded-xl text-gray-700 hover:bg-gray-50 transition-colors">
                <i class="fas fa-chart-bar w-5 text-center text-indigo-600"></i>
                <span>التقارير</span>
            </a>

            <!-- Settings -->
            <a href="#" class="flex items-center space-x-3 px-3 py-2.5 rounded-xl text-gray-700 hover:bg-gray-50 transition-colors">
                <i class="fas fa-cog w-5 text-center text-gray-600"></i>
                <span>الإعدادات</span>
            </a>

            <!-- Divider -->
            <div class="pt-4 mt-4 border-t border-gray-100">
                <p class="px-3 py-2 text-xs font-semibold text-gray-400 uppercase tracking-wider">إدارة النظام</p>
                
                <!-- Users -->
                <a href="#" class="flex items-center space-x-3 px-3 py-2.5 rounded-xl text-gray-700 hover:bg-gray-50 transition-colors">
                    <i class="fas fa-user-cog w-5 text-center text-red-600"></i>
                    <span>إدارة المستخدمين</span>
                </a>

                <!-- Backup -->
                <a href="#" class="flex items-center space-x-3 px-3 py-2.5 rounded-xl text-gray-700 hover:bg-gray-50 transition-colors">
                    <i class="fas fa-database w-5 text-center text-cyan-600"></i>
                    <span>النسخ الاحتياطي</span>
                </a>
            </div>
        </nav>
    </aside>

    <!-- Overlay for mobile -->
    <div id="overlay" class="fixed inset-0 bg-black/50 z-20 hidden lg:hidden"></div>

    <!-- Main Content -->
    <main id="mainContent" class="pt-16 pr-0 lg:pr-64 content-transition">
        <div class="p-6">
            <!-- Content goes here -->
        </div>
    </main>

    <script>
        // Sidebar Toggle
        const sidebar = document.getElementById('sidebar');
        const overlay = document.getElementById('overlay');
        const toggleBtn = document.getElementById('sidebarToggle');
        const mainContent = document.getElementById('mainContent');

        function toggleSidebar() {
            sidebar.classList.toggle('-translate-x-full');
            overlay.classList.toggle('hidden');
        }

        toggleBtn.addEventListener('click', toggleSidebar);
        overlay.addEventListener('click', toggleSidebar);

        // Close sidebar on larger screens
        window.addEventListener('resize', () => {
            if (window.innerWidth >= 1024) {
                sidebar.classList.remove('-translate-x-full');
                overlay.classList.add('hidden');
            }
        });

        // Active link handling
        document.querySelectorAll('nav a').forEach(link => {
            link.addEventListener('click', (e) => {
                document.querySelectorAll('nav a').forEach(l => {
                    l.classList.remove('text-blue-600', 'bg-blue-50');
                    l.classList.add('text-gray-700');
                });
                e.target.classList.add('text-blue-600', 'bg-blue-50');
                e.target.classList.remove('text-gray-700');
                
                // Close sidebar on mobile after click
                if (window.innerWidth < 1024) {
                    toggleSidebar();
                }
            });
        });
    </script>
</body>
</html>