/* ===== RTL Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.modern-admin-rtl {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    direction: rtl;
    background: #f5f6fa;
    color: #2c3e50;
    font-size: 14px;
    line-height: 1.6;
}

/* ===== Sidebar ===== */
.modern-sidebar {
    position: fixed;
    right: 0;
    top: 0;
    width: 240px;
    height: 100vh;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    padding: 20px 0;
    z-index: 1000;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
}

.sidebar-header {
    padding: 0 20px 30px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    font-size: 20px;
    font-weight: 600;
}

.logo i {
    font-size: 28px;
}

.sidebar-menu {
    padding: 20px 0;
    flex: 1;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.3s;
    font-size: 14px;
}

.menu-item:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.menu-item.active {
    background: rgba(255,255,255,0.15);
    color: white;
    border-right: 3px solid white;
}

.menu-item i {
    font-size: 18px;
    width: 24px;
}

.sidebar-footer {
    position: absolute;
    bottom: 20px;
    width: 100%;
}

/* ===== Main Content ===== */
.main-content {
    margin-right: 240px;
    min-height: 100vh;
}

/* ===== Top Header ===== */
.top-header {
    background: white;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.menu-toggle {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6c757d;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8f9fa;
    padding: 8px 15px;
    border-radius: 6px;
    width: 300px;
}

.search-box i {
    color: #6c757d;
}

.search-box input {
    border: none;
    background: none;
    outline: none;
    width: 100%;
    font-size: 14px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.language-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 6px;
    transition: background 0.3s;
}

/* site.css – RTL & custom overrides */
[dir="rtl"] .kt-drawer-start {
    right: 0;
    left: auto;
}
[dir="rtl"] .lg\:ms-(--sidebar-width) {
    margin-inline-start: unset;
    margin-inline-end: var(--sidebar-width);
}
/* Adjust progress bar if needed */
.progress { display: flex; height: 1rem; overflow: hidden; font-size: .75rem; background-color: #e9ecef; border-radius: 0.25rem; }
.progress-bar { display: flex; flex-direction: column; justify-content: center; overflow: hidden; color: #fff; text-align: center; white-space: nowrap; background-color: #0d6efd; transition: width .6s ease; }



/* ===== RTL Overrides ===== */
[dir="rtl"] .lg\:ms-\(--sidebar-width\) {
    margin-inline-start: unset;
    margin-inline-end: var(--sidebar-width);
}

/* اگر از کلاس lg:rounded-r-xl به جای lg:rounded-l-xl استفاده کرده‌اید نیازی نیست، 
   ولی برای اطمینان از گوشه‌های صحیح: */
[dir="rtl"] .lg\:rounded-l-xl {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-top-right-radius: 0.75rem; /* مقدار rounded-xl */
    border-bottom-right-radius: 0.75rem;
}
/* اصلاح progress bar (اگر در داشبورد استفاده می‌کنید) */
.progress {
    display: flex;
    height: 0.5rem;
    overflow: hidden;
    font-size: .75rem;
    background-color: #e9ecef;
    border-radius: 0.25rem;
}
.progress-bar {
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    background-color: #0d6efd;
    transition: width .6s ease;
}

/* Sidebar scroll fix */
.kt-scrollable-y-auto {
    scrollbar-width: thin;
}