/* ═══════════════════════════════════════════════════════════
   تاجر تيك | TAJER TECH - Main Shell Layout
   ═══════════════════════════════════════════════════════════ */

/* هيكل التطبيق الأساسي */
.app {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    background-color: var(--color-bg-main);
}

/* القائمة الجانبية (Sidebar Grid) */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--color-bg-card);
    border-left: 1px solid var(--color-border); /* حدود مع اليمين في الـ RTL */
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    flex-shrink: 0;
    transition: var(--transition);
    z-index: 20;
}

.sidebar-header {
    height: var(--header-height);
    padding: 0 24px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.sidebar-brand {
    font-size: 1.3rem;
    font-weight: 700;
    color: white;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, white 0%, var(--color-primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* العناصر الفردية داخل الـ Sidebar */
.sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    font-size: 0.92rem;
    font-weight: 500;
}

.sidebar-item:hover {
    background-color: var(--color-bg-hover);
    color: var(--color-text-primary);
}

.sidebar-item.active {
    background-color: var(--color-primary-glow);
    color: var(--color-primary);
    font-weight: 600;
}

/* المؤشر الأخضر النشط على اليمين */
.sidebar-item.active::before {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 60%;
    width: 4px;
    background-color: var(--color-primary);
    border-radius: 0 4px 4px 0;
}

/* الأيقونة الـ SVG المصاحبة */
.sidebar-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    stroke: currentColor;
    stroke-width: 2;
}

.sidebar-item.active svg {
    stroke: var(--color-primary);
}

/* شارة عدد الطلبات باللون الأحمر */
.sidebar-item .badge {
    position: absolute;
    left: 16px; /* على اليسار في RTL */
    background-color: var(--color-red);
    color: white;
    font-size: 0.72rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
}

.sidebar-divider {
    height: 1px;
    background-color: var(--color-border);
    margin: 8px 16px;
}

.sidebar-footer {
    padding: 16px;
    flex-shrink: 0;
    border-top: 1px solid var(--color-border);
}

/* العمود الأساسي لعرض المحتوى */
.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* شريط الترويسة العلوي (App Header) */
.app-header {
    height: var(--header-height);
    background-color: rgba(30, 41, 59, 0.7); /* كحلي شفاف فخم */
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-date {
    color: var(--color-text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
}

/* جرس الإشعارات مع شارة التنبيه */
.header-notification {
    position: relative;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: var(--color-bg-hover);
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
    transition: var(--transition-fast);
}

.header-notification:hover {
    background-color: var(--color-bg-card);
    color: white;
}

.header-notification svg {
    width: 20px;
    height: 20px;
}

.header-notification .badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background-color: var(--color-red);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    border: 2px solid var(--color-bg-card);
}

/* ملف المستخدم العلوي */
.header-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.25);
    border: 2px solid rgba(255, 255, 255, 0.1);
}

/* مساحة المحتوى الممتدة (Page Content Grid) */
.page-content {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
    scroll-behavior: smooth;
    animation: fadeIn 0.4s ease-out;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}

.page-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: white;
    letter-spacing: -0.5px;
}

.page-actions {
    display: flex;
    gap: 12px;
}

/* استجابة الموبايل (Responsive Layout Settings) */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        right: -280px; /* سحب للجنب */
        height: 100vh;
        box-shadow: -4px 0 16px rgba(0,0,0,0.3);
    }
    
    .sidebar.open {
        right: 0;
    }
}
