/* Logo sizing */
.navbar-brand img {
    max-height: 30px !important;
    width: auto !important;
}

/* Dropdown width utilities */
.width-300 {
    width: 300px !important;
    min-width: 300px !important;
}

/* Ensure dropdown menus maintain proper width */
.dropdown-menu.width-300 {
    max-width: 95vw;
}

/* Responsive dropdown width on small screens */
@media (max-width: 575.98px) {
    .dropdown-menu.width-300 {
        width: calc(100vw - 2rem) !important;
        min-width: 280px !important;
        max-width: 320px !important;
    }
    
    .dropdown-menu.sm-mi-45px {
        margin-inline-start: -45px !important;
    }
}

/* Fix dropdown positioning and prevent collapse */
.dropdown-menu {
    white-space: normal;
}

.dropdown-menu .row {
    margin-left: 0;
    margin-right: 0;
}

/* Prevent dropdown items from breaking layout */
.dropdown-item {
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Fix square-item grid layout in dropdowns */
.dropdown-menu .square-item {
    padding: 0.5rem;
    text-align: center;
    display: block;
}

.dropdown-menu .square-item .avatar {
    margin-left: auto;
    margin-right: auto;
}

/* Ensure proper grid layout for quick functions */
.dropdown-menu .row.gx-2 {
    --bs-gutter-x: 0.5rem;
}

.dropdown-menu .row.gy-2 {
    --bs-gutter-y: 0.5rem;
}

/* Prevent text wrapping issues in dropdown headers */
.dropdown-dontclose {
    cursor: default;
}

.dropdown-dontclose p {
    word-break: normal;
    overflow-wrap: normal;
}

/* Fix profile dropdown layout */
.dropdown-menu .col-auto {
    flex: 0 0 auto;
    width: auto;
}

/* Ensure dropdown content doesn't overflow */
.dropdown-menu .px-2 {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
}

.dropdown-menu .px-3 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}

/* Fix grid columns in dropdown to maintain proper width */
.dropdown-menu .col-4 {
    flex: 0 0 auto;
    width: 33.333333%;
}

.dropdown-menu .col-6 {
    flex: 0 0 auto;
    width: 50%;
}

.dropdown-menu .col-auto {
    flex: 0 0 auto;
    width: auto;
}

.dropdown-menu .col {
    flex: 1 0 0%;
}

/* Ensure text in quick function items doesn't break layout */
.dropdown-menu .square-item p {
    font-size: 0.875rem;
    line-height: 1.2;
    margin-top: 0.25rem;
}

/* Fix avatar sizing in dropdowns */
.dropdown-menu .avatar-40 {
    width: 40px;
    height: 40px;
}

.dropdown-menu .avatar-50 {
    width: 50px;
    height: 50px;
}

.dropdown-menu .avatar-28 {
    width: 28px;
    height: 28px;
}

.dropdown-menu .avatar-18 {
    width: 18px;
    height: 18px;
}