
:root {
    /* الألوان الأساسية */
    --primary: #0f2b46;
    --primary-light: #1a3d5c;
    --primary-dark: #091e33;
    --secondary: #d4a017;
    --secondary-light: #e8b830;
    --secondary-dark: #b8890f;
    --accent: #2196F3;

    /* ألوان النصوص */
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --text-light: #a0aec0;
    --text-white: #ffffff;
    --text-gold: #d4a017;

    /* ألوان الخلفيات */
    --bg-main: #f0f4f8;
    --bg-card: #ffffff;
    --bg-dark: #0f2b46;
    --bg-sidebar: #091e33;
    --bg-gradient: linear-gradient(135deg, #0f2b46 0%, #1a3d5c 50%, #0f2b46 100%);
    --bg-gold-gradient: linear-gradient(135deg, #d4a017 0%, #e8b830 50%, #d4a017 100%);

    /* الظلال */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 15px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.2);
    --shadow-gold: 0 4px 20px rgba(212, 160, 23, 0.25);
    --shadow-card: 0 2px 20px rgba(15, 43, 70, 0.08);

    /* الحدود */
    --border-color: #e2e8f0;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-lg: 20px;
    --border-radius-xl: 28px;
    --border-radius-full: 50%;

    /* الأبعاد */
    --sidebar-width: 260px;
    --header-height: 64px;
    --max-width: 1400px;

    /* الحركات */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;
    --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* -------- Dark Mode Variables -------- */
[data-theme="dark"] {
    /* الألوان الأساسية - أزرق نيلي فاخر */
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --secondary: #fbbf24;
    --secondary-light: #fcd34d;
    --secondary-dark: #d97706;
    --accent: #22d3ee;

    /* ألوان النصوص - مريحة للعين */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-light: #64748b;
    --text-white: #ffffff;
    --text-gold: #f59e0b;

    /* ألوان الخلفيات - عمق لوني ممتاز */
    --bg-main: #020617; /* خلفية شديدة العمق */
    --bg-card: #111827; /* اللون الرمادي المزرق للبطاقات */
    --bg-dark: #0f172a;
    --bg-sidebar: #0f172a;
    --bg-gradient: linear-gradient(135deg, #1e1b4b 0%, #020617 100%);
    --bg-gold-gradient: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);

    /* الظلال - ناعمة وعميقة */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.6);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.7);
    --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);

    /* الحدود */
    --border-color: #1e293b;
}

/* Smart Alert Box for Admin Dashboard */
.smart-alerts-card {
    border: 1px dashed var(--secondary) !important;
    background: rgba(212, 160, 23, 0.03) !important;
}

[data-theme="dark"] .smart-alerts-card {
    border: 1px dashed var(--secondary-dark) !important;
    background: rgba(217, 119, 6, 0.05) !important;
}

.smart-alerts-header {
    background: transparent !important;
    color: var(--secondary) !important;
    border-bottom: 1px solid rgba(212, 160, 23, 0.1) !important;
}

[data-theme="dark"] .smart-alerts-header {
    color: var(--secondary-light) !important;
}

.alert-item-box {
    background: rgba(212, 160, 23, 0.02);
    border-radius: var(--border-radius-sm);
    padding: 12px;
    height: 100%;
}

[data-theme="dark"] .alert-item-box {
    background: rgba(255, 255, 255, 0.02);
}

/* -------- Layout Utilities -------- */
.grid { display: grid; gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.full-width, .col-span-full { grid-column: 1 / -1; }
.gap-1 { gap: 10px; }
.gap-2 { gap: 20px; }
.gap-3 { gap: 30px; }
.w-100 { width: 100%; }
.text-center { text-align: center; }
.mb-3 { margin-bottom: 1rem; }
.mb-5 { margin-bottom: 3rem; }
.mt-3 { margin-top: 1rem; }

/* -------- Reset & Base -------- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    overflow-x: hidden;
    overflow-y: auto;
    max-width: 100%;
}

html {
    scroll-behavior: smooth;
    font-size: 14.5px;
}

body {
    font-family: 'Tajawal', sans-serif;
    font-size: 0.95rem;
    background: var(--bg-main);
    color: var(--text-primary);
    /* direction: rtl;  <-- REMOVED to allow html[dir] to take effect */
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    width: 100%;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

img {
    max-width: 100%;
    height: auto;
}

ul,
ol {
    list-style: none;
}

input,
select,
textarea,
button {
    font-family: inherit;
    font-size: inherit;
    outline: none;
    border: none;
}

/* -------- Typography -------- */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
}

h1 {
    font-size: 2.35rem;
}

h2 {
    font-size: 1.95rem;
}

h3 {
    font-size: 1.45rem;
}

h4 {
    font-size: 1.2rem;
}

h5 {
    font-size: 1.05rem;
}

.font-amiri {
    font-family: 'Amiri', serif;
}

/* الحفاظ على فخامة وبروز رسالة الترحيب والعناوين الكبيرة في لوحات التحكم */
.welcome-banner h1,
.welcome-banner h2,
.welcome-banner h3,
.welcome-hero h1,
.welcome-hero h2,
.welcome-hero h3,
.dashboard-hero-title,
.hero-welcome-heading,
.card[style*="bg-gradient"] h2,
.card[style*="background:var(--bg-gradient)"] h2,
.page-content > .card:first-child h2 {
    font-size: 1.95rem !important;
    font-weight: 800 !important;
    line-height: 1.35 !important;
    letter-spacing: -0.01em;
}

/* -------- Utility Classes -------- */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

.text-center {
    text-align: center;
}

.text-gold {
    color: var(--secondary);
}

.text-primary {
    color: var(--primary);
}

.text-white {
    color: var(--text-white);
}

.text-muted {
    color: var(--text-secondary);
}

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 1.5rem;
}

.mt-4 {
    margin-top: 2rem;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

.mb-4 {
    margin-bottom: 2rem;
}

.flex {
    display: flex;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.flex-wrap {
    flex-wrap: wrap;
}

.gap-1 {
    gap: 0.5rem;
}

.gap-2 {
    gap: 1rem;
}

.gap-3 {
    gap: 1.5rem;
}

.grid {
    display: grid;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* -------- Buttons -------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::after {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: var(--bg-gradient);
    color: var(--text-white);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-gold {
    background: var(--bg-gold-gradient);
    color: var(--primary-dark);
    box-shadow: var(--shadow-gold);
}

.btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(212, 160, 23, 0.35);
}

.btn-outline {
    background: transparent;
    border-color: var(--primary);
    color: var(--primary);
}

/* في الهيدر، لون الزر يجب أن يكون أبيض ليتناسب مع الخلفية الزرقاء */
.main-header .btn-outline {
    border-color: rgba(255, 255, 255, 0.3);
    color: var(--text-white) !important;
}

.main-header .btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-outline:hover {
    background: var(--primary);
    color: var(--text-white);
}

.btn-outline-blue {
    background: rgba(37, 99, 235, 0.08) !important;
    border: 1px solid #3b82f6 !important;
    color: #2563eb !important;
}
.btn-outline-blue:hover {
    background: #2563eb !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.btn-outline-danger {
    background: rgba(239, 68, 68, 0.08) !important;
    border: 1px solid #ef4444 !important;
    color: #dc2626 !important;
}
.btn-outline-danger:hover {
    background: #dc2626 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.35);
}

.btn-outline-gold {
    background: rgba(212, 160, 23, 0.08) !important;
    border: 1px solid var(--secondary, #d4a017) !important;
    color: #b45309 !important;
}
.btn-outline-gold:hover {
    background: var(--secondary, #d4a017) !important;
    color: #0f172a !important;
    box-shadow: 0 4px 12px rgba(212, 160, 23, 0.35);
}

.btn-outline-success {
    background: rgba(16, 185, 129, 0.08) !important;
    border: 1px solid #10b981 !important;
    color: #059669 !important;
}
.btn-outline-success:hover {
    background: #10b981 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

.btn-outline-warning {
    background: rgba(245, 158, 11, 0.08) !important;
    border: 1px solid #f59e0b !important;
    color: #d97706 !important;
}
.btn-outline-warning:hover {
    background: #f59e0b !important;
    color: #ffffff !important;
}

[data-theme="dark"] .btn-outline-blue {
    background: rgba(59, 130, 246, 0.15) !important;
    border-color: #60a5fa !important;
    color: #93c5fd !important;
}
[data-theme="dark"] .btn-outline-danger {
    background: rgba(239, 68, 68, 0.15) !important;
    border-color: #f87171 !important;
    color: #fca5a5 !important;
}
[data-theme="dark"] .btn-outline-gold {
    background: rgba(251, 191, 36, 0.15) !important;
    border-color: #fbbf24 !important;
    color: #fcd34d !important;
}
[data-theme="dark"] .btn-outline-warning {
    background: rgba(245, 158, 11, 0.15) !important;
    border-color: #fbbf24 !important;
    color: #fcd34d !important;
}

.btn-danger {
    background: linear-gradient(135deg, #e53e3e, #c53030);
    color: white;
}

.btn-info {
    background: linear-gradient(135deg, #0288d1, #0277bd);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #38a169, #2f855a);
    color: white;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.82rem;
    white-space: nowrap;
}

.btn-lg {
    padding: 16px 36px;
    font-size: 1.05rem;
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* -------- Form Elements -------- */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(212, 160, 23, 0.15);
}

.form-control::placeholder {
    color: var(--text-light);
}

.form-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%234a5568' d='M6 8.825L.35 3.175l.7-.7L6 7.425l4.95-4.95.7.7z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 16px center;
}

.form-select:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(212, 160, 23, 0.15);
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

.input-group {
    display: flex;
    align-items: stretch;
}

.input-group .form-control {
    border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
}

.input-group-prepend {
    display: flex;
    align-items: center;
    padding: 0 14px;
    background: var(--bg-main);
    border: 2px solid var(--border-color);
    border-left: none;
    border-radius: var(--border-radius-sm) 0 0 var(--border-radius-sm);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.9rem;
    white-space: nowrap;
}

.form-error {
    color: #e53e3e;
    font-size: 0.82rem;
    margin-top: 4px;
}

.form-hint {
    color: var(--text-light);
    font-size: 0.82rem;
    margin-top: 4px;
}

/* -------- Cards -------- */
.card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 {
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-body {
    padding: 24px;
}

.card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-main);
}

/* -------- Stat Cards -------- */
.stat-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow-card);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    width: 4px;
    height: 100%;
}

[dir="rtl"] .stat-card::before {
    right: 0;
    left: auto;
    border-radius: 0 4px 4px 0;
}

[dir="ltr"] .stat-card::before {
    left: 0;
    right: auto;
    border-radius: 4px 0 0 4px;
}

.stat-card:nth-child(1)::before {
    background: var(--secondary);
}

.stat-card:nth-child(2)::before {
    background: var(--accent);
}

.stat-card:nth-child(3)::before {
    background: #38a169;
}

.stat-card:nth-child(4)::before {
    background: #e53e3e;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.stat-icon.gold {
    background: rgba(212, 160, 23, 0.1);
    color: var(--secondary);
}

.stat-icon.blue {
    background: rgba(33, 150, 243, 0.1);
    color: var(--accent);
}

.stat-icon.green {
    background: rgba(56, 161, 105, 0.1);
    color: #38a169;
}

.stat-icon.red {
    background: rgba(229, 62, 62, 0.1);
    color: #e53e3e;
}

.stat-info h4 {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* -------- Tables -------- */
.table-responsive {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--border-radius);
}

.table-responsive::-webkit-scrollbar {
    height: 6px;
}
.table-responsive::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.04);
}
.table-responsive::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}
[data-theme="dark"] .table-responsive::-webkit-scrollbar-thumb,
.dark-theme .table-responsive::-webkit-scrollbar-thumb {
    background: #334155;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    background: var(--primary);
    color: var(--text-white);
    padding: 10px 14px;
    font-weight: 700;
    font-size: 0.85rem;
    text-align: inherit;
    /* Follows direction */
    white-space: nowrap;
}

.table th:first-child {
    border-top-left-radius: var(--border-radius-sm);
    border-top-right-radius: 0;
}

[dir="rtl"] .table th:first-child {
    border-top-left-radius: 0;
    border-top-right-radius: var(--border-radius-sm);
}

.table th:last-child {
    border-top-right-radius: var(--border-radius-sm);
    border-top-left-radius: 0;
}

[dir="rtl"] .table th:last-child {
    border-top-right-radius: 0;
    border-top-left-radius: var(--border-radius-sm);
}

.table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.86rem;
    vertical-align: middle;
    white-space: nowrap;
}

