/* General Header Styles */
.header {
    position: relative;
    padding: 0 1.5625rem 0 0;
    height: 80px;
    width: 100%;
    background: #f1f1f5;
    display: flex;
    align-items: center;
}

/* Logo Styles */
.header .logo {
    background: #fff;
    max-width: 251px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: left;
}

.logo-image {
    width: 48%;
    height: 100%;
    object-fit: contain;
    padding-left: 11px;
    vertical-align: middle;
    border-style: none;
}


.header .logo a {
    text-decoration: none;
    display: flex;
    align-items: center;
}

.header .logo a span {
    font-size: 1.75rem;
    color: #717482;
    font-weight: 300;
    margin-left: 1.875rem;
    vertical-align: middle;
}

/* Dashboard Links & User Profile Section */
.header .dashboard-links {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: center;
    flex: 1;
    justify-content: flex-end;
}

.header .dashboard-links ul {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    list-style: none;
    padding: 0;
    margin: 0;
}

.header .dashboard-links ul li {
    position: relative;
}

.header .dashboard-links ul li:not(:last-child) {
    margin-right: 3.125rem;
}

.lang-selector {
    font-family: 'DroidArabicKufiRegular';
}

.header .dashboard-links ul li.user-profile:before {
    position: absolute;
    content: "";
    height: 46px;
    width: 1px;
    background: #dadce5;
    left: -24px;
}

.header .dashboard-links ul li.user-profile a {
    text-decoration: none;
    display: block;
}

.header .dashboard-links ul li.user-profile a img {
    vertical-align: bottom;
}

.header .dashboard-links ul li.user-profile a .user-name {
    display: inline-block;
    padding-left: 15px;
    color: #000;
    font-weight: 400;
    font-size: 1.125rem;
}

.header .dashboard-links ul li.user-profile a .user-name:hover {
    opacity: .8;
}

.header .dashboard-links ul li.user-profile a span {
    display: block;
    color: #158f7a;
    padding-bottom: 3px;
}

.header .dropdown .dropdown-menu {
    min-width: 100%;
    right: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    margin-top: 10px;
    box-shadow: 1px 1px 12px 1px rgba(53, 71, 153, 0.2);
}

.header .dropdown .dropdown-menu .dropdown-item {
    font-size: 1rem;
    padding: 10px;
    position: relative;
}

.header .dropdown .dropdown-menu .dropdown-item:hover:before {
    position: absolute;
    background-color: #158f7a;
    content: "";
    width: 3px;
    height: 100%;
    top: 0px;
    left: 0px;
}

.header .dropdown .dropdown-menu .dropdown-item:active {
    background-color: #158f7a;
    color: #fff;
}

.header .dropdown .dropdown-item:focus {
    background: transparent;
    color: #158f7a;
}

.header .dropdown-toggle::after {
    border: 0;
}

/* User Profile Dropdown Specifics */
.header .dropdown .profile-dropdown-menu {
    width: 190px;
    box-shadow: 2px 4px 10px 0px rgba(0, 0, 0, 0.3);
    transform: translate(10px, 50px) !important;
}

.header .dashboard-links ul li.user-profile .dropdown-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    font-size: 1.125rem;
    font-weight: 500;
    color: #000;
}

/* Space between icon and text */
.header .dashboard-links ul li.user-profile .dropdown-item img {
    margin-right: 10px;
    opacity: 0.4;
}

.header .dashboard-links ul li.user-profile .dropdown-item:after {
    display: inline-block;
    font-family: 'Material Icons';
    position: absolute;
    left: 10px;
    font-size: 24px;
    color: #a6abbf;
    top: 3px;
}

/* Responsive Styles */
@media screen and (max-width: 1200px) {
    .header .logo a span {
        font-size: 1.25rem;
    }

    .header .dashboard-links ul li.notification .dropdown .dropdown-menu {
        width: 250px;
    }
}

@media screen and (max-width: 991px) {
    .header .logo {
        width: 225px;
    }

    .header .dashboard-links ul li:not(:last-child) {
        margin-right: 20px;
    }

    .header .dashboard-links ul li.user-profile:before {
        left: -10px;
    }
}

