/* ==========================================================================
   Gym Management System - Master Design System & Stylesheet (custom.css)
   Clean Dual-Root Color Engine (:root Light & :root Dark) with Full Brand Integration
   ========================================================================== */

/* ==========================================================================
   SECTION 1: DESIGN TOKENS & COLOR ARCHITECTURE (:root LIGHT & DARK)
   ========================================================================== */

/* 1.1 Light Mode Tokens (:root / Default) */
:root,
[data-bs-theme="light"],
body:not(.dark-mode) {
    /* Dynamic Brand Variables (Overridden dynamically from settings in head-css.php) */
    --bs-primary: #5b73e8;
    --bs-primary-rgb: 91, 115, 232;
    --brand-primary: #5b73e8;
    --brand-primary-hover: #435de3;
    --brand-primary-active: #334ecc;
    --brand-primary-light: #8096f2;
    --brand-primary-soft: rgba(var(--bs-primary-rgb, 91, 115, 232), 0.10);
    --brand-primary-soft-hover: rgba(var(--bs-primary-rgb, 91, 115, 232), 0.18);
    --brand-primary-glow: rgba(var(--bs-primary-rgb, 91, 115, 232), 0.28);
    --brand-accent: #50a5f1;
    --brand-accent-rgb: 80, 165, 241;
    --brand-text-contrast: #ffffff;
    --brand-gradient: linear-gradient(135deg, var(--brand-primary, #5b73e8) 0%, var(--brand-accent, #50a5f1) 100%);

    /* Theme Layout Surfaces & Text (Light Mode) */
    --theme-bg-body: #f8fafc;
    --theme-bg-card: #ffffff;
    --theme-bg-header: #ffffff;
    --theme-bg-light: #f1f5f9;
    --theme-text-main: #0f172a;          /* أسود ناصع وواضح */
    --theme-text-secondary: #334155;     /* كحلي داكن */
    --theme-text-muted: #64748b;
    --theme-border: #e2e8f0;
    --theme-border-subtle: rgba(var(--bs-primary-rgb, 91, 115, 232), 0.14);

    /* Form & Input Controls (Light Mode) */
    --input-bg: #ffffff;
    --input-border: #cbd5e1;
    --input-text: #0f172a;
    --input-focus-border: var(--brand-primary);
    --input-focus-ring: var(--brand-primary-soft);

    /* Sidebar Navigation (Light Mode - Crisp White Background with Black Text) */
    --sidebar-bg: #ffffff;
    --sidebar-border: #e2e8f0;
    --sidebar-text: #0f172a;              /* أسود ناصع للقوائم الرئيسية */
    --sidebar-sub-text: #1e293b;          /* كحلي داكن للقوائم الفرعية */
    --sidebar-title: #334155;             /* عناوين الأقسام الرئيسية */
    --sidebar-arrow: #475569;             /* أسهم القوائم المنسدلة */
    --sidebar-active-bg: var(--brand-primary-soft);
    --sidebar-active-border: var(--brand-primary);
    --sidebar-card-hover: var(--brand-primary-soft);

    /* Scrollbars */
    --scrollbar-track: #f1f5f9;
    --scrollbar-thumb: #cbd5e1;
    --scrollbar-thumb-hover: var(--brand-primary-soft-hover);
}

/* 1.2 Dark Mode Tokens ([data-bs-theme="dark"] / body.dark-mode) */
[data-bs-theme="dark"],
html[data-bs-theme="dark"],
body.dark-mode {
    /* Theme Layout Surfaces & Text (Dark Mode - Luxury Deep Navy) */
    --theme-bg-body: #13161f;
    --theme-bg-card: #1c202c;
    --theme-bg-header: #1e2230;
    --theme-bg-light: #252a3a;
    --theme-text-main: #f8fafc;
    --theme-text-secondary: #cbd5e1;
    --theme-text-muted: #94a3b8;
    --theme-border: #2d3345;
    --theme-border-subtle: rgba(var(--bs-primary-rgb, 91, 115, 232), 0.25);

    /* Form & Input Controls (Dark Mode) */
    --input-bg: #1e2230;
    --input-border: #333a4d;
    --input-text: #f8fafc;
    --input-focus-border: var(--brand-accent, var(--brand-primary));
    --input-focus-ring: rgba(var(--bs-primary-rgb, 91, 115, 232), 0.28);

    /* Sidebar Navigation (Dark Mode - Deep Navy & Glowing Accents) */
    --sidebar-bg: #171a24;
    --sidebar-border: #252a3a;
    --sidebar-text: #cbd5e1;
    --sidebar-sub-text: #94a3b8;
    --sidebar-title: #94a3b8;
    --sidebar-arrow: #94a3b8;
    --sidebar-active-bg: rgba(var(--bs-primary-rgb, 91, 115, 232), 0.16);
    --sidebar-active-border: var(--brand-primary);
    --sidebar-card-hover: rgba(var(--bs-primary-rgb, 91, 115, 232), 0.10);

    /* Scrollbars */
    --scrollbar-track: #171a24;
    --scrollbar-thumb: #333a4d;
    --scrollbar-thumb-hover: var(--brand-primary-soft-hover);
}

/* 1.3 Sidebar Custom Preset Overrides */
body.sidebar-theme-pitch-black,
.sidebar-theme-pitch-black {
    --sidebar-bg: #11141a;
    --sidebar-border: #202430;
    --sidebar-text: #cbd5e1;
    --sidebar-sub-text: #94a3b8;
    --sidebar-title: #64748b;
    --sidebar-arrow: #94a3b8;
}

body.sidebar-theme-dark_navy,
.sidebar-theme-dark_navy {
    --sidebar-bg: #1e222e;
    --sidebar-border: #282d3d;
    --sidebar-text: #cbd5e1;
    --sidebar-sub-text: #94a3b8;
    --sidebar-title: #94a3b8;
    --sidebar-arrow: #94a3b8;
}

body.sidebar-theme-pure-white,
.sidebar-theme-pure-white {
    --sidebar-bg: #ffffff;
    --sidebar-border: #e2e8f0;
    --sidebar-text: #0f172a;
    --sidebar-sub-text: #1e293b;
    --sidebar-title: #334155;
    --sidebar-arrow: #475569;
}

body.sidebar-theme-brand-gradient,
.sidebar-theme-brand-gradient {
    --sidebar-bg: linear-gradient(180deg, #1e1e2d 0%, #151521 100%);
    --sidebar-border: #252838;
    --sidebar-text: #cbd5e1;
    --sidebar-sub-text: #94a3b8;
    --sidebar-title: #94a3b8;
    --sidebar-arrow: #94a3b8;
}

body.sidebar-theme-brand-colored,
.sidebar-theme-brand-colored {
    --sidebar-bg: var(--brand-primary, #5b73e8);
    --sidebar-border: rgba(255, 255, 255, 0.15);
    --sidebar-text: rgba(255, 255, 255, 0.95);
    --sidebar-sub-text: rgba(255, 255, 255, 0.85);
    --sidebar-title: rgba(255, 255, 255, 0.65);
    --sidebar-arrow: rgba(255, 255, 255, 0.75);
    --sidebar-active-bg: rgba(255, 255, 255, 0.22);
    --sidebar-active-border: #ffffff;
}

.vertical-menu {
    background: var(--sidebar-bg) !important;
    border-left: 1px solid var(--sidebar-border) !important;
}


/* ==========================================================================
   SECTION 2: BASE SYSTEM ARCHITECTURE & GLOBAL ENHANCEMENTS
   ========================================================================== */


.btn,
.badge,
.dropdown-menu,
.nav-link,
.card {
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

.tooltip,
.popover {
    zoom: 1.15;
}

.hover-shadow {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.hover-shadow:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.09) !important;
}

html[data-bs-theme="dark"] .hover-shadow:hover,
body.dark-mode .hover-shadow:hover {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35) !important;
    border-color: var(--brand-primary) !important;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}

::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
}

::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

/* Theme Switch Overlay & View Transitions */
#theme-transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999;
    pointer-events: none;
    opacity: 0;
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    transition: opacity 0.22s cubic-bezier(0.25, 1, 0.5, 1);
}

html[data-bs-theme="dark"] #theme-transition-overlay,
body.dark-mode #theme-transition-overlay {
    background: rgba(18, 20, 26, 0.6);
}

