/* Base RTL adjustments */
[dir="rtl"] body {
    direction: rtl;
    text-align: right;
}

/* Headers and titles */
[dir="rtl"] .header,
[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3,
[dir="rtl"] .branding h1 {
    text-align: right;
}

/* Float adjustments */
[dir="rtl"] .float-left {
    float: right !important;
}

[dir="rtl"] .float-right {
    float: left !important;
}

/* Margins and paddings */
[dir="rtl"] .margin-left-10 {
    margin-right: 10px !important;
    margin-left: 0 !important;
}

[dir="rtl"] .margin-right-10 {
    margin-left: 10px !important;
    margin-right: 0 !important;
}

[dir="rtl"] .padding-left-15 {
    padding-right: 15px !important;
    padding-left: 0 !important;
}

[dir="rtl"] .padding-right-15 {
    padding-left: 15px !important;
    padding-right: 0 !important;
}

/* Form elements */
[dir="rtl"] .aligned label {
    padding: 0 0 3px 1em;
    float: right !important;
    text-align: right;
}

[dir="rtl"] .form-row {
    direction: rtl;
}

[dir="rtl"] .form-row .field-box {
    float: right;
    margin-right: 0;
    margin-left: 10px;
}

[dir="rtl"] input,
[dir="rtl"] select,
[dir="rtl"] textarea {
    direction: rtl;
}

/* Buttons and submit row */
[dir="rtl"] .submit-row {
    text-align: left;
}

[dir="rtl"] .submit-row input,
[dir="rtl"] .button {
    margin-left: 0;
    margin-right: 10px;
}

/* Inline groups (e.g., tabular or stacked inlines) */
[dir="rtl"] .inline-group {
    direction: rtl;
}

[dir="rtl"] .inline-related h3 {
    text-align: right;
}

[dir="rtl"] .inline-related .inline_label {
    float: right;
    padding-right: 0;
    padding-left: 10px;
}

/* Tables */
[dir="rtl"] table {
    direction: rtl;
}

[dir="rtl"] th,
[dir="rtl"] td {
    text-align: right;
}

[dir="rtl"] .sortoptions {
    float: left;
}

/* Navigation and sidebar (Unfold-specific) */
[dir="rtl"] .unfold-sidebar {
    right: unset;
    left: 0;
}

[dir="rtl"] .unfold-main {
    margin-left: 0;
    margin-right: 260px;
    /* Adjust based on sidebar width */
}

[dir="rtl"] .unfold-nav {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] .unfold-nav li {
    text-align: right;
}

[dir="rtl"] .unfold-nav .dropdown-menu {
    right: unset;
    left: 0;
}

/* Breadcrumbs */
[dir="rtl"] .breadcrumbs {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] .breadcrumbs a {
    margin-right: 0;
    margin-left: 5px;
}

/* Filters (right sidebar) */
[dir="rtl"] #changelist-filter {
    float: left;
    text-align: right;
}

[dir="rtl"] #changelist-filter h3 {
    text-align: right;
}

[dir="rtl"] #changelist-filter li {
    padding-right: 0;
    padding-left: 10px;
}

/* Miscellaneous */
[dir="rtl"] .object-tools {
    float: left;
}

[dir="rtl"] .paginator {
    direction: rtl;
    text-align: left;
}

/* Enhanced RTL adjustments for Unfold navigation links (specific to navbar) */
[dir="rtl"] .unfold-nav a {
    direction: rtl;
    justify-content: flex-end;
    /* Align flex items to the right */
}

[dir="rtl"] .unfold-nav .flex {
    flex-direction: row-reverse !important;
    /* Reverse the order of flex items (icon, text, badge) for RTL */
}

[dir="rtl"] .unfold-nav .material-symbols-outlined {
    margin-right: 0 !important;
    /* Remove default right margin */
    margin-left: 0.75rem !important;
    /* Equivalent to Tailwind’s mr-3 in RTL (12px or 0.75rem) */
    order: 2 !important;
    /* Place icon after text in flex direction */
}

[dir="rtl"] .unfold-nav .text-sm {
    margin-right: 0.5rem !important;
    /* Space between text and badge (equivalent to Tailwind ml-2 in RTL) */
    text-align: right;
    direction: rtl;
    order: 1 !important;
    /* Place text before badge in flex direction */
}

