
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        }

        :root {
            --primary: #2c3e50;
            --secondary: #3498db;
            --accent: #27ae60;
            --warning: #e67e22;
            --danger: #e74c3c;
            --light: #ecf0f1;
            --dark: #2c3e50;
            --white: #ffffff;
            --bg-color: #f8f9fa;
            --text-color: #2c3e50;
            --sidebar-bg: linear-gradient(180deg, #2c3e50 0%, #3498db 100%);
            --header-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            --card-bg: #ffffff;
            --border-color: #e9ecef;
            --shadow: 0 8px 30px rgba(0,0,0,0.12);
        }

        [data-theme="dark"] {
            --bg-color: #0f1419;
            --text-color: #e9ecef;
            --sidebar-bg: linear-gradient(180deg, #0f1419 0%, #1e2a3a 100%);
            --header-bg: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
            --card-bg: #1e2a3a;
            --border-color: #2d3748;
            --light: #2d3748;
            --shadow: 0 8px 30px rgba(0,0,0,0.3);
        }

        body {
            background: var(--bg-color);
            color: var(--text-color);
            min-height: 100vh;
            padding: 20px;
            transition: all 0.3s ease;
            background-image: 
                radial-gradient(at 10% 20%, rgba(52, 152, 219, 0.1) 0%, transparent 50%),
                radial-gradient(at 90% 80%, rgba(155, 89, 182, 0.1) 0%, transparent 50%);
        }

        [data-theme="dark"] body {
            background-image: 
                radial-gradient(at 10% 20%, rgba(52, 152, 219, 0.05) 0%, transparent 50%),
                radial-gradient(at 90% 80%, rgba(155, 89, 182, 0.05) 0%, transparent 50%);
        }

        .container {
            max-width: 1400px;
            margin: 0 auto;
            background: var(--bg-color);
            border-radius: 20px;
            box-shadow: var(--shadow);
            overflow: hidden;
            min-height: 95vh;
            backdrop-filter: blur(10px);
            border: 1px solid var(--border-color);
        }

        /* الهيدر */
        .header {
            background: var(--header-bg);
            color: var(--white);
            padding: 25px 40px;
            position: relative;
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 20px;
        }

        .header::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
            opacity: 0.1;
        }

        .header-content {
            display: flex;
            align-items: center;
            gap: 20px;
            flex-wrap: wrap;
            position: relative;
            z-index: 2;
        }

        .header h1 {
            font-size: 2.3em;
            margin: 0;
            text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
            font-weight: 700;
        }

        .header p {
            font-size: 1.1em;
            opacity: 0.9;
            margin: 0;
        }

        .logo {
            font-size: 2.8em;
            animation: float 3s ease-in-out infinite;
            filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.3));
        }

        @keyframes float {
            0%, 100% { transform: translateY(0px) rotate(0deg); }
            50% { transform: translateY(-10px) rotate(5deg); }
        }

        /* عناصر التحكم في الهيدر */
        .header-controls {
            display: flex;
            gap: 12px;
            align-items: center;
            flex-wrap: wrap;
            position: relative;
            z-index: 2;
        }

        .theme-toggle, .lang-toggle {
            background: rgba(255,255,255,0.15);
            border: 2px solid rgba(255,255,255,0.3);
            color: white;
            padding: 10px 18px;
            border-radius: 25px;
            cursor: pointer;
            transition: all 0.3s ease;
            font-size: 0.95em;
            font-weight: 600;
            backdrop-filter: blur(10px);
        }

        .theme-toggle:hover, .lang-toggle:hover {
            background: rgba(255,255,255,0.25);
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(0,0,0,0.2);
        }

        /* القائمة الجانبية */
        .sidebar {
            background: var(--sidebar-bg);
            width: 280px;
            height: calc(100vh - 170px);
            position: fixed;
            top: 170px;
            right: 0;
            padding: 25px 0;
            overflow-y: auto;
            border-left: 1px solid var(--border-color);
        }

        .sidebar::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain2" width="50" height="50" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="0.5" fill="rgba(255,255,255,0.05)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain2)"/></svg>');
        }

        .menu-btn {
            display: block;
            width: 90%;
            margin: 8px auto;
            padding: 14px 22px;
            background: rgba(255,255,255,0.1);
            border: none;
            color: var(--white);
            text-align: right;
            font-size: 1.05em;
            cursor: pointer;
            border-radius: 12px;
            transition: all 0.3s ease;
            position: relative;
            z-index: 2;
            backdrop-filter: blur(10px);
            border: 1px solid rgba(255,255,255,0.1);
        }

        .menu-btn:hover {
            background: rgba(255,255,255,0.2);
            transform: translateX(-8px);
            box-shadow: 0 5px 15px rgba(0,0,0,0.2);
        }

        .menu-btn.active {
            background: linear-gradient(135deg, rgba(52, 152, 219, 0.3), rgba(155, 89, 182, 0.3));
            border-right: 4px solid var(--accent);
            box-shadow: 0 5px 15px rgba(0,0,0,0.2);
        }

        .menu-btn i {
            margin-left: 10px;
            font-size: 1.2em;
        }

        /* المحتوى الرئيسي */
        .main-content {
            margin-right: 280px;
            padding: 35px;
            min-height: 600px;
            max-height: calc(100vh - 170px);
            overflow-y: auto;
        }

        .page {
            display: none;
            animation: fadeIn 0.5s ease-in;
        }

        .page.active {
            display: block;
        }

        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(20px); }
            to { opacity: 1; transform: translateY(0); }
        }

        /* بطاقات الإحصائيات */
        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 25px;
            margin: 30px 0;
        }

        .stat-card {
            background: var(--card-bg);
            padding: 28px;
            border-radius: 16px;
            box-shadow: var(--shadow);
            text-align: center;
            border-left: 5px solid var(--accent);
            transition: all 0.3s ease;
            border: 1px solid var(--border-color);
            position: relative;
            overflow: hidden;
        }

        .stat-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 4px;
            background: linear-gradient(90deg, var(--accent), var(--secondary));
        }

        .stat-card:hover {
            transform: translateY(-8px);
            box-shadow: 0 15px 40px rgba(0,0,0,0.15);
        }

        [data-theme="dark"] .stat-card:hover {
            box-shadow: 0 15px 40px rgba(0,0,0,0.4);
        }

        .stat-card.books { border-left-color: #e74c3c; }
        .stat-card.members { border-left-color: #3498db; }
        .stat-card.borrowed { border-left-color: #f39c12; }
        .stat-card.revenue { border-left-color: #9b59b6; }

        .stat-icon {
            font-size: 2.8em;
            margin-bottom: 15px;
            filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.2));
        }

        .stat-number {
            font-size: 2.4em;
            font-weight: bold;
            color: var(--text-color);
            margin: 12px 0;
            text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
        }

        .stat-label {
            color: #7f8c8d;
            font-size: 1.05em;
            font-weight: 600;
        }

        /* الجداول */
        .table-container {
            background: var(--card-bg);
            border-radius: 16px;
            padding: 28px;
            box-shadow: var(--shadow);
            margin: 30px 0;
            border: 1px solid var(--border-color);
            overflow-x: auto;
        }

        table {
            width: 100%;
            border-collapse: collapse;
            margin: 20px 0;
            min-width: 800px;
        }

        th, td {
            padding: 14px;
            text-align: right;
            border-bottom: 1px solid var(--border-color);
            color: var(--text-color);
        }

        th {
            background: var(--light);
            color: var(--text-color);
            font-weight: 600;
            font-size: 0.95em;
            border-bottom: 2px solid var(--border-color);
        }

        tr:hover {
            background: var(--light);
            transform: scale(1.01);
            transition: all 0.2s ease;
        }

        /* الأزرار */
        .btn {
            padding: 12px 24px;
            border: none;
            border-radius: 10px;
            cursor: pointer;
            font-size: 0.95em;
            transition: all 0.3s ease;
            margin: 5px;
            font-weight: 600;
            position: relative;
            overflow: hidden;
        }

        .btn::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
            transition: left 0.5s;
        }

        .btn:hover::before {
            left: 100%;
        }

        .btn-primary {
            background: var(--secondary);
            color: var(--white);
        }

        .btn-success {
            background: var(--accent);
            color: var(--white);
        }

        .btn-warning {
            background: var(--warning);
            color: var(--white);
        }

        .btn-danger {
            background: var(--danger);
            color: var(--white);
        }

        .btn:hover {
            transform: translateY(-3px);
            box-shadow: 0 8px 20px rgba(0,0,0,0.2);
        }

        /* النماذج */
        .form-group {
            margin-bottom: 22px;
        }

        .form-group label {
            display: block;
            margin-bottom: 8px;
            color: var(--text-color);
            font-weight: 600;
            font-size: 0.95em;
        }

        .form-control {
            width: 100%;
            padding: 12px 16px;
            border: 2px solid var(--border-color);
            border-radius: 10px;
            font-size: 0.95em;
            transition: all 0.3s ease;
            background: var(--card-bg);
            color: var(--text-color);
        }

        .form-control:focus {
            outline: none;
            border-color: var(--secondary);
            box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
        }

        /* النماذج المنبثقة */
        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.6);
            z-index: 1000;
            animation: fadeIn 0.3s ease;
            backdrop-filter: blur(5px);
        }

        .modal-content {
            background: var(--card-bg);
            width: 500px;
            max-width: 95%;
            margin: 100px auto;
            padding: 30px;
            border-radius: 20px;
            box-shadow: 0 25px 50px rgba(0,0,0,0.3);
            border: 1px solid var(--border-color);
            animation: slideUp 0.4s ease;
        }

        @keyframes slideUp {
            from { transform: translateY(50px); opacity: 0; }
            to { transform: translateY(0); opacity: 1; }
        }

        .modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 25px;
            padding-bottom: 18px;
            border-bottom: 2px solid var(--border-color);
        }

        .modal-title {
            font-size: 1.4em;
            color: var(--text-color);
            font-weight: bold;
        }

        .close {
            background: none;
            border: none;
            font-size: 1.4em;
            cursor: pointer;
            color: #7f8c8d;
            transition: color 0.3s ease;
        }

        .close:hover {
            color: var(--danger);
            transform: rotate(90deg);
        }

        /* تنبيهات */
        .alert {
            padding: 15px 20px;
            border-radius: 10px;
            margin: 18px 0;
            font-weight: 600;
            font-size: 0.95em;
            border-left: 4px solid;
            animation: slideIn 0.5s ease;
        }

        @keyframes slideIn {
            from { transform: translateX(-100%); opacity: 0; }
            to { transform: translateX(0); opacity: 1; }
        }

        .alert-success {
            background: #d4edda;
            color: #155724;
            border-left-color: #28a745;
        }

        .alert-danger {
            background: #f8d7da;
            color: #721c24;
            border-left-color: #dc3545;
        }

        [data-theme="dark"] .alert-success {
            background: #1e3a2c;
            color: #90ee90;
            border-left-color: #28a745;
        }

        [data-theme="dark"] .alert-danger {
            background: #3a1e1e;
            color: #ff6b6b;
            border-left-color: #dc3545;
        }

        /* البحث */
        .search-box {
            position: relative;
            margin: 20px 0;
        }

        .search-input {
            width: 100%;
            padding: 14px 50px 14px 20px;
            border: 2px solid var(--border-color);
            border-radius: 25px;
            font-size: 0.95em;
            transition: all 0.3s ease;
            background: var(--card-bg);
            color: var(--text-color);
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        }

        .search-input:focus {
            border-color: var(--secondary);
            box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1), 0 4px 15px rgba(0,0,0,0.1);
        }

        .search-icon {
            position: absolute;
            left: 20px;
            top: 50%;
            transform: translateY(-50%);
            color: #7f8c8d;
            font-size: 1.1em;
        }

        /* متجاوب للجوال */
        @media (max-width: 1024px) {
            .sidebar {
                width: 250px;
            }
            .main-content {
                margin-right: 250px;
                padding: 25px;
            }
        }

        @media (max-width: 768px) {
            body {
                padding: 10px;
            }
            
            .container {
                border-radius: 15px;
            }
            
            .header {
                padding: 20px 25px;
                flex-direction: column;
                text-align: center;
            }
            
            .header-content {
                flex-direction: column;
                gap: 15px;
            }
            
            .header h1 {
                font-size: 2em;
            }
            
            .sidebar {
                width: 100%;
                height: auto;
                position: static;
                top: auto;
                padding: 20px 0;
            }
            
            .main-content {
                margin-right: 0;
                padding: 20px;
            }
            
            .stats-grid {
                grid-template-columns: 1fr;
                gap: 20px;
            }
            
            .table-container {
                padding: 20px;
                margin: 20px 0;
            }
            
            th, td {
                padding: 12px 10px;
                font-size: 0.9em;
            }
            
            .modal-content {
                width: 95%;
                margin: 50px auto;
                padding: 25px;
            }
        }

        @media (max-width: 480px) {
            .header h1 {
                font-size: 1.7em;
            }
            
            .logo {
                font-size: 2.3em;
            }
            
            .stat-card {
                padding: 20px;
            }
            
            .stat-number {
                font-size: 2em;
            }
            
            .btn {
                padding: 10px 18px;
                font-size: 0.9em;
            }
        }