#theme-transition-overlay.active {
    opacity: 1;
}

::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: 0.35s;
    animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}


/* ==========================================================================
   SECTION 3: UNIVERSAL BRAND UTILITIES & INTERACTIVE COMPONENTS
   ========================================================================== */

/* 3.1 Buttons */
.btn-primary {
    background-color: var(--brand-primary) !important;
    border-color: var(--brand-primary) !important;
    color: var(--brand-text-contrast) !important;
    box-shadow: 0 3px 8px var(--brand-primary-glow) !important;
}

.btn-primary:hover {
    background-color: var(--brand-primary-hover) !important;
    border-color: var(--brand-primary-hover) !important;
    color: var(--brand-text-contrast) !important;
    box-shadow: 0 5px 14px var(--brand-primary-glow) !important;
}

.btn-primary:focus,
.btn-primary:active,
.btn-primary.active {
    background-color: var(--brand-primary-active) !important;
    border-color: var(--brand-primary-active) !important;
    color: var(--brand-text-contrast) !important;
}

.btn-soft-primary {
    background-color: var(--brand-primary-soft) !important;
    color: var(--brand-primary) !important;
    border: 1px solid var(--theme-border-subtle) !important;
}

.btn-soft-primary:hover {
    background-color: var(--brand-primary-soft-hover) !important;
    color: var(--brand-primary-hover) !important;
    border-color: var(--brand-primary-soft-hover) !important;
}

.btn-outline-primary {
    border-color: var(--brand-primary) !important;
    color: var(--brand-primary) !important;
    background-color: transparent !important;
}

.btn-outline-primary:hover {
    background-color: var(--brand-primary) !important;
    border-color: var(--brand-primary) !important;
    color: var(--brand-text-contrast) !important;
}

/* 3.2 Badges */
.badge.bg-primary {
    background-color: var(--brand-primary) !important;
    color: var(--brand-text-contrast) !important;
}

/* 3.3 Unified Master Solid Palette & Backgrounds */
.btn-purple {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%) !important;
    border-color: #7c3aed !important;
    color: #ffffff !important;
}

.btn-purple:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.35) !important;
}

.bg-primary {
    background-color: var(--brand-primary) !important;
    color: var(--brand-text-contrast, #ffffff) !important;
}

.bg-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: #ffffff !important;
}

.bg-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    color: #ffffff !important;
}

.bg-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    color: #ffffff !important;
}

.bg-info {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%) !important;
    color: #ffffff !important;
}

.bg-purple {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%) !important;
    color: #ffffff !important;
}

.bg-dark {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%) !important;
    color: #ffffff !important;
}

.bg-secondary {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%) !important;
    color: #ffffff !important;
}