[dir="rtl"] .unfold-nav .bg-red-600 {
    margin-left: 0 !important;
    /* Remove default left margin */
    margin-right: 0 !important;
    /* No margin needed on right unless spacing is required */
    order: 0 !important;
    /* Place badge first in flex direction (on the right in RTL) */
}

/* Ensure text alignment and direction for Persian */
[dir="rtl"] .unfold-nav .text-sm {
    text-align: right;
    direction: rtl;
}

/* RTL adjustments for navbar headers and expandable sections (including arrow icon) */
[dir="rtl"] .unfold-nav h2 {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] .unfold-nav .flex-row {
    flex-direction: row-reverse !important;
    /* Reverse flex direction for headers */
}

[dir="rtl"] .unfold-nav .material-symbols-outlined.ml-auto {
    margin-left: 0 !important;
    /* Remove default left margin (Tailwind ml-auto) */
    margin-right: auto !important;
    /* Push to the right in RTL */
    transform: rotate(180deg) !important;
    /* Flip chevron_right for RTL (pointing left) */
    order: 999 !important;
    /* Ensure it’s the last item in the flex order, on the right */
}

/* RTL adjustments for search bar and other navbar elements */
[dir="rtl"] #nav-filter {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] .unfold-nav input[type="search"] {
    padding-right: 0.75rem !important;
    /* Adjust padding for RTL */
    padding-left: 2rem !important;
    /* Space for the search icon on the left */
}

[dir="rtl"] .unfold-nav .material-symbols-outlined.pl-3 {
    padding-left: 0 !important;
    /* Remove padding-left */
    padding-right: 0.75rem !important;
    /* Add padding-right for RTL */
}

[dir="rtl"] .mr-3 {
    margin-left: .75rem !important;
    margin-right: 0 !important;
}

/* badge fix  */

[dir="rtl"] .bg-red-600 {
    margin-left: 0rem !important;
    margin-right: .5rem !important;
}

/* colapse fix  */
/* [dir="rtl"] .ml-auto {
    margin-left: 0rem !important;
    margin-right: 8rem !important;    
} */



[dir="rtl"] .absolute.bottom-0.left-0.rounded.top-0 {
    left: auto;
    right: 0;
}


/* log out fix  */

[dir="rtl"] nav.absolute.bg-white.border.flex.flex-col.leading-none.py-1.-right-2.rounded.shadow-lg.top-7.w-52.z-50.dark\:bg-base-800.dark\:border-base-700 {
    right: auto;
    /* Remove -right-2 effect */
    left: 0;
    /* Anchor to right edge (left in RTL) */
}





/* filter sprator fix  */

[dir="rtl"] ul.dark\:bg-base-900.border.border-base-200.flex.min-w-20.rounded.shadow-sm.text-font-default-light.dark\:border-base-700.dark\:text-font-default-dark.w-full li {
    border-right: none;
    border-left: 1px solid #404040;
    /* Matches border-base-200 */
}

[dir="rtl"] ul.dark\:bg-base-900.border.border-base-200.flex.min-w-20.rounded.shadow-sm.text-font-default-light.dark\:border-base-700.dark\:text-font-default-dark.w-full li:last-child {
    border-left: 0;
}

/* Dark mode override */
[dir="rtl"] .dark ul.dark\:bg-base-900.border.border-base-200.flex.min-w-20.rounded.shadow-sm.text-font-default-light.dark\:border-base-700.dark\:text-font-default-dark.w-full li {
    border-left: 1px solid #374151;
    /* Matches dark:border-base-700 */
}




/* import export sprator fix */

/* Desktop RTL: Swap right borders to left borders */
[dir="rtl"] ul.border.flex.flex-col.font-medium.mb-4.mt-2.rounded.shadow-sm.md\:flex-row.md\:mb-2.md\:mt-0.dark\:border-base-700.max-md\:w-full li.md\:border-r {
    border-right: none;
    /* Remove md:border-r */
    border-left: 1px solid #404040;
    /* Add left border, matching border-base-200 default */
}

[dir="rtl"] ul.border.flex.flex-col.font-medium.mb-4.mt-2.rounded.shadow-sm.md\:flex-row.md\:mb-2.md\:mt-0.dark\:border-base-700.max-md\:w-full li:last-child {
    border-left: 0;
    /* No left border on last item */
}

