﻿/* =========================================================
   الإعدادات العامة
   ========================================================= */

html {
    font-size: 14px;
}

body {
    margin: 0;
    padding: 0;
    background-color: #f5f7fb;
    font-family: Arial, sans-serif;
    direction: rtl;
}


/* =========================================================
   الشريط الجانبي
   ========================================================= */

.sidebar {
    position: fixed;
    right: 0;
    top: 0;
    width: 260px;
    height: 100vh;
    background: #ffffff;
    border-left: 1px solid #e5e7eb;
    box-shadow: -3px 0 15px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: width 0.25s ease;
}


/* =========================================================
   رأس الشريط
   ========================================================= */

.sidebar-header {
    height: 70px;
    min-height: 70px;
    background: #0d6efd;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 18px;
    font-weight: bold;
}

    .sidebar-header i {
        font-size: 20px;
    }


/* =========================================================
   قائمة الشريط
   ========================================================= */

.sidebar-menu {
    list-style: none;
    padding: 15px 10px;
    margin: 0;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}


    /* شريط التمرير */

    .sidebar-menu::-webkit-scrollbar {
        width: 5px;
    }

    .sidebar-menu::-webkit-scrollbar-track {
        background: transparent;
    }

    .sidebar-menu::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 10px;
    }


    /* عناصر القائمة */

    .sidebar-menu li {
        margin-bottom: 5px;
    }


    /* روابط القائمة */

    .sidebar-menu a {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 15px;
        color: #374151;
        text-decoration: none;
        border-radius: 8px;
        transition: all 0.2s ease;
    }

        .sidebar-menu a:hover {
            background-color: #eaf2ff;
            color: #0d6efd;
        }

        .sidebar-menu a i {
            width: 22px;
            min-width: 22px;
            text-align: center;
            font-size: 16px;
        }


/* =========================================================
   عنوان التقارير
   ========================================================= */

.menu-title {
    margin-top: 20px;
    padding: 8px 15px;
    font-size: 13px;
    color: #8a94a6;
    font-weight: bold;
}


/* =========================================================
   معلومات المستخدم
   ========================================================= */

.sidebar-user {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 5px 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #f5f7fb;
    border: 1px solid #e5e7eb;
}


/* أيقونة المستخدم */

.user-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eaf2ff;
    color: #0d6efd;
    font-size: 17px;
}


/* معلومات المستخدم */

.user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

    .user-info strong {
        color: #374151;
        font-size: 13px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .user-info small {
        color: #8a94a6;
        font-size: 11px;
        margin-top: 2px;
    }


/* =========================================================
   زر تسجيل الخروج
   ========================================================= */

.sidebar-logout {
    flex-shrink: 0;
    padding: 5px 10px 15px;
}

    .sidebar-logout form {
        margin: 0;
    }

.logout-button {
    width: 100%;
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    border: none;
    background: #fff5f5;
    color: #dc3545;
    text-align: right;
    padding: 10px 15px;
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    transition: all 0.2s ease;
}

    .logout-button:hover {
        background: #ffe5e5;
        color: #b02a37;
    }

    .logout-button i {
        width: 22px;
        margin-left: 10px;
        text-align: center;
    }


/* =========================================================
   المحتوى الرئيسي
   ========================================================= */

.main-content {
    margin-right: 260px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-right 0.25s ease;
}


    /* محتوى الصفحات */

    .main-content > main {
        flex: 1;
        width: 100%;
    }


/* =========================================================
   الشريط العلوي
   ========================================================= */

.top-navbar {
    height: 70px;
    background: white;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 25px;
    flex-shrink: 0;
}


/* زر القائمة */

#sidebarToggle {
    border: 1px solid #e5e7eb;
    background: white;
    color: #374151;
    border-radius: 8px;
}

    #sidebarToggle:hover {
        background: #f5f7fb;
        color: #0d6efd;
    }


/* عنوان الصفحة */

.page-title {
    font-size: 20px;
    font-weight: bold;
    color: #374151;
}


/* =========================================================
   Footer
   ========================================================= */

.main-content footer.footer {
    position: static !important;
    width: 100%;
    margin-top: 20px;
    padding: 15px 0;
    line-height: normal;
    flex-shrink: 0;
    background: transparent;
}


/* =========================================================
   تصغير الشريط الجانبي
   ========================================================= */

.sidebar-collapsed .sidebar {
    width: 80px;
}

.sidebar-collapsed .main-content {
    margin-right: 80px;
}

.sidebar-collapsed .sidebar-header span {
    display: none;
}

.sidebar-collapsed .sidebar-menu span {
    display: none;
}

.sidebar-collapsed .sidebar-menu a {
    justify-content: center;
}

    .sidebar-collapsed .sidebar-menu a i {
        margin: 0;
    }

.sidebar-collapsed .sidebar-user {
    justify-content: center;
    padding: 8px;
}

.sidebar-collapsed .user-info {
    display: none;
}

.sidebar-collapsed .sidebar-logout {
    padding-left: 10px;
    padding-right: 10px;
}

