   .rank-1 {
            box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
            transform: scale(1.02);
            border: 1px solid #FFD700 !important;
        }

        .rank-2 {
            border: 1px solid #C0C0C0 !important;
        }

        .rank-3 {
            border: 1px solid #CD7F32 !important;
        }

        #salesChart {
            cursor: zoom-in; /* أو zoom-out حسب الحالة، لكن zoom-in شكلها جميل */
        }

        /* =========================================================
        تصغير وتجميع الجدول (Compact Mode)
        ========================================================= */

#section-orders .custom-table {
    width: 100% !important;
    min-width: 100% !important;
    margin: 0 !important;
    border-spacing: 0 10px;
}

            /* 2. تقريب الخلايا من بعضها */
            #section-orders .custom-table th,
            #section-orders .custom-table td {
                padding: 10px 15px !important;
                text-align: right;
            }

                /* 3. عمود التحكم الأساسي */
                #section-orders .custom-table td:last-child {
                    width: 1%;
                    white-space: nowrap;
                }

        /* 4. تصغير الأزرار ونصوص الجدول قليلاً لتتناسب مع الشكل الملموم */
        #section-orders .icon-btn {
            width: 30px !important;
            height: 30px !important;
            font-size: 0.85rem !important;
            margin: 0 2px !important;
        }

        #section-orders .custom-table td {
            font-size: 0.95rem;
        }

#section-orders .table-responsive {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
}

/* =========================================================
   عرض الكمبيوتر: أزرار التحكم رأسية والجدول بلا سكرول أفقي
   ========================================================= */
@media (min-width: 1201px) {
    #section-orders .table-responsive {
        overflow-x: hidden !important;
    }

    #section-orders .custom-table {
        width: 100% !important;
        min-width: 0 !important;
        table-layout: fixed !important;
    }

    #section-orders .custom-table th,
    #section-orders .custom-table td {
        padding: 10px 8px !important;
        white-space: normal !important;
        overflow-wrap: anywhere !important;
        word-break: break-word !important;
    }

    #section-orders .custom-table th:first-child,
    #section-orders .custom-table td:first-child {
        width: 46px !important;
    }

    #section-orders .custom-table th:nth-child(2),
    #section-orders .custom-table td:nth-child(2) {
        width: 8% !important;
    }

    #section-orders .custom-table th:nth-child(5),
    #section-orders .custom-table td:nth-child(5) {
        width: 11% !important;
    }

    #section-orders .custom-table th:nth-child(6),
    #section-orders .custom-table td:nth-child(6) {
        width: 10% !important;
    }

    #section-orders .custom-table th:nth-child(7),
    #section-orders .custom-table td:nth-child(7) {
        width: 48px !important;
        text-align: center !important;
    }

    #section-orders .custom-table th:nth-child(8),
    #section-orders .custom-table td:nth-child(8) {
        width: 11% !important;
    }

    #section-orders .custom-table th:last-child,
    #section-orders .custom-table td:last-child {
        width: 42px !important;
        min-width: 42px !important;
        max-width: 42px !important;
        padding: 5px !important;
        text-align: center !important;
        white-space: normal !important;
    }

    #section-orders .custom-table td:last-child > div,
    #section-orders .order-actions-stack {
        display: flex !important;
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 5px !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow: visible !important;
    }

    #section-orders .icon-btn {
        width: 30px !important;
        height: 30px !important;
        min-width: 30px !important;
        flex: 0 0 30px !important;
        margin: 0 !important;
    }
}
        /* =========================================================
        تنسيق التابلت (المحسّن): أزرار عمودية + إخفاء ID
        ========================================================= */

        @media (max-width: 1200px) {

            /* 1. تفعيل السكرول الأفقي للطوارئ */
            #section-orders .table-responsive {
                display: block !important;
                overflow-x: auto !important;
            }

            /* 2. الجدول يأخذ العرض الكامل */
            #section-orders .custom-table {
                width: 100% !important;
                min-width: 100% !important;
            }

                /* 3. تنسيق عام للخلايا */
                #section-orders .custom-table th,
                #section-orders .custom-table td {
                    padding: 8px 4px !important;
                    vertical-align: middle !important;
                    font-size: 0.85rem !important;
                }

