.topbar {
    min-height: var(--erp-topbar);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.65rem 1.75rem;
    background: var(--erp-topbar-bg);
    border-bottom: 1px solid var(--erp-border);
    box-shadow: var(--erp-shadow-sm);
    z-index: 1030;
    transition: background-color 200ms ease, border-color 200ms ease;
}

.topbar-left,
.topbar-center,
.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.topbar-left .topbar-toggle,
.topbar-theme,
#fullscreenToggle,
#notificationToggle {
    border-radius: 8px;
    background: var(--erp-surface-alt);
    border: 1px solid var(--erp-border);
    color: var(--erp-text-secondary);
    transition: all var(--erp-transition);
}

.topbar-left .topbar-toggle:hover,
.topbar-theme:hover,
#fullscreenToggle:hover,
#notificationToggle:hover {
    color: var(--erp-primary);
    background: var(--erp-surface);
    border-color: var(--erp-primary);
}

.topbar-center {
    flex: 1;
    justify-content: center;
}

.topbar-search {
    flex: 1;
    max-width: 360px;
    min-width: 180px;
    position: relative;
}

.topbar-search i {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--erp-muted);
    font-size: 0.88rem;
    pointer-events: none;
}

.topbar-search .form-control {
    padding-left: 2.35rem;
    padding-right: 1rem;
    border-radius: 8px;
    background: var(--erp-surface-alt);
    border: 1px solid var(--erp-border);
    color: var(--erp-text);
    font-size: 0.88rem;
    min-height: 38px;
    transition: all var(--erp-transition);
}

.topbar-search .form-control::placeholder {
    color: var(--erp-muted);
}

.topbar-search .form-control:focus {
    background: var(--erp-surface-alt);
    color: var(--erp-text);
    border-color: var(--erp-primary);
    box-shadow: 0 0 0 3px var(--erp-primary-subtle);
}

.context-select {
    flex: 0 1 155px;
    max-width: 165px;
    min-width: 130px;
    min-height: 38px;
    font-size: 0.84rem;
    font-weight: 500;
    border-radius: 8px;
    background-color: var(--erp-surface-alt);
    border: 1px solid var(--erp-border);
    color: var(--erp-text);
}

.context-select:focus {
    background-color: var(--erp-surface-alt);
    color: var(--erp-text);
    border-color: var(--erp-primary);
    box-shadow: 0 0 0 3px var(--erp-primary-subtle);
}

.notification-dot {
    position: absolute;
    right: 7px;
    top: 7px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--erp-danger);
    box-shadow: 0 0 0 2px var(--erp-topbar-bg);
}

.badge-counter {
    position: absolute;
    top: -4px;
    right: -4px;
    font-size: 0.65rem;
    padding: 0.2rem 0.4rem;
    border-radius: 999px;
    border: 2px solid var(--erp-topbar-bg);
}

.notification-menu {
    width: min(380px, 94vw);
    border: 1px solid var(--erp-border);
    border-radius: 14px;
    background: var(--erp-card);
    box-shadow: var(--erp-shadow-lg);
    overflow: hidden;
    margin-top: 0.5rem;
}

.notification-header {
    padding: 0.85rem 1rem;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--erp-text);
    border-bottom: 1px solid var(--erp-border);
    background: var(--erp-surface-2);
}

.notification-header a {
    color: var(--erp-primary);
}

.notification-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-top: 1px solid var(--erp-border-subtle);
    cursor: pointer;
    transition: background var(--erp-transition);
}

.notification-item:hover {
    background: var(--erp-surface-2);
}

.notification-item.unread {
    background: var(--erp-primary-subtle);
}

.notification-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    font-size: 0.9rem;
}

.notification-item strong {
    display: block;
    color: var(--erp-text);
    font-size: 0.84rem;
    line-height: 1.3;
}

.notification-item p {
    color: var(--erp-text-secondary);
    font-size: 0.8rem;
    margin: 0.15rem 0;
    line-height: 1.3;
}

.notification-item small {
    color: var(--erp-muted);
    font-size: 0.74rem;
}

.notification-footer {
    padding: 0.65rem;
    border-top: 1px solid var(--erp-border);
    background: var(--erp-surface-2);
}

.profile-btn {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    border: 1px solid var(--erp-border);
    background: var(--erp-surface-alt);
    border-radius: 8px;
    padding: 0.35rem 0.65rem 0.35rem 0.4rem;
    color: var(--erp-text);
    transition: all var(--erp-transition);
}

.profile-btn:hover,
.profile-btn[aria-expanded="true"] {
    background: var(--erp-surface-2);
    border-color: var(--erp-primary);
}

.avatar-ring {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: var(--erp-primary-gradient);
    color: #0B1324;
    font-weight: 800;
    font-size: 0.88rem;
    flex-shrink: 0;
}

.profile-copy {
    text-align: left;
    line-height: 1.2;
}

.profile-copy strong {
    display: block;
    font-size: 0.84rem;
    color: var(--erp-text);
    font-weight: 600;
}

.profile-copy small {
    display: block;
    font-size: 0.74rem;
    color: var(--erp-muted);
}

.profile-btn i {
    color: var(--erp-muted);
}

.profile-menu {
    border: 1px solid var(--erp-border);
    border-radius: 12px;
    background: var(--erp-card);
    box-shadow: var(--erp-shadow-lg);
    min-width: 210px;
    margin-top: 0.5rem;
    padding: 0.4rem;
}

.profile-menu .dropdown-header {
    padding: 0.5rem 0.75rem;
    color: var(--erp-muted);
    font-size: 0.78rem;
    border-bottom: 1px solid var(--erp-border-subtle);
    margin-bottom: 0.25rem;
}

.profile-menu .dropdown-header strong {
    color: var(--erp-text);
}

.profile-menu .dropdown-item {
    border-radius: 8px;
    padding: 0.48rem 0.75rem;
    font-size: 0.86rem;
    font-weight: 500;
    color: var(--erp-text-secondary);
}

.profile-menu .dropdown-item:hover {
    background: var(--erp-surface-2);
    color: var(--erp-text);
}

.profile-menu .dropdown-item i {
    color: var(--erp-primary);
}

.profile-menu .dropdown-item.text-danger {
    color: var(--erp-danger) !important;
}

.profile-menu .dropdown-item.text-danger i {
    color: var(--erp-danger) !important;
}

.profile-menu .dropdown-item.text-danger:hover {
    background: var(--erp-danger-subtle);
    color: var(--erp-danger) !important;
}

.quick-action-btn {
    background: var(--erp-primary-gradient) !important;
    color: #FFFFFF !important;
    font-weight: 600;
    border: none !important;
    box-shadow: 0 4px 14px var(--erp-primary-subtle);
    transition: all var(--erp-transition);
}

.quick-action-btn:hover {
    box-shadow: 0 6px 20px var(--erp-primary-subtle);
    transform: translateY(-1px);
    color: #FFFFFF !important;
}