.text-primary { color: var(--brand-primary) !important; }
.text-purple  { color: #8b5cf6 !important; }
.text-info    { color: #0284c7 !important; }
.text-success { color: #059669 !important; }
.text-danger  { color: #dc2626 !important; }
.text-warning { color: #d97706 !important; }

.border-primary { border-color: var(--brand-primary) !important; }
.border-soft-primary { border-color: var(--theme-border-subtle) !important; }

/* 3.4 Interactive Controls (Forms, Checkboxes, Tabs, Pagination) */
.form-control,
input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="range"]),
textarea {
    background-color: var(--input-bg) !important;
    color: var(--input-text) !important;
    border-color: var(--input-border) !important;
    direction: rtl !important;
    text-align: right !important;
}

.form-select,
select.form-control {
    background-color: var(--input-bg) !important;
    color: var(--input-text) !important;
    border-color: var(--input-border) !important;
    direction: rtl !important;
    text-align: right !important;
    background-position: left 0.75rem center !important;
    padding-right: 0.85rem !important;
    padding-left: 2.25rem !important;
}

.form-control:focus,
.form-select:focus,
select.form-control:focus {
    border-color: var(--input-focus-border) !important;
    box-shadow: 0 0 0 0.22rem var(--input-focus-ring) !important;
}

.form-check-input:checked {
    background-color: var(--brand-primary) !important;
    border-color: var(--brand-primary) !important;
}

.form-check-input:focus {
    border-color: var(--brand-primary) !important;
    box-shadow: 0 0 0 0.22rem var(--brand-primary-soft) !important;
}

.page-item.active .page-link {
    background-color: var(--brand-primary) !important;
    border-color: var(--brand-primary) !important;
    color: var(--brand-text-contrast) !important;
}

.page-link:hover {
    color: var(--brand-primary-hover) !important;
}

.nav-pills .nav-link.active,
.nav-tabs-custom .nav-item .nav-link.active {
    background-color: var(--brand-primary) !important;
    color: var(--brand-text-contrast) !important;
}

.nav-tabs .nav-link.active {
    color: var(--brand-primary) !important;
    border-bottom: 2px solid var(--brand-primary) !important;
}

.progress-bar {
    background-color: var(--brand-primary) !important;
}

/* 3.5 Tables */
.table-hover tbody tr:hover {
    background-color: var(--brand-primary-soft) !important;
}

.table-primary {
    background-color: var(--brand-primary-soft) !important;
    color: var(--brand-primary) !important;
    border-color: var(--theme-border-subtle) !important;
}

/* 3.6 Select2 Components - Full RTL Precision */
.select2-container {
    direction: rtl !important;
    text-align: right !important;
}

.select2-container--default .select2-selection--single {
    background-color: var(--input-bg) !important;
    border-color: var(--input-border) !important;
    height: 38px !important;
    border-radius: 0.25rem !important;
    direction: rtl !important;
    text-align: right !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--input-text) !important;
    line-height: 36px !important;
    padding-right: 12px !important;
    padding-left: 32px !important;
    direction: rtl !important;
    text-align: right !important;
    display: block !important;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: var(--theme-text-muted, #94a3b8) !important;
    direction: rtl !important;
    text-align: right !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px !important;
    left: 8px !important;
    right: auto !important;
    top: 1px !important;
}

.select2-container--default .select2-selection--single .select2-selection__clear {
    float: left !important;
    margin-left: 20px !important;
    margin-right: auto !important;
}

.select2-dropdown {
    background-color: var(--theme-bg-card) !important;
    border-color: var(--theme-border) !important;
    color: var(--theme-text-main) !important;
    direction: rtl !important;
    text-align: right !important;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    background-color: var(--input-bg) !important;
    color: var(--input-text) !important;
    border-color: var(--input-border) !important;
    direction: rtl !important;
    text-align: right !important;
    padding-right: 10px !important;
    padding-left: 10px !important;
}

.select2-container--default .select2-results__option {
    direction: rtl !important;
    text-align: right !important;
    padding: 8px 12px !important;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: var(--brand-primary) !important;
    color: var(--brand-text-contrast, #ffffff) !important;
}

.select2-container--default .select2-selection--multiple {
    background-color: var(--input-bg) !important;
    border-color: var(--input-border) !important;
    min-height: 38px !important;
    direction: rtl !important;
    text-align: right !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    float: right !important;
    margin-left: 5px !important;
    margin-right: 0 !important;
    background-color: var(--brand-primary-soft) !important;
    border-color: var(--brand-primary) !important;
    color: var(--brand-primary) !important;
    direction: rtl !important;
}

.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single,
.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--default.select2-container--open .select2-selection--multiple {
    border-color: var(--input-focus-border) !important;
    box-shadow: 0 0 0 0.22rem var(--input-focus-ring) !important;
}

/* 3.7 Dark Mode Global Surface Overrides */
html[data-bs-theme="dark"] body,
body.dark-mode {
    background-color: var(--theme-bg-body) !important;
    color: var(--theme-text-main) !important;
}

html[data-bs-theme="dark"] .card,
body.dark-mode .card {
    background-color: var(--theme-bg-card) !important;
    border-color: var(--theme-border) !important;
}

html[data-bs-theme="dark"] #page-topbar,
body.dark-mode #page-topbar {
    background-color: var(--theme-bg-header) !important;
    border-bottom: 1px solid var(--theme-border) !important;
}

html[data-bs-theme="dark"] .navbar-brand-box,
body.dark-mode .navbar-brand-box {
    background-color: var(--theme-bg-header) !important;
}

html[data-bs-theme="dark"] .bg-white,
body.dark-mode .bg-white,
html[data-bs-theme="dark"] .card-header.bg-white,
body.dark-mode .card-header.bg-white,
html[data-bs-theme="dark"] .card-footer.bg-white,
body.dark-mode .card-footer.bg-white {
    background-color: var(--theme-bg-light) !important;
    color: var(--theme-text-main) !important;
}

html[data-bs-theme="dark"] .bg-light,
body.dark-mode .bg-light,
html[data-bs-theme="dark"] .card-header.bg-light,
body.dark-mode .card-header.bg-light,
html[data-bs-theme="dark"] .card-footer.bg-light,
body.dark-mode .card-footer.bg-light {
    background-color: var(--theme-bg-card) !important;
    color: var(--theme-text-main) !important;
}

html[data-bs-theme="dark"] .text-dark,
body.dark-mode .text-dark {
    color: var(--theme-text-main) !important;
}

html[data-bs-theme="dark"] .text-secondary,
body.dark-mode .text-secondary {
    color: var(--theme-text-muted) !important;
}

html[data-bs-theme="dark"] .border-bottom,
body.dark-mode .border-bottom,
html[data-bs-theme="dark"] .border-top,
body.dark-mode .border-top,
html[data-bs-theme="dark"] .border {
    border-color: var(--theme-border) !important;
}

html[data-bs-theme="dark"] .table-light,
body.dark-mode .table-light,
html[data-bs-theme="dark"] .table-light th,
body.dark-mode .table-light th,
html[data-bs-theme="dark"] .table-light td,
body.dark-mode .table-light td {
    background-color: var(--theme-bg-card) !important;
    color: var(--theme-text-main) !important;
    border-color: var(--theme-border) !important;
}

html[data-bs-theme="dark"] .input-group-text,
body.dark-mode .input-group-text {
    background-color: var(--theme-bg-card) !important;
    color: var(--theme-text-main) !important;
    border-color: var(--theme-border) !important;
}


/* ==========================================================================
   SECTION 4: SYSTEM MODALS & RESPONSIVE CONTAINERS
   ========================================================================== */

.modal-dialog {
    display: flex;
    align-items: center;
    min-height: calc(100% - 3.5rem);
    margin: 1.75rem auto;
    max-width: 94vw;
}

@media (min-width: 576px) {
    .modal-dialog { max-width: 540px; }
    .modal-dialog.modal-sm { max-width: 400px; }
    .modal-dialog.modal-md { max-width: 650px; }
    .modal-dialog.modal-lg { max-width: 900px; }
    .modal-dialog.modal-xl { max-width: 1180px; }
}

.modal-content {
    max-height: calc(100vh - 3.5rem);
    display: flex;
    flex-direction: column;
    width: 100%;
    border-radius: 14px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.25);
    border: none;
    overflow: hidden;
}

html[data-bs-theme="dark"] .modal-content,
body.dark-mode .modal-content {
    background-color: var(--theme-bg-light) !important;
    color: var(--theme-text-main) !important;
}

.modal-header,
.modal-content>form>.modal-header,
.modal-content>form>.bg-light.border-bottom {
    flex-shrink: 0;
}

.modal-body,
.modal-content>form>.modal-body {
    flex: 1 1 auto;
    max-height: calc(100vh - 210px) !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    padding: 1.5rem;
}

.modal-footer,
.modal-content>form>.modal-footer {
    flex-shrink: 0;
}

html[data-bs-theme="dark"] .modal-header,
body.dark-mode .modal-header,
html[data-bs-theme="dark"] .modal-footer,
body.dark-mode .modal-footer {
    border-color: var(--theme-border) !important;
}

.modal-backdrop {
    width: -webkit-fill-available !important;
    height: -webkit-fill-available !important;
}


/* ==========================================================================
   SECTION 5: LUXURY MODERN SIDEBAR NAVIGATION
   ========================================================================== */


#sidebar-menu .menu-title {
    padding: 14px 12px 6px 12px !important;
    font-size: 11.5px !important;
    font-weight: 800 !important;
    letter-spacing: 0.3px;
    color: var(--sidebar-title) !important;
    text-align: right !important;
}

/* 5.1 Base Menu Item Capsule Styling */
#sidebar-menu ul li {
    margin-bottom: 2px;
}