/* 4. إخفاء عمود ID في التابلت مع إبقاء مربع التحديد الجماعي */
#section-orders .custom-table th:nth-child(2),
#section-orders .custom-table td:nth-child(2) {
    display: none !important;
}

                    /* 5. ضبط عمود الأزرار ليكون عمودياً ورفيعاً */
                    #section-orders .custom-table td:last-child {
                        width: 40px !important;
                        min-width: 40px !important;
                        padding: 5px !important;
                        white-space: nowrap !important;
                    }

                        /* 6. ترتيب الأزرار فوق بعضها */
                        #section-orders .custom-table td:last-child > div {
                            display: flex !important;
                            flex-direction: column !important;
                            flex-wrap: nowrap !important;
                            gap: 5px !important;
                            align-items: center !important;
                            justify-content: center !important;
                            width: 100% !important;
                            max-width: 100% !important;
                            overflow: visible !important;
                        }

            /* 7. تصغير الأزرار */
            #section-orders .icon-btn {
                width: 30px !important;
                height: 30px !important;
                flex: 0 0 30px !important;
                font-size: 0.75rem !important;
                margin: 0 !important;
                border-radius: 6px !important;
            }

            /* 8. توزيع المساحة المتبقية بذكاء */
            #section-orders .custom-table td:nth-child(3) {
                width: 30%;
                word-break: break-word;
            }
            /* العميل */
            #section-orders .custom-table td:nth-child(4) {
                width: 35%;
                word-break: break-word;
            }
            /* المنتج */
            #section-orders .custom-table td:nth-child(5) {
                width: 15%;
                font-weight: bold;
            }
            /* السعر */
        }
        /* ==========================================================================
                0. LOADING SCREEN
                ==========================================================================
             */
        #loading-screen {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: #050505;
            z-index: 999999;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            transition: opacity 0.8s ease;
        }

        .loader-container {
            position: relative;
            width: 120px;
            height: 120px;
        }

        .loader-ring {
            position: absolute;
            width: 100%;
            height: 100%;
            border: 4px solid transparent;
            border-top: 4px solid var(--purple);
            border-radius: 50%;
            animation: spin 1.5s linear infinite;
        }

            .loader-ring:nth-child(2) {
                border-top-color: var(--gold);
                animation-delay: -0.5s;
                width: 80%;
                height: 80%;
                top: 10%;
                left: 10%;
            }

            .loader-ring:nth-child(3) {
                border-top-color: var(--green);
                animation-delay: -1s;
                width: 60%;
                height: 60%;
                top: 20%;
                left: 20%;
            }

        .loader-text {
            margin-top: 30px;
            font-size: 1.2rem;
            color: var(--purple);
            font-weight: bold;
            letter-spacing: 2px;
            text-align: center;
        }

        .loader-subtext {
            color: var(--text-muted);
            font-size: 0.9rem;
            margin-top: 10px;
            opacity: 0.8;
        }

        @keyframes spin {
            0% {
                transform: rotate(0deg);
            }

            100% {
                transform: rotate(360deg);
            }
        }

        /* ==========================================================================
                1. CORE VARIABLES & RESET (THEME ENGINE)
                ==========================================================================
             */
        :root {
            --bg-body: #0a0a0f;
            --bg-panel: rgba(15, 15, 20, 0.85);
            --bg-card: rgba(25, 25, 35, 0.7);
            --bg-input: rgba(10, 10, 15, 0.4);
            --gold: #FFD700;
            --gold-glow: rgba(255, 215, 0, 0.1);
            --purple: #7c3aed;
            --purple-glow: rgba(124, 58, 237, 0.1);
            --neon-blue: #00d4ff;
            --neon-pink: #ff00ff;
            --green: #10b981;
            --red: #ef4444;
            --text-main: #f8fafc;
            --text-muted: #94a3b8;
            --border: 1px solid rgba(255, 255, 255, 0.08);
            --border-hover: 1px solid rgba(124, 58, 237, 0.6);
            --glass: blur(25px) saturate(180%);
            --radius-lg: 28px;
            --radius-md: 18px;
            --radius-sm: 10px;
            --shadow-lg: 0 25px 60px rgba(0,0,0,0.6);
            --gradient-purple: linear-gradient(135deg, var(--purple) 0%, #a78bfa 100%);
            --gradient-gold: linear-gradient(135deg, var(--gold) 0%, #fbbf24 100%);
            --gradient-blue: linear-gradient(135deg, var(--neon-blue) 0%, #3b82f6 100%);
        }

        * {
            box-sizing: border-box;
            outline: none;
            -webkit-tap-highlight-color: transparent;
        }

        body {
            font-family: 'Tajawal', 'Cairo', sans-serif;
            background-color: var(--bg-body);
            /* 1. حط رابط الصورة هنا مكان الرابط الموجود */
            /* طبقة سوداء شفافة بنسبة 70% فوق الصورة */
            background-image: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url('https://media.forgecdn.net/attachments/1077/860/2025-01-25_12.png');
            /* 2. عشان الصورة تغطي الشاشة كلها وماتتكررش */
            background-size: cover;
            background-position: center;
            background-repeat: no-repeat;
            color: var(--text-main);
            margin: 0;
            height: 100vh;
            overflow: hidden;
            display: flex;
        }

        /* Scrollbar Styling */
        ::-webkit-scrollbar {
            width: 8px;
            height: 8px;
        }

        ::-webkit-scrollbar-track {
            background: rgba(255, 255, 255, 0.02);
            border-radius: 10px;
        }

        ::-webkit-scrollbar-thumb {
            background: rgba(124, 58, 237, 0.3);
            border-radius: 10px;
        }

            ::-webkit-scrollbar-thumb:hover {
                background: rgba(124, 58, 237, 0.5);
            }

        /* ==========================================================================
                2. ANIMATIONS
                ==========================================================================
             */
        @keyframes float {
            0%, 100% {
                transform: translateY(0) translateX(0);
            }

            33% {
                transform: translateY(-15px) translateX(10px);
            }

            66% {
                transform: translateY(5px) translateX(-10px);
            }
        }

        @keyframes glow {
            0%, 100% {
                box-shadow: 0 0 5px var(--purple-glow);
            }

            50% {
                box-shadow: 0 0 10px var(--purple-glow);
            }
        }

        @keyframes slideInUp {
            from {
                transform: translateY(40px);
                opacity: 0;
            }

            to {
                transform: translateY(0);
                opacity: 1;
            }
        }

        @keyframes slideInDown {
            from {
                transform: translateY(-40px) translateX(-50%);
                opacity: 0;
            }

            to {
                transform: translateY(0) translateX(-50%);
                opacity: 1;
            }
        }

        @keyframes fadeIn {
            from {
                opacity: 0;
            }

            to {
                opacity: 1;
            }
        }

        @keyframes pulse {
            0%, 100% {
                opacity: 1;
            }

            50% {
                opacity: 0.7;
            }
        }

        @keyframes shimmer {
            0% {
                background-position: -1000px 0;
            }

            100% {
                background-position: 1000px 0;
            }
        }

        @keyframes shake {
            0%, 100% {
                transform: rotate(0deg);
            }

            20% {
                transform: rotate(-15deg);
            }

            40% {
                transform: rotate(15deg);
            }

            60% {
                transform: rotate(-10deg);
            }

            80% {
                transform: rotate(10deg);
            }
        }

        /* ==========================================================================
                3. LOGIN SCREEN (SECURE GATE)
                ==========================================================================
             */
        #login-screen {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 100%);
            z-index: 99999;
            display: flex;
            justify-content: center;
            align-items: center;
            flex-direction: column;
            transition: opacity 0.8s ease;
        }

        .login-card {
            background: rgba(20, 20, 30, 0.9);
            padding: 60px 50px;
            border-radius: var(--radius-lg);
            border: 1px solid rgba(124, 58, 237, 0.1);
            text-align: center;
            width: 90%;
            max-width: 450px;
            box-shadow: 0 0 50px rgba(124, 58, 237, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.05);
            backdrop-filter: var(--glass);
            animation: slideInUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
            position: relative;
            overflow: hidden;
        }

            .login-card::before {
                content: '';
                position: absolute;
                top: 0;
                left: 0;
                right: 0;
                height: 1px;
                background: var(--gradient-purple);
                animation: shimmer 3s infinite linear;
            }

        .login-logo {
            width: 120px;
            margin-bottom: 25px;
            filter: drop-shadow(0 0 10px var(--purple-glow));
            animation: float 6s ease-in-out infinite;
        }

        .login-title {
            font-size: 2.2rem;
            font-weight: 900;
            margin-bottom: 10px;
            background: linear-gradient(45deg, var(--purple), var(--neon-blue));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            text-shadow: 0 0 10px rgba(124, 58, 237, 0.2);
            letter-spacing: 1px;
            font-family: 'Tajawal', sans-serif;
        }

        .login-subtitle {
            color: var(--text-muted);
            font-size: 1rem;
            margin-bottom: 40px;
            letter-spacing: 1px;
            font-weight: 300;
        }

        .auth-input-group {
            position: relative;
            margin-bottom: 30px;
        }

        .auth-input {
            width: 100%;
            padding: 20px 25px;
            background: rgba(255,255,255,0.03);
            border: 1px solid rgba(124, 58, 237, 0.1);
            border-radius: var(--radius-md);
            color: #fff;
            font-size: 1.2rem;
            text-align: center;
            letter-spacing: 4px;
            transition: all 0.3s ease;
            font-family: 'Cairo', sans-serif;
            font-weight: 600;
        }

            .auth-input:focus {
                border-color: var(--purple);
                background: rgba(124, 58, 237, 0.03);
                box-shadow: 0 0 20px var(--purple-glow);
                transform: translateY(-2px);
            }

        .btn-auth {
            width: 100%;
            padding: 20px;
            background: var(--gradient-purple);
            color: white;
            border: none;
            border-radius: var(--radius-md);
            font-size: 1.2rem;
            font-weight: bold;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 10px 25px rgba(124, 58, 237, 0.2);
            position: relative;
            overflow: hidden;
            letter-spacing: 1px;
            font-family: 'Tajawal', sans-serif;
        }

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

            .btn-auth:hover {
                transform: translateY(-3px);
                box-shadow: 0 15px 35px rgba(124, 58, 237, 0.3);
            }

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

        /* ==========================================================================
                4. LAYOUT & SIDEBAR
                ==========================================================================
             */
        .app-layout {
            display: grid;
            grid-template-columns: 300px 1fr;
            width: 100%;
            height: 100vh;
            opacity: 0;
            animation: fadeIn 0.5s ease forwards 0.3s;
        }

        .sidebar {
            background: rgba(15, 15, 25, 0.9);
            backdrop-filter: var(--glass);
            border-left: 1px solid rgba(124, 58, 237, 0.05);
            padding: 30px 25px;
            display: flex;
            flex-direction: column;
            gap: 20px;
            z-index: 100;
            box-shadow: 10px 0 30px rgba(0,0,0,0.2);
            position: relative;
            overflow-y: auto;
        }

            .sidebar::before {
                content: '';
                position: absolute;
                top: 0;
                left: 0;
                right: 0;
                height: 1px;
                background: linear-gradient(90deg, transparent, var(--purple), transparent);
            }

        .brand {
            display: flex;
            align-items: center;
            gap: 20px;
            margin-bottom: 50px;
            padding: 0 10px;
        }

            .brand img {
                width: 55px;
                height: 55px;
                border-radius: 12px;
                border: 2px solid rgba(124, 58, 237, 0.2);
                padding: 5px;
                background: rgba(124, 58, 237, 0.05);
                transition: all 0.3s ease;
            }

                .brand img:hover {
                    transform: rotate(15deg) scale(1.1);
                    border-color: var(--purple);
                }

        .brand-text h3 {
            margin: 0;
            font-size: 1.4rem;
            color: white;
            font-weight: 800;
            letter-spacing: 1px;
            font-family: 'Tajawal', sans-serif;
        }

        .brand-text span {
            font-size: 0.85rem;
            color: var(--purple);
            letter-spacing: 3px;
            font-weight: bold;
            text-transform: uppercase;
            background: linear-gradient(45deg, var(--purple), var(--neon-blue));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            font-family: 'Tajawal', sans-serif;
        }

        .nav-btn {
            background: transparent;
            border: none;
            width: 100%;
            padding: 18px 25px;
            border-radius: var(--radius-md);
            color: var(--text-muted);
            font-size: 1.1rem;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 20px;
            cursor: pointer;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            text-align: right;
            position: relative;
            overflow: hidden;
            font-family: 'Tajawal', sans-serif;
        }

            .nav-btn::before {
                content: '';
                position: absolute;
                top: 0;
                right: -100%;
                width: 100%;
                height: 100%;
                background: linear-gradient(90deg, transparent, rgba(124, 58, 237, 0.05), transparent);
                transition: 0.5s;
            }

            .nav-btn i {
                width: 25px;
                font-size: 1.3rem;
                transition: 0.3s;
            }

            .nav-btn:hover {
                background: rgba(255,255,255,0.02);
                color: white;
                transform: translateX(-5px);
            }

                .nav-btn:hover::before {
                    right: 100%;
                }

            .nav-btn.active {
                background: linear-gradient(90deg, rgba(124, 58, 237, 0.1) 0%, transparent 100%);
                color: var(--purple);
                border-right: 3px solid var(--purple);
                font-weight: 700;
                box-shadow: inset 0 0 20px rgba(124, 58, 237, 0.05);
            }

                .nav-btn.active i {
                    color: var(--purple);
                    filter: drop-shadow(0 0 5px var(--purple-glow));
                }

        .logout-btn {
            margin-top: auto;
            color: var(--red);
            border: 1px solid rgba(239, 68, 68, 0.1);
        }

            .logout-btn:hover {
                background: rgba(239, 68, 68, 0.05);
                color: var(--red);
                border-color: rgba(239, 68, 68, 0.2);
            }

        /* ==========================================================================
                5. MAIN CONTENT AREA
                ==========================================================================
             */
        .main-content {
            padding: 40px 50px;
            overflow-y: auto;
            flex: 1;
            background: rgba(10, 10, 15, 0.3);
            position: relative;
            width: 100%;
            max-width: 100%;
            overflow-x: hidden;
        }

        .header-bar {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 50px;
            padding-bottom: 20px;
            border-bottom: 1px solid rgba(255,255,255,0.03);
        }

        .page-title h1 {
            font-size: 2.3rem;
            margin: 0;
            font-weight: 800;
            background: linear-gradient(45deg, var(--text-main), var(--text-muted));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            letter-spacing: 0.5px;
            font-family: 'Tajawal', sans-serif;
        }

        .page-title p {
            color: var(--text-muted);
            margin: 10px 0 0;
            font-size: 1rem;
            max-width: 600px;
            font-family: 'Cairo', sans-serif;
            font-weight: 400;
        }

        /* Stats Cards */
        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
            gap: 25px;
            margin-bottom: 40px;
        }

        .stat-card {
            background: var(--bg-card);
            border: var(--border);
            border-radius: var(--radius-md);
            padding: 30px;
            display: flex;
            align-items: center;
            gap: 25px;
            transition: all 0.4s ease;
            position: relative;
            overflow: hidden;
            cursor: pointer;
        }

            .stat-card::before {
                content: '';
                position: absolute;
                top: 0;
                left: 0;
                width: 100%;
                height: 100%;
                background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.01) 50%, transparent 70%);
                transform: translateX(-100%);
                transition: transform 0.6s;
            }

            .stat-card:hover {
                transform: translateY(-5px);
                border-color: var(--purple);
                box-shadow: 0 15px 40px rgba(0,0,0,0.4);
            }

                .stat-card:hover::before {
                    transform: translateX(100%);
                }

            .stat-card::after {
                content: '';
                position: absolute;
                top: 0;
                left: 0;
                width: 100%;
                height: 3px;
                background: var(--gradient-purple);
            }

        .stat-icon {
            width: 60px;
            height: 60px;
            background: rgba(124, 58, 237, 0.08);
            border-radius: 16px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.8rem;
            color: var(--purple);
            transition: all 0.3s ease;
        }

        .stat-card:hover .stat-icon {
            background: rgba(124, 58, 237, 0.15);
            transform: scale(1.05) rotate(5deg);
        }

        .stat-info h4 {
            margin: 0;
            color: var(--text-muted);
            font-size: 0.95rem;
            font-weight: 500;
            letter-spacing: 0.5px;
            font-family: 'Cairo', sans-serif;
        }

        .stat-info span {
            font-size: 2rem;
            font-weight: bold;
            color: white;
            display: block;
            margin-top: 5px;
            font-family: 'Tajawal', sans-serif;
        }

        /* Forms */
        .glass-panel {
            background: rgba(20, 20, 30, 0.6);
            border: 1px solid rgba(124, 58, 237, 0.1);
            border-radius: var(--radius-lg);
            padding: 40px;
            margin-bottom: 40px;
            box-shadow: 0 15px 40px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.03);
            width: 100%;
            max-width: 100%;
            box-sizing: border-box;
            backdrop-filter: var(--glass);
        }

        .form-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 20px;
            margin-bottom: 25px;
        }

        .c-input {
            width: 100%;
            padding: 16px 20px;
            background: rgba(15, 15, 25, 0.4);
            border: 1px solid rgba(124, 58, 237, 0.1);
            border-radius: var(--radius-sm);
            color: white;
            font-family: 'Cairo', sans-serif;
            transition: all 0.3s ease;
            max-width: 100%;
            box-sizing: border-box;
            font-size: 1rem;
        }

            .c-input:focus {
                border-color: var(--purple);
                background: rgba(124, 58, 237, 0.03);
                box-shadow: 0 0 15px rgba(124, 58, 237, 0.15);
                transform: translateY(-2px);
            }

        select.c-input {
            appearance: none;
            cursor: pointer;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%237c3aed' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: left 20px center;
            padding-left: 50px;
        }

        .btn-action {
            padding: 15px 35px;
            border-radius: var(--radius-sm);
            border: none;
            font-weight: bold;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            gap: 12px;
            transition: all 0.3s ease;
            font-size: 1rem;
            font-family: 'Tajawal', sans-serif;
            position: relative;
            overflow: hidden;
            letter-spacing: 0.3px;
        }

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

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

        .btn-primary {
            background: var(--gradient-purple);
            color: white;
            box-shadow: 0 8px 20px rgba(124, 58, 237, 0.2);
        }

            .btn-primary:hover {
                background: linear-gradient(135deg, #6d28d9 0%, #8b5cf6 100%);
                transform: translateY(-2px);
                box-shadow: 0 12px 25px rgba(124, 58, 237, 0.3);
            }

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

        .btn-cancel {
            background: rgba(255,255,255,0.03);
            color: var(--text-muted);
            border: 1px solid rgba(255,255,255,0.05);
        }

        /* Products List (Grid Layout) */
        .products-container {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
            gap: 25px;
            width: 100%;
        }

        .product-card {
            background: var(--bg-card);
            border: var(--border);
            border-radius: var(--radius-md);
            padding: 20px;
            position: relative;
            transition: all 0.4s ease;
            width: 100%;
            box-sizing: border-box;
            overflow: hidden;
        }

            .product-card::before {
                content: '';
                position: absolute;
                top: 0;
                left: 0;
                right: 0;
                height: 1px;
                background: var(--gradient-purple);
                transform: scaleX(0);
                transition: transform 0.4s ease;
            }

            .product-card:hover {
                border-color: var(--purple);
                transform: translateY(-5px);
                box-shadow: 0 15px 35px rgba(0,0,0,0.3);
            }

                .product-card:hover::before {
                    transform: scaleX(1);
                }

        .p-img {
            width: 100%;
            height: 180px;
            object-fit: cover;
            border-radius: var(--radius-sm);
            margin-bottom: 20px;
            transition: all 0.3s ease;
            border: 1px solid rgba(255,255,255,0.03);
        }

        .product-card:hover .p-img {
            transform: scale(1.02);
            border-color: rgba(124, 58, 237, 0.2);
        }

        .p-details h3 {
            margin: 0 0 10px;
            font-size: 1.2rem;
            font-weight: 700;
            color: white;
            line-height: 1.4;
            font-family: 'Tajawal', sans-serif;
        }

        .p-price {
            color: var(--gold);
            font-weight: bold;
            font-size: 1.4rem;
            margin: 10px 0;
            display: flex;
            align-items: center;
            gap: 10px;
            font-family: 'Tajawal', sans-serif;
        }

        .p-actions {
            margin-top: 20px;
            display: flex;
            gap: 12px;
        }
/* =========================================================
   📦 تصغير كروت المنتجات (Compact Products Mode)
   ========================================================= */

/* 1. تصغير عرض الكارت وتقليل المسافات لزيادة العدد في الصف الواحد */
.products-container {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important; /* كانت 300px */
    gap: 15px !important;
}

/* 2. تقليل الهوامش الداخلية للكارت */
.product-card {
    padding: 12px !important; /* كانت 20px */
}

/* 3. تصغير صورة المنتج */
.p-img {
    height: 130px !important; /* كانت 180px */
    margin-bottom: 10px !important;
}

/* 4. تصغير الخطوط (الاسم، السعر، المنصة) */
.p-details h3 {
    font-size: 1rem !important; /* اسم المنتج */
    margin-bottom: 5px !important;
}

.p-details div[style*="font-size:0.9rem"] {
    font-size: 0.75rem !important; /* الوصف المختصر */
    margin-bottom: 5px !important;
}

.p-price {
    font-size: 1.1rem !important; /* السعر */
    margin: 8px 0 !important;
}

/* 5. تصغير أزرار التحكم (التعديل، الحذف، السحب) */
.p-actions {
    margin-top: 12px !important;
    gap: 8px !important;
}

#section-products .icon-btn, 
#section-products .drag-handle {
    width: 32px !important; /* كانت 40px */
    height: 32px !important;
    font-size: 0.85rem !important;
    border-radius: 8px !important;
}
        .icon-btn {
            width: 40px;
            height: 40px;
            border-radius: 10px;
            border: none;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s ease;
            font-size: 1.1rem;
            position: relative;
            overflow: hidden;
        }

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

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

        .btn-edit {
            background: rgba(59, 130, 246, 0.1);
            color: var(--neon-blue);
            border: 1px solid rgba(59, 130, 246, 0.15);
        }

            .btn-edit:hover {
                background: rgba(59, 130, 246, 0.2);
                transform: translateY(-2px);
                box-shadow: 0 5px 12px rgba(59, 130, 246, 0.2);
            }

        .btn-del {
            background: rgba(239, 68, 68, 0.1);
            color: var(--red);
            border: 1px solid rgba(239, 68, 68, 0.15);
        }

            .btn-del:hover {
                background: rgba(239, 68, 68, 0.2);
                transform: translateY(-2px);
                box-shadow: 0 5px 12px rgba(239, 68, 68, 0.2);
            }

        .drag-handle {
            margin-right: auto;
            cursor: grab;
            color: #666;
            transition: all 0.3s ease;
            width: 40px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 10px;
            background: rgba(255,255,255,0.02);
            border: 1px solid rgba(255,255,255,0.03);
        }

            .drag-handle:hover {
                color: var(--purple);
                background: rgba(124, 58, 237, 0.08);
                border-color: rgba(124, 58, 237, 0.15);
            }

            .drag-handle:active {
                cursor: grabbing;
                transform: scale(0.95);
            }

        /* Orders Table */
        .table-responsive {
            overflow-x: auto;
            border-radius: var(--radius-md);
            border: var(--border);
            width: 100%;
            background: rgba(20, 20, 30, 0.4);
        }

        .custom-table {
            width: 100%;
            border-collapse: collapse;
            min-width: 1000px;
        }

            .custom-table th {
                background: rgba(124, 58, 237, 0.08);
                padding: 25px;
                text-align: right;
                color: var(--text-muted);
                font-weight: 600;
                font-size: 1rem;
                letter-spacing: 0.5px;
                border-bottom: 1px solid rgba(124, 58, 237, 0.05);
                font-family: 'Cairo', sans-serif;
            }

            .custom-table td {
                padding: 25px;
                border-bottom: 1px solid rgba(255,255,255,0.02);
                color: white;
                vertical-align: middle;
                transition: all 0.3s ease;
                font-family: 'Tajawal', sans-serif;
            }

            .custom-table tr:hover td {
                background: rgba(255,255,255,0.01);
            }

        .status-pill {
            padding: 8px 16px;
            border-radius: 50px;
            font-size: 0.85rem;
            font-weight: bold;
            display: inline-flex;
            align-items: center;
            gap: 8px;
            transition: all 0.3s ease;
            letter-spacing: 0.3px;
            font-family: 'Tajawal', sans-serif;
        }

        .st-pending {
            background: rgba(245, 158, 11, 0.08);
            color: #f59e0b;
            border: 1px solid rgba(245, 158, 11, 0.15);
        }

        .st-completed {
            background: rgba(16, 185, 129, 0.08);
            color: var(--green);
            border: 1px solid rgba(16, 185, 129, 0.15);
        }

        .st-cancelled {
            background: rgba(239, 68, 68, 0.08);
            color: var(--red);
            border: 1px solid rgba(239, 68, 68, 0.15);
        }

        /* ==========================================================================
                6. MODAL & TOAST
                ==========================================================================
             */
        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.8);
            backdrop-filter: blur(5px);
            z-index: 2000;
            display: none;
            justify-content: center;
            align-items: center;
            animation: fadeIn 0.3s ease;
        }

        .modal-box {
            background: #1a1a2e;
            border: 1px solid rgba(124, 58, 237, 0.2);
            width: 90%;
            max-width: 600px;
            border-radius: var(--radius-lg);
            padding: 40px;
            position: relative;
            animation: slideInUp 0.4s ease;
            box-shadow: 0 0 50px rgba(124, 58, 237, 0.15), inset 0 1px 0 rgba(255,255,255,0.03);
            backdrop-filter: var(--glass);
        }

        .modal-header {
            font-size: 1.4rem;
            font-weight: bold;
            margin-bottom: 30px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            color: var(--purple);
            padding-bottom: 20px;
            border-bottom: 1px solid rgba(124, 58, 237, 0.08);
            font-family: 'Tajawal', sans-serif;
        }

        .close-modal {
            cursor: pointer;
            font-size: 1.8rem;
            color: var(--text-muted);
            transition: all 0.3s ease;
            width: 40px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            background: rgba(255,255,255,0.02);
        }

            .close-modal:hover {
                color: var(--red);
                background: rgba(239, 68, 68, 0.08);
                transform: rotate(90deg);
            }

        /* Toast */
        #toast-container {
            position: fixed;
            top: 30px;
            left: 50%;
            transform: translateX(-50%);
            z-index: 10000;
            display: flex;
            flex-direction: column;
            gap: 15px;
        }

        .toast-msg {
            background: rgba(30, 30, 45, 0.95);
            color: white;
            padding: 15px 30px;
            border-radius: 50px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.4), 0 0 0 1px rgba(124, 58, 237, 0.05);
            border-left: 3px solid;
            display: flex;
            align-items: center;
            gap: 15px;
            font-weight: 600;
            animation: slideInDown 0.4s ease;
            min-width: 350px;
            justify-content: center;
            backdrop-filter: var(--glass);
            letter-spacing: 0.3px;
            font-family: 'Tajawal', sans-serif;
        }

        /* ==========================================================================
                7. AD MANAGEMENT SECTION
                ==========================================================================
             */
        .ad-cards-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
            gap: 25px;
            width: 100%;
            margin-bottom: 30px;
        }

        .ad-card-item {
            background: rgba(25, 25, 40, 0.6);
            border: 1px solid rgba(124, 58, 237, 0.1);
            border-radius: var(--radius-md);
            padding: 25px;
            width: 100%;
            box-sizing: border-box;
            transition: all 0.4s ease;
            display: flex;
            flex-direction: column;
            gap: 20px;
            position: relative;
            overflow: hidden;
        }

            .ad-card-item::before {
                content: '';
                position: absolute;
                top: 0;
                left: 0;
                right: 0;
                height: 1px;
                background: var(--gradient-purple);
                transform: scaleX(0);
                transition: transform 0.4s ease;
            }

            .ad-card-item:hover {
                border-color: rgba(124, 58, 237, 0.3);
                transform: translateY(-5px);
                box-shadow: 0 15px 35px rgba(0,0,0,0.25);
            }

                .ad-card-item:hover::before {
                    transform: scaleX(1);
                }

            .ad-card-item h4 {
                margin: 0;
                font-size: 1.3rem;
                color: white;
                display: flex;
                align-items: center;
                gap: 10px;
                font-family: 'Tajawal', sans-serif;
            }

        .ad-preview-container {
            width: 100%;
            height: 200px;
            border-radius: var(--radius-sm);
            overflow: hidden;
            position: relative;
            background: linear-gradient(45deg, #0f0f1a, #1a1a2e);
            border: 1px solid rgba(255, 255, 255, 0.03);
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .ad-preview-img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: all 0.5s ease;
        }

            .ad-preview-img.loading {
                filter: blur(5px);
                opacity: 0.7;
            }

        .no-preview {
            text-align: center;
            color: #666;
            padding: 20px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            height: 100%;
            gap: 15px;
        }

            .no-preview i {
                font-size: 3rem;
                margin-bottom: 10px;
                opacity: 0.2;
            }

        .ad-input-group {
            display: flex;
            flex-direction: column;
            gap: 15px;
        }

        .ad-input-label {
            font-size: 0.9rem;
            color: var(--text-muted);
            display: flex;
            align-items: center;
            gap: 10px;
            font-weight: 500;
            font-family: 'Cairo', sans-serif;
        }

            .ad-input-label i {
                color: var(--purple);
                font-size: 1.1rem;
            }

        .ad-input {
            width: 100%;
            padding: 14px 18px;
            background: rgba(15, 15, 25, 0.5);
            border: 1px solid rgba(124, 58, 237, 0.1);
            border-radius: var(--radius-sm);
            color: white;
            font-family: 'Cairo', sans-serif;
            transition: all 0.3s ease;
            font-size: 1rem;
            box-sizing: border-box;
        }

            .ad-input:focus {
                border-color: var(--purple);
                background: rgba(124, 58, 237, 0.05);
                box-shadow: 0 0 15px rgba(124, 58, 237, 0.2);
                transform: translateY(-2px);
            }

            .ad-input::placeholder {
                color: #555;
            }

        .refresh-preview-btn {
            position: absolute;
            top: 15px;
            right: 15px;
            background: rgba(0, 0, 0, 0.6);
            border: 1px solid rgba(124, 58, 237, 0.15);
            color: white;
            width: 36px;
            height: 36px;
            border-radius: 50%;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1rem;
            transition: all 0.3s ease;
            z-index: 10;
            backdrop-filter: blur(5px);
        }

            .refresh-preview-btn:hover {
                background: var(--purple);
                transform: rotate(90deg);
                box-shadow: 0 0 15px rgba(124, 58, 237, 0.4);
            }

        .save-ad-btn {
            width: 100%;
            padding: 20px;
            background: var(--gradient-purple);
            color: white;
            border: none;
            border-radius: var(--radius-md);
            font-weight: 800;
            font-size: 1.1rem;
            cursor: pointer;
            transition: all 0.4s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 15px;
            box-shadow: 0 12px 35px rgba(124, 58, 237, 0.2);
            max-width: 500px;
            margin: 30px auto 0;
            letter-spacing: 0.5px;
            position: relative;
            overflow: hidden;
            font-family: 'Tajawal', sans-serif;
        }

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

            .save-ad-btn:hover {
                transform: translateY(-3px);
                box-shadow: 0 18px 45px rgba(124, 58, 237, 0.3);
            }

                .save-ad-btn:hover::before {
                    left: 100%;
                }

            .save-ad-btn:disabled {
                opacity: 0.6;
                cursor: not-allowed;
                transform: none !important;
            }

        /* ==========================================================================
                8. MOBILE RESPONSIVE
                ==========================================================================
             */
        .mobile-header {
            display: none;
            padding: 20px 25px;
            background: rgba(15, 15, 25, 0.9);
            justify-content: space-between;
            align-items: center;
            border-bottom: 1px solid rgba(124, 58, 237, 0.05);
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            z-index: 1000;
            backdrop-filter: var(--glass);
        }

        .mobile-menu-btn {
            background: rgba(124, 58, 237, 0.08);
            border: 1px solid rgba(124, 58, 237, 0.15);
            color: var(--purple);
            font-size: 1.5rem;
            width: 50px;
            height: 50px;
            border-radius: 12px;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
        }

            .mobile-menu-btn:hover {
                background: rgba(124, 58, 237, 0.15);
                transform: rotate(90deg);
            }

        /* إضافة backdrop للقائمة الجانبية */
        #sidebar-backdrop {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            /* بدون أي سواد أو blur؛ العنصر موجود فقط للضغط خارج القائمة وإغلاقها. */
            background: transparent !important;
            backdrop-filter: none !important;
            -webkit-backdrop-filter: none !important;
            z-index: 2147483000 !important;
            display: block;
            opacity: 0;
            visibility: hidden;
            pointer-events: none;
            transition: opacity 0.2s ease, visibility 0s linear 0.2s;
        }

        @media (max-width: 1024px) {
            .app-layout {
                grid-template-columns: 1fr;
                display: block;
            }

            .sidebar {
                position: fixed;
                right: -100%;
                left: auto;
                top: 0;
                height: 100%;
                width: 300px;
                transition: right 0.24s cubic-bezier(0.4, 0, 0.2, 1);
                z-index: 2147483001 !important;
                box-shadow: -10px 0 40px rgba(0,0,0,0.3);
                backdrop-filter: none !important;
                -webkit-backdrop-filter: none !important;
                pointer-events: none;
                opacity: 1 !important;
                visibility: visible !important;
                isolation: isolate;
            }

                .sidebar.active {
                    right: 0;
                    left: auto;
                    pointer-events: auto !important;
                }

                .sidebar.active .nav-btn,
                .sidebar.active .logout-btn,
                .sidebar.active button,
                .sidebar.active a {
                    pointer-events: auto !important;
                    touch-action: manipulation !important;
                }

            .mobile-header {
                display: flex;
                backdrop-filter: none !important;
            }

            .main-content {
                padding: 80px 25px 25px 25px;
                height: 100vh;
                overflow-y: auto;
            }

            .products-container,
            .ad-cards-grid {
                grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            }

            .glass-panel {
                padding: 30px;
                backdrop-filter: none !important;
            }

            .ad-preview-container {
                height: 180px;
            }

            #sidebar-backdrop.active {
                opacity: 1;
                visibility: visible;
                pointer-events: auto;
                transition: opacity 0.2s ease;
            }
        }

        @media (max-width: 768px) {
            .page-title h1 {
                font-size: 2rem;
            }

            .stats-grid {
                grid-template-columns: 1fr;
            }

            .form-grid {
                grid-template-columns: 1fr;
            }

            .products-container,
            .ad-cards-grid {
                grid-template-columns: 1fr;
            }

            .modal-box {
                padding: 30px 20px;
            }
        }

        /* ==========================================================================
                9. ENHANCEMENTS
                ==========================================================================
             */
        .version-badge {
            position: absolute;
            bottom: 20px;
            left: 20px;
            background: rgba(124, 58, 237, 0.08);
            border: 1px solid rgba(124, 58, 237, 0.15);
            border-radius: 20px;
            padding: 8px 16px;
            font-size: 0.75rem;
            color: var(--purple);
            font-weight: 600;
            letter-spacing: 1px;
        }

        .connection-status {
            position: fixed;
            bottom: 20px;
            right: 20px;
            display: flex;
            align-items: center;
            gap: 10px;
            background: rgba(16, 185, 129, 0.08);
            border: 1px solid rgba(16, 185, 129, 0.15);
            border-radius: 20px;
            padding: 8px 16px;
            font-size: 0.8rem;
            color: var(--green);
            z-index: 100;
            backdrop-filter: blur(5px);
        }

            .connection-status.offline {
                background: rgba(239, 68, 68, 0.08);
                border-color: rgba(239, 68, 68, 0.15);
                color: var(--red);
            }

        .connection-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: var(--green);
            animation: pulse 2s infinite;
        }

        .connection-status.offline .connection-dot {
            background: var(--red);
        }

        .notification-bell {
            position: relative;
            cursor: pointer;
            font-size: 1.3rem;
            color: var(--text-muted);
            transition: all 0.3s ease;
            padding: 10px;
            border-radius: 50%;
            background: rgba(255,255,255,0.02);
        }

            .notification-bell:hover {
                color: var(--purple);
                background: rgba(124, 58, 237, 0.08);
                transform: scale(1.1);
            }

            .notification-bell::after {
                content: '';
                position: absolute;
                top: 8px;
                right: 8px;
                width: 8px;
                height: 8px;
                background: var(--red);
                border-radius: 50%;
                border: 2px solid var(--bg-panel);
                display: none;
            }

            .notification-bell.has-notification::after {
                display: block;
                animation: pulse 1.5s infinite;
            }

            .notification-bell.has-notification {
                animation: shake 0.5s ease-in-out;
            }

        .select-box {
            position: relative;
            width: 100%;
            background-color: #252525;
            border: 1px solid #333;
            border-radius: 8px;
            transition: 0.3s;
        }

            .select-box::after {
                content: '';
                position: absolute;
                left: 15px;
                top: 50%;
                width: 0;
                height: 0;
                border-left: 5px solid transparent;
                border-right: 5px solid transparent;
                border-top: 6px solid #888;
                transform: translateY(-50%);
                pointer-events: none;
                transition: 0.3s;
            }

            .select-box:focus-within {
                border-color: #7289da;
                box-shadow: 0 0 0 3px rgba(114, 137, 218, 0.2);
            }

        /* تنسيق الخيارات الداخلية */
        .c-input option {
            background-color: #252525;
            color: #fff;
            padding: 15px;
        }

        .select-box:hover::after {
            border-top-color: #fff;
        }

        /* ==========================================================================
                10. LIVE CHAT BUTTON
                ==========================================================================
             */
        #live-chat-button {
            position: fixed;
            bottom: 90px;
            left: 20px;
            background: linear-gradient(135deg, #7c3aed, #a855f7);
            color: white;
            width: 60px;
            height: 60px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 24px;
            cursor: pointer;
            box-shadow: 0 8px 25px rgba(124, 58, 237, 0.4);
            z-index: 999;
            transition: all 0.3s ease;
            border: none;
            animation: pulse-chat 2s infinite;
        }

        @keyframes pulse-chat {
            0%, 100% {
                transform: scale(1);
                box-shadow: 0 8px 25px rgba(124, 58, 237, 0.4);
            }

            50% {
                transform: scale(1.05);
                box-shadow: 0 12px 30px rgba(124, 58, 237, 0.6);
            }
        }

        #live-chat-button:hover {
            transform: scale(1.1) rotate(5deg);
            box-shadow: 0 15px 35px rgba(124, 58, 237, 0.6);
        }

        #live-chat-button.has-unread::after {
            content: '';
            position: absolute;
            top: 5px;
            right: 5px;
            width: 12px;
            height: 12px;
            background: #ff4757;
            border-radius: 50%;
            border: 2px solid #1a1a2e;
            animation: pulse 1.5s infinite;
        }

        @media (max-width: 1024px) {
            #live-chat-button {
                bottom: 80px;
                left: 15px;
                width: 55px;
                height: 55px;
                font-size: 22px;
            }
        }

        @media (max-width: 768px) {
            #live-chat-button {
                bottom: 70px;
                left: 10px;
                width: 50px;
                height: 50px;
                font-size: 20px;
            }
        }

        /* Live Chat Modal */
        #live-chat-modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.9);
            backdrop-filter: blur(10px);
            z-index: 9999;
            display: none;
            justify-content: center;
            align-items: center;
            animation: fadeIn 0.3s ease;
        }

        .live-chat-container {
            width: 95%;
            height: 90%;
            max-width: 1200px;
            background: #1a1a2e;
            border-radius: 20px;
            border: 1px solid rgba(124, 58, 237, 0.3);
            overflow: hidden;
            box-shadow: 0 25px 50px rgba(0,0,0,0.5);
            display: flex;
            flex-direction: column;
        }

        .live-chat-header {
            background: linear-gradient(135deg, #6f42c1, #8e44ad);
            padding: 20px 30px;
            text-align: center;
            border-bottom: 3px solid #ffd700;
            box-shadow: 0 4px 20px rgba(0,0,0,0.3);
        }

            .live-chat-header h2 {
                font-size: 1.8rem;
                margin: 0;
                color: white;
                text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
            }

        .live-chat-subtitle {
            opacity: 0.9;
            font-size: 0.9rem;
            margin-top: 5px;
            color: rgba(255,255,255,0.9);
        }

        .live-chat-content {
            flex: 1;
            overflow: hidden;
            display: flex;
        }

        .live-chat-iframe {
            width: 100%;
            height: 100%;
            border: none;
            background: white;
        }

        .close-live-chat {
            position: absolute;
            top: 15px;
            left: 15px;
            background: rgba(239, 68, 68, 0.2);
            color: white;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            font-size: 1.5rem;
            transition: all 0.3s ease;
            border: 1px solid rgba(239, 68, 68, 0.3);
            z-index: 10;
        }

            .close-live-chat:hover {
                background: rgba(239, 68, 68, 0.4);
                transform: rotate(90deg);
            }

        /* ==========================================================================
                11. MOBILE BOTTOM NAVIGATION
                ==========================================================================
             */
        .mobile-bottom-nav {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            background: rgba(20, 20, 30, 0.95);
            backdrop-filter: blur(20px);
            border-top: 1px solid rgba(124, 58, 237, 0.1);
            display: none;
            justify-content: space-around;
            align-items: center;
            padding: 10px 0;
            z-index: 1000;
            box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.3);
        }

        .mobile-nav-btn {
            background: transparent;
            border: none;
            color: var(--text-muted);
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 5px;
            padding: 12px 10px;
            width: 100%;
            cursor: pointer;
            transition: all 0.3s ease;
            font-family: 'Tajawal', sans-serif;
            font-size: 0.8rem;
            position: relative;
        }

            .mobile-nav-btn i {
                font-size: 1.2rem;
                transition: all 0.3s ease;
            }

            .mobile-nav-btn.active {
                color: var(--purple);
            }

                .mobile-nav-btn.active i {
                    color: var(--purple);
                    transform: translateY(-3px);
                    filter: drop-shadow(0 0 5px rgba(124, 58, 237, 0.3));
                }

                .mobile-nav-btn.active::after {
                    content: '';
                    position: absolute;
                    top: -1px;
                    width: 30px;
                    height: 3px;
                    background: var(--gradient-purple);
                    border-radius: 2px;
                }

            .mobile-nav-btn:hover:not(.active) {
                color: white;
                transform: translateY(-2px);
            }

                .mobile-nav-btn:hover:not(.active) i {
                    color: white;
                }

        /* إظهار شريط التنقل في الموبايل فقط */
        @media (max-width: 1024px) {
            .mobile-bottom-nav {
                display: flex;
            }

            /* تعديل padding للمحتوى الرئيسي ليتناسب مع شريط التنقل */
            .main-content {
                padding-bottom: 80px !important;
            }
        }

        /* --- 5. أهم جزء: الشبكة المتجاوبة (Responsive Grid) --- */
        /* هذا الكلاس سنضعه بدلاً من الستايل المباشر في الـ HTML */
        .responsive-grid {
            display: grid;
            grid-template-columns: 1fr 1fr; /* عمودين للشاشات الكبيرة */
            gap: 12px;
            margin-bottom: 12px;
        }

        .grid-tools {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 10px;
        }

        /* --- Media Queries (للموبايل والتابلت) --- */
        @media (max-width: 768px) {
            /* تحويل الشبكة لعمود واحد في الموبايل */
            .responsive-grid, .grid-tools {
                grid-template-columns: 1fr !important;
            }

            /* تصغير الهوامش قليلاً */
            .modal-box {
                padding: 15px;
                width: 90% !important;
            }
        }
        /* --- تنسيق الشات الأساسي (للكمبيوتر) --- */
        .chat-container {
            display: flex;
            height: 85vh; /* ارتفاع الشات */
            overflow: hidden;
            background: #fff;
            border-radius: 10px;
            box-shadow: 0 5px 15px rgba(0,0,0,0.05);
        }

        .chat-sidebar {
            width: 300px; /* عرض القائمة في الكمبيوتر */
            border-left: 1px solid #eee; /* في حالة العربي RTL */
            overflow-y: auto;
            background: #f9fafb;
            flex-shrink: 0; /* منع الانكماش */
        }

        .chat-main {
            flex: 1; /* يأخذ باقي المساحة */
            display: flex;
            flex-direction: column;
        }

        /* --- 📱 الحل السحري للتابلت والموبايل (Responsive) --- */
        @media (max-width: 992px) {

            .chat-container {
                flex-direction: column; /* تحويل الاتجاه لعمودي */
                height: auto; /* الارتفاع حسب المحتوى */
                min-height: 80vh;
            }

            /* 1. قائمة المستخدمين في التابلت */
            .chat-sidebar {
                width: 100%; /* العرض بالكامل */
                height: 150px; /* ارتفاع قصير */
                border-left: none;
                border-bottom: 1px solid #eee;
                display: flex; /* عرض المستخدمين بجانب بعض (اختياري) */
                overflow-x: auto; /* سكرول بالعرض لو القائمة طويلة */
                overflow-y: hidden;
            }

                /* (اختياري) تحسين شكل كارت المستخدم في القائمة العلوية */
                .chat-sidebar .user-card {
                    min-width: 200px; /* عرض ثابت للكارت عشان يظهروا جنب بعض */
                }

            /* 2. منطقة الشات */
            .chat-main {
                width: 100%;
                height: 600px; /* ارتفاع ثابت لمنطقة الرسائل */
            }
        }

        @media (max-width: 992px) and (min-width: 600px) {
            .chat-sidebar {
                width: 80px; /* تصغير القائمة جداً */
                text-align: center;
            }

                /* إخفاء اسم المستخدم وإظهار الصورة فقط لتوفير مساحة */
                .chat-sidebar .user-name,
                .chat-sidebar .last-message {
                    display: none;
                }

                .chat-sidebar .user-avatar {
                    margin: 0 auto; /* توسيط الصورة */
                }
        }
        /* --- تعديل نافذة اللايف شات لتملأ الشاشة في التابلت والموبايل --- */
        @media (max-width: 1024px) {
            .live-chat-container {
                width: 100% !important;
                height: 100% !important;
                max-width: 100% !important;
                border-radius: 0 !important; /* إلغاء الحواف الدائرية لتملأ الأركان */
                border: none !important;
            }

            /* تكبير زر الإغلاق ليسهل ضغطه باللمس */
            .close-live-chat {
                top: 10px;
                left: 10px;
                width: 45px;
                height: 45px;
                font-size: 1.2rem;
                background: rgba(239, 68, 68, 0.9); /* لون أحمر واضح */
                z-index: 2000; /* لضمان ظهوره فوق أي شيء */
            }
        }

        /* =========================================================
        إصلاح نافذة اللايف شات للتابلت والموبايل
        (توسيع النافذة لتصبح ملء الشاشة)
        ========================================================= */
        @media (max-width: 1024px) {
            /* جعل الحاوية تأخذ الشاشة بالكامل */
            .live-chat-container {
                width: 100% !important;
                height: 100% !important;
                max-width: 100% !important;
                border-radius: 0 !important; /* إلغاء الحواف الدائرية */
                border: none !important;
                display: flex !important;
                flex-direction: column !important;
            }

            /* تكبير زر الإغلاق وتحسين مكانه للمس */
            .close-live-chat {
                top: 15px !important;
                left: 15px !important;
                width: 45px !important;
                height: 45px !important;
                background: rgba(220, 38, 38, 0.9) !important; /* لون أحمر واضح */
                z-index: 99999 !important; /* فوق كل شيء */
                box-shadow: 0 4px 15px rgba(0,0,0,0.3);
            }

            /* التأكد من أن الـ iframe واخد المساحة كلها */
            .live-chat-content,
            .live-chat-iframe {
                height: 100% !important;
                width: 100% !important;
            }
        }

        /* 1. الشبكة: نخلي الكروت تيجي جنب بعض بمسافات ضيقة */
        .stats-grid {
            display: grid;
            /* الكارت الواحد ياخد مساحة صغيرة، ولو الشاشة واسعة يحطهم 4 جنب بعض */
            grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
            gap: 8px; /* المسافة بين الكروت صغيرة جداً */
            margin-bottom: 20px;
        }

        /* 2. الكارت نفسه: نشيل الفراغات الزيادة */
        .stat-card {
            padding: 8px 12px; /* حشو داخلي صغير */
            display: flex;
            align-items: center; /* الأيقونة والكلام على نفس السطر */
            gap: 10px; /* مسافة بين الأيقونة والكلام */
            min-height: unset; /* إلغاء أي طول ثابت قديم */
        }

        /* 3. تصغير الأيقونة والدايرة اللي حواليها */
        .stat-icon {
            width: 32px; /* عرض الدائرة */
            height: 32px; /* طول الدائرة */
            font-size: 0.9rem; /* حجم الرمز نفسه */
            border-radius: 8px; /* تدويرة خفيفة */
            display: flex;
            align-items: center;
            justify-content: center;
            background: rgba(255, 255, 255, 0.05); /* خلفية خفيفة للأيقونة */
        }

        /* 4. تصغير الكلام (العنوان) */
        .stat-info h4 {
            font-size: 0.7rem; /* خط صغير جداً للعنوان */
            margin: 0;
            opacity: 0.7;
            white-space: nowrap; /* يمنع الكلام ينزل سطرين */
        }

        /* 5. تصغير الرقم */
        .stat-info span {
            font-size: 1rem; /* حجم الرقم */
            font-weight: bold;
            line-height: 1;
            display: block;
            margin-top: 2px;
        }

        /* =========================================================
   ⚡ تصميم زر ونافذة الانتقال السريع (Quick Actions) ⚡
   ========================================================= */