.table td.wrap,
.table th.wrap {
    white-space: normal;
}

.table td.nowrap,
.table th.nowrap,
.text-nowrap {
    white-space: nowrap !important;
}

.table tr:hover td {
    background: rgba(212, 160, 23, 0.03);
}

.table tr:last-child td {
    border-bottom: none;
}

/* -------- Badges -------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 0.76rem;
    font-weight: 600;
    white-space: nowrap !important;
}

.score-badge {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: nowrap !important;
    min-width: 72px;
    padding: 4px 12px !important;
    font-weight: 800 !important;
    font-size: 0.88rem !important;
    border-radius: 50px !important;
}

.score-badge bdi {
    display: inline-block !important;
    white-space: nowrap !important;
    direction: ltr !important;
}

.badge-gold {
    background: rgba(212, 160, 23, 0.12);
    color: var(--secondary-dark);
}

.badge-blue {
    background: rgba(33, 150, 243, 0.12);
    color: #1976D2;
}

.badge-green {
    background: rgba(56, 161, 105, 0.12);
    color: #2f855a;
}

.badge-red {
    background: rgba(229, 62, 62, 0.12);
    color: #c53030;
}

.badge-gray {
    background: rgba(160, 174, 192, 0.2);
    color: #4a5568;
}

.badge-purple {
    background: rgba(128, 90, 213, 0.12);
    color: #6b46c1;
}

/* -------- Modern Executive Alerts (Vibrant & High-Contrast in Light & Dark Mode) -------- */
.alert {
    padding: 14px 20px;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.5;
    animation: slideDown 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    z-index: 100010;
    transition: all 0.3s ease;
}

.alert i {
    font-size: 1.25rem;
    flex-shrink: 0;
}

/* Light Mode Alerts - Rich & Crisp */
.alert-success {
    background: #ecfdf5 !important;
    border: 1px solid #a7f3d0 !important;
    border-inline-start: 5px solid #10b981 !important;
    color: #065f46 !important;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.12);
}
.alert-success i {
    color: #10b981 !important;
}

.alert-error,
.alert-danger {
    background: #fef2f2 !important;
    border: 1px solid #fecaca !important;
    border-inline-start: 5px solid #ef4444 !important;
    color: #991b1b !important;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.12);
}
.alert-error i,
.alert-danger i {
    color: #ef4444 !important;
}

.alert-warning {
    background: #fffbeb !important;
    border: 1px solid #fde68a !important;
    border-inline-start: 5px solid #f59e0b !important;
    color: #92400e !important;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.12);
}
.alert-warning i {
    color: #f59e0b !important;
}

.alert-info {
    background: #eff6ff !important;
    border: 1px solid #bfdbfe !important;
    border-inline-start: 5px solid #3b82f6 !important;
    color: #1e40af !important;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.12);
}
.alert-info i {
    color: #3b82f6 !important;
}

/* Dark Mode Alerts - Luminous, High-Contrast & Anti-Pale */
[data-theme="dark"] .alert-success {
    background: rgba(16, 185, 129, 0.16) !important;
    border: 1px solid rgba(16, 185, 129, 0.38) !important;
    border-inline-start: 5px solid #34d399 !important;
    color: #6ee7b7 !important;
    box-shadow: 0 6px 24px rgba(16, 185, 129, 0.25) !important;
}
[data-theme="dark"] .alert-success i {
    color: #34d399 !important;
    text-shadow: 0 0 12px rgba(52, 211, 153, 0.6);
}

[data-theme="dark"] .alert-error,
[data-theme="dark"] .alert-danger {
    background: rgba(239, 68, 68, 0.16) !important;
    border: 1px solid rgba(239, 68, 68, 0.38) !important;
    border-inline-start: 5px solid #f87171 !important;
    color: #fca5a5 !important;
    box-shadow: 0 6px 24px rgba(239, 68, 68, 0.25) !important;
}
[data-theme="dark"] .alert-error i,
[data-theme="dark"] .alert-danger i {
    color: #f87171 !important;
    text-shadow: 0 0 12px rgba(248, 113, 113, 0.6);
}

[data-theme="dark"] .alert-warning {
    background: rgba(245, 158, 11, 0.16) !important;
    border: 1px solid rgba(245, 158, 11, 0.38) !important;
    border-inline-start: 5px solid #fbbf24 !important;
    color: #fde68a !important;
    box-shadow: 0 6px 24px rgba(245, 158, 11, 0.25) !important;
}
[data-theme="dark"] .alert-warning i {
    color: #fbbf24 !important;
    text-shadow: 0 0 12px rgba(251, 191, 36, 0.6);
}

[data-theme="dark"] .alert-info {
    background: rgba(59, 130, 246, 0.16) !important;
    border: 1px solid rgba(59, 130, 246, 0.38) !important;
    border-inline-start: 5px solid #60a5fa !important;
    color: #bfdbfe !important;
    box-shadow: 0 6px 24px rgba(59, 130, 246, 0.25) !important;
}
[data-theme="dark"] .alert-info i {
    color: #60a5fa !important;
    text-shadow: 0 0 12px rgba(96, 165, 250, 0.6);
}

/* -------- Auth Pages -------- */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    background: var(--bg-gradient);
    position: relative;
    overflow: hidden;
}

.auth-wrapper::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -25%;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: rgba(212, 160, 23, 0.05);
    animation: floatBubble 20s infinite ease-in-out;
}

.auth-wrapper::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -15%;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: rgba(212, 160, 23, 0.03);
    animation: floatBubble 15s infinite ease-in-out reverse;
}

.auth-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--text-white);
    position: relative;
    z-index: 1;
}

.auth-logo {
    margin-bottom: 24px;
}

.auth-logo img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 3px solid var(--secondary);
    box-shadow: var(--shadow-gold);
}

.auth-brand h1 {
    font-size: 2.5rem;
    color: var(--secondary);
    font-family: 'Amiri', serif;
    margin-bottom: 8px;
    text-shadow: 0 2px 10px rgba(212, 160, 23, 0.3);
}

.auth-brand p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
}

