/* ===================================
   نظام SAS - ملف الأنماط الكامل
   =================================== */

/* المتغيرات الأساسية */
:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --secondary: #8b5cf6;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --dark: #1e293b;
    --light: #f8fafc;
    --gray: #64748b;
    --gray-light: #e2e8f0;

    /* متغيرات التصميم الداكن للأدمن */
    --admin-bg: linear-gradient(135deg, #1e3a8a 0%, #4c1d95 50%, #581c87 100%);
    --sidebar-bg: rgba(30, 41, 59, 0.85);
    --card-bg: rgba(30, 41, 59, 0.85);
    --card-border: rgba(139, 92, 246, 0.3);
    --text-light: #f1f5f9;
    --text-muted: #cbd5e1;
    --input-bg: rgba(51, 65, 85, 0.6);
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(139, 92, 246, 0.2);
    --card-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* إعدادات شاملة لإخفاء السكرول بار */
::-webkit-scrollbar {
    width: 0px;
    background: transparent;
    /* Chrome/Safari/Webkit */
}

::-webkit-scrollbar-thumb {
    background: transparent;
}

html {
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE 10+ */
}

/* إعدادات أساسية */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    -webkit-tap-highlight-color: transparent;
    /* يمنع ظهور المربع الملون عند اللمس */
    outline: none;
}

*:focus {
    outline: none !important;
}

body {
    min-height: 100vh;
    direction: rtl;
    overflow-x: hidden;
    background: #f8f9fa;
    width: 100%;
    position: relative;
    overscroll-behavior-y: none;
    /* يمنع تأثير الارتداد الذي يظهر الخط العلوي/السفلي */
}

/* خلفية الموقع الأساسي (Landing Page) */
body.home-body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

html {
    scroll-behavior: smooth;
}

/* الحاوية الرئيسية */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* ===================================
   الأنيميشن والتأثيرات
   =================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-10px);
    }

    75% {
        transform: translateX(10px);
    }
}

/* تطبيق الأنيميشن */
.fade-in {
    animation: fadeIn 0.6s ease-out;
}

.slide-in {
    animation: slideInRight 0.8s ease-out;
}

.slide-in-left {
    animation: slideInLeft 0.8s ease-out;
}

.pulse {
    animation: pulse 2s infinite;
}

.float {
    animation: float 3s ease-in-out infinite;
}

/* ===================================
   البطاقات (Cards)
   =================================== */

.card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

/* ===================================
   الأزرار (Buttons)
   =================================== */

.btn {
    padding: 12px 30px;
    border-radius: 50px;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 5px 15px rgba(67, 97, 238, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(67, 97, 238, 0.6);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--warning), var(--danger));
    color: white;
    box-shadow: 0 5px 15px rgba(248, 150, 30, 0.4);
}

.btn-secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(248, 150, 30, 0.6);
}

.btn-success {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #f44336, #d32f2f);
    color: white;
    box-shadow: 0 5px 15px rgba(244, 67, 54, 0.4);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===================================
   شريط التنقل (Navbar)
   =================================== */

.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 15px 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.navbar.scrolled {
    padding: 10px 0;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.2);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary);
    font-size: 24px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.logo i {
    font-size: 28px;
}

.nav-links {
    display: flex;
    gap: 20px;
    list-style: none;
    align-items: center;
}

.nav-links a {
    color: var(--dark);
    text-decoration: none;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 50px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 50%;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: all 0.3s ease;
    transform: translateX(50%);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 80%;
}

.nav-links a:hover,
.nav-links a.active {
    background: var(--primary);
    color: white;
}

.nav-links a i {
    margin-left: 5px;
}

/* زر الموبايل الافتراضي */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--primary);
    cursor: pointer;
}