/* زر الانتقال السريع العائم */
#quick-actions-trigger {
    position: fixed;
    bottom: 90px;
    right: 20px; /* على اليمين لعدم التعارض مع اللايف شات */
    background: linear-gradient(135deg, var(--neon-blue), #3b82f6);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(0, 212, 255, 0.4);
    z-index: 999;
    transition: all 0.3s ease;
    border: none;
    animation: pulse-qa 2.5s infinite;
}

@keyframes pulse-qa {
    0%, 100% { transform: scale(1); box-shadow: 0 8px 25px rgba(0, 212, 255, 0.4); }
    50% { transform: scale(1.05); box-shadow: 0 12px 30px rgba(0, 212, 255, 0.6); }
}

#quick-actions-trigger:hover {
    transform: scale(1.1) rotate(15deg);
}

/* شبكة الأزرار داخل النافذة */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

/* تصميم كارت كل قسم */
.qa-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 20px 10px;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    font-family: 'Tajawal', sans-serif;
    font-weight: bold;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.qa-btn i {
    font-size: 2.2rem;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.qa-btn:hover {
    background: rgba(0, 212, 255, 0.08);
    border-color: rgba(0, 212, 255, 0.3);
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.qa-btn:hover i {
    transform: scale(1.2);
    filter: drop-shadow(0 0 10px rgba(255,255,255,0.3));
}

/* تعديلات للموبايل */
@media (max-width: 1024px) {
    #quick-actions-trigger {
        bottom: 85px; /* يرتفع ليكون أعلى شريط التنقل السفلي */
        right: 15px;
        width: 55px;
        height: 55px;
        font-size: 22px;
    }

    .quick-actions-grid {
        grid-template-columns: repeat(3, 1fr); /* 3 أعمدة في الموبايل */
        gap: 10px;
    }

    .qa-btn {
        padding: 15px 5px;
        font-size: 0.8rem;
        gap: 10px;
    }
    
    .qa-btn i {
        font-size: 1.8rem;
    }
}
@media (max-width: 400px) {
    .quick-actions-grid {
        grid-template-columns: repeat(2, 1fr); /* عمودين للشاشات الصغيرة جداً */
    }
}

/* =========================================
   🔍 ستايل محرك البحث (Spotlight)
   ========================================= */
.spotlight-box {
    width: 90% !important;
    max-width: 650px !important;
    background: rgba(15, 15, 25, 0.95) !important;
    border: 1px solid var(--purple) !important;
    box-shadow: 0 20px 60px rgba(124, 58, 237, 0.3) !important;
    padding: 0 !important;
    border-radius: 15px !important;
    overflow: hidden;
}

.spotlight-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(0, 0, 0, 0.2);
}