/* Dark mode for desktop RTL */
[dir="rtl"] .dark ul.border.flex.flex-col.font-medium.mb-4.mt-2.rounded.shadow-sm.md\:flex-row.md\:mb-2.md\:mt-0.dark\:border-base-700.max-md\:w-full li.md\:border-r {
    border-left: 1px solid #374151;
    /* Matches dark:border-base-700 */
}

[dir="rtl"] h2.font-semibold.flex.flex-row.group.items-center.mb-1.mx-3.py-1\.5.px-3.select-none.text-font-important-light.text-sm.dark\:text-font-important-dark.cursor-pointer.hover\:text-primary-600.dark\:hover\:text-primary-500 {
    justify-content: space-between;
}

[dir="rtl"] span.material-symbols-outlined.ml-auto.text-base-400.transition-all.group-hover\:text-primary-600.dark\:group-hover\:text-primary-500 {
    margin: 0 !important;
    rotate: 90deg !important;
}


[dir="rtl"] div.overflow-hidden.relative.px-2.py-1.text-sm {
    background: rgb(var(--color-primary-950));
    border-radius: var(--border-radius, 6px);
    padding: 8px 16px;
}

[dir="rtl"] div.flex.flex-row.relative.z-20 {
    justify-content: space-between;
}

[dir="rtl"] strong.font-semibold.text-font-important-light.ml-auto.dark\:text-font-important-dark {
    margin: 0 !important;
}


[dir="rtl"] span.datetimeshortcuts {
    right: auto;
    /* Remove -right-2 effect */
    left: 0;
    /* Anchor to right edge (left in RTL) */
}



/* input.jalali_date-date {
    background: rgb(var(--color-base-900));
    border-radius: var(--border-radius, 6px);
} */





/* date input styles */


.jalali_date-date {
    border: 1px solid;
    background-color: rgb(var(--color-base-900));
    font-weight: 500;
    min-width: 10rem;
    /* Equivalent to min-w-20 */
    border-radius: var(--border-radius, 6px);
    /* Equivalent to rounded-md */
    box-shadow: 0 1px 2px rgb(var(--color-base-900));
    /* Equivalent to shadow-sm */
    font-size: 0.875rem;
    /* Equivalent to text-sm */
    color: var(--text-font-default-light);
    /* Adjust as per your CSS variables */
    padding: 0.5rem 0.75rem;
    /* Equivalent to px-3 py-2 */
    width: 100%;
    max-width: 32rem;
    /* Equivalent to max-w-2xl */
    outline: none;
}

.jalali_date-date:focus {
    border-color: #0059ff;
    box-shadow: 0 0 0 3px var(--color-primary-600);
}

.jalali_date-date:focus-visible {
    outline: none;
}

.group.errors .jalali_date-date {
    border-color: #dc2626;
    /* Equivalent to border-red-600 */
}

.group.errors .jalali_date-date:focus {
    box-shadow: 0 0 0 3px rgb(var(--color-base-900));
    /* Equivalent to focus:ring-red-200 */
}

/* Dark Mode Styles */
@media (prefers-color-scheme: dark) {
    .jalali_date-date {
        background-color: rgb(var(--color-base-900));
        /* Equivalent to dark:bg-gray-900 */
        border-color: rgb(var(--color-base-700));
        /* Equivalent to dark:border-gray-700 */
        color: var(--text-font-default-dark);
    }

    .jalali_date-date:focus {
        border-color: rgb(var(--color-primary-900));
        box-shadow: 2 3 2 6px var(--primary-700);
        opacity: 1;
    }

    .group.errors .jalali_date-date {
        border-color: #ef4444;
        /* Equivalent to dark:border-red-500 */
    }

    .group.errors .jalali_date-date:focus {
        box-shadow: 0 0 0 3px rgba(128, 60, 60, 0.4);
        /* Equivalent to dark:focus:ring-red-600/40 */
    }
}



input[name="location"] {
    border: 1px solid;
    background-color: rgb(var(--color-base-900));
    font-weight: 500;
    min-width: 10rem;
    /* Equivalent to min-w-20 */
    border-radius: var(--border-radius, 6px);
    /* Equivalent to rounded-md */
    box-shadow: 0 1px 2px rgb(var(--color-base-900));
    /* Equivalent to shadow-sm */
    font-size: 0.875rem;
    /* Equivalent to text-sm */
    color: var(--text-font-default-light);
    /* Adjust as per your CSS variables */
    padding: 0.5rem 0.75rem;
    /* Equivalent to px-3 py-2 */
    width: 100%;
    max-width: 32rem;
    /* Equivalent to max-w-2xl */
    outline: none;
}