.sidebar-collapsed .logout-button {
    justify-content: center;
    padding: 10px;
}

    .sidebar-collapsed .logout-button span {
        display: none;
    }

    .sidebar-collapsed .logout-button i {
        margin: 0;
    }


/* =========================================================
   Dashboard
   ========================================================= */

.dashboard-card {
    border-radius: 12px;
    transition: all 0.2s ease;
    border: none;
}

    .dashboard-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    }


.dashboard-icon {
    width: 55px;
    height: 55px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 22px;
}


.dashboard-card a {
    display: inline-block;
    margin-top: 15px;
}


/* =========================================================
   الرسوم البيانية
   ========================================================= */

.chart-container {
    position: relative;
    height: 330px;
    width: 100%;
}


/* =========================================================
   صفحة تسجيل الدخول
   ========================================================= */

.login-page {
    min-height: 80vh;
    display: flex;
    justify-content: center;
    align-items: center;
    direction: rtl;
}


.login-card {
    width: 100%;
    max-width: 430px;
    background: white;
    padding: 35px;
    border-radius: 18px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.10);
}


    .login-card h2 {
        color: #1f2937;
    }


    .login-card .form-control {
        height: 48px;
        border-radius: 10px;
    }


    .login-card .btn {
        height: 48px;
        border-radius: 10px;
        font-weight: bold;
    }


/* =========================================================
   البطاقات والجداول
   ========================================================= */

.card {
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.table {
    background: white;
}


/* =========================================================
   الشاشات الصغيرة
   ========================================================= */

@media (max-width: 768px) {

    .sidebar {
        width: 80px;
    }

    .sidebar-header span {
        display: none;
    }

    .sidebar-menu span {
        display: none;
    }

    .sidebar-menu a {
        justify-content: center;
    }

        .sidebar-menu a i {
            margin: 0;
        }

    .main-content {
        margin-right: 80px;
    }

    .sidebar-user {
        justify-content: center;
        padding: 8px;
    }

    .user-info {
        display: none;
    }

    .logout-button {
        justify-content: center;
        padding: 10px;
    }

        .logout-button span {
            display: none;
        }

        .logout-button i {
            margin: 0;
        }

    .top-navbar {
        padding: 0 15px;
    }

    .page-title {
        font-size: 17px;
    }

    .chart-container {
        height: 280px;
    }
}


/* =========================================================
   الشاشات الصغيرة جدًا
   ========================================================= */

@media (max-width: 480px) {

    .main-content {
        margin-right: 70px;
    }

    .sidebar {
        width: 70px;
    }

    .sidebar-header {
        height: 60px;
        min-height: 60px;
    }

    .top-navbar {
        height: 60px;
    }

    .chart-container {
        height: 240px;
    }
}
/* =========================================================
   قائمة التقارير القابلة للفتح
   ========================================================= */

.reports-menu {
    margin-bottom: 5px;
}

.reports-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: none;
    background: transparent;
    color: #374151;
    padding: 12px 15px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    text-align: right;
    transition: all 0.2s ease;
}

    .reports-toggle:hover {
        background-color: #eaf2ff;
        color: #0d6efd;
    }

    .reports-toggle span {
        display: flex;
        align-items: center;
        gap: 12px;
    }

        .reports-toggle span i {
            width: 22px;
            min-width: 22px;
            text-align: center;
            font-size: 16px;
        }

.reports-arrow {
    font-size: 11px;
    transition: transform 0.2s ease;
}

    .reports-arrow.rotate {
        transform: rotate(180deg);
    }


/* القائمة الفرعية */

.reports-submenu {
    display: none;
    margin: 0;
    padding: 0 5px 5px 5px;
}

    .reports-submenu.show {
        display: block;
    }


    /* روابط التقارير */

    .reports-submenu a {
        display: flex;
        align-items: center;
        padding: 9px 15px 9px 10px;
        color: #6b7280;
        text-decoration: none;
        border-radius: 7px;
        font-size: 13px;
        transition: all 0.2s ease;
    }

        .reports-submenu a:hover {
            background-color: #f0f6ff;
            color: #0d6efd;
        }

        .reports-submenu a i {
            width: 22px;
            min-width: 22px;
            margin-left: 8px;
            text-align: center;
            font-size: 14px;
        }


/* =========================================================
   عند تصغير الشريط
   ========================================================= */

.sidebar-collapsed .reports-toggle {
    justify-content: center;
    padding: 12px 10px;
}

    .sidebar-collapsed .reports-toggle span {
        justify-content: center;
    }

.sidebar-collapsed .reports-arrow {
    display: none;
}

.sidebar-collapsed .reports-submenu {
    display: none !important;
}


/* =========================================================
   الشاشات الصغيرة
   ========================================================= */

@media (max-width: 768px) {

    .reports-toggle {
        justify-content: center;
        padding: 12px 10px;
    }

        .reports-toggle span {
            justify-content: center;
        }

    .reports-arrow {
        display: none;
    }

    .reports-submenu {
        display: none !important;
    }
}