.auth-features {
    margin-top: 40px;
}

.auth-feature {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
    color: rgba(255, 255, 255, 0.8);
}

.auth-feature i {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(212, 160, 23, 0.15);
    color: var(--secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.auth-right {
    width: 520px;
    background: var(--bg-card);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 50px;
    position: relative;
    z-index: 1;
}

[dir="rtl"] .auth-right {
    border-radius: var(--border-radius-lg) 0 0 var(--border-radius-lg);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.2);
}

[dir="ltr"] .auth-right {
    border-radius: 0 var(--border-radius-lg) var(--border-radius-lg) 0;
    box-shadow: 10px 0 40px rgba(0, 0, 0, 0.2);
}

.auth-right h2 {
    font-size: 1.6rem;
    margin-bottom: 8px;
    color: var(--primary);
}

.auth-right .subtitle {
    color: var(--text-secondary);
    margin-bottom: 28px;
    font-size: 0.9rem;
}

.auth-links {
    text-align: center;
    margin-top: 20px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.auth-links a {
    color: var(--secondary);
    font-weight: 600;
}

.auth-links a:hover {
    color: var(--secondary-dark);
    text-decoration: underline;
}

/* -------- Dashboard Layout -------- */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    color: var(--text-white);
    position: fixed;
    top: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xl);
    transition: var(--transition);
}

[data-theme="dark"] .sidebar {
    background: #0f172a;
    border-inline-end: 1px solid rgba(255,255,255,0.05);
}

[dir="rtl"] .sidebar {
    right: 0;
    left: auto;
}

[dir="ltr"] .sidebar {
    left: 0;
    right: auto;
}

.sidebar,
.sidebar-nav {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.sidebar::-webkit-scrollbar,
.sidebar-nav::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

.sidebar::-webkit-scrollbar-track,
.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb,
.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    transition: background 0.2s ease;
}

.sidebar::-webkit-scrollbar-thumb:hover,
.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: var(--secondary, #d4a017);
}

.sidebar-header .brand-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 15px;
    overflow: hidden;
    max-width: 100%;
}

.sidebar-header .logo {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    flex-shrink: 0;
}

.sidebar-header .brand-text {
    flex: 1;
    min-width: 0;
}

.sidebar-header h2 {
    color: var(--secondary);
    font-size: 1rem;
    font-weight: 800;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.sidebar-header p {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.65rem;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


.sidebar-nav {
    flex: 1;
    padding: 10px 14px;
    overflow-y: auto;
}

.sidebar-section {
    margin-bottom: 8px;
}

.sidebar-section-title {
    color: rgba(255, 255, 255, 0.25);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 20px 16px 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 2px;
    transition: var(--transition);
    font-size: 0.86rem;
    position: relative;
}

.nav-item i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.nav-item:hover {
    color: var(--text-white);
    background: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
    color: var(--secondary) !important;
    background: rgba(212, 160, 23, 0.1) !important;
    border-radius: 12px;
    font-weight: 800;
}

.nav-item.active i {
    color: var(--secondary) !important;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 70%;
    background: var(--secondary);
    border-radius: 4px;
}

[dir="rtl"] .nav-item.active::before {
    right: 0;
    left: auto;
}
[dir="ltr"] .nav-item.active::before {
    left: 0;
    right: auto;
}
.nav-badge {
    background: var(--secondary);
    color: var(--primary-dark);
    padding: 2px 8px;
    border-radius: 50px;
    font-size: 0.72rem;
    font-weight: 700;
}

[dir="rtl"] .nav-badge {
    margin-right: auto;
    margin-left: 0;
}

[dir="ltr"] .nav-badge {
    margin-left: auto;
    margin-right: 0;
}

.sidebar-user {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--secondary);
}

.sidebar-user-info h4 {
    color: var(--text-white);
    font-size: 0.85rem;
    font-weight: 600;
}

.sidebar-user-info p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75rem;
}

/* Main Content */
.main-content {
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

[dir="rtl"] .main-content {
    margin-right: var(--sidebar-width);
    margin-left: 0;
    max-width: calc(100% - var(--sidebar-width));
}

[dir="ltr"] .main-content {
    margin-left: var(--sidebar-width);
    margin-right: 0;
    max-width: calc(100% - var(--sidebar-width));
}
.top-header {
    height: var(--header-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}
.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.header-right h3 {
    font-size: 1.15rem;
    color: var(--primary);
}

.header-right p {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-main);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    border: none;
    font-size: 1.1rem;
    line-height: 1;
    padding: 0;
}

.header-icon:hover {
    background: rgba(212, 160, 23, 0.1);
    color: var(--secondary);
}

.header-icon .dot {
    position: absolute;
    top: 8px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ff4d4f;
    border: 2px solid var(--bg-card);
    box-shadow: 0 0 0 2px rgba(255, 77, 79, 0.2);
}

.return-admin-btn {
    background: rgba(212, 160, 23, 0.12) !important;
    color: #d4a017 !important;
    border: 1.5px solid #d4a017 !important;
    border-radius: 20px !important;
    height: 36px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 7px !important;
    text-decoration: none !important;
    padding: 0 14px !important;
    font-weight: 700 !important;
    font-size: 0.82rem !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    transition: all 0.25s ease !important;
    box-shadow: 0 2px 8px rgba(212, 160, 23, 0.15) !important;
    box-sizing: border-box !important;
}
.return-admin-btn:hover {
    background: #d4a017 !important;
    color: #0a192f !important;
    border-color: #d4a017 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 14px rgba(212, 160, 23, 0.35) !important;
}
.return-admin-btn i {
    font-size: 0.95rem !important;
    color: inherit !important;
    line-height: 1 !important;
}
.return-admin-text-full {
    display: inline !important;
}
.return-admin-text-short {
    display: none !important;
}

[data-theme="dark"] .return-admin-btn {
    background: rgba(212, 160, 23, 0.18) !important;
    border-color: #d4a017 !important;
    color: #fbbf24 !important;
}

@media (max-width: 991.98px) {
    .return-admin-btn {
        height: 34px !important;
        padding: 0 10px !important;
        font-size: 0.78rem !important;
        gap: 5px !important;
        border-radius: 16px !important;
    }
    .return-admin-text-full {
        display: none !important;
    }
    .return-admin-text-short {
        display: inline !important;
    }
}

@media (max-width: 575.98px) {
    .return-admin-btn {
        width: 32px !important;
        height: 32px !important;
        padding: 0 !important;
        border-radius: 10px !important;
        gap: 0 !important;
    }
    .return-admin-btn i {
        font-size: 0.9rem !important;
    }
    .return-admin-text-full,
    .return-admin-text-short {
        display: none !important;
    }
}

/* =============== Global Language Switcher (Home Page) =============== */

.lang-switcher-wrap {
    position: relative;
}

.lang-btn {
    background: rgba(212, 160, 23, 0.1);
    border: 1px solid rgba(212, 160, 23, 0.3);
    color: var(--text-white);
    padding: 8px 15px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
}

.lang-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    inset-inline-end: 0;
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    min-width: 170px;
    z-index: 1001;
    border: 1px solid var(--border-color);
}

.lang-dropdown-menu.show {
    display: block;
    animation: slideUp 0.3s ease;
}

.lang-dropdown-menu a {
    display: block;
    padding: 12px 20px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    border-bottom: 1px solid var(--border-color);
}

.lang-dropdown-menu a:last-child {
    border-bottom: none;
}

[dir="rtl"] .header-icon .dot {
    right: 4px;
    left: auto;
}

[dir="ltr"] .header-icon .dot {
    right: 4px;
    left: auto;
}

.header-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
    cursor: pointer;
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.4rem;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
}

/* Page Content */
.page-content {
    flex: 1;
    padding: 20px 24px;
}