#sidebar-menu ul li a {
    padding: 8px 12px !important;
    margin: 3px 6px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    text-align: right !important;
    font-size: 13.8px !important;
    font-weight: 700 !important;
    color: var(--sidebar-text) !important;
    border-right: 3.5px solid transparent !important;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative;
    direction: rtl !important;
}

#sidebar-menu ul li a .d-flex {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    flex-grow: 1 !important;
    text-align: right !important;
}

#sidebar-menu ul li a span:not(.avatar-xs) {
    font-size: 13.8px !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
    line-height: 1.3 !important;
    display: inline-block !important;
    color: inherit !important;
}

/* 5.2 Fixed-Size Square Icon Box (36x36 px, Perfectly Centered) */
#sidebar-menu .avatar-xs {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    max-width: 36px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    margin-left: 12px !important;
    margin-right: 0 !important;
    border-radius: 9px !important;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.14) !important;
    transition: all 0.22s ease !important;
    flex-shrink: 0 !important;
}

#sidebar-menu .avatar-xs i {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
    font-size: 18px !important;
    line-height: 1 !important;
    color: #ffffff !important;
    margin: 0 !important;
    padding: 0 !important;
    transition: transform 0.2s ease !important;
}

/* Preset Solid Color Palettes for Icon Boxes */
#sidebar-menu .avatar-xs.bg-primary,
#sidebar-menu .avatar-xs.bg-primary {
    background: var(--brand-gradient) !important;
    color: var(--brand-text-contrast) !important;
}

#sidebar-menu .avatar-xs.bg-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: #ffffff !important;
}

#sidebar-menu .avatar-xs.bg-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    color: #ffffff !important;
}

#sidebar-menu .avatar-xs.bg-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    color: #ffffff !important;
}

#sidebar-menu .avatar-xs.bg-info {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%) !important;
    color: #ffffff !important;
}

#sidebar-menu .avatar-xs.bg-purple {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%) !important;
    color: #ffffff !important;
}

#sidebar-menu .avatar-xs.bg-secondary {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%) !important;
    color: #ffffff !important;
}

/* 5.3 Hover States */
#sidebar-menu ul li a:hover {
    background: var(--sidebar-card-hover) !important;
    color: var(--brand-primary) !important;
    transform: translateX(-2px);
}

#sidebar-menu ul li a:hover .avatar-xs {
    transform: scale(1.1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2) !important;
}

/* 5.4 Active State for Parent / Open Dropdown */
#sidebar-menu ul li.mm-active > a,
#sidebar-menu ul li a.active {
    background: var(--sidebar-active-bg) !important;
    color: var(--brand-primary) !important;
    font-weight: 700 !important;
    border-right: 4px solid var(--sidebar-active-border) !important;
    box-shadow: 0 2px 8px var(--brand-primary-soft) !important;
}

#sidebar-menu ul li.mm-active > a .avatar-xs,
#sidebar-menu ul li a.active .avatar-xs {
    transform: scale(1.06);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.22) !important;
}

/* 5.5 MetisMenu Dropdown Arrow (Has-Arrow) */
#sidebar-menu ul li a.has-arrow:after {
    display: inline-block;
    font-family: 'remixicon' !important;
    content: "\ea4e" !important; /* ri-arrow-down-s-line */
    font-size: 16px !important;
    color: var(--sidebar-arrow) !important;
    border: none !important;
    width: auto !important;
    height: auto !important;
    margin-right: auto !important;
    margin-left: 2px !important;
    transform: rotate(0deg) !important;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s ease !important;
}

#sidebar-menu ul li.mm-active > a.has-arrow:after,
#sidebar-menu ul li a.has-arrow[aria-expanded="true"]:after {
    transform: rotate(180deg) !important;
    color: var(--brand-primary) !important;
    font-weight: bold !important;
}

/* 5.6 Sub-Menu List Container */
#sidebar-menu ul.sub-menu {
    padding: 4px 6px 6px 14px !important;
    margin-right: 14px !important;
    border-right: 2px dashed var(--brand-primary-soft-hover) !important;
    list-style: none !important;
}

/* 5.7 Sub-Menu Items */
#sidebar-menu ul.sub-menu li {
    margin-bottom: 2px;
}

#sidebar-menu ul.sub-menu li a {
    padding: 8px 12px !important;
    margin: 2px 4px !important;
    font-size: 13.2px !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    border-right: none !important;
    color: var(--sidebar-sub-text) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    text-align: right !important;
    transition: all 0.2s ease !important;
}

#sidebar-menu ul.sub-menu li a i {
    font-size: 15px !important;
    margin-left: 8px !important;
    margin-right: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease !important;
}

#sidebar-menu ul.sub-menu li a:hover {
    background: var(--brand-primary-soft) !important;
    color: var(--brand-primary) !important;
    transform: translateX(-4px) !important;
}

#sidebar-menu ul.sub-menu li a:hover i {
    transform: scale(1.15);
}

/* 5.8 Multi-Level Nested Sub-Menus (Level 2.2 / Level 3) */
#sidebar-menu ul.sub-menu ul.sub-menu {
    padding: 2px 4px 4px 10px !important;
    margin-right: 12px !important;
    border-right: 1.5px dotted var(--brand-primary-soft) !important;
}

#sidebar-menu ul.sub-menu ul.sub-menu li a {
    padding: 6px 10px !important;
    font-size: 12.6px !important;
}

/* Sub-Menu Item Active State */
#sidebar-menu ul.sub-menu li a.active,
#sidebar-menu ul.sub-menu li.mm-active > a {
    background: var(--sidebar-active-bg) !important;
    color: var(--brand-primary) !important;
    font-weight: 700 !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 6px var(--brand-primary-soft) !important;
}

#sidebar-menu ul.sub-menu li a.active i,
#sidebar-menu ul.sub-menu li.mm-active > a i {
    color: var(--brand-primary) !important;
}


/* ==========================================================================
   SECTION 6: BRANDING & VISUAL IDENTITY CONTROL CENTER UI
   ========================================================================== */

.branding-logo-box {
    border: 2px dashed var(--input-border);
    border-radius: 12px;
    background-color: var(--theme-bg-light);
    transition: all 0.2s ease-in-out;
}

.branding-logo-box:hover {
    border-color: var(--brand-primary);
    background-color: var(--brand-primary-soft);
}

.branding-logo-preview-img {
    max-height: 52px;
    max-width: 100%;
    object-fit: contain;
}