.spotlight-header i {
    color: var(--purple);
    font-size: 1.5rem;
}

.spotlight-header input {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    font-size: 1.2rem;
    outline: none;
    font-family: 'Cairo', sans-serif;
}

.spotlight-esc {
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 8px;
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    font-weight: bold;
}

.spotlight-results {
    max-height: 50vh;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
}

.spotlight-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.2s;
    border: 1px solid transparent;
}

.spotlight-item:hover {
    background: rgba(124, 58, 237, 0.1);
    border-color: rgba(124, 58, 237, 0.2);
    transform: translateX(-5px);
}

.spotlight-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

/* =========================================
   🔥 ستايل المنتجات الأكثر مبيعاً (Hot Items)
   ========================================= */
.hot-item-row {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 12px;
    border-radius: 12px;
}

.hot-item-img {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid rgba(255, 69, 0, 0.3);
}

.hot-item-progress-bg {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 8px;
}

.hot-item-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff4500, #ff8c00);
    border-radius: 10px;
    transition: width 1s ease-in-out;
}

#orders-load-more-footer {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 18px 0 10px;
}

#orders-load-more-btn {
    min-width: 220px;
    padding: 12px 20px;
}

/* إخفاء زر المستشار الذكي في شاشات الموبايل (أصغر من 768 بيكسل) */
@media (max-width: 768px) {
    #general-ai-btn {
        display: none !important;
    }
}
    .calc-btn {
        padding: 15px 5px;
        border: none;
        border-radius: 8px;
        font-size: 1.1rem;
        cursor: pointer;
        transition: 0.2s;
        background: rgba(255, 255, 255, 0.08);
        color: #fff;
    }
    .calc-btn:hover {
        background: rgba(255, 255, 255, 0.2);
        transform: translateY(-2px);
    }
    .op-btn {
        color: #25D366;
        font-weight: bold;
    }
    

/* ستايل المهمة لما يتعمل عليها صح */
.task-done-style {
    background: rgba(16, 185, 129, 0.05) !important; /* خلفية خضراء خفيفة جداً */
    border-color: var(--green) !important;
    transition: all 0.3s ease;
}

.task-done-style div {
    color: var(--text-muted) !important; /* بهتان النص */
}
/* الكارت اللي بيفضل مكانه وأنت بتسحب (الشفاف) */
.sortable-ghost {
    opacity: 0.3;
    background: var(--purple) !important;
    border: 2px dashed #fff !important;
}

/* شكل الكارت وهو "طاير" تحت الماوس */
.sortable-drag {
    cursor: grabbing !important;
    box-shadow: 0 15px 30px rgba(0,0,0,0.5) !important;
    transform: rotate(3deg);
}

.task-item {
    cursor: grab; /* شكل اليد للسحب */
    user-select: none; /* منع تحديد النص وأنت بتسحب */
}

.task-column {
    min-height: 200px; /* عشان تقدر تسحب لعمود فاضي */
}
.task-column {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 15px;
    padding: 15px;
    min-height: 400px;
    border: 1px solid rgba(255,255,255,0.05);
}
.column-header {
    display: flex;
    justify-content: space-between;
    padding-bottom: 15px;
    margin-bottom: 15px;
    font-weight: bold;
    font-size: 0.9rem;
}
.task-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.task-item {
    background: var(--bg-card);
    border-radius: 10px;
    padding: 15px;
    border: 1px solid rgba(255,255,255,0.05);
    cursor: grab;
    transition: 0.3s;
}
.task-item:hover {
    border-color: var(--purple);
    transform: translateX(-5px);
}
.task-user {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.task-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.65rem;
    text-transform: uppercase;
}
/* تأمين مساحة السحب حتى لو العمود فاضي */
.task-list {
    min-height: 150px; /* طول مناسب للسحب */
    padding: 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    transition: background 0.3s;
}

/* تأثير بصري عند السحب فوق عمود */
.task-list.sortable-chosen {
    background: rgba(124, 58, 237, 0.05);
}

/* شكل الكارت وهو بيتحرك */
.sortable-ghost {
    opacity: 0.4;
    border: 2px dashed var(--purple) !important;
    background: rgba(124, 58, 237, 0.1) !important;
}

.task-item {
    cursor: grab !important; /* شكل اليد للسحب */
    user-select: none;
}

.task-item:active {
    cursor: grabbing !important;
}
        /* =========================================================
        تظبيط نوافذ الإيميل والأدوات للشاشات الصغيرة (Mobile Modals Fix)
        ========================================================= */

        /* تعديلات عامة لجميع النوافذ المنبثقة لضمان عدم خروجها عن الشاشة */
        .modal-box {
            width: 95% !important;
            max-height: 90vh !important;
            overflow-y: auto !important;
        }

        @media (max-width: 768px) {
            /* تصغير الهوامش الداخلية في الموبايل */
            .modal-box {
                padding: 20px 15px !important; 
            }

            /* تعديل نافذة الإيميل */
            #email-modal .modal-header {
                flex-direction: column;
                align-items: flex-start !important;
                gap: 15px;
                font-size: 1.2rem !important;
                margin-bottom: 20px !important;
                padding-bottom: 15px !important;
            }

            #email-modal .modal-header > div {
                width: 100%;
                justify-content: space-between;
            }

            /* جعل حقول الإيميل والباسورد تحت بعضها بدلاً من بجانب بعضها */
            #email-modal .form-grid,
            #email-modal > .modal-box > div[style*="display: grid"] { 
                grid-template-columns: 1fr !important; 
                gap: 10px !important;
            }

            #email-modal .form-group {
                margin-bottom: 15px !important;
            }
            
            #email-modal .c-input {
                padding: 12px 15px !important; /* تصغير حجم الحقول قليلاً */
            }

            /* تعديل نافذة الأدوات */
            #tools-modal .modal-header {
                font-size: 1.2rem !important;
            }

            #tools-modal .stat-card {
                padding: 10px !important;
            }
            
            #tools-modal .stat-icon {
                width: 35px !important;
                height: 35px !important;
                font-size: 1rem !important;
            }
        }

        .active-carts-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: 15px;
        }

        .ghost-card {
            background: rgba(255, 0, 255, 0.05);
            border: 1px solid rgba(255, 0, 255, 0.2);
            border-radius: 12px;
            padding: 15px;
            position: relative;
            overflow: hidden;
            transition: 0.3s;
        }

            .ghost-card:hover {
                transform: translateY(-3px);
                box-shadow: 0 0 20px rgba(255, 0, 255, 0.15);
                border-color: #ff00ff;
            }

        .ghost-head {
            display: flex;
            justify-content: space-between;
            font-size: 0.9rem;
            margin-bottom: 10px;
            color: #ff00ff;
            font-weight: bold;
        }

        .ghost-item {
            display: flex;
            gap: 10px;
            margin-bottom: 8px;
            background: rgba(0,0,0,0.2);
            padding: 8px;
            border-radius: 8px;
            align-items: center;
        }

            .ghost-item img {
                width: 30px;
                height: 30px;
                border-radius: 6px;
                object-fit: cover;
            }

        .ghost-actions {
            margin-top: 10px;
            display: flex;
            gap: 5px;
        }

        @keyframes ghost-pulse {
            0% {
                box-shadow: 0 0 0 0 rgba(255, 0, 255, 0.4);
            }

            70% {
                box-shadow: 0 0 0 10px rgba(255, 0, 255, 0);
            }

            100% {
                box-shadow: 0 0 0 0 rgba(255, 0, 255, 0);
            }
        }

        .live-user-dot {
            width: 10px;
            height: 10px;
            background: #0f0;
            border-radius: 50%;
            box-shadow: 0 0 5px #0f0;
            animation: pulse 1s infinite;
        }

        /* تنسيق الحاوية الأساسية */
        .sticky-note-container {
            position: fixed;
            bottom: 80px; /* مرفوع شوية عشان الزر العائم */
            left: 20px;
            width: 280px;
            height: 300px;
            background: #fff9c4; /* لون أصفر فاتح زي الستيكي نوت */
            border-radius: 12px;
            box-shadow: 0 10px 40px rgba(0,0,0,0.4);
            z-index: 10000;
            display: flex;
            flex-direction: column;
            transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* انيميشن ناعم */
            overflow: hidden;
            border: 1px solid rgba(0,0,0,0.1);
        }

        /* تنسيق الهيدر */
        .note-header {
            background: rgba(0,0,0,0.05);
            padding: 10px 15px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            cursor: move; /* شكل الماوس يدل على السحب */
            border-bottom: 1px solid rgba(0,0,0,0.05);
            color: #444;
            font-weight: bold;
            font-family: 'Cairo', sans-serif;
        }

        /* أزرار التحكم */
        .note-controls i {
            cursor: pointer;
            margin-left: 8px;
            transition: 0.2s;
            padding: 5px;
            border-radius: 50%;
        }

            .note-controls i:hover {
                background: rgba(0,0,0,0.1);
                color: #000;
            }

        /* مكان الكتابة */
        .note-body {
            flex: 1;
            width: 100%;
            background: transparent;
            border: none;
            resize: none;
            padding: 15px;
            font-family: 'Tajawal', sans-serif;
            font-size: 1rem;
            line-height: 1.5;
            color: #333;
            outline: none;
        }

        /* --- حالات الورقة (Classes) --- */

        /* 1. حالة التصغير (Minimize) */
        .sticky-note-container.minimized {
            height: 45px !important; /* ارتفاع الهيدر بس */
            width: 200px !important;
            bottom: 20px;
        }

        /* 2. حالة التكبير (Maximize) */
        .sticky-note-container.maximized {
            width: 80% !important;
            height: 80% !important;
            bottom: 10% !important;
            left: 10% !important;
            border-radius: 20px;
            box-shadow: 0 0 100px rgba(0,0,0,0.7);
        }
        /* =========================================================
        تظبيط نافذة المنتجات للشاشات الصغيرة (Mobile Modal Fix)
        ========================================================= */
        #product-modal .modal-box {
            width: 95% !important;
            max-width: 600px !important; /* تصغير العرض قليلاً */
            max-height: 85vh !important; /* أقصى طول للنافذة 85% من الشاشة */
            overflow-y: auto !important; /* عمل سكرول داخلي إذا كثرت الخانات */
            padding: 25px !important; /* تقليل الهوامش الداخلية */
        }

        /* تعديلات مخصصة للموبايل فقط */
        @media (max-width: 768px) {
            #product-modal .modal-box {
                padding: 15px !important; /* مساحة أكبر للبيانات في الموبايل */
            }

            #product-modal .form-grid {
                grid-template-columns: 1fr !important; /* جعل الخانات تحت بعضها */
                gap: 12px !important; /* تقليل المسافة بين الخانات */
            }

            /* إلغاء تمدد حقل الاسم في الموبايل ليناسب الشاشة */
            #product-modal #p-title {
                grid-column: span 1 !important; 
            }

            #product-modal .modal-header {
                font-size: 1.1rem !important;
                margin-bottom: 15px !important;
                padding-bottom: 10px !important;
            }

            #product-modal .btn-action {
                padding: 12px !important;
                font-size: 0.95rem !important;
            }
        }

/* =========================================================
   📱 ترقيات الموبايل الأسطورية (MOBILE ULTRA OPTIMIZATION)
   ========================================================= */

@media (max-width: 1024px) {
    /* 1. ضبط المسافات الآمنة للمحتوى الرئيسي */
    .main-content {
        padding: 90px 15px 110px 15px !important; /* مساحة للهيدر فوق وشريط التنقل تحت */
        height: 100vh;
        overflow-y: auto;
        overflow-x: hidden;
    }

    /* 2. التوزيع الذكي للأزرار العائمة (منع التداخل) */
    /* زر الانتقال السريع (يمين) */
#quick-actions-trigger {
        bottom: 115px !important; /* زودنا الرقم عشان يترفع لفوق وميغطيش على القائمة السفلية */
        right: 15px !important;
        width: 50px !important;
        height: 50px !important;
        font-size: 20px !important;
    }
    
    /* زر اللايف شات (يسار) */
/* زر اللايف شات (يسار) */
    #live-chat-button {
        bottom: 115px !important; /* 🚀 رفعنا الزرار عشان يبقى قصاد زرار الانتقال السريع */
        left: 15px !important;
        right: auto !important;
        width: 50px !important;
        height: 50px !important;
        font-size: 20px !important;
    }

    /* زر الملاحظات (يسار - فوق اللايف شات) */
    button[onclick*="sticky-notes"] {
        bottom: 145px !important; 
        left: 15px !important;
        width: 45px !important;
        height: 45px !important;
    }

    /* 3. تظبيط النوافذ المنبثقة (Modals) لتناسب شاشة الهاتف */
    .modal-box {
        width: 95% !important;
        max-height: 85vh !important;
        overflow-y: auto !important;
        padding: 20px 15px !important;
        border-radius: 15px !important;
    }
    
    /* رأس النافذة المنبثقة */
    .modal-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 10px;
    }
    
    .modal-header .close-modal {
        position: absolute;
        top: 15px;
        left: 15px;
        background: rgba(239, 68, 68, 0.1);
        color: var(--red);
    }

    /* جعل حقول الإدخال تحت بعضها */
    .form-grid, #email-modal > .modal-box > div[style*="display: grid"] {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    
    .header-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
}

@media (max-width: 768px) {
    /* =======================================
       🌟 السحر الحقيقي: تحويل الجداول لكروت 🌟
       ======================================= */
    
    /* إخفاء عناوين الجدول العلوية */
    .custom-table thead {
        display: none !important;
    }

    /* تحويل الجدول لعناصر بلوك */
    .custom-table, .custom-table tbody, .custom-table tr, .custom-table td {
        display: block !important;
        width: 100% !important;
    }

    /* تصميم الصف كأنه كارت منفصل */
    .custom-table tr {
        background: rgba(25, 25, 35, 0.8) !important;
        margin-bottom: 15px !important;
        border-radius: 15px !important;
        border: 1px solid rgba(124, 58, 237, 0.2) !important;
        padding: 15px !important;
        box-shadow: 0 5px 15px rgba(0,0,0,0.2) !important;
        position: relative;
    }

    /* تصميم الخلايا داخل الكارت */
    .custom-table td {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        text-align: left !important;
        padding: 10px 0 !important;
        border-bottom: 1px dashed rgba(255,255,255,0.05) !important;
        font-size: 0.95rem !important;
    }

    /* إزالة الخط السفلي من آخر خلية وتوسيط الأزرار */
    .custom-table td:last-child {
        border-bottom: none !important;
        padding-bottom: 0 !important;
        justify-content: center !important;
        margin-top: 10px;
    }

    /* تظبيط أزرار الأكشن داخل الجداول في الموبايل */
    .custom-table td:last-child > div {
        flex-direction: row !important;
        flex-wrap: wrap;
        justify-content: center !important;
        gap: 8px !important;
        width: 100%;
    }

    /* أزرار التحكم في طلبات الموبايل: صف أفقي بدل العمود الرأسي */
    #section-orders .custom-table td:last-child {
        width: 100% !important;
        min-width: 0 !important;
        padding: 10px 0 0 !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    #section-orders .custom-table td:last-child > div {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 6px !important;
        width: max-content !important;
        min-width: 100% !important;
        max-width: none !important;
    }

    .custom-table .icon-btn {
        width: 42px !important;
        height: 42px !important;
        font-size: 1.1rem !important;
    }

    /* إضافة عناوين للخلايا (Labels) تلقائياً عبر CSS */
    
    /* 1. جدول الطلبات */
    #orders-body td:nth-child(1)::before { content: "تحديد:"; color: var(--text-muted); font-size: 0.85rem; font-weight: bold; }
    #orders-body td:nth-child(3)::before { content: "العميل:"; color: var(--text-muted); font-size: 0.85rem; font-weight: bold; }
    #orders-body td:nth-child(4)::before { content: "المنتج:"; color: var(--text-muted); font-size: 0.85rem; font-weight: bold; }
    #orders-body td:nth-child(5)::before { content: "السعر:"; color: var(--text-muted); font-size: 0.85rem; font-weight: bold; }
    #orders-body td:nth-child(6)::before { content: "التاريخ:"; color: var(--text-muted); font-size: 0.85rem; font-weight: bold; }
    #orders-body td:nth-child(7)::before { content: "التفاصيل:"; color: var(--text-muted); font-size: 0.85rem; font-weight: bold; }
    #orders-body td:nth-child(8)::before { content: "الحالة:"; color: var(--text-muted); font-size: 0.85rem; font-weight: bold; }
    
    /* 2. جدول العملاء */
    #users-body td:nth-child(1) { display: none !important; } /* إخفاء رقم التسلسل */
    #users-body td:nth-child(2)::before { content: "الصورة:"; color: var(--text-muted); font-size: 0.85rem; font-weight: bold; }
    #users-body td:nth-child(3)::before { content: "الاسم:"; color: var(--text-muted); font-size: 0.85rem; font-weight: bold; }
    #users-body td:nth-child(4)::before { content: "الإيميل:"; color: var(--text-muted); font-size: 0.85rem; font-weight: bold; }
    #users-body td:nth-child(5)::before { content: "الطلبات:"; color: var(--text-muted); font-size: 0.85rem; font-weight: bold; }

    /* 3. جدول المحافظ */
    #wallets-body td:nth-child(1)::before { content: "العميل:"; color: var(--text-muted); font-size: 0.85rem; font-weight: bold; }
    #wallets-body td:nth-child(2)::before { content: "الإيميل:"; color: var(--text-muted); font-size: 0.85rem; font-weight: bold; }
    #wallets-body td:nth-child(3)::before { content: "الرصيد:"; color: var(--text-muted); font-size: 0.85rem; font-weight: bold; }
    #wallets-body td:nth-child(4)::before { content: "آخر تحديث:"; color: var(--text-muted); font-size: 0.85rem; font-weight: bold; }

    /* =======================================
       تنظيمات أخرى للشاشات الصغيرة
       ======================================= */
    
    /* شبكة الإحصائيات (كارتين جنب بعض بدل واحد) */
    .stats-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
    }
    
    /* قائمة الانتقال السريع (Quick Actions) - 3 في الصف */
    .quick-actions-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 8px !important;
    }
    .qa-btn {
        padding: 12px 5px !important;
    }
    .qa-btn i {
        font-size: 1.5rem !important;
    }
    .qa-btn span {
        font-size: 0.75rem !important;
    }
    
    /* لوحة المهام (Kanban) */
    .task-column {
        min-height: auto !important;
        margin-bottom: 20px;
    }
}