.page-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-title h2 {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-title h2 i {
    color: var(--secondary);
}

/* -------- Schedule -------- */
.schedule-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.schedule-day {
    background: var(--bg-card);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.schedule-day-header {
    background: var(--primary);
    color: var(--text-white);
    padding: 10px;
    text-align: center;
    font-weight: 600;
    font-size: 0.85rem;
}

.schedule-day-header.today {
    background: var(--secondary);
    color: var(--primary-dark);
}

.schedule-slot {
    padding: 10px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.8rem;
    text-align: center;
}

.schedule-slot:last-child {
    border-bottom: none;
}

.schedule-slot .time {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

/* -------- Video Card -------- */
.video-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: var(--transition);
}

.video-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.video-thumb {
    position: relative;
    padding-top: 56.25%;
    background: #0b1329;
    background: radial-gradient(circle at center, #1e293b 0%, #0f172a 65%, #020617 100%);
    overflow: hidden;
}

[data-theme="dark"] .video-thumb {
    background: #020617;
    background: radial-gradient(circle at center, #111827 0%, #0a0f1d 65%, #020617 100%);
}

.video-thumb img,
.video-thumb iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(212, 160, 23, 0.9);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 2;
}

.video-play-btn:hover {
    transform: translate(-50%, -50%) scale(1.1);
    background: var(--secondary);
}

.video-info {
    padding: 16px;
}

.video-info h4 {
    font-size: 0.95rem;
    margin-bottom: 6px;
}

.video-info p {
    color: var(--text-secondary);
    font-size: 0.82rem;
}

/* Smart Video Poster Enhancements */
.smart-video-poster {
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease;
}
.video-card:hover .smart-video-poster,
.admin-video-card:hover .smart-video-poster {
    transform: scale(1.03);
}
.video-card:hover .smart-poster-play-icon,
.admin-video-card:hover .smart-poster-play-icon {
    transform: scale(1.14) !important;
}

.notifications-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.notification-dropdown {
    position: absolute;
    top: calc(100% + 15px);
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) scale(0.95);
    width: 400px;
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 20px 50px rgba(0,0,0,0.15);
    border: 1px solid var(--border-color);
    z-index: 1000;
    display: none;
    transform-origin: top center;
    animation: slideDownCenter 0.35s cubic-bezier(0.165, 0.84, 0.44, 1);
    overflow: hidden;
    opacity: 0;
}

[data-theme="dark"] .notification-dropdown {
    background: #0f172a;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    border-color: rgba(255,255,255,0.05);
}

[dir="rtl"] .notification-dropdown {
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%);
    transform-origin: top center;
}

@media (max-width: 768px) {
    .top-header { padding: 0 8px; height: 60px; }
    .header-right { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
    .header-right h3 { font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }
    .header-right p { display: none; }
    .header-left { gap: 4px; flex-shrink: 0; min-width: 0; display: flex; align-items: center; }
    .header-icon { width: 34px; height: 34px; font-size: 0.95rem; }
    .return-admin-btn { width: 34px !important; height: 34px !important; border-radius: 8px !important; }
    .mobile-toggle { font-size: 1.3rem; padding: 4px; }
    .header-avatar { width: 34px; height: 34px; border-width: 1.5px; }
    
    /* ضمان ظهور جميع الأزرار مهما كانت شاشة الجوال صغيرة */
    @media (max-width: 480px) {
        .header-icon { width: 30px; height: 30px; font-size: 0.85rem; }
        .return-admin-btn { width: 30px !important; height: 30px !important; }
        .header-avatar { width: 30px; height: 30px; }
        .header-left { gap: 3px; }
        .header-right { gap: 6px; }
        .header-right h3 { max-width: 125px; font-size: 0.8rem; }
        .lang-btn { padding: 4px !important; font-size: 0.8rem !important; }
        .lang-btn span { display: none; } /* إخفاء اسم اللغة والاكتفاء بالأيقونة */
        
        /* إذا كانت الشاشة ضيقة جداً، نصغر العنوان أكثر */
        @media (max-width: 360px) {
            .header-right h3 { display: none; }
        }
    }
}

@media (max-width: 600px) {
    .notifications-dropdown { position: static !important; }
    .notification-dropdown {
        width: auto !important;
        position: fixed !important;
        left: 10px !important;
        right: 10px !important;
        top: 65px !important;
        transform: none !important;
        margin: 0 !important;
        z-index: 100000 !important;
        display: none;
        border: 1px solid var(--border-color);
        box-shadow: var(--shadow-xl);
    }
}

@media (max-width: 991px) {
    .sidebar { 
        position: fixed !important;
        top: 0;
        bottom: 0;
        width: 280px !important;
        z-index: 10001 !important; /* أعلى قيمة ممكنة ليكون في المقدمة */
        visibility: hidden;
        pointer-events: none;
        transition: transform 0.3s ease, visibility 0.3s;
    }
    .sidebar-overlay {
        z-index: 10000 !important; /* خلف السايدبار مباشرة */
    }
    [dir="rtl"] .sidebar { transform: translateX(100%); right: 0; left: auto; }
    [dir="ltr"] .sidebar { transform: translateX(-100%); left: 0; right: auto; }
    
    .sidebar.show, .sidebar.open, .sidebar.active { 
        transform: translateX(0) !important; 
        visibility: visible !important; 
        pointer-events: all !important; 
    }
    [dir="rtl"] .main-content,
    [dir="ltr"] .main-content,
    .main-content { margin: 0 !important; width: 100% !important; max-width: 100% !important; }
    
    /* Stats & Page Titles */
    .stats-row, .grid-row, .grid { display: flex !important; flex-direction: column !important; gap: 15px !important; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr !important; }
    .stat-card, .analysis-card, .card { width: 100% !important; margin-bottom: 10px; }
    
    .page-title { flex-direction: column !important; align-items: stretch !important; gap: 15px !important; }
    .page-title .btn-actions, .page-title div:not(.sidebar-header div) { 
        width: 100%; 
        display: flex !important; 
        flex-direction: column !important; 
        gap: 8px !important; 
    }
    .page-title .btn { width: 100% !important; justify-content: center !important; margin: 0 !important; }
    
    /* Table Fixes */
    .table-premium td, .table-premium th { white-space: nowrap; min-width: 120px; }
    .table-premium td:first-child { min-width: 50px; }
}

/* Sidebar Header Brand Absolute Fix */
.sidebar-header .brand-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 100%;
    overflow: hidden;
    padding: 10px;
}
.sidebar-header img { 
    width: 45px !important; 
    height: 45px !important; 
    flex-shrink: 0; 
}
.sidebar-header .brand-text h2 {
    font-size: 1rem !important;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}
.sidebar-header .brand-text p {
    font-size: 0.6rem !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.notification-dropdown.show {
    display: block;
    opacity: 1;
    transform: translateX(-50%) scale(1) !important;
}

.notification-dropdown-header {
    padding: 18px 22px;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(212, 160, 23, 0.02);
}

.notification-item {
    padding: 16px 22px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 15px;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    align-items: flex-start;
}

.notification-item:hover {
    background: rgba(212, 160, 23, 0.04);
}

.notification-item.unread {
    background: rgba(99, 102, 241, 0.03);
}

.notification-item.unread::before {
    content: '';
    position: absolute;
    top: 50%;
    inset-inline-start: 10px;
    width: 6px;
    height: 6px;
    background: var(--secondary);
    border-radius: 50%;
    transform: translateY(-50%);
}

.notification-item:last-child {
    border-bottom: none;
}

.lang-dropdown {
    position: relative;
}

.dropdown-content-afaq {
    position: absolute;
    top: calc(100% + 15px);
    width: 200px;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-color);
    z-index: 1000;
    display: none;
    padding: 8px;
    animation: slideDown 0.3s ease;
}

[dir="rtl"] .dropdown-content-afaq {
    left: 0;
}

[dir="ltr"] .dropdown-content-afaq {
    right: 0;
}

.dropdown-content-afaq.show {
    display: block;
}

.dropdown-content-afaq a {
    display: block;
    padding: 10px 15px;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: var(--border-radius-sm);
    font-size: 0.9rem;
    transition: var(--transition);
}

.dropdown-content-afaq a:hover {
    background: rgba(212, 160, 23, 0.1);
    color: var(--secondary);
}

.dropdown-content-afaq a.active {
    background: var(--secondary);
    color: white;
}

/* -------- Empty State -------- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 4rem;
    color: var(--text-light);
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    margin-bottom: 8px;
    color: var(--text-secondary);
}

/* -------- Modal -------- */
/* -------- Modal -------- */
.modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.75) !important;
    backdrop-filter: blur(4px);
    z-index: 999999 !important;
    display: none;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px;
    box-sizing: border-box;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.show {
    display: flex !important;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.3s ease;
    margin: auto !important;
    position: relative !important;
    z-index: 1000000 !important;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3,
.modal-header h2,
.modal-header h4 {
    font-size: 1.15rem;
    color: inherit;
    margin: 0;
}

.modal-header[style*="background"] h3,
.modal-header[style*="background"] h2,
.modal-header[style*="color:white"] h3,
.modal-header[style*="color: white"] h3,
.modal-header[style*="color:#fff"] h3,
.modal-header[style*="color: #fff"] h3 {
    color: #ffffff !important;
}

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-main);
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.modal-close:hover {
    background: rgba(229, 62, 62, 0.1);
    color: #e53e3e;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-start;
    gap: 12px;
}

/* -------- Pagination -------- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 24px;
}

.pagination a,
.pagination span {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
}

.pagination a {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.pagination a:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.pagination .active {
    background: var(--secondary);
    color: var(--primary-dark);
    border-color: var(--secondary);
}

/* -------- Animations -------- */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes floatBubble {

    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(-30px, 30px);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

.slide-up {
    animation: slideUp 0.5s ease;
}

/* -------- Responsive -------- */
@media (max-width: 1200px) {
    .grid-4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .sidebar {
        z-index: 10001;
        transform: translateX(100%);
        box-shadow: none;
    }

    [dir="ltr"] .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-xl);
    }

    [dir="rtl"] .main-content,
    [dir="ltr"] .main-content,
    .main-content {
        margin-right: 0 !important;
        margin-left: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .mobile-toggle {
        display: block;
    }

    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.7); /* Slightly darker for better focus */
        z-index: 10000;
        display: none;
    }


    .sidebar-overlay.show {
        display: block;
    }

    .auth-left {
        display: none;
    }

    .auth-right {
        width: 100%;
        border-radius: 0;
    }

    .schedule-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .page-content {
        padding: 16px;
    }

    .top-header {
        padding: 0 12px;
        gap: 8px;
    }

    .header-left {
        gap: 8px;
    }

    .header-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .header-avatar {
        width: 34px;
        height: 34px;
    }

    .header-right h3 {
        font-size: 1rem;
    }

    .page-title {
        flex-direction: column;
        align-items: flex-start;
    }

    .stat-card {
        padding: 18px;
    }

    .schedule-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-wrapper {
        display: block !important;
        min-height: 100vh;
        height: auto !important;
    }

    .main-content {
        margin: 0 !important;
        width: 100% !important;
        height: auto !important;
        display: block !important;
    }

    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .auth-right {
        padding: 30px 20px;
    }

    .schedule-grid {
        grid-template-columns: 1fr;
    }

    .btn-lg {
        padding: 12px 24px;
        font-size: 0.95rem;
    }
}