.branding-preset-card {
    cursor: pointer;
    border: 2px solid var(--theme-border);
    border-radius: 12px;
    transition: all 0.2s ease-in-out;
}

.branding-preset-card:hover {
    border-color: var(--brand-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px var(--brand-primary-glow);
}

.branding-preset-card.active {
    border-color: var(--brand-primary);
    background-color: var(--brand-primary-soft);
    box-shadow: 0 4px 14px var(--brand-primary-glow);
}

.branding-color-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-block;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.branding-live-preview-box {
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

/* ==========================================================================
   SECTION 7: FULL-SCREEN AUTH PORTAL UI & FLOATING BREATHING PARTICLES
   ========================================================================== */

.auth-split-wrapper {
    min-height: 100vh;
    overflow-x: hidden;
}

.auth-form-side {
    background-color: var(--theme-bg-card, #ffffff);
    border-left: 1px solid var(--theme-border, #e2e8f0);
    z-index: 2;
}

.auth-hero-side {
    background: radial-gradient(circle at 10% 20%, rgba(85, 110, 230, 0.18) 0%, transparent 40%),
                radial-gradient(circle at 90% 80%, rgba(85, 110, 230, 0.12) 0%, transparent 40%),
                var(--theme-bg-body, #0f172a);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.auth-hero-side-admin {
    background: radial-gradient(circle at 15% 25%, rgba(85, 110, 230, 0.32) 0%, transparent 50%),
                radial-gradient(circle at 85% 75%, rgba(139, 92, 246, 0.22) 0%, transparent 50%),
                #0f172a;
}

.auth-hero-side-branch {
    background: radial-gradient(circle at 15% 25%, rgba(16, 185, 129, 0.32) 0%, transparent 50%),
                radial-gradient(circle at 85% 75%, rgba(6, 78, 59, 0.45) 0%, transparent 50%),
                #04241a;
}

.auth-hero-side-member {
    background: radial-gradient(circle at 15% 25%, rgba(14, 165, 233, 0.32) 0%, transparent 50%),
                radial-gradient(circle at 85% 75%, rgba(99, 102, 241, 0.28) 0%, transparent 50%),
                #061a2b;
}

/* Floating Breathing Icons */
.auth-floating-icon {
    position: absolute;
    color: rgba(255, 255, 255, 0.08);
    pointer-events: none;
    user-select: none;
    z-index: 1;
    animation: authFloatBreath 6s ease-in-out infinite alternate;
}

.auth-floating-icon-1 {
    top: 8%;
    left: 12%;
    font-size: 5.5rem;
    animation-duration: 7.5s;
    animation-delay: 0s;
}

.auth-floating-icon-2 {
    bottom: 12%;
    right: 8%;
    font-size: 7rem;
    animation-duration: 9.5s;
    animation-delay: -2.5s;
}

.auth-floating-icon-3 {
    top: 50%;
    left: 6%;
    font-size: 4.5rem;
    animation-duration: 6.8s;
    animation-delay: -4s;
}

.auth-floating-icon-4 {
    top: 22%;
    right: 18%;
    font-size: 4.8rem;
    animation-duration: 8.2s;
    animation-delay: -1.2s;
}

@keyframes authFloatBreath {
    0% {
        transform: translateY(0px) scale(1) rotate(0deg);
        opacity: 0.08;
    }
    50% {
        transform: translateY(-16px) scale(1.1) rotate(4deg);
        opacity: 0.18;
    }
    100% {
        transform: translateY(10px) scale(0.95) rotate(-4deg);
        opacity: 0.06;
    }
}

/* Glassmorphism Feature Card in Auth Hero */
.auth-hero-feature-card {
    background: rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.auth-hero-feature-card:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-3px);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.22);
}

.auth-portal-btn-switch {
    border-radius: 12px;
    border: 1px solid var(--theme-border, #e2e8f0);
    transition: all 0.2s ease-in-out;
}

.auth-portal-btn-switch:hover {
    border-color: var(--brand-primary);
    background-color: var(--brand-primary-soft);
    transform: translateY(-2px);
}

/* Perfect Height Fitting & Zero-Scroll Desktop View */
@media (min-width: 992px) {
    .auth-split-wrapper {
        height: 100vh;
        max-height: 100vh;
        overflow: hidden;
    }

    .auth-form-side {
        height: 100vh;
        max-height: 100vh;
        overflow-y: auto;
        scrollbar-width: thin;
    }

    .auth-hero-side {
        height: 100vh;
        max-height: 100vh;
        overflow: hidden;
    }
}

/* Mobile & Tablet Screens (Phones only show clean centered login form) */
@media (max-width: 991.98px) {
    .auth-split-wrapper {
        min-height: 100vh;
        min-height: 100dvh;
        background-color: var(--theme-bg-card, #ffffff);
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .auth-form-side {
        min-height: 100vh;
        min-height: 100dvh;
        width: 100%;
        display: flex;
        flex-direction: column;
        justify-content: center !important;
        padding: 2rem 1.25rem !important;
        border-left: none !important;
        max-width: 480px;
        margin: 0 auto;
    }

    .auth-hero-side {
        display: none !important;
    }
}

/* ==========================================================================
   SECTION 8: DRIVER.JS INTERACTIVE ONBOARDING TOUR GUIDE (RTL ARABIC)
   ========================================================================== */

.driver-popover {
    font-family: 'IBM Plex Sans Arabic', sans-serif !important;
    direction: rtl !important;
    text-align: right !important;
    background: #ffffff !important;
    border-radius: 12px !important;
    padding: 20px !important;
    min-width: 320px !important;
    max-width: 420px !important;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(91, 115, 232, 0.15) !important;
    z-index: 1000000000 !important;
}

[data-bs-theme="dark"] .driver-popover {
    background: #2a3042 !important;
    color: #e9ecef !important;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(91, 115, 232, 0.3) !important;
}

.driver-popover-title {
    font-size: 16px !important;
    font-weight: 800 !important;
    color: #1e293b !important;
    margin-bottom: 8px !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

[data-bs-theme="dark"] .driver-popover-title {
    color: #ffffff !important;
}

.driver-popover-description {
    font-size: 13.5px !important;
    line-height: 1.65 !important;
    color: #64748b !important;
    margin-bottom: 16px !important;
}

[data-bs-theme="dark"] .driver-popover-description {
    color: #a6b0cf !important;
}

.driver-popover-footer {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    border-top: 1px solid #f1f5f9 !important;
    padding-top: 12px !important;
    margin-top: 8px !important;
}

[data-bs-theme="dark"] .driver-popover-footer {
    border-top-color: #32394e !important;
}

.driver-popover-progress-text {
    font-size: 12px !important;
    font-weight: 700 !important;
    color: #5b73e8 !important;
    background: rgba(91, 115, 232, 0.12) !important;
    padding: 3px 10px !important;
    border-radius: 20px !important;
}

.driver-popover-navigation-btns {
    display: flex !important;
    gap: 8px !important;
}

.driver-popover-prev-btn,
.driver-popover-next-btn,
.driver-popover-close-btn {
    font-family: 'IBM Plex Sans Arabic', sans-serif !important;
    font-size: 12.5px !important;
    font-weight: 700 !important;
    border-radius: 6px !important;
    padding: 6px 14px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.driver-popover-next-btn {
    background-color: #5b73e8 !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: 0 3px 8px rgba(91, 115, 232, 0.3) !important;
}

.driver-popover-next-btn:hover {
    background-color: #4861df !important;
}

.driver-popover-prev-btn {
    background-color: #f1f5f9 !important;
    color: #475569 !important;
    border: 1px solid #e2e8f0 !important;
}

[data-bs-theme="dark"] .driver-popover-prev-btn {
    background-color: #32394e !important;
    color: #c3cbe4 !important;
    border-color: #3b4258 !important;
}

.driver-popover-prev-btn:hover {
    background-color: #e2e8f0 !important;
}

.driver-popover-close-btn {
    position: absolute !important;
    top: 14px !important;
    left: 14px !important;
    right: auto !important;
    width: 24px !important;
    height: 24px !important;
    border-radius: 50% !important;
    background: #f8fafc !important;
    color: #94a3b8 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
}

[data-bs-theme="dark"] .driver-popover-close-btn {
    background: #32394e !important;
    color: #a6b0cf !important;
}

.driver-popover-close-btn:hover {
    background: #ef4444 !important;
    color: #ffffff !important;
}

/* Driver.js Voice Narration Audio UI Button */
.gym-tour-audio-toggle {
    font-size: 11px !important;
    padding: 3px 9px !important;
    border: 1px solid rgba(91, 115, 232, 0.25) !important;
    transition: all 0.2s ease-in-out !important;
    cursor: pointer !important;
}

.gym-tour-audio-toggle:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.gym-audio-pulse {
    display: inline-block;
    animation: gymAudioPulseAnim 1.2s infinite ease-in-out;
}

@keyframes gymAudioPulseAnim {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.25);
        opacity: 1;
        filter: drop-shadow(0 0 4px #5b73e8);
    }
    100% {
        transform: scale(1);
        opacity: 0.8;
    }
}

/* 5px Padding for Direct Table Containers */
.p-5px {
    padding: 5px !important;
}

.table-direct-wrapper {
    padding: 5px !important;
}

/* ==========================================================================
   SECTION 9: MOBILE RESPONSIVE TOPBAR & ICON ALIGNMENT ENGINE (RTL & DARK/LIGHT)
   ========================================================================== */

#page-topbar {
    transition: all 0.25s ease-in-out;
    border-bottom: 1px solid var(--theme-border, #e2e8f0);
}

[data-bs-theme="dark"] #page-topbar {
    background-color: #1f293d !important;
    border-bottom-color: #2b364c !important;
}

.topbar-branch-dropdown-menu {
    min-width: 250px;
}

.topbar-noti-scroll {
    max-height: 280px;
}

/* Base Topbar Action Icon Buttons (Desktop & Mobile) */
.topbar-icon-btn,
#page-topbar .header-item.noti-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* ==========================================================================
   SECTION 10: ADVANCED CYBERSECURITY SHIELD & ANTI-INSPECTION MODAL (RTL)
   ========================================================================== */

.security-shield-backdrop {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: radial-gradient(circle at 50% 30%, #1e1b4b 0%, #0f172a 60%, #020617 100%) !important;
    z-index: 2147483647 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-family: 'IBM Plex Sans Arabic', sans-serif !important;
    direction: rtl !important;
    padding: 24px !important;
    overflow: hidden !important;
}

.security-shield-card {
    background: rgba(15, 23, 42, 0.88) !important;
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
    border: 1px solid rgba(239, 68, 68, 0.4) !important;
    border-radius: 24px !important;
    padding: 40px 32px !important;
    text-align: center !important;
    max-width: 560px !important;
    width: 100% !important;
    color: #ffffff !important;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.8), 0 0 40px rgba(239, 68, 68, 0.2) !important;
    animation: secShieldPopIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
    position: relative !important;
}

@keyframes secShieldPopIn {
    0% {
        transform: scale(0.85);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.security-shield-pill {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    background: rgba(239, 68, 68, 0.12) !important;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
    color: #fca5a5 !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    padding: 5px 14px !important;
    border-radius: 30px !important;
    margin-bottom: 20px !important;
}

.security-shield-dot {
    width: 8px !important;
    height: 8px !important;
    background-color: #ef4444 !important;
    border-radius: 50% !important;
    display: inline-block !important;
    animation: secDotPulse 1.2s infinite ease-in-out !important;
}

@keyframes secDotPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0.4; }
}

.security-shield-icon-box {
    width: 84px !important;
    height: 84px !important;
    background: radial-gradient(circle, rgba(239, 68, 68, 0.25) 0%, rgba(239, 68, 68, 0.05) 70%) !important;
    border: 2px solid rgba(239, 68, 68, 0.6) !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-bottom: 22px !important;
    color: #ef4444 !important;
    font-size: 42px !important;
    box-shadow: 0 0 25px rgba(239, 68, 68, 0.35) !important;
    animation: secPulseIcon 2s infinite ease-in-out !important;
}

@keyframes secPulseIcon {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }
    70% {
        transform: scale(1.06);
        box-shadow: 0 0 0 16px rgba(239, 68, 68, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

.security-shield-title {
    color: #ffffff !important;
    font-size: 22px !important;
    font-weight: 800 !important;
    margin-bottom: 12px !important;
    letter-spacing: -0.5px !important;
}

.security-shield-desc {
    color: #94a3b8 !important;
    font-size: 13.5px !important;
    line-height: 1.8 !important;
    margin-bottom: 24px !important;
}

.security-shield-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 10px !important;
    background: rgba(30, 41, 59, 0.6) !important;
    border: 1px solid rgba(51, 65, 85, 0.8) !important;
    border-radius: 14px !important;
    padding: 12px !important;
    margin-bottom: 24px !important;
    text-align: center !important;
}

.security-shield-grid-item {
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
}

.security-shield-grid-label {
    font-size: 11px !important;
    color: #64748b !important;
    font-weight: 600 !important;
}

.security-shield-grid-val {
    font-size: 12px !important;
    color: #e2e8f0 !important;
    font-weight: 700 !important;
}

.security-shield-actions {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px !important;
}

.security-shield-btn-primary {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    color: #ffffff !important;
    border: none !important;
    padding: 12px 28px !important;
    border-radius: 12px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.4) !important;
    transition: all 0.2s ease !important;
}

.security-shield-btn-primary:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.6) !important;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%) !important;
}

.security-shield-btn-secondary {
    background: rgba(30, 41, 59, 0.8) !important;
    color: #cbd5e1 !important;
    border: 1px solid rgba(71, 85, 105, 0.8) !important;
    padding: 12px 20px !important;
    border-radius: 12px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    transition: all 0.2s ease !important;
}

.security-shield-btn-secondary:hover {
    background: rgba(51, 65, 85, 0.9) !important;
    color: #ffffff !important;
    border-color: #94a3b8 !important;
}

.topbar-icon-btn i,
#page-topbar .header-item.noti-icon i {
    line-height: 1 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Desktop Branch Button Enhancement */
@media (min-width: 1200px) {
    .topbar-branch-btn,
    #page-header-branch-dropdown {
        border-radius: 10px !important;
        padding: 6px 14px !important;
        height: 40px !important;
        display: inline-flex !important;
        align-items: center !important;
        gap: 8px !important;
        background: var(--brand-primary, #5b73e8) !important;
        color: #ffffff !important;
        border: 1px solid rgba(255, 255, 255, 0.15) !important;
        box-shadow: 0 2px 6px var(--brand-primary-soft, rgba(91, 115, 232, 0.25)) !important;
        transition: all 0.2s ease-in-out !important;
    }

    .topbar-branch-btn:hover,
    #page-header-branch-dropdown:hover {
        background: var(--brand-primary-hover, #4861df) !important;
        transform: translateY(-1px);
        box-shadow: 0 4px 10px var(--brand-primary-soft, rgba(91, 115, 232, 0.35)) !important;
    }
}

/* Tablet & Mobile Screens (<= 991.98px) */
@media (max-width: 991.98px) {
    #page-topbar {
        height: 64px !important;
        position: fixed !important;
        top: 0 !important;
        right: 0 !important;
        left: 0 !important;
        z-index: 1002 !important;
        background: var(--theme-bg-card, #ffffff) !important;
        box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08) !important;
    }

    #page-topbar .navbar-header {
        height: 64px !important;
        padding: 0 10px !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
        max-width: 100vw !important;
    }

    /* Left Side: Logo & Hamburger Menu */
    .topbar-left-side {
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
        margin: 0 !important;
        flex-shrink: 0 !important;
        max-width: fit-content !important;
    }

    .topbar-left-side .navbar-brand-box {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        position: relative !important;
        width: auto !important;
        height: 40px !important;
        padding: 0 !important;
        margin: 0 !important;
        background: transparent !important;
    }

    .topbar-left-side .navbar-brand-box .logo img {
        max-height: 48px !important;
        max-width: 100% !important;
        object-fit: contain !important;
    }

    .topbar-left-side .vertical-menu-btn {
        height: 38px !important;
        width: 38px !important;
        min-width: 38px !important;
        padding: 0 !important;
        margin: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 10px !important;
        background-color: var(--theme-bg-light, #f8fafc) !important;
        color: var(--theme-text-dark, #334155) !important;
        border: 1px solid var(--theme-border, #e2e8f0) !important;
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }

    .topbar-left-side .vertical-menu-btn:active {
        transform: scale(0.92) !important;
    }

    .topbar-left-side .vertical-menu-btn i {
        font-size: 20px !important;
        line-height: 1 !important;
    }

    [data-bs-theme="dark"] .topbar-left-side .vertical-menu-btn {
        background-color: #273147 !important;
        color: #e2e8f0 !important;
        border-color: #334155 !important;
    }

    /* Right Side: Action Icons Container */
    .topbar-right-side {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
        gap: 5px !important;
        flex-shrink: 0 !important;
        margin: 0 !important;
    }

    /* Uniform Icon Buttons on Mobile */
    .topbar-icon-btn,
    #page-topbar .header-item.noti-icon {
        height: 38px !important;
        width: 38px !important;
        min-width: 38px !important;
        max-width: 38px !important;
        padding: 0 !important;
        margin: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 10px !important;
        background-color: var(--theme-bg-light, #f8fafc) !important;
        color: var(--theme-text-dark, #475569) !important;
        border: 1px solid var(--theme-border, #e2e8f0) !important;
        position: relative !important;
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
    }

    .topbar-icon-btn:hover,
    #page-topbar .header-item.noti-icon:hover {
        background-color: var(--brand-primary-soft, rgba(91, 115, 232, 0.1)) !important;
        color: var(--brand-primary, #5b73e8) !important;
        border-color: var(--brand-primary-soft-hover, rgba(91, 115, 232, 0.2)) !important;
    }

    .topbar-icon-btn:active,
    #page-topbar .header-item.noti-icon:active {
        transform: scale(0.92) !important;
    }

    .topbar-icon-btn i,
    #page-topbar .header-item.noti-icon i {
        font-size: 18px !important;
        line-height: 1 !important;
        margin: 0 !important;
    }

    [data-bs-theme="dark"] .topbar-icon-btn,
    [data-bs-theme="dark"] #page-topbar .header-item.noti-icon {
        background-color: #273147 !important;
        color: #cbd5e1 !important;
        border-color: #334155 !important;
    }

    [data-bs-theme="dark"] .topbar-icon-btn:hover,
    [data-bs-theme="dark"] #page-topbar .header-item.noti-icon:hover {
        background-color: rgba(91, 115, 232, 0.2) !important;
        color: #ffffff !important;
    }

    /* Notification Badge Alignment on Mobile (RTL) */
    #page-topbar .noti-icon .badge {
        position: absolute !important;
        top: -3px !important;
        left: -3px !important;
        right: auto !important;
        font-size: 10px !important;
        padding: 2px 5px !important;
        min-width: 16px !important;
        height: 16px !important;
        line-height: 12px !important;
        border: 2px solid #ffffff !important;
        border-radius: 10px !important;
        box-shadow: 0 2px 5px rgba(239, 68, 68, 0.4) !important;
    }

    [data-bs-theme="dark"] #page-topbar .noti-icon .badge {
        border-color: #1f293d !important;
    }

    /* Branch Switcher Button on Mobile */
    .topbar-branch-btn,
    #page-header-branch-dropdown {
        height: 38px !important;
        width: 38px !important;
        min-width: 38px !important;
        max-width: 38px !important;
        padding: 0 !important;
        margin: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 10px !important;
        background: var(--brand-primary, #5b73e8) !important;
        color: #ffffff !important;
        border: 1px solid rgba(255, 255, 255, 0.2) !important;
        box-shadow: 0 2px 6px var(--brand-primary-soft, rgba(91, 115, 232, 0.3)) !important;
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }

    .topbar-branch-btn:active,
    #page-header-branch-dropdown:active {
        transform: scale(0.92) !important;
    }

    .topbar-branch-btn i,
    #page-header-branch-dropdown i {
        font-size: 18px !important;
        color: #ffffff !important;
        margin: 0 !important;
    }

    /* User Profile Button on Mobile */
    .topbar-user-btn,
    #page-header-user-dropdown {
        height: 38px !important;
        width: 38px !important;
        min-width: 38px !important;
        max-width: 38px !important;
        padding: 0 !important;
        margin: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 10px !important;
        border: 1px solid var(--theme-border, #e2e8f0) !important;
        background-color: var(--theme-bg-light, #f8fafc) !important;
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }

    .topbar-user-btn .avatar-xs,
    #page-header-user-dropdown .avatar-xs {
        height: 28px !important;
        width: 28px !important;
        margin: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .topbar-user-btn .avatar-title,
    #page-header-user-dropdown .avatar-title {
        font-size: 12px !important;
        border-radius: 8px !important;
    }

    [data-bs-theme="dark"] .topbar-user-btn,
    [data-bs-theme="dark"] #page-header-user-dropdown {
        background-color: #273147 !important;
        border-color: #334155 !important;
    }

    /* Dropdown Menus Responsiveness & Viewport Protection */
    #page-topbar .dropdown-menu {
        position: absolute !important;
        top: 100% !important;
        margin-top: 8px !important;
        border-radius: 14px !important;
        border: 1px solid var(--theme-border, #e2e8f0) !important;
        box-shadow: 0 14px 35px rgba(15, 23, 42, 0.18) !important;
        max-width: calc(100vw - 20px) !important;
        z-index: 1005 !important;
    }

    [data-bs-theme="dark"] #page-topbar .dropdown-menu {
        background-color: #232c3f !important;
        border-color: #334155 !important;
        box-shadow: 0 14px 35px rgba(0, 0, 0, 0.45) !important;
    }

    #page-topbar .dropdown-menu-end {
        right: auto !important;
        left: 0 !important;
    }

    [dir="rtl"] #page-topbar .dropdown-menu-end {
        right: auto !important;
        left: 8px !important;
    }

    #page-topbar .dropdown-menu-lg {
        width: calc(100vw - 24px) !important;
        max-width: 360px !important;
    }

    .page-content {
        padding-top: calc(64px + 1rem) !important;
    }
}

