/* ==========================================================================
   نظام الألوان المتجانسة الفاخرة للوحة التحكم (Harmonized Obsidian & Indigo Palette)
   جميع الألوان متناسقة بعناية فائقة وتوفر أقصى درجات الراحة البصرية والجمالية.
   ========================================================================== */

:root {
    /* ----------------------------------------------------------------------
       1. الألوان الرئيسية والأزرار (Primary & Brand Indigo)
       ---------------------------------------------------------------------- */
    --admin-primary: #0f172a;             /* الداكن الرئيسي (Slate 900) للأزرار وعناوين التحكم */
    --admin-primary-hover: #1e293b;       /* لون الوقوف بالماوس للزر الرئيسي (Slate 800) */
    --admin-primary-text: #ffffff;        /* النص الناصع فوق العناصر الرئيسية */

    --admin-secondary-btn-bg: #f1f5f9;    /* خلفية الأزرار الثانوية الهادئة (Slate 100) */
    --admin-secondary-btn-text: #475569;  /* نص الأزرار الثانوية (Slate 600) */
    --admin-secondary-btn-hover: #e2e8f0; /* هوفر الأزرار الثانوية (Slate 200) */

    /* ----------------------------------------------------------------------
       2. ألوان التفاعل والتوهج (Blue Accent & Glow)
       ---------------------------------------------------------------------- */
    --admin-accent: #2563eb;              /* الأزرق الملكي المميز (Royal Blue 600) للروابط والتركيز */
    --admin-accent-hover: #1d4ed8;        /* هوفر الروابط والأزرار التفاعلية (Royal Blue 700) */
    --admin-accent-gradient: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); /* التدرج الأزرق التفاعلي */
    --admin-accent-light: rgba(37, 99, 235, 0.15); /* إضاءة الفوكس الناعمة حول الحقول */

    /* ----------------------------------------------------------------------
       3. القائمة الجانبية (Obsidian Sidebar Navigation)
       ---------------------------------------------------------------------- */
    --admin-sidebar-bg: linear-gradient(180deg, #0f172a 0%, #1e293b 100%); /* تدرج خلفية السايدبار */
    --admin-sidebar-header-bg: transparent;                              /* إزالة أي طبقة خلفية أو تظليل لمنطقة اللوجو */
    --admin-sidebar-text: #94a3b8;        /* النصوص والأيقونات العادية بالسايدبار (Slate 400) */
    --admin-sidebar-hover-bg: rgba(255, 255, 255, 0.05);                  /* خلفية المرور بالماوس بالسايدبار */
    --admin-sidebar-active-bg: rgba(99, 102, 241, 0.22);                  /* خلفية الصفحة الحالية النشطة بالسايدبار */
    --admin-sidebar-active-text: #ffffff; /* لون نص وأيقونة الصفحة المفعلة */
    --admin-sidebar-section-title: #64748b;/* عناوين الأقسام الرئيسية بالسايدبار */

    /* ----------------------------------------------------------------------
       4. الشريط العلوي وخلفيات الصفحات (Header & Body Surfaces)
       ---------------------------------------------------------------------- */
    --admin-header-bg: rgba(255, 255, 255, 0.95); /* خلفية الشريط العلوي الزجاجية */
    --admin-header-border: #e2e8f0;               /* حد الهيدر العلوي */
    --admin-body-bg: #f8fafc;                     /* الخلفية المريحة العامة للصفحة (Slate 50) */
    --admin-page-title: #0f172a;                  /* لون عنوان الصفحة الرئيسي */
    --admin-breadcrumb: #64748b;                  /* لون مسار التنقل في الصفحة */

    /* ----------------------------------------------------------------------
       5. البطاقات والكروت (Card Surfaces & Shadows)
       ---------------------------------------------------------------------- */
    --admin-card-bg: #ffffff;             /* خلفية البطاقات الكلية */
    --admin-card-header-bg: #ffffff;      /* خلفية رأس البطاقة */
    --admin-card-header-text: #0f172a;    /* عنوان البطاقة الداكن المحكم */
    --admin-card-border: #e2e8f0;         /* حدود البطاقة الهادئة */
    --admin-card-radius: 16px;            /* استدارة زوايا الكروت */

    /* ----------------------------------------------------------------------
       6. الجداول والبيانات (Datatables & Grids)
       ---------------------------------------------------------------------- */
    --admin-table-header-bg: #f1f5f9;     /* خلفية ترويسة الجدول الهادئة */
    --admin-table-header-text: #475569;   /* نص ترويسة الجدول */
    --admin-table-row-hover: #f8fafc;     /* تمييز الصف عند الوقوف بالماوس */
    --admin-table-border: #e2e8f0;        /* خطوط الجداول */
    --admin-table-text: #334155;          /* نصوص بيانات الجدول */

    /* ----------------------------------------------------------------------
       7. الحالات والشارات المتجانسة (Harmonized Status Badges)
       ---------------------------------------------------------------------- */
    /* حالة النجاح والتسليم (Emerald Soft Green) */
    --admin-success-bg: #ecfdf5;
    --admin-success-text: #047857;

    /* حالة الخطر والرفض (Rose Soft Red) */
    --admin-danger-bg: #fff1f2;
    --admin-danger-text: #be123c;

    /* حالة التحذير والانتظار (Amber Soft Orange) */
    --admin-warning-bg: #fffbeb;
    --admin-warning-text: #b45309;

    /* حالة المعلومات والتوصيل (Sky Soft Blue) */
    --admin-info-bg: #f0f9ff;
    --admin-info-text: #0369a1;

    /* ----------------------------------------------------------------------
       8. حقول الإدخال والتركيز (Form Controls & Focus)
       ---------------------------------------------------------------------- */
    --admin-input-bg: #ffffff;            /* خلفية مربع الكتابة والقوائم */
    --admin-input-border: #cbd5e1;        /* حدود مربع الكتابة */
    --admin-input-text: #0f172a;          /* نص الكتابة داخل مربع الإدخال */
    --admin-input-placeholder: #94a3b8;   /* النص التوضيحي داخل مربع الإدخال */
    --admin-input-focus-border: #4f46e5;  /* حد الحقل عند التحديد بالنقر */

    /* ----------------------------------------------------------------------
       9. النوافذ المنبثقة (Modals & Dialogs)
       ---------------------------------------------------------------------- */
    --admin-modal-bg: #ffffff;            /* خلفية النافذة المنبثقة */
    --admin-modal-header-bg: #f8fafc;     /* رأس النافذة المنبثقة */
    --admin-modal-border: #e2e8f0;        /* حدود النافذة المنبثقة */
}

