@font-face {
    font-family: "IRANSans";
    src: url("../fonts/IRANSans/IRANSansWeb_Light.woff2") format("woff2"),
    url("../fonts/IRANSans/IRANSansWeb_Light.woff") format("woff"),
    url("../fonts/IRANSans/IRANSansWeb_Light.ttf") format("truetype");
    font-display: swap;
}

* {
	font-family: IRANSans, serif;
    text-align: right;
    box-sizing: border-box;
}

.bg-blue {
    background-color: rgb(74, 109, 165);
    box-shadow: 0px 3px 4px #aaaaaa, 0px 4px 8px #ededed;
}

body {
    background-color: #ededed;
}

footer p {
    font-size: .8rem;
}

.myfontsize {
    font-size: .8rem;
}

.myFont {
	font-family: IRANSans, serif;
	text-align: right;
}


/* ============================================================================================
   استایل‌های سایدبار با منوی تو در تو
   فقط استایل‌های ظاهری - بدون محتوای HTML
=============================================================================================== */

.app-wrapper {
    display: flex;
    flex-direction: row;
    flex-grow: 1;
    position: relative;
    min-height: 100vh;
}

/* استایل سایدبار در حالت دسکتاپ */
.sidebar {
    width: 350px;
    background: #fff;
    border-left: 1px solid #e9ecef;
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    z-index: 1020;
    position: relative;
    right: 0;
    overflow-y: auto;
}

.sidebar-header {
    padding: 1.5rem 1rem;
    border-bottom: 1px solid #eef2f6;
    text-align: center;
}

.sidebar-header h4 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #0a58ca;
    margin: 0;
}

.sidebar-header p {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 5px;
}

/* استایل پایه آیتم‌های منو */
.sidebar .nav-link {
    padding: 0.5rem 0rem;
    border-radius: 8px;
    margin: 4px 8px;
    color: #2c3e50;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    text-decoration: none;
}

.sidebar .nav-link i:first-child {
    width: 25px;
    text-align: center;
}

.sidebar .nav-link.active {
    background-color: #e7f0ff;
    color: #0d6efd;
}

.sidebar .nav-link:hover:not(.active) {
    background-color: #f1f5f9;
}

/* استایل زیرمنوها */
.submenu {
    list-style: none;
    padding-right: 0.1rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    margin: 0;
}

.submenu.open {
    max-height: 500px;
    transition: max-height 0.4s ease-in;
}

.submenu .nav-link {
    padding: 0.5rem 0.5rem;
    font-size: 0.9rem;
    margin: 2px 8px;
}

.submenu .submenu {
    padding-right: 0.5rem;
}

/* فلش راهنما برای منوهای دارای زیرمنو */
.submenu-arrow {
    margin-right: auto;
    transition: transform 0.2s ease;
    font-size: 0.8rem;
}

.submenu-toggle[aria-expanded="true"] .submenu-arrow {
    transform: rotate(-90deg);
}

.submenu-toggle .submenu-arrow {
    transform: rotate(180deg);
}

.submenu-toggle[aria-expanded="true"] .submenu-arrow {
    transform: rotate(90deg);
}

.has-submenu > .nav-link {
    position: relative;
}

.sidebar-footer {
    margin-top: auto;
    padding: 1rem;
    border-top: 1px solid #e9ecef;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #f4f7fc;
}

.mobile-topbar {
    display: none;
    background-color: #0d6efd;
    padding: 0.75rem 0.1rem;
    align-items: center;
    justify-content: space-between;
}

.brand-mobile {
    color: white;
    font-size: 1.2rem;
    font-weight: 500;
    text-decoration: none;
}

.menu-toggle-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