input[name="location"]:focus {
    border-color: #0059ff;
    box-shadow: 0 0 0 3px var(--color-primary-600);
}

input[name="location"]:focus-visible {
    outline: none;
}

input[name="location"].group.errors {
    border-color: #dc2626;
    /* Equivalent to border-red-600 */
}

input[name="location"].group.errors:focus {
    box-shadow: 0 0 0 3px rgb(var(--color-base-900));
    /* Equivalent to focus:ring-red-200 */
}

/* Dark Mode Styles */
@media (prefers-color-scheme: dark) {
    input[name="location"] {
        background-color: rgb(var(--color-base-900));
        /* Equivalent to dark:bg-gray-900 */
        border-color: rgb(var(--color-base-700));
        /* Equivalent to dark:border-gray-700 */
        color: var(--text-font-default-dark);
    }

    input[name="location"]:focus {
        border-color: rgb(var(--color-primary-900));
        box-shadow: 2 3 2 6px var(--primary-700);
        opacity: 1;
    }

    .group.errors input[name="location"] {
        border-color: #ef4444;
        /* Equivalent to dark:border-red-500 */
    }

    .group.errors input[name="location"]:focus {
        box-shadow: 0 0 0 3px rgba(128, 60, 60, 0.4);
        /* Equivalent to dark:focus:ring-red-600/40 */
    }
}


.vTimeField {
    border: 1px solid;
    background-color: rgb(var(--color-base-900));
    font-weight: 500;
    min-width: 10rem;
    /* Equivalent to min-w-20 */
    border-radius: var(--border-radius, 6px);
    /* Equivalent to rounded-md */
    box-shadow: 0 1px 2px rgb(var(--color-base-900));
    /* Equivalent to shadow-sm */
    font-size: 0.875rem;
    /* Equivalent to text-sm */
    color: var(--text-font-default-light);
    /* Adjust as per your CSS variables */
    padding: 0.5rem 0.75rem;
    /* Equivalent to px-3 py-2 */
    width: 100%;
    max-width: 32rem;
    /* Equivalent to max-w-2xl */
    outline: none;
}

.vTimeField:focus {
    border-color: #0059ff;
    box-shadow: 0 0 0 3px var(--color-primary-600);
}

.vTimeField:focus-visible {
    outline: none;
}

.group.errors .vTimeField {
    border-color: #dc2626;
    /* Equivalent to border-red-600 */
}

.group.errors .vTimeField:focus {
    box-shadow: 0 0 0 3px rgb(var(--color-base-900));
    /* Equivalent to focus:ring-red-200 */
}

/* Dark Mode Styles */
@media (prefers-color-scheme: dark) {
    .vTimeField {
        background-color: rgb(var(--color-base-900));
        /* Equivalent to dark:bg-gray-900 */
        border-color: rgb(var(--color-base-700));
        /* Equivalent to dark:border-gray-700 */
        color: var(--text-font-default-dark);
    }

    .vTimeField:focus {
        border-color: rgb(var(--color-primary-900));
        box-shadow: 2 3 2 6px var(--primary-700);
        opacity: 1;
    }

    .group.errors .vTimeField {
        border-color: #ef4444;
        /* Equivalent to dark:border-red-500 */
    }

    .group.errors .vTimeField:focus {
        box-shadow: 0 0 0 3px rgba(128, 60, 60, 0.4);
        /* Equivalent to dark:focus:ring-red-600/40 */
    }
}

span.datetimeshortcuts {
    display: none;
}


div.bg-white.border.flex.flex-col.flex-grow.overflow-hidden.p-6.relative.rounded.shadow-sm.dark\:bg-base-900.dark\:border-base-800.w-full.lg\:w-1\/3>div>div.absolute.right-0.top-0 {
    left: 0;
    right: auto;
}

.bg-base-50 table>caption {
    direction: rtl;
    text-align: right;

    padding-right: 0.5rem;
    /* give space from the right edge */
    width: 100%;
    /* span full table width */
    box-sizing: border-box;
}


p.flex.font-medium.items-center.px-3.text-xs.py-2.lg\:pb-0.lg\:pt-2 {
    gap: 0.75rem;
}