@media screen and (max-width: 767px) {
    .header .logo {
        width: 66px !important;
    }

    .header .logo a {
        overflow: hidden;
    }

    .header .logo a span {
        display: none;
    }

    .header .dashboard-links ul li.user-profile:before {
        height: 35px;
    }

    .header .dashboard-links ul li.notification img {
        max-width: 18px;
    }

    .header .dashboard-links ul li.notification .badge {
        font-size: 0.75rem;
        width: 18px;
        height: 18px;
        line-height: 18px;
    }

}

@media screen and (max-width: 667px) {
    .header .dashboard-links ul li.user-profile:before {
        height: 35px;
    }

    .header .dashboard-links ul li:not(:last-child) {
        margin-right: 15px;
    }
}

@media screen and (max-width: 500px) {
    .header .lang-selector {
        font-size: 0.9375rem;
    }

    .header .dashboard-links ul li.user-profile a img {
        width: 30px;
        height: 30px;
    }

    .header .dashboard-links ul li.user-profile a .user-name {
        padding-left: .4rem;
        font-size: 0.9375rem;
    }

    .header .dashboard-links ul li:first-child {
        margin-right: 1.125rem;
    }

    .header .dashboard-links ul li.notification .dropdown .dropdown-menu {
        transform: translate3d(-21px, 17px, 0px) !important;
        width: 220px;
    }
}

@media screen and (max-width: 450px) {
    .header .dashboard-links ul li.user-profile:before {
        left: -13px;
        height: 35px;
    }

    .header .dashboard-links ul li.user-profile .dropdown .dropdown-menu {
        transform: translate3d(-60px, 30px, 0px) !important;
        right: auto;
    }

    .header .dashboard-links ul li.notification .dropdown .dropdown-menu {
        transform: translate3d(-140px, 17px, 0px) !important;
    }

    .header .dashboard-links ul li:not(:last-child) {
        margin-right: 10px;
    }
}

@media screen and (max-width: 414px) {
    .header {
        padding-right: 1.125rem;
    }

    .header .logo {
        width: 62px !important;
    }

    .header .dashboard-links ul li.user-profile {
        padding-top: 0.3125rem;
    }

    .header .dashboard-links ul li.user-profile a .user-name {
        display: none;
    }

    .header .dashboard-links ul li.user-profile:before {
        top: 50%;
        transform: translateY(-50%);
    }

    .header .dashboard-links ul li:not(:last-child) {
        margin-right: 8px;
    }
}

@media screen and (max-width: 350px) {
    .header .dashboard-links ul li:not(:last-child) {
        margin-right: 5px;
    }

    .header .lang-selector {
        font-size: 0.8rem;
    }
}

/* === RTL STYLES === */
/* --- General Header RTL --- */
[dir="rtl"] .header {
    padding: 0 0 0 1.5625rem;
}

/* --- Logo RTL --- */
[dir="rtl"] .header .logo {
    justify-content: right;
    padding-left: 0;
    padding-right: 10px;
    width: 20%;
}

[dir="rtl"] .header .logo a span {
    margin-left: 0;
    margin-right: 1.875rem;
}

/* --- Dashboard Links RTL --- */
[dir="rtl"] .header .dashboard-links ul li:not(:last-child) {
    margin-right: 0;
    margin-left: 3.125rem;
}

[dir="rtl"] .header .dashboard-links ul li.user-profile:before {
    left: auto;
    right: -24px;
}

[dir="rtl"] .header .dashboard-links ul li.user-profile a .user-name {
    padding-left: 0;
    padding-right: 15px;
}

/* --- Dropdown RTL --- */
/* MODIFIED: Added .header */
[dir="rtl"] .header .dropdown .dropdown-menu {
    right: auto;
    left: 0;
}

[dir="rtl"] .header .dropdown .dropdown-menu .dropdown-item:hover:before {
    left: auto;
    right: 0px;
}

[dir="rtl"] .header .dashboard-links ul li.user-profile .dropdown-item {
    padding-left: 10px;
}

[dir="rtl"] .header .dashboard-links ul li.user-profile .dropdown-item img {
    margin-right: 0;
    margin-left: 10px;
}