/* حالت ریسپانسیو (موبایل) */
@media (max-width: 991.98px) {
    .sidebar {
        position: fixed;
        top: 0;
        right: -300px;
        bottom: 0;
        width: 300px;
        z-index: 1050;
        background: white;
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.2);
        transition: right 0.25s ease-in-out;
        border-left: none;
        border-right: 1px solid #dee2e6;
    }

    .sidebar.open {
        right: 0;
    }

    .sidebar-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1040;
        display: none;
    }

    .sidebar-backdrop.show {
        display: block;
    }

    .mobile-topbar {
        display: flex;
    }

    .main-content {
        width: 100%;
    }

    /* ============================================================================================
         ========== تنظیمات فاصله منوها در موبایل ==========
    =============================================================================================== */
    /* منوی اصلی در موبایل */
    .sidebar .nav-link {
        padding: 0.5rem 0.1rem !important;
        margin: 2px 4px !important;
        font-size: 0.95rem !important;
    }

    /* زیرمنو سطح 1 در موبایل */
    .submenu {
        padding-right: 0.1rem !important;
    }

    .submenu .nav-link {
        padding: 0.5rem 0.5rem !important;
        font-size: 0.9rem !important;
        margin: 2px 0 !important;
    }

    /* زیرمنو سطح 2 (تو در تو) در موبایل */
    .submenu .submenu {
        padding-right: 0.5rem !important;
    }

    .submenu .submenu .nav-link {
        padding: 0.45rem 0.5rem !important;
        font-size: 0.85rem !important;
    }

    /* هدر سایدبار در موبایل */
    .sidebar-header {
        padding: 1rem 0.8rem !important;
        text-align: center;
    }

    .sidebar-header h4 {
        font-size: 1.1rem !important;
    }

    .sidebar-header p {
        font-size: 0.7rem !important;
    }

    /* دکمه بستن در موبایل */
    .sidebar-close-btn {
        top: 10px;
        right: 10px;
    }

    .sidebar-close-btn .btn-close {
        padding: 8px !important;
    }

    /* فوتر سایدبار در موبایل */
    .sidebar-footer {
        padding: 0.8rem !important;
    }

    .sidebar-footer .btn {
        padding: 0.4rem 0.6rem !important;
        font-size: 0.85rem !important;
        margin-bottom: 0.5rem !important;
    }
}

@media (min-width: 992px) {
    .sidebar-backdrop {
        display: none !important;
    }
}
/* ============================================================================================
 رفع مشکل پس‌زمینه و رنگ متن هدرها هنگام کلیک
=============================================================================================== */
.table th, .table td {
    vertical-align: middle !important;
}

.form-control:focus {
    box-shadow: none;
    border-color: #0d6efd;
}

/* رفع مشکل پس‌زمینه هدرها هنگام سورت */
.table thead.table-dark tr th,
.table thead.table-dark tr th.sortable,
.table thead.table-dark tr th.sortable:hover,
.table thead.table-dark tr th.sortable:active,
.table thead.table-dark tr th.sortable:focus,
.table-dark th,
.table-dark th.sortable,
.table-dark th.sortable:active,
.table-dark th.sortable:focus {
    background-color: #212529 !important;
    color: #ffffff !important;
    outline: none !important;
    box-shadow: none !important;
    -webkit-tap-highlight-color: transparent !important;
}

.sortable {
    cursor: pointer;
    user-select: none;
    transition: all 0.2s;
}

.sortable:hover {
    background-color: #2c3034 !important;
    color: white !important;
}

.sortable i {
    margin-right: 5px;
    font-size: 0.8rem;
    color: #6c757d;
}

.sortable.asc i, .sortable.desc i {
    color: #0d6efd !important;
}

.sortable:active,
.sortable:focus,
.sortable:focus-visible {
    background-color: #212529 !important;
    color: white !important;
    outline: none !important;
    box-shadow: none !important;
}


/* ============================================================================================
       Sweet Alert
=============================================================================================== */

/* ===== پاپ‌آپ: بدون اسکرول، بزرگ‌شدن خودکار ===== */
.swal-success-custom {
	width: auto !important;
	max-width: 90vw !important;
	height: auto !important;
	max-height: none !important;
	overflow: visible !important;
	display: flex !important;
	flex-direction: column !important;
	align-items: center !important;
	padding: 1em 1.5em !important;
}

/* ===== کانتینر متن: بدون اسکرول ===== */
.swal-success-custom .swal2-html-container {
	overflow: visible !important;
	max-height: none !important;
	height: auto !important;
	margin: 0 !important;
	padding: 0 !important;
	font-size: 1rem !important;      /* همون سایز 2 که خواستی */
	line-height: 1.4 !important;
	text-align: center !important;
	word-break: break-word !important;
	white-space: normal !important;
}

.swal-success-custom .swal2-title {
	overflow: visible !important;
	max-height: none !important;
	font-size: 2rem !important;
	margin: 0 !important;
	padding: 0 !important;
}

/* ===== ترتیب: آیکون بالا، متن زیر ===== */
.swal-success-custom .swal2-icon {
	order: 1 !important;
	margin: 0 auto 0.5em auto !important;
	flex-shrink: 0 !important;
}

.swal-success-custom .swal2-title,
.swal-success-custom .swal2-html-container {
	order: 2 !important;
}

/* ===== کانتینر اصلی هم اسکرول نده ===== */
.swal2-container {
	overflow-y: auto !important;
}

.swal2-container .swal2-popup {
	max-height: none !important;
	overflow: visible !important;
}