/* Arefin Admin - RTL (Right-to-Left) Overrides */
/* Include this file AFTER style.css to enable full RTL layout */

/* ===== Base Direction ===== */
html {
	direction: rtl;
}

body {
	text-align: right;
}

/* ===== Scrollbar (flip to left side) ===== */
::-webkit-scrollbar {
	direction: ltr;
}

/* ===== Layout ===== */
.admin-wrapper {
	direction: rtl;
}

/* ===== Sidebar ===== */
.sidebar-header {
	padding: 0 1.25rem;
}

.nav-link {
	flex-direction: row;
}

/* Sidebar dropdown arrow: flip to left side */
.nav-dropdown-toggle .nav-arrow {
	margin-left: 0;
	margin-right: auto;
}

.nav-dropdown.open>.nav-dropdown-toggle .nav-arrow {
	transform: rotate(-90deg);
}

/* Sub-links: flip padding */
.nav-sub-link {
	padding: 0.5rem 2.75rem 0.5rem 0.75rem;
}

.nav-sub-link::before {
	margin-right: 0;
	margin-left: 0.625rem;
}

/* Sidebar mobile: slide from right */
@media (max-width: 1023px) {
	.sidebar {
		left: auto;
		right: -260px;
	}

	.sidebar.open {
		left: auto;
		right: 0;
	}
}

/* Sidebar collapsed (desktop) */
@media (min-width: 1024px) {
	.sidebar.collapsed .sidebar-label {
		display: none;
	}
}

/* ===== Top Bar ===== */
/* Search icon: flip to right */
.topbar-search i {
	left: auto;
	right: 0.75rem;
}

.topbar-search input {
	padding: 0.5rem 2.25rem 0.5rem 1rem;
}

/* ===== User Dropdown ===== */
.user-dropdown-menu {
	right: auto;
	left: 0;
}

.user-dropdown-menu a {
	flex-direction: row;
}

/* ===== Tables text-align ===== */
.table-custom thead th {
	text-align: right;
}

.table-dt thead th {
	text-align: right;
}

table.dataTable thead th {
	text-align: right;
}

/* ===== Filter Bar ===== */
.filter-search i {
	left: auto;
	right: 0.75rem;
}

.filter-search input {
	padding: 0.5rem 2.25rem 0.5rem 1rem;
}

/* ===== Toggle Switch ===== */
.toggle-track::after {
	left: auto;
	right: 2px;
}

.toggle-switch input:checked+.toggle-track::after {
	transform: translateX(-20px);
}

/* ===== Settings Nav ===== */
.settings-nav a {
	flex-direction: row;
}

/* ===== Form Control Icons (Login, Forget, Reset) ===== */
.login-input-wrap i {
	left: auto;
	right: 12px;
}

.login-input-wrap .form-control-custom {
	padding-left: 1rem;
	padding-right: 2.5rem;
}

/* ===== Buttons & Icons ===== */
.btn-icon {
	direction: ltr;
}

/* ===== DataTables RTL ===== */
.dataTables_wrapper {
	direction: rtl;
}

.dataTables_wrapper .dataTables_filter {
	float: left !important;
}

.dataTables_wrapper .dataTables_length {
	float: right !important;
}

.dataTables_wrapper .dataTables_info {
	float: right !important;
}

.dataTables_wrapper .dataTables_paginate {
	float: left !important;
}

table.dataTable {
	direction: rtl;
}

/* DataTables responsive RTL */
@media (max-width: 767px) {

	.dataTables_wrapper .dataTables_length,
	.dataTables_wrapper .dataTables_filter {
		float: none !important;
		text-align: right !important;
	}

	.dataTables_wrapper .dataTables_info {
		float: none !important;
		text-align: center !important;
	}

	.dataTables_wrapper .dataTables_paginate {
		float: none !important;
	}
}

/* ===== Select2 RTL ===== */
.select2-container--default .select2-selection--single {
	direction: rtl;
	text-align: right;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
	left: 8px;
	right: auto;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
	padding-left: 28px;
	padding-right: 0;
}

.select2-results {
	text-align: right;
}

/* ===== Activity Feed ===== */
.activity-item {
	flex-direction: row;
}

/* ===== Pagination ===== */
.pagination-custom {
	direction: rtl;
}

/* ===== Badge & Misc ===== */
.text-left {
	text-align: right;
}

/* ===== Bootstrap RTL Overrides ===== */
/* Flex gap / alignment helpers - already direction-aware via flexbox */

/* Modal close button */
.modal-header .btn-close {
	margin: -0.5rem auto -0.5rem -0.5rem;
}

/* Margin/padding directional utilities used in HTML */
.me-1,
.me-2,
.me-3 {
	margin-right: 0 !important;
}

.me-1 {
	margin-left: 0.25rem !important;
}

.me-2 {
	margin-left: 0.5rem !important;
}

.me-3 {
	margin-left: 1rem !important;
}

.ms-1,
.ms-2,
.ms-3,
.ms-auto {
	margin-left: 0 !important;
}

.ms-1 {
	margin-right: 0.25rem !important;
}

.ms-2 {
	margin-right: 0.5rem !important;
}

.ms-3 {
	margin-right: 1rem !important;
}

.ms-auto {
	margin-right: auto !important;
}

.pe-1,
.pe-2,
.pe-3 {
	padding-right: 0 !important;
}

.pe-1 {
	padding-left: 0.25rem !important;
}

.pe-2 {
	padding-left: 0.5rem !important;
}

.pe-3 {
	padding-left: 1rem !important;
}

.ps-1,
.ps-2,
.ps-3 {
	padding-left: 0 !important;
}

.ps-1 {
	padding-right: 0.25rem !important;
}

.ps-2 {
	padding-right: 0.5rem !important;
}

.ps-3 {
	padding-right: 1rem !important;
}

/* Text alignment */
.text-start {
	text-align: right !important;
}

.text-end {
	text-align: left !important;
}

/* Float */
.float-start {
	float: right !important;
}

.float-end {
	float: left !important;
}

/* Border */
.border-start {
	border-left: 0 !important;
	border-right: var(--bs-border-width) var(--bs-border-style) var(--bs-border-color) !important;
}

.border-end {
	border-right: 0 !important;
	border-left: var(--bs-border-width) var(--bs-border-style) var(--bs-border-color) !important;
}

/* Rounded */
.rounded-start {
	border-top-left-radius: 0 !important;
	border-bottom-left-radius: 0 !important;
	border-top-right-radius: var(--bs-border-radius) !important;
	border-bottom-right-radius: var(--bs-border-radius) !important;
}

.rounded-end {
	border-top-right-radius: 0 !important;
	border-bottom-right-radius: 0 !important;
	border-top-left-radius: var(--bs-border-radius) !important;
	border-bottom-left-radius: var(--bs-border-radius) !important;
}

/* Dropdown menu alignment */
.dropdown-menu-end {
	right: auto !important;
	left: 0 !important;
}

/* Chevron icon used for "back" / navigation */
.fa-chevron-right:before {
	content: "\f053";
}

.fa-chevron-left:before {
	content: "\f054";
}

/* Logout icon flip */
.fa-right-from-bracket {
	transform: scaleX(-1);
}

/* ===== TinyMCE RTL ===== */
.tox-tinymce {
	direction: ltr;
}