/* ==========================================================================
   التنسيقات والتطبيقات الفعلية للألوان المتجانسة (CSS Overrides)
   ========================================================================== */

/* الخلفيات العامة للصفحات */
body.app-default,
body {
    background-color: var(--admin-body-bg) !important;
}

/* العناوين والروابط التنقلية */
body .page-heading h1,
body h1.text-gray-900,
body .text-gray-900 {
    color: var(--admin-page-title) !important;
}

body .breadcrumb-item,
body .breadcrumb-item a {
    color: var(--admin-breadcrumb) !important;
}

/* الأزرار الرئيسية بالتدرج المتجانس */
body .btn-ecom,
body .btn-primary,
body .btn.btn-primary {
    background: var(--admin-accent-gradient) !important;
    color: var(--admin-primary-text) !important;
    border: none !important;
    border-radius: 10px !important;
    box-shadow: 0 4px 14px var(--admin-accent-light) !important;
}

body .btn-ecom:hover,
body .btn-primary:hover,
body .btn.btn-primary:hover {
    background: var(--admin-accent-hover) !important;
    color: var(--admin-primary-text) !important;
    box-shadow: 0 6px 18px rgba(79, 70, 229, 0.3) !important;
}

/* الأزرار الثانوية الهادئة */
body .btn-secondary,
body .btn-light,
body .btn.btn-light {
    background-color: var(--admin-secondary-btn-bg) !important;
    color: var(--admin-secondary-btn-text) !important;
    border-color: var(--admin-secondary-btn-bg) !important;
}

body .btn-secondary:hover,
body .btn-light:hover,
body .btn.btn-light:hover {
    background-color: var(--admin-secondary-btn-hover) !important;
    color: var(--admin-secondary-btn-text) !important;
}

/* القائمة الجانبية المظهرة للوحة التحكم */
body .app-sidebar,
body #kt_app_sidebar {
    background: var(--admin-sidebar-bg) !important;
}

body .app-sidebar-logo,
body #kt_app_header_logo,
body .app-header-logo {
    background: transparent !important;
    background-color: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: none !important;
}

body .app-sidebar-logo::before,
body .app-sidebar-logo::after,
body #kt_app_header_logo::before,
body #kt_app_header_logo::after,
body .app-header-logo::before,
body .app-header-logo::after {
    display: none !important;
    content: none !important;
}

body .app-sidebar-logo img,
body #kt_app_header_logo img,
body .app-header-logo img {
    filter: none !important;
    opacity: 1 !important;
    mix-blend-mode: normal !important;
}

body .menu-section {
    color: var(--admin-sidebar-section-title) !important;
}

body .app-sidebar-menu-primary .menu-link .menu-title,
body .app-sidebar-menu-primary .menu-link .menu-icon i {
    color: var(--admin-sidebar-text) !important;
}

body .app-sidebar-menu-primary .menu-link:hover {
    background: var(--admin-sidebar-hover-bg) !important;
}

