﻿<style >
:root {
    /* رنگ پس‌زمینه را کاملاً کدر (Solid) انتخاب می‌کنیم */
    --side-bg: #111827;
    --side-hover: #1f2937;
    --accent: #6366f1;
    --top-bg: #ffffff;
    --content-bg: #f9fafb;
    --text-dark: #111827;
    --text-muted: #6b7280;
    /* رنگ جدید برای متن‌های غیرفعال (روشن‌تر و واضح‌تر) */
    --nav-text-color: #d1d5db;
}

/* بازنویسی کلاس مونو-اسپیس برای هماهنگی با فونت یکان بخ */
/*.font-monospace {
    font-family: 'YekanBakh', Consolas, "Andale Mono", "Lucida Console", monospace !important;
    letter-spacing: 0.5px;
    direction: rtl;
    display: inline-block;
}
*/
/* در صورتی که می‌خواهید اعداد فارسی/انگلیسی در جدول کاملاً تراز و ستونی زیر هم قرار گیرند */
table .font-monospace {
    font-variant-numeric: tabular-nums;
    -moz-font-feature-settings: "tnum";
    -webkit-font-feature-settings: "tnum";
    font-feature-settings: "tnum";
}

.admin-shell {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    font-family: 'YekanBakh', sans-serif !important;
    direction: rtl;
}

/* --- Sidebar --- */
.admin-sidebar {
    width: 280px;
    background-color: var(--side-bg) !important; /* اطمینان از کدر بودن */
    color: white;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1060;
    opacity: 1 !important; /* جلوگیری از هرگونه شفافیت ارثی */
}

.sidebar-header {
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #374151;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    font-size: 1.1rem;
    color: green;
}

.sidebar-nav {
    flex: 1;
    padding: 15px 0;
}

/* اصلاح رنگ لینک‌ها */
.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: #0e1437;
    /*color: var(--nav-text-color);*/ /* رنگ روشن و واضح در حالت عادی */
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    opacity: 0.85; /* کمی مات در حالت عادی برای زیبایی */

}

    .nav-link i {
        font-size: 1.2rem;
        color: #818cf8; /* آیکون‌ها کمی متمایز باشند */
    }

    /* اصلاح حالت Hover و Active */
    .nav-link:hover, .nav-link.active {
        background-color: var(--side-hover) !important;
        color: green !important; /* در هاور کاملاً سفید شود */
        opacity: 1; /* حذف ماتی */
        border-right: 4px solid var(--accent);
        font-weight: bolder;
    }

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid #374151;
}

.btn-logout-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    transition: 0.3s;
}

    .btn-logout-link:hover {
        background: #ef4444;
        color: white;
    }

/* --- Main Content --- */
.admin-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--content-bg);
    overflow: hidden;
}

.admin-topbar {
    height: 70px;
    background: var(--top-bg);
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    padding: 0 24px;
    justify-content: space-between;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.breadcrumb-item.active {
    color: var(--text-dark);
    font-weight: 700;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-text {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.u-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-dark);
}

.u-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.u-avatar {
    width: 40px;
    height: 40px;
    background: var(--accent);
    color: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.admin-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.content-wrapper {
    background: white;
    border-radius: 16px;
    padding: 24px;
    min-height: 100%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* --- Mobile Logic --- */
.menu-toggle, .close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn {
    color: white;
}

/* مدیریت نمایش سایدبارها */
@media (min-width: 769px) {
    /* در دسکتاپ، سایدبار مخصوص موبایل نباید وجود داشته باشد */
    .admin-sidebar.mobile-only {
        display: none !important;
    }
}

/* استایل مخصوص موبایل برای رفع شفافیت */
@media (max-width: 768px) {
    .admin-sidebar.mobile-only {
        position: fixed;
        right: 0;
        top: 0;
        bottom: 0;
        width: 280px;
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        display: flex !important;
        /* استفاده از رنگ خالص بدون شفافیت */
        background-color: silver !important;
        box-shadow: -10px 0 30px rgba(0,0,0,0.5);
        z-index: 2000; /* بالاتر از همه لایه‌ها */
    }

        .admin-sidebar.mobile-only.open {
            transform: translateX(0);
        }
}

/* اصلاح Overlay */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7); /* تیره‌تر کردن پشت منو برای تمرکز بیشتر */
    backdrop-filter: blur(4px);
    z-index: 1999; /* زیر سایدبار موبایل و بالای محتوا */
    display: none;
}

    .sidebar-overlay.active {
        display: block;
    }

.admin-content {
    padding: 15px;
}

/* تاپ‌بار در موبایل کمی کوچک‌تر شود */
.admin-topbar {
    padding: 0 15px;
    height: 60px;
}

.admin-page-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

    .admin-page-title h3 {
        margin: 0;
        font-weight: 800;
        color: var(--text-dark);
    }

.admin-card {
    background: white;
    border-radius: 18px;
    padding: 1.2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,.05);
}

.admin-table {
    margin: 0;
    vertical-align: middle;
}

    .admin-table thead th {
        background: #f8fafc;
        border-bottom: 1px solid #e5e7eb;
        color: var(--text-muted);
        font-size: .85rem;
        font-weight: 700;
        padding: 14px;
    }

    .admin-table tbody td {
        padding: 14px;
        vertical-align: middle;
    }

.action-buttons {
    display: flex;
    align-items: center;
    gap: .4rem;
    flex-wrap: wrap;
}

.action-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: .2s;
    border: 1px solid #e5e7eb;
    background: white;
}

    .action-btn:hover {
        transform: translateY(-1px);
        background: #f8fafc;
    }

.btn-view {
    color: #0ea5e9;
}

.btn-edit {
    color: #6366f1;
}

.btn-active {
    color: #16a34a;
}

.btn-deactive {
    color: #f59e0b;
}

.btn-delete {
    color: #ef4444;
}

.admin-add-btn {
    border-radius: 12px;
    padding: .7rem 1.2rem;
    text-decoration: none;
    font-weight: 600;
}

</style >