[dir="rtl"] .header .dashboard-links ul li.user-profile .dropdown-item:after {
    left: auto;
    right: 10px;
}

/* --- Responsive RTL Overrides --- */
@media screen and (max-width: 991px) {
    [dir="rtl"] .header .dashboard-links ul li:not(:last-child) {
        margin-right: 0;
        margin-left: 20px;
    }

    [dir="rtl"] .header .dashboard-links ul li.user-profile:before {
        left: auto;
        right: -10px;
    }
}

@media screen and (max-width: 667px) {
    [dir="rtl"] .header .dashboard-links ul li:not(:last-child) {
        margin-right: 0;
        margin-left: 15px;
    }
}

@media screen and (max-width: 500px) {
    [dir="rtl"] .header .dashboard-links ul li.user-profile a .user-name {
        padding-left: 0;
        padding-right: .4rem;
    }

    [dir="rtl"] .header .dashboard-links ul li:first-child {
        margin-right: 0;
        margin-left: 1.125rem;
    }
}

@media screen and (max-width: 450px) {
    [dir="rtl"] .header .dashboard-links ul li.user-profile:before {
        left: auto;
        right: -13px;
    }

    [dir="rtl"] .header .dashboard-links ul li.user-profile .dropdown .dropdown-menu {
        left: auto;
        right: -60px;
        transform: none !important;
    }

    [dir="rtl"] .header .dashboard-links ul li:not(:last-child) {
        margin-right: 0;
        margin-left: 10px;
    }
}

@media screen and (max-width: 414px) {
    [dir="rtl"] .header {
        padding-right: 0;
        padding-left: 1.125rem;
    }

    [dir="rtl"] .header .dashboard-links ul li:not(:last-child) {
        margin-right: 0;
        margin-left: 8px;
    }
}

@media screen and (max-width: 350px) {
    [dir="rtl"] .header .dashboard-links ul li:not(:last-child) {
        margin-right: 0;
        margin-left: 5px;
    }
}

.sidebar-collapsed .header .logo {
    overflow: hidden;
    max-width: 69px !important;
    justify-content: center;
    padding-left: 0;
}

.sidebar-collapsed .header .logo a span {
    font-size: 0px;
    height: 0px;
    display: none;
}

.sidebar-collapsed .logo-image {
    width: 173%;
    height: 100%;
    object-fit: contain;
    padding-left: 11px;
    vertical-align: middle;
    border-style: none;
}

/* Timezone selector wrapper */
.timezone-select-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Select2 inherits Bootstrap look */
.select2-container--default .select2-selection--single {
    height: auto !important;
    border: 1px solid #ced4da !important;
    border-radius: 0.375rem !important;
    background-color: #fff !important;
    padding: 0.25rem 0.75rem !important;
    font-size: 0.9rem !important;
    color: #212529 !important;
    min-width: 200px;
    max-width: 100%;
    transition: all 0.2s ease;
}

.select2-container--default .select2-selection--single:hover {
    border-color: #86b7fe !important;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15) !important;
}

/* Text alignment */
.select2-selection__rendered {
    line-height: 1.5 !important;
}

/* Search box styling */
.select2-search--dropdown .select2-search__field {
    border-radius: 0.375rem;
    border: 1px solid #ced4da;
    padding: 0.25rem 0.5rem;
    font-size: 0.9rem;
}

/* Dropdown option styling */
.select2-results__option {
    padding: 6px 10px;
    font-size: 0.9rem;
}

.select2-results__option--highlighted {
    background-color: #0d6efd !important;
    color: #fff !important;
}

/* Center the dropdown arrow */
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 100% !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    right: 8px !important;
    position: absolute !important;
    width: 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    pointer-events: none;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: #6c757d transparent transparent transparent !important;
    border-width: 5px 4px 0 4px !important;
}

/* Responsive design */
@media (max-width: 768px) {
    .dashboard-links ul {
        flex-wrap: wrap;
    }

    .timezone-select-wrapper {
        width: 100%;
        justify-content: flex-start;
    }

    .timezone-select {
        width: 100% !important;
    }

    .dashboard-links li {
        margin-left: 10px;
        margin-bottom: 10px;
    }
}