@media (max-width: 992px) {
    .menu-toggle {
        display: block !important;
        background: transparent;
        border: 2px solid var(--primary);
        border-radius: 8px;
        color: var(--primary);
        font-size: 20px;
        cursor: pointer;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 2500;
    }

    .nav-links {
        display: none !important;
        flex-direction: column;
        position: fixed;
        /* Fixed positioning to ensure visibility */
        top: 70px;
        left: 0;
        right: 0;
        /* Premium Glassmorphism & Animation */
        /* Clearer Background Color */
        background: #f1f5f9 !important;
        /* Light Slate Grey to stand out */
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        padding: 25px !important;
        box-shadow: none !important;
        /* Removed shadow */
        z-index: 2400;
        border-bottom: 2px solid var(--primary);
        max-height: 85vh;
        overflow-y: auto;
        border-radius: 0 0 30px 30px;
        transform-origin: top;
        animation: menuSlideDown 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
        scrollbar-width: none;
        /* Firefox */
        -ms-overflow-style: none;
        /* IE/Edge */
        border: none !important;
    }

    .nav-links::-webkit-scrollbar {
        display: none;
        /* Chrome/Safari */
    }

    @keyframes menuSlideDown {
        from {
            opacity: 0;
            transform: translateY(-20px) scale(0.98);
        }

        to {
            opacity: 1;
            transform: translateY(0) scale(1);
        }
    }

    .nav-links.active {
        display: flex !important;
    }

    .nav-links li {
        width: 100% !important;
        margin-bottom: 10px;
    }

    .nav-links a {
        display: flex !important;
        align-items: center;
        width: 100% !important;
        padding: 16px 20px !important;
        background: transparent !important;
        /* Removed blocky background */
        border-radius: 12px;
        text-decoration: none !important;
        color: #1e293b !important;
        font-weight: 700 !important;
        font-size: 16px !important;
        border: 1px solid transparent;
        /* Removed visible border */
        transition: all 0.3s ease;
    }

    .nav-links a:hover,
    .nav-links a.active,
    .nav-links a:focus {
        background: rgba(67, 97, 238, 0.05) !important;
        color: var(--primary) !important;
        border: none !important;
        outline: none !important;
        box-shadow: none !important;
    }

    .nav-links a i {
        margin-left: 12px !important;
        font-size: 18px;
        width: 24px;
        text-align: center;
        color: var(--primary) !important;
    }

    .nav-links a:hover {
        background: #e2e8f0 !important;
        transform: translateX(-5px);
    }

    .nav-links a.active {
        background: var(--primary) !important;
        color: #ffffff !important;
        border-color: var(--primary);
    }

    .nav-links a.active i {
        color: #ffffff !important;
    }
}

/* ===================================
   الجداول (Tables)
   =================================== */

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 20px;
    border-radius: 15px;
}

table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
    background: white;
}

th {
    padding: 15px 20px;
    text-align: right;
    background: var(--gray-light);
    color: var(--dark);
    font-weight: 600;
    border-bottom: 2px solid var(--primary);
}

td {
    padding: 15px 20px;
    text-align: right;
    border-bottom: 1px solid var(--gray-light);
}

tr {
    transition: all 0.3s ease;
}

tr:hover td {
    background: rgba(67, 97, 238, 0.05);
    transform: scale(1.01);
}

tr:last-child td {
    border-bottom: none;
}

/* ===================================
   النماذج (Forms)
   =================================== */

.input-group {
    margin-bottom: 20px;
    text-align: right;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--dark);
    font-weight: 600;
    font-size: 15px;
}

.input-group label i {
    margin-left: 5px;
    color: var(--primary);
}

.input-group input,
.input-group select,
.input-group textarea {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid var(--gray-light);
    border-radius: 15px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
    font-family: 'Cairo', sans-serif;
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
    outline: none;
}

.input-group input:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.7;
}

/* ===================================
   الإشعارات والرسائل (Alerts)
   =================================== */

.alert {
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideInRight 0.5s ease;
}

.alert i {
    font-size: 20px;
}

.alert-success {
    background: #e8f5e9;
    color: #2e7d32;
    border-right: 4px solid #4CAF50;
}

.alert-danger {
    background: #ffebee;
    color: #c62828;
    border-right: 4px solid #f44336;
}

.alert-warning {
    background: #fff3e0;
    color: #e65100;
    border-right: 4px solid #ff9800;
}