/* Extra Small Mobile Screens (<= 400px) */
@media (max-width: 400px) {
    #page-topbar .navbar-header {
        padding: 0 6px !important;
    }

    .topbar-right-side {
        gap: 3px !important;
    }

    .topbar-icon-btn,
    #page-topbar .header-item.noti-icon,
    .topbar-branch-btn,
    #page-header-branch-dropdown,
    .topbar-user-btn,
    #page-header-user-dropdown,
    .topbar-left-side .vertical-menu-btn {
        height: 35px !important;
        width: 35px !important;
        min-width: 35px !important;
        max-width: 35px !important;
        border-radius: 8px !important;
    }

    .topbar-icon-btn i,
    #page-topbar .header-item.noti-icon i,
    .topbar-branch-btn i,
    #page-header-branch-dropdown i {
        font-size: 16px !important;
    }

    .topbar-user-btn .avatar-xs,
    #page-header-user-dropdown .avatar-xs {
        height: 24px !important;
        width: 24px !important;
    }

    .topbar-left-side .navbar-brand-box .logo img {
        max-height: 36px !important;
    }
}

/* ==========================================================================
   DEMO USERS & TEST MODE WIDGET (وضع العرض والتجربة)
   ========================================================================== */

/* Floating Launcher Pill */
.demo-testmode-launcher {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 9998;
    cursor: pointer;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s ease;
    animation: demoLauncherPulse 3s infinite;
}

