body {
    font-family: 'Vazir', 'Vazirmatn', Tahoma, Arial, sans-serif;
    background-color: #f5f5f5;
}
.sidebar {
    min-height: 100vh;
    background-color: #2c3e50;
    color: white;
}
.sidebar a {
    color: #ecf0f1;
    text-decoration: none;
    padding: 12px 20px;
    display: block;
    transition: 0.3s;
}
.sidebar a:hover {
    background-color: #34495e;
    color: white;
}
.sidebar a.active {
    background-color: #3498db;
}
.main-content {
    padding: 20px;
}

/* منوهای گروهی (والد) و زیرمنوها در سایدبار داده‌محور */
.sidebar a.sidebar-group-toggle,
.sidebar span.sidebar-group-toggle,
.sidebar a.sidebar-child {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.sidebar span.sidebar-group-toggle {
    color: #ecf0f1;
    padding: 12px 20px;
}

.sidebar a.sidebar-group-toggle:hover,
.sidebar a.sidebar-child:hover {
    color: #fff;
}

.sidebar .sidebar-caret {
    margin-inline-start: auto;
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

.sidebar a.sidebar-group-toggle[aria-expanded="true"] .sidebar-caret {
    transform: rotate(180deg);
}

.sidebar a.sidebar-child {
    padding-inline-start: 42px;
    font-size: 0.95rem;
    background-color: rgba(0, 0, 0, 0.12);
}
.navbar-brand {
    font-weight: bold;
}
/* لوگوی شرکت در بالای سایدبار (از تنظیمات ← لوگوهای شرکت) */
.sidebar-logo {
    max-height: 56px;
    max-width: 100%;
    width: auto;
    object-fit: contain;
    border-radius: 6px;
    /*background-color: #fff;*/
    padding: 4px 8px;
}
/* پیش‌نمایش لوگو در صفحهٔ تنظیمات */
.brand-logo-preview {
    max-height: 90px;
    max-width: 100%;
    width: auto;
    object-fit: contain;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background-color: #fff;
    padding: 6px 12px;
}

/* ---------- موبایل: نوار بالای صفحه + منوی سه‌خط (offcanvas) ---------- */
/* قاعده: در موبایل سایدبار تمام‌صفحه بالای محتوا نمی‌آید؛ به‌جایش یک نوار باریک
   با دکمهٔ منو دارد و خودِ منو از کنار صفحه باز می‌شود. */
.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    display: flex;
    align-items: center;
    gap: 12px;
    background: #2c3e50;
    color: #fff;
    padding: 10px 14px;
    /* env(safe-area-inset-top) روی گوشی‌های ناچ‌دار (آیفون) فاصلهٔ امن را اضافه می‌کند */
    padding-top: calc(10px + env(safe-area-inset-top, 0px));
    box-shadow: 0 2px 10px rgba(0, 0, 0, .25);
}

.admin-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    flex: 0 0 auto;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 10px;
    background: transparent;
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.admin-menu-btn:active,
.admin-menu-btn:focus-visible {
    background: rgba(255, 255, 255, .16);
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

.admin-topbar-title {
    font-weight: 700;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* پنل کشویی منو در موبایل: همان ظاهر و همان لینک‌های سایدبار */
.admin-offcanvas {
    width: min(86vw, 320px);
    background: #2c3e50;
    color: #fff;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.admin-offcanvas .offcanvas-header {
    border-bottom: 1px solid rgba(255, 255, 255, .18);
    padding: 12px 16px;
}

.admin-offcanvas .offcanvas-body {
    overflow-y: auto;
}

@media (max-width: 767.98px) {
    .main-content {
        padding: 14px 12px 28px;
    }

    .main-content h1,
    .main-content h2 {
        font-size: 1.3rem;
    }

    /* جدول‌های پنل مدیریت در موبایل: فونت کوچک‌تر، اسکرول افقی دست‌نخورده */
    .main-content .table {
        font-size: .85rem;
    }

    .main-content .btn {
        min-height: 42px;
    }

    .main-content .btn-sm {
        min-height: 38px;
    }
}