/* للشاشات الصغيرة جداً جداً */
@media (max-width: 400px) {
    .stats-grid {
        grid-template-columns: 1fr !important;
    }
    .quick-actions-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* ستايل رسايل الخزنة المركزية */
.vault-msg {
    background: rgba(255, 255, 255, 0.05);
    padding: 12px 15px;
    border-radius: 8px;
    border-right: 3px solid var(--gold);
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideInUp 0.3s ease;
}

.vault-msg-content {
    color: white;
    font-family: monospace;
    font-size: 1.1rem;
    letter-spacing: 1px;
    word-break: break-all;
}

.vault-msg-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 5px;
    font-family: 'Cairo', sans-serif;
}

.vault-msg-actions {
    display: flex;
    gap: 15px;
    color: #aaa;
    font-size: 1.1rem;
}

.vault-msg-actions i {
    cursor: pointer;
    transition: 0.2s;
}

.vault-msg-actions .fa-copy:hover { color: var(--green); transform: scale(1.2); }
.vault-msg-actions .fa-trash-alt:hover { color: var(--red); transform: scale(1.2); }

/* ستايل عناصر الرادار */
.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    border-right: 3px solid transparent;
    transition: 0.3s;
}

.activity-item:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(-5px);
}

.activity-icon-box {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.9rem;
}

.activity-info {
    flex: 1;
}

.activity-user {
    font-weight: bold;
    color: #fff;
    font-size: 0.85rem;
}

.activity-text {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 2px;
}

.activity-time {
    font-size: 0.7rem;
    color: #555;
    white-space: nowrap;
}
/* تنسيق الرابط المولد */
#generatedLink {
    cursor: pointer; /* بيخلي الماوس يتحول لإيد */
    color: var(--neon-blue); /* لون مميز */
    text-decoration: underline; /* خط تحت الكلام */
    transition: 0.3s;
}

#generatedLink:hover {
    color: var(--purple); /* لونه يتغير لما يقرب منه */
    text-shadow: 0 0 10px var(--purple-glow); /* وهج بسيط */
}

/* زر الذكاء الاصطناعي العائم في المنتصف */
#general-ai-btn {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #10b981, #059669); /* لون أخضر زمردي مميز */
    color: white;
    width: 65px;
    height: 65px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
    z-index: 9998;
    border: none;
    transition: all 0.3s ease;
    animation: float 4s ease-in-out infinite;
}

#general-ai-btn:hover {
    transform: translateX(-50%) scale(1.1);
    box-shadow: 0 12px 35px rgba(16, 185, 129, 0.6);
}

/* تنسيق منطقة الرد في نافذة الذكاء الاصطناعي */
#ai-response-area {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 12px;
    padding: 15px;
    margin-top: 15px;
    min-height: 100px;
    max-height: 250px;
    overflow-y: auto;
    color: #e2e8f0;
    font-size: 1rem;
    line-height: 1.6;
    display: none;
    white-space: pre-wrap;
}

@media (max-width: 1024px) {
    
    /* 1. تصغير ورفع زراير التحكم اللي جوه الملاحظة (اللي إنت باعت كودها) */
    .note-controls i {
        font-size: 0.85rem !important; /* تصغير حجم الأيقونة */
        padding: 4px !important; /* تصغير المساحة حوالين الأيقونة */
        margin-top: -5px !important; /* رفع الزراير لفوق شوية */
    }

    /* 2. تصغير ورفع الزرار العائم (القلم) اللي بيفتح الملاحظات عشان ميتداخلش مع اللايف شات */
    button[onclick*="sticky-notes"] {
        bottom: 175px !important; /* رفعناه لفوق بمسافة ممتازة */
        width: 40px !important; /* صغرنا العرض */
        height: 40px !important; /* صغرنا الطول */
        font-size: 16px !important; /* صغرنا حجم القلم اللي جواه */
    }
    
    /* (اختياري) لو حابب تصغر حجم نافذة الملاحظات نفسها في الموبايل وترفعها شوية */
    .sticky-note-container {
        bottom: 100px !important; /* رفعناها عن الشريط السفلي */
        width: 250px !important; /* صغرنا عرضها */
        height: 250px !important; /* صغرنا طولها */
    }
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    50% { transform: scale(1.08); box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}

.badge-new {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 50px;
    margin-right: 8px;
    animation: badgePulse 1.5s ease-in-out infinite;
}

.badge-stale {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.4);
    font-size: 0.7rem;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 50px;
    margin-right: 8px;
}

.order-row.is-stale td {
    background: rgba(245, 158, 11, 0.04) !important;
    border-top: 1px solid rgba(245, 158, 11, 0.2) !important;
    border-bottom: 1px solid rgba(245, 158, 11, 0.2) !important;
}

.customer-name-link {
    cursor: pointer;
    transition: 0.2s;
    border-bottom: 1px dashed transparent;
}
.customer-name-link:hover {
    color: var(--purple) !important;
    border-bottom-color: var(--purple);
}

.customer-orders-count {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: rgba(124, 58, 237, 0.15);
    color: var(--purple);
    font-size: 0.7rem;
    font-weight: bold;
    padding: 1px 7px;
    border-radius: 50px;
    margin-right: 6px;
    border: 1px solid rgba(124, 58, 237, 0.3);
}

@keyframes firstTimeShine {
    0%, 100% { box-shadow: 0 0 5px rgba(16, 185, 129, 0.4); }
    50% { box-shadow: 0 0 12px rgba(16, 185, 129, 0.8); }
}

.badge-first-time {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 50px;
    margin-right: 8px;
    animation: firstTimeShine 2s ease-in-out infinite;
}

/* 🚀 تظبيط زر الـ X (الخروج من الشات) للموبايل عشان ميبقاش فوق الصح 🚀 */
@media (max-width: 768px) {
    .close-live-chat {
        position: absolute !important;
        top: 85px !important; /* نزلناه تحت هيدر الشات */
        right: 15px !important;
        z-index: 999999 !important;
        background: var(--danger, #ef4444) !important;
        color: white !important;
        width: 40px !important;
        height: 40px !important;
        border-radius: 50% !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        border: 2px solid rgba(255,255,255,0.2) !important;
        box-shadow: 0 4px 15px rgba(0,0,0,0.5) !important;
    }
}

/* ✅ السماح بتحديد ونسخ نص الرسائل على الموبايل */
.message,
.message-content,
.sender-name,
.msg-reply-quote,
.quote-text {
    -webkit-user-select: text !important;
    user-select: text !important;
    -webkit-touch-callout: default !important;
}

/* خلي أزرار الأكشن نفسها مش بتتحدد كنص */
.msg-actions-bar,
.msg-actions-bar *,
.msg-action-emoji,
.msg-action-reply,
.chat-action-btn,
.send-btn {
    -webkit-user-select: none !important;
    user-select: none !important;
}

/* ===== ضبط البراند وبيانات الموظف بشكل مضغوط ومتوسط ===== */

.sidebar .brand {
    padding: 8px 10px 4px !important;
    margin-bottom: 0 !important;
    gap: 10px !important;
    justify-content: center !important;
    align-items: center !important;
}

/* لوجو Berlin Store فقط */
.sidebar .brand > img {
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    min-height: 42px !important;
    padding: 3px !important;
}

/* النصوص في النص */
.sidebar .brand-text {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    line-height: 1 !important;
}

.sidebar .brand-text h3 {
    margin: 0 !important;
    font-size: 1rem !important;
    line-height: 1.1 !important;
}

.sidebar .brand-text > span {
    font-size: 0.68rem !important;
    line-height: 1 !important;
    letter-spacing: 1px !important;
}

/* بيانات الموظف */
.sidebar .admin-profile-mini {
    margin: 6px auto 0 !important;
    padding: 3px 8px !important;
    height: 30px !important;
    max-width: 160px !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 7px !important;

    border-radius: 999px !important;
    background: rgba(124, 58, 237, 0.12) !important;
    border: 1px solid rgba(124, 58, 237, 0.28) !important;
    box-sizing: border-box !important;
}

/* صورة الموظف تحديدًا */
.sidebar .admin-profile-mini .admin-avatar {
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    min-height: 24px !important;

    border-radius: 50% !important;
    object-fit: cover !important;
    padding: 0 !important;
    border: 1.5px solid var(--purple) !important;
    background: rgba(124, 58, 237, 0.15) !important;
    box-shadow: 0 0 8px rgba(124, 58, 237, 0.35) !important;
}

/* اسم الموظف */
.sidebar .admin-profile-mini span {
    font-size: 0.76rem !important;
    font-weight: 800 !important;
    color: #fff !important;
    line-height: 1 !important;

    max-width: 105px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

.sidebar-nav-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 7px !important;
    padding: 5px 12px 12px !important;
}

.sidebar-nav-list .nav-btn {
    padding: 9px 12px !important;
    min-height: 38px !important;
}

/* ✅ Quick Actions يظهر في الموبايل فقط */
#quick-actions-trigger {
    display: none !important;
}

@media (max-width: 1024px) {
    #quick-actions-trigger {
        display: flex !important;
    }
}

/* ✅ كلمة متصل تروح شمال */
.connection-status {
    left: 70px !important;
    right: auto !important;
}

#live-chat-modal {
    position: fixed !important;
    z-index: 99999 !important;
}

#live-chat-modal .live-chat-container {
    position: relative !important;
    z-index: 1 !important;
}

#live-chat-iframe {
    position: relative !important;
    z-index: 1 !important;
}

#customer-profile-modal {
    position: absolute !important;
    inset: 0 !important;
    z-index: 999999999 !important;
    background: rgba(0, 0, 0, 0.88) !important;
    align-items: center !important;
    justify-content: center !important;
}

#customer-profile-modal .modal-box {
    position: relative !important;
    z-index: 1000000000 !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
}

/* =========================================================
   📱 Customer Profile Modal - Mobile Responsive Fix
   ========================================================= */

/* تأمين المودال فوق اللايف شات */
#customer-profile-modal {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 999999999 !important;
    background: rgba(0, 0, 0, 0.88) !important;
    display: none;
    align-items: center !important;
    justify-content: center !important;
    padding: 16px !important;
    box-sizing: border-box !important;
}

/* البوكس الأساسي */
#customer-profile-modal .modal-box {
    width: min(850px, 96vw) !important;
    max-width: 850px !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    background: #0f0f19 !important;
    border: 1px solid var(--purple) !important;
    border-radius: 18px !important;
    box-sizing: border-box !important;
}

/* الهيدر يفضل ثابت وانت بتسكرول */
#customer-profile-modal .modal-header {
    position: sticky !important;
    top: 0 !important;
    z-index: 5 !important;
    background: #0f0f19 !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 12px !important;
}

/* زرار القفل */
#customer-profile-modal .close-modal {
    flex-shrink: 0 !important;
    width: 38px !important;
    height: 38px !important;
    border-radius: 50% !important;
    background: rgba(239, 68, 68, 0.14) !important;
    color: #fff !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.6rem !important;
    line-height: 1 !important;
}

/* =========================================================
   📱 موبايل / تابلت
   ========================================================= */
@media (max-width: 768px) {

    #customer-profile-modal {
        padding: 10px !important;
        align-items: stretch !important;
        justify-content: center !important;
    }

    #customer-profile-modal .modal-box {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: calc(100dvh - 20px) !important;
        border-radius: 16px !important;
        padding: 12px !important;
    }

    #customer-profile-modal .modal-header {
        padding: 10px 4px 12px !important;
        margin-bottom: 10px !important;
    }

    #customer-profile-modal .modal-header span:first-child {
        font-size: 1rem !important;
        line-height: 1.3 !important;
    }

    /* الجريد اللي جوه profile-content يتحول لعمود واحد */
    #profile-content > div {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 14px !important;
        margin-top: 10px !important;
        width: 100% !important;
    }

    /* كارت بيانات العميل */
    #profile-content > div > div:first-child {
        padding: 14px !important;
        border-radius: 14px !important;
        width: 100% !important;
    }

    #profile-content img {
        width: 78px !important;
        height: 78px !important;
        margin-bottom: 10px !important;
    }

    #profile-content h3 {
        font-size: 1.05rem !important;
        line-height: 1.3 !important;
        word-break: break-word !important;
    }

    #profile-content p {
        font-size: 0.78rem !important;
        line-height: 1.4 !important;
    }

    /* بادجات العميل */
    #profile-content > div > div:first-child > div[style*="flex-wrap"] {
        gap: 6px !important;
        margin-bottom: 14px !important;
    }

    #profile-content > div > div:first-child > div[style*="flex-wrap"] span {
        font-size: 0.68rem !important;
        padding: 3px 7px !important;
    }

    /* بوكس المحفظة والمشتريات */
    #profile-content > div > div:first-child > div[style*="text-align:right"] {
        padding: 12px !important;
    }

    /* زر إرسال عرض خاص */
    #profile-content .btn-action {
        width: 100% !important;
        padding: 12px !important;
        font-size: 0.9rem !important;
        margin-top: 12px !important;
    }

    /* ليستة الطلبات */
    #profile-content > div > div:last-child {
        max-height: none !important;
        overflow: visible !important;
        padding-left: 0 !important;
        width: 100% !important;
    }

    #profile-content > div > div:last-child h4 {
        font-size: 0.95rem !important;
        margin: 4px 0 10px !important;
        flex-wrap: wrap !important;
    }

    /* كارت كل طلب */
    #profile-content > div > div:last-child > div {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
        padding: 12px !important;
        border-radius: 12px !important;
        margin-bottom: 10px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* بيانات المنتج */
    #profile-content > div > div:last-child > div > div:first-child {
        width: 100% !important;
        min-width: 0 !important;
    }

    #profile-content > div > div:last-child > div > div:first-child div:first-child {
        font-size: 0.88rem !important;
        line-height: 1.4 !important;
        word-break: break-word !important;
    }

    #profile-content > div > div:last-child > div > div:first-child div:last-child {
        font-size: 0.72rem !important;
        line-height: 1.5 !important;
        word-break: break-word !important;
    }

    /* السعر والحالة */
    #profile-content > div > div:last-child > div > div:last-child {
        width: 100% !important;
        text-align: right !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        gap: 10px !important;
        padding-top: 8px !important;
        border-top: 1px solid rgba(255,255,255,0.06) !important;
    }

    #profile-content > div > div:last-child > div > div:last-child div {
        font-size: 0.82rem !important;
        white-space: nowrap !important;
    }
}

/* موبايلات صغيرة جدًا */
@media (max-width: 380px) {
    #customer-profile-modal {
        padding: 6px !important;
    }

    #customer-profile-modal .modal-box {
        max-height: calc(100dvh - 12px) !important;
        padding: 10px !important;
        border-radius: 14px !important;
    }

    #customer-profile-modal .modal-header span:first-child {
        font-size: 0.9rem !important;
    }

    #profile-content img {
        width: 68px !important;
        height: 68px !important;
    }

    #profile-content > div > div:last-child > div > div:last-child {
        flex-direction: column !important;
        align-items: flex-start !important;
    }
}

/* ==========================================
   ✅ Daily Tasks Widget - PC Only
========================================== */

.daily-tasks-widget {
    position: fixed;
    top: 85px;
    left: 18px;
    width: 330px;
    background: rgba(15, 15, 25, 0.94);
    border: 1px solid rgba(124, 58, 237, 0.35);
    border-radius: 18px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(18px);
    z-index: 9000;
    overflow: hidden;
    font-family: 'Tajawal', sans-serif;
}

.daily-tasks-header h3 i {
    color: var(--gold, #FFD700);
}

.daily-tasks-header button {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.08);
    color: white;
    transition: 0.2s;
}

.daily-tasks-header button:hover {
    background: rgba(124, 58, 237, 0.35);
}

.daily-task-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 11px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    color: #e5e7eb;
    font-size: 0.83rem;
    cursor: pointer;
    transition: 0.2s;
}