body .app-sidebar-menu-primary .menu-link.active {
    background: var(--admin-sidebar-active-bg) !important;
    border-inline-start: 3px solid var(--admin-accent) !important;
}

body .app-sidebar-menu-primary .menu-link.active .menu-title,
body .app-sidebar-menu-primary .menu-link.active .menu-icon i,
body .app-sidebar-menu-primary .menu-link:hover .menu-title {
    color: var(--admin-sidebar-active-text) !important;
}

/* الشريط العلوي الهيدر */
body .app-header,
body #kt_app_header {
    background: var(--admin-header-bg) !important;
    border-bottom: 1px solid var(--admin-header-border) !important;
}

/* البطاقات والكروت */
body .card {
    background-color: var(--admin-card-bg) !important;
    border: 1px solid var(--admin-card-border) !important;
    border-radius: var(--admin-card-radius) !important;
}

body .card .card-header {
    background-color: var(--admin-card-header-bg) !important;
    border-bottom: 1px solid var(--admin-card-border) !important;
}

body .card .card-title,
body .card .card-title h3 {
    color: var(--admin-card-header-text) !important;
}

/* حقول المدخلات وقوائم الاختيار */
body .form-control,
body .form-select,
body .select2-container--default .select2-selection--single {
    background-color: var(--admin-input-bg) !important;
    border: 1px solid var(--admin-input-border) !important;
    color: var(--admin-input-text) !important;
    border-radius: 10px !important;
}

body .form-control::placeholder {
    color: var(--admin-input-placeholder) !important;
}

body .form-control:focus,
body .form-select:focus,
body .select2-container--default.select2-container--open .select2-selection--single {
    border-color: var(--admin-input-focus-border) !important;
    box-shadow: 0 0 0 4px var(--admin-accent-light) !important;
}

body .select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
    background-color: var(--admin-accent) !important;
    color: #ffffff !important;
}

/* الجداول */
body .table thead th {
    background-color: var(--admin-table-header-bg) !important;
    color: var(--admin-table-header-text) !important;
    border-bottom: 1px solid var(--admin-table-border) !important;
}

body .table tbody tr td {
    color: var(--admin-table-text) !important;
    border-bottom: 1px solid var(--admin-table-border) !important;
}

body .table tbody tr:hover td {
    background-color: var(--admin-table-row-hover) !important;
}

/* الشارات والتنبيهات المتجانسة */
body .bg-light-success, body .badge-light-success {
    background-color: var(--admin-success-bg) !important;
    color: var(--admin-success-text) !important;
}

body .bg-light-danger, body .badge-light-danger {
    background-color: var(--admin-danger-bg) !important;
    color: var(--admin-danger-text) !important;
}

body .bg-light-warning, body .badge-light-warning {
    background-color: var(--admin-warning-bg) !important;
    color: var(--admin-warning-text) !important;
}

body .bg-light-info, body .badge-light-info {
    background-color: var(--admin-info-bg) !important;
    color: var(--admin-info-text) !important;
}

/* النوافذ المنبثقة */
body .modal-content {
    background-color: var(--admin-modal-bg) !important;
    border-radius: 16px !important;
}

body .modal-header {
    background-color: var(--admin-modal-header-bg) !important;
    border-bottom: 1px solid var(--admin-modal-border) !important;
}

body .modal-footer {
    border-top: 1px solid var(--admin-modal-border) !important;
}

/* الروابط والنصوص الملونة */
body a.text-hover-primary:hover {
    color: var(--admin-accent-hover) !important;
}

body .text-primary {
    color: var(--admin-accent) !important;
}

body .bg-primary {
    background-color: var(--admin-accent) !important;
}

/* ==========================================================================
   Filament PHP Admin Style Pagination
   ========================================================================== */
.filament-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: 0.85rem 1.25rem;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.03);
}

.filament-pagination-info {
    font-size: 0.875rem;
    color: #64748b;
    font-weight: 500;
}

.filament-pagination-info b {
    color: #0f172a;
    font-weight: 700;
}

.filament-pagination-list {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.filament-pagination-btn {
    min-width: 36px;
    height: 36px;
    border-radius: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: #475569;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    text-decoration: none;
    transition: all 0.2s ease;
}

.filament-pagination-btn:hover:not(.disabled) {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: var(--admin-accent, #4f46e5);
}

.filament-pagination-btn.active {
    background: var(--admin-accent-gradient, linear-gradient(135deg, #6366f1 0%, #4f46e5 100%)) !important;
    border-color: transparent !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px var(--admin-accent-light, rgba(99, 102, 241, 0.25)) !important;
}

.filament-pagination-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

[dir="rtl"] .filament-pagination-btn i {
    transform: scaleX(-1);
}
