:dir(rtl) body,
:dir(rtl) button,
:dir(rtl) input,
:dir(rtl) select,
:dir(rtl) textarea,
:dir(rtl) .btn,
:dir(rtl) .form-control,
:dir(rtl) .form-select,
[dir="rtl"] body,
[dir="rtl"] button,
[dir="rtl"] input,
[dir="rtl"] select,
[dir="rtl"] textarea,
[dir="rtl"] .btn,
[dir="rtl"] .form-control,
[dir="rtl"] .form-select {
    font-family: 'Heebo', sans-serif !important;
}

.sidebar-link-active {
    background-color: #3B82F6 !important;
    color: #ffffff !important;
}

.admin-sidebar {
    width: 22rem;
    max-width: 90vw;
    will-change: transform;
    border-inline-end: 1px solid rgb(226 232 240);
    overflow-y: auto;
}

.notification-recipient-list {
    max-height: 220px;
    overflow-y: auto;
}

.stable-filter-btn {
    min-width: 6.5rem;
    min-height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    white-space: nowrap;
    font-weight: 600 !important;
    line-height: 1.2;
    box-sizing: border-box;
    border-width: 1px !important;
    transform: none !important;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.stable-filter-btn:hover,
.stable-filter-btn:focus,
.stable-filter-btn:active {
    font-weight: 600 !important;
    transform: none !important;
}

.stable-filter-btn.is-selected {
    background-color: rgba(59, 130, 246, 0.12) !important;
    color: #1e40af !important;
    border-color: rgba(59, 130, 246, 0.45) !important;
    box-shadow: none !important;
}

.notification-history-item {
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 0.9rem;
    padding: 0.75rem;
    background: #fff;
}

.collapse.show {
    display: block;
    visibility: visible !important;
}

.collapsing {
    visibility: visible !important;
}

@media (max-width: 1023.98px) {
    .admin-sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        z-index: 40;
        opacity: 0;
        pointer-events: none;
        transition: transform 0.28s ease, opacity 0.28s ease;
        box-shadow: 0 20px 40px rgba(15, 23, 42, 0.18);
    }
    .admin-sidebar {
        inset-inline-start: 0;
        transform: translateX(-105%);
    }
    html:dir(rtl) .admin-sidebar,
    html[dir="rtl"] .admin-sidebar {
        transform: translateX(105%);
    }
    .admin-sidebar.is-open {
        transform: translateX(0) !important;
        opacity: 1;
        pointer-events: auto;
    }
}

@media (min-width: 1024px) {
    .admin-sidebar {
        position: static !important;
        inset: auto !important;
        transform: none !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        box-shadow: none !important;
        max-width: none;
    }
}

[data-bs-theme="dark"] .admin-sidebar {
    background-color: #1e293b;
    border-inline-end-color: #334155;
}

[data-bs-theme="dark"] .notification-history-item {
    background: #1e293b;
    border-color: #334155;
}

[data-bs-theme="dark"] .notification-recipient-list {
    background: #1e293b !important;
}

[data-bs-theme="dark"] .stable-filter-btn.is-selected {
    background-color: rgba(59, 130, 246, 0.15) !important;
    color: var(--bs-primary) !important;
    border-color: rgba(59, 130, 246, 0.4) !important;
}

/* RTL icon mirroring for Bootstrap Icons */
:dir(rtl) .bi-chevron-left,
:dir(rtl) .bi-chevron-right,
:dir(rtl) .bi-arrow-left,
:dir(rtl) .bi-arrow-right,
:dir(rtl) .bi-arrow-right-short,
:dir(rtl) .bi-arrow-up-right,
:dir(rtl) .bi-caret-left-fill,
:dir(rtl) .bi-caret-right-fill,
[dir="rtl"] .bi-chevron-left,
[dir="rtl"] .bi-chevron-right,
[dir="rtl"] .bi-arrow-left,
[dir="rtl"] .bi-arrow-right,
[dir="rtl"] .bi-arrow-right-short,
[dir="rtl"] .bi-arrow-up-right,
[dir="rtl"] .bi-caret-left-fill,
[dir="rtl"] .bi-caret-right-fill {
    transform: scaleX(-1);
}

/* Dark mode */
:root.dark { --bg: #1a1a2e; --surface: #16213e; --text: #e2e8f0; --border: #334155; --muted: #94a3b8; }
html.dark body { background-color: #1a1a2e; color: #e2e8f0; }
html.dark .bg-white { background-color: #16213e !important; }
html.dark .card, html.dark .bg-white.rounded-2xl { background-color: #16213e; border-color: #334155; }
html.dark .border-slate-100, html.dark .border-slate-200 { border-color: #334155 !important; }
html.dark .text-slate-500, html.dark .text-slate-700, html.dark .text-muted { color: #94a3b8 !important; }
html.dark .text-teal-900, html.dark .text-primary, html.dark .text-dark, html.dark .fw-semibold.text-dark { color: #e2e8f0 !important; }
html.dark .bg-light, html.dark .bg-light-subtle { background-color: #1e293b !important; }
html.dark .border-b { border-color: #334155 !important; }
html.dark .navbar, html.dark nav.fixed { background-color: rgba(26, 26, 46, 0.9) !important; }
html.dark .offcanvas { background-color: #16213e; color: #e2e8f0; }
html.dark .offcanvas-header-brand { background-color: #0f172a; }
html.dark .btn-outline-secondary { border-color: #475569; color: #cbd5e1; }
html.dark .btn-outline-secondary:hover { background-color: #334155; color: #f1f5f9; }
html.dark input.form-control, html.dark select.form-select, html.dark textarea.form-control { background-color: #1e293b; border-color: #475569; color: #e2e8f0; }
html.dark .table { color: #e2e8f0; }
html.dark .list-group-item { background-color: #16213e; color: #e2e8f0; border-color: #334155; }
