/* الإعدادات الكلية والهوية البصرية المعاصرة */
:root {
    --primary-indigo: #4f46e5;
    --primary-indigo-hover: #4338ca;
    --charcoal-black: #0f172a;
    --card-bg-white: #ffffff;
    --text-main: #1e293b;
    --border-color: #e2e8f0;
}

body {
    font-family: 'Cairo', sans-serif;
    background-color: #f8fafc;
    color: var(--text-main);
    margin: 0;
    padding: 0;
}

/* تخطيط الـ Single Page Application المتكامل */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* القائمة الجانبية الفاخرة (Sidebar) */
.sidebar-wrapper {
    width: 280px;
    background-color: var(--charcoal-black);
    color: #ffffff;
    padding: 2rem 1.25rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    right: 0;
    top: 0;
    z-index: 100;
    border-left: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 2.5rem;
}

.brand-icon {
    background: var(--primary-indigo);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-badge {
    font-size: 0.65rem;
    background: #f59e0b;
    color: #000;
    padding: 2px 6px;
    border-radius: 4px;
    vertical-align: middle;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.menu-item {
    background: none;
    border: none;
    color: #94a3b8;
    text-align: right;
    padding: 14px 16px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.25s ease;
    width: 100%;
}

.menu-item:hover, .menu-item.active {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.06);
}
.menu-item.active {
    background-color: var(--primary-indigo);
}

.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 1.5rem;
}

.user-avatar-box {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar-placeholder {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #cbd5e1;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.95rem;
    font-weight: 600;
}

.user-role {
    font-size: 0.75rem;
    color: #94a3b8;
}

/* حاوية المحتوى الرئيسي المحمية من التداخل مع السايدبار */
.main-content-wrapper {
    flex: 1;
    margin-right: 280px; /* تمنع التداخل تماماً مع السايدبار الثابت */
    padding: 2.5rem 3rem;
}

/* إخفاء وإظهار الصفحات برمجياً بـ Animations ناعمة */
.app-page {
    display: none;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.app-page.active-page {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.page-header {
    margin-bottom: 2.5rem;
}

.page-header h1 {
    font-weight: 700;
    font-size: 1.85rem;
    color: var(--charcoal-black);
}

/* كروت الإحصائيات الفاخرة للوحة الأداء الرئيسي */
.premium-stat-card {
    border-radius: 16px;
    padding: 1.5rem;
    color: #ffffff;
    display: flex;
    justify-content: justify;
    align-items: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.card-purple { background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%); }
.card-blue { background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%); }
.card-green { background: linear-gradient(135deg, #10b981 0%, #059669 100%); }

.stat-content { flex-grow: 1; z-index: 2; }
.stat-content h6 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.5px; opacity: 0.9; font-weight: 600; }
.stat-content h2 { font-size: 2rem; font-weight: 700; margin: 8px 0; }

.stat-icon {
    font-size: 3.5rem;
    opacity: 0.15;
    position: absolute;
    left: -10px;
    bottom: -15px;
    z-index: 1;
}

/* هيكلة الجداول الفاخرة */
.custom-card-wrapper {
    background-color: var(--card-bg-white);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.02);
    overflow: hidden;
}

.card-header-custom {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    font-weight: 700;
}

.custom-premium-table th {
    background-color: #f8fafc;
    color: #64748b;
    font-weight: 600;
    padding: 14px 20px;
    font-size: 0.85rem;
}

.custom-premium-table td {
    padding: 16px 20px;
    vertical-align: middle;
}

/* شارات الحالة الملونة */
.status-indicator {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
}
.status-success { background: #dcfce7; color: #166534; }

/* ================= استايل مصفوفة كروت المهام المتطورة (Tasks) ================= */
.task-column-wrapper {
    background-color: #f1f5f9;
    border-radius: 16px;
    padding: 1.25rem;
    min-height: 400px;
}

.column-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    padding-bottom: 8px;
    border-bottom: 2px solid;
}
.title-blue { color: #0284c7; border-color: #0284c7; }
.title-green { color: #166534; border-color: #166534; }

.task-cards-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.task-premium-card {
    background-color: var(--card-bg-white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    gap: 14px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.01);
    transition: transform 0.2s ease;
}

.task-premium-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.05);
}

.border-left-blue { border-right: 4px solid #0284c7; }
.border-left-green { border-right: 4px solid #10b981; }

.task-card-icon { font-size: 1.4rem; }
.task-card-body { flex: 1; }
.task-card-body h5 { font-size: 1rem; font-weight: 700; margin-bottom: 6px; }
.task-card-body p { font-size: 0.88rem; color: #475569; line-height: 1.6; }

.task-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px dashed var(--border-color);
}

/* ================= استايل كرت المحفظة الفاخر (Crypto) ================= */
.crypto-wallet-card {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: 20px;
    padding: 2rem;
    color: #ffffff;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    position: relative;
}

.wallet-top { display: flex; justify-content: space-between; align-items: center; }
.wallet-brand { font-weight: 700; font-size: 0.9rem; letter-spacing: 1px; }
.crypto-icons-row { display: flex; gap: 8px; }

.premium-input {
    border: 1px solid var(--border-color);
    padding: 10px 14px;
    border-radius: 10px;
}
.premium-input:focus {
    border-color: var(--primary-indigo);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.btn-primary-custom {
    background-color: var(--primary-indigo);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    transition: background 0.2s ease;
}
.btn-primary-custom:hover {
    background-color: var(--primary-indigo-hover);
    color: white;
}

/* كلاس مخصص لتأثير حركة حقن السطور الجديدة */
.slide-in-row {
    animation: slideIn 0.4s ease-out forwards;
}
@keyframes slideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* مقاسات خط فرعية وتعديلات هامة */
.fs-7 { font-size: 0.85rem; }
.fs-8 { font-size: 0.75rem; }
.text-indigo { color: var(--primary-indigo); }
.bg-indigo-subtle { background-color: #e0e7ff; }
.text-purple { color: #7c3aed; }
.bg-purple-subtle { background-color: #f3e8ff; }

