/**
 * Arabic-first UX: fonts, RTL logical properties, empty states, unavailable nav.
 * Loaded after app.css so it can override without rebuilding vendor bundles.
 */
html[dir="rtl"] body,
html[dir="rtl"] .lw-outer-home-page {
    font-family: "IBM Plex Sans Arabic", "IBM Plex Sans", sans-serif;
}
html[dir="ltr"] body,
html[dir="ltr"] .lw-outer-home-page {
    font-family: "IBM Plex Sans", "IBM Plex Sans Arabic", sans-serif;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.btn:focus-visible,
.nav-link:focus-visible,
.form-control:focus {
    outline: 2px solid #008069;
    outline-offset: 2px;
}

#lwN8nHandoverBannerStack {
    inset-inline-end: 20px !important;
    inset-inline-start: auto !important;
    right: auto !important;
}

html[dir="rtl"] #lwN8nHandoverBannerStack {
    inset-inline-end: 20px !important;
    inset-inline-start: auto !important;
}

html[dir="rtl"] .dropdown-menu-right,
html[dir="rtl"] .dropdown-menu-end {
    right: auto;
    left: 0;
}
html[dir="ltr"] .dropdown-menu-right,
html[dir="ltr"] .dropdown-menu-end {
    left: auto;
    right: 0;
}

html[dir="rtl"] .ml-1 { margin-left: 0 !important; margin-inline-start: 0.25rem !important; }
html[dir="rtl"] .ml-2 { margin-left: 0 !important; margin-inline-start: 0.5rem !important; }
html[dir="rtl"] .ml-3 { margin-left: 0 !important; margin-inline-start: 1rem !important; }
html[dir="rtl"] .mr-1 { margin-right: 0 !important; margin-inline-end: 0.25rem !important; }
html[dir="rtl"] .mr-2 { margin-right: 0 !important; margin-inline-end: 0.5rem !important; }
html[dir="rtl"] .mr-3 { margin-right: 0 !important; margin-inline-end: 1rem !important; }
html[dir="rtl"] .pl-2 { padding-left: 0 !important; padding-inline-start: 0.5rem !important; }
html[dir="rtl"] .pr-0 { padding-right: 0 !important; padding-inline-end: 0 !important; }
html[dir="rtl"] .text-left { text-align: right !important; }
html[dir="rtl"] .text-right { text-align: left !important; }
html[dir="rtl"] .float-right { float: left !important; }
html[dir="rtl"] .float-left { float: right !important; }
html[dir="rtl"] .input-group-prepend { order: 2; }
html[dir="rtl"] .input-group-append { order: 0; }

.lw-nav-unavailable {
    cursor: default;
    opacity: 0.85;
    pointer-events: auto;
}
.lw-nav-unavailable__hint {
    font-size: 11px;
    line-height: 1.3;
    padding-inline-start: 1.5rem;
    opacity: 0.9;
}

.lw-empty-state {
    text-align: center;
    padding: 2.5rem 1.25rem;
}
.lw-empty-state__title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
}
.lw-empty-state__desc {
    color: #667781;
    margin-bottom: 1rem;
}

.lw-password-toggle {
    border: 0;
    background: transparent;
    color: #667781;
    min-width: 40px;
    min-height: 40px;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.dataTables_wrapper .dataTables_empty,
td.dataTables_empty {
    padding: 1.5rem !important;
}

.lw-chat-empty-pane {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 240px;
    padding: 2rem 1.25rem;
    text-align: center;
    color: #667781;
}
.lw-chat-empty-pane__title {
    font-weight: 600;
    color: #111b21;
    margin-bottom: 0.35rem;
}

/* Chat direction: incoming at inline-start, outgoing at inline-end */
html[dir="rtl"] .lw-whatsapp-chat-block-container .marvel-device .screen {
    text-align: right;
}
html[dir="rtl"] .lw-whatsapp-chat-block-container .user-bar div {
    float: right;
}
html[dir="rtl"] .lw-whatsapp-chat-block-container .user-bar .actions {
    float: left;
    margin: 0 20px 0 0;
}
html[dir="rtl"] .lw-whatsapp-chat-block-container .message.received {
    float: right;
    border-radius: 5px 0 5px 5px;
}
html[dir="rtl"] .lw-whatsapp-chat-block-container .message.received:after {
    left: auto;
    right: -9px;
    border-width: 0 0 10px 10px;
    border-color: transparent transparent transparent #fff;
}
html[dir="rtl"] .lw-whatsapp-chat-block-container .message.sent {
    float: left;
    border-radius: 0 5px 5px 5px;
}
html[dir="rtl"] .lw-whatsapp-chat-block-container .message.sent:after {
    right: auto;
    left: -9px;
    border-width: 0 10px 10px 0;
    border-color: transparent #e1ffc7 transparent transparent;
}
html[dir="rtl"] .lw-whatsapp-chat-block-container .lw-chat-send-btn svg {
    transform: scaleX(-1);
}
html[dir="rtl"] .lw-contact-crm-block {
    right: auto;
    left: 0;
    inset-inline-end: 0;
    inset-inline-start: auto;
}

@media (max-width: 767.98px) {
    html[dir="rtl"] .float-right {
        float: left !important;
    }
    html[dir="rtl"] .float-left {
        float: right !important;
    }
}