.demo-testmode-launcher:hover {
    transform: translateY(-3px) scale(1.03);
}

.demo-testmode-pill {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #f8fafc;
    border: 1px solid rgba(245, 158, 11, 0.4);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 0 15px rgba(245, 158, 11, 0.2);
    border-radius: 50rem;
    padding: 9px 18px;
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    user-select: none;
}

[data-bs-theme="dark"] .demo-testmode-pill,
body.dark-mode .demo-testmode-pill {
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    border-color: rgba(245, 158, 11, 0.6);
}

@keyframes demoLauncherPulse {
    0%, 100% {
        box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 0 10px rgba(245, 158, 11, 0.2);
    }
    50% {
        box-shadow: 0 12px 30px -5px rgba(0, 0, 0, 0.4), 0 0 22px rgba(245, 158, 11, 0.45);
    }
}

/* Modal / Offcanvas Drawer */
.demo-accounts-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.demo-accounts-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.demo-accounts-dialog {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    width: 100%;
    max-width: 960px;
    max-height: 88vh;
    background: var(--theme-bg-card, #ffffff);
    border: 1px solid var(--theme-border, #e2e8f0);
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -15px 40px rgba(0, 0, 0, 0.25);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.demo-accounts-backdrop.active .demo-accounts-dialog {
    transform: translateX(-50%) translateY(0);
}

.demo-accounts-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--theme-border, #e2e8f0);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--theme-bg-light, #f8fafc);
}

.demo-accounts-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}

/* Demo User Card */
.demo-user-card {
    background: var(--theme-bg-card, #ffffff);
    border: 1px solid var(--theme-border, #e2e8f0);
    border-radius: 14px;
    padding: 14px 16px;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.demo-user-card:hover {
    border-color: var(--brand-primary, #5b73e8);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

.demo-user-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.demo-user-credentials {
    background: var(--theme-bg-light, #f1f5f9);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 12px;
    font-family: monospace;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    margin-bottom: 10px;
}

/* Login Page Embedded Demo Section */
.demo-login-embed {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 16px;
    padding: 16px;
    margin-top: 20px;
}

[data-bs-theme="dark"] .demo-login-embed,
body.dark-mode .demo-login-embed {
    background: rgba(30, 41, 59, 0.5);
    border-color: #334155;
}

/* ==========================================================================
   SANDBOX TOPBAR GLOWING BUTTON ANIMATION
   ========================================================================== */
@keyframes sandboxGlowPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(13, 202, 240, 0.7), 0 2px 8px rgba(0, 0, 0, 0.15);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 16px 4px rgba(13, 202, 240, 0.45), 0 4px 12px rgba(0, 0, 0, 0.2);
        transform: scale(1.02);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(13, 202, 240, 0.7), 0 2px 8px rgba(0, 0, 0, 0.15);
        transform: scale(1);
    }
}

.topbar-sandbox-glow-btn {
    animation: sandboxGlowPulse 2.5s infinite ease-in-out;
    background: #0ea5e9 !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    transition: all 0.25s ease;
}

.topbar-sandbox-glow-btn:hover {
    animation: none;
    transform: translateY(-1px) scale(1.03);
    background: #0284c7 !important;
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.4) !important;
}