.daily-task-item.done span {
    text-decoration: line-through;
    color: #10b981;
}

.daily-tasks-actions {
    margin-top: 4px;
}

.daily-tasks-actions button:hover {
    background: rgba(239, 68, 68, 0.16);
}

/* ✅ مخفي تمامًا من الموبايل والتابلت */
@media (max-width: 1024px) {
    .daily-tasks-widget {
        display: none !important;
    }
}

/* ✅ Daily Task Item with Open Button */

.daily-task-item {
    display: grid !important;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 8px;
}

.daily-task-item label span {
    line-height: 1.4;
}

/* لما المهمة تتعمل check */
.daily-task-item.done .daily-task-open-btn {
    opacity: 0.55;
}

/* ==========================================
   ✅ Daily Tasks Floating Icon + Panel - PC Only
========================================== */

.daily-tasks-fab {
    position: fixed;
    bottom: 20px;
    left: 70px; /* جنب زرار الملاحظات */
    z-index: 9998;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #7c3aed, #00d4ff);
    color: white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.25);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: 0.2s ease;
}

.daily-tasks-fab:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 22px rgba(124, 58, 237, 0.35);
}

#daily-tasks-fab-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #ef4444;
    color: white;
    font-size: 0.68rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #111827;
}

/* البوكس نفسه يفتح فوق الأيقونة */
.daily-tasks-widget {
    position: fixed;
    bottom: 72px;
    left: 20px;
    width: 350px;
    background: rgba(15, 15, 25, 0.96);
    border: 1px solid rgba(124, 58, 237, 0.35);
    border-radius: 18px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(18px);
    z-index: 9997;
    overflow: hidden;
    font-family: 'Tajawal', sans-serif;
}

.daily-tasks-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 15px;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.22), rgba(0, 212, 255, 0.08));
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.daily-tasks-header h3 {
    margin: 0;
    color: white;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.daily-tasks-header h3 i {
    color: #00d4ff;
}

.daily-tasks-header span {
    display: block;
    margin-top: 4px;
    color: var(--text-muted, #aaa);
    font-size: 0.75rem;
}

.daily-tasks-header button {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
    transition: 0.2s;
}

.daily-tasks-header button:hover {
    background: rgba(239, 68, 68, 0.25);
}

.daily-tasks-progress {
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.daily-tasks-progress-info {
    display: flex;
    justify-content: space-between;
    color: #ddd;
    font-size: 0.8rem;
    margin-bottom: 8px;
}

.daily-tasks-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    overflow: hidden;
}

#daily-tasks-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #7c3aed, #00d4ff);
    border-radius: 999px;
    transition: width 0.3s ease;
}

.daily-tasks-body {
    padding: 12px;
    display: grid;
    gap: 8px;
}

.daily-task-item {
    display: grid !important;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 8px;
    padding: 10px 11px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    color: #e5e7eb;
    font-size: 0.83rem;
    transition: 0.2s;
}

.daily-task-item:hover {
    background: rgba(124, 58, 237, 0.12);
    border-color: rgba(124, 58, 237, 0.35);
}

.daily-task-item label {
    display: flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    min-width: 0;
}

.daily-task-item input {
    width: 17px;
    height: 17px;
    accent-color: #7c3aed;
    cursor: pointer;
    flex-shrink: 0;
}

.daily-task-item.done {
    opacity: 0.75;
}

.daily-task-item.done label span {
    text-decoration: line-through;
    color: #10b981;
}

.daily-task-open-btn {
    border: 1px solid rgba(0, 212, 255, 0.35);
    background: rgba(0, 212, 255, 0.10);
    color: #00d4ff;
    border-radius: 9px;
    padding: 6px 9px;
    cursor: pointer;
    font-family: 'Tajawal', sans-serif;
    font-size: 0.75rem;
    white-space: nowrap;
    transition: 0.2s ease;
}

.daily-task-open-btn:hover {
    background: rgba(0, 212, 255, 0.20);
    transform: translateX(-2px);
}

.daily-tasks-actions button {
    width: 100%;
    border: 1px solid rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.08);
    color: #ef4444;
    border-radius: 11px;
    padding: 9px 10px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.82rem;
    transition: 0.2s;
}

/* ✅ مخفي تمامًا من الموبايل والتابلت */
@media (max-width: 1024px) {
    .daily-tasks-widget,
    .daily-tasks-fab {
        display: none !important;
    }
}

/* =========================================================
   Support Ticket Modal - New One Screen Layout
========================================================= */

@media (min-width: 769px) {
    #support-mail-modal.support-ticket-overlay {
        align-items: center !important;
        justify-content: center !important;
        padding: 14px !important;
    }

    #support-mail-modal .support-ticket-box {
        width: min(1350px, 96vw) !important;
        height: calc(100vh - 28px) !important;
        max-width: 1350px !important;
        max-height: calc(100vh - 28px) !important;

        padding: 16px !important;
        display: grid !important;
        grid-template-rows: auto minmax(0, 1fr) !important;
        gap: 12px !important;

        overflow: hidden !important;
        border-radius: 22px !important;
    }

    #support-mail-modal .support-ticket-header {
        margin: 0 !important;
        padding-bottom: 12px !important;
        flex-shrink: 0 !important;
    }

    .support-ticket-layout {
        min-height: 0 !important;
        height: 100% !important;

        display: grid !important;
        grid-template-columns: 310px minmax(0, 1fr) !important;
        gap: 14px !important;
        overflow: hidden !important;
    }

    .support-ticket-side {
        min-height: 0 !important;
        overflow-y: auto !important;

        background: rgba(255, 255, 255, 0.035) !important;
        border: 1px solid rgba(255, 255, 255, 0.08) !important;
        border-radius: 18px !important;
        padding: 14px !important;
    }

    .support-side-title {
        color: var(--gold) !important;
        font-weight: 900 !important;
        font-size: 0.95rem !important;
        margin-bottom: 10px !important;

        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
    }

    #support-mail-details {
        margin: 0 !important;
        line-height: 1.45 !important;
    }

    #support-mail-details > div {
        background: transparent !important;
        padding: 0 !important;
        margin: 0 !important;
        border-radius: 0 !important;
    }

    #support-mail-details p {
        margin: 0 0 8px !important;
        padding: 8px 9px !important;

        background: rgba(0, 0, 0, 0.22) !important;
        border: 1px solid rgba(255, 255, 255, 0.06) !important;
        border-radius: 10px !important;

        color: #e5e7eb !important;
        font-size: 0.86rem !important;
        word-break: break-word !important;
    }

    #support-mail-details strong {
        color: var(--neon-blue) !important;
        display: block !important;
        margin-bottom: 3px !important;
        font-size: 0.78rem !important;
    }

    .support-ticket-chat-area {
        min-width: 0 !important;
        min-height: 0 !important;
        height: 100% !important;

        display: grid !important;
        grid-template-rows: minmax(0, 1fr) auto !important;
        gap: 12px !important;
        overflow: hidden !important;
    }

    #support-mail-thread {
        min-height: 0 !important;
        height: 100% !important;
        overflow-y: auto !important;

        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;

        padding: 16px !important;
        background: rgba(0, 0, 0, 0.35) !important;
        border: 1px solid rgba(124, 58, 237, 0.28) !important;
        border-radius: 18px !important;
    }

    .support-ticket-reply-bar {
        min-height: 76px !important;
        flex-shrink: 0 !important;

        display: grid !important;
        grid-template-columns: minmax(0, 1fr) 96px !important;
        gap: 10px !important;
        align-items: stretch !important;

        padding: 10px !important;
        background: rgba(255, 255, 255, 0.035) !important;
        border: 1px solid rgba(255, 255, 255, 0.08) !important;
        border-radius: 16px !important;
    }

    #support-admin-reply {
        width: 100% !important;
        height: 56px !important;
        min-height: 56px !important;
        max-height: 56px !important;

        resize: none !important;
        font-size: 0.95rem !important;
        line-height: 1.5 !important;
        padding: 10px 12px !important;
        margin: 0 !important;
    }

    .support-send-btn {
        height: 56px !important;
        min-height: 56px !important;
        width: 100% !important;

        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 7px !important;

        margin: 0 !important;
        padding: 0 14px !important;
        white-space: nowrap !important;
    }

    #support-mail-thread > div {
        max-width: 76% !important;
        font-size: 0.95rem !important;
        line-height: 1.75 !important;
        word-break: break-word !important;
    }
}

/* موبايل / تابلت: يرجع عمودي بس كل حاجة ظاهرة بسكرول طبيعي */
@media (max-width: 768px) {
    #support-mail-modal.support-ticket-overlay {
        padding: 8px !important;
        align-items: stretch !important;
    }

    #support-mail-modal .support-ticket-box {
        width: 100% !important;
        height: 96vh !important;
        max-height: 96vh !important;
        padding: 12px !important;

        display: grid !important;
        grid-template-rows: auto minmax(0, 1fr) !important;
        overflow: hidden !important;
    }

    .support-ticket-layout {
        min-height: 0 !important;
        display: grid !important;
        grid-template-rows: auto minmax(0, 1fr) !important;
        gap: 10px !important;
        overflow: hidden !important;
    }

    .support-ticket-side {
        max-height: 155px !important;
        overflow-y: auto !important;
        padding: 10px !important;
        border-radius: 14px !important;
        background: rgba(255, 255, 255, 0.035) !important;
        border: 1px solid rgba(255, 255, 255, 0.08) !important;
    }

    #support-mail-details p {
        margin: 0 0 6px !important;
        font-size: 0.78rem !important;
    }

    .support-ticket-chat-area {
        min-height: 0 !important;
        display: grid !important;
        grid-template-rows: minmax(0, 1fr) auto !important;
        gap: 8px !important;
    }

    #support-mail-thread {
        min-height: 0 !important;
        overflow-y: auto !important;
        padding: 10px !important;
        border-radius: 14px !important;
    }

    .support-ticket-reply-bar {
        display: grid !important;
        grid-template-columns: 1fr 72px !important;
        gap: 8px !important;
    }

    #support-admin-reply {
        height: 50px !important;
        min-height: 50px !important;
        max-height: 50px !important;
        resize: none !important;
    }

    .support-send-btn {
        height: 50px !important;
        padding: 0 !important;
    }
}

/* ==========================================
   ⚡ Performance Mode - Low FPS Fix
========================================== */

html.performance-mode,
body.performance-mode {
    --glass: none !important;
    --shadow-lg: none !important;
    --bg-panel: rgba(15, 15, 20, 0.98) !important;
    --bg-card: rgba(22, 22, 30, 0.98) !important;
}

html.performance-mode body,
body.performance-mode {
    background-image: none !important;
    background-color: #0a0a0f !important;
}

/* وقف الأنيميشن والترانزيشن والشادو والبلور */
html.performance-mode *,
html.performance-mode *::before,
html.performance-mode *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
    box-shadow: none !important;
    text-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    filter: none !important;
}

/* خفف الكروت والبانلز */
html.performance-mode .stat-card,
html.performance-mode .glass-panel,
html.performance-mode .modal-box,
html.performance-mode .sidebar,
html.performance-mode .mobile-header,
html.performance-mode .mobile-bottom-nav,
html.performance-mode .daily-tasks-widget,
html.performance-mode .connection-status,
html.performance-mode .login-card {
    background: rgba(15, 15, 22, 0.98) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

/* وقف الحركات اللي من animate.css */
html.performance-mode .animate__animated,
html.performance-mode .animate__infinite {
    animation: none !important;
}

/* خفف اللودر */
html.performance-mode .loader-ring {
    animation: none !important;
    border-top-color: var(--purple) !important;
}

/* زرار السايدبار */
.performance-mode-nav-btn {
    border: 1px solid rgba(16, 185, 129, 0.18) !important;
    color: var(--green) !important;
}

.performance-mode-nav-btn.active-performance {
    background: rgba(16, 185, 129, 0.12) !important;
    color: #10b981 !important;
    border-right: 3px solid #10b981 !important;
}

/* زرار عائم للموبايل والبي سي */
#performance-mode-fab {
    position: fixed;
    left: 20px;
    bottom: 75px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(16, 185, 129, 0.35);
    background: rgba(15, 15, 25, 0.96);
    color: #10b981;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
}

#performance-mode-fab.active-performance {
    background: #10b981;
    color: #06110d;
    border-color: #10b981;
}

@media (max-width: 1024px) {
    #performance-mode-fab {
        bottom: 95px;
        left: 18px;
    }
}

/* ==========================================
   ✅ Fix Black Screen In Performance Mode
========================================== */

html.performance-mode .app-layout {
    opacity: 1 !important;
    animation: none !important;
}

/* خليه ظاهر لما الجافاسكريبت يفتحه */
html.performance-mode #app-layout[style*="display: grid"],
html.performance-mode #app-layout[style*="display: block"] {
    opacity: 1 !important;
}

/* السيكشنات اللي كانت معتمدة على animate.css */
html.performance-mode section,
html.performance-mode .animate__animated,
html.performance-mode .animate__fadeIn {
    opacity: 1 !important;
    visibility: visible !important;
}

/* تأكيد إن المحتوى الرئيسي والسايدبار ظاهرين */
html.performance-mode .main-content,
html.performance-mode .sidebar {
    opacity: 1 !important;
    visibility: visible !important;
}

/* إخفاء زر Performance Mode العائم في الموبايل/اللمس فقط */
@media (max-width: 1024px), (pointer: coarse) {
    #performance-mode-fab,
    #performance-mode-float-btn {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }
}

/* =========================================================
   ✅ Berlin Mobile FPS Boost v2
   الهدف: رفع FPS على الموبايل بدون كسر وظائف الداشبورد
========================================================= */

@media (max-width: 1024px), (pointer: coarse) {
    :root {
        --glass: none !important;
        --shadow-lg: none !important;
        --bg-panel: rgba(15, 15, 22, 0.98) !important;
        --bg-card: rgba(22, 22, 30, 0.98) !important;
        --radius-lg: 18px !important;
        --radius-md: 14px !important;
    }

    html,
    body {
        background-image: none !important;
        background-color: #0a0a0f !important;
        height: 100dvh !important;
        overscroll-behavior: none !important;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }

    .animate__animated,
    .animate__infinite,
    .loader-ring,
    .connection-dot {
        animation: none !important;
    }

    .stat-card,
    .glass-panel,
    .product-card,
    .ad-card,
    .modal-box,
    .sidebar,
    .mobile-header,
    .mobile-bottom-nav,
    .daily-tasks-widget,
    .connection-status,
    .login-card,
    .spotlight-box,
    .chat-container,
    .live-chat-container,
    .table-responsive {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        box-shadow: none !important;
        text-shadow: none !important;
        filter: none !important;
    }

    .login-logo,
    .brand img,
    .admin-avatar,
    .stat-icon,
    .nav-btn i,
    .mobile-nav-btn i,
    .p-img {
        filter: none !important;
    }

    .main-content {
        padding: 72px 12px 84px 12px !important;
        height: 100dvh !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        contain: layout paint style !important;
    }

    .mobile-header {
        padding: 10px 12px !important;
        min-height: 58px !important;
        background: rgba(12, 12, 18, 0.98) !important;
    }

    .mobile-menu-btn {
        width: 42px !important;
        height: 42px !important;
        font-size: 1.15rem !important;
        border-radius: 10px !important;
    }

    .sidebar {
        width: min(86vw, 300px) !important;
        padding: 16px 12px !important;
        background: rgba(12, 12, 18, 0.99) !important;
        transform: none !important;
        will-change: auto !important;
        transition: right 0.24s cubic-bezier(0.4, 0, 0.2, 1) !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    .brand {
        margin-bottom: 20px !important;
        gap: 12px !important;
    }

    .brand img {
        width: 44px !important;
        height: 44px !important;
    }

    .nav-btn {
        padding: 12px 14px !important;
        font-size: 0.95rem !important;
        gap: 12px !important;
        border-radius: 12px !important;
    }

    .header-bar {
        margin-bottom: 18px !important;
        padding-bottom: 12px !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }

    .page-title h1 {
        font-size: 1.45rem !important;
        line-height: 1.35 !important;
    }

    .page-title p {
        font-size: 0.85rem !important;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
    }

    .stat-card {
        padding: 12px !important;
        border-radius: 14px !important;
        gap: 10px !important;
        background: rgba(18, 18, 26, 0.98) !important;
    }

    .stat-icon {
        width: 38px !important;
        height: 38px !important;
        font-size: 1rem !important;
        flex: 0 0 38px !important;
    }

    .stat-info h4,
    .stat-info span {
        font-size: 0.82rem !important;
    }

    .glass-panel {
        padding: 14px !important;
        border-radius: 16px !important;
        background: rgba(16, 16, 24, 0.98) !important;
        margin-bottom: 14px !important;
    }

    .products-container,
    .ad-cards-grid,
    .form-grid,
    .responsive-grid,
    .grid-tools {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .custom-table {
        min-width: 760px !important;
    }

    .custom-table th,
    .custom-table td {
        padding: 8px 6px !important;
        font-size: 0.8rem !important;
    }

    .modal-overlay {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    .modal-box {
        width: calc(100vw - 18px) !important;
        max-width: calc(100vw - 18px) !important;
        max-height: 92dvh !important;
        overflow-y: auto !important;
        padding: 16px !important;
        border-radius: 16px !important;
    }

    #salesChart {
        max-height: 280px !important;
    }

    #live-chat-button,
    #quick-actions-trigger {
        transform: translateZ(0) !important;
        box-shadow: none !important;
    }

    .mobile-bottom-nav {
        background: rgba(12, 12, 18, 0.99) !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    .mobile-nav-btn {
        padding: 8px 3px !important;
        font-size: 0.68rem !important;
    }

    .mobile-nav-btn i {
        font-size: 1.05rem !important;
    }

    @supports (content-visibility: auto) {
        .glass-panel,
        .product-card,
        .ad-card,
        .daily-task-item,
        .vault-msg {
            content-visibility: auto;
            contain-intrinsic-size: 180px;
        }
    }
}

/* Performance mode أقوى من الموبايل العادي */
html.performance-mode .login-logo,
html.performance-mode .brand img,
html.performance-mode .admin-avatar,
html.performance-mode .stat-icon,
html.performance-mode .nav-btn i,
html.performance-mode .mobile-nav-btn i,
html.performance-mode .p-img {
    filter: none !important;
}

html.performance-mode .custom-table th,
html.performance-mode .custom-table td {
    transition: none !important;
}

html.performance-mode .main-content {
    contain: layout paint style !important;
}

/* زر Performance Mode العائم يظل ظاهرًا على الكمبيوتر، ومخفيًا في الموبايل بالقاعدة السابقة. */

@media (max-width: 420px) {
    .stats-grid {
        grid-template-columns: 1fr !important;
    }

    .main-content {
        padding-left: 9px !important;
        padding-right: 9px !important;
    }
}


/* =========================================================
   ✅ Mobile notes + copy/select hotfix
   ========================================================= */
#open-sticky-notes-btn,
button[onclick*="sticky-notes"] {
    z-index: 100000 !important;
    touch-action: manipulation !important;
    -webkit-user-select: none !important;
    user-select: none !important;
}

.sticky-note-container {
    z-index: 100001 !important;
    pointer-events: auto !important;
}

.note-body,
#admin-notes,
#mail-msg,
input,
textarea {
    -webkit-user-select: text !important;
    user-select: text !important;
    -webkit-touch-callout: default !important;
}

@media (max-width: 1024px), (pointer: coarse) {
    html,
    body,
    .main-content,
    .glass-panel,
    .modal-box,
    #order-details-modal,
    .custom-table td,
    .stat-info,
    .message,
    .message-content,
    .sender-name,
    .msg-reply-quote,
    .quote-text,
    .vault-msg-content,
    #ai-response-area,
    .note-body,
    #admin-notes {
        -webkit-user-select: text !important;
        user-select: text !important;
        -webkit-touch-callout: default !important;
    }

    button,
    button *,
    .icon-btn,
    .icon-btn *,
    .nav-btn,
    .mobile-nav-btn,
    .msg-actions-bar,
    .msg-actions-bar *,
    .chat-action-btn,
    .send-btn {
        -webkit-user-select: none !important;
        user-select: none !important;
    }

    #open-sticky-notes-btn,
    button[onclick*="sticky-notes"] {
        left: 15px !important;
        bottom: 175px !important;
        width: 44px !important;
        height: 44px !important;
        font-size: 17px !important;
    }

    .sticky-note-container {
        left: 12px !important;
        bottom: 230px !important;
        width: min(320px, calc(100vw - 24px)) !important;
        height: min(360px, 45dvh) !important;
        max-height: 70dvh !important;
    }

    .sticky-note-container.maximized {
        left: 8px !important;
        bottom: 8px !important;
        width: calc(100vw - 16px) !important;
        height: calc(100dvh - 16px) !important;
    }
}
/* ============================================================================
   BERLIN COMMANDER V6 — PERFORMANCE + RESPONSIVE MODALS + SECURE VAULT
   ============================================================================ */

/* Lightweight rendering boundaries */
.main-content > section,
.main-content > [id="ad-management"] {
    contain: layout style paint;
}
.product-card,
.physical-order-card,
.stat-card,
.berlin-office-panel,
.berlin-control-card {
    contain: layout paint style;
}
#products-list,
#physical-orders-list,
#auto-deliveries-list,
#manual-inventory-products-list {
    content-visibility: auto;
    contain-intrinsic-size: 700px;
}