/* -------- Loading Skeleton -------- */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--border-radius-sm);
}

.skeleton-text {
    height: 14px;
    margin-bottom: 8px;
    width: 80%;
}

.skeleton-title {
    height: 20px;
    margin-bottom: 12px;
    width: 60%;
}

/* -------- Tooltips -------- */
[data-tooltip] {
    position: relative;
    cursor: pointer;
}

/* Fix for buttons with overflow:hidden clipping the tooltip */
[data-tooltip]:hover {
    overflow: visible !important;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%) translateY(5px);
    background: #1a202c;
    color: #fff;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    pointer-events: none;
    z-index: 99999;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    font-weight: 500;
    font-family: 'Tajawal', sans-serif;
}

[data-tooltip]::before {
    content: "";
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%) translateY(5px);
    border-width: 6px;
    border-style: solid;
    border-color: #1a202c transparent transparent transparent;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 99999;
}

[data-tooltip]:hover::after,
[data-tooltip]:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* -------- Scrollbar -------- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
    background: #c4c4c4;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a0a0a0;
}

[data-theme="dark"] ::-webkit-scrollbar-track {
    background: #091e33;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.18);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.35);
}

/* -------- Group Card -------- */
.group-card-header::after, .arabic-prefix {
    content: '﷽';
    font-family: var(--font-arabic, 'Amiri', serif);
    display: block;
    text-align: center;
    font-size: 2.5rem;
    color: var(--secondary);
    margin-bottom: 20px;
    font-weight: normal;
    text-shadow: 0 0 15px rgba(212, 160, 23, 0.4);
    transform: translateX(-50%);
    position: relative;
    left: 50%;
    width: max-content;
}

/* إخفاء محتوى span في حالة كان يحتوي على text، والاعتماد على ::after للبسملة الموحدة */
.arabic-prefix {
    content: none;
}
.arabic-prefix::after {
    content: '﷽';
    font-family: var(--font-arabic, 'Amiri', serif);
    display: block;
    text-align: center;
    font-size: 3rem; /* أو 2.5rem كما يفضل */
    color: var(--secondary);
    margin-bottom: 5px;
    font-weight: normal;
    text-shadow: 0 0 15px rgba(212, 160, 23, 0.4);
}

.group-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition: var(--transition);
}

.group-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.group-card-header {
    background: var(--bg-gradient);
    padding: 20px;
    color: var(--text-white);
    position: relative;
}

.group-card-header::after {
    content: '﷽';
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2.5rem;
    opacity: 0.85;
    color: var(--secondary);
    font-family: 'Amiri', serif;
}

.group-card-header h4 {
    color: var(--secondary);
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.group-card-header p {
    font-size: 0.82rem;
    opacity: 0.7;
}

.group-card-body {
    padding: 20px;
}

.group-card-meta {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.group-meta-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.group-meta-item i {
    width: 18px;
    color: var(--secondary);
}

.group-card-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* -------- Avatar Stack -------- */
.avatar-stack {
    display: flex;
    direction: ltr;
}

.avatar-stack img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--bg-card);
    margin-left: -8px;
    object-fit: cover;
}

.avatar-stack .more {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--text-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    margin-left: -8px;
    border: 2px solid var(--bg-card);
}

/* -------- Live Session Indicator -------- */
.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(229, 62, 62, 0.1);
    color: #e53e3e;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 600;
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e53e3e;
    animation: pulse 1.5s infinite;
}

/* -------- Course Type Colors -------- */
.course-quran {
    border-top: 3px solid var(--secondary);
}

.course-tajweed {
    border-top: 3px solid #38a169;
}

.course-tafseer {
    border-top: 3px solid var(--accent);
}

.course-memorization {
    border-top: 3px solid #805ad5;
}

/* -------- Tab Navigation -------- */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 24px;
}

.tab {
    padding: 12px 24px;
    cursor: pointer;
    color: var(--text-secondary);
    font-weight: 600;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: var(--transition);
    font-size: 0.9rem;
}

.tab:hover {
    color: var(--primary);
}

