.topbar {
    position: fixed;
    inset: 0 0 auto var(--hms-sidebar-width);
    z-index: 1500;
    display: flex;
    height: var(--hms-topbar-height);
    align-items: center;
    justify-content: flex-start;
    gap: 18px;
    padding: 0 28px;
    overflow: visible;
    border-bottom: 1px solid var(--hms-border);
    background: rgba(255,255,255,.98);
}

.sidebar.collapsed ~ .main-wrapper .topbar {
    left: var(--hms-sidebar-rail);
}

.topbar-left,
.topbar-right {
    display: flex;
    min-width: 0;
    align-items: center;
}

.topbar-left {
    flex: 1 1 auto;
    gap: 18px;
}

.topbar-right {
    flex: 0 0 auto;
    margin-left: 10px;
    gap: 8px;
}

.topbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--hms-ink);
    font-size: 18px;
    font-weight: 750;
    text-decoration: none;
    white-space: nowrap;
}

.topbar-brand-mark {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.sidebar-toggle-btn {
    display: inline-flex;
    width: 34px;
    height: 34px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border: 1px solid var(--hms-border);
    border-radius: 7px;
    background: #fff;
    cursor: pointer;
    margin-left:10px;
}

    .sidebar-toggle-btn span {
        width: 14px;
        height: 2px;
        border-radius: 2px;
        background: #708090;
    }

    .sidebar-toggle-btn:hover {
        border-color: #c9c4ff;
        background: #f7f6ff;
    }

.page-info {
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
}

    .page-title,
    .page-info h3 {
        max-width: 48vw;
        margin: 0;
        overflow: hidden;
        color: var(--hms-ink);
        font-size: 17px;
        font-weight: 750;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

.breadcrumb {
    display: flex;
    margin: 4px 0 0;
    padding: 0;
    font-size: 12px;
    line-height: 1.2;
}

.breadcrumb-item,
.breadcrumb-item a {
    color: var(--hms-muted);
}

    .breadcrumb-item.active {
        color: var(--hms-primary);
    }

.quick-btn,
.top-icon,
.profile-menu {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--hms-border);
    border-radius: 7px;
    background: #fff;
    color: var(--hms-ink);
    cursor: pointer;
}

.quick-btn {
    gap: 7px;
    padding: 0 16px;
    border-color: var(--hms-primary);
    background: var(--hms-primary);
    color: #fff;
    font-size: 13px;
    font-weight: 650;
}

    .quick-btn:hover {
        background: #4039aa;
    }

    .quick-btn .mdi {
        font-size: 17px;
    }

.top-icon {
    position: relative;
    width: 36px;
    color: var(--hms-muted);
}

    .top-icon .mdi {
        font-size: 18px;
    }

    .top-icon:hover,
    .profile-menu:hover {
        border-color: #c9c4ff;
        background: #f7f6ff;
    }

.notify-badge {
    position: absolute;
    top: 3px;
    right: 3px;
    display: flex;
    min-width: 15px;
    height: 15px;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border-radius: 50%;
    background: #d64545;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
}

.profile-wrapper {
    position: relative;
    z-index: 4000;
}

.profile-menu {
    gap: 8px;
    padding: 0 8px;
}

.profile-img {
    width: 28px;
    height: 28px;
    border: 1px solid #d8ddea;
    border-radius: 50%;
    object-fit: cover;
}

.profile-info {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    text-align: left;
}

    .profile-info strong {
        color: var(--hms-ink);
        font-size: 12px;
    }

    .profile-info small {
        display: none;
    }

.profile-arrow {
    color: var(--hms-muted);
    font-size: 16px;
    transition: transform .15s ease;
}

    .profile-arrow.rotate {
        transform: rotate(180deg);
    }

.profile-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    z-index: 4100;
    right: 0;
    width: 230px;
    overflow: visible;
    border: 1px solid var(--hms-border);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 16px 34px rgba(32, 48, 64, .16);
}

.dropdown-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px;
    border-bottom: 1px solid #edf0f4;
}

.dropdown-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
}

.profile-dropdown .dropdown-menu {
    position: static;
    display: block;
    float: none;
    min-width: 0;
    margin: 0;
    padding: 6px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    list-style: none;
}

    .profile-dropdown .dropdown-menu li {
        display: flex;
        min-height: 38px;
        align-items: center;
        gap: 10px;
        padding: 0 12px;
        border-radius: 6px;
        color: #526477;
        cursor: pointer;
        font-size: 13px;
        font-weight: 600;
        transition: background .15s ease, color .15s ease;
    }

        .profile-dropdown .dropdown-menu li:hover {
            background: #f5f6ff;
            color: var(--hms-primary);
        }

        .profile-dropdown .dropdown-menu li .mdi {
            width: 18px;
            display: inline-flex;
            justify-content: center;
            color: var(--hms-muted);
            font-size: 17px;
            flex-shrink: 0;
            transition: color .15s ease;
        }

        .profile-dropdown .dropdown-menu li:hover .mdi {
            color: var(--hms-primary);
        }

        .profile-dropdown .dropdown-menu li span {
            flex: 1;
            white-space: nowrap;
        }

        .profile-dropdown .dropdown-menu li.logout {
            margin-top: 6px;
            padding-top: 6px;
            border-top: 1px solid #edf0f4;
            border-radius: 6px;
            color: #b42318;
        }

            .profile-dropdown .dropdown-menu li.logout .mdi {
                color: #b42318;
            }

            .profile-dropdown .dropdown-menu li.logout:hover {
                background: #fef2f2;
                color: #b91c1c;
            }

                .profile-dropdown .dropdown-menu li.logout:hover .mdi {
                    color: #b91c1c;
                }

.dropdown-menu li.logout .mdi {
    color: #b42318;
}

.dropdown-menu li.logout:hover {
    background: #fef2f2;
}

@media (max-width: 992px) {
    .topbar {
        left: 0 !important;
        padding: 0 16px 0 62px;
    }

    .topbar-brand {
        display: none;
    }

    .page-title,
    .page-info h3 {
        max-width: 42vw;
        font-size: 15px;
    }

    .profile-info {
        display: none;
    }

    .quick-btn {
        width: 36px;
        padding: 0;
    }

        .quick-btn span {
            display: none;
        }
}

@media (max-width: 576px) {
    .topbar {
        height: 60px;
        padding-right: 12px;
    }

    .breadcrumb {
        display: none;
    }

    .page-title,
    .page-info h3 {
        max-width: 48vw;
    }
}
