* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Vazirmatn', sans-serif;
    background: #f5f7fb;
    color: #0f172a;
    line-height: 1.6;
}

/* ---------- Navbar (هدر) ---------- */
.navbar {
    background: white;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}



body:has(.admin-sidebar) .navbar {
    margin-right: 280px;
    width: auto;
}


body:has(.admin-sidebar) .nav-container {
    max-width: calc(1280px - 280px);
    margin-right: 280px;
}


@media (max-width: 768px) {
    body:has(.admin-sidebar) .navbar {
        margin-right: 0;
    }
}


.nav-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand a {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-size: 1.3rem;
    font-weight: 700;
    color: #0f172a;
}

.nav-brand i {
    color: #a855f7;
    font-size: 1.5rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 25px;
}

.nav-links a {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: #475569;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: #a855f7;
}

.nav-links a i {
    font-size: 1.1rem;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: #475569;
}

/* ---------- Admin Sidebar (سایدبار) ---------- */
.admin-sidebar {
    width: 280px;
    background: white;
    border-left: 1px solid #e2e8f0;
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    overflow-y: auto;
    box-shadow: -4px 0 15px rgba(0,0,0,0.05);
    z-index: 999;
}

.sidebar-header {
    padding: 30px 25px;
    border-bottom: 1px solid #e2e8f0;
    text-align: center;
}

.sidebar-header i {
    font-size: 2.5rem;
    color: #a855f7;
    margin-bottom: 10px;
}

.sidebar-header h3 {
    font-size: 1.1rem;
    color: #0f172a;
    font-weight: 600;
}

.sidebar-menu {
    list-style: none;
    padding: 20px 0;
}

.sidebar-menu li {
    margin-bottom: 5px;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 25px;
    color: #475569;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.sidebar-menu li a:hover {
    background: #f1f5f9;
    color: #a855f7;
}

.sidebar-menu li a i {
    font-size: 1.2rem;
    width: 24px;
}

/* حالت active برای منوی جاری */
.sidebar-menu li.active a {
    background: #f3e8ff;
    color: #a855f7;
    border-right: 3px solid #a855f7;
}

/* شیفت محتوای اصلی وقتی سایدبار وجود دارد */
body:has(.admin-sidebar) main,
body:has(.admin-sidebar) .dashboard-container,
body:has(.admin-sidebar) .form-container,
body:has(.admin-sidebar) .list-container,
body:has(.admin-sidebar) .edit-container {
    margin-right: 280px;
}

/* دکمه باز/بستن سایدبار (موبایل و دسکتاپ) */
.sidebar-toggle-btn {
    display: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    /* هدر ریسپانسیو */
    .nav-toggle {
        display: block;
    }
    
    .nav-links {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 10px 20px rgba(0,0,0,0.1);
        gap: 15px;
    }
    
    .nav-links.show {
        display: flex;
    }
    
    .nav-container {
        flex-wrap: wrap;
    }

    /* سایدبار ریسپانسیو */
    .admin-sidebar {
        transform: translateX(100%);
        transition: transform 0.3s ease;
        box-shadow: none;
    }
    
    .admin-sidebar.open {
        transform: translateX(0);
        box-shadow: -4px 0 15px rgba(0,0,0,0.1);
    }
    
    /* حذف margin در موبایل */
    body:has(.admin-sidebar) main,
    body:has(.admin-sidebar) .dashboard-container,
    body:has(.admin-sidebar) .form-container,
    body:has(.admin-sidebar) .list-container,
    body:has(.admin-sidebar) .edit-container {
        margin-right: 0;
    }
    
    /* دکمه شناور باز کردن سایدبار در موبایل */
    .sidebar-toggle-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        background: #a855f7;
        color: white;
        border: none;
        width: 40px;
        height: 40px;
        border-radius: 10px;
        cursor: pointer;
        position: fixed;
        bottom: 20px;
        right: 20px;
        z-index: 1000;
        box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    }
}