/* =====================================================
   Smart Lock - RTL Stylesheet
   Loaded only when language = Arabic or Kurdish
   ===================================================== */

body.rtl {
    font-family: 'Cairo', 'Noto Kufi Arabic', 'Poppins', sans-serif;
    direction: rtl;
    text-align: right;
}

/* Sidebar moves to the right */
body.rtl .sidebar {
    left: auto;
    right: 0;
    border-right: none;
    border-left: 1px solid var(--border);
}

/* Main content margin flips */
body.rtl .main {
    margin-left: 0;
    margin-right: var(--sidebar-w);
}

@media (max-width: 768px) {
    body.rtl .sidebar { transform: translateX(100%); }
    body.rtl .sidebar.open { transform: translateX(0); }
    body.rtl .main { margin-right: 0; }
}

/* Sidebar menu icons flip */
body.rtl .sidebar-menu a { flex-direction: row; }
body.rtl .sidebar-menu a i { margin-left: 0; margin-right: 0; }

/* Topbar: user menu flips, chevron direction */
body.rtl .user-info { text-align: right; }

/* User dropdown aligns to the left (since menu is on the right) */
body.rtl .user-dropdown {
    right: auto;
    left: 0;
}

/* Form icons: flip input-with-icon padding */
body.rtl .input-with-icon i {
    left: auto;
    right: 14px;
}
body.rtl .input-with-icon .form-control {
    padding-left: 14px;
    padding-right: 42px;
}

/* Select dropdown arrow flips to left */
body.rtl select.form-control {
    background-position: left 12px center;
    padding-left: 36px;
    padding-right: 14px;
}

/* Tables - swap text alignment */
body.rtl .table th,
body.rtl .table td { text-align: right; }

/* Page header flex order stays same but content flips naturally via dir=rtl */

/* Card headers */
body.rtl .card-header { flex-direction: row; }

/* Login page: swap panels so branding is on the right visually */
body.rtl .login-wrapper {
    direction: rtl;
}

/* Alert icons */
body.rtl .alert i { margin-left: 6px; margin-right: 0; }

/* Buttons with icons: space flips automatically due to flex row-reverse? Keep gap. */

/* Modal header */
body.rtl .modal-header { flex-direction: row; }

/* Fix scrollbar side */
body.rtl ::-webkit-scrollbar { direction: rtl; }

/* Numbers and currency should stay LTR even in RTL */
.ltr-num, .stat-value { direction: ltr; display: inline-block; }
body.rtl .stat-value { text-align: right; }

/* Keep action buttons centered */
body.rtl .action-btns { flex-direction: row-reverse; }