/* Avoid unnecessary GPU layers and animation work on lite devices */
.performance-mode *,
.mobile-lite * {
    scroll-behavior: auto !important;
}
.performance-mode .animate__animated,
.mobile-lite .animate__animated,
.performance-mode .loader-ring,
.mobile-lite .loader-ring,
.performance-mode [class*="animate__"],
.mobile-lite [class*="animate__"] {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
}
.performance-mode .glass-panel,
.performance-mode .modal-box,
.performance-mode .sidebar,
.mobile-lite .glass-panel,
.mobile-lite .modal-box,
.mobile-lite .sidebar {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}
.performance-mode .product-card,
.performance-mode .physical-order-card,
.performance-mode .berlin-office-panel,
.mobile-lite .product-card,
.mobile-lite .physical-order-card,
.mobile-lite .berlin-office-panel {
    box-shadow: none !important;
}
.performance-mode body,
.mobile-lite body {
    background-attachment: scroll !important;
}

/* Auto-delivery modal stays inside the viewport */
#auto-delivery-modal {
    align-items: center !important;
    overflow: hidden !important;
    padding: 12px !important;
}
#auto-delivery-modal > .modal-box {
    width: min(760px, 100%) !important;
    max-width: 760px !important;
    max-height: calc(100dvh - 24px) !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    margin: 0 !important;
}
#auto-delivery-modal .modal-header {
    position: sticky;
    top: 0;
    z-index: 5;
    margin: -1px -1px 14px;
    padding: 14px 4px 12px;
    background: rgba(2, 6, 23, 0.96);
    backdrop-filter: blur(10px);
}
#ad-product-search {
    position: sticky;
    top: 58px;
    z-index: 4;
    background: #080f1e !important;
}
#ad-product-select {
    width: 100%;
    min-height: 190px;
    max-height: 260px;
    padding: 5px !important;
    overflow-y: auto;
    background: #07101f !important;
}
#ad-product-select option {
    padding: 10px 11px;
    margin: 3px 0;
    border-radius: 8px;
    white-space: normal;
    line-height: 1.45;
}
#ad-product-select option:checked {
    background: rgba(0, 255, 170, 0.18) linear-gradient(0deg, rgba(0, 255, 170, 0.18), rgba(0, 255, 170, 0.18));
    color: #d1fae5;
}

/* Product flash-sale quick action */
.btn-flash-v6 {
    color: #fbbf24 !important;
    border-color: rgba(251, 191, 36, 0.32) !important;
    background: rgba(251, 191, 36, 0.1) !important;
}
.btn-flash-v6:hover {
    background: rgba(251, 191, 36, 0.2) !important;
}
.berlin-manual-stock-btn {
    color: #67e8f9 !important;
    border-color: rgba(34, 211, 238, 0.32) !important;
    background: rgba(34, 211, 238, 0.1) !important;
}

/* Secure manual inventory */
.berlin-vault-shell {
    --vault-cyan: #22d3ee;
    --vault-green: #34d399;
    --vault-gold: #fbbf24;
    display: grid;
    gap: 14px;
}
.berlin-vault-hero,
.berlin-vault-panel {
    border: 1px solid rgba(34, 211, 238, 0.16);
    border-radius: 17px;
    background: linear-gradient(145deg, rgba(8, 18, 34, 0.96), rgba(2, 6, 23, 0.92));
}
.berlin-vault-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 18px;
}
.berlin-vault-hero h3,
.berlin-vault-panel h4 {
    margin: 0;
    color: #ecfeff;
}
.berlin-vault-hero h3 i,
.berlin-vault-panel h4 i {
    color: var(--vault-cyan);
}
.berlin-vault-hero p {
    max-width: 760px;
    margin: 7px 0 0;
    color: #94a3b8;
    line-height: 1.75;
    font-size: 0.85rem;
}
.berlin-vault-state {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex: 0 0 auto;
    padding: 8px 11px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 900;
}
.berlin-vault-state.locked {
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.08);
}
.berlin-vault-state.unlocked {
    color: #86efac;
    border: 1px solid rgba(34, 197, 94, 0.3);
    background: rgba(34, 197, 94, 0.08);
}
.berlin-vault-panel {
    padding: 17px;
}
.berlin-vault-panel h4 {
    margin-bottom: 13px;
}
.berlin-vault-panel small {
    display: block;
    margin-top: 9px;
    color: #94a3b8;
    line-height: 1.6;
}
.berlin-vault-grid {
    display: grid;
    gap: 9px;
    margin-bottom: 9px;
}
.berlin-vault-grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.berlin-vault-toolbar {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}
.berlin-vault-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 17px 0 11px;
    color: #64748b;
    font-size: 0.76rem;
}
.berlin-vault-divider::before,
.berlin-vault-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(148, 163, 184, 0.15);
}
.berlin-vault-product {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) repeat(3, minmax(85px, 110px));
    align-items: center;
    gap: 9px;
    padding: 11px;
    margin-bottom: 8px;
    border: 1px solid rgba(255, 255, 255, 0.065);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.025);
}
.berlin-vault-product strong,
.berlin-vault-product small {
    display: block;
}
.berlin-vault-product strong {
    color: #fff;
}
.berlin-vault-product small {
    margin-top: 4px;
    color: #64748b;
    direction: ltr;
    text-align: right;
    overflow-wrap: anywhere;
}
.berlin-vault-count {
    padding: 7px;
    border-radius: 9px;
    text-align: center;
}
.berlin-vault-count span,
.berlin-vault-count b {
    display: block;
}
.berlin-vault-count span {
    font-size: 0.66rem;
    opacity: 0.78;
}
.berlin-vault-count b {
    margin-top: 3px;
    font-size: 1.05rem;
}
.berlin-vault-count.available {
    color: #86efac;
    background: rgba(34, 197, 94, 0.08);
}
.berlin-vault-count.reserved {
    color: #fde68a;
    background: rgba(245, 158, 11, 0.08);
}
.berlin-vault-count.delivered {
    color: #bae6fd;
    background: rgba(56, 189, 248, 0.08);
}

.berlin-vault-product-actions {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
    flex-wrap: wrap;
    padding-top: 9px;
    border-top: 1px dashed rgba(148, 163, 184, 0.14);
}
.berlin-vault-product-actions .btn-action {
    min-height: 37px;
    padding: 7px 11px;
    border-radius: 9px;
    font-size: 0.76rem;
    font-weight: 800;
}
.berlin-vault-product-actions .berlin-vault-edit-btn {
    color: #bae6fd;
    border-color: rgba(56, 189, 248, 0.28);
    background: rgba(56, 189, 248, 0.08);
}
.berlin-vault-product-actions .berlin-vault-delete-btn {
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.28);
    background: rgba(239, 68, 68, 0.075);
}
.berlin-vault-product-actions .berlin-vault-delete-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}
.berlin-inventory-edit-modal {
    padding: 14px !important;
}
.berlin-inventory-edit-box {
    width: min(620px, 100%) !important;
    max-width: 620px !important;
    max-height: calc(100dvh - 28px) !important;
    overflow-y: auto !important;
    border-color: rgba(56, 189, 248, 0.32) !important;
}
.berlin-inventory-edit-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px;
}
.berlin-inventory-edit-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.berlin-inventory-edit-field.full {
    grid-column: 1 / -1;
}
.berlin-inventory-edit-field label {
    color: #cbd5e1;
    font-size: 0.78rem;
    font-weight: 800;
}
.berlin-inventory-edit-note {
    margin: 12px 0;
    padding: 10px 12px;
    border: 1px solid rgba(56, 189, 248, 0.18);
    border-radius: 10px;
    color: #bae6fd;
    background: rgba(56, 189, 248, 0.055);
    font-size: 0.75rem;
    line-height: 1.65;
}
.berlin-inventory-edit-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}
.berlin-vault-empty {
    display: grid;
    place-items: center;
    gap: 9px;
    min-height: 110px;
    color: #94a3b8;
    text-align: center;
}
.berlin-vault-empty.error {
    color: #fca5a5;
}

/* Manual delivery modal */
.berlin-manual-delivery-modal {
    padding: 12px !important;
    overflow: hidden !important;
}
.berlin-manual-delivery-box {
    width: min(720px, 100%) !important;
    max-width: 720px !important;
    max-height: calc(100dvh - 24px) !important;
    overflow-y: auto !important;
    border-color: rgba(34, 211, 238, 0.34) !important;
}
.berlin-manual-order-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px;
    margin-bottom: 12px;
    border: 1px solid rgba(34, 211, 238, 0.16);
    border-radius: 12px;
    background: rgba(34, 211, 238, 0.055);
}
.berlin-manual-order-head strong,
.berlin-manual-order-head span {
    display: block;
}
.berlin-manual-order-head strong {
    color: #67e8f9;
}
.berlin-manual-order-head span {
    margin-top: 4px;
    color: #94a3b8;
    font-size: 0.8rem;
}
.berlin-manual-payment {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    margin: 0 !important;
    padding: 6px 9px;
    border-radius: 999px;
    color: #fde68a !important;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.25);
}
.berlin-vault-inline-lock {
    display: grid;
    grid-template-columns: auto minmax(130px, 1fr) minmax(180px, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 12px;
    margin-bottom: 12px;
    border: 1px solid rgba(251, 191, 36, 0.2);
    border-radius: 12px;
    background: rgba(251, 191, 36, 0.06);
}
.berlin-vault-inline-lock > i {
    color: #fbbf24;
    font-size: 1.25rem;
}
.berlin-vault-inline-lock strong,
.berlin-vault-inline-lock span {
    display: block;
}
.berlin-vault-inline-lock strong {
    color: #fff;
}
.berlin-vault-inline-lock span {
    margin-top: 3px;
    color: #94a3b8;
    font-size: 0.73rem;
}
.berlin-manual-match-list {
    display: grid;
    gap: 8px;
    margin-bottom: 12px;
}
.berlin-manual-match {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px;
    border-radius: 11px;
}
.berlin-manual-match.ok {
    border: 1px solid rgba(34, 197, 94, 0.2);
    background: rgba(34, 197, 94, 0.055);
}
.berlin-manual-match.missing {
    border: 1px solid rgba(239, 68, 68, 0.2);
    background: rgba(239, 68, 68, 0.055);
}
.berlin-manual-match.ok > i {
    color: #34d399;
}
.berlin-manual-match.missing > i {
    color: #f87171;
}
.berlin-manual-match strong,
.berlin-manual-match span {
    display: block;
}
.berlin-manual-match strong {
    color: #fff;
}
.berlin-manual-match span {
    margin-top: 3px;
    color: #94a3b8;
    font-size: 0.75rem;
}
.berlin-manual-note {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 11px;
    margin-bottom: 12px;
    border-radius: 10px;
    color: #c4b5fd;
    background: rgba(139, 92, 246, 0.07);
    border: 1px solid rgba(139, 92, 246, 0.18);
    font-size: 0.78rem;
}
.berlin-payment-confirm {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 12px;
    margin-bottom: 12px;
    border: 1px solid rgba(245, 158, 11, 0.22);
    border-radius: 11px;
    color: #fef3c7;
    background: rgba(245, 158, 11, 0.065);
    cursor: pointer;
}
.berlin-payment-confirm input {
    width: 20px;
    height: 20px;
    accent-color: #f59e0b;
}
#berlin-manual-deliver-btn {
    width: 100%;
    justify-content: center;
    min-height: 48px;
}

@media (max-width: 720px) {
    #auto-delivery-modal,
    .berlin-manual-delivery-modal {
        align-items: stretch !important;
        padding: 0 !important;
    }
    #auto-delivery-modal > .modal-box,
    .berlin-manual-delivery-box {
        width: 100% !important;
        max-width: none !important;
        max-height: 100dvh !important;
        min-height: 100dvh;
        border-radius: 0 !important;
    }
    #auto-delivery-modal [style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }
    .berlin-vault-grid.two,
    .berlin-vault-product {
        grid-template-columns: 1fr 1fr;
    }
    .berlin-vault-product > div:first-child {
        grid-column: 1 / -1;
    }
    .berlin-vault-hero {
        align-items: flex-start;
    }
    .berlin-vault-inline-lock {
        grid-template-columns: auto 1fr;
    }
    .berlin-vault-inline-lock input,
    .berlin-vault-inline-lock button {
        grid-column: 1 / -1;
    }
    .berlin-vault-product-actions {
        justify-content: stretch;
    }
    .berlin-vault-product-actions .btn-action {
        flex: 1 1 calc(50% - 7px);
        justify-content: center;
    }
    .berlin-inventory-edit-grid {
        grid-template-columns: 1fr;
    }
    .berlin-inventory-edit-field.full {
        grid-column: auto;
    }
}

/* ========================================================================== 
   Berlin Mobile Experience — Final Touch V3
   الخلفية الجديدة للموبايل فقط + وضوح أفضل + Safe Area + ثبات أثناء السكرول
   ========================================================================== */