.alert-info {
    background: #e3f2fd;
    color: #1565c0;
    border-right: 4px solid #2196f3;
}

/* ===================================
   الشارات (Badges)
   =================================== */

.badge {
    display: inline-block;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge {
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.status-active {
    background: rgba(76, 175, 80, 0.1);
    color: #4CAF50;
}

.status-expired {
    background: rgba(244, 67, 54, 0.1);
    color: #f44336;
}

.status-pending {
    background: rgba(255, 193, 7, 0.1);
    color: #ffc107;
}

.status-inactive {
    background: rgba(158, 158, 158, 0.1);
    color: #9e9e9e;
}

/* ===================================
   شريط التقدم (Progress Bar)
   =================================== */

.progress-bar {
    height: 10px;
    background: var(--gray-light);
    border-radius: 5px;
    overflow: hidden;
    margin: 10px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 5px;
    transition: width 1s ease;
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.3),
            transparent);
    animation: progress-shine 2s infinite;
}

@keyframes progress-shine {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

/* ===================================
   الأدوات المساعدة (Utilities)
   =================================== */

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.mt-1 {
    margin-top: 10px;
}

.mt-2 {
    margin-top: 20px;
}

.mt-3 {
    margin-top: 30px;
}

.mt-4 {
    margin-top: 40px;
}

.mt-5 {
    margin-top: 50px;
}

.mb-1 {
    margin-bottom: 10px;
}

.mb-2 {
    margin-bottom: 20px;
}

.mb-3 {
    margin-bottom: 30px;
}

.mb-4 {
    margin-bottom: 40px;
}

.mb-5 {
    margin-bottom: 50px;
}

.p-1 {
    padding: 10px;
}

.p-2 {
    padding: 20px;
}

.p-3 {
    padding: 30px;
}

.p-4 {
    padding: 40px;
}

.p-5 {
    padding: 50px;
}

.d-none {
    display: none;
}

.d-block {
    display: block;
}

.d-flex {
    display: flex;
}

.d-grid {
    display: grid;
}

.gap-1 {
    gap: 10px;
}

.gap-2 {
    gap: 20px;
}

.gap-3 {
    gap: 30px;
}

/* ===================================
   التصميم المتجاوب (Responsive)
   =================================== */

@media (max-width: 992px) {
    .container {
        max-width: 100%;
        padding: 0 20px;
    }
}

@media (max-width: 768px) {
    .navbar .container {
        flex-wrap: wrap;
    }

    .nav-links {
        flex-direction: column;
        width: 100%;
        display: none;
        margin-top: 15px;
        background: white;
        border-radius: 15px;
        padding: 15px;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links li {
        width: 100%;
    }

    .nav-links a {
        display: block;
        padding: 12px;
        width: 100%;
    }

    .menu-toggle {
        display: block;
    }

    .card {
        margin: 10px 0;
    }

    table {
        font-size: 14px;
    }

    th,
    td {
        padding: 10px;
    }
}

@media (max-width: 576px) {
    .logo {
        font-size: 20px;
    }

    .logo i {
        font-size: 24px;
    }

    .btn {
        padding: 10px 20px;
        font-size: 14px;
    }

    .input-group input,
    .input-group select {
        padding: 12px 15px;
        font-size: 14px;
    }

    .alert {
        padding: 12px 15px;
        font-size: 14px;
    }

    table {
        font-size: 12px;
    }

    th,
    td {
        padding: 8px;
    }
}

/* ===================================
   طباعة (Print)
   =================================== */

@media print {

    .navbar,
    .menu-toggle,
    .btn,
    .sidebar {
        display: none !important;
    }

    body {
        background: white;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* ===================================
   تحسينات إضافية
   =================================== */

::selection {
    background: var(--primary);
    color: white;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* ===================================
   أنماط لوحة التحكم المتطورة (Premium Admin Layout)
   =================================== */

:root {
    --admin-bg: linear-gradient(135deg, #1e3a8a 0%, #4c1d95 50%, #581c87 100%);
    --sidebar-bg: rgba(30, 41, 59, 0.85);
    --card-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(139, 92, 246, 0.2);
}

.admin-layout {
    display: flex;
    min-height: 100vh;
    background: var(--admin-bg);
    padding-top: 0;
    position: relative;
}

.admin-layout::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(168, 85, 247, 0.15) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* الشريط الجانبي الفخم (Sleek Sidebar) */
.sidebar {
    width: 280px;
    background: var(--sidebar-bg);
    backdrop-filter: blur(20px);
    box-shadow: 15px 0 40px rgba(0, 0, 0, 0.3);
    border-left: 2px solid var(--glass-border);
    position: fixed;
    height: 100vh;
    right: 0;
    top: 0;
    z-index: 1001;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    margin-bottom: 50px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 15px;
    color: #ffffff;
    font-size: 24px;
    font-weight: 800;
    text-decoration: none;
    letter-spacing: -0.5px;
}

.sidebar-logo i {
    font-size: 35px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-menu {
    list-style: none;
    flex: 1;
}

.sidebar-item {
    margin-bottom: 12px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 16px 20px;
    text-decoration: none;
    color: #cbd5e1;
    font-weight: 600;
    border-radius: 16px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.sidebar-link i {
    font-size: 22px;
    width: 28px;
    text-align: center;
    transition: transform 0.3s ease;
}

.sidebar-link:hover {
    background: rgba(59, 130, 246, 0.15);
    color: #ffffff;
    transform: translateX(-5px);
}

.sidebar-link:hover i {
    transform: scale(1.1);
}

.sidebar-link.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(139, 92, 246, 0.15));
    color: #ffffff;
    border: 1px solid rgba(59, 130, 246, 0.3);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.2);
}

.sidebar-link.active i {
    color: #ffffff;
}

/* المحتوى الرئيسي (Main Content) */
.admin-main {
    flex: 1;
    margin-right: 280px;
    padding: 40px 50px;
    transition: all 0.4s ease;
    max-width: calc(100% - 280px);
    position: relative;
    z-index: 1;
}

.admin-header {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 2px solid var(--glass-border);
    padding: 15px 30px;
    border-radius: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 45px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.admin-title h1 {
    font-size: 32px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.admin-title p {
    color: #cbd5e1;
    font-weight: 500;
}

/* بطاقات الإحصائيات (Modern Stats Cards) */
.stats-fakhma {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.stat-item {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    padding: 30px;
    border-radius: 24px;
    box-shadow: var(--card-shadow);
    display: flex;
    align-items: center;
    gap: 25px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid var(--card-border);
}

.stat-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

.stat-icon-box {
    width: 70px;
    height: 70px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
}

.stat-info .count {
    font-size: 30px;
    font-weight: 800;
    color: #ffffff;
    line-height: 1;
    margin-bottom: 5px;
}

.stat-info .label {
    font-size: 15px;
    color: #cbd5e1;
    font-weight: 600;
}

/* البطاقات الموحدة (Modern Admin Cards) */
.admin-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 35px;
    box-shadow: var(--card-shadow);
    border: 2px solid var(--card-border);
    margin-bottom: 35px;
}

.admin-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
}

.admin-card-header h3 {
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* تحسين الجداول (Premium Tables) */
table {
    border-radius: 16px;
    overflow: hidden;
    border: none;
}

th {
    background: rgba(51, 65, 85, 0.5);
    color: #cbd5e1;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 20px;
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
}

td {
    padding: 20px;
    color: #f1f5f9;
    font-weight: 500;
    border-bottom: 1px solid rgba(139, 92, 246, 0.1);
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: rgba(59, 130, 246, 0.1);
}

/* أزرار الإجراءات (Action Buttons) */
.action-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    text-decoration: none;
}

.action-btn.edit {
    background: rgba(67, 97, 238, 0.1);
    color: var(--primary);
}

.action-btn.delete {
    background: rgba(247, 37, 133, 0.1);
    color: var(--danger);
}

.action-btn:hover {
    transform: scale(1.1);
}

/* التجاوب (Responsive Optimization) */
@media (max-width: 1200px) {
    .admin-main {
        padding: 30px;
    }
}

@media (max-width: 992px) {
    .sidebar {
        right: -280px;
    }

    .sidebar.open {
        right: 0;
        box-shadow: -20px 0 60px rgba(0, 0, 0, 0.1);
    }

    .admin-main {
        margin-right: 0;
        max-width: 100%;
        padding: 20px;
    }

    .admin-header {
        margin-bottom: 30px;
    }

    .sidebar-toggle {
        display: flex;
    }
}

@media (max-width: 576px) {
    .admin-title h1 {
        font-size: 24px;
    }

    .stats-fakhma {
        grid-template-columns: 1fr;
    }
}

.bg-primary {
    background: var(--primary);
}

.bg-secondary {
    background: var(--secondary);
}

.bg-success {
    background: #4CAF50;
}

.bg-danger {
    background: #f44336;
}

.bg-light {
    background: var(--light);
}

.bg-white {
    background: white;
}

/* ===================================
   أنماط بوابة الوكيل (Premium Agent Portal)
   =================================== */

.agent-portal {
    background: var(--admin-bg);
    min-height: 100vh;
    padding-bottom: 50px;
    position: relative;
    color: var(--text-light);
}

.agent-portal::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(168, 85, 247, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.agent-header-section {
    display: none;
}

.agent-welcome h1 {
    font-size: 20px;
}

@media (max-width: 992px) {
    .nav-welcome-text {
        display: none !important;
    }
}

.agent-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    position: relative;
    z-index: 2;
    margin-bottom: 30px;
}

.agent-stat-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 30px;
    box-shadow: var(--card-shadow);
    border: 2px solid var(--card-border);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.agent-stat-card:hover {
    transform: translateY(-8px);
    border-color: rgba(139, 92, 246, 0.6);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
}

.agent-stat-icon {
    width: 65px;
    height: 65px;
    border-radius: 20px;
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.agent-stat-value {
    font-size: 26px;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.2;
}

.agent-stat-label {
    font-size: 14px;
    color: #94a3b8;
    font-weight: 600;
    margin-bottom: 4px;
}

.agent-main-grid {
    display: grid;
    grid-template-columns: 1.8fr 1fr;
    gap: 30px;
    margin-top: 20px;
    position: relative;
    z-index: 2;
}

.agent-section-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 35px;
    box-shadow: var(--card-shadow);
    border: 2px solid var(--card-border);
}

.agent-section-title {
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.agent-info-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
}

.agent-info-item {
    background: rgba(15, 23, 42, 0.4);
    padding: 18px 22px;
    border-radius: 18px;
    border-right: 4px solid #3b82f6;
    transition: all 0.3s ease;
}

.agent-info-item:hover {
    background: rgba(15, 23, 42, 0.6);
    transform: scale(1.02);
}

.agent-info-label {
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 6px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.agent-info-value {
    font-size: 16px;
    font-weight: 700;
    color: #f1f5f9;
}

.agent-action-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 10px;
}

.agent-btn {
    padding: 16px 25px;
    border-radius: 16px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border: none;
    cursor: pointer;
}

.agent-btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
}

.agent-btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(59, 130, 246, 0.4);
}

.agent-btn-secondary {
    background: rgba(51, 65, 85, 0.4);
    color: #e2e8f0;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.agent-btn-secondary:hover {
    background: rgba(51, 65, 85, 0.6);
    color: white;
}

.agent-btn-whatsapp {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    box-shadow: 0 8px 20px rgba(34, 197, 94, 0.3);
}

.agent-btn-whatsapp:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(34, 197, 94, 0.4);
}

.agent-badge {
    padding: 6px 14px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

@media (max-width: 992px) {
    .agent-main-grid {
        grid-template-columns: 1fr;
    }

    /* لوحة الإدارة على الجوال */
    .sidebar {
        transform: translateX(100%);
        transition: transform 0.3s ease;
        z-index: 9999 !important;
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        width: 300px;
        width: 300px;
        background: #f1f5f9 !important;
        /* Light Slate Grey to stand out */
        box-shadow: none !important;
        /* Removed shadow/line */
        padding: 35px 25px !important;
        overflow-y: auto;
        display: flex !important;
        flex-direction: column !important;
        visibility: visible !important;
        border-top-left-radius: 30px;
        border-bottom-left-radius: 30px;
        scrollbar-width: none;
        -ms-overflow-style: none;
        border-left: 1px solid rgba(0, 0, 0, 0.05);
        /* Very subtle separator instead of shadow */
    }

    .sidebar::-webkit-scrollbar {
        display: none;
    }

    .sidebar * {
        visibility: visible !important;
        opacity: 1 !important;
        box-sizing: border-box !important;
    }

    .sidebar.active,
    .sidebar.open {
        transform: translateX(0);
        right: 0 !important;
        visibility: visible !important;
        opacity: 1 !important;
        display: flex !important;
    }

    .sidebar-logo {
        margin-bottom: 30px !important;
        padding-bottom: 20px !important;
        border-bottom: 2px solid #f1f5f9;
        display: flex !important;
    }

    .sidebar-logo span {
        color: #1a202c !important;
        display: block !important;
        font-size: 22px !important;
        font-weight: 800 !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    .sidebar-menu {
        margin-top: 20px;
    }

    .sidebar-link {
        background: transparent !important;
        color: #1e293b !important;
        margin-bottom: 5px !important;
        padding: 15px 20px !important;
        border: 1px solid transparent !important;
        border-radius: 12px !important;
        font-weight: 600 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        width: 100% !important;
        text-decoration: none !important;
        visibility: visible !important;
        transition: all 0.2s ease;
    }

    .sidebar-link i {
        color: #64748b !important;
        font-size: 18px !important;
        margin-left: 15px !important;
        transition: color 0.2s ease;
    }

    .sidebar-link.active,
    .sidebar-link:hover,
    .sidebar-link:focus {
        background: rgba(67, 97, 238, 0.08) !important;
        color: var(--primary) !important;
        border: none !important;
        outline: none !important;
        box-shadow: none !important;
    }

    .sidebar-link.active i,
    .sidebar-link:hover i,
    .sidebar-link:focus i {
        color: var(--primary) !important;
    }

    .admin-main {
        margin-right: 0 !important;
        width: 100%;
        padding: 20px;
        max-width: 100%;
    }

    .sidebar-toggle {
        display: block !important;
        color: var(--primary) !important;
    }

    .admin-header {
        padding: 15px 20px;
        margin-bottom: 30px;
    }
}

@media (max-width: 768px) {
    .agent-header-section {
        padding: 60px 0 120px;
        margin-bottom: -80px;
        border-radius: 0 0 30px 30px;
    }

    .agent-welcome h1 {
        font-size: 26px;
    }

    .agent-stats-grid {
        grid-template-columns: 1fr;
    }

    .header-search {
        display: none;
    }

    .admin-card {
        padding: 15px;
    }

    .container {
        padding: 0 10px;
    }
}

@media (max-width: 480px) {
    .agent-section-card {
        padding: 20px;
    }

    .agent-action-buttons {
        grid-template-columns: 1fr;
    }

    .logo span {
        display: none;
    }

    .navbar .logo i {
        font-size: 20px;
    }
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0px);
    }
}

.agent-stat-icon i {
    animation: float 3s ease-in-out infinite;
}

.agent-stat-card:nth-child(2) .agent-stat-icon i {
    animation-delay: 0.5s;
}

.agent-stat-card:nth-child(3) .agent-stat-icon i {
    animation-delay: 1s;
}

.progress-bar {
    background: rgba(15, 23, 42, 0.4) !important;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.progress-fill {
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.4);
    border-radius: 10px;
}

/* تحسين السكرول بار في النافذة المنبثقة */
.modal-body::-webkit-scrollbar {
    width: 5px;
}

.modal-body::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.1);
}

.modal-body::-webkit-scrollbar-thumb {
    background: #8b5cf6;
    border-radius: 10px;
}

/* نهاية الملف التصميمي */