.tab.active {
    color: var(--secondary);
    border-bottom-color: var(--secondary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* -------- Profile Header -------- */
.profile-header {
    background: var(--bg-gradient);
    border-radius: var(--border-radius-lg);
    padding: 40px;
    color: var(--text-white);
    display: flex;
    align-items: center;
    gap: 30px;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

.profile-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -20%;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: rgba(212, 160, 23, 0.05);
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 4px solid var(--secondary);
    object-fit: cover;
    box-shadow: var(--shadow-gold);
    position: relative;
    z-index: 1;
}

.profile-info {
    position: relative;
    z-index: 1;
}

.profile-info h2 {
    color: var(--text-white);
    margin-bottom: 4px;
}

.profile-info p {
    opacity: 0.7;
    font-size: 0.9rem;
}

/* ============================================
   إضافات النخبة - Premium UI Enhancement
   ============================================ */

/* تأثيرات الزجاج (Glassmorphism) */
.glass-panel {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
}

.glass-dark {
    background: rgba(15, 43, 70, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* عمق متقدم للبطاقات */
.card-premium {
    border: none;
    border-radius: var(--border-radius-lg);
    background: var(--bg-card);
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.05), 0 5px 15px -8px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}

.card-premium:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.1);
}

/* أيقونة الحالة المباشرة الراقية */
.status-indicator:not(.avatar-status-dot) {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
}

.status-indicator.live {
    background: rgba(229, 62, 62, 0.1);
    color: #e53e3e;
}

.status-indicator.live .dot {
    width: 8px;
    height: 8px;
    background: #e53e3e;
    border-radius: 50%;
    position: relative;
    box-shadow: 0 0 0 rgba(229, 62, 62, 0.4);
    animation: livePulse 2s infinite;
}

@keyframes livePulse {
    0% {
        box-shadow: 0 0 0 0 rgba(229, 62, 62, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(229, 62, 62, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(229, 62, 62, 0);
    }
}

/* تأثيرات الأزرار */
.btn-premium {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-premium::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300%;
    height: 300%;
    background: rgba(255, 255, 255, 0.1);
    transition: var(--transition-slow);
    transform: translate(-50%, -50%) scale(0);
    border-radius: 50%;
    z-index: -1;
}

.btn-premium:hover::after {
    transform: translate(-50%, -50%) scale(1);
}

/* نصوص التايتل الذهبية */
.text-gradient-gold {
    background: var(--bg-gold-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

/* تحسين الجريد */
.grid-premium {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

/* حركات الدخول */
.fade-in-up {
    animation: fadeInUp 0.6s cubic-bezier(0.23, 1, 0.32, 1) both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* -------- Toast Notification (إشعار منبثق) -------- */
.afaq-toast {
    position: fixed;
    top: 20px;
    /* Fixed positions based on direction */
}
html[dir="rtl"] .afaq-toast {
    left: 20px;
    right: auto;
}
html[dir="ltr"] .afaq-toast {
    right: 20px;
    left: auto;
}
.afaq-toast {
    /* transform removed */
    z-index: 100020; /* Higher than alerts and sidebars */
    background: linear-gradient(135deg, #0f2b46, #1a3d5c);
    color: white;
    padding: 16px 22px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(212, 160, 23, 0.3);
    min-width: 320px;
    max-width: 450px;
    font-family: 'Tajawal', sans-serif;
    direction: inherit;
    animation: toastSlide 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    border-inline-start: 4px solid var(--secondary);
    cursor: pointer;
    transition: opacity 0.3s, transform 0.3s;
}

.afaq-toast:hover {
    transform: scale(1.02);
}

@keyframes toastSlide {
    from {
        opacity: 0;
        transform: translateY(0) scale(0.95);
        /* Simple fade and scale is safer across directions */
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 480px) {
    .afaq-toast {
        min-width: auto;
        inset-inline-start: 10px;
        inset-inline-end: 10px;
        left: 10px;
        right: 10px;
        transform: none;
        max-width: none;
    }

    @keyframes toastSlide {
        from {
            opacity: 0;
            transform: translateY(-30px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .afaq-toast:hover {
        transform: none;
    }
}

/* =============== Global Preloader =============== */
#global-preloader,
#homepage-preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-main);
    z-index: 999999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#global-preloader.fade-out,
#homepage-preloader.fade-out {
    opacity: 0;
    visibility: hidden;
}

.preloader-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.circular-loader {
    position: relative;
    width: 80px;
    height: 80px;
}

.loader-circle {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 4px solid rgba(212, 160, 23, 0.2);
    border-top-color: var(--secondary);
    border-right-color: var(--primary);
    animation: spinLoader 1.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

.loader-icon-wrap {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--primary);
    font-size: 24px;
    /* Optional pulse if needed */
}

.loader-text {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 1px;
}

.pulse-text {
    animation: textPulse 1.5s ease-in-out infinite;
}

@keyframes spinLoader {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes textPulse {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
        color: var(--secondary);
    }
}

/* =============== Scroll Progress Bar =============== */
#scrollProgressBar {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--secondary) 0%, var(--primary) 100%);
    width: 0%;
    z-index: 999998;
    /* Just below preloader, but above header */
    transition: width 0.1s ease;
    border-radius: 0 4px 4px 0;
    box-shadow: 0 0 10px rgba(212, 160, 23, 0.5);
}

/* =============== Global Language Switcher =============== */
.lang-switcher-wrap {
    position: relative;
}

.lang-btn {
    background: rgba(212, 160, 23, 0.1);
    border: 1px solid rgba(212, 160, 23, 0.3);
    color: var(--text-white);
    padding: 8px 15px;
    border-radius: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.lang-btn:hover {
    background: var(--secondary);
    color: var(--primary);
}

.lang-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: var(--bg-card);
    /* Use card background which is white in light mode, dark blue in dark mode */
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    min-width: 170px;
    z-index: 1001;
    border: 1px solid var(--border-color);
}

.lang-dropdown.show {
    display: block;
    animation: slideUp 0.3s ease;
}

.lang-dropdown a {
    display: block;
    padding: 12px 20px;
    color: var(--text-primary);
    /* Use theme text color (dark in light mode, white in dark mode) */
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    border-bottom: 1px solid var(--border-color);
}

.lang-dropdown a:last-child {
    border-bottom: none;
}

.lang-dropdown a:hover {
    background: var(--secondary);
    color: var(--primary);
}

.lang-dropdown a.active {
    background: rgba(212, 160, 23, 0.1);
    color: var(--secondary);
}

/* =============== Mobile Sidebar Menu =============== */
.mobile-sidebar {
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100vh;
    background: #091e33; /* Dark solid foundation */
    z-index: 100001; /* Must be higher than overlay */

    transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.3);
    border-left: 1px solid rgba(255, 255, 255, 0.05);
}

.mobile-sidebar.open {
    right: 0;
}

.sidebar-header {
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}


.close-sidebar {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

.sidebar-body {
    padding: 20px 0;
    flex: 1;
    overflow-y: auto;
}

.mobile-nav {
    display: flex;
    flex-direction: column;
}

.mobile-nav-link {
    padding: 15px 25px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: 0.3s;
}

.mobile-nav-link i {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
    background: rgba(212, 160, 23, 0.1);
    color: var(--secondary);
}

.gold-text {
    color: var(--secondary) !important;
}

@media (max-width: 991.98px) {
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.6);
        z-index: 10000; 
        display: none;
        animation: fadeIn 0.3s ease;
    }

    .sidebar-overlay.show,
    .sidebar-overlay.active {
        display: block !important;
    }

    /* On mobile / phone screens: hide sidebar collapse button, show hamburger menu button */
    .sidebar-collapse-btn {
        display: none !important;
    }
    .sidebar-toggle-btn,
    .sidebar-toggle-btn.mobile-menu-btn,
    .mobile-menu-btn,
    #sidebarToggle {
        display: inline-flex !important;
    }
}

@media (min-width: 992px) {
    .sidebar-overlay,
    #sidebarOverlay,
    .sidebar-overlay.show,
    .sidebar-overlay.active,
    #sidebarOverlay.show,
    #sidebarOverlay.active {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    /* On laptop / desktop screens: hide hamburger menu in topbar, show collapse button in sidebar */
    .sidebar-toggle-btn,
    .sidebar-toggle-btn.mobile-menu-btn,
    .mobile-menu-btn,
    #sidebarToggle {
        display: none !important;
    }
    .sidebar-collapse-btn {
        display: inline-flex !important;
    }
}

.sidebar-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(212, 160, 23, 0.1);
    border: 1px solid rgba(212, 160, 23, 0.25);
    color: var(--secondary, #d4a017);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1.1rem;
}

.sidebar-toggle-btn:hover {
    background: var(--secondary, #d4a017);
    color: var(--primary-dark, #0a192f) !important;
    border-color: var(--secondary, #d4a017);
    transform: scale(1.05);
}

.mobile-menu-btn {
    display: none;
    background: rgba(212, 160, 23, 0.1);
    border: 1px solid rgba(212, 160, 23, 0.2);
    color: var(--secondary);
    width: 42px;
    height: 42px;
    border-radius: 12px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.mobile-menu-btn i {
    font-size: 1.2rem;
}

.mobile-menu-btn:hover {
    background: var(--secondary);
    color: var(--primary-dark);
    border-color: var(--secondary);
    transform: scale(1.05);
}

/* Header UI Elements */
.btn-round-icon {
    border-radius: 50% !important;
    width: 40px !important;
    height: 40px !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    border-color: rgba(255, 255, 255, 0.2) !important;
    color: white !important;
}

.btn-capsule {
    border-radius: 50px !important;
    padding: 8px 20px !important;
}

@media (max-width: 991px) {
    .mobile-menu-btn {
        display: flex;
    }

    .desktop-btns {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .grid, .grid-2, .grid-3, .grid-4 { 
        grid-template-columns: 1fr !important; 
    }
    
    .card-body {
        flex-direction: column !important;
        text-align: center;
        padding: 20px !important;
    }

/* Gamification Avatars */
.header-avatar.avatar-level-1 { border: 2px solid #cd7f32; box-shadow: 0 0 8px rgba(205, 127, 50, 0.5); }
.header-avatar.avatar-level-2 { border: 2px solid #c0c0c0; box-shadow: 0 0 10px rgba(192, 192, 192, 0.6); }
.header-avatar.avatar-level-3 { border: 2px solid #ffd700; box-shadow: 0 0 12px rgba(255, 215, 0, 0.8); }
.header-avatar.avatar-level-4 { border: 3px solid #ff4500; box-shadow: 0 0 15px rgba(255, 69, 0, 0.9); animation: pulseGold 2s infinite; }

@keyframes pulseGold {
    0% { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(255, 215, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0); }
}
    
    .session-date-box {
        width: 100% !important;
        max-width: none !important;
        margin-bottom: 15px;
    }
    
    [dir="rtl"] .main-content,
    [dir="ltr"] .main-content,
    .main-content {
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .page-content {
        padding: 15px !important;
    }

    /* Responsive Profile Grid */
    .profile-grid-responsive {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }

    /* Responsive OTP Boxes */
    .otp-box-input {
        width: 42px !important;
        height: 52px !important;
        font-size: 20px !important;
    }
    
    .otp-container {
        gap: 5px !important;
    }
}

@keyframes slideDownCenter {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   Homepage Specific Styles
   ============================================ */
.main-title { font-size: 4.5rem; margin-bottom: 25px; line-height: 1.4; }
.main-header { position: absolute; top: 0; left: 0; width: 100%; z-index: 1000; padding: 20px 0; background: transparent; transition: all 0.3s; }

.desktop-nav .nav-link { color: white; font-weight: 600; padding: 8px 15px; opacity: 0.8; transition: all 0.3s; }
.desktop-nav .nav-link:hover, .desktop-nav .nav-link.active { opacity: 1; color: var(--secondary); }
.site-name { color: white; font-size: 1.8rem; font-weight: 700; white-space: nowrap; }
.header-logo-img { height: 50px; width: auto; object-fit: contain; }

.welcome-badge { display: inline-flex; align-items: center; gap: 10px; background: rgba(212,160,23,0.15); color: var(--secondary); padding: 8px 20px; border-radius: 50px; font-weight: 700; border: 1px solid rgba(212,160,23,0.3); }
.hero-logo-img { max-width: 380px; width: 100%; filter: drop-shadow(0 0 80px rgba(212,160,23,0.25)); animation: floatLogo 6s ease-in-out infinite; z-index: 2; position: relative; }
.hero-img-wrap { position: relative; display: inline-block; }
.glow-effect { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 300px; height: 300px; background: radial-gradient(circle, rgba(212,160,23,0.2) 0%, transparent 70%); z-index: 1; pointer-events: none; }

.icon-box-premium { width: 90px; height: 90px; border-radius: 25px; display: flex; align-items: center; justify-content: center; margin: 0 auto; transition: transform 0.3s; }
.card-premium:hover .icon-box-premium { transform: scale(1.1) rotate(5deg); }

.stat-item { padding: 30px; }
.stat-num { font-size: 3rem; font-weight: 850; color: var(--primary); margin-bottom: 5px; }
.stat-label { color: var(--secondary); font-weight: 700; text-transform: uppercase; font-size: 0.85rem; letter-spacing: 1px; }

@keyframes floatLogo { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-20px); } }

@media (max-width: 1200px) {
    .main-title { font-size: 3.5rem !important; }
    .hero-logo-img { max-width: 300px; }
}

@media (max-width: 991px) {
    .site-name { display: none; }
    .main-header .container { flex-wrap: nowrap; justify-content: space-between; padding: 10px 15px !important; }
    .desktop-nav { display: none !important; }
    .main-title { font-size: 2rem !important; margin-top: 10px; text-align: center; line-height: 1.5 !important; }
    .hero-logo-img { max-width: 150px; display: block; margin: 20px auto; }

    .hero-home { padding-top: 120px !important; text-align: center; }
    .hero-btns { flex-direction: column !important; align-items: center; width: 100% !important; gap: 12px !important; margin-top: 30px !important; display: flex !important; }
    .hero-btns .btn { width: 100% !important; max-width: 380px !important; margin: 0 auto !important; font-size: 1.1rem !important; padding: 16px !important; justify-content: center !important; display: flex !important; }
    .nav-actions { gap: 6px !important; }
    .hero-desc { font-size: 1.1rem !important; margin-bottom: 30px; margin-left: auto; margin-right: auto; text-align: center; }
}

@media (max-width: 768px) {
    .flex-between { flex-wrap: wrap; justify-content: center; gap: 15px; }
    .stat-num { font-size: 2rem; }
    .stat-item { padding: 15px; }
    .welcome-badge { font-size: 0.85rem; padding: 6px 15px; margin-bottom: 20px; display: inline-flex; }
    section { padding: 60px 0 !important; }
    h2 { font-size: 1.8rem !important; }
}

@media (max-width: 480px) {
    .hero-home { padding-top: 130px !important; }
    .main-title { font-size: 1.75rem !important; line-height: 1.5 !important; }
    .hero-desc { font-size: 1rem !important; }

    .hero-btns .btn { font-size: 1rem !important; padding: 14px !important; }
    .nav-actions .btn-round-icon { width: 35px !important; height: 35px !important; }
    .lang-btn { padding: 6px 10px; font-size: 0.8rem; }
    .mobile-menu-btn { width: 35px; height: 35px; }
}

/* ============================================
   Footer & Contact Styles
   ============================================ */
.main-footer { padding: 80px 0 40px; background: #060b13; color: white; margin-top: 0; }
.footer-site-name { color: var(--secondary); font-size: 2.5rem; margin-bottom: 10px; }
.footer-site-desc { opacity: 0.7; max-width: 300px; line-height: 1.6; }

.footer-contact { text-align: center; }
.contact-info-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 20px; opacity: 0.9; }
.contact-item { text-align: center; background: rgba(255,255,255,0.05); padding: 15px 20px; border-radius: 12px; min-width: 160px; border: 1px solid rgba(255,255,255,0.1); transition: var(--transition); }
.contact-item:hover { background: rgba(255,255,255,0.1); transform: translateY(-3px); }
.footer-icon { color: var(--secondary); display: block; font-size: 1.5rem; margin-bottom: 10px; }
.contact-text { display: block; color: #fff; font-weight: bold; }
.phone-text { font-size: 1.15rem; letter-spacing: 0.5px; }
.email-text { font-size: 0.95rem; word-break: break-all; }

.social-links-wrap { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.social-circle { width: 45px; height: 45px; border-radius: 50%; background: rgba(255,255,255,0.05); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); color: #fff; text-decoration: none; border: 1px solid rgba(255,255,255,0.1); }
.social-circle:hover { background: var(--secondary); color: var(--primary); transform: translateY(-5px) rotate(360deg); box-shadow: 0 10px 20px rgba(212, 160, 23, 0.2); }
.social-circle.fb:hover { background: #3b5998; color: white; }
.social-circle.wa:hover { background: #25d366; color: white; }
.social-circle.ig:hover { background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%); color: white; }
.social-circle.tw:hover { background: #1da1f2; color: white; }
.social-circle.yt:hover { background: #ff0000; color: white; }

.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 30px; text-align: center; margin-top: 40px; }
.copyright-text { opacity: 0.6; font-size: 0.85rem; }

@media (max-width: 768px) {
    .footer-top { flex-direction: column; gap: 40px; text-align: center; }
    .footer-brand { display: flex; flex-direction: column; align-items: center; }
    .contact-info-grid { flex-direction: column; align-items: center; gap: 15px; }
    .contact-item { width: 100%; max-width: 300px; }
}

/* Footer Links Custom Style */
.footer-nav-list li { margin-bottom: 12px; }
.footer-nav-link { color: rgba(255,255,255,0.7); font-size: 0.92rem; transition: all 0.3s; display: flex; align-items: center; gap: 8px; }
.footer-nav-link i { font-size: 0.7rem; opacity: 0.5; transition: transform 0.3s; }
.footer-nav-link:hover { color: var(--secondary); padding-inline-start: 5px; }
.footer-nav-link:hover i { transform: translateX(-3px); opacity: 1; }

/* Modern Chat Enhancements */
.message-bubble { backdrop-filter: blur(5px); transition: all 0.3s ease; }
.message-wrapper.me .message-bubble { background: linear-gradient(135deg, #0f2b46 0%, #1a3d5c 100%) !important; border: 1px solid rgba(255,255,255,0.1); box-shadow: 0 4px 15px rgba(15, 43, 70, 0.2) !important; }
.message-wrapper.others .message-bubble { background: var(--bg-card) !important; border: 1px solid var(--border-color); box-shadow: 0 4px 15px rgba(0,0,0,0.05) !important; }
[data-theme="dark"] .message-wrapper.others .message-bubble { background: rgba(255,255,255,0.05) !important; border: 1px solid rgba(255,255,255,0.1); }
.chat-empty-state i { filter: drop-shadow(0 0 10px rgba(212, 160, 23, 0.3)); animation: pulse 2s infinite; }
@keyframes pulse { 0% { transform: scale(1); opacity: 0.6; } 50% { transform: scale(1.05); opacity: 1; } 100% { transform: scale(1); opacity: 0.6; } }

/* -------- Package Details Button -------- */
.pkg-details-btn {
    background: none;
    border: none;
    color: var(--secondary);
    font-size: 0.85rem;
    cursor: pointer;
    font-weight: bold;
    padding: 5px 0;
    width: 100%;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    transition: var(--transition);
}
.pkg-details-btn:hover {
    color: var(--secondary-light);
    transform: scale(1.03);
}

/* -------- Package Details Modal -------- */
.pkg-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 100050;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 20px;
    visibility: hidden;
}
.pkg-modal-overlay.active {
    opacity: 1;
    pointer-events: all;
    visibility: visible;
}
.pkg-modal {
    background: var(--bg-card);
    border-radius: 20px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.85) translateY(30px);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-color);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}
.pkg-modal-overlay.active .pkg-modal {
    transform: scale(1) translateY(0);
}
.pkg-modal-close {
    position: absolute;
    top: 15px;
    z-index: 10;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.15);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: var(--transition);
}
[dir="rtl"] .pkg-modal-close { left: 15px; right: auto; }
[dir="ltr"] .pkg-modal-close { right: 15px; left: auto; }
.pkg-modal-close:hover {
    background: rgba(0, 0, 0, 0.3);
    transform: rotate(90deg);
}
.pkg-modal-header {
    background: var(--bg-gold-gradient);
    padding: 30px 25px;
    text-align: center;
    flex-shrink: 0;
}
.pkg-modal-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 1.5rem;
    color: var(--primary-dark);
}
.pkg-modal-title {
    font-size: 1.5rem;
    color: var(--primary-dark) !important;
    margin: 0;
}
.pkg-modal-body {
    padding: 25px;
    overflow-y: auto;
}
.pkg-modal-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.9;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}
.pkg-modal-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.pkg-modal-info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: rgba(212, 160, 23, 0.06);
    border-radius: 12px;
    border: 1px solid rgba(212, 160, 23, 0.1);
    font-size: 0.95rem;
}
.pkg-modal-info-item i {
    color: var(--secondary);
    font-size: 1rem;
    width: 20px;
    text-align: center;
}
.pkg-modal-info-item strong {
    color: var(--secondary);
    font-size: 1.1rem;
    margin-inline-start: auto;
}

[data-theme="dark"] .pkg-modal {
    border-color: rgba(255, 255, 255, 0.1);
}
[data-theme="dark"] .pkg-modal-close {
    background: rgba(255, 255, 255, 0.1);
}
[data-theme="dark"] .pkg-modal-info-item {
    background: rgba(251, 191, 36, 0.06);
    border-color: rgba(251, 191, 36, 0.1);
}

@media (max-width: 480px) {
    .pkg-modal {
        max-width: 100%;
        border-radius: 16px;
    }
    .pkg-modal-header {
        padding: 25px 20px;
    }
    .pkg-modal-body {
        padding: 20px;
    }
}

@media (max-width: 768px) {
    /* ????? ?????? ?? ???????? */
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }

    /* ????? ??????? ???? ?????? ???????? */
    .table-responsive {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border: 1px solid var(--border-color);
        margin-bottom: 15px;
    }

    .table th, .table td {
        white-space: nowrap !important;
        padding: 10px 12px !important;
        font-size: 0.85rem !important;
    }

    /* ????? ???? ???????? */
    .card-body, .page-content {
        padding: 15px !important;
    }

    .stat-card {
        padding: 15px !important;
        gap: 12px !important;
    }

    .stat-icon {
        width: 45px !important;
        height: 45px !important;
        font-size: 1.2rem !important;
    }

    .stat-info h4 {
        font-size: 1.4rem !important;
    }

    /* ????? ??????? ??????? ??????? */
    h1 { font-size: 1.6rem !important; }
    h2 { font-size: 1.4rem !important; }
    h3 { font-size: 1.2rem !important; }

    /* ????? ????? ????????? ????? ????? */
    .btn {
        padding: 10px 16px !important;
        font-size: 0.85rem !important;
    }

    /* ????? ????? ??????? ?? ?????? ????? AI */
    .smart-alerts-card .grid {
        grid-template-columns: 1fr !important;
    }
    
    .main-content {
        padding: 10px !important;
        margin-right: 0 !important;
        margin-left: 0 !important;
    }
}

/* ??????? ?????? ?????? ????? ???????? */
.ai-quick-queries {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

@media (max-width: 768px) {
    .ai-quick-queries {
        grid-template-columns: 1fr !important;
    }
    
    .ai-input-group input {
        padding-left: 80px !important;
        font-size: 0.8rem !important;
        height: 50px !important;
    }
    
    .ai-input-group button {
        width: 70px !important;
        font-size: 0.7rem !important;
        padding: 0 !important;
    }
    
    /* ??? ?????? ?????? ???????? */
    canvas {
        min-width: 300px;
    }
    
    /* ????? ??? ?????? ?? ???????? */
    .page-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px;
    }
}

/* ??????? ?????? ????? ?????? ?????? - ??????? ?????? */
@media (max-width: 768px) {
    /* 1. ????? ???? ????? ???????? ??? ?????? ????? ???? */
    .grid-2, .grid-3, .grid-4, .analytics-main-grid, .analytics-grid {
        grid-template-columns: 1fr !important;
        display: grid !important;
        gap: 15px !important;
    }

    /* 2. ????? ???? ????????? ???????? */
    .analytics-main-grid {
        display: flex !important;
        flex-direction: column !important;
    }
    
    .chart-container {
        min-height: 300px !important;
        width: 100% !important;
        padding: 15px !important;
    }

    canvas {
        max-height: 300px !important;
    }

    /* 3. ????? ??????? ?????? ???????? */
    .table-responsive {
        width: 100% !important;
        overflow-x: auto !important;
        display: block !important;
        -webkit-overflow-scrolling: touch !important;
        margin-bottom: 20px !important;
        border-radius: 12px;
    }

    table {
        min-width: 600px !important; /* ???? ???? ????? ????? ??????? */
    }

    /* 4. ????? ????? ????? ?????? ?????? */
    .t-card-actions {
        flex-wrap: wrap !important;
        justify-content: center !important;
        padding: 10px !important;
    }

    .t-action {
        flex: 1 1 45% !important; /* ??? ??????? ???? ??? ??????? ??????? ????? ????? */
        justify-content: center !important;
        margin-bottom: 5px;
    }

    .t-action.delete {
        background: #fee2e2 !important;
        color: #ef4444 !important;
        border-color: #fecaca !important;
    }

    /* 5. ????? ????? ????? ???? */
    .form-group.full-width {
        grid-column: 1 / -1 !important;
    }
    
    .modal-body {
        padding: 15px !important;
    }

    /* 6. ????? ???? ???????? */
    .content-container {
        flex-direction: column !important;
    }
    
    .form-card {
        width: 100% !important;
        max-width: 100% !important;
        flex: none !important;
    }
}

/* ===== SweetAlert Toast Positioning Fix ===== */
.swal2-container.swal2-top,
.swal2-container.swal2-top-start,
.swal2-container.swal2-top-end,
.swal2-container.app-swal-toast-container {
    top: 85px !important;
    z-index: 99999999 !important;
    padding: 10px 20px !important;
    pointer-events: none !important;
}

.swal2-container.swal2-top .swal2-popup,
.swal2-container.swal2-top-start .swal2-popup,
.swal2-container.swal2-top-end .swal2-popup,
.swal2-container.app-swal-toast-container .swal2-popup {
    pointer-events: auto !important;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.25), 0 4px 12px rgba(0, 0, 0, 0.12) !important;
    border-radius: 14px !important;
    border: 1px solid rgba(245, 166, 35, 0.3) !important;
}

/* ===== FullCalendar Universal Dark Mode Theme Overrides ===== */
[data-theme="dark"] .fc,
[data-theme="dark"] .fc-theme-standard th,
[data-theme="dark"] .fc-theme-standard td,
[data-theme="dark"] .fc-scrollgrid-section-header,
[data-theme="dark"] .fc-scrollgrid-section-header > th,
[data-theme="dark"] .fc-scrollgrid-section-header > td,
[data-theme="dark"] .fc table.fc-col-header,
[data-theme="dark"] .fc thead,
[data-theme="dark"] .fc-col-header-cell {
    background-color: #111827 !important;
    border-color: #1e293b !important;
    color: #f1f5f9 !important;
}
[data-theme="dark"] .fc .fc-col-header-cell-cushion {
    color: #f1f5f9 !important;
}
[data-theme="dark"] .fc .fc-timegrid-axis,
[data-theme="dark"] .fc .fc-timegrid-slot,
[data-theme="dark"] .fc .fc-timegrid-slot-label,
[data-theme="dark"] .fc .fc-timegrid-divider {
    background-color: #0f172a !important;
    border-color: #1e293b !important;
    color: #94a3b8 !important;
}

/* ===== الشريط العائم للإجراءات الجماعية (Floating Bulk Bar) بتجاوب مثالي للجوال والحاسوب ===== */
.bulk-floating-toolbar {
    position: fixed;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    background: #0f2b46;
    color: #fff;
    border-radius: 50px;
    padding: 10px 24px;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
    z-index: 9999;
    align-items: center;
    gap: 16px;
    border: 1px solid rgba(212, 160, 23, 0.5);
    backdrop-filter: blur(10px);
    transition: all 0.25s ease;
}

[data-theme="dark"] .bulk-floating-toolbar {
    background: #0d1e33;
    border-color: rgba(212, 160, 23, 0.6);
    box-shadow: 0 16px 45px rgba(0, 0, 0, 0.7);
}

.bulk-tb-info {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    font-size: 0.92rem;
    font-weight: 600;
}

.bulk-tb-divider {
    height: 22px;
    width: 1px;
    background: rgba(255, 255, 255, 0.2);
}

.bulk-tb-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bulk-tb-btn {
    border-radius: 20px;
    font-size: 0.85rem;
    padding: 6px 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    text-decoration: none;
}

.bulk-tb-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.bulk-tb-btn-activate {
    color: #2ecc71;
    border-color: #2ecc71;
    background: rgba(46, 204, 113, 0.1);
}
.bulk-tb-btn-activate:hover {
    background: #2ecc71;
    color: #fff;
}

.bulk-tb-btn-deactivate {
    color: #e74c3c;
    border-color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
}
.bulk-tb-btn-deactivate:hover {
    background: #e74c3c;
    color: #fff;
}

.bulk-tb-btn-transfer {
    color: #f39c12;
    border-color: #f39c12;
    background: rgba(243, 156, 18, 0.1);
}
.bulk-tb-btn-transfer:hover {
    background: #f39c12;
    color: #fff;
}

.bulk-tb-btn-delete {
    color: #ff4d4f;
    border-color: #ff4d4f;
    background: rgba(255, 77, 79, 0.1);
}
.bulk-tb-btn-delete:hover {
    background: #ff4d4f;
    color: #fff;
}

.bulk-tb-btn-renew {
    color: #2ecc71;
    border-color: #2ecc71;
    background: rgba(46, 204, 113, 0.1);
}
.bulk-tb-btn-renew:hover {
    background: #2ecc71;
    color: #fff;
}

.bulk-tb-btn-pause {
    color: #f39c12;
    border-color: #f39c12;
    background: rgba(243, 156, 18, 0.1);
}
.bulk-tb-btn-pause:hover {
    background: #f39c12;
    color: #fff;
}

.bulk-tb-btn-resume {
    color: #3498db;
    border-color: #3498db;
    background: rgba(52, 152, 219, 0.1);
}
.bulk-tb-btn-resume:hover {
    background: #3498db;
    color: #fff;
}

.bulk-tb-cancel {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.15rem;
    cursor: pointer;
    padding: 4px 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.bulk-tb-cancel:hover {
    color: #ff4d4f;
    background: rgba(255, 77, 79, 0.15);
}

/* ── استجابة الموبايل والشاشات الصغيرة (< 768px) ── */
@media (max-width: 768px) {
    .bulk-floating-toolbar {
        bottom: 12px !important;
        left: 8px !important;
        right: 8px !important;
        transform: none !important;
        width: auto !important;
        border-radius: 14px !important;
        padding: 10px 10px !important;
        flex-direction: column !important;
        gap: 8px !important;
        box-sizing: border-box !important;
    }

    .bulk-tb-info {
        width: 100% !important;
        justify-content: space-between !important;
        font-size: 0.85rem !important;
    }

    .bulk-tb-divider {
        display: none !important;
    }

    .bulk-tb-actions {
        width: 100% !important;
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 5px !important;
    }

    .bulk-tb-actions.actions-3 {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    .bulk-tb-btn {
        width: 100% !important;
        padding: 7px 2px !important;
        font-size: 0.74rem !important;
        justify-content: center !important;
        border-radius: 8px !important;
        gap: 3px !important;
        text-align: center !important;
        box-sizing: border-box !important;
    }

    .bulk-tb-btn i {
        font-size: 0.82rem !important;
    }

    .bulk-tb-cancel-mobile {
        display: inline-flex !important;
        align-items: center;
        gap: 4px;
        background: rgba(255, 255, 255, 0.12);
        color: #fff;
        border: none;
        border-radius: 6px;
        padding: 3px 8px;
        font-size: 0.75rem;
        cursor: pointer;
    }

    .bulk-tb-cancel-desktop {
        display: none !important;
    }
}

@media (min-width: 769px) {
    .bulk-tb-cancel-mobile {
        display: none !important;
    }
}