@media (max-width: 1024px) {
    html.berlin-mobile-dashboard-view {
        width: 100%;
        height: 100%;
        min-height: 100%;
        overflow: hidden;
        background: #020617 !important;
        color-scheme: dark;
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }

    html.berlin-mobile-dashboard-view body {
        width: 100%;
        min-height: 100vh;
        min-height: 100svh;
        min-height: 100dvh;
        height: 100vh !important;
        height: 100svh !important;
        height: 100dvh !important;
        margin: 0;
        overflow: hidden !important;
        overscroll-behavior: none;
        background: transparent !important;
        isolation: isolate;
        -webkit-tap-highlight-color: transparent;
    }

    /* طبقة مستقلة ثابتة: لا يعاد رسمها مع كل حركة سكرول. */
    html.berlin-mobile-dashboard-view body::before {
        content: "";
        position: fixed;
        inset: -2px;
        z-index: -2;
        pointer-events: none;
        background-color: #020617;
        background-image: var(
            --berlin-dashboard-bg-image,
            url("https://i.postimg.cc/HnsHhDtL/wallpaper-minecraft-burberry-1080x1920.png")
        ) !important;
        background-position: center top;
        background-repeat: no-repeat;
        background-size: cover;
        transform: translate3d(0, 0, 0);
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
    }

    /* طبقة قراءة موحّدة، تمنع الكروت والنص من الضياع فوق تفاصيل الصورة. */
    html.berlin-mobile-dashboard-view body::after {
        content: "";
        position: fixed;
        inset: 0;
        z-index: -1;
        pointer-events: none;
        background:
            linear-gradient(180deg, rgba(2, 6, 23, 0.42) 0%, rgba(2, 6, 23, 0.58) 42%, rgba(2, 6, 23, 0.76) 100%);
    }

    html.berlin-mobile-dashboard-view #app-layout,
    html.berlin-mobile-dashboard-view .app-layout,
    html.berlin-mobile-dashboard-view .main-content {
        background-color: transparent !important;
        background-image: none !important;
    }

    html.berlin-mobile-dashboard-view .main-content {
        width: 100%;
        max-width: 100%;
        min-height: 0 !important;
        height: 100vh !important;
        height: 100svh !important;
        height: 100dvh !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        overscroll-behavior-x: none;
        overscroll-behavior-y: contain;
        -webkit-overflow-scrolling: touch;
        contain: none !important;
        padding:
            calc(72px + env(safe-area-inset-top, 0px))
            12px
            calc(88px + env(safe-area-inset-bottom, 0px)) !important;
    }

    /* شفافية موزونة: الخلفية تظل ظاهرة بدون تحويل الواجهة إلى كروت سوداء. */
    html.berlin-mobile-dashboard-view .stat-card {
        background: rgba(10, 15, 27, 0.88) !important;
        border-color: rgba(255, 255, 255, 0.10) !important;
    }

    html.berlin-mobile-dashboard-view .glass-panel {
        background: rgba(8, 13, 24, 0.86) !important;
        border-color: rgba(255, 255, 255, 0.10) !important;
    }

    html.berlin-mobile-dashboard-view .daily-tasks-widget,
    html.berlin-mobile-dashboard-view .connection-status {
        background-color: rgba(8, 13, 24, 0.90) !important;
    }

    html.berlin-mobile-dashboard-view .mobile-header {
        min-height: calc(58px + env(safe-area-inset-top, 0px)) !important;
        padding-top: max(10px, env(safe-area-inset-top, 0px)) !important;
        padding-right: max(12px, env(safe-area-inset-right, 0px)) !important;
        padding-left: max(12px, env(safe-area-inset-left, 0px)) !important;
        background: rgba(7, 11, 20, 0.94) !important;
        border-bottom-color: rgba(255, 255, 255, 0.08) !important;
    }

    html.berlin-mobile-dashboard-view .mobile-bottom-nav {
        min-height: calc(64px + env(safe-area-inset-bottom, 0px)) !important;
        padding-right: max(6px, env(safe-area-inset-right, 0px)) !important;
        padding-bottom: max(8px, env(safe-area-inset-bottom, 0px)) !important;
        padding-left: max(6px, env(safe-area-inset-left, 0px)) !important;
        background: rgba(7, 11, 20, 0.95) !important;
        border-top-color: rgba(255, 255, 255, 0.08) !important;
    }

    html.berlin-mobile-dashboard-view .sidebar {
        padding-top: calc(16px + env(safe-area-inset-top, 0px)) !important;
        padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)) !important;
        background: linear-gradient(180deg, #171a2b 0%, #101424 100%) !important;
        border-left-color: rgba(124, 58, 237, 0.38) !important;
        color: #f8fafc !important;
        z-index: 2147483001 !important;
        pointer-events: none;
    }

    html.berlin-mobile-dashboard-view .sidebar .nav-btn {
        color: #cbd5e1 !important;
        position: relative;
        z-index: 2;
        touch-action: manipulation !important;
        -webkit-tap-highlight-color: rgba(124, 58, 237, 0.18);
    }

    html.berlin-mobile-dashboard-view .sidebar .nav-btn:hover,
    html.berlin-mobile-dashboard-view .sidebar .nav-btn:focus-visible {
        color: #ffffff !important;
        background: rgba(255, 255, 255, 0.07) !important;
    }

    html.berlin-mobile-dashboard-view .sidebar .nav-btn.active {
        color: #c084fc !important;
        background: linear-gradient(90deg, rgba(124, 58, 237, 0.26), rgba(124, 58, 237, 0.07)) !important;
        border-right-color: #8b5cf6 !important;
    }

    html.berlin-mobile-dashboard-view .sidebar.active,
    html.berlin-mobile-dashboard-view .sidebar.active .nav-btn {
        pointer-events: auto !important;
    }

    html.berlin-sidebar-open #quick-actions-modal {
        display: none !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }

    html.berlin-mobile-dashboard-view .modal-overlay {
        padding-top: max(8px, env(safe-area-inset-top, 0px));
        padding-right: max(8px, env(safe-area-inset-right, 0px));
        padding-bottom: max(8px, env(safe-area-inset-bottom, 0px));
        padding-left: max(8px, env(safe-area-inset-left, 0px));
        overscroll-behavior: contain;
    }

    html.berlin-mobile-dashboard-view .modal-box {
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    /* لا نستخدم content-visibility في إحصائيات الداشبورد حتى لا تتأخر الرسوم وHot Items. */
    html.berlin-mobile-dashboard-view #section-dashboard .glass-panel,
    html.berlin-mobile-dashboard-view #section-dashboard .stats-grid,
    html.berlin-mobile-dashboard-view #hot-items-container,
    html.berlin-mobile-dashboard-view #salesChart {
        content-visibility: visible !important;
        contain: none !important;
    }

    html.berlin-mobile-dashboard-view img,
    html.berlin-mobile-dashboard-view canvas,
    html.berlin-mobile-dashboard-view video,
    html.berlin-mobile-dashboard-view svg {
        max-width: 100%;
    }

    html.berlin-mobile-dashboard-view button,
    html.berlin-mobile-dashboard-view a,
    html.berlin-mobile-dashboard-view input,
    html.berlin-mobile-dashboard-view select,
    html.berlin-mobile-dashboard-view textarea,
    html.berlin-mobile-dashboard-view [role="button"] {
        touch-action: manipulation;
    }
}

@media (max-width: 600px) {
    html.berlin-mobile-dashboard-view input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
    html.berlin-mobile-dashboard-view select,
    html.berlin-mobile-dashboard-view textarea {
        font-size: 16px !important;
    }
}

@media (max-width: 1024px) and (orientation: landscape) {
    html.berlin-mobile-dashboard-view body::before {
        background-position: center 22%;
    }

    html.berlin-mobile-dashboard-view .main-content {
        padding-top: calc(64px + env(safe-area-inset-top, 0px)) !important;
    }
}

@media (max-width: 1024px) and (prefers-reduced-motion: reduce) {
    html.berlin-mobile-dashboard-view *,
    html.berlin-mobile-dashboard-view *::before,
    html.berlin-mobile-dashboard-view *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================================================
   Berlin Gaming Performance Mode V4
   - Floating button directly above live chat
   - Minimal compositor-only screen
   - Only the latest four orders are painted
   ============================================================================ */
#berlin-gaming-performance-fab {
    position: fixed;
    left: 20px;
    bottom: 162px;
    z-index: 100000;
    width: 60px;
    height: 60px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(16, 185, 129, 0.48);
    border-radius: 50%;
    background: #0d1715;
    color: #6ee7b7;
    font: inherit;
    font-size: 21px;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
    isolation: isolate;
}

#berlin-gaming-performance-fab::after {
    content: "وضع اللعب";
    position: absolute;
    left: 70px;
    top: 50%;
    transform: translateY(-50%);
    width: max-content;
    padding: 6px 9px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: #0b0f14;
    color: #d1fae5;
    font-size: 11px;
    font-weight: 800;
    pointer-events: none;
    opacity: 0;
}

#berlin-gaming-performance-fab:hover::after,
#berlin-gaming-performance-fab:focus-visible::after {
    opacity: 1;
}

#berlin-gaming-performance-fab.is-active {
    border-color: #34d399;
    background: #10b981;
    color: #03110c;
}

#berlin-gaming-performance-fab.is-active::after {
    content: "إيقاف وضع اللعب";
}

#berlin-gaming-lite-panel {
    display: none;
    position: fixed;
    inset: 18px 18px auto auto;
    z-index: 99980;
    width: min(390px, calc(100vw - 36px));
    contain: layout paint style;
    direction: rtl;
    border: 1px solid #263244;
    border-radius: 14px;
    background: #090d13;
    color: #f8fafc;
    font-family: Tajawal, Cairo, sans-serif;
}

html.berlin-gaming-mode #berlin-gaming-lite-panel {
    display: block;
}

.berlin-gaming-lite-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 13px 14px;
    border-bottom: 1px solid #1d2735;
}

.berlin-gaming-lite-title {
    min-width: 0;
}

.berlin-gaming-lite-title strong {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #d1fae5;
    font-size: 14px;
}

.berlin-gaming-lite-title small {
    display: block;
    margin-top: 4px;
    color: #64748b;
    font-size: 10px;
}

#berlin-gaming-exit-btn {
    min-width: 72px;
    min-height: 32px;
    border: 1px solid #374151;
    border-radius: 8px;
    background: #111827;
    color: #e5e7eb;
    font: inherit;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
}

#berlin-gaming-orders-list {
    display: grid;
    gap: 1px;
    background: #18202c;
}

.berlin-gaming-order-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    padding: 11px 13px;
    border: 0;
    background: #0c121a;
    color: inherit;
    text-align: right;
    font: inherit;
    cursor: pointer;
}

.berlin-gaming-order-row:hover,
.berlin-gaming-order-row:focus-visible {
    background: #111a25;
}

.berlin-gaming-order-main {
    min-width: 0;
}

.berlin-gaming-order-main strong,
.berlin-gaming-order-main span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.berlin-gaming-order-main strong {
    color: #f8fafc;
    font-size: 12px;
}

.berlin-gaming-order-main span {
    margin-top: 4px;
    color: #7c8aa0;
    font-size: 10px;
}

.berlin-gaming-order-side {
    text-align: left;
    white-space: nowrap;
}

.berlin-gaming-order-price {
    display: block;
    color: #fbbf24;
    font-size: 12px;
    font-weight: 900;
}

.berlin-gaming-order-status {
    display: inline-block;
    margin-top: 5px;
    padding: 2px 6px;
    border: 1px solid #334155;
    border-radius: 999px;
    color: #94a3b8;
    font-size: 9px;
    font-weight: 800;
}

.berlin-gaming-order-status.pending,
.berlin-gaming-order-status.problem_contact {
    border-color: #854d0e;
    color: #fcd34d;
}

.berlin-gaming-order-status.completed {
    border-color: #166534;
    color: #86efac;
}

.berlin-gaming-lite-empty {
    padding: 28px 14px;
    background: #0c121a;
    color: #64748b;
    text-align: center;
    font-size: 12px;
}

.berlin-gaming-lite-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 13px;
    border-top: 1px solid #1d2735;
    color: #64748b;
    font-size: 10px;
}

#berlin-gaming-order-count {
    color: #6ee7b7;
    font-weight: 900;
}

#berlin-gaming-lite-panel.has-new-order {
    border-color: #10b981;
    background: #0b1612;
}

/* Stop almost all painting/compositing while gaming mode is enabled. */
html.berlin-gaming-mode,
html.berlin-gaming-mode body {
    background: #05070a !important;
    background-image: none !important;
    overflow: hidden !important;
    color-scheme: dark;
}

html.berlin-gaming-mode #app-layout,
html.berlin-gaming-mode #connection-status,
html.berlin-gaming-mode .mobile-header,
html.berlin-gaming-mode .mobile-bottom-nav,
html.berlin-gaming-mode .mobile-quick-access,
html.berlin-gaming-mode #new-order-popup,
html.berlin-gaming-mode #toast-container,
html.berlin-gaming-mode .order-notification,
html.berlin-gaming-mode .daily-tasks-widget,
html.berlin-gaming-mode #global-alert-banner {
    display: none !important;
    visibility: hidden !important;
    content-visibility: hidden !important;
    pointer-events: none !important;
}

html.berlin-gaming-mode #app-layout {
    contain: strict !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
}

html.berlin-gaming-mode *,
html.berlin-gaming-mode *::before,
html.berlin-gaming-mode *::after {
    animation: none !important;
    transition: none !important;
    filter: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    text-shadow: none !important;
    scroll-behavior: auto !important;
}

html.berlin-gaming-mode #live-chat-button {
    animation: none !important;
    box-shadow: none !important;
    background: #512da8 !important;
}

html.berlin-gaming-mode #berlin-gaming-performance-fab {
    box-shadow: none !important;
}

@media (max-width: 1024px), (pointer: coarse) {
    #berlin-gaming-performance-fab {
        left: 15px;
        bottom: 147px;
        width: 55px;
        height: 55px;
        font-size: 19px;
    }

    #berlin-gaming-performance-fab::after {
        display: none;
    }

    #berlin-gaming-lite-panel {
        inset: 12px 12px auto 12px;
        width: auto;
    }
}

@media (max-width: 768px) {
    #berlin-gaming-performance-fab {
        left: 10px;
        bottom: 132px;
        width: 50px;
        height: 50px;
        font-size: 18px;
    }
}

/* =========================================================
   Mobile Search + Desktop-only Performance FAB Fix
   ========================================================= */
.mobile-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mobile-search-btn {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(0, 212, 255, 0.28);
    border-radius: 10px;
    background: rgba(0, 212, 255, 0.08);
    color: var(--neon-blue);
    font: inherit;
    font-size: 1.05rem;
    cursor: pointer;
    touch-action: manipulation;
}

.mobile-search-btn:active {
    transform: scale(0.96);
}

/* Performance Mode floating controls are intentionally desktop-only. */
@media (max-width: 1024px), (pointer: coarse) {
    #berlin-gaming-performance-fab,
    #performance-mode-fab,
    #performance-mode-float-btn {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }

    #spotlight-modal {
        align-items: flex-start !important;
        justify-content: center !important;
        padding: calc(66px + env(safe-area-inset-top, 0px)) 8px calc(84px + env(safe-area-inset-bottom, 0px)) !important;
        overflow: hidden !important;
    }

    #spotlight-modal .spotlight-box {
        width: calc(100vw - 16px) !important;
        max-width: none !important;
        max-height: calc(100dvh - 158px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)) !important;
        padding: 0 !important;
        margin: 0 !important;
        border-radius: 14px !important;
        overflow: hidden !important;
    }

    #spotlight-modal .spotlight-header {
        gap: 10px !important;
        padding: 12px 13px !important;
    }

    #spotlight-modal .spotlight-header > i {
        flex: 0 0 auto;
        font-size: 1.1rem !important;
    }

    #spotlight-modal .spotlight-header input {
        min-width: 0 !important;
        width: 100% !important;
        font-size: 16px !important;
        line-height: 1.35 !important;
    }

    #spotlight-modal .spotlight-esc {
        width: 38px;
        height: 38px;
        flex: 0 0 38px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 1px solid rgba(255, 255, 255, 0.12);
        color: #e2e8f0;
    }

    #spotlight-modal .spotlight-results {
        max-height: calc(100dvh - 225px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)) !important;
        padding: 8px !important;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    #spotlight-modal .spotlight-item {
        gap: 10px !important;
        padding: 12px 10px !important;
        min-height: 64px;
    }

    #spotlight-modal .spotlight-item:hover {
        transform: none !important;
    }
}

/* =========================================================
   Mobile sidebar V4: top layer + native scroll + page-level gesture capture
   ========================================================= */
@media (max-width: 1024px) {
    html body #sidebar.sidebar {
        display: flex !important;
        flex-direction: column !important;
        position: fixed !important;
        top: 0 !important;
        bottom: 0 !important;
        height: auto !important;
        max-height: none !important;
        min-height: 0 !important;
        overflow-x: hidden !important;
        overflow-y: scroll !important;
        overscroll-behavior-x: none !important;
        overscroll-behavior-y: contain !important;
        -webkit-overflow-scrolling: touch !important;
        touch-action: pan-y !important;
        scrollbar-width: thin;
    }

    /* Block layout gives the menu its real content height instead of shrinking it as a flex child. */
    html body #sidebar.sidebar .sidebar-nav-list {
        display: block !important;
        flex: none !important;
        width: 100% !important;
        height: auto !important;
        min-height: max-content !important;
        max-height: none !important;
        overflow: visible !important;
        touch-action: pan-y !important;
    }

    html body #sidebar.sidebar .sidebar-nav-list > * {
        width: 100% !important;
        margin-bottom: 7px !important;
    }

    html body #sidebar.sidebar .brand,
    html body #sidebar.sidebar .logout-btn,
    html body #sidebar.sidebar > div:last-child {
        flex: none !important;
    }

    html body #sidebar.sidebar .logout-btn,
    html body #sidebar.sidebar > div:last-child {
        margin-top: 8px !important;
    }

    /* A swipe normally starts on a section button, so it must allow vertical panning too. */
    html body #sidebar.sidebar .sidebar-nav-list,
    html body #sidebar.sidebar .sidebar-nav-list * {
        touch-action: pan-y !important;
    }

    html body #sidebar.sidebar.active,
    html body #sidebar.sidebar.active .sidebar-nav-list {
        pointer-events: auto !important;
    }

    html.berlin-sidebar-open body #sidebar.sidebar.active {
        z-index: 2147483647 !important;
        pointer-events: auto !important;
    }

    html.berlin-sidebar-open body #sidebar-backdrop.active {
        z-index: 2147483646 !important;
    }
}


/* =========================================================
   Berlin Mobile Sidebar V6 — real fix for unclickable menu
   Root cause: the transparent backdrop was above the whole
   app-layout stacking context and intercepted taps.
   ========================================================= */
@media (max-width: 1024px) {
    :root {
        --berlin-mobile-sidebar-width: min(300px, 92vw);
    }

    html body #sidebar.sidebar {
        width: var(--berlin-mobile-sidebar-width) !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        touch-action: pan-y !important;
    }

    html.berlin-sidebar-open body #sidebar.sidebar.active {
        z-index: 2147483647 !important;
        pointer-events: auto !important;
    }

    html.berlin-sidebar-open body #sidebar.sidebar.active .sidebar-nav-list,
    html.berlin-sidebar-open body #sidebar.sidebar.active .sidebar-nav-list .nav-btn,
    html.berlin-sidebar-open body #sidebar.sidebar.active .sidebar-nav-list button,
    html.berlin-sidebar-open body #sidebar.sidebar.active .sidebar-nav-list a {
        pointer-events: auto !important;
    }

    html.berlin-sidebar-open body #sidebar.sidebar.active .sidebar-nav-list .nav-btn,
    html.berlin-sidebar-open body #sidebar.sidebar.active .sidebar-nav-list button,
    html.berlin-sidebar-open body #sidebar.sidebar.active .sidebar-nav-list a {
        position: relative !important;
        z-index: 2 !important;
        touch-action: manipulation !important;
        -webkit-user-select: none;
        user-select: none;
    }

    /* Cover only the area OUTSIDE the right-side menu. */
    html.berlin-sidebar-open body #sidebar-backdrop.active {
        top: 0 !important;
        bottom: 0 !important;
        left: 0 !important;
        right: var(--berlin-mobile-sidebar-width) !important;
        width: auto !important;
        height: auto !important;
        z-index: 2147483646 !important;
        pointer-events: auto !important;
    }
}
